Deploying actions on google webhook on glitch - actions-on-google

I want to deploy this example on glitch. I've added package.js and index.js to my glitch project and built successfully.
However, the code is missing a section to listen for HTTPS requests. In most node.js/express webapps, there is code to indicate which paths trigger which functions, but this is missing from the example. Can you explain to me how it should work and why that part is missing from this example?

It's not clear what do you mean by "the code is missing a section to listen" as the only main feature of index.js is to listen to requests and return information.
I suggest you check index.js and make sure that you getting requests to your end point on glitch.
Also, it would be helpful if you can share your glitch project over here at SO so we could see what you are doing.
Btw, you might want to double check that you have all the packages
I also created this simple example on Glitch - It's returning the current bitcoin price. Feel free to remix it and use the code there for your own action.
Good luck!

The part that "listens to requests" is
// The Entry point to all our actions
const actionMap = new Map();
actionMap.set(ACTION_PRICE, priceHandler);
actionMap.set(ACTION_TOTAL, totalHandler);
actionMap.set(ACTION_BLOCK, blockCountHandler);
actionMap.set(ACTION_MARKET, marketCaptHandler);
actionMap.set(ACTION_INTERVAL, intervalHandler);
assistant.handleRequest(actionMap);
where each ACTION is an action(in an intent) in Dialogflow and the handler is the corresponding function in your code.
I'd recommend you take a look at
https://codelabs.developers.google.com/codelabs/assistant-codelab/index.html?index=..%2F..%2Findex#0
If you want a good example of an assistant app, though this uses firebase instead of glitch.

Related

Maneuver issues in Turn By Turn Navigation with HERE maps in Flutter

Thanks in advance.
We have to use HERE map's Turn by turn navigation feature in one of our Flutter application, we have added billing in the developer account and have created the necessary keys.
When we try HERE map examples they have provided, we get everything except maneuver instructions that shows the user when to turn right/left/go straight for some distance etc.
I'm new to this and I have no idea how to get this, we never get events on the listener and it only shows updating there, am I missing something ?
this is how it looks right now, Updating...
I think we should be getting the progress here, but we are not getting it here...
_visualNavigator.routeProgressListener = Navigation.RouteProgressListener((routeProgress) { }
Please look into the provided example app. It shows here how to get the maneuver actions.
Your screenshot shows a different app, so make sure everything works with the example app, at first. The app offers to run a simulation mode. This should work. If you run the example app with real GPS updates, you may need to go outside and move to get location updates. This should also work.
If this still does not work, it could either mean that your device has an issue with getting GPS locations. Some iPads, for example, lack support. Or that you have disabled getting location updates. You can cross-check this when trying the positioning_app example from the same repository that shows how to get location updates.
A last point may be to clarify what events you get and what you miss: There are multiple event listeners providing real-time information during guidance - if you have only an issue with maneuvers, then most likely you can solve your issue by following strictly the code of the example app.
Note that previous HERE SDK versions, prior to HERE SDK 4.13.0, only provided empty maneuver instruction texts during guidance when they have been taken from the route instance. Make sure to take this information from the VisualNavigator instead.

Bit.cloud not showing my components tests

Bit.cloud is not showing my tests, but they are right there, and they show when running bit start locally. Sadly, the link on the no tests page directing me to learn how to add tests goes to a 404.
I the workspace is public, have a look and see here, the first link the is "tests" tab showing empty, https://bit.cloud/koodoo/koomeleon/second-charge/validation/~tests, and this link is a test for the the same component https://bit.cloud/koodoo/koomeleon/second-charge/validation/~code/eligibility/dateOfBirth/index.test.ts.
Also, side note, can I get an invite to the Slack workspace please? Again the link on the bit.cloud page goes to a sign-in page for the workspace bit-dev-community, but there is no way of registering or requesting an invite.
Please and thank you in advanced.
Explanation
The reason your tests are not being show is due to its extension.
Tests are configured to use the .spec.ts extension to work.
Solution
Having said so, rename your test to:
vaidation.spec.tsx
and it will work.
edit: forgot to add the 'x' at the end of '.tsx'

Setting a value in Frappe application isn't reflected in ERPNext GUI

I have added a 'number_of_members' value to the Customer DocType via customization.
In my application I have tried several ways to update the value. However the value never updates in the webpage. I feel like I'm missing some sort of save or update or commit step.
For example I have tried:
frappe.client.set_value('Customer', '00042', 'number_of_members', 8887)
frappe.set_value('Customer', '00042', 'number_of_members', 8887)
frappe.db.set_value('Customer', '00042', 'number_of_members', 8887)
and also
customer = frappe.get_doc('Customer', '00042')
customer.number_of_members = 8887
customer.save()
In each case I can do something like frappe.get_value, or frappe.get_doc and it shows the value is set to 8887. However it never updates in the web side. This is what makes me think I'm updating some sort of cache or database transaction and I need some way to save it, but have not had any luck.
I am mostly testing this via bench console if that has any bearing on it, but I've tried a couple of the methods in my application code as well.
Relevant documentation:
Frappe Developer API - Document
Frappe Developer API - Database
Turns out the answer is to call frappe.db.commit() after making changes. If someone can point this out in the documentation so I can better understand how I'm missing stuff, I would appreciate it.
I also noticed if you try to Save something in the UI before you send frappe.db.commit() the UI will hang.

Publishing actions on google failed with unclear message

Every time I try to publish my actions on google for alpha release it denies the request with this unclear error message:
For en: Your sample invocations are structured incorrectly. Make sure they all start with a trigger phrase, include either your app name or pronunciation, and successfully invoke your app.
My trigger phrases all passes the invocation page rules and it works fine in the simulator. this is my invocation phrase
Talk to Doctor Electronics
Any one has a clue?
It sounds like it is talking about the sample invocations configuration, which is in the Directory information page of the console for your Action under the Details section. Make sure these phrases are correctly structured and make sense for your action.

Manatee.Trello: Webhook Code Sample

I am looking for a code sample on how to use Manatee.Trello Webhook feature.
I found some documentation here: https://bitbucket.org/gregsdennis/manatee.trello/wiki/Webhooks, but it's not clear enough for me.
It only demonstrates how to create a Webhook, but doesn't demonstrate how the real-time updates are received and processed. Tried the Updated event on the Webhook, Card and Actions - but clearly I am not doing something correctly.
Any help would be appreciated.
This article demonstrates webhooks in general:
https://blogs.msdn.microsoft.com/webdev/2015/09/04/introducing-microsoft-asp-net-webhooks-preview/
Basically, there is a NuGet package Microsoft.AspNet.WebHooks.Receivers.Trello that you can install that does all the heavy lifting.
Once the NuGet package is installed I can override the built-in Controller and use Webhook.ProcessNotification() as Greg Dennis had suggested.
Hope someone out there finds this useful.
You'll need to set up the web portion yourself. This can be done with an ApiController (or others).
Once you receive a POST message, read the content as a string (don't deserialize), and pass that to Webhook.ProcessNotification(). Manatee.Trello well take care of the rest.
This will trigger the Updated events.
EDIT
I have created some better docs. Here is the example you seek!
https://gregsdennis.github.io/Manatee.Trello/examples/webhook.html#processing-a-webhook-notification