-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix intent examples in docs #65
Conversation
9ede6da
to
ee2606a
Compare
|
||
### Find applications that can start a chat | ||
```javascript | ||
const intentApps = await fdc3.findIntent("StartChat"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The findIntents
call returns an object, not the actual apps :
// I know 'StartChat' exists as a concept, and want to know more about it ...
const appIntent = await agent.findIntent("StartChat");
// returns a single AppIntent:
// {
// intent: { name: "StartChat", displayName: "Chat" },
// apps: [{ name: "Skype" }, { name: "Symphony" }, { name: "Slack" }]
// }
// raise the intent against a particular app
await agent.raiseIntent(appIntent.intent.name, context, appIntent.apps[0].name);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, but this isn't the API docs, I wanted to be concise and unspecific and get the idea across of what it turns. Do you think I should change it? It could still be an object with that name in my example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool - just checking.
|
||
### Find available intents for a contact | ||
```javascript | ||
const intentsAndApps = await fdc3.findIntentsByContext({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, but I noticed that the example in the api docs for findIntentsByContext
says findIntentsForContext
- we need to change that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I noticed the same while doing this and then promptly forgot to change it! Will update the PR...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do that on a separate commit if you like
* new schema structure quicktypeUtils update npm scripts update * PR feedback * cleanup * typos * fix type generation folder * Fixed schema structures * copy schemas to website * package json update * removed defunct file * make sources optional * cleanup * Update schemas/bridging/raiseIntentResultResponse.schema.json Co-authored-by: Kris West <kris@cosaic.io> * cleanup * regenerated types * PR feedback * Fixe meta for requests * Apply suggestions from code review * Regenerating bridging typescript * Apply suggestions from code review * adjust OptionalFeatures and IntentResult schemas --------- Co-authored-by: Kris West <kris@cosaic.io>
Fix #63 by using correct intent APIs