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

498 Allow intents to be resolved on output type (where they return data) #499

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
167a7d4
Merge branch '432-return-data-from-an-intent' into 498-resolve-intent…
kriswest Nov 12, 2021
85619ec
Add suport for metadata on output types for intent to appD and the fi…
kriswest Nov 12, 2021
0adfd83
changelog
kriswest Nov 12, 2021
bd97624
WIP
kriswest Nov 18, 2021
ea69042
WIP
kriswest Nov 18, 2021
22cd3be
Merge branch '432-return-data-from-an-intent' into 498-resolve-intent…
kriswest Nov 18, 2021
6d68022
Changing IntentResolution.getData() to IntentResolution.getResult()
kriswest Nov 18, 2021
bb1e120
Changing IntentResolution.getData() to IntentResolution.getResult()
kriswest Nov 18, 2021
e3a962e
WIP
kriswest Nov 18, 2021
240b424
WIP
kriswest Nov 19, 2021
9b0b3b4
completed draft of feeds
kriswest Nov 19, 2021
075067a
changelog
kriswest Nov 19, 2021
ea3e2eb
outputContext -> resultContext and other comments from review
kriswest Nov 22, 2021
157a46f
Mergeing updates from review of upstream PR
kriswest Nov 22, 2021
4c274a4
Apply suggestions from code review
kriswest Dec 13, 2021
461bf95
Merge branch 'master' into 498-resolve-intents-on-output-type
kriswest Jan 25, 2022
3fa81cb
Merge branch '498-resolve-intents-on-output-type' into 433-private-ch…
kriswest Jan 25, 2022
dbd3e81
Merge branch 'master' into 433-private-channels-returned-by-intents
kriswest Feb 4, 2022
ef1d315
Merge branch 'master' into 433-private-channels-returned-by-intents
kriswest Feb 21, 2022
6412fba
Removing defunct paragraph from docs/api/spec.md (bad merge)
kriswest Feb 21, 2022
1da923a
prettier
kriswest Feb 21, 2022
b88b4af
Update docs/api/ref/DesktopAgent.md
kriswest Feb 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into 498-resolve-intents-on-output-type
  • Loading branch information
kriswest authored Jan 25, 2022
commit 461bf95960a88a9bf3499a1c655231abf29f86cb
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
* Added advice on how to `broadcast` complex context types, composed of other types, so that other apps can listen for both the complex type and simpler constituent types ([#464](https://github.com/finos/FDC3/pull/464))
* Added the ability to return data from an intent, via the addition of an IntentHandler type and a `getResult()` to IntentResolution, both of which return a Promise of a Context object. ([#495](https://github.com/finos/FDC3/pull/495))
* Added a field to specify the Context type that intent can return to the AppD Application schema and extended the findIntent API calls to be able to use it for resolution. ([#499](https://github.com/finos/FDC3/pull/499))
* Added a References and Bibliography section to the Standard's documentation to hold links to 'normative references' and other documentation that is useful for understanding the standard ([#530](https://github.com/finos/FDC3/pull/530))
* `IntentResolution` now requires the name of the intent raised to included, allowing it to be used to determine the intent raised via `fdc3.raiseIntentForContext()`. ([#507](https://github.com/finos/FDC3/pull/507))
* A Trademarks page was added to acknowledge trademarks used within the Standard not owned by FINOS or the Linux Foundation ([#534](https://github.com/finos/FDC3/pull/534))
* Added details of FDC3's existing versioning and deprecation policies to the FDC3 compliance page ([#539](https://github.com/finos/FDC3/pull/539))

### Changed
* Consolidated `Listener` documentation with other types ([#404](https://github.com/finos/FDC3/pull/404))
* Updated definition of the `Position` context type to support negative (short) positions ([#419](https://github.com/finos/FDC3/pull/419))
Expand Down
4 changes: 2 additions & 2 deletions docs/api/ref/DesktopAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface DesktopAgent {
findIntentsByContext(context: Context, resultContextType?: string): Promise<Array<AppIntent>>;
raiseIntent(intent: string, context: Context, app?: TargetApp): Promise<IntentResolution>;
raiseIntentForContext(context: Context, app?: TargetApp): Promise<IntentResolution>;
addIntentListener(intent: string, handler: IntentHandler): Listener;
addIntentListener(intent: string, handler: IntentHandler): Promise<Listener>;

// channels
getOrCreateChannel(channelId: string): Promise<Channel>;
Expand Down Expand Up @@ -80,7 +80,7 @@ const contactListener = await fdc3.addContextListener('fdc3.contact', contact =>
### `addIntentListener`

```ts
addIntentListener(intent: string, handler: IntentHandler): Listener;
addIntentListener(intent: string, handler: IntentHandler): Promise<Listener>;
```
Adds a listener for incoming Intents from the Desktop Agent. The handler function may return void or a promise that resolves to a context object (data that should be returned to app that raised the intent).

Expand Down
6 changes: 6 additions & 0 deletions docs/api/ref/Metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,16 @@ The Interface used to describe an Intent within the platform.

```ts
interface IntentResolution {

/**
* The application that resolved the intent.
*/
readonly source: TargetApp;
/**
* The intent that was raised. May be used to determine which intent the user
* chose in response to `fdc3.raiseIntentForContext()`.
*/
readonly intent: string;
/**
* The version number of the Intents schema being used.
*/
Expand Down
7 changes: 6 additions & 1 deletion docs/api/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,15 @@ If the raising of the intent resolves (or rejects), a standard object will be pa

```ts
interface IntentResolution {
/**
/**
* The application that resolved the intent.
*/
readonly source: TargetApp;
/**
* The intent that was raised. May be used to determine which intent the user
* chose in response to `fdc3.raiseIntentForContext()`.
*/
readonly intent: string;
/**
* The version number of the Intents schema being used.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/api/DesktopAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export interface DesktopAgent {
* });
* ```
*/
addIntentListener(intent: string, handler: IntentHandler): Listener;
addIntentListener(intent: string, handler: IntentHandler): Promise<Listener>;

/**
* Adds a listener for incoming context broadcast from the Desktop Agent.
Expand Down
5 changes: 5 additions & 0 deletions src/api/IntentResolution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export interface IntentResolution {
* The application that resolved the intent.
*/
readonly source: TargetApp;
/**
* The intent that was raised. May be used to determine which intent the user
* chose in response to `fdc3.raiseIntentForContext()`.
*/
readonly intent: string;
/**
* The version number of the Intents schema being used.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/api/Methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export function raiseIntentForContext(context: Context, app?: TargetApp): Promis
return rejectIfNoGlobal(() => window.fdc3.raiseIntentForContext(context, app));
}

export function addIntentListener(intent: string, handler: IntentHandler): Listener {
return throwIfNoGlobal(() => window.fdc3.addIntentListener(intent, handler));
export function addIntentListener(intent: string, handler: IntentHandler): Promise<Listener> {
return rejectIfNoGlobal(() => window.fdc3.addIntentListener(intent, handler));
}

export function addContextListener(
Expand Down
2 changes: 1 addition & 1 deletion src/app-directory/specification/appd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ components:
items:
type: string
description: >-
A comma separated list of the types of contexts the intent offered by the application can process.
A comma separated list of the types of contexts the intent offered by the application can process,
where the first part of the context type is the namespace e.g."fdc3.contact, org.symphony.contact"
resultContext:
type: string
Expand Down
2 changes: 1 addition & 1 deletion website/static/schemas/next/app-directory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ components:
items:
type: string
description: >-
A comma separated list of the types of contexts the intent offered by the application can process.
A comma separated list of the types of contexts the intent offered by the application can process,
where the first part of the context type is the namespace e.g."fdc3.contact, org.symphony.contact"
resultContext:
type: string
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.