Skip to content
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

Merged
merged 1 commit into from
Mar 24, 2019

Conversation

rikoe
Copy link
Contributor

@rikoe rikoe commented Mar 22, 2019

Fix #63 by using correct intent APIs

Use correct examples for using intent APIs
@rikoe rikoe force-pushed the issue-63-fix-intent-examples branch from 9ede6da to ee2606a Compare March 22, 2019 17:44

### Find applications that can start a chat
```javascript
const intentApps = await fdc3.findIntent("StartChat");
Copy link
Contributor

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);

Copy link
Contributor Author

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.

Copy link
Contributor

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({
Copy link
Contributor

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.

Copy link
Contributor Author

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...

Copy link
Contributor

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

@rikoe rikoe merged commit b90877d into finos:master Mar 24, 2019
@rikoe rikoe deleted the issue-63-fix-intent-examples branch March 24, 2019 20:56
@rikoe rikoe added this to the 1.0 milestone Mar 25, 2019
kriswest added a commit that referenced this pull request Jul 26, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants