-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1252 from finos/1068-context-docs-generation
1068 context docs generation
- Loading branch information
Showing
60 changed files
with
5,113 additions
and
3,964 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/node_modules/ | ||
dist/ | ||
dist/ | ||
/website/schema2Markdown.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,91 @@ | ||
--- | ||
id: Action | ||
sidebar_label: Action | ||
title: Action | ||
hide_title: true | ||
sidebar_label: Action | ||
|
||
--- | ||
# `Action` | ||
|
||
# Action | ||
|
||
A representation of an FDC3 Action (specified via a Context or Context & Intent) that can be inserted inside another object, for example a chat message. | ||
|
||
The action may be completed by calling `fdc3.raiseIntent()` with the specified Intent and Context, or, if only a context is specified, by calling `fdc3.raiseIntentForContext()` (which the Desktop Agent will resolve by presenting the user with a list of available Intents for the Context). | ||
|
||
Accepts an optional `app` parameter in order to specify a specific app. | ||
|
||
## Schema | ||
|
||
<https://fdc3.finos.org/schemas/next/context/action.schema.json> ([github](https://github.com/finos/FDC3/tree/main/schemas/context/action.schema.json)) | ||
|
||
## Type | ||
|
||
`fdc3.action` | ||
|
||
## Schema | ||
## Properties | ||
|
||
<https://fdc3.finos.org/schemas/next/context/action.schema.json> | ||
<details> | ||
<summary><code>title</code> <strong>(required)</strong></summary> | ||
|
||
## Details | ||
**type**: `string` | ||
|
||
| Property | Type | Required | Example Value | | ||
|-------------------|-------------------------------------------|----------|-------------------------| | ||
| `type` | string | Yes | `'fdc3.action'` | | ||
| `title` | string | Yes | `'Click to view Chart'` | | ||
| `intent` | string | No | `'ViewChart'` | | ||
| `context` | string | Yes | See Below | | ||
| `app` | object | No | `'myApp'` | | ||
| `app.appId` | string | Yes | `'app1'` | | ||
| `app.instanceId` | string | No | `'instance1'` | | ||
A human readable display name for the action | ||
|
||
## Example | ||
</details> | ||
|
||
```js | ||
const action = { | ||
type: 'fdc3.action', | ||
title: 'Click to view Chart', | ||
intent: 'ViewChart', | ||
context { | ||
type: 'fdc3.chart', | ||
instruments: [ | ||
{ | ||
type: 'fdc3.instrument', | ||
id: { | ||
ticker: 'EURUSD' | ||
} | ||
} | ||
], | ||
range: { | ||
type: 'fdc3.dateRange', | ||
starttime: '2020-09-01T08:00:00.000Z', | ||
endtime: '2020-10-31T08:00:00.000Z' | ||
}, | ||
style: 'candle' | ||
}, | ||
app { | ||
appId: 'MyChartViewingApp', | ||
instanceId: 'instance1' | ||
} | ||
} | ||
``` | ||
<details> | ||
<summary><code>intent</code></summary> | ||
|
||
**type**: `string` | ||
|
||
## See Also | ||
Optional Intent to raise to perform the actions. Should reference an intent type name, such as those defined in the FDC3 Standard. If intent is not set then `fdc3.raiseIntentForContext` should be used to perform the action as this will usually allow the user to choose the intent to raise. | ||
|
||
Other Types | ||
</details> | ||
|
||
- [Message](Message) | ||
<details> | ||
<summary><code>context</code> <strong>(required)</strong></summary> | ||
|
||
Intents | ||
**type**: [Context](/docs/next/context/spec#the-context-interface) | ||
|
||
A context object with which the action will be performed | ||
|
||
</details> | ||
|
||
<details> | ||
<summary><code>app</code></summary> | ||
|
||
**type**: api/AppIdentifier | ||
|
||
An optional target application identifier that should perform the action | ||
|
||
</details> | ||
|
||
## Example | ||
|
||
```json | ||
{ | ||
"type": "fdc3.action", | ||
"title": "Click to view Chart", | ||
"intent": "ViewChart", | ||
"context": { | ||
"type": "fdc3.chart", | ||
"instruments": [ | ||
{ | ||
"type": "fdc3.instrument", | ||
"id": { | ||
"ticker": "EURUSD" | ||
} | ||
} | ||
], | ||
"range": { | ||
"type": "fdc3.dateRange", | ||
"starttime": "2020-09-01T08:00:00.000Z", | ||
"endtime": "2020-10-31T08:00:00.000Z" | ||
}, | ||
"style": "candle" | ||
}, | ||
"app": { | ||
"appId": "MyChartViewingApp", | ||
"instanceId": "instance1" | ||
} | ||
} | ||
``` | ||
|
||
- [StartChat](../../intents/ref/StartChat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: BaseContext | ||
sidebar_label: BaseContext | ||
|
||
--- | ||
|
||
# BaseContext | ||
|
||
## Schema | ||
|
||
<https://github.com/finos/FDC3/tree/main/schemas/context/context.schema.json> | ||
|
||
## Type | ||
|
||
`undefined` | ||
|
||
## Properties | ||
|
||
<details> | ||
<summary><code>name</code></summary> | ||
|
||
**type**: `string` | ||
|
||
</details> | ||
|
||
<details> | ||
<summary><code>id</code></summary> | ||
|
||
**type**: `object` | ||
|
||
</details> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,133 @@ | ||
--- | ||
id: Chart | ||
sidebar_label: Chart | ||
title: Chart | ||
hide_title: true | ||
sidebar_label: Chart | ||
|
||
--- | ||
# `Chart` | ||
|
||
# Chart | ||
|
||
A context type representing details of a Chart, which may be used to request plotting of a particular chart or to otherwise share details of its composition, such as: | ||
|
||
- A list of instruments for comparison | ||
- The time period to plot the chart over | ||
- The style of chart (line, bar, mountain, candle etc.) | ||
- Other settings such as indicators to calculate, or data representing drawings and annotations | ||
- Other settings such as indicators to calculate, or data representing drawings and annotations. | ||
|
||
In addition to handling requests to plot charts, a charting application may use this type to output a representation of what it is currently displaying so that it can be recorded by another application. | ||
|
||
## Schema | ||
|
||
<https://fdc3.finos.org/schemas/next/context/chart.schema.json> ([github](https://github.com/finos/FDC3/tree/main/schemas/context/chart.schema.json)) | ||
|
||
## Type | ||
|
||
`fdc3.chart` | ||
|
||
## Schema | ||
## Properties | ||
|
||
<https://fdc3.finos.org/schemas/next/context/chart.schema.json> | ||
<details> | ||
<summary><code>instruments</code> <strong>(required)</strong></summary> | ||
|
||
## Details | ||
**type**: `array` | ||
|
||
| Property | Type | Required | Example Value | | ||
|------------------|-----------------|----------|----------------------| | ||
| `type` | string | Yes | `'fdc3.chart'` | | ||
| `instruments` | Instrument[] | Yes | <pre>[<br/>  {<br/>    "type": "fdc3.instrument",<br/>    "id": {<br/>      "ticker": "AAPL"<br/>    }<br/>  },<br/>  {<br/>    "type": "fdc3.instrument",<br/>    "id": {<br/>      "ticker": "MSFT"<br/>    }<br/>  }<br/>]</pre> | | ||
| `range` | TimeRange | No | <pre>{<br/>  "type": "fdc3.timeRange",<br/>  "startTime": "2022-03-30T15:44:44+00:00",<br/>  "endTime": "2022-04-30T23:59:59+00:00"<br/>}</pre> | | ||
| `style` | string | No | one of: `'line'`, `'bar'`, `'stacked-bar'`, `'mountain'`, `'candle'`, `'pie'`, `'scatter'`, `'histogram'`, `'heatmap'`, `'custom'` | | ||
| `otherConfig`* | array | No | `[ {/* additional config context objects */} ]` | | ||
<details> | ||
<summary><code>Items</code></summary> | ||
|
||
::: info | ||
**type**: [Instrument](Instrument) | ||
|
||
It is common for charts to support other configuration, such as indicators, annotations etc., which do not have standardized formats, but may be included in the `otherConfig` array as context objects. | ||
</details> | ||
|
||
::: | ||
An array of instrument contexts whose data should be plotted. | ||
|
||
## Example | ||
</details> | ||
|
||
```js | ||
const chart = { | ||
type: "fdc3.chart", | ||
instruments: [ | ||
{ | ||
type: "fdc3.instrument", | ||
id: { | ||
ticker: "AAPL" | ||
} | ||
}, | ||
{ | ||
type: "fdc3.instrument", | ||
id: { | ||
ticker: "GOOG" | ||
} | ||
} | ||
], | ||
range: { | ||
type: "fdc3.timeRange", | ||
startTime: "2020-09-01T08:00:00.000Z", | ||
endTime: "2020-10-31T08:00:00.000Z" | ||
}, | ||
style: "line", | ||
otherConfig: [ | ||
{ | ||
type: "somevendor.someproduct.indicator", | ||
name: "stddev", | ||
parameters: { | ||
period: 10, | ||
matype: "exponential" | ||
} | ||
}, | ||
{ | ||
type: "someothervendor.someotherproduct.formula", | ||
formula: "standard-deviation", | ||
fields: { | ||
lookback: 10, | ||
type: "ema" | ||
} | ||
} | ||
] | ||
}; | ||
|
||
fdc3.raiseIntent("ViewChart", chart); | ||
``` | ||
<details> | ||
<summary><code>range</code></summary> | ||
|
||
**type**: [TimeRange](TimeRange) | ||
|
||
The time range that should be plotted | ||
|
||
</details> | ||
|
||
## See Also | ||
<details> | ||
<summary><code>style</code></summary> | ||
|
||
Other Types | ||
**type**: `string` with values: | ||
- `line`, | ||
- `bar`, | ||
- `stacked-bar`, | ||
- `mountain`, | ||
- `candle`, | ||
- `pie`, | ||
- `scatter`, | ||
- `histogram`, | ||
- `heatmap`, | ||
- `custom` | ||
|
||
- [Instrument](Instrument) | ||
- [TimeRange](TimeRange) | ||
The type of chart that should be plotted | ||
|
||
Intents | ||
</details> | ||
|
||
<details> | ||
<summary><code>otherConfig</code></summary> | ||
|
||
**type**: `array` | ||
|
||
<details> | ||
<summary><code>Items</code></summary> | ||
|
||
**type**: [Context](/docs/next/context/spec#the-context-interface) | ||
|
||
</details> | ||
|
||
It is common for charts to support other configuration, such as indicators, annotations etc., which do not have standardized formats, but may be included in the `otherConfig` array as context objects. | ||
|
||
</details> | ||
|
||
## Example | ||
|
||
```json | ||
{ | ||
"type": "fdc3.chart", | ||
"instruments": [ | ||
{ | ||
"type": "fdc3.instrument", | ||
"id": { | ||
"ticker": "AAPL" | ||
} | ||
}, | ||
{ | ||
"type": "fdc3.instrument", | ||
"id": { | ||
"ticker": "GOOG" | ||
} | ||
} | ||
], | ||
"range": { | ||
"type": "fdc3.timeRange", | ||
"startTime": "2020-09-01T08:00:00.000Z", | ||
"endTime": "2020-10-31T08:00:00.000Z" | ||
}, | ||
"style": "line", | ||
"otherConfig": [ | ||
{ | ||
"type": "somevendor.someproduct.indicator", | ||
"name": "stddev", | ||
"parameters": { | ||
"period": 10, | ||
"matype": "exponential" | ||
} | ||
}, | ||
{ | ||
"type": "someothervendor.someotherproduct.formula", | ||
"formula": "standard-deviation", | ||
"fields": { | ||
"lookback": 10, | ||
"type": "ema" | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
- [ViewChart](../../intents/ref/ViewChart) |
Oops, something went wrong.