Permalink
Browse files

feat: clarified the target property is an app identifier

  • Loading branch information...
ColinEberhardt committed Jun 1, 2018
1 parent eac0696 commit 4632932bd9ff14393e9c4e3a38429b480c8924ad
@@ -6,6 +6,14 @@ API Working Group repository.

See the [specification draft](/Specification-Draft.MD) for the current working documentation, and the [FDC3 Confluence page](https://finosfoundation.atlassian.net/wiki/spaces/FDC3) for further information.

### Development

```
yarn install
```

When making changes to the TypeScript interfaces, run `yarn test` to ensure there are no syntax errors, and `yarn run doc` to regenerate the documentation.

## Index

### External modules
@@ -21,7 +21,7 @@

**AppNotFound**: = "AppNotFound"

*Defined in interface.ts:5*
*Defined in [interface.ts:6](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L6)*

___
<a id="apptimeout"></a>
@@ -30,7 +30,7 @@ ___

**AppTimeout**: = "AppTimeout"

*Defined in interface.ts:7*
*Defined in [interface.ts:8](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L8)*

___
<a id="erroronlaunch"></a>
@@ -39,7 +39,7 @@ ___

**ErrorOnLaunch**: = "ErrorOnLaunch"

*Defined in interface.ts:6*
*Defined in [interface.ts:7](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L7)*

___
<a id="resolverunavailable"></a>
@@ -48,7 +48,7 @@ ___

**ResolverUnavailable**: = "ResolverUnavailable"

*Defined in interface.ts:8*
*Defined in [interface.ts:9](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L9)*

___

@@ -20,7 +20,7 @@

**NoAppsFound**: = "NoAppsFound"

*Defined in interface.ts:12*
*Defined in [interface.ts:13](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L13)*

___
<a id="resolvertimeout"></a>
@@ -29,7 +29,7 @@ ___

**ResolverTimeout**: = "ResolverTimeout"

*Defined in interface.ts:14*
*Defined in [interface.ts:15](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L15)*

___
<a id="resolverunavailable"></a>
@@ -38,7 +38,7 @@ ___

**ResolverUnavailable**: = "ResolverUnavailable"

*Defined in interface.ts:13*
*Defined in [interface.ts:14](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L14)*

___

@@ -22,9 +22,9 @@ App metadata is Desktop Agent specific - but should support a name property.

### name

**● name**: *`String`*
**● name**: *[AppIdentifier](../modules/_interface_.md#appidentifier)*

*Defined in interface.ts:36*
*Defined in [interface.ts:41](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L41)*

___

@@ -29,9 +29,9 @@ A Desktop Agent can be connected to one or more App Directories and will use dir

### broadcast

**broadcast**(context: *[Context](../modules/_interface_.md#context)*): `any`
**broadcast**(context: *[Context](../modules/_interface_.md#context)*): `void`

*Defined in interface.ts:75*
*Defined in [interface.ts:80](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L80)*

Publishes context to other apps on the desktop.

@@ -41,7 +41,7 @@ Publishes context to other apps on the desktop.
| ------ | ------ |
| context | [Context](../modules/_interface_.md#context) |

**Returns:** `any`
**Returns:** `void`

___
<a id="contextlistener"></a>
@@ -50,7 +50,7 @@ ___

**contextListener**(handler: *`function`*): [Listener](_interface_.listener.md)

*Defined in interface.ts:90*
*Defined in [interface.ts:95](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L95)*

Listens to incoming context broadcast from the Desktop Agent.

@@ -69,7 +69,7 @@ ___

**intent**(intent: *[IntentName](../modules/_interface_.md#intentname)*, context: *[Context](../modules/_interface_.md#context)*, target: *`String`*): [Intent](_interface_.intent.md)

*Defined in interface.ts:80*
*Defined in [interface.ts:85](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L85)*

Constructs a new intent

@@ -90,7 +90,7 @@ ___

**intentListener**(intent: *[IntentName](../modules/_interface_.md#intentname)*, handler: *`function`*): [Listener](_interface_.listener.md)

*Defined in interface.ts:85*
*Defined in [interface.ts:90](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L90)*

Listens to incoming Intents from the Agent.

@@ -110,7 +110,7 @@ ___

**open**(name: *`String`*, context: *[Context](../modules/_interface_.md#context)*): `Promise`<`void`>

*Defined in interface.ts:61*
*Defined in [interface.ts:66](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L66)*

Launches/links to an app by name.

@@ -132,7 +132,7 @@ ___

**resolve**(intent: *[IntentName](../modules/_interface_.md#intentname)*, context: *[Context](../modules/_interface_.md#context)*): `Promise`<`Array`<[AppMetadata](_interface_.appmetadata.md)>>

*Defined in interface.ts:70*
*Defined in [interface.ts:75](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L75)*

Resolves a intent & context pair to a list of App names/metadata.

@@ -28,7 +28,7 @@

**● context**: *[Context](../modules/_interface_.md#context)*

*Defined in interface.ts:19*
*Defined in [interface.ts:20](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L20)*

___
<a id="intent"></a>
@@ -37,16 +37,18 @@ ___

**● intent**: *[IntentName](../modules/_interface_.md#intentname)*

*Defined in interface.ts:18*
*Defined in [interface.ts:19](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L19)*

___
<a id="target"></a>

### `<Optional>` target

**● target**: *`String`*
**● target**: *[AppIdentifier](../modules/_interface_.md#appidentifier)*

*Defined in interface.ts:20*
*Defined in [interface.ts:25](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L25)*

Name of app to target for the Intent. Use if creating an explicit intent that bypasses resolver and goes directly to an app.

___

@@ -56,9 +58,9 @@ ___

### send

**send**(context: *[Context](../modules/_interface_.md#context)*, target?: *`String`*): `Promise`<`void`>
**send**(context: *[Context](../modules/_interface_.md#context)*, target?: *[AppIdentifier](../modules/_interface_.md#appidentifier)*): `Promise`<`void`>

*Defined in interface.ts:29*
*Defined in [interface.ts:34](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L34)*

Dispatches the intent with the Desktop Agent.

@@ -69,7 +71,7 @@ Accepts context data and target (if an explicit Intent) as optional args. Return
| Param | Type |
| ------ | ------ |
| context | [Context](../modules/_interface_.md#context) |
| `Optional` target | `String` |
| `Optional` target | [AppIdentifier](../modules/_interface_.md#appidentifier) |

**Returns:** `Promise`<`void`>

@@ -22,7 +22,7 @@

**unsubscribe**(): `any`

*Defined in interface.ts:43*
*Defined in [interface.ts:48](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L48)*

Unsubscribe the listener object.

@@ -18,20 +18,30 @@

### Type aliases

* [AppIdentifier](_interface_.md#appidentifier)
* [Context](_interface_.md#context)
* [IntentName](_interface_.md#intentname)

---

## Type aliases

<a id="appidentifier"></a>

### AppIdentifier

**ΤAppIdentifier**: *`String`*

*Defined in [interface.ts:3](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L3)*

___
<a id="context"></a>

### Context

**ΤContext**: *`Object`*

*Defined in interface.ts:1*
*Defined in [interface.ts:1](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L1)*

___
<a id="intentname"></a>
@@ -40,7 +50,7 @@ ___

**ΤIntentName**: *`String`*

*Defined in interface.ts:2*
*Defined in [interface.ts:2](https://github.com/ColinEberhardt/API/blob/eac0696/src/interface.ts#L2)*

___

@@ -1,5 +1,6 @@
type Context = Object;
type IntentName = String;
type AppIdentifier = String;

enum OpenError {
AppNotFound = "AppNotFound",
@@ -17,7 +18,11 @@ enum ResolveError {
interface Intent {
intent: IntentName;
context: Context;
target?: String;
/**
* Name of app to target for the Intent. Use if creating an explicit intent
* that bypasses resolver and goes directly to an app.
*/
target?: AppIdentifier;

/**
* Dispatches the intent with the Desktop Agent.
@@ -26,14 +31,14 @@ interface Intent {
* Returns a Promise - resolving if the intent successfully results in launching an App.
* If the resolution errors, it returns an `Error` with a string from the `ResolveError` enumeration.
*/
send(context: Context, target?: String): Promise<void>
send(context: Context, target?: AppIdentifier): Promise<void>
}

/**
* App metadata is Desktop Agent specific - but should support a name property.
*/
interface AppMetadata {
name: String;
name: AppIdentifier;
}

interface Listener {

0 comments on commit 4632932

Please sign in to comment.