Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

[SERVICE-542] Refresh FDC3 API docs #120

Merged
merged 21 commits into from Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6d6e102
[SERVICE-543] Documentation, hiding some intents
Jul 9, 2019
9385644
fix conflicts
Jul 9, 2019
c18fb4c
fix refactoring bugs
Jul 9, 2019
a511c64
fixes for comments
Aug 9, 2019
af972b6
Merge branch 'develop' of https://github.com/HadoukenIO/fdc3-service …
Aug 14, 2019
fae58d1
More cleanup and comments
Aug 14, 2019
1bcc439
clean up the headers somewhat
Aug 14, 2019
59a9905
Merge branch 'develop' of https://github.com/hadoukenio/fdc3-service …
Aug 29, 2019
56a047a
I think this might be it
Sep 2, 2019
82aaf6b
Merge branch 'dev/tim/SERVICE-543-1' of https://github.com/tim-dinsda…
Sep 2, 2019
143a735
Merge branch 'develop' into dev/tim/SERVICE-543-1
pjbroadbent Oct 24, 2019
911206d
[SERVICE-542] Docs updates - whitespace tweaks, fixed module titles, …
pjbroadbent Oct 24, 2019
eb0cdd9
[SERVICE-543] Doc updates - general proof-reading, formatting tweaks,…
pjbroadbent Nov 4, 2019
5e5cf6f
[SERVICE-542] Added explicit Jest dependency to avoid test build issue
pjbroadbent Nov 5, 2019
197d799
[SERVICE-542] Made contexts and customConfig fields in intent definit…
pjbroadbent Nov 5, 2019
2d68276
[SERVICE-542] Minor tweaks to wording
pjbroadbent Nov 5, 2019
99946fb
Merge remote-tracking branch 'upstream/develop' into dev/tim/SERVICE-…
pjbroadbent Nov 5, 2019
46fb7ef
Merge remote-tracking branch 'upstream/develop' into dev/tim/SERVICE-…
pjbroadbent Nov 6, 2019
5ff1351
[SERVICE-542] Consistency changes, using 'handler' in place of 'callb…
pjbroadbent Nov 6, 2019
495a23b
[SERVICE-542] PR feedback - minor wording/grammar fixes.
pjbroadbent Nov 6, 2019
fe519ab
[SERVICE-542] PR feedback
pjbroadbent Nov 7, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 30 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 64 additions & 15 deletions src/client/context.ts
Expand Up @@ -5,25 +5,24 @@
/**
* TypeScript definitions for envelope and context objects.
bryangaleopenfin marked this conversation as resolved.
Show resolved Hide resolved
*
* These structures are defined by the Contexts FDC3 working group. he definitions here are based on current
* proposals and are not final. There may be minor differences between the current spec and the definitions here,
* in order to support this demo.
* These structures are defined by the Contexts FDC3 working group.
*/

/**
* General-purpose context type
*
* A context object is open for extension with any custom properties/metadata.
* General-purpose context type, as defined by [FDC3](https://fdc3.finos.org/docs/1.0/context-intro).
* A context object is a well-understood datum that is streamable between FDC3 participants. As a result
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "streamable" the right term here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serializable?..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shareable?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh

* it has a field describing what type it is, and data indicating its identity. Use this as a base
* to derive your own with any custom properties or metadata.
*/
export interface Context {
/**
* The type of the context that uniquely identifies it, e.g. "fdc3.instrument"
* Used to refer to the accepted context(s) when declaring intents.
* The type of the context that uniquely identifies it, e.g. "fdc3.instrument".
* This is used to refer to the accepted context(s) when declaring intents. See [[AppDirIntent]].
*/
type: string;

/**
* The name of the context data (optional).
* The name of the context data (optional). This is a text string that describes the data being sent.
* Implementors of context may choose to make the name mandatory.
*/
name?: string;
Expand All @@ -35,22 +34,72 @@ export interface Context {
id?: {[key: string]: string|undefined;};
tomrobertsOF marked this conversation as resolved.
Show resolved Hide resolved

/**
* A context object is open for extension with any custom properties/metadata.
* @hidden
* Custom properties and metadata. This can be extended in specific context object.
*/
[key: string]: unknown;
}

// Built-in contexts
/**
* Built-in context to define a contact.
*/
export interface ContactContext extends Context {
/**
* The context type is always 'fdc3.contact'.
*/
type: 'fdc3.contact';
/**
* Free text name of the contact.
*/
name: string;
/**
* The contact data. Can contain email address, Twitter handle, and phone number.
*/
id: {[key: string]: string}&{email?: string; twitter?: string; phone?: string};
pjbroadbent marked this conversation as resolved.
Show resolved Hide resolved
}
export interface SecurityContext extends Context {
type: 'fdc3.security';
id: {[key: string]: string}&{default: string};

/**
* Built-in context to define a financial instrument.
*/
export interface InstrumentContext extends Context {
tomrobertsOF marked this conversation as resolved.
Show resolved Hide resolved
/**
* The context type is always 'fdc3.instrument'.
*/
type: 'fdc3.instrument';
/**
* Optional free text name of the instrument.
*/
name?: string;
/**
* Can contain some or all of
* * a ticker,
* * an [ISIN](https://www.isin.org/isin/),
* * a [CUSIP](https://www.cusip.com/cusip/index.htm),
* * a [SEDOL](https://www.londonstockexchange.com/products-and-services/reference-data/sedol-master-file/sedol-master-file.htm),
* * a [Reuters Instrument Code (RIC)](https://en.wikipedia.org/wiki/Reuters_Instrument_Code),
* * a [Bloomberg Ticker](https://www.bloomberg.com/professional/product/market-data/),
* * a [PERMID](https://permid.org/),
* * and a [FIGI](https://www.openfigi.com/about/figi).
*/
id: {[key: string]: string}&{ticker?: string; ISIN?: string; CUSIP?: string; SEDOL?: string;
RIC?: string; BBG?: string; PERMID?: string; FIGI?: string;};
}

/**
* Built-in context to define an organization.
*/
export interface OrganizationContext extends Context {
/**
tomrobertsOF marked this conversation as resolved.
Show resolved Hide resolved
* The context type is always fdc3.organization.
*/
type: 'fdc3.organization';
id: {[key: string]: string}&{default: string};
/**
* Optional free text name of the organization.
*/
name?: string;
/**
* Can contain either or both an [LEI](https://www.gleif.org/en/about-lei/introducing-the-legal-entity-identifier-lei)
* and a [PERMID](https://permid.org/).
*/
id: {[key: string]: string}&{LEI?: string; PERMID?: string};
bryangaleopenfin marked this conversation as resolved.
Show resolved Hide resolved
}
12 changes: 6 additions & 6 deletions src/client/contextChannels.ts
Expand Up @@ -30,7 +30,7 @@ export type FDC3ChannelEvent = ChannelWindowAddedEvent | ChannelWindowRemovedEve
export type FDC3ChannelEventType = FDC3ChannelEvent['type'];

/**
* Event fired when a window is added to a channel. See {@link Channel.addEventListener}.
* Event fired when a window is added to a channel. See {@link ChannelBase.addEventListener}.
*
* Note that this event will typically fire as part of a pair - since windows must always belong to a channel, a window
* can only join a channel by leaving it's previous channel. The exceptions to this rule are when the window is created
bryangaleopenfin marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -47,7 +47,7 @@ export interface ChannelWindowAddedEvent {
identity: Identity;

/**
* The channel that window now belongs to. Will always be the channel object that {@link Channel.addEventListener} was
* The channel that window now belongs to. Will always be the channel object that {@link ChannelBase.addEventListener} was
* called on.
*/
channel: Channel;
Expand All @@ -61,7 +61,7 @@ export interface ChannelWindowAddedEvent {
}

/**
* Event fired when a window is removed from a channel. See {@link Channel.addEventListener}.
* Event fired when a window is removed from a channel. See {@link ChannelBase.addEventListener}.
*
* Note that this event will typically fire as part of a pair - since windows must always belong to a channel, a window
* can only join a channel by leaving it's previous channel. The exceptions to this rule are when the window is created
Expand All @@ -87,7 +87,7 @@ export interface ChannelWindowRemovedEvent {
channel: Channel | null;

/**
* The channel that the window belonged to previously. Will always be the channel object that {@link Channel.addEventListener} was
* The channel that the window belonged to previously. Will always be the channel object that {@link ChannelBase.addEventListener} was
* called on.
*/
previousChannel: Channel;
Expand Down Expand Up @@ -335,7 +335,7 @@ export class DesktopChannel extends ChannelBase {
public readonly color: number;
pjbroadbent marked this conversation as resolved.
Show resolved Hide resolved

/**
* @hidden
* @hideconstructor
pjbroadbent marked this conversation as resolved.
Show resolved Hide resolved
*/
public constructor(transport: DesktopChannelTransport) {
super(transport.id, 'desktop');
Expand All @@ -355,7 +355,7 @@ export class DefaultChannel extends ChannelBase {
public readonly type!: 'default';

/**
* @hidden
* @hideconstructor
*/
public constructor() {
super(DEFAULT_CHANNEL_ID, 'default');
Expand Down