Skip to content

Commit

Permalink
Merge branch 'master' into remove_chat_message_string
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick-Malins authored Dec 13, 2023
2 parents a710850 + 3e7a652 commit c555f13
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 73 deletions.
55 changes: 34 additions & 21 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,38 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: [18.16.x]
node: [20]
os: [ubuntu-latest, windows-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Install dependencies
uses: bahmutov/npm-install@c5482d70ec8706408996e31ac94075030694993f #v1.8.32
uses: bahmutov/npm-install@2509f13e8485d88340a789a3f7ca11aaac47c9fc #v1.8.36

- name: Lint
run: yarn lint
run: npm run lint

- name: Test
run: yarn test --ci --coverage --maxWorkers=2
run: npm run test --ci --coverage --maxWorkers=2

- name: Build
run: yarn build
run: npm run build

pacakge-publish:
package-publish:
if: ${{ github.event_name == 'push' }}
needs: package-build
name: Publish package to ${{ matrix.name }}
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
matrix:
include:
Expand All @@ -68,30 +71,40 @@ jobs:
token-name: GITHUB_TOKEN
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Configure Node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 18.16.x
node-version: 20
registry-url: ${{ matrix.registry }}

- name: Check package version
id: check-version
uses: PostHog/check-package-version@adccce0ed9759513476413668bd2a5c995450bde #v2.0.0
uses: tehpsalmist/npm-publish-status-action@deb911186cfe5134094f49183364da10a986e4e7

- name: Package version info
run: |
echo "Committed version: ${{ steps.check-version.outputs.committed-version }}"
echo "Published version: ${{ steps.check-version.published-version }}"
echo "Is version new: ${{ steps.check-version.outputs.is-new-version }}"
# Disabled when switching from PostHog/check-package-version as the new lib
# just tells you if your version exists or not
# - name: Package version info
# run: |
# echo "Committed version: ${{ steps.check-version.outputs.committed-version }}"
# echo "Published version: ${{ steps.check-version.published-version }}"
# echo "Is version new: ${{ steps.check-version.outputs.is-new-version }}"

- name: Report already published status
if: steps.check-version.outputs.exists == '1'
run: 'echo "package version already exists on npm registry"'

- name: Report not yet published status
if: steps.check-version.outputs.exists == '1'
run: 'echo "package version does not exist on npm registry, publishing..."'

- name: Install dependencies
if: steps.check-version.outputs.is-new-version == 'true'
uses: bahmutov/npm-install@c5482d70ec8706408996e31ac94075030694993f #v1.8.32
if: steps.check-version.outputs.exists == '0'
uses: bahmutov/npm-install@2509f13e8485d88340a789a3f7ca11aaac47c9fc #v1.8.36

- name: Publish
if: steps.check-version.outputs.is-new-version == 'true'
run: yarn publish --access public
if: steps.check-version.outputs.exists == '0'
run: npm run publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets[matrix.token-name] }}
7 changes: 4 additions & 3 deletions docs/agent-bridging/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,9 @@ The DA must then respond to the `hello` message with a `handshake` request to th
},
/** The requested DA name */
requestedName: string,
/** The current state of the Desktop Agent's channels, excluding any private channels,
* as a mapping of channel id to an array of Context objects, most recent first.*/
/** The current state of the Desktop Agent's App and User channels (exclude any
* Private channels), as a mapping of channel id to an array of Context objects,
* one per type found in the channel, most recent first.*/
channelsState: Record<string, Context[]>
},
meta: {
Expand Down Expand Up @@ -330,7 +331,7 @@ Channels are the main stateful mechanism in the FDC3 that we have to consider. T

A key responsibility of the Desktop Agent Bridge is ensuring that the channel state of the connected agents is kept in-sync. To do so, the states must be synchronized whenever a new agent connects. Hence, the Bridge MUST process the `channelState` provided by the new agent in the `handshake` request, which MUST contain details of each known User Channel or App Channel and its state (the most recent context object and the most recent context object of each type that it has received). The bridge MUST compare the received channel names and states to its own representation of the current state of channels in connected agents, merge that state with that of the new agent and communicate the updated state to all connected agents to ensure that they are synchronized with it.

Hence, if we assume that the state of each channel can be represented by an ordered array of context objects (most recent first - noting that only the first position, that of the most recent context broadcast, matters), the Desktop Agent Bridge MUST merge the incoming `channelsState` with the `existingChannelsState` as follows:
Hence, if we assume that the state of each channel can be represented by an array of the most recent context object of each type, with the most recent context occupying the first position in the array, the Desktop Agent Bridge MUST merge the incoming `channelsState` with the `existingChannelsState` as follows:

```typescript
Object.keys(channelsState).forEach((channelId) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/api/ref/DesktopAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ addContextListener(contextType: string | null, handler: ContextHandler): Promise

Adds a listener for incoming context broadcasts from the Desktop Agent (via a User channel or [`fdc3.open`](#open) API call). If the consumer is only interested in a context of a particular type, they can specify that type. If the consumer is able to receive context of any type or will inspect types received, then they can pass `null` as the `contextType` parameter to receive all context types.

Context broadcasts are primarily received from apps that are joined to the same User Channel as the listening application, hence, if the application is not currently joined to a User Channel no broadcasts will be received from channels. If this function is called after the app has already joined a channel and the channel already contains context that would be passed to the context listener, then it will be called immediately with that context.
Context broadcasts are primarily received from apps that are joined to the same User Channel as the listening application, hence, if the application is not currently joined to a User Channel no broadcasts will be received from User channels. If this function is called after the app has already joined a channel and the channel already contains context that matches the type of the context listener, then it will be called immediately and the context passed to the handler function. If `null` was passed as the context type for the listener and the channel contains context, then the handler function will be called immediately with the most recent context - regardless of type.

Context may also be received via this listener if the application was launched via a call to [`fdc3.open`](#open), where context was passed as an argument. In order to receive this, applications SHOULD add their context listener as quickly as possible after launch, or an error MAY be returned to the caller and the context may not be delivered. The exact timeout used is set by the Desktop Agent implementation, but MUST be at least 15 seconds.

Expand Down
64 changes: 32 additions & 32 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"build": "tsdx build",
"test": "tsdx test --verbose",
"lint": "tsdx lint src/api test",
"disabled-preprepare": "npm run typegen && npm run typegen-bridging",
"preprepare": "npm run typegen && npm run typegen-bridging",
"prepare": "tsdx build",
"typegen": "node s2tQuicktypeUtil.js schemas/context src/context/ContextTypes.ts && tsdx lint src/context/ --fix",
"typegen-bridging": "node s2tQuicktypeUtil.js schemas/api schemas/bridging schemas/context/context.schema.json src/bridging/BridgingTypes.ts && tsdx lint src/bridging/ --fix"
Expand All @@ -48,7 +48,7 @@
"devDependencies": {
"husky": "^4.3.0",
"jest-mock-extended": "^1.0.13",
"quicktype": "23.0.75",
"quicktype": "23.0.78",
"tsdx": "^0.14.1",
"tslib": "^2.0.1",
"typescript": "^4.0.3"
Expand Down
2 changes: 1 addition & 1 deletion schemas/bridging/connectionStep3Handshake.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"channelsState": {
"title": "Channel State",
"type": "object",
"description": "The current state of the Desktop Agent's channels, excluding any private channels, as a mapping of channel id to an array of Context objects, most recent first.",
"description": "The current state of the Desktop Agent's App and User channels (exclude any Private channels), as a mapping of channel id to an array of Context objects, one per type found in the channel, most recent first.",
"additionalProperties": {
"title": "Channel ",
"type": "array",
Expand Down
2 changes: 0 additions & 2 deletions src/app-directory/specification/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const exampleApplication2 = require('../examples/application/fdc3-workbench.json
console.log('Setting up the validator...');
const v = new Validator();


console.log('\nValidating the first example: myApplication.json');
const validatorResult1 = v.validate(exampleApplication1, applicationSchema);

Expand All @@ -35,7 +34,6 @@ const exampleApplication2 = require('../examples/application/fdc3-workbench.json
);

console.log('Successfully validated the specification and the second example application definition!');

} catch (error) {
console.log(error.message || error);
}
Expand Down
5 changes: 3 additions & 2 deletions src/bridging/BridgingTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,9 @@ export interface ConnectionStep3HandshakeMeta {
export interface ConnectionStep3HandshakePayload {
authToken?: string;
/**
* The current state of the Desktop Agent's channels, excluding any private channels, as a
* mapping of channel id to an array of Context objects, most recent first.
* The current state of the Desktop Agent's App and User channels (exclude any Private
* channels), as a mapping of channel id to an array of Context objects, one per type found
* in the channel, most recent first.
*/
channelsState: { [key: string]: ContextElement[] };
/**
Expand Down
17 changes: 13 additions & 4 deletions website/data/community.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "examples-and-training",
"badges": [
],
"description": "<p>This entry-level course is designed for business technologists who are looking to adopt application interoperability within their technology landscape and for developers who want to build interoperable applications using the FDC3 Standard.</p>"
"description": "<p>This <strong>FREE</strong> entry-level course is designed for business technologists who are looking to adopt application interoperability within their technology landscape and for developers who want to build interoperable applications using the FDC3 Standard.</p>"
},
{
"title": "Developing Solutions with FDC3 (LFD237)",
Expand All @@ -17,7 +17,7 @@
"type": "examples-and-training",
"badges": [
],
"description": "<p>This course is designed for developers who are looking to build interoperable applications using the FDC3 standard, as well as community participants who provide FDC3 technology and services.</p>"
"description": "<p>This course is designed for developers who are looking to build interoperable applications using the FDC3 standard, as well as community participants who provide FDC3 technology and services.</p><p>LFD237 is priced at $299 but free seats are available to FINOS members.</p>"
},
{
"title": "FDC3 Certified Practitioner (FCFP)",
Expand All @@ -27,7 +27,7 @@
"type": "examples-and-training",
"badges": [
],
"description": "<p>The FCFP is a professional certification designed for technical business analysts, software developers and FDC3 implementers in the finance, insurance, banking, and investment industries.</p>"
"description": "<p>The FCFP is a professional certification designed for technical business analysts, software developers and FDC3 implementers in the finance, insurance, banking, and investment industries.</p><p>FCFP is priced at $250 but free seats are available to FINOS members.</p>"
},
{
"title": "ChartIQ",
Expand Down Expand Up @@ -198,7 +198,16 @@
"link": "https://www.finos.org/blog/fdc3-news-march-2023"
}
]
}
},
{
"src": "/img/community/certified-2.0.png",
"items": [
{
"text": "OpenFin - 32.114.76.14 Certified Conformant With FDC3 2.0 Specification on 19th October 2023",
"link": "https://www.finos.org/press/finos-announces-fdc3-2.1"
}
]
}
]
},
{
Expand Down
Loading

0 comments on commit c555f13

Please sign in to comment.