From 48b37c19a4a569031d7f02c2b1c1fbdb82d5d32d Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 11:28:12 +0100 Subject: [PATCH 01/16] Moving da-server and demo, adding schemas to fdc3-schema --- package.json | 4 ++-- packages/client/tsconfig.json | 2 +- packages/fdc3-schema/package.json | 8 ++++---- packages/fdc3-schema/tsconfig.json | 1 + packages/testing/src/steps/generic.steps.ts | 5 +++-- .../fdc3-for-web}/da-server/cucumber.yml | 0 .../fdc3-for-web}/da-server/package.json | 2 +- .../fdc3-for-web}/da-server/src/BasicFDC3Server.ts | 0 .../fdc3-for-web}/da-server/src/FDC3Server.ts | 0 .../fdc3-for-web}/da-server/src/ServerContext.ts | 0 .../da-server/src/directory/BasicDirectory.ts | 0 .../da-server/src/directory/DirectoryInterface.ts | 0 .../da-server/src/handlers/BroadcastHandler.ts | 0 .../da-server/src/handlers/IntentHandler.ts | 0 .../da-server/src/handlers/OpenHandler.ts | 0 .../fdc3-for-web}/da-server/src/handlers/support.ts | 0 .../fdc3-for-web}/da-server/src/index.ts | 0 .../da-server/test/features/apps.feature | 0 .../da-server/test/features/broadcast.feature | 0 .../da-server/test/features/find-intent.feature | 0 .../da-server/test/features/intent-result.feature | 0 .../da-server/test/features/private-channel.feature | 0 .../test/features/raise-intent-with-context.feature | 0 .../da-server/test/features/raise-intent.feature | 0 .../da-server/test/features/user-channels.feature | 0 .../test/step-definitions/app-channel.steps.ts | 0 .../test/step-definitions/broadcast.steps.ts | 0 .../test/step-definitions/generic.steps.ts | 0 .../test/step-definitions/intents.steps.ts | 0 .../test/step-definitions/messaging.steps.ts | 0 .../test/step-definitions/private-channel.steps.ts | 0 .../test/step-definitions/start-app.steps.ts | 0 .../test/step-definitions/user-channel.steps.ts | 0 .../da-server/test/support/TestServerContext.ts | 0 .../fdc3-for-web}/da-server/test/world/index.ts | 0 .../fdc3-for-web}/da-server/tsconfig.json | 6 +++--- {packages => toolbox/fdc3-for-web}/demo/.gitignore | 0 .../fdc3-for-web}/demo/package.json | 0 .../fdc3-for-web}/demo/src/client/apps/ag-grid.css | 0 .../fdc3-for-web}/demo/src/client/apps/ag-grid.ts | 0 .../fdc3-for-web}/demo/src/client/apps/app1.ts | 0 .../fdc3-for-web}/demo/src/client/apps/app2.ts | 0 .../fdc3-for-web}/demo/src/client/apps/app3.ts | 0 .../fdc3-for-web}/demo/src/client/apps/app4.ts | 0 .../fdc3-for-web}/demo/src/client/apps/app5.ts | 0 .../fdc3-for-web}/demo/src/client/apps/app6.ts | 0 .../fdc3-for-web}/demo/src/client/apps/app7.ts | 0 .../fdc3-for-web}/demo/src/client/apps/chartiq.ts | 0 .../demo/src/client/da/DemoServerContext.ts | 0 .../demo/src/client/da/FDC3_2_1_JSONDirectory.ts | 0 .../demo/src/client/da/dummy-desktop-agent.ts | 0 .../fdc3-for-web}/demo/src/client/da/embed.ts | 0 .../fdc3-for-web}/demo/src/client/da/util.ts | 0 .../demo/src/client/tsconfig.json.unused | 0 .../demo/src/client/ui/channel-selector.ts | 0 .../demo/src/client/ui/intent-resolver.ts | 0 .../fdc3-for-web}/demo/src/client/vite-env.d.ts | 0 .../fdc3-for-web}/demo/src/message-types.ts | 0 .../fdc3-for-web}/demo/src/server/main.ts | 0 .../fdc3-for-web}/demo/static/ag-grid/index.html | 0 .../fdc3-for-web}/demo/static/app1/index.html | 0 .../fdc3-for-web}/demo/static/app2/index.html | 0 .../fdc3-for-web}/demo/static/app3/index.html | 0 .../fdc3-for-web}/demo/static/app4/index.html | 0 .../fdc3-for-web}/demo/static/app5/index.html | 0 .../fdc3-for-web}/demo/static/app6/index.html | 0 .../fdc3-for-web}/demo/static/app7/index.html | 0 .../demo/static/chartiq/css/chartiq.css | 0 .../demo/static/chartiq/css/chartiq.css.map | 0 .../demo/static/chartiq/css/font-awesome.css | 0 .../static/chartiq/css/img/ciq-done-edit-white.svg | 0 .../demo/static/chartiq/css/img/ciq-done-edit.svg | 0 .../demo/static/chartiq/css/img/ciq-save-white.svg | 0 .../demo/static/chartiq/css/img/ciq-save.svg | 0 .../demo/static/chartiq/css/img/closedhand.cur | Bin .../demo/static/chartiq/css/img/helicopter.png | Bin .../demo/static/chartiq/css/img/hu.svg | Bin .../demo/static/chartiq/css/img/languages.svg | 0 .../static/chartiq/css/img/loading-spin-white.svg | 0 .../demo/static/chartiq/css/img/loading-spin.svg | Bin .../static/chartiq/css/img/stx-sprite-markers.svg | Bin .../static/chartiq/css/img/stx-sprite-panels.png | Bin .../static/chartiq/css/img/stx-sprite-panels.svg | Bin .../demo/static/chartiq/css/img/stx-sprite-ui.svg | 0 .../demo/static/chartiq/css/normalize.css | 0 .../demo/static/chartiq/css/page-defaults.css | 0 .../demo/static/chartiq/css/perfect-scrollbar.css | 0 .../demo/static/chartiq/css/stx-chart.css | 0 .../static/chartiq/examples/data/STX_SAMPLE_5MIN.js | 0 .../chartiq/examples/data/STX_SAMPLE_DAILY.js | 0 .../examples/data/historicalComparisonData.js | 0 .../static/chartiq/examples/feeds/L2_simulator.js | 0 .../chartiq/examples/feeds/quoteFeedBarChart.js | 0 .../chartiq/examples/feeds/quoteFeedSimulator.js | 0 .../chartiq/examples/feeds/quoteFeedSunGard.js | 0 .../chartiq/examples/feeds/quoteFeedXignite.js | 0 .../chartiq/examples/feeds/symbolLookupChartIQ.js | 0 .../chartiq/examples/markets/exchangeHours.js | 0 .../examples/markets/marketDefinitionsSample.js | 0 .../examples/markets/marketSymbologySample.js | 0 .../static/chartiq/examples/templates/README.md | 0 .../templates/sample-template-advanced.html | 0 .../examples/templates/sample-template-basic.html | 0 .../examples/translations/translationSample.js | 0 .../fdc3-for-web}/demo/static/chartiq/index.html | 0 .../fdc3-for-web}/demo/static/chartiq/js/addOns.js | 0 .../demo/static/chartiq/js/chartiq-lite.js | 0 .../fdc3-for-web}/demo/static/chartiq/js/chartiq.js | 0 .../demo/static/chartiq/js/componentUI.js | 0 .../demo/static/chartiq/js/components.js | 0 .../demo/static/chartiq/js/extras/hlcbox.js | 0 .../demo/static/chartiq/js/extras/requestLimiter.js | 0 .../@webcomponents/custom-elements.min.js | 0 .../js/thirdparty/@webcomponents/native-shim.js | 0 .../js/thirdparty/@webcomponents/template.js | 0 .../static/chartiq/js/thirdparty/html2canvas.js | 0 .../demo/static/chartiq/js/thirdparty/intl.js | 0 .../static/chartiq/js/thirdparty/object-observe.js | 0 .../js/thirdparty/perfect-scrollbar.jquery.js | 0 .../static/chartiq/js/thirdparty/promise.min.js | 0 .../demo/static/chartiq/js/thirdparty/splines.js | 0 .../chartiq/js/thirdparty/webcomponents-lite.min.js | 0 .../fdc3-for-web}/demo/static/da/appd.json | 0 .../demo/static/da/channel-selector.html | 0 .../fdc3-for-web}/demo/static/da/corner.png | Bin .../fdc3-for-web}/demo/static/da/embed.html | 0 .../fdc3-for-web}/demo/static/da/index.html | 0 .../demo/static/da/intent-resolver.html | 0 .../demo/static/da/local-conformance-2_0.v2.json | 0 .../fdc3-for-web}/demo/static/da/nested.html | 0 .../demo/static/da/noun-mailbox-6010513.png | Bin .../fdc3-for-web}/demo/static/dnd/index.html | 0 .../fdc3-for-web}/demo/static/dnd/movable.html | 0 .../fdc3-for-web}/demo/static/embed/index.html | 0 .../fdc3-for-web}/demo/tsconfig.json | 4 ++-- 135 files changed, 17 insertions(+), 15 deletions(-) rename {packages => toolbox/fdc3-for-web}/da-server/cucumber.yml (100%) rename {packages => toolbox/fdc3-for-web}/da-server/package.json (89%) rename {packages => toolbox/fdc3-for-web}/da-server/src/BasicFDC3Server.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/src/FDC3Server.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/src/ServerContext.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/src/directory/BasicDirectory.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/src/directory/DirectoryInterface.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/src/handlers/BroadcastHandler.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/src/handlers/IntentHandler.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/src/handlers/OpenHandler.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/src/handlers/support.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/src/index.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/features/apps.feature (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/features/broadcast.feature (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/features/find-intent.feature (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/features/intent-result.feature (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/features/private-channel.feature (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/features/raise-intent-with-context.feature (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/features/raise-intent.feature (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/features/user-channels.feature (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/step-definitions/app-channel.steps.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/step-definitions/broadcast.steps.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/step-definitions/generic.steps.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/step-definitions/intents.steps.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/step-definitions/messaging.steps.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/step-definitions/private-channel.steps.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/step-definitions/start-app.steps.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/step-definitions/user-channel.steps.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/support/TestServerContext.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/test/world/index.ts (100%) rename {packages => toolbox/fdc3-for-web}/da-server/tsconfig.json (70%) rename {packages => toolbox/fdc3-for-web}/demo/.gitignore (100%) rename {packages => toolbox/fdc3-for-web}/demo/package.json (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/apps/ag-grid.css (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/apps/ag-grid.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/apps/app1.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/apps/app2.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/apps/app3.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/apps/app4.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/apps/app5.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/apps/app6.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/apps/app7.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/apps/chartiq.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/da/DemoServerContext.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/da/FDC3_2_1_JSONDirectory.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/da/dummy-desktop-agent.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/da/embed.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/da/util.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/tsconfig.json.unused (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/ui/channel-selector.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/ui/intent-resolver.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/client/vite-env.d.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/message-types.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/src/server/main.ts (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/ag-grid/index.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/app1/index.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/app2/index.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/app3/index.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/app4/index.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/app5/index.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/app6/index.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/app7/index.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/chartiq.css (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/chartiq.css.map (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/font-awesome.css (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/ciq-done-edit-white.svg (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/ciq-done-edit.svg (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/ciq-save-white.svg (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/ciq-save.svg (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/closedhand.cur (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/helicopter.png (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/hu.svg (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/languages.svg (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/loading-spin-white.svg (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/loading-spin.svg (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/stx-sprite-markers.svg (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/stx-sprite-panels.png (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/stx-sprite-panels.svg (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/img/stx-sprite-ui.svg (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/normalize.css (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/page-defaults.css (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/perfect-scrollbar.css (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/css/stx-chart.css (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/data/STX_SAMPLE_5MIN.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/data/STX_SAMPLE_DAILY.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/data/historicalComparisonData.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/feeds/L2_simulator.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/feeds/quoteFeedBarChart.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/feeds/quoteFeedSimulator.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/feeds/quoteFeedSunGard.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/feeds/quoteFeedXignite.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/feeds/symbolLookupChartIQ.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/markets/exchangeHours.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/markets/marketDefinitionsSample.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/markets/marketSymbologySample.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/templates/README.md (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/templates/sample-template-advanced.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/templates/sample-template-basic.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/examples/translations/translationSample.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/index.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/addOns.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/chartiq-lite.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/chartiq.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/componentUI.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/components.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/extras/hlcbox.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/extras/requestLimiter.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/thirdparty/@webcomponents/custom-elements.min.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/thirdparty/@webcomponents/native-shim.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/thirdparty/@webcomponents/template.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/thirdparty/html2canvas.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/thirdparty/intl.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/thirdparty/object-observe.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/thirdparty/perfect-scrollbar.jquery.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/thirdparty/promise.min.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/thirdparty/splines.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/chartiq/js/thirdparty/webcomponents-lite.min.js (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/da/appd.json (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/da/channel-selector.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/da/corner.png (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/da/embed.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/da/index.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/da/intent-resolver.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/da/local-conformance-2_0.v2.json (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/da/nested.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/da/noun-mailbox-6010513.png (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/dnd/index.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/dnd/movable.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/static/embed/index.html (100%) rename {packages => toolbox/fdc3-for-web}/demo/tsconfig.json (86%) diff --git a/package.json b/package.json index d3ab842a2..a4d2adf5a 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,9 @@ "packages/fdc3-core", "packages/testing", "packages/da-proxy", - "packages/da-server", + "toolbox/fdc3-for-web/da-server", "packages/client", - "packages/demo", + "toolbox/fdc3-for-web/demo", "toolbox/fdc3-workbench" ], "scripts": { diff --git a/packages/client/tsconfig.json b/packages/client/tsconfig.json index 2fa632ee8..924f412f7 100644 --- a/packages/client/tsconfig.json +++ b/packages/client/tsconfig.json @@ -21,7 +21,7 @@ "path": "../testing" }, { - "path": "../da-server" + "path": "../../toolbox/fdc3-for-web/da-server" } ] } \ No newline at end of file diff --git a/packages/fdc3-schema/package.json b/packages/fdc3-schema/package.json index 2d55cee09..fbd29fd16 100644 --- a/packages/fdc3-schema/package.json +++ b/packages/fdc3-schema/package.json @@ -17,11 +17,11 @@ "dist" ], "scripts": { - "clean": "rimraf dist && rimraf generated/context/* && rimraf generated/api/* && rimraf generated/bridging/*", + "clean": "rimraf dist && rimraf generated", "mkdirs": "mkdirp generated/context && mkdirp generated/api && mkdirp generated/bridging", - "prebuild": "npm run clean && npm run mkdirs && npm run typegen && npm run typegen-browser && npm run typegen-bridging && npm run lint", - "build": "npm run prebuild && tsc --module es2022", - "test": "npm run prebuild && tsc", + "generate": "npm run mkdirs && npm run typegen && npm run typegen-browser && npm run typegen-bridging && npm run lint", + "build": "npm run generate && tsc --module es2022", + "test": "npm run generate && tsc", "lint": "eslint generated/ --ext .ts --fix", "typegen": "cd schemas && node ../s2tQuicktypeUtil.js context ../generated/context/ContextTypes.ts", "typegen-browser": "cd schemas && node ../s2tQuicktypeUtil.js api/api.schema.json api/common.schema.json context/context.schema.json api ../generated/api/BrowserTypes.ts", diff --git a/packages/fdc3-schema/tsconfig.json b/packages/fdc3-schema/tsconfig.json index f415962b6..5273a6e11 100644 --- a/packages/fdc3-schema/tsconfig.json +++ b/packages/fdc3-schema/tsconfig.json @@ -10,6 +10,7 @@ "include": [ "src/**/*.ts", "generated/**/*.ts", + "schemas/**/*.json" ], "exclude": [ "dist/**" diff --git a/packages/testing/src/steps/generic.steps.ts b/packages/testing/src/steps/generic.steps.ts index 7532c09a5..f2f7fc2f0 100644 --- a/packages/testing/src/steps/generic.steps.ts +++ b/packages/testing/src/steps/generic.steps.ts @@ -139,7 +139,7 @@ export function setupGenericSteps() { const f2 = fs const p = path - const abspath = p.join(process.cwd(), '../fdc3-schema/schemas/api') + const abspath = p.join(__dirname, '../fdc3-schema/schemas/api') try { f2.readdirSync(abspath).forEach(file => { @@ -155,7 +155,8 @@ export function setupGenericSteps() { console.log(error) } - const contents = fs.readFileSync('../fdc3-schema/schemas/context/context.schema.json', 'utf8') + const contextPath = p.join(__dirname, '../fdc3-schema/schemas/context.schema.json') + const contents = fs.readFileSync(contextPath, 'utf8') const schema = JSON.parse(contents); ajv.addSchema(schema); diff --git a/packages/da-server/cucumber.yml b/toolbox/fdc3-for-web/da-server/cucumber.yml similarity index 100% rename from packages/da-server/cucumber.yml rename to toolbox/fdc3-for-web/da-server/cucumber.yml diff --git a/packages/da-server/package.json b/toolbox/fdc3-for-web/da-server/package.json similarity index 89% rename from packages/da-server/package.json rename to toolbox/fdc3-for-web/da-server/package.json index ff24492e3..04eed2870 100644 --- a/packages/da-server/package.json +++ b/toolbox/fdc3-for-web/da-server/package.json @@ -8,7 +8,7 @@ "types": "dist/src/index.d.ts", "scripts": { "clean": "rimraf dist; rimraf generated; rimraf node_modules; rimraf coverage; rimraf .nyc_output; rimraf cucumber-report.html", - "directory-openapi": "npx openapi-typescript ../fdc3-core/src/app-directory/specification/appd.schema.json --output generated/directory-schema.ts", + "directory-openapi": "npx openapi-typescript ../../../packages/fdc3-core/src/app-directory/specification/appd.schema.json --output generated/directory-schema.ts", "test": "npm run directory-openapi; tsc; nyc --reporter=lcov --reporter=text cucumber-js", "build": "npm run directory-openapi && tsc --module es2022" }, diff --git a/packages/da-server/src/BasicFDC3Server.ts b/toolbox/fdc3-for-web/da-server/src/BasicFDC3Server.ts similarity index 100% rename from packages/da-server/src/BasicFDC3Server.ts rename to toolbox/fdc3-for-web/da-server/src/BasicFDC3Server.ts diff --git a/packages/da-server/src/FDC3Server.ts b/toolbox/fdc3-for-web/da-server/src/FDC3Server.ts similarity index 100% rename from packages/da-server/src/FDC3Server.ts rename to toolbox/fdc3-for-web/da-server/src/FDC3Server.ts diff --git a/packages/da-server/src/ServerContext.ts b/toolbox/fdc3-for-web/da-server/src/ServerContext.ts similarity index 100% rename from packages/da-server/src/ServerContext.ts rename to toolbox/fdc3-for-web/da-server/src/ServerContext.ts diff --git a/packages/da-server/src/directory/BasicDirectory.ts b/toolbox/fdc3-for-web/da-server/src/directory/BasicDirectory.ts similarity index 100% rename from packages/da-server/src/directory/BasicDirectory.ts rename to toolbox/fdc3-for-web/da-server/src/directory/BasicDirectory.ts diff --git a/packages/da-server/src/directory/DirectoryInterface.ts b/toolbox/fdc3-for-web/da-server/src/directory/DirectoryInterface.ts similarity index 100% rename from packages/da-server/src/directory/DirectoryInterface.ts rename to toolbox/fdc3-for-web/da-server/src/directory/DirectoryInterface.ts diff --git a/packages/da-server/src/handlers/BroadcastHandler.ts b/toolbox/fdc3-for-web/da-server/src/handlers/BroadcastHandler.ts similarity index 100% rename from packages/da-server/src/handlers/BroadcastHandler.ts rename to toolbox/fdc3-for-web/da-server/src/handlers/BroadcastHandler.ts diff --git a/packages/da-server/src/handlers/IntentHandler.ts b/toolbox/fdc3-for-web/da-server/src/handlers/IntentHandler.ts similarity index 100% rename from packages/da-server/src/handlers/IntentHandler.ts rename to toolbox/fdc3-for-web/da-server/src/handlers/IntentHandler.ts diff --git a/packages/da-server/src/handlers/OpenHandler.ts b/toolbox/fdc3-for-web/da-server/src/handlers/OpenHandler.ts similarity index 100% rename from packages/da-server/src/handlers/OpenHandler.ts rename to toolbox/fdc3-for-web/da-server/src/handlers/OpenHandler.ts diff --git a/packages/da-server/src/handlers/support.ts b/toolbox/fdc3-for-web/da-server/src/handlers/support.ts similarity index 100% rename from packages/da-server/src/handlers/support.ts rename to toolbox/fdc3-for-web/da-server/src/handlers/support.ts diff --git a/packages/da-server/src/index.ts b/toolbox/fdc3-for-web/da-server/src/index.ts similarity index 100% rename from packages/da-server/src/index.ts rename to toolbox/fdc3-for-web/da-server/src/index.ts diff --git a/packages/da-server/test/features/apps.feature b/toolbox/fdc3-for-web/da-server/test/features/apps.feature similarity index 100% rename from packages/da-server/test/features/apps.feature rename to toolbox/fdc3-for-web/da-server/test/features/apps.feature diff --git a/packages/da-server/test/features/broadcast.feature b/toolbox/fdc3-for-web/da-server/test/features/broadcast.feature similarity index 100% rename from packages/da-server/test/features/broadcast.feature rename to toolbox/fdc3-for-web/da-server/test/features/broadcast.feature diff --git a/packages/da-server/test/features/find-intent.feature b/toolbox/fdc3-for-web/da-server/test/features/find-intent.feature similarity index 100% rename from packages/da-server/test/features/find-intent.feature rename to toolbox/fdc3-for-web/da-server/test/features/find-intent.feature diff --git a/packages/da-server/test/features/intent-result.feature b/toolbox/fdc3-for-web/da-server/test/features/intent-result.feature similarity index 100% rename from packages/da-server/test/features/intent-result.feature rename to toolbox/fdc3-for-web/da-server/test/features/intent-result.feature diff --git a/packages/da-server/test/features/private-channel.feature b/toolbox/fdc3-for-web/da-server/test/features/private-channel.feature similarity index 100% rename from packages/da-server/test/features/private-channel.feature rename to toolbox/fdc3-for-web/da-server/test/features/private-channel.feature diff --git a/packages/da-server/test/features/raise-intent-with-context.feature b/toolbox/fdc3-for-web/da-server/test/features/raise-intent-with-context.feature similarity index 100% rename from packages/da-server/test/features/raise-intent-with-context.feature rename to toolbox/fdc3-for-web/da-server/test/features/raise-intent-with-context.feature diff --git a/packages/da-server/test/features/raise-intent.feature b/toolbox/fdc3-for-web/da-server/test/features/raise-intent.feature similarity index 100% rename from packages/da-server/test/features/raise-intent.feature rename to toolbox/fdc3-for-web/da-server/test/features/raise-intent.feature diff --git a/packages/da-server/test/features/user-channels.feature b/toolbox/fdc3-for-web/da-server/test/features/user-channels.feature similarity index 100% rename from packages/da-server/test/features/user-channels.feature rename to toolbox/fdc3-for-web/da-server/test/features/user-channels.feature diff --git a/packages/da-server/test/step-definitions/app-channel.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/app-channel.steps.ts similarity index 100% rename from packages/da-server/test/step-definitions/app-channel.steps.ts rename to toolbox/fdc3-for-web/da-server/test/step-definitions/app-channel.steps.ts diff --git a/packages/da-server/test/step-definitions/broadcast.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/broadcast.steps.ts similarity index 100% rename from packages/da-server/test/step-definitions/broadcast.steps.ts rename to toolbox/fdc3-for-web/da-server/test/step-definitions/broadcast.steps.ts diff --git a/packages/da-server/test/step-definitions/generic.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/generic.steps.ts similarity index 100% rename from packages/da-server/test/step-definitions/generic.steps.ts rename to toolbox/fdc3-for-web/da-server/test/step-definitions/generic.steps.ts diff --git a/packages/da-server/test/step-definitions/intents.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/intents.steps.ts similarity index 100% rename from packages/da-server/test/step-definitions/intents.steps.ts rename to toolbox/fdc3-for-web/da-server/test/step-definitions/intents.steps.ts diff --git a/packages/da-server/test/step-definitions/messaging.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/messaging.steps.ts similarity index 100% rename from packages/da-server/test/step-definitions/messaging.steps.ts rename to toolbox/fdc3-for-web/da-server/test/step-definitions/messaging.steps.ts diff --git a/packages/da-server/test/step-definitions/private-channel.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/private-channel.steps.ts similarity index 100% rename from packages/da-server/test/step-definitions/private-channel.steps.ts rename to toolbox/fdc3-for-web/da-server/test/step-definitions/private-channel.steps.ts diff --git a/packages/da-server/test/step-definitions/start-app.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/start-app.steps.ts similarity index 100% rename from packages/da-server/test/step-definitions/start-app.steps.ts rename to toolbox/fdc3-for-web/da-server/test/step-definitions/start-app.steps.ts diff --git a/packages/da-server/test/step-definitions/user-channel.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/user-channel.steps.ts similarity index 100% rename from packages/da-server/test/step-definitions/user-channel.steps.ts rename to toolbox/fdc3-for-web/da-server/test/step-definitions/user-channel.steps.ts diff --git a/packages/da-server/test/support/TestServerContext.ts b/toolbox/fdc3-for-web/da-server/test/support/TestServerContext.ts similarity index 100% rename from packages/da-server/test/support/TestServerContext.ts rename to toolbox/fdc3-for-web/da-server/test/support/TestServerContext.ts diff --git a/packages/da-server/test/world/index.ts b/toolbox/fdc3-for-web/da-server/test/world/index.ts similarity index 100% rename from packages/da-server/test/world/index.ts rename to toolbox/fdc3-for-web/da-server/test/world/index.ts diff --git a/packages/da-server/tsconfig.json b/toolbox/fdc3-for-web/da-server/tsconfig.json similarity index 70% rename from packages/da-server/tsconfig.json rename to toolbox/fdc3-for-web/da-server/tsconfig.json index 907ea3fa1..5ef9cad96 100644 --- a/packages/da-server/tsconfig.json +++ b/toolbox/fdc3-for-web/da-server/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.root.json", + "extends": "../../../tsconfig.root.json", "compilerOptions": { "rootDirs": [ "src", @@ -18,10 +18,10 @@ ], "references": [ { - "path": "../fdc3-core" + "path": "../../../packages/fdc3-core" }, { - "path": "../testing" + "path": "../../../packages/testing" } ] } \ No newline at end of file diff --git a/packages/demo/.gitignore b/toolbox/fdc3-for-web/demo/.gitignore similarity index 100% rename from packages/demo/.gitignore rename to toolbox/fdc3-for-web/demo/.gitignore diff --git a/packages/demo/package.json b/toolbox/fdc3-for-web/demo/package.json similarity index 100% rename from packages/demo/package.json rename to toolbox/fdc3-for-web/demo/package.json diff --git a/packages/demo/src/client/apps/ag-grid.css b/toolbox/fdc3-for-web/demo/src/client/apps/ag-grid.css similarity index 100% rename from packages/demo/src/client/apps/ag-grid.css rename to toolbox/fdc3-for-web/demo/src/client/apps/ag-grid.css diff --git a/packages/demo/src/client/apps/ag-grid.ts b/toolbox/fdc3-for-web/demo/src/client/apps/ag-grid.ts similarity index 100% rename from packages/demo/src/client/apps/ag-grid.ts rename to toolbox/fdc3-for-web/demo/src/client/apps/ag-grid.ts diff --git a/packages/demo/src/client/apps/app1.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app1.ts similarity index 100% rename from packages/demo/src/client/apps/app1.ts rename to toolbox/fdc3-for-web/demo/src/client/apps/app1.ts diff --git a/packages/demo/src/client/apps/app2.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app2.ts similarity index 100% rename from packages/demo/src/client/apps/app2.ts rename to toolbox/fdc3-for-web/demo/src/client/apps/app2.ts diff --git a/packages/demo/src/client/apps/app3.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app3.ts similarity index 100% rename from packages/demo/src/client/apps/app3.ts rename to toolbox/fdc3-for-web/demo/src/client/apps/app3.ts diff --git a/packages/demo/src/client/apps/app4.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app4.ts similarity index 100% rename from packages/demo/src/client/apps/app4.ts rename to toolbox/fdc3-for-web/demo/src/client/apps/app4.ts diff --git a/packages/demo/src/client/apps/app5.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app5.ts similarity index 100% rename from packages/demo/src/client/apps/app5.ts rename to toolbox/fdc3-for-web/demo/src/client/apps/app5.ts diff --git a/packages/demo/src/client/apps/app6.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app6.ts similarity index 100% rename from packages/demo/src/client/apps/app6.ts rename to toolbox/fdc3-for-web/demo/src/client/apps/app6.ts diff --git a/packages/demo/src/client/apps/app7.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app7.ts similarity index 100% rename from packages/demo/src/client/apps/app7.ts rename to toolbox/fdc3-for-web/demo/src/client/apps/app7.ts diff --git a/packages/demo/src/client/apps/chartiq.ts b/toolbox/fdc3-for-web/demo/src/client/apps/chartiq.ts similarity index 100% rename from packages/demo/src/client/apps/chartiq.ts rename to toolbox/fdc3-for-web/demo/src/client/apps/chartiq.ts diff --git a/packages/demo/src/client/da/DemoServerContext.ts b/toolbox/fdc3-for-web/demo/src/client/da/DemoServerContext.ts similarity index 100% rename from packages/demo/src/client/da/DemoServerContext.ts rename to toolbox/fdc3-for-web/demo/src/client/da/DemoServerContext.ts diff --git a/packages/demo/src/client/da/FDC3_2_1_JSONDirectory.ts b/toolbox/fdc3-for-web/demo/src/client/da/FDC3_2_1_JSONDirectory.ts similarity index 100% rename from packages/demo/src/client/da/FDC3_2_1_JSONDirectory.ts rename to toolbox/fdc3-for-web/demo/src/client/da/FDC3_2_1_JSONDirectory.ts diff --git a/packages/demo/src/client/da/dummy-desktop-agent.ts b/toolbox/fdc3-for-web/demo/src/client/da/dummy-desktop-agent.ts similarity index 100% rename from packages/demo/src/client/da/dummy-desktop-agent.ts rename to toolbox/fdc3-for-web/demo/src/client/da/dummy-desktop-agent.ts diff --git a/packages/demo/src/client/da/embed.ts b/toolbox/fdc3-for-web/demo/src/client/da/embed.ts similarity index 100% rename from packages/demo/src/client/da/embed.ts rename to toolbox/fdc3-for-web/demo/src/client/da/embed.ts diff --git a/packages/demo/src/client/da/util.ts b/toolbox/fdc3-for-web/demo/src/client/da/util.ts similarity index 100% rename from packages/demo/src/client/da/util.ts rename to toolbox/fdc3-for-web/demo/src/client/da/util.ts diff --git a/packages/demo/src/client/tsconfig.json.unused b/toolbox/fdc3-for-web/demo/src/client/tsconfig.json.unused similarity index 100% rename from packages/demo/src/client/tsconfig.json.unused rename to toolbox/fdc3-for-web/demo/src/client/tsconfig.json.unused diff --git a/packages/demo/src/client/ui/channel-selector.ts b/toolbox/fdc3-for-web/demo/src/client/ui/channel-selector.ts similarity index 100% rename from packages/demo/src/client/ui/channel-selector.ts rename to toolbox/fdc3-for-web/demo/src/client/ui/channel-selector.ts diff --git a/packages/demo/src/client/ui/intent-resolver.ts b/toolbox/fdc3-for-web/demo/src/client/ui/intent-resolver.ts similarity index 100% rename from packages/demo/src/client/ui/intent-resolver.ts rename to toolbox/fdc3-for-web/demo/src/client/ui/intent-resolver.ts diff --git a/packages/demo/src/client/vite-env.d.ts b/toolbox/fdc3-for-web/demo/src/client/vite-env.d.ts similarity index 100% rename from packages/demo/src/client/vite-env.d.ts rename to toolbox/fdc3-for-web/demo/src/client/vite-env.d.ts diff --git a/packages/demo/src/message-types.ts b/toolbox/fdc3-for-web/demo/src/message-types.ts similarity index 100% rename from packages/demo/src/message-types.ts rename to toolbox/fdc3-for-web/demo/src/message-types.ts diff --git a/packages/demo/src/server/main.ts b/toolbox/fdc3-for-web/demo/src/server/main.ts similarity index 100% rename from packages/demo/src/server/main.ts rename to toolbox/fdc3-for-web/demo/src/server/main.ts diff --git a/packages/demo/static/ag-grid/index.html b/toolbox/fdc3-for-web/demo/static/ag-grid/index.html similarity index 100% rename from packages/demo/static/ag-grid/index.html rename to toolbox/fdc3-for-web/demo/static/ag-grid/index.html diff --git a/packages/demo/static/app1/index.html b/toolbox/fdc3-for-web/demo/static/app1/index.html similarity index 100% rename from packages/demo/static/app1/index.html rename to toolbox/fdc3-for-web/demo/static/app1/index.html diff --git a/packages/demo/static/app2/index.html b/toolbox/fdc3-for-web/demo/static/app2/index.html similarity index 100% rename from packages/demo/static/app2/index.html rename to toolbox/fdc3-for-web/demo/static/app2/index.html diff --git a/packages/demo/static/app3/index.html b/toolbox/fdc3-for-web/demo/static/app3/index.html similarity index 100% rename from packages/demo/static/app3/index.html rename to toolbox/fdc3-for-web/demo/static/app3/index.html diff --git a/packages/demo/static/app4/index.html b/toolbox/fdc3-for-web/demo/static/app4/index.html similarity index 100% rename from packages/demo/static/app4/index.html rename to toolbox/fdc3-for-web/demo/static/app4/index.html diff --git a/packages/demo/static/app5/index.html b/toolbox/fdc3-for-web/demo/static/app5/index.html similarity index 100% rename from packages/demo/static/app5/index.html rename to toolbox/fdc3-for-web/demo/static/app5/index.html diff --git a/packages/demo/static/app6/index.html b/toolbox/fdc3-for-web/demo/static/app6/index.html similarity index 100% rename from packages/demo/static/app6/index.html rename to toolbox/fdc3-for-web/demo/static/app6/index.html diff --git a/packages/demo/static/app7/index.html b/toolbox/fdc3-for-web/demo/static/app7/index.html similarity index 100% rename from packages/demo/static/app7/index.html rename to toolbox/fdc3-for-web/demo/static/app7/index.html diff --git a/packages/demo/static/chartiq/css/chartiq.css b/toolbox/fdc3-for-web/demo/static/chartiq/css/chartiq.css similarity index 100% rename from packages/demo/static/chartiq/css/chartiq.css rename to toolbox/fdc3-for-web/demo/static/chartiq/css/chartiq.css diff --git a/packages/demo/static/chartiq/css/chartiq.css.map b/toolbox/fdc3-for-web/demo/static/chartiq/css/chartiq.css.map similarity index 100% rename from packages/demo/static/chartiq/css/chartiq.css.map rename to toolbox/fdc3-for-web/demo/static/chartiq/css/chartiq.css.map diff --git a/packages/demo/static/chartiq/css/font-awesome.css b/toolbox/fdc3-for-web/demo/static/chartiq/css/font-awesome.css similarity index 100% rename from packages/demo/static/chartiq/css/font-awesome.css rename to toolbox/fdc3-for-web/demo/static/chartiq/css/font-awesome.css diff --git a/packages/demo/static/chartiq/css/img/ciq-done-edit-white.svg b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/ciq-done-edit-white.svg similarity index 100% rename from packages/demo/static/chartiq/css/img/ciq-done-edit-white.svg rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/ciq-done-edit-white.svg diff --git a/packages/demo/static/chartiq/css/img/ciq-done-edit.svg b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/ciq-done-edit.svg similarity index 100% rename from packages/demo/static/chartiq/css/img/ciq-done-edit.svg rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/ciq-done-edit.svg diff --git a/packages/demo/static/chartiq/css/img/ciq-save-white.svg b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/ciq-save-white.svg similarity index 100% rename from packages/demo/static/chartiq/css/img/ciq-save-white.svg rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/ciq-save-white.svg diff --git a/packages/demo/static/chartiq/css/img/ciq-save.svg b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/ciq-save.svg similarity index 100% rename from packages/demo/static/chartiq/css/img/ciq-save.svg rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/ciq-save.svg diff --git a/packages/demo/static/chartiq/css/img/closedhand.cur b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/closedhand.cur similarity index 100% rename from packages/demo/static/chartiq/css/img/closedhand.cur rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/closedhand.cur diff --git a/packages/demo/static/chartiq/css/img/helicopter.png b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/helicopter.png similarity index 100% rename from packages/demo/static/chartiq/css/img/helicopter.png rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/helicopter.png diff --git a/packages/demo/static/chartiq/css/img/hu.svg b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/hu.svg similarity index 100% rename from packages/demo/static/chartiq/css/img/hu.svg rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/hu.svg diff --git a/packages/demo/static/chartiq/css/img/languages.svg b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/languages.svg similarity index 100% rename from packages/demo/static/chartiq/css/img/languages.svg rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/languages.svg diff --git a/packages/demo/static/chartiq/css/img/loading-spin-white.svg b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/loading-spin-white.svg similarity index 100% rename from packages/demo/static/chartiq/css/img/loading-spin-white.svg rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/loading-spin-white.svg diff --git a/packages/demo/static/chartiq/css/img/loading-spin.svg b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/loading-spin.svg similarity index 100% rename from packages/demo/static/chartiq/css/img/loading-spin.svg rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/loading-spin.svg diff --git a/packages/demo/static/chartiq/css/img/stx-sprite-markers.svg b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/stx-sprite-markers.svg similarity index 100% rename from packages/demo/static/chartiq/css/img/stx-sprite-markers.svg rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/stx-sprite-markers.svg diff --git a/packages/demo/static/chartiq/css/img/stx-sprite-panels.png b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/stx-sprite-panels.png similarity index 100% rename from packages/demo/static/chartiq/css/img/stx-sprite-panels.png rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/stx-sprite-panels.png diff --git a/packages/demo/static/chartiq/css/img/stx-sprite-panels.svg b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/stx-sprite-panels.svg similarity index 100% rename from packages/demo/static/chartiq/css/img/stx-sprite-panels.svg rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/stx-sprite-panels.svg diff --git a/packages/demo/static/chartiq/css/img/stx-sprite-ui.svg b/toolbox/fdc3-for-web/demo/static/chartiq/css/img/stx-sprite-ui.svg similarity index 100% rename from packages/demo/static/chartiq/css/img/stx-sprite-ui.svg rename to toolbox/fdc3-for-web/demo/static/chartiq/css/img/stx-sprite-ui.svg diff --git a/packages/demo/static/chartiq/css/normalize.css b/toolbox/fdc3-for-web/demo/static/chartiq/css/normalize.css similarity index 100% rename from packages/demo/static/chartiq/css/normalize.css rename to toolbox/fdc3-for-web/demo/static/chartiq/css/normalize.css diff --git a/packages/demo/static/chartiq/css/page-defaults.css b/toolbox/fdc3-for-web/demo/static/chartiq/css/page-defaults.css similarity index 100% rename from packages/demo/static/chartiq/css/page-defaults.css rename to toolbox/fdc3-for-web/demo/static/chartiq/css/page-defaults.css diff --git a/packages/demo/static/chartiq/css/perfect-scrollbar.css b/toolbox/fdc3-for-web/demo/static/chartiq/css/perfect-scrollbar.css similarity index 100% rename from packages/demo/static/chartiq/css/perfect-scrollbar.css rename to toolbox/fdc3-for-web/demo/static/chartiq/css/perfect-scrollbar.css diff --git a/packages/demo/static/chartiq/css/stx-chart.css b/toolbox/fdc3-for-web/demo/static/chartiq/css/stx-chart.css similarity index 100% rename from packages/demo/static/chartiq/css/stx-chart.css rename to toolbox/fdc3-for-web/demo/static/chartiq/css/stx-chart.css diff --git a/packages/demo/static/chartiq/examples/data/STX_SAMPLE_5MIN.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/data/STX_SAMPLE_5MIN.js similarity index 100% rename from packages/demo/static/chartiq/examples/data/STX_SAMPLE_5MIN.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/data/STX_SAMPLE_5MIN.js diff --git a/packages/demo/static/chartiq/examples/data/STX_SAMPLE_DAILY.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/data/STX_SAMPLE_DAILY.js similarity index 100% rename from packages/demo/static/chartiq/examples/data/STX_SAMPLE_DAILY.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/data/STX_SAMPLE_DAILY.js diff --git a/packages/demo/static/chartiq/examples/data/historicalComparisonData.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/data/historicalComparisonData.js similarity index 100% rename from packages/demo/static/chartiq/examples/data/historicalComparisonData.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/data/historicalComparisonData.js diff --git a/packages/demo/static/chartiq/examples/feeds/L2_simulator.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/feeds/L2_simulator.js similarity index 100% rename from packages/demo/static/chartiq/examples/feeds/L2_simulator.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/feeds/L2_simulator.js diff --git a/packages/demo/static/chartiq/examples/feeds/quoteFeedBarChart.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/feeds/quoteFeedBarChart.js similarity index 100% rename from packages/demo/static/chartiq/examples/feeds/quoteFeedBarChart.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/feeds/quoteFeedBarChart.js diff --git a/packages/demo/static/chartiq/examples/feeds/quoteFeedSimulator.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/feeds/quoteFeedSimulator.js similarity index 100% rename from packages/demo/static/chartiq/examples/feeds/quoteFeedSimulator.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/feeds/quoteFeedSimulator.js diff --git a/packages/demo/static/chartiq/examples/feeds/quoteFeedSunGard.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/feeds/quoteFeedSunGard.js similarity index 100% rename from packages/demo/static/chartiq/examples/feeds/quoteFeedSunGard.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/feeds/quoteFeedSunGard.js diff --git a/packages/demo/static/chartiq/examples/feeds/quoteFeedXignite.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/feeds/quoteFeedXignite.js similarity index 100% rename from packages/demo/static/chartiq/examples/feeds/quoteFeedXignite.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/feeds/quoteFeedXignite.js diff --git a/packages/demo/static/chartiq/examples/feeds/symbolLookupChartIQ.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/feeds/symbolLookupChartIQ.js similarity index 100% rename from packages/demo/static/chartiq/examples/feeds/symbolLookupChartIQ.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/feeds/symbolLookupChartIQ.js diff --git a/packages/demo/static/chartiq/examples/markets/exchangeHours.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/markets/exchangeHours.js similarity index 100% rename from packages/demo/static/chartiq/examples/markets/exchangeHours.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/markets/exchangeHours.js diff --git a/packages/demo/static/chartiq/examples/markets/marketDefinitionsSample.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/markets/marketDefinitionsSample.js similarity index 100% rename from packages/demo/static/chartiq/examples/markets/marketDefinitionsSample.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/markets/marketDefinitionsSample.js diff --git a/packages/demo/static/chartiq/examples/markets/marketSymbologySample.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/markets/marketSymbologySample.js similarity index 100% rename from packages/demo/static/chartiq/examples/markets/marketSymbologySample.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/markets/marketSymbologySample.js diff --git a/packages/demo/static/chartiq/examples/templates/README.md b/toolbox/fdc3-for-web/demo/static/chartiq/examples/templates/README.md similarity index 100% rename from packages/demo/static/chartiq/examples/templates/README.md rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/templates/README.md diff --git a/packages/demo/static/chartiq/examples/templates/sample-template-advanced.html b/toolbox/fdc3-for-web/demo/static/chartiq/examples/templates/sample-template-advanced.html similarity index 100% rename from packages/demo/static/chartiq/examples/templates/sample-template-advanced.html rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/templates/sample-template-advanced.html diff --git a/packages/demo/static/chartiq/examples/templates/sample-template-basic.html b/toolbox/fdc3-for-web/demo/static/chartiq/examples/templates/sample-template-basic.html similarity index 100% rename from packages/demo/static/chartiq/examples/templates/sample-template-basic.html rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/templates/sample-template-basic.html diff --git a/packages/demo/static/chartiq/examples/translations/translationSample.js b/toolbox/fdc3-for-web/demo/static/chartiq/examples/translations/translationSample.js similarity index 100% rename from packages/demo/static/chartiq/examples/translations/translationSample.js rename to toolbox/fdc3-for-web/demo/static/chartiq/examples/translations/translationSample.js diff --git a/packages/demo/static/chartiq/index.html b/toolbox/fdc3-for-web/demo/static/chartiq/index.html similarity index 100% rename from packages/demo/static/chartiq/index.html rename to toolbox/fdc3-for-web/demo/static/chartiq/index.html diff --git a/packages/demo/static/chartiq/js/addOns.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/addOns.js similarity index 100% rename from packages/demo/static/chartiq/js/addOns.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/addOns.js diff --git a/packages/demo/static/chartiq/js/chartiq-lite.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/chartiq-lite.js similarity index 100% rename from packages/demo/static/chartiq/js/chartiq-lite.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/chartiq-lite.js diff --git a/packages/demo/static/chartiq/js/chartiq.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/chartiq.js similarity index 100% rename from packages/demo/static/chartiq/js/chartiq.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/chartiq.js diff --git a/packages/demo/static/chartiq/js/componentUI.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/componentUI.js similarity index 100% rename from packages/demo/static/chartiq/js/componentUI.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/componentUI.js diff --git a/packages/demo/static/chartiq/js/components.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/components.js similarity index 100% rename from packages/demo/static/chartiq/js/components.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/components.js diff --git a/packages/demo/static/chartiq/js/extras/hlcbox.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/extras/hlcbox.js similarity index 100% rename from packages/demo/static/chartiq/js/extras/hlcbox.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/extras/hlcbox.js diff --git a/packages/demo/static/chartiq/js/extras/requestLimiter.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/extras/requestLimiter.js similarity index 100% rename from packages/demo/static/chartiq/js/extras/requestLimiter.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/extras/requestLimiter.js diff --git a/packages/demo/static/chartiq/js/thirdparty/@webcomponents/custom-elements.min.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/@webcomponents/custom-elements.min.js similarity index 100% rename from packages/demo/static/chartiq/js/thirdparty/@webcomponents/custom-elements.min.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/@webcomponents/custom-elements.min.js diff --git a/packages/demo/static/chartiq/js/thirdparty/@webcomponents/native-shim.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/@webcomponents/native-shim.js similarity index 100% rename from packages/demo/static/chartiq/js/thirdparty/@webcomponents/native-shim.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/@webcomponents/native-shim.js diff --git a/packages/demo/static/chartiq/js/thirdparty/@webcomponents/template.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/@webcomponents/template.js similarity index 100% rename from packages/demo/static/chartiq/js/thirdparty/@webcomponents/template.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/@webcomponents/template.js diff --git a/packages/demo/static/chartiq/js/thirdparty/html2canvas.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/html2canvas.js similarity index 100% rename from packages/demo/static/chartiq/js/thirdparty/html2canvas.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/html2canvas.js diff --git a/packages/demo/static/chartiq/js/thirdparty/intl.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/intl.js similarity index 100% rename from packages/demo/static/chartiq/js/thirdparty/intl.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/intl.js diff --git a/packages/demo/static/chartiq/js/thirdparty/object-observe.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/object-observe.js similarity index 100% rename from packages/demo/static/chartiq/js/thirdparty/object-observe.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/object-observe.js diff --git a/packages/demo/static/chartiq/js/thirdparty/perfect-scrollbar.jquery.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/perfect-scrollbar.jquery.js similarity index 100% rename from packages/demo/static/chartiq/js/thirdparty/perfect-scrollbar.jquery.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/perfect-scrollbar.jquery.js diff --git a/packages/demo/static/chartiq/js/thirdparty/promise.min.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/promise.min.js similarity index 100% rename from packages/demo/static/chartiq/js/thirdparty/promise.min.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/promise.min.js diff --git a/packages/demo/static/chartiq/js/thirdparty/splines.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/splines.js similarity index 100% rename from packages/demo/static/chartiq/js/thirdparty/splines.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/splines.js diff --git a/packages/demo/static/chartiq/js/thirdparty/webcomponents-lite.min.js b/toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/webcomponents-lite.min.js similarity index 100% rename from packages/demo/static/chartiq/js/thirdparty/webcomponents-lite.min.js rename to toolbox/fdc3-for-web/demo/static/chartiq/js/thirdparty/webcomponents-lite.min.js diff --git a/packages/demo/static/da/appd.json b/toolbox/fdc3-for-web/demo/static/da/appd.json similarity index 100% rename from packages/demo/static/da/appd.json rename to toolbox/fdc3-for-web/demo/static/da/appd.json diff --git a/packages/demo/static/da/channel-selector.html b/toolbox/fdc3-for-web/demo/static/da/channel-selector.html similarity index 100% rename from packages/demo/static/da/channel-selector.html rename to toolbox/fdc3-for-web/demo/static/da/channel-selector.html diff --git a/packages/demo/static/da/corner.png b/toolbox/fdc3-for-web/demo/static/da/corner.png similarity index 100% rename from packages/demo/static/da/corner.png rename to toolbox/fdc3-for-web/demo/static/da/corner.png diff --git a/packages/demo/static/da/embed.html b/toolbox/fdc3-for-web/demo/static/da/embed.html similarity index 100% rename from packages/demo/static/da/embed.html rename to toolbox/fdc3-for-web/demo/static/da/embed.html diff --git a/packages/demo/static/da/index.html b/toolbox/fdc3-for-web/demo/static/da/index.html similarity index 100% rename from packages/demo/static/da/index.html rename to toolbox/fdc3-for-web/demo/static/da/index.html diff --git a/packages/demo/static/da/intent-resolver.html b/toolbox/fdc3-for-web/demo/static/da/intent-resolver.html similarity index 100% rename from packages/demo/static/da/intent-resolver.html rename to toolbox/fdc3-for-web/demo/static/da/intent-resolver.html diff --git a/packages/demo/static/da/local-conformance-2_0.v2.json b/toolbox/fdc3-for-web/demo/static/da/local-conformance-2_0.v2.json similarity index 100% rename from packages/demo/static/da/local-conformance-2_0.v2.json rename to toolbox/fdc3-for-web/demo/static/da/local-conformance-2_0.v2.json diff --git a/packages/demo/static/da/nested.html b/toolbox/fdc3-for-web/demo/static/da/nested.html similarity index 100% rename from packages/demo/static/da/nested.html rename to toolbox/fdc3-for-web/demo/static/da/nested.html diff --git a/packages/demo/static/da/noun-mailbox-6010513.png b/toolbox/fdc3-for-web/demo/static/da/noun-mailbox-6010513.png similarity index 100% rename from packages/demo/static/da/noun-mailbox-6010513.png rename to toolbox/fdc3-for-web/demo/static/da/noun-mailbox-6010513.png diff --git a/packages/demo/static/dnd/index.html b/toolbox/fdc3-for-web/demo/static/dnd/index.html similarity index 100% rename from packages/demo/static/dnd/index.html rename to toolbox/fdc3-for-web/demo/static/dnd/index.html diff --git a/packages/demo/static/dnd/movable.html b/toolbox/fdc3-for-web/demo/static/dnd/movable.html similarity index 100% rename from packages/demo/static/dnd/movable.html rename to toolbox/fdc3-for-web/demo/static/dnd/movable.html diff --git a/packages/demo/static/embed/index.html b/toolbox/fdc3-for-web/demo/static/embed/index.html similarity index 100% rename from packages/demo/static/embed/index.html rename to toolbox/fdc3-for-web/demo/static/embed/index.html diff --git a/packages/demo/tsconfig.json b/toolbox/fdc3-for-web/demo/tsconfig.json similarity index 86% rename from packages/demo/tsconfig.json rename to toolbox/fdc3-for-web/demo/tsconfig.json index 60fcc1ea5..4640e702e 100644 --- a/packages/demo/tsconfig.json +++ b/toolbox/fdc3-for-web/demo/tsconfig.json @@ -23,10 +23,10 @@ ], "references": [ { - "path": "../fdc3-core" + "path": "../../../packages/fdc3-core" }, { - "path": "../client" + "path": "../../../packages/client" }, { "path": "../da-server" From d6588e9f7cce2ab7463ef3f350d5225b71d35b9c Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 11:48:19 +0100 Subject: [PATCH 02/16] Finished moving da-server, fixed tests --- package-lock.json | 136 +++++++++--------- .../test/support/responses/GetUserChannels.ts | 2 +- packages/testing/src/steps/generic.steps.ts | 6 +- 3 files changed, 73 insertions(+), 71 deletions(-) diff --git a/package-lock.json b/package-lock.json index edc020d6e..4639f7450 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,9 +13,9 @@ "packages/fdc3-core", "packages/testing", "packages/da-proxy", - "packages/da-server", + "toolbox/fdc3-for-web/da-server", "packages/client", - "packages/demo", + "toolbox/fdc3-for-web/demo", "toolbox/fdc3-workbench" ], "dependencies": { @@ -3401,11 +3401,11 @@ "link": true }, "node_modules/@kite9/da-server": { - "resolved": "packages/da-server", + "resolved": "toolbox/fdc3-for-web/da-server", "link": true }, "node_modules/@kite9/demo": { - "resolved": "packages/demo", + "resolved": "toolbox/fdc3-for-web/demo", "link": true }, "node_modules/@kite9/fdc3": { @@ -6778,8 +6778,8 @@ "integrity": "sha512-5YM9LFQgVYfuLNEoqMqVWIBuF2UNCA+xu/jz1TyryLN/wmBcQSb+GNAwvLKvEpGESwgGN8XA1nbLAt6rKlyHYQ==" }, "node_modules/electron-to-chromium": { - "version": "1.5.18", - "integrity": "sha512-1OfuVACu+zKlmjsNdcJuVQuVE61sZOLbNM4JAQ1Rvh6EOj0/EUKhMJjRH73InPlXSh8HIJk1cVZ8pyOV/FMdUQ==" + "version": "1.5.19", + "integrity": "sha512-kpLJJi3zxTR1U828P+LIUDZ5ohixyo68/IcYOHLqnbTPr/wdgn4i1ECvmALN9E16JPA6cvCG5UG79gVwVdEK5w==" }, "node_modules/emittery": { "version": "0.13.1", @@ -15336,8 +15336,8 @@ } }, "node_modules/vite": { - "version": "5.4.3", - "integrity": "sha512-IH+nl64eq9lJjFqU+/yrRnrHPVTlgy42/+IzbOdaFDVlyLgI/wDlf+FCobXLX1cT0X5+7LMyH1mIy2xJdLfo8Q==", + "version": "5.4.4", + "integrity": "sha512-RHFCkULitycHVTtelJ6jQLd+KSAAzOgEYorV32R2q++M6COBjKJR6BxqClwp5sf0XaBDjVMuJ9wnNfyAJwjMkA==", "dev": true, "dependencies": { "esbuild": "^0.21.3", @@ -16276,66 +16276,6 @@ "uuid": "^9.0.1" } }, - "packages/da-server": { - "version": "2.2.0-beta.6", - "dependencies": { - "@kite9/fdc3-core": "2.2.0-beta.6", - "@types/uuid": "^10.0.0", - "uuid": "^9.0.1" - }, - "devDependencies": { - "@cucumber/cucumber": "10.3.1", - "@cucumber/html-formatter": "11.0.4", - "@cucumber/pretty-formatter": "1.0.1", - "@kite9/fdc3-common": "2.2.0-beta.6", - "@kite9/testing": "2.2.0-beta.6", - "@types/expect": "24.3.0", - "@types/lodash": "4.14.167", - "@types/node": "^20.14.11", - "@types/uuid": "^10.0.0", - "@typescript-eslint/eslint-plugin": "7.1.1", - "@typescript-eslint/parser": "7.1.0", - "cucumber-console-formatter": "1.0.0", - "eslint": "8.57.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-import": "^2.23.4", - "eslint-plugin-prettier": "3.3.1", - "expect": "^29.7.0", - "is-ci": "2.0.0", - "jsonpath-plus": "^9.0.0", - "nyc": "15.1.0", - "openapi-typescript": "^6.7.4", - "prettier": "3.2.5", - "rimraf": "^6.0.1", - "ts-node": "^10.9.2", - "typescript": "^5.3.2", - "uuid": "^9.0.1" - } - }, - "packages/demo": { - "version": "2.2.0-beta.6", - "dependencies": { - "@kite9/client": "2.2.0-beta.6", - "@kite9/da-server": "2.2.0-beta.6", - "@kite9/fdc3-core": "2.2.0-beta.6", - "@types/uuid": "^10.0.0", - "@types/ws": "^8.5.10", - "express": "^4.18.3", - "socket.io": "^4.7.5", - "socket.io-client": "^4.7.5", - "tsx": "^4.7.1", - "typescript": "^5.3.2", - "uuid": "^9.0.1", - "vite-express": "^0.15.0" - }, - "devDependencies": { - "@types/express": "^4.17.15", - "@types/node": "^20.14.11", - "nodemon": "^3.0.1", - "rimraf": "^6.0.1", - "vite": "^5.2.0" - } - }, "packages/fdc3-core": { "version": "2.2.0-beta.6", "license": "Apache-2.0", @@ -16412,6 +16352,66 @@ "uuid": "^9.0.1" } }, + "toolbox/fdc3-for-web/da-server": { + "version": "2.2.0-beta.6", + "dependencies": { + "@kite9/fdc3-core": "2.2.0-beta.6", + "@types/uuid": "^10.0.0", + "uuid": "^9.0.1" + }, + "devDependencies": { + "@cucumber/cucumber": "10.3.1", + "@cucumber/html-formatter": "11.0.4", + "@cucumber/pretty-formatter": "1.0.1", + "@kite9/fdc3-common": "2.2.0-beta.6", + "@kite9/testing": "2.2.0-beta.6", + "@types/expect": "24.3.0", + "@types/lodash": "4.14.167", + "@types/node": "^20.14.11", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "7.1.1", + "@typescript-eslint/parser": "7.1.0", + "cucumber-console-formatter": "1.0.0", + "eslint": "8.57.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-import": "^2.23.4", + "eslint-plugin-prettier": "3.3.1", + "expect": "^29.7.0", + "is-ci": "2.0.0", + "jsonpath-plus": "^9.0.0", + "nyc": "15.1.0", + "openapi-typescript": "^6.7.4", + "prettier": "3.2.5", + "rimraf": "^6.0.1", + "ts-node": "^10.9.2", + "typescript": "^5.3.2", + "uuid": "^9.0.1" + } + }, + "toolbox/fdc3-for-web/demo": { + "version": "2.2.0-beta.6", + "dependencies": { + "@kite9/client": "2.2.0-beta.6", + "@kite9/da-server": "2.2.0-beta.6", + "@kite9/fdc3-core": "2.2.0-beta.6", + "@types/uuid": "^10.0.0", + "@types/ws": "^8.5.10", + "express": "^4.18.3", + "socket.io": "^4.7.5", + "socket.io-client": "^4.7.5", + "tsx": "^4.7.1", + "typescript": "^5.3.2", + "uuid": "^9.0.1", + "vite-express": "^0.15.0" + }, + "devDependencies": { + "@types/express": "^4.17.15", + "@types/node": "^20.14.11", + "nodemon": "^3.0.1", + "rimraf": "^6.0.1", + "vite": "^5.2.0" + } + }, "toolbox/fdc3-workbench": { "version": "2.2.0-beta.6", "license": "Apache-2.0", diff --git a/packages/da-proxy/test/support/responses/GetUserChannels.ts b/packages/da-proxy/test/support/responses/GetUserChannels.ts index e03e316ff..2cb7d7985 100644 --- a/packages/da-proxy/test/support/responses/GetUserChannels.ts +++ b/packages/da-proxy/test/support/responses/GetUserChannels.ts @@ -26,7 +26,7 @@ export class GetUserChannels implements AutomaticResponse { color: "red", glyph: "triangle", } - } + } as any }) return { diff --git a/packages/testing/src/steps/generic.steps.ts b/packages/testing/src/steps/generic.steps.ts index f2f7fc2f0..996249cf5 100644 --- a/packages/testing/src/steps/generic.steps.ts +++ b/packages/testing/src/steps/generic.steps.ts @@ -139,7 +139,9 @@ export function setupGenericSteps() { const f2 = fs const p = path - const abspath = p.join(__dirname, '../fdc3-schema/schemas/api') + const schemaDir = p.join(__dirname, '../../../../fdc3-schema/schemas') + + const abspath = p.join(schemaDir, 'api') try { f2.readdirSync(abspath).forEach(file => { @@ -155,7 +157,7 @@ export function setupGenericSteps() { console.log(error) } - const contextPath = p.join(__dirname, '../fdc3-schema/schemas/context.schema.json') + const contextPath = p.join(schemaDir, 'context/context.schema.json') const contents = fs.readFileSync(contextPath, 'utf8') const schema = JSON.parse(contents); ajv.addSchema(schema); From 6f0ab7e4bcdf411983483fbd6e2e22a3ce917ce4 Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 11:51:58 +0100 Subject: [PATCH 03/16] Added test workflow --- .github/workflows/test.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..97cea1d6b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: Node.js CI + +# Controls when the workflow will run on any branch +on: + push: + pull_request: + +# Define the jobs for this workflow +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] # Specify the Node.js versions you want to test against + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm test From 06ae5eb1c1743cd9b317fedda6d88ac853dd449f Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 11:54:19 +0100 Subject: [PATCH 04/16] Removed husky hooks - we'll use actions instead --- package.json | 5 ----- packages/fdc3-all/package.json | 6 ------ packages/fdc3-core/package.json | 8 +------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/package.json b/package.json index a4d2adf5a..9db58c5d7 100644 --- a/package.json +++ b/package.json @@ -35,11 +35,6 @@ "syncpack": "npm exec syncpack fix-mismatches --types 'local'", "dev": "concurrently \"cd toolbox/fdc3-workbench && npm run dev\" \"cd packages/demo && npm run dev\"" }, - "husky": { - "hooks": { - "pre-commit": "npm run prebuild" - } - }, "prettier": { "semi": true, "singleQuote": true, diff --git a/packages/fdc3-all/package.json b/packages/fdc3-all/package.json index c6309fbbb..f174c51c2 100644 --- a/packages/fdc3-all/package.json +++ b/packages/fdc3-all/package.json @@ -29,11 +29,6 @@ "typegen-browser": "cd schemas && node ../s2tQuicktypeUtil.js api/api.schema.json api/common.schema.json context/context.schema.json api ../src/api/BrowserTypes.ts", "typegen-bridging": "cd schemas && node ../s2tQuicktypeUtil.js api/api.schema.json api/common.schema.json api/broadcastRequest.schema.json api/findInstancesRequest.schema.json api/findInstancesResponse.schema.json api/findIntentRequest.schema.json api/findIntentResponse.schema.json api/findIntentsByContextRequest.schema.json api/findIntentsByContextResponse.schema.json api/getAppMetadataRequest.schema.json api/getAppMetadataResponse.schema.json api/openRequest.schema.json api/openResponse.schema.json api/raiseIntentRequest.schema.json api/raiseIntentResponse.schema.json api/raiseIntentResultResponse.schema.json context/context.schema.json bridging ../src/bridging/BridgingTypes.ts" }, - "husky": { - "hooks": { - "pre-commit": "npm run prebuild" - } - }, "prettier": { "semi": true, "singleQuote": true, @@ -56,7 +51,6 @@ "eslint-config-prettier": "9.1.0", "eslint-plugin-jest": "27.9.0", "eslint-plugin-jsx-a11y": "^6.8.0", - "husky": "^4.3.0", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", "jest-mock-extended": "3.0.5", diff --git a/packages/fdc3-core/package.json b/packages/fdc3-core/package.json index 892fa8317..4e11364e2 100644 --- a/packages/fdc3-core/package.json +++ b/packages/fdc3-core/package.json @@ -21,12 +21,7 @@ "build": "tsc --module es2022", "test": "tsc; jest --verbose", "lint": "eslint src/ --ext .ts --fix" - }, - "husky": { - "hooks": { - "pre-commit": "npm run prebuild" - } - }, + } "prettier": { "semi": true, "singleQuote": true, @@ -46,7 +41,6 @@ "eslint-config-prettier": "9.1.0", "eslint-plugin-jest": "27.9.0", "eslint-plugin-jsx-a11y": "^6.8.0", - "husky": "^4.3.0", "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", "jest-mock-extended": "3.0.5", From ee39f625adfed2b9f3da9982a8ba55e8b5fc79aa Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 11:56:18 +0100 Subject: [PATCH 05/16] Fixed typo --- packages/fdc3-core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fdc3-core/package.json b/packages/fdc3-core/package.json index 4e11364e2..9e8af62d7 100644 --- a/packages/fdc3-core/package.json +++ b/packages/fdc3-core/package.json @@ -21,7 +21,7 @@ "build": "tsc --module es2022", "test": "tsc; jest --verbose", "lint": "eslint src/ --ext .ts --fix" - } + }, "prettier": { "semi": true, "singleQuote": true, From 5c6a366b1d7aef4c1cb0fd6ee8b1d33f7d42243a Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 12:08:03 +0100 Subject: [PATCH 06/16] Updated workflow --- .github/workflows/test.yml | 2 +- .gitignore | 2 +- .../fdc3-schema/generated/api/BrowserTypes.ts | 5682 ++++++++++++++++ .../generated/bridging/BridgingTypes.ts | 6058 +++++++++++++++++ .../generated/context/ContextTypes.ts | 2901 ++++++++ 5 files changed, 14643 insertions(+), 2 deletions(-) create mode 100644 packages/fdc3-schema/generated/api/BrowserTypes.ts create mode 100644 packages/fdc3-schema/generated/bridging/BridgingTypes.ts create mode 100644 packages/fdc3-schema/generated/context/ContextTypes.ts diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 97cea1d6b..0c80a3bae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [14.x, 16.x, 18.x] # Specify the Node.js versions you want to test against + node-version: [18.x] steps: - name: Checkout repository diff --git a/.gitignore b/.gitignore index b3bede434..e07de5c2a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,5 +20,5 @@ website/.docusaurus/** *.iml website/.yarn .nyc_output -generated/ +toolbox/fdc3-for-web/da-server/generated/ cucumber-report.html \ No newline at end of file diff --git a/packages/fdc3-schema/generated/api/BrowserTypes.ts b/packages/fdc3-schema/generated/api/BrowserTypes.ts new file mode 100644 index 000000000..70b633b13 --- /dev/null +++ b/packages/fdc3-schema/generated/api/BrowserTypes.ts @@ -0,0 +1,5682 @@ +// To parse this data: +// +// import { Convert, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake, WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentityFailedResponse, WebConnectionProtocol5ValidateAppIdentitySuccessResponse, WebConnectionProtocol6Goodbye, WebConnectionProtocolMessage, AddContextListenerRequest, AddContextListenerResponse, AddEventListenerEvent, AddEventListenerRequest, AddEventListenerResponse, AddIntentListenerRequest, AddIntentListenerResponse, AgentEventMessage, AgentResponseMessage, AppRequestMessage, BroadcastEvent, BroadcastRequest, BroadcastResponse, ChannelChangedEvent, ContextListenerUnsubscribeRequest, ContextListenerUnsubscribeResponse, CreatePrivateChannelRequest, CreatePrivateChannelResponse, EventListenerUnsubscribeRequest, EventListenerUnsubscribeResponse, FindInstancesRequest, FindInstancesResponse, FindIntentRequest, FindIntentResponse, FindIntentsByContextRequest, FindIntentsByContextResponse, GetAppMetadataRequest, GetAppMetadataResponse, GetCurrentChannelRequest, GetCurrentChannelResponse, GetCurrentContextRequest, GetCurrentContextResponse, GetInfoRequest, GetInfoResponse, GetOrCreateChannelRequest, GetOrCreateChannelResponse, GetUserChannelsRequest, GetUserChannelsResponse, IframeChannelDrag, IframeChannelResize, IframeChannelSelected, IframeChannels, IframeHandshake, IframeHello, IframeMessage, IframeResolve, IframeResolveAction, IntentEvent, IntentListenerUnsubscribeRequest, IntentListenerUnsubscribeResponse, IntentResultRequest, IntentResultResponse, JoinUserChannelRequest, JoinUserChannelResponse, LeaveCurrentChannelRequest, LeaveCurrentChannelResponse, OpenRequest, OpenResponse, PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse, PrivateChannelOnAddContextListenerEvent, PrivateChannelOnDisconnectEvent, PrivateChannelOnUnsubscribeEvent, PrivateChannelUnsubscribeEventListenerRequest, PrivateChannelUnsubscribeEventListenerResponse, PrivateChannelAddEventListenerRequest, PrivateChannelAddEventListenerResponse, RaiseIntentForContextRequest, RaiseIntentForContextResponse, RaiseIntentRequest, RaiseIntentResponse, RaiseIntentResultResponse } from "./file"; +// +// const webConnectionProtocol1Hello = Convert.toWebConnectionProtocol1Hello(json); +// const webConnectionProtocol2LoadURL = Convert.toWebConnectionProtocol2LoadURL(json); +// const webConnectionProtocol3Handshake = Convert.toWebConnectionProtocol3Handshake(json); +// const webConnectionProtocol4ValidateAppIdentity = Convert.toWebConnectionProtocol4ValidateAppIdentity(json); +// const webConnectionProtocol5ValidateAppIdentityFailedResponse = Convert.toWebConnectionProtocol5ValidateAppIdentityFailedResponse(json); +// const webConnectionProtocol5ValidateAppIdentitySuccessResponse = Convert.toWebConnectionProtocol5ValidateAppIdentitySuccessResponse(json); +// const webConnectionProtocol6Goodbye = Convert.toWebConnectionProtocol6Goodbye(json); +// const webConnectionProtocolMessage = Convert.toWebConnectionProtocolMessage(json); +// const addContextListenerRequest = Convert.toAddContextListenerRequest(json); +// const addContextListenerResponse = Convert.toAddContextListenerResponse(json); +// const addEventListenerEvent = Convert.toAddEventListenerEvent(json); +// const addEventListenerRequest = Convert.toAddEventListenerRequest(json); +// const addEventListenerResponse = Convert.toAddEventListenerResponse(json); +// const addIntentListenerRequest = Convert.toAddIntentListenerRequest(json); +// const addIntentListenerResponse = Convert.toAddIntentListenerResponse(json); +// const agentEventMessage = Convert.toAgentEventMessage(json); +// const agentResponseMessage = Convert.toAgentResponseMessage(json); +// const appRequestMessage = Convert.toAppRequestMessage(json); +// const broadcastEvent = Convert.toBroadcastEvent(json); +// const broadcastRequest = Convert.toBroadcastRequest(json); +// const broadcastResponse = Convert.toBroadcastResponse(json); +// const channelChangedEvent = Convert.toChannelChangedEvent(json); +// const contextListenerUnsubscribeRequest = Convert.toContextListenerUnsubscribeRequest(json); +// const contextListenerUnsubscribeResponse = Convert.toContextListenerUnsubscribeResponse(json); +// const createPrivateChannelRequest = Convert.toCreatePrivateChannelRequest(json); +// const createPrivateChannelResponse = Convert.toCreatePrivateChannelResponse(json); +// const eventListenerUnsubscribeRequest = Convert.toEventListenerUnsubscribeRequest(json); +// const eventListenerUnsubscribeResponse = Convert.toEventListenerUnsubscribeResponse(json); +// const findInstancesRequest = Convert.toFindInstancesRequest(json); +// const findInstancesResponse = Convert.toFindInstancesResponse(json); +// const findIntentRequest = Convert.toFindIntentRequest(json); +// const findIntentResponse = Convert.toFindIntentResponse(json); +// const findIntentsByContextRequest = Convert.toFindIntentsByContextRequest(json); +// const findIntentsByContextResponse = Convert.toFindIntentsByContextResponse(json); +// const getAppMetadataRequest = Convert.toGetAppMetadataRequest(json); +// const getAppMetadataResponse = Convert.toGetAppMetadataResponse(json); +// const getCurrentChannelRequest = Convert.toGetCurrentChannelRequest(json); +// const getCurrentChannelResponse = Convert.toGetCurrentChannelResponse(json); +// const getCurrentContextRequest = Convert.toGetCurrentContextRequest(json); +// const getCurrentContextResponse = Convert.toGetCurrentContextResponse(json); +// const getInfoRequest = Convert.toGetInfoRequest(json); +// const getInfoResponse = Convert.toGetInfoResponse(json); +// const getOrCreateChannelRequest = Convert.toGetOrCreateChannelRequest(json); +// const getOrCreateChannelResponse = Convert.toGetOrCreateChannelResponse(json); +// const getUserChannelsRequest = Convert.toGetUserChannelsRequest(json); +// const getUserChannelsResponse = Convert.toGetUserChannelsResponse(json); +// const iframeChannelDrag = Convert.toIframeChannelDrag(json); +// const iframeChannelResize = Convert.toIframeChannelResize(json); +// const iframeChannelSelected = Convert.toIframeChannelSelected(json); +// const iframeChannels = Convert.toIframeChannels(json); +// const iframeHandshake = Convert.toIframeHandshake(json); +// const iframeHello = Convert.toIframeHello(json); +// const iframeMessage = Convert.toIframeMessage(json); +// const iframeResolve = Convert.toIframeResolve(json); +// const iframeResolveAction = Convert.toIframeResolveAction(json); +// const intentEvent = Convert.toIntentEvent(json); +// const intentListenerUnsubscribeRequest = Convert.toIntentListenerUnsubscribeRequest(json); +// const intentListenerUnsubscribeResponse = Convert.toIntentListenerUnsubscribeResponse(json); +// const intentResultRequest = Convert.toIntentResultRequest(json); +// const intentResultResponse = Convert.toIntentResultResponse(json); +// const joinUserChannelRequest = Convert.toJoinUserChannelRequest(json); +// const joinUserChannelResponse = Convert.toJoinUserChannelResponse(json); +// const leaveCurrentChannelRequest = Convert.toLeaveCurrentChannelRequest(json); +// const leaveCurrentChannelResponse = Convert.toLeaveCurrentChannelResponse(json); +// const openRequest = Convert.toOpenRequest(json); +// const openResponse = Convert.toOpenResponse(json); +// const privateChannelDisconnectRequest = Convert.toPrivateChannelDisconnectRequest(json); +// const privateChannelDisconnectResponse = Convert.toPrivateChannelDisconnectResponse(json); +// const privateChannelOnAddContextListenerEvent = Convert.toPrivateChannelOnAddContextListenerEvent(json); +// const privateChannelOnDisconnectEvent = Convert.toPrivateChannelOnDisconnectEvent(json); +// const privateChannelOnUnsubscribeEvent = Convert.toPrivateChannelOnUnsubscribeEvent(json); +// const privateChannelUnsubscribeEventListenerRequest = Convert.toPrivateChannelUnsubscribeEventListenerRequest(json); +// const privateChannelUnsubscribeEventListenerResponse = Convert.toPrivateChannelUnsubscribeEventListenerResponse(json); +// const privateChannelAddEventListenerRequest = Convert.toPrivateChannelAddEventListenerRequest(json); +// const privateChannelAddEventListenerResponse = Convert.toPrivateChannelAddEventListenerResponse(json); +// const raiseIntentForContextRequest = Convert.toRaiseIntentForContextRequest(json); +// const raiseIntentForContextResponse = Convert.toRaiseIntentForContextResponse(json); +// const raiseIntentRequest = Convert.toRaiseIntentRequest(json); +// const raiseIntentResponse = Convert.toRaiseIntentResponse(json); +// const raiseIntentResultResponse = Convert.toRaiseIntentResultResponse(json); +// +// These functions will throw an error if the JSON doesn't +// match the expected interface, even if the JSON is valid. + +/** + * Hello message sent by an application to a parent window or frame when attempting to + * establish connectivity to a Desktop Agent + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol1Hello { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol1HelloPayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP1Hello"; +} + +/** + * Metadata for this connection step message + */ +export interface ConnectionStepMetadata { + connectionAttemptUuid: string; + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol1HelloPayload { + /** + * A flag that may be used to indicate that a channel selector UI is or is not required. If + * the app includes its own UI for displaying + */ + channelSelector?: boolean; + /** + * The version of FDC3 API that the app supports. + */ + fdc3Version: string; + /** + * URL to use for the identity of the application. Desktop Agents MUST validate that the + * origin of the message matches the URL, but MAY implement custom comparison logic. + */ + identityUrl: string; + /** + * A flag that may be used to indicate that an intent resolver is or is not required. Set to + * false if no intents, or only targeted intents, are raised + */ + resolver?: boolean; + [property: string]: any; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Response from a Desktop Agent to an application requesting access to it indicating that + * it should load a specified URL into a hidden iframe in order to establish connectivity to + * a Desktop Agent + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol2LoadURL { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol2LoadURLPayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP2LoadUrl"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol2LoadURLPayload { + /** + * A URL which can be used to establish communication with the Desktop Agent, via loading + * the URL into an iframe and restarting the Web Connection protocol with the iframe as the + * target + */ + iframeUrl: string; + [property: string]: any; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Handshake message sent by the Desktop Agent to the app (with a MessagePort appended) that + * should be used for subsequent communication steps. + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol3Handshake { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol3HandshakePayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP3Handshake"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol3HandshakePayload { + /** + * Indicates whether a channel selector UI is required and the URL to use to do so. Set to + * `true` to use the default or `false` to disable the channel selector (as the Desktop + * Agent will handle another way) + */ + channelSelector: boolean | string; + /** + * The version of FDC3 API that the Desktop Agent will provide support for. + */ + fdc3Version: string; + /** + * Indicates whether an intent resolver UI is required and the URL to use to do so. Set to + * `true` to use the default or `false` to disable the intent resolver (as the Desktop Agent + * will handle another way) + */ + resolver: boolean | string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Identity Validation request from an app attempting to connect to a Desktop Agent. + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol4ValidateAppIdentity { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol4ValidateAppIdentityPayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP4ValidateAppIdentity"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol4ValidateAppIdentityPayload { + /** + * URL to use for the identity of the application. Desktop Agents MUST validate that the + * origin of the message matches the URL, but MAY implement custom comparison logic. + */ + identityUrl: string; + /** + * If an application has previously connected to the desktop agent, it may specify its prior + * instance id and associated instance UUID to request the same same instance Id be assigned. + */ + instanceId?: string; + /** + * Instance UUID associated with the requested instanceId. + */ + instanceUuid?: string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Message sent by the Desktop Agent to an app if their identity validation fails. + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol5ValidateAppIdentityFailedResponse { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP5ValidateAppIdentityFailedResponse"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload { + message?: string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Message sent by the Desktop Agent to an app after successful identity validation + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol5ValidateAppIdentitySuccessResponse { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP5ValidateAppIdentityResponse"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload { + /** + * The appId that the app's identity was validated against + */ + appId: string; + /** + * Implementation metadata for the Desktop Agent, which includes an appMetadata element + * containing a copy of the app's own metadata + */ + implementationMetadata: ImplementationMetadata; + /** + * The instance Id granted to the application by the Desktop Agent. + */ + instanceId: string; + /** + * Instance UUID associated with the instanceId granted, which may be used to retrieve the + * same instance Id if the app is reloaded or navigates. + */ + instanceUuid: string; +} + +/** + * Implementation metadata for the Desktop Agent, which includes an appMetadata element + * containing a copy of the app's own metadata + * + * Includes Metadata for the current application. + * + * Metadata relating to the FDC3 Desktop Agent implementation and its provider. + */ +export interface ImplementationMetadata { + /** + * The calling application instance's own metadata, according to the Desktop Agent (MUST + * include at least the `appId` and `instanceId`). + */ + appMetadata: AppMetadata; + /** + * The version number of the FDC3 specification that the implementation provides. + * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. + */ + fdc3Version: string; + /** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ + optionalFeatures: OptionalFeatures; + /** + * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, + * OpenFin etc.). + */ + provider: string; + /** + * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). + */ + providerVersion?: string; +} + +/** + * The calling application instance's own metadata, according to the Desktop Agent (MUST + * include at least the `appId` and `instanceId`). + * + * Extends an `AppIdentifier`, describing an application or instance of an application, with + * additional descriptive metadata that is usually provided by an FDC3 App Directory that + * the desktop agent connects to. + * + * The additional information from an app directory can aid in rendering UI elements, such + * as a launcher menu or resolver UI. This includes a title, description, tooltip and icon + * and screenshot URLs. + * + * Note that as `AppMetadata` instances are also `AppIdentifiers` they may be passed to the + * `app` argument of `fdc3.open`, `fdc3.raiseIntent` etc. + */ +export interface AppMetadata { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * A longer, multi-paragraph description for the application that could include markup + */ + description?: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * A list of icon URLs for the application that can be used to render UI elements + */ + icons?: Icon[]; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + /** + * An optional set of, implementation specific, metadata fields that can be used to + * disambiguate instances, such as a window title or screen position. Must only be set if + * `instanceId` is set. + */ + instanceMetadata?: { [key: string]: any }; + /** + * The 'friendly' app name. + * This field was used with the `open` and `raiseIntent` calls in FDC3 <2.0, which now + * require an `AppIdentifier` wth `appId` set. + * Note that for display purposes the `title` field should be used, if set, in preference to + * this field. + */ + name?: string; + /** + * The type of output returned for any intent specified during resolution. May express a + * particular context type (e.g. "fdc3.instrument"), channel (e.g. "channel") or a channel + * that will receive a specified type (e.g. "channel"). + */ + resultType?: null | string; + /** + * Images representing the app in common usage scenarios that can be used to render UI + * elements + */ + screenshots?: Image[]; + /** + * A more user-friendly application title that can be used to render UI elements + */ + title?: string; + /** + * A tooltip for the application that can be used to render UI elements + */ + tooltip?: string; + /** + * The Version of the application. + */ + version?: string; +} + +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ +export interface Icon { + /** + * The icon dimension, formatted as `x`. + */ + size?: string; + /** + * The icon url + */ + src: string; + /** + * Icon media type. If not present the Desktop Agent may use the src file extension. + */ + type?: string; +} + +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ +export interface Image { + /** + * Caption for the image. + */ + label?: string; + /** + * The image dimension, formatted as `x`. + */ + size?: string; + /** + * The image url. + */ + src: string; + /** + * Image media type. If not present the Desktop Agent may use the src file extension. + */ + type?: string; +} + +/** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ +export interface OptionalFeatures { + /** + * Used to indicate whether the experimental Desktop Agent Bridging + * feature is implemented by the Desktop Agent. + */ + DesktopAgentBridging: boolean; + /** + * Used to indicate whether the exposure of 'originating app metadata' for + * context and intent messages is supported by the Desktop Agent. + */ + OriginatingAppMetadata: boolean; + /** + * Used to indicate whether the optional `fdc3.joinUserChannel`, + * `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by + * the Desktop Agent. + */ + UserChannelMembershipAPIs: boolean; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Goodbye message to be sent to the Desktop Agent when disconnecting (e.g. when closing the + * window or navigating). Desktop Agents should close the MessagePort after receiving this + * message, but retain instance details in case the application reconnects (e.g. after a + * navigation event). + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol6Goodbye { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the connection step message. + */ + type: "WCP6Goodbye"; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocolMessage { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the connection step message. + */ + type: ConnectionStepMessageType; +} + +/** + * Identifies the type of the connection step message. + */ +export type ConnectionStepMessageType = "WCP1Hello" | "WCP2LoadUrl" | "WCP3Handshake" | "WCP4ValidateAppIdentity" | "WCP5ValidateAppIdentityFailedResponse" | "WCP5ValidateAppIdentityResponse" | "WCP6Goodbye"; + +/** + * A request to add a context listener to a specified Channel OR to the current user + * channel. Where the listener is added to the current user channel (channelId == null), and + * this app has already been added to a user channel, client code should make a subsequent + * request to get the current context of that channel for this listener and then call its + * handler with it. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface AddContextListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: AddContextListenerRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "addContextListenerRequest"; +} + +/** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ +export interface AddContextListenerRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that a request or response was received + * from. Please note that this may be set by an app or Desktop Agent proxy for debugging + * purposes but a Desktop Agent should make its own determination of the source of a message + * to avoid spoofing. + */ + source?: AppIdentifier; + timestamp: Date; +} + +/** + * Field that represents the source application that a request or response was received + * from. Please note that this may be set by an app or Desktop Agent proxy for debugging + * purposes but a Desktop Agent should make its own determination of the source of a message + * to avoid spoofing. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that the request being responded to was + * received from, for debugging purposes. + * + * Details of the application instance that broadcast the context + * + * The App resolution option chosen + * + * Details of the application instance that raised the intent + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppIdentifier { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface AddContextListenerRequestPayload { + /** + * The id of the channel to add the listener to or `null` indicating that it should listen + * to the current user channel (at the time of broadcast). + */ + channelId: null | string; + /** + * The type of context to listen for OR `null` indicating that it should listen to all + * context types. + */ + contextType: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a addContextListener request. Where the listener was added to the current + * user channel (channelId == null), and this app has already been added to a user channel, + * client code should make a subsequent request to get the current context of that channel + * for this listener and then call its handler with it. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface AddContextListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: AddContextListenerResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "addContextListenerResponse"; +} + +/** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ +export interface AddContextListenerResponseMeta { + requestUuid: string; + responseUuid: string; + /** + * Field that represents the source application that the request being responded to was + * received from, for debugging purposes. + */ + source?: AppIdentifier; + timestamp: Date; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface AddContextListenerResponsePayload { + error?: PurpleError; + listenerUUID?: string; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type PurpleError = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app for a specified event type. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface AddEventListenerEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: AddEventListenerEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "addEventListenerEvent"; +} + +/** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ +export interface AddEventListenerEventMeta { + eventUuid: string; + timestamp: Date; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface AddEventListenerEventPayload { + event: FDC3Event; +} + +/** + * An event object received via the FDC3 API's addEventListener function. Will always + * include both type and details, which describe type of the event and any additional + * details respectively. + */ +export interface FDC3Event { + /** + * Additional details of the event, such as the `currentChannelId` for a CHANNEL_CHANGED + * event + */ + details: { [key: string]: any }; + type: "USER_CHANNEL_CHANGED"; +} + +/** + * The type of a (non-context and non-intent) event that may be received via the FDC3 API's + * addEventListener function. + * + * The type of the event to be listened to. + */ + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to add an event listener for a specified event type to the DesktopAgent. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface AddEventListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: AddEventListenerRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "addEventListenerRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface AddEventListenerRequestPayload { + /** + * The type of the event to be listened to. + */ + type: "USER_CHANNEL_CHANGED"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to an addEventListener request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface AddEventListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: AddEventListenerResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "addEventListenerResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface AddEventListenerResponsePayload { + error?: ResponsePayloadError; + listenerUUID?: string; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type ResponsePayloadError = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to add an Intent listener for a specified intent type. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface AddIntentListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: AddIntentListenerRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "addIntentListenerRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface AddIntentListenerRequestPayload { + /** + * The name of the intent to listen for. + */ + intent: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a addIntentListener request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface AddIntentListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: AddIntentListenerResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "addIntentListenerResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface AddIntentListenerResponsePayload { + error?: FluffyError; + listenerUUID?: string; + [property: string]: any; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type FluffyError = "MalformedContext" | "DesktopAgentNotFound" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface AgentEventMessage { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AgentEventMessageMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: EventMessageType; +} + +/** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ +export interface AgentEventMessageMeta { + eventUuid: string; + timestamp: Date; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ +export type EventMessageType = "intentEvent" | "broadcastEvent" | "channelChangedEvent" | "privateChannelOnAddContextListenerEvent" | "privateChannelOnDisconnectEvent" | "privateChannelOnUnsubscribeEvent" | "addEventListenerEvent"; + +/** + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface AgentResponseMessage { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AgentResponseMessageMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: AgentResponseMessageResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: ResponseMessageType; +} + +/** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ +export interface AgentResponseMessageMeta { + requestUuid: string; + responseUuid: string; + /** + * Field that represents the source application that the request being responded to was + * received from, for debugging purposes. + */ + source?: AppIdentifier; + timestamp: Date; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface AgentResponseMessageResponsePayload { + error?: ResponsePayloadError; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ +export type ResponseMessageType = "addContextListenerResponse" | "addEventListenerResponse" | "addIntentListenerResponse" | "broadcastResponse" | "contextListenerUnsubscribeResponse" | "createPrivateChannelResponse" | "eventListenerUnsubscribeResponse" | "findInstancesResponse" | "findIntentResponse" | "findIntentsByContextResponse" | "getAppMetadataResponse" | "getCurrentChannelResponse" | "getCurrentContextResponse" | "getInfoResponse" | "getOrCreateChannelResponse" | "getUserChannelsResponse" | "intentListenerUnsubscribeResponse" | "intentResultResponse" | "joinUserChannelResponse" | "leaveCurrentChannelResponse" | "openResponse" | "privateChannelAddEventListenerResponse" | "privateChannelDisconnectResponse" | "privateChannelUnsubscribeEventListenerResponse" | "raiseIntentForContextResponse" | "raiseIntentResponse" | "raiseIntentResultResponse"; + +/** + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface AppRequestMessage { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AppRequestMessageMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: RequestMessageType; +} + +/** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ +export interface AppRequestMessageMeta { + requestUuid: string; + /** + * Field that represents the source application that a request or response was received + * from. Please note that this may be set by an app or Desktop Agent proxy for debugging + * purposes but a Desktop Agent should make its own determination of the source of a message + * to avoid spoofing. + */ + source?: AppIdentifier; + timestamp: Date; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ +export type RequestMessageType = "addContextListenerRequest" | "addEventListenerRequest" | "addIntentListenerRequest" | "broadcastRequest" | "contextListenerUnsubscribeRequest" | "createPrivateChannelRequest" | "eventListenerUnsubscribeRequest" | "findInstancesRequest" | "findIntentRequest" | "findIntentsByContextRequest" | "getAppMetadataRequest" | "getCurrentChannelRequest" | "getCurrentContextRequest" | "getInfoRequest" | "getOrCreateChannelRequest" | "getUserChannelsRequest" | "intentListenerUnsubscribeRequest" | "intentResultRequest" | "joinUserChannelRequest" | "leaveCurrentChannelRequest" | "openRequest" | "privateChannelAddEventListenerRequest" | "privateChannelDisconnectRequest" | "privateChannelUnsubscribeEventListenerRequest" | "raiseIntentForContextRequest" | "raiseIntentRequest"; + +/** + * An event message from the Desktop Agent to an app indicating that context has been + * broadcast on a channel it is listening to, or specifically to this app instance if it was + * launched via `fdc3.open` and context was passed. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface BroadcastEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: BroadcastEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "broadcastEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface BroadcastEventPayload { + /** + * The Id of the channel that the broadcast was sent on. May be `null` if the context is + * being broadcast due to a call `fdc3.open` that passed context. + */ + channelId: null | string; + /** + * The context object that was broadcast. + */ + context: Context; + /** + * Details of the application instance that broadcast the context + */ + originatingApp?: AppIdentifier; +} + +/** + * The context object that was broadcast. + * + * The context object that is to be broadcast. + * + * The context object passed with the raised intent. + * + * If a Context object is passed in, this object will be provided to the opened application + * via a contextListener. The Context argument is functionally equivalent to opening the + * target app with no context and broadcasting the context directly to it. + * + * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by + * FDC3 operations. As such, it is not really meant to be used on its own, but is imported + * by more specific type definitions (standardized or custom) to provide the structure and + * properties shared by all FDC3 context data types. + * + * The key element of FDC3 context types is their mandatory `type` property, which is used + * to identify what type of data the object represents, and what shape it has. + * + * The FDC3 context type, and all derived types, define the minimum set of fields a context + * data object of a particular type can be expected to have, but this can always be extended + * with custom fields as appropriate. + */ +export interface Context { + /** + * Context data objects may include a set of equivalent key-value pairs that can be used to + * help applications identify and look up the context type they receive in their own domain. + * The idea behind this design is that applications can provide as many equivalent + * identifiers to a target application as possible, e.g. an instrument may be represented by + * an ISIN, CUSIP or Bloomberg identifier. + * + * Identifiers do not make sense for all types of data, so the `id` property is therefore + * optional, but some derived types may choose to require at least one identifier. + * Identifier values SHOULD always be of type string. + */ + id?: { [key: string]: any }; + /** + * Context data objects may include a name property that can be used for more information, + * or display purposes. Some derived types may require the name object as mandatory, + * depending on use case. + */ + name?: string; + /** + * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 + * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present + * to route shared context data appropriately. + * + * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data + * types they support in an FDC3 [App + * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery + * and routing. + * + * Standardized FDC3 context types have well-known `type` properties prefixed with the + * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and + * used by a particular organization, the convention is to prefix them with an + * organization-specific namespace, e.g. `blackrock.fund`. + * + * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more + * information about context data types. + */ + type: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to broadcast context on a channel. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface BroadcastRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: BroadcastRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "broadcastRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface BroadcastRequestPayload { + /** + * The Id of the Channel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that is to be broadcast. + */ + context: Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a request to broadcast context on a channel. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface BroadcastResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "broadcastResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface BroadcastResponseResponsePayload { + error?: ResponsePayloadError; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app indicating that its current user + * channel has changed. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface ChannelChangedEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: ChannelChangedEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "channelChangedEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface ChannelChangedEventPayload { + /** + * The Id of the channel that the app was added to or `null` if it was removed from a + * channel. + */ + newChannelId: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to unsubscribe a context listener. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface ContextListenerUnsubscribeRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: ContextListenerUnsubscribeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "contextListenerUnsubscribeRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface ContextListenerUnsubscribeRequestPayload { + listenerUUID: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a contextListenerUnsubscribe request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface ContextListenerUnsubscribeResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "contextListenerUnsubscribeResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to return a Channel with an auto-generated identity that is intended for private + * communication between applications. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface CreatePrivateChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: CreatePrivateChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "createPrivateChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface CreatePrivateChannelRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a createPrivateChannel request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface CreatePrivateChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: CreatePrivateChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "createPrivateChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface CreatePrivateChannelResponsePayload { + error?: PurpleError; + privateChannel?: Channel; +} + +/** + * Represents a context channel that applications can use to send and receive + * context data. + * + * Please note that There are differences in behavior when you interact with a + * User channel via the `DesktopAgent` interface and the `Channel` interface. + * Specifically, when 'joining' a User channel or adding a context listener + * when already joined to a channel via the `DesktopAgent` interface, existing + * context (matching the type of the context listener) on the channel is + * received by the context listener immediately. Whereas, when a context + * listener is added via the Channel interface, context is not received + * automatically, but may be retrieved manually via the `getCurrentContext()` + * function. + */ +export interface Channel { + /** + * Channels may be visualized and selectable by users. DisplayMetadata may be used to + * provide hints on how to see them. + * For App channels, displayMetadata would typically not be present. + */ + displayMetadata?: DisplayMetadata; + /** + * Constant that uniquely identifies this channel. + */ + id: string; + /** + * Uniquely defines each channel type. + * Can be "user", "app" or "private". + */ + type: Type; +} + +/** + * Channels may be visualized and selectable by users. DisplayMetadata may be used to + * provide hints on how to see them. + * For App channels, displayMetadata would typically not be present. + * + * A system channel will be global enough to have a presence across many apps. This gives us + * some hints + * to render them in a standard way. It is assumed it may have other properties too, but if + * it has these, + * this is their meaning. + */ +export interface DisplayMetadata { + /** + * The color that should be associated within this channel when displaying this channel in a + * UI, e.g: `0xFF0000`. + */ + color?: string; + /** + * A URL of an image that can be used to display this channel + */ + glyph?: string; + /** + * A user-readable name for this channel, e.g: `"Red"` + */ + name?: string; +} + +/** + * Uniquely defines each channel type. + * Can be "user", "app" or "private". + */ +export type Type = "app" | "private" | "user"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to unsubscribe an event listener. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface EventListenerUnsubscribeRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: EventListenerUnsubscribeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "eventListenerUnsubscribeRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface EventListenerUnsubscribeRequestPayload { + listenerUUID: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to an eventListenerUnsubscribe request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface EventListenerUnsubscribeResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "eventListenerUnsubscribeResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request for details of instances of a particular app. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface FindInstancesRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindInstancesRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findInstancesRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindInstancesRequestPayload { + app: AppIdentifier; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a findInstances request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface FindInstancesResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: FindInstancesResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * The message payload contains a flag indicating whether the API call was successful, plus + * any return values for the FDC3 API function called, or indicating that the request + * resulted in an error and including a standardized error message. + */ +export interface FindInstancesResponsePayload { + error?: FindInstancesErrors; + appIdentifiers?: AppMetadata[]; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + * + * Unique identifier for a for an attempt to connect to a Desktop Agent + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + * + * Unique identifier for a `listener` object returned by a Desktop Agent to an app in + * response to addContextListener, addIntentListener or one of the PrivateChannel event + * listeners and used to identify it in messages (e.g. when unsubscribing). + * + * Should be set if the raiseIntent request returned an error. + */ +export type FindInstancesErrors = "MalformedContext" | "DesktopAgentNotFound" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request for details of apps available to resolve a particular intent and context pair. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface FindIntentRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentRequestPayload { + context?: Context; + intent: string; + resultType?: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a findIntent request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface FindIntentResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: FindIntentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface FindIntentResponsePayload { + error?: FindInstancesErrors; + appIntent?: AppIntent; +} + +/** + * An interface that relates an intent to apps + * + * Used if a raiseIntent request requires additional resolution (e.g. by showing an intent + * resolver) before it can be handled. + */ +export interface AppIntent { + /** + * Details of applications that can resolve the intent. + */ + apps: AppMetadata[]; + /** + * Details of the intent whose relationship to resolving applications is being described. + */ + intent: IntentMetadata; +} + +/** + * Details of the intent whose relationship to resolving applications is being described. + * + * Intent descriptor + */ +export interface IntentMetadata { + /** + * Display name for the intent. + */ + displayName?: string; + /** + * The unique name of the intent that can be invoked by the raiseIntent call + */ + name: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request for details of intents and apps available to resolve them for a particular + * context. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface FindIntentsByContextRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentsByContextRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentsByContextRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentsByContextRequestPayload { + context: Context; + resultType?: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a findIntentsByContext request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface FindIntentsByContextResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: FindIntentsByContextResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface FindIntentsByContextResponsePayload { + error?: FindInstancesErrors; + appIntents?: AppIntent[]; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request for metadata about an app. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetAppMetadataRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetAppMetadataRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getAppMetadataRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetAppMetadataRequestPayload { + app: AppIdentifier; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getAppMetadata request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetAppMetadataResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetAppMetadataResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetAppMetadataResponsePayload { + error?: FindInstancesErrors; + appMetadata?: AppMetadata; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to return the Channel object for the current User channel membership. Returns + * `null` if the app is not joined to a channel. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetCurrentChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetCurrentChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getCurrentChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetCurrentChannelRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getCurrentChannel request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetCurrentChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetCurrentChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getCurrentChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetCurrentChannelResponsePayload { + error?: ResponsePayloadError; + channel?: Channel | null; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to return the current context (either of a specified type or most recent + * broadcast) of a specified Channel. Returns `null` if no context (of the requested type if + * one was specified) is available in the channel. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetCurrentContextRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetCurrentContextRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getCurrentContextRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetCurrentContextRequestPayload { + /** + * The id of the channel to return the current context of + */ + channelId: string; + /** + * The type of context to return for OR `null` indicating that the most recently broadcast + * context on the channel should be returned. + */ + contextType: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getCurrentContext request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetCurrentContextResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetCurrentContextResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getCurrentContextResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetCurrentContextResponsePayload { + error?: PurpleError; + /** + * The most recently broadcast context object (of the specified type, if one was specified), + * or `null` if none was available in the channel + */ + context?: null | Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to retrieve information about the FDC3 Desktop Agent implementation and the + * metadata of the calling application according to the desktop agent. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetInfoRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetInfoRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getInfoRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetInfoRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getInfo request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetInfoResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetInfoResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getInfoResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetInfoResponsePayload { + error?: ResponsePayloadError; + implementationMetadata?: ImplementationMetadata; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to return a Channel with an auto-generated identity that is intended for private + * communication between applications. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetOrCreateChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetOrCreateChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getOrCreateChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetOrCreateChannelRequestPayload { + /** + * The id of the channel to return + */ + channelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getOrCreateChannel request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetOrCreateChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetOrCreateChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getOrCreateChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetOrCreateChannelResponsePayload { + error?: PurpleError; + channel?: Channel; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to retrieve a list of the User Channels available for the app to join. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetUserChannelsRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetUserChannelsRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getUserChannelsRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetUserChannelsRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getUserChannels request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetUserChannelsResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetUserChannelsResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getUserChannelsResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetUserChannelsResponsePayload { + error?: PurpleError; + userChannels?: Channel[]; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Message from the channel selector UI to the DA proxy when the user drags the selector to + * a new location. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeChannelDrag { + /** + * The message payload + */ + payload: IframeChannelDragPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeChannelDrag"; +} + +/** + * The message payload + */ +export interface IframeChannelDragPayload { + /** + * The offset to move the frame by + */ + mouse: MouseClass; +} + +/** + * The offset to move the frame by + */ +export interface MouseClass { + offsetX: number; + offsetY: number; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Message from the channel selector UI to the DA proxy when the user hits a toggle button + * that opens or closes the selector or otherwise resizes it. Includes the size that it + * should change to and the corner (if any) at which the change should be made. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeChannelResize { + /** + * The message payload + */ + payload: IframeChannelResizePayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeChannelResize"; +} + +/** + * The message payload + */ +export interface IframeChannelResizePayload { + /** + * The updated dimensions of the UI + */ + dimensions: DimensionsClass; + /** + * When resizing anchor at the indicated location, + * e.g. + * - for top-left and a larger size: the bottom right corner should move down and out. + * - for top and smaller size: both the bottom corners should move in and up. + */ + resizeAnchor: Resizing; +} + +/** + * The updated dimensions of the UI + */ +export interface DimensionsClass { + height: number; + width: number; +} + +/** + * When resizing anchor at the indicated location, + * e.g. + * - for top-left and a larger size: the bottom right corner should move down and out. + * - for top and smaller size: both the bottom corners should move in and up. + */ +export type Resizing = "top-left" | "top" | "top-right" | "right" | "bottom-right" | "bottom" | "bottom-left" | "left" | "center"; + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Message from the channel selector UI to the DA proxy sent when the channel selection + * changes. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeChannelSelected { + /** + * The message payload + */ + payload: IframeChannelSelectedPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeChannelSelected"; +} + +/** + * The message payload + */ +export interface IframeChannelSelectedPayload { + /** + * The id of the channel that should be currently selected, or `null` if none should be + * selected + */ + selected: null | string; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Setup message sent by the DA proxy code in getAgent() to a channel selector UI in an + * iframe with the channel definitions and current channel selection. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeChannels { + /** + * The message payload + */ + payload: IframeChannelsPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeChannels"; +} + +/** + * The message payload + */ +export interface IframeChannelsPayload { + /** + * If the channel selector was previously displayed in this window its location may be + * restored by setting the location coordinates + */ + location?: Location; + /** + * The id of the channel that should be currently selected, or `null` if none should be + * selected + */ + selected: null | string; + /** + * User Channel definitions + */ + userChannels: Channel[]; +} + +/** + * If the channel selector was previously displayed in this window its location may be + * restored by setting the location coordinates + */ +export interface Location { + x: number; + y: number; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Handshake message sent back by an iframe to the DA proxy code indicating that it is setup + * and ready to communicate over the MessagePort. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeHandshake { + /** + * The message payload + */ + payload: IframeHandshakePayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeHandshake"; +} + +/** + * The message payload + */ +export interface IframeHandshakePayload { + /** + * Details about the UI implementation in the iframe, such as vendor and version, for + * logging purposes. + */ + implementationDetails: string; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Hello message sent by the DA proxy code in getAgent() to an iframe, that it has injected + * into the page, with a MessagePort appended that should be used for subsequent + * communication steps. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeHello { + /** + * The message payload + */ + payload: IframeHelloPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeHello"; +} + +/** + * The message payload + */ +export interface IframeHelloPayload { + /** + * The version of FDC3 API that the Desktop Agent proxy is providing support for. + */ + fdc3Version: string; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeMessage { + /** + * The message payload + */ + payload?: { [key: string]: any }; + /** + * Identifies the type of the message to or from the iframe. + */ + type: IframeMessageType; +} + +/** + * Identifies the type of the message to or from the iframe. + */ +export type IframeMessageType = "iframeHello" | "iframeHandshake" | "iframeResolve" | "iframeResolveAction" | "iframeChannels" | "iframeChannelSelected" | "iframeChannelResize" | "iframeChannelDrag"; + +/** + * Setup message sent by the DA proxy code in getAgent() to an intent resolver UI in an + * iframe with the resolver data to setup the UI. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeResolve { + /** + * The message payload + */ + payload: IframeResolvePayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeResolve"; +} + +/** + * The message payload + */ +export interface IframeResolvePayload { + /** + * An array of AppIntent objects defining the resolution options. + */ + appIntents: AppIntent[]; + context: Context; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Message from an intent resolver UI in an iframe to DA proxy code in getAgent() reporting + * a user action. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeResolveAction { + /** + * The message payload + */ + payload: IframeResolveActionPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeResolveAction"; +} + +/** + * The message payload + */ +export interface IframeResolveActionPayload { + action: Action; + /** + * The App resolution option chosen + */ + appIdentifier?: AppIdentifier; + /** + * The intent resolved + */ + intent?: string; +} + +export type Action = "hover" | "click" | "cancel"; + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * An event message from the Desktop Agent to an app indicating that it has been selected to + * resolve a raised intent and context. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface IntentEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: IntentEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "intentEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface IntentEventPayload { + /** + * The context object passed with the raised intent. + */ + context: Context; + /** + * The intent that was raised. + */ + intent: string; + /** + * Details of the application instance that raised the intent + */ + originatingApp?: AppIdentifier; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to unsubscribe a context listener. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface IntentListenerUnsubscribeRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: IntentListenerUnsubscribeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "intentListenerUnsubscribeRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface IntentListenerUnsubscribeRequestPayload { + listenerUUID: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a intentListenerUnsubscribe request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface IntentListenerUnsubscribeResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "intentListenerUnsubscribeResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to deliver a result for an intent (which may include a `void` result that just + * indicates that the handler has run, returning no result). + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface IntentResultRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: IntentResultRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "intentResultRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface IntentResultRequestPayload { + intentResult: PurpleIntentResult; +} + +export interface PurpleIntentResult { + context?: Context; + channel?: Channel; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a request to deliver an intent result. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface IntentResultResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "intentResultResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to join the app to the specified User channel. On successfully joining a channel, + * client code should make subsequent requests to get the current context of that channel + * for all registered context listeners and then call their handlers with it. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface JoinUserChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: JoinUserChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "joinUserChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface JoinUserChannelRequestPayload { + /** + * The id of the channel to join + */ + channelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a joinUserChannel request. On receipt of this response, client code should + * make subsequent requests to get the current context of that channel for all registered + * context listeners and then call their handlers with it. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface JoinUserChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: JoinUserChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "joinUserChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface JoinUserChannelResponsePayload { + error?: PurpleError; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to remove the app from any User channel membership. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface LeaveCurrentChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: LeaveCurrentChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "leaveCurrentChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface LeaveCurrentChannelRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a leaveCurrentChannel request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface LeaveCurrentChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: LeaveCurrentChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "leaveCurrentChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface LeaveCurrentChannelResponsePayload { + error?: PurpleError; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to open an application. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface OpenRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: OpenRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "openRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface OpenRequestPayload { + app: AppIdentifier; + /** + * If a Context object is passed in, this object will be provided to the opened application + * via a contextListener. The Context argument is functionally equivalent to opening the + * target app with no context and broadcasting the context directly to it. + */ + context?: Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a open request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface OpenResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: OpenResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface OpenResponsePayload { + error?: OpenErrorResponsePayload; + appIdentifier?: AppIdentifier; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type OpenErrorResponsePayload = "MalformedContext" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request that indicates that a participant will no longer interact with a specified + * `PrivateChannel`. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface PrivateChannelDisconnectRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelDisconnectRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "privateChannelDisconnectRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelDisconnectRequestPayload { + /** + * The Id of the Channel that should be disconnected from + */ + channelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a privateChannelDisconnect request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface PrivateChannelDisconnectResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: PrivateChannelDisconnectResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelDisconnectResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface PrivateChannelDisconnectResponsePayload { + error?: PurpleError; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app indicating that another app has added a + * context listener to a specific PrivateChannel. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface PrivateChannelOnAddContextListenerEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: PrivateChannelOnAddContextListenerEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelOnAddContextListenerEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface PrivateChannelOnAddContextListenerEventPayload { + /** + * The type of the context listener added to the channel by another app, or null if it will + * listen to all types. + */ + contextType: null | string; + /** + * The Id of the PrivateChannel that the listener was added to. + */ + privateChannelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app indicating that another app has + * disconnected from a specific PrivateChannel and will no longer interact with it. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface PrivateChannelOnDisconnectEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: PrivateChannelOnDisconnectEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelOnDisconnectEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface PrivateChannelOnDisconnectEventPayload { + /** + * The Id of the PrivateChannel that the app has disconnected from. + */ + privateChannelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app indicating that another app has + * unsubscribed a context listener from a specific PrivateChannel. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface PrivateChannelOnUnsubscribeEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: PrivateChannelOnUnsubscribeEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelOnUnsubscribeEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface PrivateChannelOnUnsubscribeEventPayload { + /** + * The type of the context listener unsubscribed from the channel by another app, or null if + * it was listening to all types. + */ + contextType: null | string; + /** + * The Id of the PrivateChannel that the listener was unsubscribed from. + */ + privateChannelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to unsubscribe a context listener. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface PrivateChannelUnsubscribeEventListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelUnsubscribeEventListenerRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "privateChannelUnsubscribeEventListenerRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelUnsubscribeEventListenerRequestPayload { + listenerUUID: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a privateChannelUnsubscribeEventListener request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface PrivateChannelUnsubscribeEventListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelUnsubscribeEventListenerResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to add an event listener to a specific PrivateChannel. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface PrivateChannelAddEventListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: TPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "privateChannelAddEventListenerRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface TPayload { + /** + * The type of PrivateChannel event that the listener should be applied to. + */ + listenerType: PrivateChannelEventListenerTypes; + /** + * The Id of the PrivateChannel that the listener should be added to. + */ + privateChannelId: string; +} + +/** + * The type of PrivateChannel event that the listener should be applied to. + * + * Event listener type names for Private Channel events + */ +export type PrivateChannelEventListenerTypes = "onAddContextListener" | "onUnsubscribe" | "onDisconnect"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a privateChannelAddEventListener request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface PrivateChannelAddEventListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: PrivateChannelAddEventListenerResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelAddEventListenerResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface PrivateChannelAddEventListenerResponsePayload { + error?: PurpleError; + listenerUUID?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to raise an unspecified intent for a specified context. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface RaiseIntentForContextRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: RaiseIntentForContextRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "raiseIntentForContextRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface RaiseIntentForContextRequestPayload { + app?: AppIdentifier; + context: Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a raiseIntentForContext request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface RaiseIntentForContextResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * There are 3 possible responses to a raiseIntentForContext request, each of which sets a + * single property in the payload: Success (`intentResolution`), Needs further resolution + * (`appIntents`) or Error (`error`). + */ + payload: RaiseIntentForContextResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentForContextResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * There are 3 possible responses to a raiseIntentForContext request, each of which sets a + * single property in the payload: Success (`intentResolution`), Needs further resolution + * (`appIntents`) or Error (`error`). + * + * Response to a raiseIntentForContext request that needs additional resolution (i.e. show + * an intent resolver UI) + * + * Used if a raiseIntent request resulted in an error + */ +export interface RaiseIntentForContextResponsePayload { + /** + * Should be set if the raiseIntent request returned an error. + */ + error?: FindInstancesErrors; + /** + * Used if the raiseIntent request was successfully resolved + */ + intentResolution?: IntentResolution; + /** + * Used if a raiseIntentForContext request requires additional resolution (e.g. by showing + * an intent resolver) before it can be handled. + */ + appIntents?: AppIntent[]; +} + +/** + * Used if the raiseIntent request was successfully resolved + * + * IntentResolution provides a standard format for data returned upon resolving an intent. + * + * ```javascript + * //resolve a "Chain" type intent + * let resolution = await agent.raiseIntent("intentName", context); + * + * //resolve a "Client-Service" type intent with a data response or a Channel + * let resolution = await agent.raiseIntent("intentName", context); + * try { + * const result = await resolution.getResult(); + * if (result && result.broadcast) { + * console.log(`${resolution.source} returned a channel with id ${result.id}`); + * } else if (result){ + * console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`); + * } else { + * console.error(`${resolution.source} didn't return data` + * } + * } catch(error) { + * console.error(`${resolution.source} returned an error: ${error}`); + * } + * + * // Use metadata about the resolving app instance to target a further intent + * await agent.raiseIntent("intentName", context, resolution.source); + * ``` + */ +export interface IntentResolution { + /** + * The intent that was raised. May be used to determine which intent the user + * chose in response to `fdc3.raiseIntentForContext()`. + */ + intent: string; + /** + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ + source: AppIdentifier; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to raise an intent for a context. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface RaiseIntentRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: RaiseIntentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "raiseIntentRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface RaiseIntentRequestPayload { + app?: AppIdentifier; + context: Context; + intent: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a raiseIntent request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface RaiseIntentResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * There are 3 possible responses to a raiseIntent request, each of which sets a single + * property in the payload: Success (`intentResolution`), Needs further resolution + * (`appIntent`) or Error (`error`). + */ + payload: RaiseIntentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * There are 3 possible responses to a raiseIntent request, each of which sets a single + * property in the payload: Success (`intentResolution`), Needs further resolution + * (`appIntent`) or Error (`error`). + * + * Response to a raiseIntent request that needs additional resolution (i.e. show an intent + * resolver UI). + * + * Used if a raiseIntent request resulted in an error + */ +export interface RaiseIntentResponsePayload { + /** + * Should be set if the raiseIntent request returned an error. + */ + error?: FindInstancesErrors; + /** + * Used if the raiseIntent request was successfully resolved + */ + intentResolution?: IntentResolution; + /** + * Used if a raiseIntent request requires additional resolution (e.g. by showing an intent + * resolver) before it can be handled. + */ + appIntent?: AppIntent; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A secondary response to a request to raise an intent used to deliver the intent result. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface RaiseIntentResultResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: RaiseIntentResultResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface RaiseIntentResultResponsePayload { + error?: ResponsePayloadError; + intentResult?: FluffyIntentResult; +} + +export interface FluffyIntentResult { + context?: Context; + channel?: Channel; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +// Converts JSON strings to/from your types +// and asserts the results of JSON.parse at runtime +export class Convert { + public static toWebConnectionProtocol1Hello(json: string): WebConnectionProtocol1Hello { + return cast(JSON.parse(json), r("WebConnectionProtocol1Hello")); + } + + public static webConnectionProtocol1HelloToJson(value: WebConnectionProtocol1Hello): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol1Hello")), null, 2); + } + + public static toWebConnectionProtocol2LoadURL(json: string): WebConnectionProtocol2LoadURL { + return cast(JSON.parse(json), r("WebConnectionProtocol2LoadURL")); + } + + public static webConnectionProtocol2LoadURLToJson(value: WebConnectionProtocol2LoadURL): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol2LoadURL")), null, 2); + } + + public static toWebConnectionProtocol3Handshake(json: string): WebConnectionProtocol3Handshake { + return cast(JSON.parse(json), r("WebConnectionProtocol3Handshake")); + } + + public static webConnectionProtocol3HandshakeToJson(value: WebConnectionProtocol3Handshake): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol3Handshake")), null, 2); + } + + public static toWebConnectionProtocol4ValidateAppIdentity(json: string): WebConnectionProtocol4ValidateAppIdentity { + return cast(JSON.parse(json), r("WebConnectionProtocol4ValidateAppIdentity")); + } + + public static webConnectionProtocol4ValidateAppIdentityToJson(value: WebConnectionProtocol4ValidateAppIdentity): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol4ValidateAppIdentity")), null, 2); + } + + public static toWebConnectionProtocol5ValidateAppIdentityFailedResponse(json: string): WebConnectionProtocol5ValidateAppIdentityFailedResponse { + return cast(JSON.parse(json), r("WebConnectionProtocol5ValidateAppIdentityFailedResponse")); + } + + public static webConnectionProtocol5ValidateAppIdentityFailedResponseToJson(value: WebConnectionProtocol5ValidateAppIdentityFailedResponse): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol5ValidateAppIdentityFailedResponse")), null, 2); + } + + public static toWebConnectionProtocol5ValidateAppIdentitySuccessResponse(json: string): WebConnectionProtocol5ValidateAppIdentitySuccessResponse { + return cast(JSON.parse(json), r("WebConnectionProtocol5ValidateAppIdentitySuccessResponse")); + } + + public static webConnectionProtocol5ValidateAppIdentitySuccessResponseToJson(value: WebConnectionProtocol5ValidateAppIdentitySuccessResponse): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol5ValidateAppIdentitySuccessResponse")), null, 2); + } + + public static toWebConnectionProtocol6Goodbye(json: string): WebConnectionProtocol6Goodbye { + return cast(JSON.parse(json), r("WebConnectionProtocol6Goodbye")); + } + + public static webConnectionProtocol6GoodbyeToJson(value: WebConnectionProtocol6Goodbye): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol6Goodbye")), null, 2); + } + + public static toWebConnectionProtocolMessage(json: string): WebConnectionProtocolMessage { + return cast(JSON.parse(json), r("WebConnectionProtocolMessage")); + } + + public static webConnectionProtocolMessageToJson(value: WebConnectionProtocolMessage): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocolMessage")), null, 2); + } + + public static toAddContextListenerRequest(json: string): AddContextListenerRequest { + return cast(JSON.parse(json), r("AddContextListenerRequest")); + } + + public static addContextListenerRequestToJson(value: AddContextListenerRequest): string { + return JSON.stringify(uncast(value, r("AddContextListenerRequest")), null, 2); + } + + public static toAddContextListenerResponse(json: string): AddContextListenerResponse { + return cast(JSON.parse(json), r("AddContextListenerResponse")); + } + + public static addContextListenerResponseToJson(value: AddContextListenerResponse): string { + return JSON.stringify(uncast(value, r("AddContextListenerResponse")), null, 2); + } + + public static toAddEventListenerEvent(json: string): AddEventListenerEvent { + return cast(JSON.parse(json), r("AddEventListenerEvent")); + } + + public static addEventListenerEventToJson(value: AddEventListenerEvent): string { + return JSON.stringify(uncast(value, r("AddEventListenerEvent")), null, 2); + } + + public static toAddEventListenerRequest(json: string): AddEventListenerRequest { + return cast(JSON.parse(json), r("AddEventListenerRequest")); + } + + public static addEventListenerRequestToJson(value: AddEventListenerRequest): string { + return JSON.stringify(uncast(value, r("AddEventListenerRequest")), null, 2); + } + + public static toAddEventListenerResponse(json: string): AddEventListenerResponse { + return cast(JSON.parse(json), r("AddEventListenerResponse")); + } + + public static addEventListenerResponseToJson(value: AddEventListenerResponse): string { + return JSON.stringify(uncast(value, r("AddEventListenerResponse")), null, 2); + } + + public static toAddIntentListenerRequest(json: string): AddIntentListenerRequest { + return cast(JSON.parse(json), r("AddIntentListenerRequest")); + } + + public static addIntentListenerRequestToJson(value: AddIntentListenerRequest): string { + return JSON.stringify(uncast(value, r("AddIntentListenerRequest")), null, 2); + } + + public static toAddIntentListenerResponse(json: string): AddIntentListenerResponse { + return cast(JSON.parse(json), r("AddIntentListenerResponse")); + } + + public static addIntentListenerResponseToJson(value: AddIntentListenerResponse): string { + return JSON.stringify(uncast(value, r("AddIntentListenerResponse")), null, 2); + } + + public static toAgentEventMessage(json: string): AgentEventMessage { + return cast(JSON.parse(json), r("AgentEventMessage")); + } + + public static agentEventMessageToJson(value: AgentEventMessage): string { + return JSON.stringify(uncast(value, r("AgentEventMessage")), null, 2); + } + + public static toAgentResponseMessage(json: string): AgentResponseMessage { + return cast(JSON.parse(json), r("AgentResponseMessage")); + } + + public static agentResponseMessageToJson(value: AgentResponseMessage): string { + return JSON.stringify(uncast(value, r("AgentResponseMessage")), null, 2); + } + + public static toAppRequestMessage(json: string): AppRequestMessage { + return cast(JSON.parse(json), r("AppRequestMessage")); + } + + public static appRequestMessageToJson(value: AppRequestMessage): string { + return JSON.stringify(uncast(value, r("AppRequestMessage")), null, 2); + } + + public static toBroadcastEvent(json: string): BroadcastEvent { + return cast(JSON.parse(json), r("BroadcastEvent")); + } + + public static broadcastEventToJson(value: BroadcastEvent): string { + return JSON.stringify(uncast(value, r("BroadcastEvent")), null, 2); + } + + public static toBroadcastRequest(json: string): BroadcastRequest { + return cast(JSON.parse(json), r("BroadcastRequest")); + } + + public static broadcastRequestToJson(value: BroadcastRequest): string { + return JSON.stringify(uncast(value, r("BroadcastRequest")), null, 2); + } + + public static toBroadcastResponse(json: string): BroadcastResponse { + return cast(JSON.parse(json), r("BroadcastResponse")); + } + + public static broadcastResponseToJson(value: BroadcastResponse): string { + return JSON.stringify(uncast(value, r("BroadcastResponse")), null, 2); + } + + public static toChannelChangedEvent(json: string): ChannelChangedEvent { + return cast(JSON.parse(json), r("ChannelChangedEvent")); + } + + public static channelChangedEventToJson(value: ChannelChangedEvent): string { + return JSON.stringify(uncast(value, r("ChannelChangedEvent")), null, 2); + } + + public static toContextListenerUnsubscribeRequest(json: string): ContextListenerUnsubscribeRequest { + return cast(JSON.parse(json), r("ContextListenerUnsubscribeRequest")); + } + + public static contextListenerUnsubscribeRequestToJson(value: ContextListenerUnsubscribeRequest): string { + return JSON.stringify(uncast(value, r("ContextListenerUnsubscribeRequest")), null, 2); + } + + public static toContextListenerUnsubscribeResponse(json: string): ContextListenerUnsubscribeResponse { + return cast(JSON.parse(json), r("ContextListenerUnsubscribeResponse")); + } + + public static contextListenerUnsubscribeResponseToJson(value: ContextListenerUnsubscribeResponse): string { + return JSON.stringify(uncast(value, r("ContextListenerUnsubscribeResponse")), null, 2); + } + + public static toCreatePrivateChannelRequest(json: string): CreatePrivateChannelRequest { + return cast(JSON.parse(json), r("CreatePrivateChannelRequest")); + } + + public static createPrivateChannelRequestToJson(value: CreatePrivateChannelRequest): string { + return JSON.stringify(uncast(value, r("CreatePrivateChannelRequest")), null, 2); + } + + public static toCreatePrivateChannelResponse(json: string): CreatePrivateChannelResponse { + return cast(JSON.parse(json), r("CreatePrivateChannelResponse")); + } + + public static createPrivateChannelResponseToJson(value: CreatePrivateChannelResponse): string { + return JSON.stringify(uncast(value, r("CreatePrivateChannelResponse")), null, 2); + } + + public static toEventListenerUnsubscribeRequest(json: string): EventListenerUnsubscribeRequest { + return cast(JSON.parse(json), r("EventListenerUnsubscribeRequest")); + } + + public static eventListenerUnsubscribeRequestToJson(value: EventListenerUnsubscribeRequest): string { + return JSON.stringify(uncast(value, r("EventListenerUnsubscribeRequest")), null, 2); + } + + public static toEventListenerUnsubscribeResponse(json: string): EventListenerUnsubscribeResponse { + return cast(JSON.parse(json), r("EventListenerUnsubscribeResponse")); + } + + public static eventListenerUnsubscribeResponseToJson(value: EventListenerUnsubscribeResponse): string { + return JSON.stringify(uncast(value, r("EventListenerUnsubscribeResponse")), null, 2); + } + + public static toFindInstancesRequest(json: string): FindInstancesRequest { + return cast(JSON.parse(json), r("FindInstancesRequest")); + } + + public static findInstancesRequestToJson(value: FindInstancesRequest): string { + return JSON.stringify(uncast(value, r("FindInstancesRequest")), null, 2); + } + + public static toFindInstancesResponse(json: string): FindInstancesResponse { + return cast(JSON.parse(json), r("FindInstancesResponse")); + } + + public static findInstancesResponseToJson(value: FindInstancesResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesResponse")), null, 2); + } + + public static toFindIntentRequest(json: string): FindIntentRequest { + return cast(JSON.parse(json), r("FindIntentRequest")); + } + + public static findIntentRequestToJson(value: FindIntentRequest): string { + return JSON.stringify(uncast(value, r("FindIntentRequest")), null, 2); + } + + public static toFindIntentResponse(json: string): FindIntentResponse { + return cast(JSON.parse(json), r("FindIntentResponse")); + } + + public static findIntentResponseToJson(value: FindIntentResponse): string { + return JSON.stringify(uncast(value, r("FindIntentResponse")), null, 2); + } + + public static toFindIntentsByContextRequest(json: string): FindIntentsByContextRequest { + return cast(JSON.parse(json), r("FindIntentsByContextRequest")); + } + + public static findIntentsByContextRequestToJson(value: FindIntentsByContextRequest): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextRequest")), null, 2); + } + + public static toFindIntentsByContextResponse(json: string): FindIntentsByContextResponse { + return cast(JSON.parse(json), r("FindIntentsByContextResponse")); + } + + public static findIntentsByContextResponseToJson(value: FindIntentsByContextResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextResponse")), null, 2); + } + + public static toGetAppMetadataRequest(json: string): GetAppMetadataRequest { + return cast(JSON.parse(json), r("GetAppMetadataRequest")); + } + + public static getAppMetadataRequestToJson(value: GetAppMetadataRequest): string { + return JSON.stringify(uncast(value, r("GetAppMetadataRequest")), null, 2); + } + + public static toGetAppMetadataResponse(json: string): GetAppMetadataResponse { + return cast(JSON.parse(json), r("GetAppMetadataResponse")); + } + + public static getAppMetadataResponseToJson(value: GetAppMetadataResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataResponse")), null, 2); + } + + public static toGetCurrentChannelRequest(json: string): GetCurrentChannelRequest { + return cast(JSON.parse(json), r("GetCurrentChannelRequest")); + } + + public static getCurrentChannelRequestToJson(value: GetCurrentChannelRequest): string { + return JSON.stringify(uncast(value, r("GetCurrentChannelRequest")), null, 2); + } + + public static toGetCurrentChannelResponse(json: string): GetCurrentChannelResponse { + return cast(JSON.parse(json), r("GetCurrentChannelResponse")); + } + + public static getCurrentChannelResponseToJson(value: GetCurrentChannelResponse): string { + return JSON.stringify(uncast(value, r("GetCurrentChannelResponse")), null, 2); + } + + public static toGetCurrentContextRequest(json: string): GetCurrentContextRequest { + return cast(JSON.parse(json), r("GetCurrentContextRequest")); + } + + public static getCurrentContextRequestToJson(value: GetCurrentContextRequest): string { + return JSON.stringify(uncast(value, r("GetCurrentContextRequest")), null, 2); + } + + public static toGetCurrentContextResponse(json: string): GetCurrentContextResponse { + return cast(JSON.parse(json), r("GetCurrentContextResponse")); + } + + public static getCurrentContextResponseToJson(value: GetCurrentContextResponse): string { + return JSON.stringify(uncast(value, r("GetCurrentContextResponse")), null, 2); + } + + public static toGetInfoRequest(json: string): GetInfoRequest { + return cast(JSON.parse(json), r("GetInfoRequest")); + } + + public static getInfoRequestToJson(value: GetInfoRequest): string { + return JSON.stringify(uncast(value, r("GetInfoRequest")), null, 2); + } + + public static toGetInfoResponse(json: string): GetInfoResponse { + return cast(JSON.parse(json), r("GetInfoResponse")); + } + + public static getInfoResponseToJson(value: GetInfoResponse): string { + return JSON.stringify(uncast(value, r("GetInfoResponse")), null, 2); + } + + public static toGetOrCreateChannelRequest(json: string): GetOrCreateChannelRequest { + return cast(JSON.parse(json), r("GetOrCreateChannelRequest")); + } + + public static getOrCreateChannelRequestToJson(value: GetOrCreateChannelRequest): string { + return JSON.stringify(uncast(value, r("GetOrCreateChannelRequest")), null, 2); + } + + public static toGetOrCreateChannelResponse(json: string): GetOrCreateChannelResponse { + return cast(JSON.parse(json), r("GetOrCreateChannelResponse")); + } + + public static getOrCreateChannelResponseToJson(value: GetOrCreateChannelResponse): string { + return JSON.stringify(uncast(value, r("GetOrCreateChannelResponse")), null, 2); + } + + public static toGetUserChannelsRequest(json: string): GetUserChannelsRequest { + return cast(JSON.parse(json), r("GetUserChannelsRequest")); + } + + public static getUserChannelsRequestToJson(value: GetUserChannelsRequest): string { + return JSON.stringify(uncast(value, r("GetUserChannelsRequest")), null, 2); + } + + public static toGetUserChannelsResponse(json: string): GetUserChannelsResponse { + return cast(JSON.parse(json), r("GetUserChannelsResponse")); + } + + public static getUserChannelsResponseToJson(value: GetUserChannelsResponse): string { + return JSON.stringify(uncast(value, r("GetUserChannelsResponse")), null, 2); + } + + public static toIframeChannelDrag(json: string): IframeChannelDrag { + return cast(JSON.parse(json), r("IframeChannelDrag")); + } + + public static iframeChannelDragToJson(value: IframeChannelDrag): string { + return JSON.stringify(uncast(value, r("IframeChannelDrag")), null, 2); + } + + public static toIframeChannelResize(json: string): IframeChannelResize { + return cast(JSON.parse(json), r("IframeChannelResize")); + } + + public static iframeChannelResizeToJson(value: IframeChannelResize): string { + return JSON.stringify(uncast(value, r("IframeChannelResize")), null, 2); + } + + public static toIframeChannelSelected(json: string): IframeChannelSelected { + return cast(JSON.parse(json), r("IframeChannelSelected")); + } + + public static iframeChannelSelectedToJson(value: IframeChannelSelected): string { + return JSON.stringify(uncast(value, r("IframeChannelSelected")), null, 2); + } + + public static toIframeChannels(json: string): IframeChannels { + return cast(JSON.parse(json), r("IframeChannels")); + } + + public static iframeChannelsToJson(value: IframeChannels): string { + return JSON.stringify(uncast(value, r("IframeChannels")), null, 2); + } + + public static toIframeHandshake(json: string): IframeHandshake { + return cast(JSON.parse(json), r("IframeHandshake")); + } + + public static iframeHandshakeToJson(value: IframeHandshake): string { + return JSON.stringify(uncast(value, r("IframeHandshake")), null, 2); + } + + public static toIframeHello(json: string): IframeHello { + return cast(JSON.parse(json), r("IframeHello")); + } + + public static iframeHelloToJson(value: IframeHello): string { + return JSON.stringify(uncast(value, r("IframeHello")), null, 2); + } + + public static toIframeMessage(json: string): IframeMessage { + return cast(JSON.parse(json), r("IframeMessage")); + } + + public static iframeMessageToJson(value: IframeMessage): string { + return JSON.stringify(uncast(value, r("IframeMessage")), null, 2); + } + + public static toIframeResolve(json: string): IframeResolve { + return cast(JSON.parse(json), r("IframeResolve")); + } + + public static iframeResolveToJson(value: IframeResolve): string { + return JSON.stringify(uncast(value, r("IframeResolve")), null, 2); + } + + public static toIframeResolveAction(json: string): IframeResolveAction { + return cast(JSON.parse(json), r("IframeResolveAction")); + } + + public static iframeResolveActionToJson(value: IframeResolveAction): string { + return JSON.stringify(uncast(value, r("IframeResolveAction")), null, 2); + } + + public static toIntentEvent(json: string): IntentEvent { + return cast(JSON.parse(json), r("IntentEvent")); + } + + public static intentEventToJson(value: IntentEvent): string { + return JSON.stringify(uncast(value, r("IntentEvent")), null, 2); + } + + public static toIntentListenerUnsubscribeRequest(json: string): IntentListenerUnsubscribeRequest { + return cast(JSON.parse(json), r("IntentListenerUnsubscribeRequest")); + } + + public static intentListenerUnsubscribeRequestToJson(value: IntentListenerUnsubscribeRequest): string { + return JSON.stringify(uncast(value, r("IntentListenerUnsubscribeRequest")), null, 2); + } + + public static toIntentListenerUnsubscribeResponse(json: string): IntentListenerUnsubscribeResponse { + return cast(JSON.parse(json), r("IntentListenerUnsubscribeResponse")); + } + + public static intentListenerUnsubscribeResponseToJson(value: IntentListenerUnsubscribeResponse): string { + return JSON.stringify(uncast(value, r("IntentListenerUnsubscribeResponse")), null, 2); + } + + public static toIntentResultRequest(json: string): IntentResultRequest { + return cast(JSON.parse(json), r("IntentResultRequest")); + } + + public static intentResultRequestToJson(value: IntentResultRequest): string { + return JSON.stringify(uncast(value, r("IntentResultRequest")), null, 2); + } + + public static toIntentResultResponse(json: string): IntentResultResponse { + return cast(JSON.parse(json), r("IntentResultResponse")); + } + + public static intentResultResponseToJson(value: IntentResultResponse): string { + return JSON.stringify(uncast(value, r("IntentResultResponse")), null, 2); + } + + public static toJoinUserChannelRequest(json: string): JoinUserChannelRequest { + return cast(JSON.parse(json), r("JoinUserChannelRequest")); + } + + public static joinUserChannelRequestToJson(value: JoinUserChannelRequest): string { + return JSON.stringify(uncast(value, r("JoinUserChannelRequest")), null, 2); + } + + public static toJoinUserChannelResponse(json: string): JoinUserChannelResponse { + return cast(JSON.parse(json), r("JoinUserChannelResponse")); + } + + public static joinUserChannelResponseToJson(value: JoinUserChannelResponse): string { + return JSON.stringify(uncast(value, r("JoinUserChannelResponse")), null, 2); + } + + public static toLeaveCurrentChannelRequest(json: string): LeaveCurrentChannelRequest { + return cast(JSON.parse(json), r("LeaveCurrentChannelRequest")); + } + + public static leaveCurrentChannelRequestToJson(value: LeaveCurrentChannelRequest): string { + return JSON.stringify(uncast(value, r("LeaveCurrentChannelRequest")), null, 2); + } + + public static toLeaveCurrentChannelResponse(json: string): LeaveCurrentChannelResponse { + return cast(JSON.parse(json), r("LeaveCurrentChannelResponse")); + } + + public static leaveCurrentChannelResponseToJson(value: LeaveCurrentChannelResponse): string { + return JSON.stringify(uncast(value, r("LeaveCurrentChannelResponse")), null, 2); + } + + public static toOpenRequest(json: string): OpenRequest { + return cast(JSON.parse(json), r("OpenRequest")); + } + + public static openRequestToJson(value: OpenRequest): string { + return JSON.stringify(uncast(value, r("OpenRequest")), null, 2); + } + + public static toOpenResponse(json: string): OpenResponse { + return cast(JSON.parse(json), r("OpenResponse")); + } + + public static openResponseToJson(value: OpenResponse): string { + return JSON.stringify(uncast(value, r("OpenResponse")), null, 2); + } + + public static toPrivateChannelDisconnectRequest(json: string): PrivateChannelDisconnectRequest { + return cast(JSON.parse(json), r("PrivateChannelDisconnectRequest")); + } + + public static privateChannelDisconnectRequestToJson(value: PrivateChannelDisconnectRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelDisconnectRequest")), null, 2); + } + + public static toPrivateChannelDisconnectResponse(json: string): PrivateChannelDisconnectResponse { + return cast(JSON.parse(json), r("PrivateChannelDisconnectResponse")); + } + + public static privateChannelDisconnectResponseToJson(value: PrivateChannelDisconnectResponse): string { + return JSON.stringify(uncast(value, r("PrivateChannelDisconnectResponse")), null, 2); + } + + public static toPrivateChannelOnAddContextListenerEvent(json: string): PrivateChannelOnAddContextListenerEvent { + return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerEvent")); + } + + public static privateChannelOnAddContextListenerEventToJson(value: PrivateChannelOnAddContextListenerEvent): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerEvent")), null, 2); + } + + public static toPrivateChannelOnDisconnectEvent(json: string): PrivateChannelOnDisconnectEvent { + return cast(JSON.parse(json), r("PrivateChannelOnDisconnectEvent")); + } + + public static privateChannelOnDisconnectEventToJson(value: PrivateChannelOnDisconnectEvent): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectEvent")), null, 2); + } + + public static toPrivateChannelOnUnsubscribeEvent(json: string): PrivateChannelOnUnsubscribeEvent { + return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeEvent")); + } + + public static privateChannelOnUnsubscribeEventToJson(value: PrivateChannelOnUnsubscribeEvent): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeEvent")), null, 2); + } + + public static toPrivateChannelUnsubscribeEventListenerRequest(json: string): PrivateChannelUnsubscribeEventListenerRequest { + return cast(JSON.parse(json), r("PrivateChannelUnsubscribeEventListenerRequest")); + } + + public static privateChannelUnsubscribeEventListenerRequestToJson(value: PrivateChannelUnsubscribeEventListenerRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelUnsubscribeEventListenerRequest")), null, 2); + } + + public static toPrivateChannelUnsubscribeEventListenerResponse(json: string): PrivateChannelUnsubscribeEventListenerResponse { + return cast(JSON.parse(json), r("PrivateChannelUnsubscribeEventListenerResponse")); + } + + public static privateChannelUnsubscribeEventListenerResponseToJson(value: PrivateChannelUnsubscribeEventListenerResponse): string { + return JSON.stringify(uncast(value, r("PrivateChannelUnsubscribeEventListenerResponse")), null, 2); + } + + public static toPrivateChannelAddEventListenerRequest(json: string): PrivateChannelAddEventListenerRequest { + return cast(JSON.parse(json), r("PrivateChannelAddEventListenerRequest")); + } + + public static privateChannelAddEventListenerRequestToJson(value: PrivateChannelAddEventListenerRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelAddEventListenerRequest")), null, 2); + } + + public static toPrivateChannelAddEventListenerResponse(json: string): PrivateChannelAddEventListenerResponse { + return cast(JSON.parse(json), r("PrivateChannelAddEventListenerResponse")); + } + + public static privateChannelAddEventListenerResponseToJson(value: PrivateChannelAddEventListenerResponse): string { + return JSON.stringify(uncast(value, r("PrivateChannelAddEventListenerResponse")), null, 2); + } + + public static toRaiseIntentForContextRequest(json: string): RaiseIntentForContextRequest { + return cast(JSON.parse(json), r("RaiseIntentForContextRequest")); + } + + public static raiseIntentForContextRequestToJson(value: RaiseIntentForContextRequest): string { + return JSON.stringify(uncast(value, r("RaiseIntentForContextRequest")), null, 2); + } + + public static toRaiseIntentForContextResponse(json: string): RaiseIntentForContextResponse { + return cast(JSON.parse(json), r("RaiseIntentForContextResponse")); + } + + public static raiseIntentForContextResponseToJson(value: RaiseIntentForContextResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentForContextResponse")), null, 2); + } + + public static toRaiseIntentRequest(json: string): RaiseIntentRequest { + return cast(JSON.parse(json), r("RaiseIntentRequest")); + } + + public static raiseIntentRequestToJson(value: RaiseIntentRequest): string { + return JSON.stringify(uncast(value, r("RaiseIntentRequest")), null, 2); + } + + public static toRaiseIntentResponse(json: string): RaiseIntentResponse { + return cast(JSON.parse(json), r("RaiseIntentResponse")); + } + + public static raiseIntentResponseToJson(value: RaiseIntentResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResponse")), null, 2); + } + + public static toRaiseIntentResultResponse(json: string): RaiseIntentResultResponse { + return cast(JSON.parse(json), r("RaiseIntentResultResponse")); + } + + public static raiseIntentResultResponseToJson(value: RaiseIntentResultResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultResponse")), null, 2); + } +} + +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { + const prettyTyp = prettyTypeName(typ); + const parentText = parent ? ` on ${parent}` : ''; + const keyText = key ? ` for key "${key}"` : ''; + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); +} + +function prettyTypeName(typ: any): string { + if (Array.isArray(typ)) { + if (typ.length === 2 && typ[0] === undefined) { + return `an optional ${prettyTypeName(typ[1])}`; + } else { + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; + } + } else if (typeof typ === "object" && typ.literal !== undefined) { + return typ.literal; + } else { + return typeof typ; + } +} + +function jsonToJSProps(typ: any): any { + if (typ.jsonToJS === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); + typ.jsonToJS = map; + } + return typ.jsonToJS; +} + +function jsToJSONProps(typ: any): any { + if (typ.jsToJSON === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); + typ.jsToJSON = map; + } + return typ.jsToJSON; +} + +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { + function transformPrimitive(typ: string, val: any): any { + if (typeof typ === typeof val) return val; + return invalidValue(typ, val, key, parent); + } + + function transformUnion(typs: any[], val: any): any { + // val must validate against one typ in typs + const l = typs.length; + for (let i = 0; i < l; i++) { + const typ = typs[i]; + try { + return transform(val, typ, getProps); + } catch (_) {} + } + return invalidValue(typs, val, key, parent); + } + + function transformEnum(cases: string[], val: any): any { + if (cases.indexOf(val) !== -1) return val; + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); + } + + function transformArray(typ: any, val: any): any { + // val must be an array with no invalid elements + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); + return val.map(el => transform(el, typ, getProps)); + } + + function transformDate(val: any): any { + if (val === null) { + return null; + } + const d = new Date(val); + if (isNaN(d.valueOf())) { + return invalidValue(l("Date"), val, key, parent); + } + return d; + } + + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { + if (val === null || typeof val !== "object" || Array.isArray(val)) { + return invalidValue(l(ref || "object"), val, key, parent); + } + const result: any = {}; + Object.getOwnPropertyNames(props).forEach(key => { + const prop = props[key]; + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; + result[prop.key] = transform(v, prop.typ, getProps, key, ref); + }); + Object.getOwnPropertyNames(val).forEach(key => { + if (!Object.prototype.hasOwnProperty.call(props, key)) { + result[key] = transform(val[key], additional, getProps, key, ref); + } + }); + return result; + } + + if (typ === "any") return val; + if (typ === null) { + if (val === null) return val; + return invalidValue(typ, val, key, parent); + } + if (typ === false) return invalidValue(typ, val, key, parent); + let ref: any = undefined; + while (typeof typ === "object" && typ.ref !== undefined) { + ref = typ.ref; + typ = typeMap[typ.ref]; + } + if (Array.isArray(typ)) return transformEnum(typ, val); + if (typeof typ === "object") { + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) + : invalidValue(typ, val, key, parent); + } + // Numbers can be parsed by Date but shouldn't be. + if (typ === Date && typeof val !== "number") return transformDate(val); + return transformPrimitive(typ, val); +} + +function cast(val: any, typ: any): T { + return transform(val, typ, jsonToJSProps); +} + +function uncast(val: T, typ: any): any { + return transform(val, typ, jsToJSONProps); +} + +function l(typ: any) { + return { literal: typ }; +} + +function a(typ: any) { + return { arrayItems: typ }; +} + +function u(...typs: any[]) { + return { unionMembers: typs }; +} + +function o(props: any[], additional: any) { + return { props, additional }; +} + +function m(additional: any) { + return { props: [], additional }; +} + +function r(name: string) { + return { ref: name }; +} + +const typeMap: any = { + "WebConnectionProtocol1Hello": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol1HelloPayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol1HelloType") }, + ], false), + "ConnectionStepMetadata": o([ + { json: "connectionAttemptUuid", js: "connectionAttemptUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "WebConnectionProtocol1HelloPayload": o([ + { json: "channelSelector", js: "channelSelector", typ: u(undefined, true) }, + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "identityUrl", js: "identityUrl", typ: "" }, + { json: "resolver", js: "resolver", typ: u(undefined, true) }, + ], "any"), + "WebConnectionProtocol2LoadURL": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol2LoadURLPayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol2LoadURLType") }, + ], false), + "WebConnectionProtocol2LoadURLPayload": o([ + { json: "iframeUrl", js: "iframeUrl", typ: "" }, + ], "any"), + "WebConnectionProtocol3Handshake": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol3HandshakePayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol3HandshakeType") }, + ], false), + "WebConnectionProtocol3HandshakePayload": o([ + { json: "channelSelector", js: "channelSelector", typ: u(true, "") }, + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "resolver", js: "resolver", typ: u(true, "") }, + ], false), + "WebConnectionProtocol4ValidateAppIdentity": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol4ValidateAppIdentityPayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol4ValidateAppIdentityType") }, + ], false), + "WebConnectionProtocol4ValidateAppIdentityPayload": o([ + { json: "identityUrl", js: "identityUrl", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + { json: "instanceUuid", js: "instanceUuid", typ: u(undefined, "") }, + ], false), + "WebConnectionProtocol5ValidateAppIdentityFailedResponse": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol5ValidateAppIdentityFailedResponseType") }, + ], false), + "WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload": o([ + { json: "message", js: "message", typ: u(undefined, "") }, + ], false), + "WebConnectionProtocol5ValidateAppIdentitySuccessResponse": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol5ValidateAppIdentitySuccessResponseType") }, + ], false), + "WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "implementationMetadata", js: "implementationMetadata", typ: r("ImplementationMetadata") }, + { json: "instanceId", js: "instanceId", typ: "" }, + { json: "instanceUuid", js: "instanceUuid", typ: "" }, + ], false), + "ImplementationMetadata": o([ + { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, + { json: "provider", js: "provider", typ: "" }, + { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, + ], false), + "AppMetadata": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "description", js: "description", typ: u(undefined, "") }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "icons", js: "icons", typ: u(undefined, a(r("Icon"))) }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + { json: "instanceMetadata", js: "instanceMetadata", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "resultType", js: "resultType", typ: u(undefined, u(null, "")) }, + { json: "screenshots", js: "screenshots", typ: u(undefined, a(r("Image"))) }, + { json: "title", js: "title", typ: u(undefined, "") }, + { json: "tooltip", js: "tooltip", typ: u(undefined, "") }, + { json: "version", js: "version", typ: u(undefined, "") }, + ], false), + "Icon": o([ + { json: "size", js: "size", typ: u(undefined, "") }, + { json: "src", js: "src", typ: "" }, + { json: "type", js: "type", typ: u(undefined, "") }, + ], false), + "Image": o([ + { json: "label", js: "label", typ: u(undefined, "") }, + { json: "size", js: "size", typ: u(undefined, "") }, + { json: "src", js: "src", typ: "" }, + { json: "type", js: "type", typ: u(undefined, "") }, + ], false), + "OptionalFeatures": o([ + { json: "DesktopAgentBridging", js: "DesktopAgentBridging", typ: true }, + { json: "OriginatingAppMetadata", js: "OriginatingAppMetadata", typ: true }, + { json: "UserChannelMembershipAPIs", js: "UserChannelMembershipAPIs", typ: true }, + ], false), + "WebConnectionProtocol6Goodbye": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol6GoodbyeType") }, + ], false), + "WebConnectionProtocolMessage": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("ConnectionStepMessageType") }, + ], false), + "AddContextListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("AddContextListenerRequestPayload") }, + { json: "type", js: "type", typ: r("AddContextListenerRequestType") }, + ], false), + "AddContextListenerRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AppIdentifier": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "AddContextListenerRequestPayload": o([ + { json: "channelId", js: "channelId", typ: u(null, "") }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "AddContextListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("AddContextListenerResponsePayload") }, + { json: "type", js: "type", typ: r("AddContextListenerResponseType") }, + ], false), + "AddContextListenerResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AddContextListenerResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, + ], false), + "AddEventListenerEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("AddEventListenerEventPayload") }, + { json: "type", js: "type", typ: r("AddEventListenerEventType") }, + ], false), + "AddEventListenerEventMeta": o([ + { json: "eventUuid", js: "eventUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AddEventListenerEventPayload": o([ + { json: "event", js: "event", typ: r("FDC3Event") }, + ], false), + "FDC3Event": o([ + { json: "details", js: "details", typ: m("any") }, + { json: "type", js: "type", typ: r("FDC3EventType") }, + ], false), + "AddEventListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("AddEventListenerRequestPayload") }, + { json: "type", js: "type", typ: r("AddEventListenerRequestType") }, + ], false), + "AddEventListenerRequestPayload": o([ + { json: "type", js: "type", typ: r("FDC3EventType") }, + ], false), + "AddEventListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("AddEventListenerResponsePayload") }, + { json: "type", js: "type", typ: r("AddEventListenerResponseType") }, + ], false), + "AddEventListenerResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, + ], false), + "AddIntentListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("AddIntentListenerRequestPayload") }, + { json: "type", js: "type", typ: r("AddIntentListenerRequestType") }, + ], false), + "AddIntentListenerRequestPayload": o([ + { json: "intent", js: "intent", typ: "" }, + ], false), + "AddIntentListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("AddIntentListenerResponsePayload") }, + { json: "type", js: "type", typ: r("AddIntentListenerResponseType") }, + ], false), + "AddIntentListenerResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FluffyError")) }, + { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, + ], "any"), + "AgentEventMessage": o([ + { json: "meta", js: "meta", typ: r("AgentEventMessageMeta") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("EventMessageType") }, + ], false), + "AgentEventMessageMeta": o([ + { json: "eventUuid", js: "eventUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AgentResponseMessage": o([ + { json: "meta", js: "meta", typ: r("AgentResponseMessageMeta") }, + { json: "payload", js: "payload", typ: r("AgentResponseMessageResponsePayload") }, + { json: "type", js: "type", typ: r("ResponseMessageType") }, + ], false), + "AgentResponseMessageMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AgentResponseMessageResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + ], "any"), + "AppRequestMessage": o([ + { json: "meta", js: "meta", typ: r("AppRequestMessageMeta") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("RequestMessageType") }, + ], false), + "AppRequestMessageMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "BroadcastEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastEventPayload") }, + { json: "type", js: "type", typ: r("BroadcastEventType") }, + ], false), + "BroadcastEventPayload": o([ + { json: "channelId", js: "channelId", typ: u(null, "") }, + { json: "context", js: "context", typ: r("Context") }, + { json: "originatingApp", js: "originatingApp", typ: u(undefined, r("AppIdentifier")) }, + ], false), + "Context": o([ + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: "" }, + ], "any"), + "BroadcastRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastRequestPayload") }, + { json: "type", js: "type", typ: r("BroadcastRequestType") }, + ], false), + "BroadcastRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "BroadcastResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("BroadcastResponseType") }, + ], false), + "BroadcastResponseResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + ], "any"), + "ChannelChangedEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("ChannelChangedEventPayload") }, + { json: "type", js: "type", typ: r("ChannelChangedEventType") }, + ], false), + "ChannelChangedEventPayload": o([ + { json: "newChannelId", js: "newChannelId", typ: u(null, "") }, + ], false), + "ContextListenerUnsubscribeRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("ContextListenerUnsubscribeRequestPayload") }, + { json: "type", js: "type", typ: r("ContextListenerUnsubscribeRequestType") }, + ], false), + "ContextListenerUnsubscribeRequestPayload": o([ + { json: "listenerUUID", js: "listenerUUID", typ: "" }, + ], false), + "ContextListenerUnsubscribeResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("ContextListenerUnsubscribeResponseType") }, + ], false), + "CreatePrivateChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("CreatePrivateChannelRequestPayload") }, + { json: "type", js: "type", typ: r("CreatePrivateChannelRequestType") }, + ], false), + "CreatePrivateChannelRequestPayload": o([ + ], false), + "CreatePrivateChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("CreatePrivateChannelResponsePayload") }, + { json: "type", js: "type", typ: r("CreatePrivateChannelResponseType") }, + ], false), + "CreatePrivateChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "privateChannel", js: "privateChannel", typ: u(undefined, r("Channel")) }, + ], false), + "Channel": o([ + { json: "displayMetadata", js: "displayMetadata", typ: u(undefined, r("DisplayMetadata")) }, + { json: "id", js: "id", typ: "" }, + { json: "type", js: "type", typ: r("Type") }, + ], false), + "DisplayMetadata": o([ + { json: "color", js: "color", typ: u(undefined, "") }, + { json: "glyph", js: "glyph", typ: u(undefined, "") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], false), + "EventListenerUnsubscribeRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("EventListenerUnsubscribeRequestPayload") }, + { json: "type", js: "type", typ: r("EventListenerUnsubscribeRequestType") }, + ], false), + "EventListenerUnsubscribeRequestPayload": o([ + { json: "listenerUUID", js: "listenerUUID", typ: "" }, + ], false), + "EventListenerUnsubscribeResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("EventListenerUnsubscribeResponseType") }, + ], false), + "FindInstancesRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesRequestPayload") }, + { json: "type", js: "type", typ: r("FindInstancesRequestType") }, + ], false), + "FindInstancesRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + ], false), + "FindInstancesResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesResponsePayload") }, + { json: "type", js: "type", typ: r("FindInstancesResponseType") }, + ], false), + "FindInstancesResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "appIdentifiers", js: "appIdentifiers", typ: u(undefined, a(r("AppMetadata"))) }, + ], false), + "FindIntentRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentRequestType") }, + ], false), + "FindIntentRequestPayload": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "intent", js: "intent", typ: "" }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentResponseType") }, + ], false), + "FindIntentResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "appIntent", js: "appIntent", typ: u(undefined, r("AppIntent")) }, + ], false), + "AppIntent": o([ + { json: "apps", js: "apps", typ: a(r("AppMetadata")) }, + { json: "intent", js: "intent", typ: r("IntentMetadata") }, + ], false), + "IntentMetadata": o([ + { json: "displayName", js: "displayName", typ: u(undefined, "") }, + { json: "name", js: "name", typ: "" }, + ], false), + "FindIntentsByContextRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextRequestType") }, + ], false), + "FindIntentsByContextRequestPayload": o([ + { json: "context", js: "context", typ: r("Context") }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentsByContextResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextResponseType") }, + ], false), + "FindIntentsByContextResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "appIntents", js: "appIntents", typ: u(undefined, a(r("AppIntent"))) }, + ], false), + "GetAppMetadataRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataRequestPayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataRequestType") }, + ], false), + "GetAppMetadataRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + ], false), + "GetAppMetadataResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataResponseType") }, + ], false), + "GetAppMetadataResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "appMetadata", js: "appMetadata", typ: u(undefined, r("AppMetadata")) }, + ], false), + "GetCurrentChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetCurrentChannelRequestPayload") }, + { json: "type", js: "type", typ: r("GetCurrentChannelRequestType") }, + ], false), + "GetCurrentChannelRequestPayload": o([ + ], false), + "GetCurrentChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetCurrentChannelResponsePayload") }, + { json: "type", js: "type", typ: r("GetCurrentChannelResponseType") }, + ], false), + "GetCurrentChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + { json: "channel", js: "channel", typ: u(undefined, u(r("Channel"), null)) }, + ], false), + "GetCurrentContextRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetCurrentContextRequestPayload") }, + { json: "type", js: "type", typ: r("GetCurrentContextRequestType") }, + ], false), + "GetCurrentContextRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "GetCurrentContextResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetCurrentContextResponsePayload") }, + { json: "type", js: "type", typ: r("GetCurrentContextResponseType") }, + ], false), + "GetCurrentContextResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "context", js: "context", typ: u(undefined, u(null, r("Context"))) }, + ], false), + "GetInfoRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetInfoRequestPayload") }, + { json: "type", js: "type", typ: r("GetInfoRequestType") }, + ], false), + "GetInfoRequestPayload": o([ + ], false), + "GetInfoResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetInfoResponsePayload") }, + { json: "type", js: "type", typ: r("GetInfoResponseType") }, + ], false), + "GetInfoResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + { json: "implementationMetadata", js: "implementationMetadata", typ: u(undefined, r("ImplementationMetadata")) }, + ], false), + "GetOrCreateChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetOrCreateChannelRequestPayload") }, + { json: "type", js: "type", typ: r("GetOrCreateChannelRequestType") }, + ], false), + "GetOrCreateChannelRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "GetOrCreateChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetOrCreateChannelResponsePayload") }, + { json: "type", js: "type", typ: r("GetOrCreateChannelResponseType") }, + ], false), + "GetOrCreateChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, + ], false), + "GetUserChannelsRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetUserChannelsRequestPayload") }, + { json: "type", js: "type", typ: r("GetUserChannelsRequestType") }, + ], false), + "GetUserChannelsRequestPayload": o([ + ], false), + "GetUserChannelsResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetUserChannelsResponsePayload") }, + { json: "type", js: "type", typ: r("GetUserChannelsResponseType") }, + ], false), + "GetUserChannelsResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "userChannels", js: "userChannels", typ: u(undefined, a(r("Channel"))) }, + ], false), + "IframeChannelDrag": o([ + { json: "payload", js: "payload", typ: r("IframeChannelDragPayload") }, + { json: "type", js: "type", typ: r("IframeChannelDragType") }, + ], false), + "IframeChannelDragPayload": o([ + { json: "mouse", js: "mouse", typ: r("MouseClass") }, + ], false), + "MouseClass": o([ + { json: "offsetX", js: "offsetX", typ: 0 }, + { json: "offsetY", js: "offsetY", typ: 0 }, + ], false), + "IframeChannelResize": o([ + { json: "payload", js: "payload", typ: r("IframeChannelResizePayload") }, + { json: "type", js: "type", typ: r("IframeChannelResizeType") }, + ], false), + "IframeChannelResizePayload": o([ + { json: "dimensions", js: "dimensions", typ: r("DimensionsClass") }, + { json: "resizeAnchor", js: "resizeAnchor", typ: r("Resizing") }, + ], false), + "DimensionsClass": o([ + { json: "height", js: "height", typ: 0 }, + { json: "width", js: "width", typ: 0 }, + ], false), + "IframeChannelSelected": o([ + { json: "payload", js: "payload", typ: r("IframeChannelSelectedPayload") }, + { json: "type", js: "type", typ: r("IframeChannelSelectedType") }, + ], false), + "IframeChannelSelectedPayload": o([ + { json: "selected", js: "selected", typ: u(null, "") }, + ], false), + "IframeChannels": o([ + { json: "payload", js: "payload", typ: r("IframeChannelsPayload") }, + { json: "type", js: "type", typ: r("IframeChannelsType") }, + ], false), + "IframeChannelsPayload": o([ + { json: "location", js: "location", typ: u(undefined, r("Location")) }, + { json: "selected", js: "selected", typ: u(null, "") }, + { json: "userChannels", js: "userChannels", typ: a(r("Channel")) }, + ], false), + "Location": o([ + { json: "x", js: "x", typ: 0 }, + { json: "y", js: "y", typ: 0 }, + ], false), + "IframeHandshake": o([ + { json: "payload", js: "payload", typ: r("IframeHandshakePayload") }, + { json: "type", js: "type", typ: r("IframeHandshakeType") }, + ], false), + "IframeHandshakePayload": o([ + { json: "implementationDetails", js: "implementationDetails", typ: "" }, + ], false), + "IframeHello": o([ + { json: "payload", js: "payload", typ: r("IframeHelloPayload") }, + { json: "type", js: "type", typ: r("IframeHelloType") }, + ], false), + "IframeHelloPayload": o([ + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + ], false), + "IframeMessage": o([ + { json: "payload", js: "payload", typ: u(undefined, m("any")) }, + { json: "type", js: "type", typ: r("IframeMessageType") }, + ], false), + "IframeResolve": o([ + { json: "payload", js: "payload", typ: r("IframeResolvePayload") }, + { json: "type", js: "type", typ: r("IframeResolveType") }, + ], false), + "IframeResolvePayload": o([ + { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "IframeResolveAction": o([ + { json: "payload", js: "payload", typ: r("IframeResolveActionPayload") }, + { json: "type", js: "type", typ: r("IframeResolveActionType") }, + ], false), + "IframeResolveActionPayload": o([ + { json: "action", js: "action", typ: r("Action") }, + { json: "appIdentifier", js: "appIdentifier", typ: u(undefined, r("AppIdentifier")) }, + { json: "intent", js: "intent", typ: u(undefined, "") }, + ], false), + "IntentEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("IntentEventPayload") }, + { json: "type", js: "type", typ: r("IntentEventType") }, + ], false), + "IntentEventPayload": o([ + { json: "context", js: "context", typ: r("Context") }, + { json: "intent", js: "intent", typ: "" }, + { json: "originatingApp", js: "originatingApp", typ: u(undefined, r("AppIdentifier")) }, + ], false), + "IntentListenerUnsubscribeRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("IntentListenerUnsubscribeRequestPayload") }, + { json: "type", js: "type", typ: r("IntentListenerUnsubscribeRequestType") }, + ], false), + "IntentListenerUnsubscribeRequestPayload": o([ + { json: "listenerUUID", js: "listenerUUID", typ: "" }, + ], false), + "IntentListenerUnsubscribeResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("IntentListenerUnsubscribeResponseType") }, + ], false), + "IntentResultRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("IntentResultRequestPayload") }, + { json: "type", js: "type", typ: r("IntentResultRequestType") }, + ], false), + "IntentResultRequestPayload": o([ + { json: "intentResult", js: "intentResult", typ: r("PurpleIntentResult") }, + ], false), + "PurpleIntentResult": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, + ], false), + "IntentResultResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("IntentResultResponseType") }, + ], false), + "JoinUserChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("JoinUserChannelRequestPayload") }, + { json: "type", js: "type", typ: r("JoinUserChannelRequestType") }, + ], false), + "JoinUserChannelRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "JoinUserChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("JoinUserChannelResponsePayload") }, + { json: "type", js: "type", typ: r("JoinUserChannelResponseType") }, + ], false), + "JoinUserChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + ], false), + "LeaveCurrentChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("LeaveCurrentChannelRequestPayload") }, + { json: "type", js: "type", typ: r("LeaveCurrentChannelRequestType") }, + ], false), + "LeaveCurrentChannelRequestPayload": o([ + ], false), + "LeaveCurrentChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("LeaveCurrentChannelResponsePayload") }, + { json: "type", js: "type", typ: r("LeaveCurrentChannelResponseType") }, + ], false), + "LeaveCurrentChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + ], false), + "OpenRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("OpenRequestPayload") }, + { json: "type", js: "type", typ: r("OpenRequestType") }, + ], false), + "OpenRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + ], false), + "OpenResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenResponsePayload") }, + { json: "type", js: "type", typ: r("OpenResponseType") }, + ], false), + "OpenResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("OpenErrorResponsePayload")) }, + { json: "appIdentifier", js: "appIdentifier", typ: u(undefined, r("AppIdentifier")) }, + ], false), + "PrivateChannelDisconnectRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelDisconnectRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelDisconnectRequestType") }, + ], false), + "PrivateChannelDisconnectRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "PrivateChannelDisconnectResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelDisconnectResponsePayload") }, + { json: "type", js: "type", typ: r("PrivateChannelDisconnectResponseType") }, + ], false), + "PrivateChannelDisconnectResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + ], false), + "PrivateChannelOnAddContextListenerEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerEventPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerEventType") }, + ], false), + "PrivateChannelOnAddContextListenerEventPayload": o([ + { json: "contextType", js: "contextType", typ: u(null, "") }, + { json: "privateChannelId", js: "privateChannelId", typ: "" }, + ], false), + "PrivateChannelOnDisconnectEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectEventPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectEventType") }, + ], false), + "PrivateChannelOnDisconnectEventPayload": o([ + { json: "privateChannelId", js: "privateChannelId", typ: "" }, + ], false), + "PrivateChannelOnUnsubscribeEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeEventPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeEventType") }, + ], false), + "PrivateChannelOnUnsubscribeEventPayload": o([ + { json: "contextType", js: "contextType", typ: u(null, "") }, + { json: "privateChannelId", js: "privateChannelId", typ: "" }, + ], false), + "PrivateChannelUnsubscribeEventListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelUnsubscribeEventListenerRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelUnsubscribeEventListenerRequestType") }, + ], false), + "PrivateChannelUnsubscribeEventListenerRequestPayload": o([ + { json: "listenerUUID", js: "listenerUUID", typ: "" }, + ], false), + "PrivateChannelUnsubscribeEventListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("PrivateChannelUnsubscribeEventListenerResponseType") }, + ], false), + "PrivateChannelAddEventListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("TPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelAddEventListenerRequestType") }, + ], false), + "TPayload": o([ + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + { json: "privateChannelId", js: "privateChannelId", typ: "" }, + ], false), + "PrivateChannelAddEventListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelAddEventListenerResponsePayload") }, + { json: "type", js: "type", typ: r("PrivateChannelAddEventListenerResponseType") }, + ], false), + "PrivateChannelAddEventListenerResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, + ], "any"), + "RaiseIntentForContextRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentForContextRequestPayload") }, + { json: "type", js: "type", typ: r("RaiseIntentForContextRequestType") }, + ], false), + "RaiseIntentForContextRequestPayload": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "RaiseIntentForContextResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentForContextResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentForContextResponseType") }, + ], false), + "RaiseIntentForContextResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "intentResolution", js: "intentResolution", typ: u(undefined, r("IntentResolution")) }, + { json: "appIntents", js: "appIntents", typ: u(undefined, a(r("AppIntent"))) }, + ], false), + "IntentResolution": o([ + { json: "intent", js: "intent", typ: "" }, + { json: "source", js: "source", typ: r("AppIdentifier") }, + ], false), + "RaiseIntentRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentRequestPayload") }, + { json: "type", js: "type", typ: r("RaiseIntentRequestType") }, + ], false), + "RaiseIntentRequestPayload": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: r("Context") }, + { json: "intent", js: "intent", typ: "" }, + ], false), + "RaiseIntentResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResponseType") }, + ], false), + "RaiseIntentResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "intentResolution", js: "intentResolution", typ: u(undefined, r("IntentResolution")) }, + { json: "appIntent", js: "appIntent", typ: u(undefined, r("AppIntent")) }, + ], false), + "RaiseIntentResultResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultResponseType") }, + ], false), + "RaiseIntentResultResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + { json: "intentResult", js: "intentResult", typ: u(undefined, r("FluffyIntentResult")) }, + ], false), + "FluffyIntentResult": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, + ], false), + "WebConnectionProtocol1HelloType": [ + "WCP1Hello", + ], + "WebConnectionProtocol2LoadURLType": [ + "WCP2LoadUrl", + ], + "WebConnectionProtocol3HandshakeType": [ + "WCP3Handshake", + ], + "WebConnectionProtocol4ValidateAppIdentityType": [ + "WCP4ValidateAppIdentity", + ], + "WebConnectionProtocol5ValidateAppIdentityFailedResponseType": [ + "WCP5ValidateAppIdentityFailedResponse", + ], + "WebConnectionProtocol5ValidateAppIdentitySuccessResponseType": [ + "WCP5ValidateAppIdentityResponse", + ], + "WebConnectionProtocol6GoodbyeType": [ + "WCP6Goodbye", + ], + "ConnectionStepMessageType": [ + "WCP1Hello", + "WCP2LoadUrl", + "WCP3Handshake", + "WCP4ValidateAppIdentity", + "WCP5ValidateAppIdentityFailedResponse", + "WCP5ValidateAppIdentityResponse", + "WCP6Goodbye", + ], + "AddContextListenerRequestType": [ + "addContextListenerRequest", + ], + "PurpleError": [ + "AccessDenied", + "CreationFailed", + "MalformedContext", + "NoChannelFound", + ], + "AddContextListenerResponseType": [ + "addContextListenerResponse", + ], + "FDC3EventType": [ + "USER_CHANNEL_CHANGED", + ], + "AddEventListenerEventType": [ + "addEventListenerEvent", + ], + "AddEventListenerRequestType": [ + "addEventListenerRequest", + ], + "ResponsePayloadError": [ + "AccessDenied", + "AgentDisconnected", + "AppNotFound", + "AppTimeout", + "CreationFailed", + "DesktopAgentNotFound", + "ErrorOnLaunch", + "IntentDeliveryFailed", + "IntentHandlerRejected", + "MalformedContext", + "MalformedMessage", + "NoAppsFound", + "NoChannelFound", + "NoResultReturned", + "NotConnectedToBridge", + "ResolverTimeout", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "AddEventListenerResponseType": [ + "addEventListenerResponse", + ], + "AddIntentListenerRequestType": [ + "addIntentListenerRequest", + ], + "FluffyError": [ + "DesktopAgentNotFound", + "IntentDeliveryFailed", + "MalformedContext", + "NoAppsFound", + "ResolverTimeout", + "ResolverUnavailable", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "AddIntentListenerResponseType": [ + "addIntentListenerResponse", + ], + "EventMessageType": [ + "addEventListenerEvent", + "broadcastEvent", + "channelChangedEvent", + "intentEvent", + "privateChannelOnAddContextListenerEvent", + "privateChannelOnDisconnectEvent", + "privateChannelOnUnsubscribeEvent", + ], + "ResponseMessageType": [ + "addContextListenerResponse", + "addEventListenerResponse", + "addIntentListenerResponse", + "broadcastResponse", + "contextListenerUnsubscribeResponse", + "createPrivateChannelResponse", + "eventListenerUnsubscribeResponse", + "findInstancesResponse", + "findIntentResponse", + "findIntentsByContextResponse", + "getAppMetadataResponse", + "getCurrentChannelResponse", + "getCurrentContextResponse", + "getInfoResponse", + "getOrCreateChannelResponse", + "getUserChannelsResponse", + "intentListenerUnsubscribeResponse", + "intentResultResponse", + "joinUserChannelResponse", + "leaveCurrentChannelResponse", + "openResponse", + "privateChannelAddEventListenerResponse", + "privateChannelDisconnectResponse", + "privateChannelUnsubscribeEventListenerResponse", + "raiseIntentForContextResponse", + "raiseIntentResponse", + "raiseIntentResultResponse", + ], + "RequestMessageType": [ + "addContextListenerRequest", + "addEventListenerRequest", + "addIntentListenerRequest", + "broadcastRequest", + "contextListenerUnsubscribeRequest", + "createPrivateChannelRequest", + "eventListenerUnsubscribeRequest", + "findInstancesRequest", + "findIntentRequest", + "findIntentsByContextRequest", + "getAppMetadataRequest", + "getCurrentChannelRequest", + "getCurrentContextRequest", + "getInfoRequest", + "getOrCreateChannelRequest", + "getUserChannelsRequest", + "intentListenerUnsubscribeRequest", + "intentResultRequest", + "joinUserChannelRequest", + "leaveCurrentChannelRequest", + "openRequest", + "privateChannelAddEventListenerRequest", + "privateChannelDisconnectRequest", + "privateChannelUnsubscribeEventListenerRequest", + "raiseIntentForContextRequest", + "raiseIntentRequest", + ], + "BroadcastEventType": [ + "broadcastEvent", + ], + "BroadcastRequestType": [ + "broadcastRequest", + ], + "BroadcastResponseType": [ + "broadcastResponse", + ], + "ChannelChangedEventType": [ + "channelChangedEvent", + ], + "ContextListenerUnsubscribeRequestType": [ + "contextListenerUnsubscribeRequest", + ], + "ContextListenerUnsubscribeResponseType": [ + "contextListenerUnsubscribeResponse", + ], + "CreatePrivateChannelRequestType": [ + "createPrivateChannelRequest", + ], + "Type": [ + "app", + "private", + "user", + ], + "CreatePrivateChannelResponseType": [ + "createPrivateChannelResponse", + ], + "EventListenerUnsubscribeRequestType": [ + "eventListenerUnsubscribeRequest", + ], + "EventListenerUnsubscribeResponseType": [ + "eventListenerUnsubscribeResponse", + ], + "FindInstancesRequestType": [ + "findInstancesRequest", + ], + "FindInstancesErrors": [ + "AgentDisconnected", + "DesktopAgentNotFound", + "IntentDeliveryFailed", + "MalformedContext", + "MalformedMessage", + "NoAppsFound", + "NotConnectedToBridge", + "ResolverTimeout", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "FindInstancesResponseType": [ + "findInstancesResponse", + ], + "FindIntentRequestType": [ + "findIntentRequest", + ], + "FindIntentResponseType": [ + "findIntentResponse", + ], + "FindIntentsByContextRequestType": [ + "findIntentsByContextRequest", + ], + "FindIntentsByContextResponseType": [ + "findIntentsByContextResponse", + ], + "GetAppMetadataRequestType": [ + "getAppMetadataRequest", + ], + "GetAppMetadataResponseType": [ + "getAppMetadataResponse", + ], + "GetCurrentChannelRequestType": [ + "getCurrentChannelRequest", + ], + "GetCurrentChannelResponseType": [ + "getCurrentChannelResponse", + ], + "GetCurrentContextRequestType": [ + "getCurrentContextRequest", + ], + "GetCurrentContextResponseType": [ + "getCurrentContextResponse", + ], + "GetInfoRequestType": [ + "getInfoRequest", + ], + "GetInfoResponseType": [ + "getInfoResponse", + ], + "GetOrCreateChannelRequestType": [ + "getOrCreateChannelRequest", + ], + "GetOrCreateChannelResponseType": [ + "getOrCreateChannelResponse", + ], + "GetUserChannelsRequestType": [ + "getUserChannelsRequest", + ], + "GetUserChannelsResponseType": [ + "getUserChannelsResponse", + ], + "IframeChannelDragType": [ + "iframeChannelDrag", + ], + "Resizing": [ + "bottom", + "bottom-left", + "bottom-right", + "center", + "left", + "right", + "top", + "top-left", + "top-right", + ], + "IframeChannelResizeType": [ + "iframeChannelResize", + ], + "IframeChannelSelectedType": [ + "iframeChannelSelected", + ], + "IframeChannelsType": [ + "iframeChannels", + ], + "IframeHandshakeType": [ + "iframeHandshake", + ], + "IframeHelloType": [ + "iframeHello", + ], + "IframeMessageType": [ + "iframeChannelDrag", + "iframeChannelResize", + "iframeChannelSelected", + "iframeChannels", + "iframeHandshake", + "iframeHello", + "iframeResolve", + "iframeResolveAction", + ], + "IframeResolveType": [ + "iframeResolve", + ], + "Action": [ + "cancel", + "click", + "hover", + ], + "IframeResolveActionType": [ + "iframeResolveAction", + ], + "IntentEventType": [ + "intentEvent", + ], + "IntentListenerUnsubscribeRequestType": [ + "intentListenerUnsubscribeRequest", + ], + "IntentListenerUnsubscribeResponseType": [ + "intentListenerUnsubscribeResponse", + ], + "IntentResultRequestType": [ + "intentResultRequest", + ], + "IntentResultResponseType": [ + "intentResultResponse", + ], + "JoinUserChannelRequestType": [ + "joinUserChannelRequest", + ], + "JoinUserChannelResponseType": [ + "joinUserChannelResponse", + ], + "LeaveCurrentChannelRequestType": [ + "leaveCurrentChannelRequest", + ], + "LeaveCurrentChannelResponseType": [ + "leaveCurrentChannelResponse", + ], + "OpenRequestType": [ + "openRequest", + ], + "OpenErrorResponsePayload": [ + "AgentDisconnected", + "AppNotFound", + "AppTimeout", + "DesktopAgentNotFound", + "ErrorOnLaunch", + "MalformedContext", + "MalformedMessage", + "NotConnectedToBridge", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + ], + "OpenResponseType": [ + "openResponse", + ], + "PrivateChannelDisconnectRequestType": [ + "privateChannelDisconnectRequest", + ], + "PrivateChannelDisconnectResponseType": [ + "privateChannelDisconnectResponse", + ], + "PrivateChannelOnAddContextListenerEventType": [ + "privateChannelOnAddContextListenerEvent", + ], + "PrivateChannelOnDisconnectEventType": [ + "privateChannelOnDisconnectEvent", + ], + "PrivateChannelOnUnsubscribeEventType": [ + "privateChannelOnUnsubscribeEvent", + ], + "PrivateChannelUnsubscribeEventListenerRequestType": [ + "privateChannelUnsubscribeEventListenerRequest", + ], + "PrivateChannelUnsubscribeEventListenerResponseType": [ + "privateChannelUnsubscribeEventListenerResponse", + ], + "PrivateChannelEventListenerTypes": [ + "onAddContextListener", + "onDisconnect", + "onUnsubscribe", + ], + "PrivateChannelAddEventListenerRequestType": [ + "privateChannelAddEventListenerRequest", + ], + "PrivateChannelAddEventListenerResponseType": [ + "privateChannelAddEventListenerResponse", + ], + "RaiseIntentForContextRequestType": [ + "raiseIntentForContextRequest", + ], + "RaiseIntentForContextResponseType": [ + "raiseIntentForContextResponse", + ], + "RaiseIntentRequestType": [ + "raiseIntentRequest", + ], + "RaiseIntentResponseType": [ + "raiseIntentResponse", + ], + "RaiseIntentResultResponseType": [ + "raiseIntentResultResponse", + ], +}; diff --git a/packages/fdc3-schema/generated/bridging/BridgingTypes.ts b/packages/fdc3-schema/generated/bridging/BridgingTypes.ts new file mode 100644 index 000000000..ec0a3b481 --- /dev/null +++ b/packages/fdc3-schema/generated/bridging/BridgingTypes.ts @@ -0,0 +1,6058 @@ +// To parse this data: +// +// import { Convert, AgentErrorResponseMessage, AgentRequestMessage, AgentResponseMessage, BridgeErrorResponseMessage, BridgeRequestMessage, BridgeResponseMessage, BroadcastAgentRequest, BroadcastBridgeRequest, ConnectionStepMessage, ConnectionStep2Hello, ConnectionStep3Handshake, ConnectionStep4AuthenticationFailed, ConnectionStep6ConnectedAgentsUpdate, FindInstancesAgentErrorResponse, FindInstancesAgentRequest, FindInstancesAgentResponse, FindInstancesBridgeErrorResponse, FindInstancesBridgeRequest, FindInstancesBridgeResponse, FindIntentAgentErrorResponse, FindIntentAgentRequest, FindIntentAgentResponse, FindIntentBridgeErrorResponse, FindIntentBridgeRequest, FindIntentBridgeResponse, FindIntentsByContextAgentErrorResponse, FindIntentsByContextAgentRequest, FindIntentsByContextAgentResponse, FindIntentsByContextBridgeErrorResponse, FindIntentsByContextBridgeRequest, FindIntentsByContextBridgeResponse, GetAppMetadataAgentErrorResponse, GetAppMetadataAgentRequest, GetAppMetadataAgentResponse, GetAppMetadataBridgeErrorResponse, GetAppMetadataBridgeRequest, GetAppMetadataBridgeResponse, OpenAgentErrorResponse, OpenAgentRequest, OpenAgentResponse, OpenBridgeErrorResponse, OpenBridgeRequest, OpenBridgeResponse, PrivateChannelBroadcastAgentRequest, PrivateChannelBroadcastBridgeRequest, PrivateChannelEventListenerAddedAgentRequest, PrivateChannelEventListenerAddedBridgeRequest, PrivateChannelEventListenerRemovedAgentRequest, PrivateChannelEventListenerRemovedBridgeRequest, PrivateChannelOnAddContextListenerAgentRequest, PrivateChannelOnAddContextListenerBridgeRequest, PrivateChannelOnDisconnectAgentRequest, PrivateChannelOnDisconnectBridgeRequest, PrivateChannelOnUnsubscribeAgentRequest, PrivateChannelOnUnsubscribeBridgeRequest, RaiseIntentAgentErrorResponse, RaiseIntentAgentRequest, RaiseIntentAgentResponse, RaiseIntentBridgeErrorResponse, RaiseIntentBridgeRequest, RaiseIntentBridgeResponse, RaiseIntentResultAgentErrorResponse, RaiseIntentResultAgentResponse, RaiseIntentResultBridgeErrorResponse, RaiseIntentResultBridgeResponse } from "./file"; +// +// const agentErrorResponseMessage = Convert.toAgentErrorResponseMessage(json); +// const agentRequestMessage = Convert.toAgentRequestMessage(json); +// const agentResponseMessage = Convert.toAgentResponseMessage(json); +// const bridgeErrorResponseMessage = Convert.toBridgeErrorResponseMessage(json); +// const bridgeRequestMessage = Convert.toBridgeRequestMessage(json); +// const bridgeResponseMessage = Convert.toBridgeResponseMessage(json); +// const broadcastAgentRequest = Convert.toBroadcastAgentRequest(json); +// const broadcastBridgeRequest = Convert.toBroadcastBridgeRequest(json); +// const bridgeCommonDefinitions = Convert.toBridgeCommonDefinitions(json); +// const connectionStepMessage = Convert.toConnectionStepMessage(json); +// const connectionStep2Hello = Convert.toConnectionStep2Hello(json); +// const connectionStep3Handshake = Convert.toConnectionStep3Handshake(json); +// const connectionStep4AuthenticationFailed = Convert.toConnectionStep4AuthenticationFailed(json); +// const connectionStep6ConnectedAgentsUpdate = Convert.toConnectionStep6ConnectedAgentsUpdate(json); +// const findInstancesAgentErrorResponse = Convert.toFindInstancesAgentErrorResponse(json); +// const findInstancesAgentRequest = Convert.toFindInstancesAgentRequest(json); +// const findInstancesAgentResponse = Convert.toFindInstancesAgentResponse(json); +// const findInstancesBridgeErrorResponse = Convert.toFindInstancesBridgeErrorResponse(json); +// const findInstancesBridgeRequest = Convert.toFindInstancesBridgeRequest(json); +// const findInstancesBridgeResponse = Convert.toFindInstancesBridgeResponse(json); +// const findIntentAgentErrorResponse = Convert.toFindIntentAgentErrorResponse(json); +// const findIntentAgentRequest = Convert.toFindIntentAgentRequest(json); +// const findIntentAgentResponse = Convert.toFindIntentAgentResponse(json); +// const findIntentBridgeErrorResponse = Convert.toFindIntentBridgeErrorResponse(json); +// const findIntentBridgeRequest = Convert.toFindIntentBridgeRequest(json); +// const findIntentBridgeResponse = Convert.toFindIntentBridgeResponse(json); +// const findIntentsByContextAgentErrorResponse = Convert.toFindIntentsByContextAgentErrorResponse(json); +// const findIntentsByContextAgentRequest = Convert.toFindIntentsByContextAgentRequest(json); +// const findIntentsByContextAgentResponse = Convert.toFindIntentsByContextAgentResponse(json); +// const findIntentsByContextBridgeErrorResponse = Convert.toFindIntentsByContextBridgeErrorResponse(json); +// const findIntentsByContextBridgeRequest = Convert.toFindIntentsByContextBridgeRequest(json); +// const findIntentsByContextBridgeResponse = Convert.toFindIntentsByContextBridgeResponse(json); +// const getAppMetadataAgentErrorResponse = Convert.toGetAppMetadataAgentErrorResponse(json); +// const getAppMetadataAgentRequest = Convert.toGetAppMetadataAgentRequest(json); +// const getAppMetadataAgentResponse = Convert.toGetAppMetadataAgentResponse(json); +// const getAppMetadataBridgeErrorResponse = Convert.toGetAppMetadataBridgeErrorResponse(json); +// const getAppMetadataBridgeRequest = Convert.toGetAppMetadataBridgeRequest(json); +// const getAppMetadataBridgeResponse = Convert.toGetAppMetadataBridgeResponse(json); +// const openAgentErrorResponse = Convert.toOpenAgentErrorResponse(json); +// const openAgentRequest = Convert.toOpenAgentRequest(json); +// const openAgentResponse = Convert.toOpenAgentResponse(json); +// const openBridgeErrorResponse = Convert.toOpenBridgeErrorResponse(json); +// const openBridgeRequest = Convert.toOpenBridgeRequest(json); +// const openBridgeResponse = Convert.toOpenBridgeResponse(json); +// const privateChannelBroadcastAgentRequest = Convert.toPrivateChannelBroadcastAgentRequest(json); +// const privateChannelBroadcastBridgeRequest = Convert.toPrivateChannelBroadcastBridgeRequest(json); +// const privateChannelEventListenerAddedAgentRequest = Convert.toPrivateChannelEventListenerAddedAgentRequest(json); +// const privateChannelEventListenerAddedBridgeRequest = Convert.toPrivateChannelEventListenerAddedBridgeRequest(json); +// const privateChannelEventListenerRemovedAgentRequest = Convert.toPrivateChannelEventListenerRemovedAgentRequest(json); +// const privateChannelEventListenerRemovedBridgeRequest = Convert.toPrivateChannelEventListenerRemovedBridgeRequest(json); +// const privateChannelOnAddContextListenerAgentRequest = Convert.toPrivateChannelOnAddContextListenerAgentRequest(json); +// const privateChannelOnAddContextListenerBridgeRequest = Convert.toPrivateChannelOnAddContextListenerBridgeRequest(json); +// const privateChannelOnDisconnectAgentRequest = Convert.toPrivateChannelOnDisconnectAgentRequest(json); +// const privateChannelOnDisconnectBridgeRequest = Convert.toPrivateChannelOnDisconnectBridgeRequest(json); +// const privateChannelOnUnsubscribeAgentRequest = Convert.toPrivateChannelOnUnsubscribeAgentRequest(json); +// const privateChannelOnUnsubscribeBridgeRequest = Convert.toPrivateChannelOnUnsubscribeBridgeRequest(json); +// const raiseIntentAgentErrorResponse = Convert.toRaiseIntentAgentErrorResponse(json); +// const raiseIntentAgentRequest = Convert.toRaiseIntentAgentRequest(json); +// const raiseIntentAgentResponse = Convert.toRaiseIntentAgentResponse(json); +// const raiseIntentBridgeErrorResponse = Convert.toRaiseIntentBridgeErrorResponse(json); +// const raiseIntentBridgeRequest = Convert.toRaiseIntentBridgeRequest(json); +// const raiseIntentBridgeResponse = Convert.toRaiseIntentBridgeResponse(json); +// const raiseIntentResultAgentErrorResponse = Convert.toRaiseIntentResultAgentErrorResponse(json); +// const raiseIntentResultAgentResponse = Convert.toRaiseIntentResultAgentResponse(json); +// const raiseIntentResultBridgeErrorResponse = Convert.toRaiseIntentResultBridgeErrorResponse(json); +// const raiseIntentResultBridgeResponse = Convert.toRaiseIntentResultBridgeResponse(json); +// +// These functions will throw an error if the JSON doesn't +// match the expected interface, even if the JSON is valid. + +/** + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface AgentErrorResponseMessage { + meta: AgentResponseMetadata; + /** + * Error message payload containing an standardized error string. + */ + payload: ErrorResponseMessagePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: ResponseMessageType; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface AgentResponseMetadata { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface ErrorResponseMessagePayload { + error: ResponseErrorDetail; + [property: string]: any; +} + +/** + * Array of error message strings for responses that were not returned to the bridge before + * the timeout or because an error occurred. Should be the same length as the `errorSources` + * array and ordered the same. May be omitted if all sources responded without errors. + * + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type ResponseErrorDetail = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ +export type ResponseMessageType = "findInstancesResponse" | "findIntentResponse" | "findIntentsByContextResponse" | "getAppMetadataResponse" | "openResponse" | "raiseIntentResponse" | "raiseIntentResultResponse"; + +/** + * A request message from a Desktop Agent to the Bridge. + */ +export interface AgentRequestMessage { + meta: AgentRequestMetadata; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: RequestMessageType; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface AgentRequestMetadata { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceIdentifier; + timestamp: Date; +} + +/** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface BridgeParticipantIdentifier { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + * + * Field that represents the source application that a request or response was received + * from, or the source Desktop Agent if it issued the request or response itself. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + */ +export interface SourceIdentifier { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId?: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + * + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ +export type RequestMessageType = "broadcastRequest" | "findInstancesRequest" | "findIntentRequest" | "findIntentsByContextRequest" | "getAppMetadataRequest" | "openRequest" | "PrivateChannel.broadcast" | "PrivateChannel.eventListenerAdded" | "PrivateChannel.eventListenerRemoved" | "PrivateChannel.onAddContextListener" | "PrivateChannel.onDisconnect" | "PrivateChannel.onUnsubscribe" | "raiseIntentRequest"; + +/** + * A response message from a Desktop Agent to the Bridge. + */ +export interface AgentResponseMessage { + meta: AgentResponseMetadata; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: ResponseMessageType; +} + +/** + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface BridgeErrorResponseMessage { + meta: BridgeErrorResponseMessageMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: ResponseErrorMessagePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: string; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface BridgeErrorResponseMessageMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + */ +export interface DesktopAgentIdentifier { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent: string; + [property: string]: any; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface ResponseErrorMessagePayload { + error?: ResponseErrorDetail; + [property: string]: any; +} + +/** + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface BridgeRequestMessage { + meta: BridgeRequestMetadata; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: string; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface BridgeRequestMetadata { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: BridgeParticipantIdentifier; + timestamp: Date; +} + +/** + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface BridgeResponseMessage { + meta: BridgeResponseMessageMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: string; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface BridgeResponseMessageMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * A request to broadcast context on a channel. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface BroadcastAgentRequest { + meta: BroadcastAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: BroadcastAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "broadcastRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface BroadcastAgentRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source: SourceObject; + timestamp: Date; +} + +/** + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + * + * Field that represents the source application that a request or response was received + * from, or the source Desktop Agent if it issued the request or response itself. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + */ +export interface SourceObject { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + * + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface BroadcastAgentRequestPayload { + /** + * The Id of the Channel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that is to be broadcast. + */ + context: Context; +} + +/** + * The context object that is to be broadcast. + * + * The context object that was the payload of a broadcast message. + * + * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by + * FDC3 operations. As such, it is not really meant to be used on its own, but is imported + * by more specific type definitions (standardized or custom) to provide the structure and + * properties shared by all FDC3 context data types. + * + * The key element of FDC3 context types is their mandatory `type` property, which is used + * to identify what type of data the object represents, and what shape it has. + * + * The FDC3 context type, and all derived types, define the minimum set of fields a context + * data object of a particular type can be expected to have, but this can always be extended + * with custom fields as appropriate. + */ +export interface Context { + /** + * Context data objects may include a set of equivalent key-value pairs that can be used to + * help applications identify and look up the context type they receive in their own domain. + * The idea behind this design is that applications can provide as many equivalent + * identifiers to a target application as possible, e.g. an instrument may be represented by + * an ISIN, CUSIP or Bloomberg identifier. + * + * Identifiers do not make sense for all types of data, so the `id` property is therefore + * optional, but some derived types may choose to require at least one identifier. + * Identifier values SHOULD always be of type string. + */ + id?: { [key: string]: any }; + /** + * Context data objects may include a name property that can be used for more information, + * or display purposes. Some derived types may require the name object as mandatory, + * depending on use case. + */ + name?: string; + /** + * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 + * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present + * to route shared context data appropriately. + * + * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data + * types they support in an FDC3 [App + * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery + * and routing. + * + * Standardized FDC3 context types have well-known `type` properties prefixed with the + * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and + * used by a particular organization, the convention is to prefix them with an + * organization-specific namespace, e.g. `blackrock.fund`. + * + * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more + * information about context data types. + */ + type: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to broadcast context on a channel. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface BroadcastBridgeRequest { + meta: BroadcastBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: BroadcastBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "broadcastRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface BroadcastBridgeRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + */ +export interface MetaSource { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + * + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface BroadcastBridgeRequestPayload { + /** + * The Id of the Channel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that is to be broadcast. + */ + context: Context; +} + +/** + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStepMessage { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the connection step message. + */ + type: ConnectionStepMessageType; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStepMetadata { + requestUuid?: string; + responseUuid?: string; + timestamp: Date; +} + +/** + * Identifies the type of the connection step message. + */ +export type ConnectionStepMessageType = "hello" | "handshake" | "authenticationFailed" | "connectedAgentsUpdate"; + +/** + * Hello message sent by the Bridge to anyone connecting to the Bridge (enables + * identification as a bridge and confirmation of whether authentication is required) + * + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStep2Hello { + meta: ConnectionStep2HelloMeta; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: ConnectionStep2HelloPayload; + /** + * Identifies the type of the connection step message. + */ + type: "hello"; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStep2HelloMeta { + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface ConnectionStep2HelloPayload { + /** + * A flag indicating whether the Desktop Agent Bridge requires authentication or not. + */ + authRequired: boolean; + /** + * An optional Desktop Agent Bridge JWT authentication token if the Desktop Agent want to + * authenticate a bridge. + */ + authToken?: string; + /** + * The version of the Bridge + */ + desktopAgentBridgeVersion: string; + /** + * The FDC3 versions supported by the Bridge + */ + supportedFDC3Versions: string[]; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Handshake message sent by the Desktop Agent to the Bridge (including requested name, + * channel state and authentication data) + * + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStep3Handshake { + meta: ConnectionStep3HandshakeMeta; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: ConnectionStep3HandshakePayload; + /** + * Identifies the type of the connection step message. + */ + type: "handshake"; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStep3HandshakeMeta { + requestUuid: string; + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface ConnectionStep3HandshakePayload { + authToken?: string; + /** + * 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]: Context[] }; + /** + * Desktop Agent ImplementationMetadata trying to connect to the bridge. + */ + implementationMetadata: ConnectingAgentImplementationMetadata; + /** + * The requested Desktop Agent name + */ + requestedName: string; +} + +/** + * Desktop Agent ImplementationMetadata trying to connect to the bridge. + * + * Metadata relating to the FDC3 Desktop Agent implementation and its provider. + */ +export interface ConnectingAgentImplementationMetadata { + /** + * The version number of the FDC3 specification that the implementation provides. + * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. + */ + fdc3Version: string; + /** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ + optionalFeatures: OptionalFeatures; + /** + * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, + * OpenFin etc.). + */ + provider: string; + /** + * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). + */ + providerVersion?: string; +} + +/** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ +export interface OptionalFeatures { + /** + * Used to indicate whether the experimental Desktop Agent Bridging + * feature is implemented by the Desktop Agent. + */ + DesktopAgentBridging: boolean; + /** + * Used to indicate whether the exposure of 'originating app metadata' for + * context and intent messages is supported by the Desktop Agent. + */ + OriginatingAppMetadata: boolean; + /** + * Used to indicate whether the optional `fdc3.joinUserChannel`, + * `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by + * the Desktop Agent. + */ + UserChannelMembershipAPIs: boolean; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Message sent by Bridge to Desktop Agent if their authentication fails. + * + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStep4AuthenticationFailed { + meta: ConnectionStep4AuthenticationFailedMeta; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: ConnectionStep4AuthenticationFailedPayload; + /** + * Identifies the type of the connection step message. + */ + type: "authenticationFailed"; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStep4AuthenticationFailedMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface ConnectionStep4AuthenticationFailedPayload { + message?: string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Message sent by Bridge to all Desktop Agent when an agent joins or leaves the bridge, + * includes the details of all agents, the change made and the expected channel state for + * all agents. + * + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStep6ConnectedAgentsUpdate { + meta: ConnectionStep6ConnectedAgentsUpdateMeta; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: ConnectionStep6ConnectedAgentsUpdatePayload; + /** + * Identifies the type of the connection step message. + */ + type: "connectedAgentsUpdate"; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStep6ConnectedAgentsUpdateMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface ConnectionStep6ConnectedAgentsUpdatePayload { + /** + * Should be set when an agent first connects to the bridge and provide its assigned name. + */ + addAgent?: string; + /** + * Desktop Agent Bridge implementation metadata of all connected agents. + */ + allAgents: DesktopAgentImplementationMetadata[]; + /** + * The updated state of channels that should be adopted by the agents. Should only be set + * when an agent is connecting to the bridge. + */ + channelsState?: { [key: string]: Context[] }; + /** + * Should be set when an agent disconnects from the bridge and provide the name that no + * longer is assigned. + */ + removeAgent?: string; +} + +/** + * Includes the name assigned to the Desktop Agent by the Bridge. + * + * Metadata relating to the FDC3 Desktop Agent implementation and its provider. + */ +export interface DesktopAgentImplementationMetadata { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a particular Desktop + * Agent. + */ + desktopAgent: string; + /** + * The version number of the FDC3 specification that the implementation provides. + * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. + */ + fdc3Version: string; + /** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ + optionalFeatures: OptionalFeatures; + /** + * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, + * OpenFin etc.). + */ + provider: string; + /** + * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). + */ + providerVersion?: string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * A response to a findInstances request that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface FindInstancesAgentErrorResponse { + meta: FindInstancesAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: PayloadClass; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindInstancesAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface PayloadClass { + error: FindInstancesErrors; +} + +/** + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + * + * Should be set if the raiseIntent request returned an error. + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + * + * Array of error message strings for responses that were not returned to the bridge before + * the timeout or because an error occurred. Should be the same length as the `errorSources` + * array and ordered the same. May be omitted if all sources responded without errors. + * + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + */ +export type FindInstancesErrors = "DesktopAgentNotFound" | "IntentDeliveryFailed" | "MalformedContext" | "NoAppsFound" | "ResolverTimeout" | "ResolverUnavailable" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request for details of instances of a particular app + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface FindInstancesAgentRequest { + meta: FindInstancesAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindInstancesAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findInstancesRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface FindInstancesAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceIdentifier; + timestamp: Date; +} + +/** + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + * + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface DestinationObject { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindInstancesAgentRequestPayload { + app: AppIdentifier; +} + +/** + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppIdentifier { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a findInstances request. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface FindInstancesAgentResponse { + meta: AgentResponseMetadata; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindInstancesAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * The message payload contains a flag indicating whether the API call was successful, plus + * any return values for the FDC3 API function called, or indicating that the request + * resulted in an error and including a standardized error message. + * + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindInstancesAgentResponsePayload { + appIdentifiers: AppMetadata[]; +} + +/** + * Extends an `AppIdentifier`, describing an application or instance of an application, with + * additional descriptive metadata that is usually provided by an FDC3 App Directory that + * the desktop agent connects to. + * + * The additional information from an app directory can aid in rendering UI elements, such + * as a launcher menu or resolver UI. This includes a title, description, tooltip and icon + * and screenshot URLs. + * + * Note that as `AppMetadata` instances are also `AppIdentifiers` they may be passed to the + * `app` argument of `fdc3.open`, `fdc3.raiseIntent` etc. + */ +export interface AppMetadata { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * A longer, multi-paragraph description for the application that could include markup + */ + description?: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * A list of icon URLs for the application that can be used to render UI elements + */ + icons?: Icon[]; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + /** + * An optional set of, implementation specific, metadata fields that can be used to + * disambiguate instances, such as a window title or screen position. Must only be set if + * `instanceId` is set. + */ + instanceMetadata?: { [key: string]: any }; + /** + * The 'friendly' app name. + * This field was used with the `open` and `raiseIntent` calls in FDC3 <2.0, which now + * require an `AppIdentifier` wth `appId` set. + * Note that for display purposes the `title` field should be used, if set, in preference to + * this field. + */ + name?: string; + /** + * The type of output returned for any intent specified during resolution. May express a + * particular context type (e.g. "fdc3.instrument"), channel (e.g. "channel") or a channel + * that will receive a specified type (e.g. "channel"). + */ + resultType?: null | string; + /** + * Images representing the app in common usage scenarios that can be used to render UI + * elements + */ + screenshots?: Image[]; + /** + * A more user-friendly application title that can be used to render UI elements + */ + title?: string; + /** + * A tooltip for the application that can be used to render UI elements + */ + tooltip?: string; + /** + * The Version of the application. + */ + version?: string; +} + +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ +export interface Icon { + /** + * The icon dimension, formatted as `x`. + */ + size?: string; + /** + * The icon url + */ + src: string; + /** + * Icon media type. If not present the Desktop Agent may use the src file extension. + */ + type?: string; +} + +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ +export interface Image { + /** + * Caption for the image. + */ + label?: string; + /** + * The image dimension, formatted as `x`. + */ + size?: string; + /** + * The image url. + */ + src: string; + /** + * Image media type. If not present the Desktop Agent may use the src file extension. + */ + type?: string; +} + +/** + * A response to a findInstances request that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface FindInstancesBridgeErrorResponse { + meta: FindInstancesBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: MessagePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindInstancesBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface MessagePayload { + error: FindInstancesErrors; +} + +/** + * A request for details of instances of a particular app + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface FindInstancesBridgeRequest { + meta: FindInstancesBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindInstancesBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findInstancesRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface FindInstancesBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSourceObject; + timestamp: Date; +} + +/** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + * + * Field that represents the source application that a request or response was received + * from, or the source Desktop Agent if it issued the request or response itself. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + * + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + */ +export interface MetaSourceObject { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId?: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + * + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindInstancesBridgeRequestPayload { + app: AppIdentifier; +} + +/** + * A response to a findInstances request. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface FindInstancesBridgeResponse { + meta: BridgeResponseMessageMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindInstancesBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * The message payload contains a flag indicating whether the API call was successful, plus + * any return values for the FDC3 API function called, or indicating that the request + * resulted in an error and including a standardized error message. + * + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindInstancesBridgeResponsePayload { + appIdentifiers: AppMetadata[]; +} + +/** + * A response to a findIntent request that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface FindIntentAgentErrorResponse { + meta: FindIntentAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: FindIntentAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindIntentAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface FindIntentAgentErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request for details of apps available to resolve a particular intent and context pair. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface FindIntentAgentRequest { + meta: FindIntentAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface FindIntentAgentRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceIdentifier; + timestamp: Date; + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentAgentRequestPayload { + context?: Context; + intent: string; + resultType?: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a findIntent request. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface FindIntentAgentResponse { + meta: FindIntentAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindIntentAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindIntentAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindIntentAgentResponsePayload { + appIntent: AppIntent; +} + +/** + * An interface that relates an intent to apps + */ +export interface AppIntent { + /** + * Details of applications that can resolve the intent. + */ + apps: AppMetadata[]; + /** + * Details of the intent whose relationship to resolving applications is being described. + */ + intent: IntentMetadata; +} + +/** + * Details of the intent whose relationship to resolving applications is being described. + * + * Intent descriptor + */ +export interface IntentMetadata { + /** + * Display name for the intent. + */ + displayName?: string; + /** + * The unique name of the intent that can be invoked by the raiseIntent call + */ + name: string; +} + +/** + * A response to a findIntent request that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface FindIntentBridgeErrorResponse { + meta: FindIntentBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: FindIntentBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindIntentBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface FindIntentBridgeErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * A request for details of apps available to resolve a particular intent and context pair. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface FindIntentBridgeRequest { + meta: FindIntentBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface FindIntentBridgeRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: BridgeParticipantIdentifier; + timestamp: Date; + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentBridgeRequestPayload { + context?: Context; + intent: string; + resultType?: string; +} + +/** + * A response to a findIntent request. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface FindIntentBridgeResponse { + meta: FindIntentBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindIntentBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindIntentBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindIntentBridgeResponsePayload { + appIntent: AppIntent; +} + +/** + * A response to a findIntentsByContext request that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface FindIntentsByContextAgentErrorResponse { + meta: FindIntentsByContextAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: FindIntentsByContextAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindIntentsByContextAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface FindIntentsByContextAgentErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request for details of intents and apps available to resolve them for a particular + * context. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface FindIntentsByContextAgentRequest { + meta: FindIntentsByContextAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentsByContextAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentsByContextRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface FindIntentsByContextAgentRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentsByContextAgentRequestPayload { + context: Context; + resultType?: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a findIntentsByContext request. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface FindIntentsByContextAgentResponse { + meta: FindIntentsByContextAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindIntentsByContextAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindIntentsByContextAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindIntentsByContextAgentResponsePayload { + appIntents: AppIntent[]; +} + +/** + * A response to a findIntentsByContext request that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface FindIntentsByContextBridgeErrorResponse { + meta: FindIntentsByContextBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: FindIntentsByContextBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindIntentsByContextBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface FindIntentsByContextBridgeErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * A request for details of intents and apps available to resolve them for a particular + * context. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface FindIntentsByContextBridgeRequest { + meta: FindIntentsByContextBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentsByContextBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentsByContextRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface FindIntentsByContextBridgeRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentsByContextBridgeRequestPayload { + context: Context; + resultType?: string; +} + +/** + * A response to a findIntentsByContext request. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface FindIntentsByContextBridgeResponse { + meta: FindIntentsByContextBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindIntentsByContextBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindIntentsByContextBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindIntentsByContextBridgeResponsePayload { + appIntents: AppIntent[]; +} + +/** + * A response to a getAppMetadata request that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface GetAppMetadataAgentErrorResponse { + meta: GetAppMetadataAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: GetAppMetadataAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface GetAppMetadataAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface GetAppMetadataAgentErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request for metadata about an app + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface GetAppMetadataAgentRequest { + meta: GetAppMetadataAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetAppMetadataAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getAppMetadataRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface GetAppMetadataAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceIdentifier; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetAppMetadataAgentRequestPayload { + app: AppObject; +} + +/** + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppObject { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a getAppMetadata request. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface GetAppMetadataAgentResponse { + meta: GetAppMetadataAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: GetAppMetadataAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface GetAppMetadataAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface GetAppMetadataAgentResponsePayload { + appMetadata: AppMetadata; +} + +/** + * A response to a getAppMetadata request that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface GetAppMetadataBridgeErrorResponse { + meta: GetAppMetadataBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: GetAppMetadataBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface GetAppMetadataBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface GetAppMetadataBridgeErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * A request for metadata about an app + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface GetAppMetadataBridgeRequest { + meta: GetAppMetadataBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetAppMetadataBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getAppMetadataRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface GetAppMetadataBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetAppMetadataBridgeRequestPayload { + app: AppObject; +} + +/** + * A response to a getAppMetadata request. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface GetAppMetadataBridgeResponse { + meta: GetAppMetadataBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: GetAppMetadataBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface GetAppMetadataBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface GetAppMetadataBridgeResponsePayload { + appMetadata: AppMetadata; +} + +/** + * A response to an open request that contains an error + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface OpenAgentErrorResponse { + meta: OpenAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: OpenAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface OpenAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface OpenAgentErrorResponsePayload { + error: OpenErrorResponsePayload; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Array of error message strings for responses that were not returned to the bridge before + * the timeout or because an error occurred. Should be the same length as the `errorSources` + * array and ordered the same. May be omitted if all sources responded without errors. + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type OpenErrorResponsePayload = "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "MalformedContext" | "ResolverUnavailable" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to open an application + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface OpenAgentRequest { + meta: OpenAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: OpenAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "openRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface OpenAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface OpenAgentRequestPayload { + /** + * The application to open on the specified Desktop Agent + */ + app: AppToOpen; + context?: Context; +} + +/** + * The application to open on the specified Desktop Agent + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppToOpen { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to an open request + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface OpenAgentResponse { + meta: OpenAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: OpenAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface OpenAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface OpenAgentResponsePayload { + appIdentifier: AppIdentifier; +} + +/** + * A response to an open request that contains an error + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface OpenBridgeErrorResponse { + meta: OpenBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: OpenBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface OpenBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface OpenBridgeErrorResponsePayload { + error: OpenErrorResponsePayload; +} + +/** + * A request to open an application + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface OpenBridgeRequest { + meta: OpenBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: OpenBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "openRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface OpenBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface OpenBridgeRequestPayload { + /** + * The application to open on the specified Desktop Agent + */ + app: AppToOpen; + context?: Context; +} + +/** + * A response to an open request + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface OpenBridgeResponse { + meta: OpenBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: OpenBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface OpenBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface OpenBridgeResponsePayload { + appIdentifier: AppIdentifier; +} + +/** + * A request to broadcast on a PrivateChannel. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelBroadcastAgentRequest { + meta: PrivateChannelBroadcastAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelBroadcastAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.broadcast"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelBroadcastAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ +export interface MetaDestination { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelBroadcastAgentRequestPayload { + /** + * The Id of the PrivateChannel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that was the payload of a broadcast message. + */ + context: Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to broadcast on a PrivateChannel. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelBroadcastBridgeRequest { + meta: PrivateChannelBroadcastBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelBroadcastBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.broadcast"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelBroadcastBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelBroadcastBridgeRequestPayload { + /** + * The Id of the PrivateChannel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that was the payload of a broadcast message. + */ + context: Context; +} + +/** + * A request to forward on an EventListenerAdded event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelEventListenerAddedAgentRequest { + meta: PrivateChannelEventListenerAddedAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelEventListenerAddedAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.eventListenerAdded"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelEventListenerAddedAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelEventListenerAddedAgentRequestPayload { + /** + * The id of the PrivateChannel that the event listener was added to. + */ + channelId: string; + listenerType: PrivateChannelEventListenerTypes; +} + +/** + * Event listener type names for Private Channel events + */ +export type PrivateChannelEventListenerTypes = "onAddContextListener" | "onUnsubscribe" | "onDisconnect"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on an EventListenerAdded event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelEventListenerAddedBridgeRequest { + meta: PrivateChannelEventListenerAddedBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelEventListenerAddedBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.eventListenerAdded"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelEventListenerAddedBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelEventListenerAddedBridgeRequestPayload { + /** + * The id of the PrivateChannel that the event listener was added to. + */ + channelId: string; + listenerType: PrivateChannelEventListenerTypes; +} + +/** + * A request to forward on an EventListenerRemoved event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelEventListenerRemovedAgentRequest { + meta: PrivateChannelEventListenerRemovedAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelEventListenerRemovedAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.eventListenerRemoved"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelEventListenerRemovedAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelEventListenerRemovedAgentRequestPayload { + /** + * The id of the PrivateChannel that the event listener was removed from. + */ + channelId: string; + listenerType: PrivateChannelEventListenerTypes; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on an EventListenerRemoved event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelEventListenerRemovedBridgeRequest { + meta: PrivateChannelEventListenerRemovedBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelEventListenerRemovedBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.eventListenerRemoved"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelEventListenerRemovedBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelEventListenerRemovedBridgeRequestPayload { + /** + * The id of the PrivateChannel that the event listener was removed from. + */ + channelId: string; + listenerType: PrivateChannelEventListenerTypes; +} + +/** + * A request to forward on an AddContextListener event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelOnAddContextListenerAgentRequest { + meta: PrivateChannelOnAddContextListenerAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnAddContextListenerAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onAddContextListener"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelOnAddContextListenerAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnAddContextListenerAgentRequestPayload { + /** + * The id of the PrivateChannel that the context listener was added to. + */ + channelId: string; + /** + * The type of the context listener added. Should be null for an untyped listener. + */ + contextType: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on an AddContextListener event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelOnAddContextListenerBridgeRequest { + meta: PrivateChannelOnAddContextListenerBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnAddContextListenerBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onAddContextListener"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelOnAddContextListenerBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnAddContextListenerBridgeRequestPayload { + /** + * The id of the PrivateChannel that the context listener was added to. + */ + channelId: string; + /** + * The type of the context listener added. Should be null for an untyped listener. + */ + contextType: null | string; +} + +/** + * A request to forward on a Disconnect event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelOnDisconnectAgentRequest { + meta: PrivateChannelOnDisconnectAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnDisconnectAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onDisconnect"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelOnDisconnectAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnDisconnectAgentRequestPayload { + /** + * The id of the PrivateChannel that the agent discconnected from. + */ + channelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on a Disconnect event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelOnDisconnectBridgeRequest { + meta: PrivateChannelOnDisconnectBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnDisconnectBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onDisconnect"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelOnDisconnectBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnDisconnectBridgeRequestPayload { + /** + * The id of the PrivateChannel that the agent discconnected from. + */ + channelId: string; +} + +/** + * A request to forward on an Unsubscribe event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelOnUnsubscribeAgentRequest { + meta: PrivateChannelOnUnsubscribeAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnUnsubscribeAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onUnsubscribe"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelOnUnsubscribeAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnUnsubscribeAgentRequestPayload { + /** + * The id of the PrivateChannel that the context listener was unsubscribed from. + */ + channelId: string; + /** + * The type of the context listener that was unsubscribed. Should be null for an untyped + * listener. + */ + contextType: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on an Unsubscribe event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelOnUnsubscribeBridgeRequest { + meta: ERequestMetadata; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnUnsubscribeBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onUnsubscribe"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface ERequestMetadata { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnUnsubscribeBridgeRequestPayload { + /** + * The id of the PrivateChannel that the context listener was unsubscribed from. + */ + channelId: string; + /** + * The type of the context listener that was unsubscribed. Should be null for an untyped + * listener. + */ + contextType: null | string; +} + +/** + * A response to a request to raise an intent that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface RaiseIntentAgentErrorResponse { + meta: RaiseIntentAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: RaiseIntentAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface RaiseIntentAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Used if a raiseIntent request resulted in an error + * + * Error message payload containing an standardized error string. + */ +export interface RaiseIntentAgentErrorResponsePayload { + /** + * Should be set if the raiseIntent request returned an error. + */ + error: FindInstancesErrors; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to raise an intent. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface RaiseIntentAgentRequest { + meta: RaiseIntentAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: RaiseIntentAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "raiseIntentRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface RaiseIntentAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface RaiseIntentAgentRequestPayload { + app: AppDestinationIdentifier; + context: Context; + intent: string; +} + +/** + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppDestinationIdentifier { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a request to raise an intent. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface RaiseIntentAgentResponse { + meta: RaiseIntentAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: RaiseIntentAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface RaiseIntentAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface RaiseIntentAgentResponsePayload { + /** + * Used if the raiseIntent request was successfully resolved + */ + intentResolution: IntentResolution; +} + +/** + * Used if the raiseIntent request was successfully resolved + * + * IntentResolution provides a standard format for data returned upon resolving an intent. + * + * ```javascript + * //resolve a "Chain" type intent + * let resolution = await agent.raiseIntent("intentName", context); + * + * //resolve a "Client-Service" type intent with a data response or a Channel + * let resolution = await agent.raiseIntent("intentName", context); + * try { + * const result = await resolution.getResult(); + * if (result && result.broadcast) { + * console.log(`${resolution.source} returned a channel with id ${result.id}`); + * } else if (result){ + * console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`); + * } else { + * console.error(`${resolution.source} didn't return data` + * } + * } catch(error) { + * console.error(`${resolution.source} returned an error: ${error}`); + * } + * + * // Use metadata about the resolving app instance to target a further intent + * await agent.raiseIntent("intentName", context, resolution.source); + * ``` + */ +export interface IntentResolution { + /** + * The intent that was raised. May be used to determine which intent the user + * chose in response to `fdc3.raiseIntentForContext()`. + */ + intent: string; + /** + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ + source: AppIdentifier; +} + +/** + * A response to a request to raise an intent that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface RaiseIntentBridgeErrorResponse { + meta: RaiseIntentBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: RaiseIntentBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface RaiseIntentBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Used if a raiseIntent request resulted in an error + * + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface RaiseIntentBridgeErrorResponsePayload { + /** + * Should be set if the raiseIntent request returned an error. + */ + error: FindInstancesErrors; +} + +/** + * A request to raise an intent. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface RaiseIntentBridgeRequest { + meta: RaiseIntentBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: RaiseIntentBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "raiseIntentRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface RaiseIntentBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface RaiseIntentBridgeRequestPayload { + app: AppDestinationIdentifier; + context: Context; + intent: string; +} + +/** + * A response to a request to raise an intent. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface RaiseIntentBridgeResponse { + meta: RaiseIntentBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: RaiseIntentBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface RaiseIntentBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface RaiseIntentBridgeResponsePayload { + /** + * Used if the raiseIntent request was successfully resolved + */ + intentResolution: IntentResolution; +} + +/** + * A secondary response to a request to raise an intent used to deliver the intent result, + * which contains an error + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface RaiseIntentResultAgentErrorResponse { + meta: RaiseIntentResultAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: RaiseIntentResultAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface RaiseIntentResultAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface RaiseIntentResultAgentErrorResponsePayload { + error: RaiseIntentResultErrorMessage; +} + +/** + * Array of error message strings for responses that were not returned to the bridge before + * the timeout or because an error occurred. Should be the same length as the `errorSources` + * array and ordered the same. May be omitted if all sources responded without errors. + * + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type RaiseIntentResultErrorMessage = "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A secondary response to a request to raise an intent used to deliver the intent result + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface RaiseIntentResultAgentResponse { + meta: RaiseIntentResultAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: RaiseIntentResultAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface RaiseIntentResultAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface RaiseIntentResultAgentResponsePayload { + intentResult: IntentResult; +} + +export interface IntentResult { + context?: Context; + channel?: Channel; +} + +/** + * Represents a context channel that applications can use to send and receive + * context data. + * + * Please note that There are differences in behavior when you interact with a + * User channel via the `DesktopAgent` interface and the `Channel` interface. + * Specifically, when 'joining' a User channel or adding a context listener + * when already joined to a channel via the `DesktopAgent` interface, existing + * context (matching the type of the context listener) on the channel is + * received by the context listener immediately. Whereas, when a context + * listener is added via the Channel interface, context is not received + * automatically, but may be retrieved manually via the `getCurrentContext()` + * function. + */ +export interface Channel { + /** + * Channels may be visualized and selectable by users. DisplayMetadata may be used to + * provide hints on how to see them. + * For App channels, displayMetadata would typically not be present. + */ + displayMetadata?: DisplayMetadata; + /** + * Constant that uniquely identifies this channel. + */ + id: string; + /** + * Uniquely defines each channel type. + * Can be "user", "app" or "private". + */ + type: Type; +} + +/** + * Channels may be visualized and selectable by users. DisplayMetadata may be used to + * provide hints on how to see them. + * For App channels, displayMetadata would typically not be present. + * + * A system channel will be global enough to have a presence across many apps. This gives us + * some hints + * to render them in a standard way. It is assumed it may have other properties too, but if + * it has these, + * this is their meaning. + */ +export interface DisplayMetadata { + /** + * The color that should be associated within this channel when displaying this channel in a + * UI, e.g: `0xFF0000`. + */ + color?: string; + /** + * A URL of an image that can be used to display this channel + */ + glyph?: string; + /** + * A user-readable name for this channel, e.g: `"Red"` + */ + name?: string; +} + +/** + * Uniquely defines each channel type. + * Can be "user", "app" or "private". + */ +export type Type = "app" | "private" | "user"; + +/** + * A secondary response to a request to raise an intent used to deliver the intent result, + * which contains an error + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface RaiseIntentResultBridgeErrorResponse { + meta: RaiseIntentResultBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: RaiseIntentResultBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface RaiseIntentResultBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface RaiseIntentResultBridgeErrorResponsePayload { + error: RaiseIntentResultErrorMessage; +} + +/** + * A secondary response to a request to raise an intent used to deliver the intent result + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface RaiseIntentResultBridgeResponse { + meta: RaiseIntentResultBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: RaiseIntentResultBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface RaiseIntentResultBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface RaiseIntentResultBridgeResponsePayload { + intentResult: IntentResult; +} + +// Converts JSON strings to/from your types +// and asserts the results of JSON.parse at runtime +export class Convert { + public static toAgentErrorResponseMessage(json: string): AgentErrorResponseMessage { + return cast(JSON.parse(json), r("AgentErrorResponseMessage")); + } + + public static agentErrorResponseMessageToJson(value: AgentErrorResponseMessage): string { + return JSON.stringify(uncast(value, r("AgentErrorResponseMessage")), null, 2); + } + + public static toAgentRequestMessage(json: string): AgentRequestMessage { + return cast(JSON.parse(json), r("AgentRequestMessage")); + } + + public static agentRequestMessageToJson(value: AgentRequestMessage): string { + return JSON.stringify(uncast(value, r("AgentRequestMessage")), null, 2); + } + + public static toAgentResponseMessage(json: string): AgentResponseMessage { + return cast(JSON.parse(json), r("AgentResponseMessage")); + } + + public static agentResponseMessageToJson(value: AgentResponseMessage): string { + return JSON.stringify(uncast(value, r("AgentResponseMessage")), null, 2); + } + + public static toBridgeErrorResponseMessage(json: string): BridgeErrorResponseMessage { + return cast(JSON.parse(json), r("BridgeErrorResponseMessage")); + } + + public static bridgeErrorResponseMessageToJson(value: BridgeErrorResponseMessage): string { + return JSON.stringify(uncast(value, r("BridgeErrorResponseMessage")), null, 2); + } + + public static toBridgeRequestMessage(json: string): BridgeRequestMessage { + return cast(JSON.parse(json), r("BridgeRequestMessage")); + } + + public static bridgeRequestMessageToJson(value: BridgeRequestMessage): string { + return JSON.stringify(uncast(value, r("BridgeRequestMessage")), null, 2); + } + + public static toBridgeResponseMessage(json: string): BridgeResponseMessage { + return cast(JSON.parse(json), r("BridgeResponseMessage")); + } + + public static bridgeResponseMessageToJson(value: BridgeResponseMessage): string { + return JSON.stringify(uncast(value, r("BridgeResponseMessage")), null, 2); + } + + public static toBroadcastAgentRequest(json: string): BroadcastAgentRequest { + return cast(JSON.parse(json), r("BroadcastAgentRequest")); + } + + public static broadcastAgentRequestToJson(value: BroadcastAgentRequest): string { + return JSON.stringify(uncast(value, r("BroadcastAgentRequest")), null, 2); + } + + public static toBroadcastBridgeRequest(json: string): BroadcastBridgeRequest { + return cast(JSON.parse(json), r("BroadcastBridgeRequest")); + } + + public static broadcastBridgeRequestToJson(value: BroadcastBridgeRequest): string { + return JSON.stringify(uncast(value, r("BroadcastBridgeRequest")), null, 2); + } + + public static toBridgeCommonDefinitions(json: string): { [key: string]: any } { + return cast(JSON.parse(json), m("any")); + } + + public static bridgeCommonDefinitionsToJson(value: { [key: string]: any }): string { + return JSON.stringify(uncast(value, m("any")), null, 2); + } + + public static toConnectionStepMessage(json: string): ConnectionStepMessage { + return cast(JSON.parse(json), r("ConnectionStepMessage")); + } + + public static connectionStepMessageToJson(value: ConnectionStepMessage): string { + return JSON.stringify(uncast(value, r("ConnectionStepMessage")), null, 2); + } + + public static toConnectionStep2Hello(json: string): ConnectionStep2Hello { + return cast(JSON.parse(json), r("ConnectionStep2Hello")); + } + + public static connectionStep2HelloToJson(value: ConnectionStep2Hello): string { + return JSON.stringify(uncast(value, r("ConnectionStep2Hello")), null, 2); + } + + public static toConnectionStep3Handshake(json: string): ConnectionStep3Handshake { + return cast(JSON.parse(json), r("ConnectionStep3Handshake")); + } + + public static connectionStep3HandshakeToJson(value: ConnectionStep3Handshake): string { + return JSON.stringify(uncast(value, r("ConnectionStep3Handshake")), null, 2); + } + + public static toConnectionStep4AuthenticationFailed(json: string): ConnectionStep4AuthenticationFailed { + return cast(JSON.parse(json), r("ConnectionStep4AuthenticationFailed")); + } + + public static connectionStep4AuthenticationFailedToJson(value: ConnectionStep4AuthenticationFailed): string { + return JSON.stringify(uncast(value, r("ConnectionStep4AuthenticationFailed")), null, 2); + } + + public static toConnectionStep6ConnectedAgentsUpdate(json: string): ConnectionStep6ConnectedAgentsUpdate { + return cast(JSON.parse(json), r("ConnectionStep6ConnectedAgentsUpdate")); + } + + public static connectionStep6ConnectedAgentsUpdateToJson(value: ConnectionStep6ConnectedAgentsUpdate): string { + return JSON.stringify(uncast(value, r("ConnectionStep6ConnectedAgentsUpdate")), null, 2); + } + + public static toFindInstancesAgentErrorResponse(json: string): FindInstancesAgentErrorResponse { + return cast(JSON.parse(json), r("FindInstancesAgentErrorResponse")); + } + + public static findInstancesAgentErrorResponseToJson(value: FindInstancesAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesAgentErrorResponse")), null, 2); + } + + public static toFindInstancesAgentRequest(json: string): FindInstancesAgentRequest { + return cast(JSON.parse(json), r("FindInstancesAgentRequest")); + } + + public static findInstancesAgentRequestToJson(value: FindInstancesAgentRequest): string { + return JSON.stringify(uncast(value, r("FindInstancesAgentRequest")), null, 2); + } + + public static toFindInstancesAgentResponse(json: string): FindInstancesAgentResponse { + return cast(JSON.parse(json), r("FindInstancesAgentResponse")); + } + + public static findInstancesAgentResponseToJson(value: FindInstancesAgentResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesAgentResponse")), null, 2); + } + + public static toFindInstancesBridgeErrorResponse(json: string): FindInstancesBridgeErrorResponse { + return cast(JSON.parse(json), r("FindInstancesBridgeErrorResponse")); + } + + public static findInstancesBridgeErrorResponseToJson(value: FindInstancesBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesBridgeErrorResponse")), null, 2); + } + + public static toFindInstancesBridgeRequest(json: string): FindInstancesBridgeRequest { + return cast(JSON.parse(json), r("FindInstancesBridgeRequest")); + } + + public static findInstancesBridgeRequestToJson(value: FindInstancesBridgeRequest): string { + return JSON.stringify(uncast(value, r("FindInstancesBridgeRequest")), null, 2); + } + + public static toFindInstancesBridgeResponse(json: string): FindInstancesBridgeResponse { + return cast(JSON.parse(json), r("FindInstancesBridgeResponse")); + } + + public static findInstancesBridgeResponseToJson(value: FindInstancesBridgeResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesBridgeResponse")), null, 2); + } + + public static toFindIntentAgentErrorResponse(json: string): FindIntentAgentErrorResponse { + return cast(JSON.parse(json), r("FindIntentAgentErrorResponse")); + } + + public static findIntentAgentErrorResponseToJson(value: FindIntentAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("FindIntentAgentErrorResponse")), null, 2); + } + + public static toFindIntentAgentRequest(json: string): FindIntentAgentRequest { + return cast(JSON.parse(json), r("FindIntentAgentRequest")); + } + + public static findIntentAgentRequestToJson(value: FindIntentAgentRequest): string { + return JSON.stringify(uncast(value, r("FindIntentAgentRequest")), null, 2); + } + + public static toFindIntentAgentResponse(json: string): FindIntentAgentResponse { + return cast(JSON.parse(json), r("FindIntentAgentResponse")); + } + + public static findIntentAgentResponseToJson(value: FindIntentAgentResponse): string { + return JSON.stringify(uncast(value, r("FindIntentAgentResponse")), null, 2); + } + + public static toFindIntentBridgeErrorResponse(json: string): FindIntentBridgeErrorResponse { + return cast(JSON.parse(json), r("FindIntentBridgeErrorResponse")); + } + + public static findIntentBridgeErrorResponseToJson(value: FindIntentBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("FindIntentBridgeErrorResponse")), null, 2); + } + + public static toFindIntentBridgeRequest(json: string): FindIntentBridgeRequest { + return cast(JSON.parse(json), r("FindIntentBridgeRequest")); + } + + public static findIntentBridgeRequestToJson(value: FindIntentBridgeRequest): string { + return JSON.stringify(uncast(value, r("FindIntentBridgeRequest")), null, 2); + } + + public static toFindIntentBridgeResponse(json: string): FindIntentBridgeResponse { + return cast(JSON.parse(json), r("FindIntentBridgeResponse")); + } + + public static findIntentBridgeResponseToJson(value: FindIntentBridgeResponse): string { + return JSON.stringify(uncast(value, r("FindIntentBridgeResponse")), null, 2); + } + + public static toFindIntentsByContextAgentErrorResponse(json: string): FindIntentsByContextAgentErrorResponse { + return cast(JSON.parse(json), r("FindIntentsByContextAgentErrorResponse")); + } + + public static findIntentsByContextAgentErrorResponseToJson(value: FindIntentsByContextAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextAgentErrorResponse")), null, 2); + } + + public static toFindIntentsByContextAgentRequest(json: string): FindIntentsByContextAgentRequest { + return cast(JSON.parse(json), r("FindIntentsByContextAgentRequest")); + } + + public static findIntentsByContextAgentRequestToJson(value: FindIntentsByContextAgentRequest): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextAgentRequest")), null, 2); + } + + public static toFindIntentsByContextAgentResponse(json: string): FindIntentsByContextAgentResponse { + return cast(JSON.parse(json), r("FindIntentsByContextAgentResponse")); + } + + public static findIntentsByContextAgentResponseToJson(value: FindIntentsByContextAgentResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextAgentResponse")), null, 2); + } + + public static toFindIntentsByContextBridgeErrorResponse(json: string): FindIntentsByContextBridgeErrorResponse { + return cast(JSON.parse(json), r("FindIntentsByContextBridgeErrorResponse")); + } + + public static findIntentsByContextBridgeErrorResponseToJson(value: FindIntentsByContextBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeErrorResponse")), null, 2); + } + + public static toFindIntentsByContextBridgeRequest(json: string): FindIntentsByContextBridgeRequest { + return cast(JSON.parse(json), r("FindIntentsByContextBridgeRequest")); + } + + public static findIntentsByContextBridgeRequestToJson(value: FindIntentsByContextBridgeRequest): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeRequest")), null, 2); + } + + public static toFindIntentsByContextBridgeResponse(json: string): FindIntentsByContextBridgeResponse { + return cast(JSON.parse(json), r("FindIntentsByContextBridgeResponse")); + } + + public static findIntentsByContextBridgeResponseToJson(value: FindIntentsByContextBridgeResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeResponse")), null, 2); + } + + public static toGetAppMetadataAgentErrorResponse(json: string): GetAppMetadataAgentErrorResponse { + return cast(JSON.parse(json), r("GetAppMetadataAgentErrorResponse")); + } + + public static getAppMetadataAgentErrorResponseToJson(value: GetAppMetadataAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataAgentErrorResponse")), null, 2); + } + + public static toGetAppMetadataAgentRequest(json: string): GetAppMetadataAgentRequest { + return cast(JSON.parse(json), r("GetAppMetadataAgentRequest")); + } + + public static getAppMetadataAgentRequestToJson(value: GetAppMetadataAgentRequest): string { + return JSON.stringify(uncast(value, r("GetAppMetadataAgentRequest")), null, 2); + } + + public static toGetAppMetadataAgentResponse(json: string): GetAppMetadataAgentResponse { + return cast(JSON.parse(json), r("GetAppMetadataAgentResponse")); + } + + public static getAppMetadataAgentResponseToJson(value: GetAppMetadataAgentResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataAgentResponse")), null, 2); + } + + public static toGetAppMetadataBridgeErrorResponse(json: string): GetAppMetadataBridgeErrorResponse { + return cast(JSON.parse(json), r("GetAppMetadataBridgeErrorResponse")); + } + + public static getAppMetadataBridgeErrorResponseToJson(value: GetAppMetadataBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataBridgeErrorResponse")), null, 2); + } + + public static toGetAppMetadataBridgeRequest(json: string): GetAppMetadataBridgeRequest { + return cast(JSON.parse(json), r("GetAppMetadataBridgeRequest")); + } + + public static getAppMetadataBridgeRequestToJson(value: GetAppMetadataBridgeRequest): string { + return JSON.stringify(uncast(value, r("GetAppMetadataBridgeRequest")), null, 2); + } + + public static toGetAppMetadataBridgeResponse(json: string): GetAppMetadataBridgeResponse { + return cast(JSON.parse(json), r("GetAppMetadataBridgeResponse")); + } + + public static getAppMetadataBridgeResponseToJson(value: GetAppMetadataBridgeResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataBridgeResponse")), null, 2); + } + + public static toOpenAgentErrorResponse(json: string): OpenAgentErrorResponse { + return cast(JSON.parse(json), r("OpenAgentErrorResponse")); + } + + public static openAgentErrorResponseToJson(value: OpenAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("OpenAgentErrorResponse")), null, 2); + } + + public static toOpenAgentRequest(json: string): OpenAgentRequest { + return cast(JSON.parse(json), r("OpenAgentRequest")); + } + + public static openAgentRequestToJson(value: OpenAgentRequest): string { + return JSON.stringify(uncast(value, r("OpenAgentRequest")), null, 2); + } + + public static toOpenAgentResponse(json: string): OpenAgentResponse { + return cast(JSON.parse(json), r("OpenAgentResponse")); + } + + public static openAgentResponseToJson(value: OpenAgentResponse): string { + return JSON.stringify(uncast(value, r("OpenAgentResponse")), null, 2); + } + + public static toOpenBridgeErrorResponse(json: string): OpenBridgeErrorResponse { + return cast(JSON.parse(json), r("OpenBridgeErrorResponse")); + } + + public static openBridgeErrorResponseToJson(value: OpenBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("OpenBridgeErrorResponse")), null, 2); + } + + public static toOpenBridgeRequest(json: string): OpenBridgeRequest { + return cast(JSON.parse(json), r("OpenBridgeRequest")); + } + + public static openBridgeRequestToJson(value: OpenBridgeRequest): string { + return JSON.stringify(uncast(value, r("OpenBridgeRequest")), null, 2); + } + + public static toOpenBridgeResponse(json: string): OpenBridgeResponse { + return cast(JSON.parse(json), r("OpenBridgeResponse")); + } + + public static openBridgeResponseToJson(value: OpenBridgeResponse): string { + return JSON.stringify(uncast(value, r("OpenBridgeResponse")), null, 2); + } + + public static toPrivateChannelBroadcastAgentRequest(json: string): PrivateChannelBroadcastAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelBroadcastAgentRequest")); + } + + public static privateChannelBroadcastAgentRequestToJson(value: PrivateChannelBroadcastAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelBroadcastAgentRequest")), null, 2); + } + + public static toPrivateChannelBroadcastBridgeRequest(json: string): PrivateChannelBroadcastBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelBroadcastBridgeRequest")); + } + + public static privateChannelBroadcastBridgeRequestToJson(value: PrivateChannelBroadcastBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelBroadcastBridgeRequest")), null, 2); + } + + public static toPrivateChannelEventListenerAddedAgentRequest(json: string): PrivateChannelEventListenerAddedAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelEventListenerAddedAgentRequest")); + } + + public static privateChannelEventListenerAddedAgentRequestToJson(value: PrivateChannelEventListenerAddedAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelEventListenerAddedAgentRequest")), null, 2); + } + + public static toPrivateChannelEventListenerAddedBridgeRequest(json: string): PrivateChannelEventListenerAddedBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelEventListenerAddedBridgeRequest")); + } + + public static privateChannelEventListenerAddedBridgeRequestToJson(value: PrivateChannelEventListenerAddedBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelEventListenerAddedBridgeRequest")), null, 2); + } + + public static toPrivateChannelEventListenerRemovedAgentRequest(json: string): PrivateChannelEventListenerRemovedAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelEventListenerRemovedAgentRequest")); + } + + public static privateChannelEventListenerRemovedAgentRequestToJson(value: PrivateChannelEventListenerRemovedAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelEventListenerRemovedAgentRequest")), null, 2); + } + + public static toPrivateChannelEventListenerRemovedBridgeRequest(json: string): PrivateChannelEventListenerRemovedBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelEventListenerRemovedBridgeRequest")); + } + + public static privateChannelEventListenerRemovedBridgeRequestToJson(value: PrivateChannelEventListenerRemovedBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelEventListenerRemovedBridgeRequest")), null, 2); + } + + public static toPrivateChannelOnAddContextListenerAgentRequest(json: string): PrivateChannelOnAddContextListenerAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerAgentRequest")); + } + + public static privateChannelOnAddContextListenerAgentRequestToJson(value: PrivateChannelOnAddContextListenerAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerAgentRequest")), null, 2); + } + + public static toPrivateChannelOnAddContextListenerBridgeRequest(json: string): PrivateChannelOnAddContextListenerBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerBridgeRequest")); + } + + public static privateChannelOnAddContextListenerBridgeRequestToJson(value: PrivateChannelOnAddContextListenerBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerBridgeRequest")), null, 2); + } + + public static toPrivateChannelOnDisconnectAgentRequest(json: string): PrivateChannelOnDisconnectAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelOnDisconnectAgentRequest")); + } + + public static privateChannelOnDisconnectAgentRequestToJson(value: PrivateChannelOnDisconnectAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectAgentRequest")), null, 2); + } + + public static toPrivateChannelOnDisconnectBridgeRequest(json: string): PrivateChannelOnDisconnectBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelOnDisconnectBridgeRequest")); + } + + public static privateChannelOnDisconnectBridgeRequestToJson(value: PrivateChannelOnDisconnectBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectBridgeRequest")), null, 2); + } + + public static toPrivateChannelOnUnsubscribeAgentRequest(json: string): PrivateChannelOnUnsubscribeAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeAgentRequest")); + } + + public static privateChannelOnUnsubscribeAgentRequestToJson(value: PrivateChannelOnUnsubscribeAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeAgentRequest")), null, 2); + } + + public static toPrivateChannelOnUnsubscribeBridgeRequest(json: string): PrivateChannelOnUnsubscribeBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeBridgeRequest")); + } + + public static privateChannelOnUnsubscribeBridgeRequestToJson(value: PrivateChannelOnUnsubscribeBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeBridgeRequest")), null, 2); + } + + public static toRaiseIntentAgentErrorResponse(json: string): RaiseIntentAgentErrorResponse { + return cast(JSON.parse(json), r("RaiseIntentAgentErrorResponse")); + } + + public static raiseIntentAgentErrorResponseToJson(value: RaiseIntentAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentAgentErrorResponse")), null, 2); + } + + public static toRaiseIntentAgentRequest(json: string): RaiseIntentAgentRequest { + return cast(JSON.parse(json), r("RaiseIntentAgentRequest")); + } + + public static raiseIntentAgentRequestToJson(value: RaiseIntentAgentRequest): string { + return JSON.stringify(uncast(value, r("RaiseIntentAgentRequest")), null, 2); + } + + public static toRaiseIntentAgentResponse(json: string): RaiseIntentAgentResponse { + return cast(JSON.parse(json), r("RaiseIntentAgentResponse")); + } + + public static raiseIntentAgentResponseToJson(value: RaiseIntentAgentResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentAgentResponse")), null, 2); + } + + public static toRaiseIntentBridgeErrorResponse(json: string): RaiseIntentBridgeErrorResponse { + return cast(JSON.parse(json), r("RaiseIntentBridgeErrorResponse")); + } + + public static raiseIntentBridgeErrorResponseToJson(value: RaiseIntentBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentBridgeErrorResponse")), null, 2); + } + + public static toRaiseIntentBridgeRequest(json: string): RaiseIntentBridgeRequest { + return cast(JSON.parse(json), r("RaiseIntentBridgeRequest")); + } + + public static raiseIntentBridgeRequestToJson(value: RaiseIntentBridgeRequest): string { + return JSON.stringify(uncast(value, r("RaiseIntentBridgeRequest")), null, 2); + } + + public static toRaiseIntentBridgeResponse(json: string): RaiseIntentBridgeResponse { + return cast(JSON.parse(json), r("RaiseIntentBridgeResponse")); + } + + public static raiseIntentBridgeResponseToJson(value: RaiseIntentBridgeResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentBridgeResponse")), null, 2); + } + + public static toRaiseIntentResultAgentErrorResponse(json: string): RaiseIntentResultAgentErrorResponse { + return cast(JSON.parse(json), r("RaiseIntentResultAgentErrorResponse")); + } + + public static raiseIntentResultAgentErrorResponseToJson(value: RaiseIntentResultAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultAgentErrorResponse")), null, 2); + } + + public static toRaiseIntentResultAgentResponse(json: string): RaiseIntentResultAgentResponse { + return cast(JSON.parse(json), r("RaiseIntentResultAgentResponse")); + } + + public static raiseIntentResultAgentResponseToJson(value: RaiseIntentResultAgentResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultAgentResponse")), null, 2); + } + + public static toRaiseIntentResultBridgeErrorResponse(json: string): RaiseIntentResultBridgeErrorResponse { + return cast(JSON.parse(json), r("RaiseIntentResultBridgeErrorResponse")); + } + + public static raiseIntentResultBridgeErrorResponseToJson(value: RaiseIntentResultBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultBridgeErrorResponse")), null, 2); + } + + public static toRaiseIntentResultBridgeResponse(json: string): RaiseIntentResultBridgeResponse { + return cast(JSON.parse(json), r("RaiseIntentResultBridgeResponse")); + } + + public static raiseIntentResultBridgeResponseToJson(value: RaiseIntentResultBridgeResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultBridgeResponse")), null, 2); + } +} + +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { + const prettyTyp = prettyTypeName(typ); + const parentText = parent ? ` on ${parent}` : ''; + const keyText = key ? ` for key "${key}"` : ''; + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); +} + +function prettyTypeName(typ: any): string { + if (Array.isArray(typ)) { + if (typ.length === 2 && typ[0] === undefined) { + return `an optional ${prettyTypeName(typ[1])}`; + } else { + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; + } + } else if (typeof typ === "object" && typ.literal !== undefined) { + return typ.literal; + } else { + return typeof typ; + } +} + +function jsonToJSProps(typ: any): any { + if (typ.jsonToJS === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); + typ.jsonToJS = map; + } + return typ.jsonToJS; +} + +function jsToJSONProps(typ: any): any { + if (typ.jsToJSON === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); + typ.jsToJSON = map; + } + return typ.jsToJSON; +} + +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { + function transformPrimitive(typ: string, val: any): any { + if (typeof typ === typeof val) return val; + return invalidValue(typ, val, key, parent); + } + + function transformUnion(typs: any[], val: any): any { + // val must validate against one typ in typs + const l = typs.length; + for (let i = 0; i < l; i++) { + const typ = typs[i]; + try { + return transform(val, typ, getProps); + } catch (_) {} + } + return invalidValue(typs, val, key, parent); + } + + function transformEnum(cases: string[], val: any): any { + if (cases.indexOf(val) !== -1) return val; + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); + } + + function transformArray(typ: any, val: any): any { + // val must be an array with no invalid elements + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); + return val.map(el => transform(el, typ, getProps)); + } + + function transformDate(val: any): any { + if (val === null) { + return null; + } + const d = new Date(val); + if (isNaN(d.valueOf())) { + return invalidValue(l("Date"), val, key, parent); + } + return d; + } + + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { + if (val === null || typeof val !== "object" || Array.isArray(val)) { + return invalidValue(l(ref || "object"), val, key, parent); + } + const result: any = {}; + Object.getOwnPropertyNames(props).forEach(key => { + const prop = props[key]; + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; + result[prop.key] = transform(v, prop.typ, getProps, key, ref); + }); + Object.getOwnPropertyNames(val).forEach(key => { + if (!Object.prototype.hasOwnProperty.call(props, key)) { + result[key] = transform(val[key], additional, getProps, key, ref); + } + }); + return result; + } + + if (typ === "any") return val; + if (typ === null) { + if (val === null) return val; + return invalidValue(typ, val, key, parent); + } + if (typ === false) return invalidValue(typ, val, key, parent); + let ref: any = undefined; + while (typeof typ === "object" && typ.ref !== undefined) { + ref = typ.ref; + typ = typeMap[typ.ref]; + } + if (Array.isArray(typ)) return transformEnum(typ, val); + if (typeof typ === "object") { + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) + : invalidValue(typ, val, key, parent); + } + // Numbers can be parsed by Date but shouldn't be. + if (typ === Date && typeof val !== "number") return transformDate(val); + return transformPrimitive(typ, val); +} + +function cast(val: any, typ: any): T { + return transform(val, typ, jsonToJSProps); +} + +function uncast(val: T, typ: any): any { + return transform(val, typ, jsToJSONProps); +} + +function l(typ: any) { + return { literal: typ }; +} + +function a(typ: any) { + return { arrayItems: typ }; +} + +function u(...typs: any[]) { + return { unionMembers: typs }; +} + +function o(props: any[], additional: any) { + return { props, additional }; +} + +function m(additional: any) { + return { props: [], additional }; +} + +function r(name: string) { + return { ref: name }; +} + +const typeMap: any = { + "AgentErrorResponseMessage": o([ + { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, + { json: "payload", js: "payload", typ: r("ErrorResponseMessagePayload") }, + { json: "type", js: "type", typ: r("ResponseMessageType") }, + ], false), + "AgentResponseMetadata": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ErrorResponseMessagePayload": o([ + { json: "error", js: "error", typ: r("ResponseErrorDetail") }, + ], "any"), + "AgentRequestMessage": o([ + { json: "meta", js: "meta", typ: r("AgentRequestMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("RequestMessageType") }, + ], false), + "AgentRequestMetadata": o([ + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "BridgeParticipantIdentifier": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "SourceIdentifier": o([ + { json: "appId", js: "appId", typ: u(undefined, "") }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "AgentResponseMessage": o([ + { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("ResponseMessageType") }, + ], false), + "BridgeErrorResponseMessage": o([ + { json: "meta", js: "meta", typ: r("BridgeErrorResponseMessageMeta") }, + { json: "payload", js: "payload", typ: r("ResponseErrorMessagePayload") }, + { json: "type", js: "type", typ: "" }, + ], false), + "BridgeErrorResponseMessageMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "DesktopAgentIdentifier": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + ], "any"), + "ResponseErrorMessagePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponseErrorDetail")) }, + ], "any"), + "BridgeRequestMessage": o([ + { json: "meta", js: "meta", typ: r("BridgeRequestMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: "" }, + ], false), + "BridgeRequestMetadata": o([ + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("BridgeParticipantIdentifier") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "BridgeResponseMessage": o([ + { json: "meta", js: "meta", typ: r("BridgeResponseMessageMeta") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: "" }, + ], false), + "BridgeResponseMessageMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "BroadcastAgentRequest": o([ + { json: "meta", js: "meta", typ: r("BroadcastAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastAgentRequestPayload") }, + { json: "type", js: "type", typ: r("BroadcastAgentRequestType") }, + ], false), + "BroadcastAgentRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("SourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "SourceObject": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "BroadcastAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "Context": o([ + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: "" }, + ], "any"), + "BroadcastBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("BroadcastBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("BroadcastAgentRequestType") }, + ], false), + "BroadcastBridgeRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "MetaSource": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "BroadcastBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "ConnectionStepMessage": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("ConnectionStepMessageType") }, + ], false), + "ConnectionStepMetadata": o([ + { json: "requestUuid", js: "requestUuid", typ: u(undefined, "") }, + { json: "responseUuid", js: "responseUuid", typ: u(undefined, "") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep2Hello": o([ + { json: "meta", js: "meta", typ: r("ConnectionStep2HelloMeta") }, + { json: "payload", js: "payload", typ: r("ConnectionStep2HelloPayload") }, + { json: "type", js: "type", typ: r("ConnectionStep2HelloType") }, + ], false), + "ConnectionStep2HelloMeta": o([ + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep2HelloPayload": o([ + { json: "authRequired", js: "authRequired", typ: true }, + { json: "authToken", js: "authToken", typ: u(undefined, "") }, + { json: "desktopAgentBridgeVersion", js: "desktopAgentBridgeVersion", typ: "" }, + { json: "supportedFDC3Versions", js: "supportedFDC3Versions", typ: a("") }, + ], false), + "ConnectionStep3Handshake": o([ + { json: "meta", js: "meta", typ: r("ConnectionStep3HandshakeMeta") }, + { json: "payload", js: "payload", typ: r("ConnectionStep3HandshakePayload") }, + { json: "type", js: "type", typ: r("ConnectionStep3HandshakeType") }, + ], false), + "ConnectionStep3HandshakeMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep3HandshakePayload": o([ + { json: "authToken", js: "authToken", typ: u(undefined, "") }, + { json: "channelsState", js: "channelsState", typ: m(a(r("Context"))) }, + { json: "implementationMetadata", js: "implementationMetadata", typ: r("ConnectingAgentImplementationMetadata") }, + { json: "requestedName", js: "requestedName", typ: "" }, + ], false), + "ConnectingAgentImplementationMetadata": o([ + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, + { json: "provider", js: "provider", typ: "" }, + { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, + ], false), + "OptionalFeatures": o([ + { json: "DesktopAgentBridging", js: "DesktopAgentBridging", typ: true }, + { json: "OriginatingAppMetadata", js: "OriginatingAppMetadata", typ: true }, + { json: "UserChannelMembershipAPIs", js: "UserChannelMembershipAPIs", typ: true }, + ], false), + "ConnectionStep4AuthenticationFailed": o([ + { json: "meta", js: "meta", typ: r("ConnectionStep4AuthenticationFailedMeta") }, + { json: "payload", js: "payload", typ: r("ConnectionStep4AuthenticationFailedPayload") }, + { json: "type", js: "type", typ: r("ConnectionStep4AuthenticationFailedType") }, + ], false), + "ConnectionStep4AuthenticationFailedMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep4AuthenticationFailedPayload": o([ + { json: "message", js: "message", typ: u(undefined, "") }, + ], false), + "ConnectionStep6ConnectedAgentsUpdate": o([ + { json: "meta", js: "meta", typ: r("ConnectionStep6ConnectedAgentsUpdateMeta") }, + { json: "payload", js: "payload", typ: r("ConnectionStep6ConnectedAgentsUpdatePayload") }, + { json: "type", js: "type", typ: r("ConnectionStep6ConnectedAgentsUpdateType") }, + ], false), + "ConnectionStep6ConnectedAgentsUpdateMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep6ConnectedAgentsUpdatePayload": o([ + { json: "addAgent", js: "addAgent", typ: u(undefined, "") }, + { json: "allAgents", js: "allAgents", typ: a(r("DesktopAgentImplementationMetadata")) }, + { json: "channelsState", js: "channelsState", typ: u(undefined, m(a(r("Context")))) }, + { json: "removeAgent", js: "removeAgent", typ: u(undefined, "") }, + ], false), + "DesktopAgentImplementationMetadata": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, + { json: "provider", js: "provider", typ: "" }, + { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, + ], false), + "FindInstancesAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindInstancesAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("PayloadClass") }, + { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, + ], false), + "FindInstancesAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PayloadClass": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindInstancesAgentRequest": o([ + { json: "meta", js: "meta", typ: r("FindInstancesAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesAgentRequestPayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentRequestType") }, + ], false), + "FindInstancesAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "DestinationObject": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "FindInstancesAgentRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + ], false), + "AppIdentifier": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "FindInstancesAgentResponse": o([ + { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, + { json: "payload", js: "payload", typ: r("FindInstancesAgentResponsePayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, + ], false), + "FindInstancesAgentResponsePayload": o([ + { json: "appIdentifiers", js: "appIdentifiers", typ: a(r("AppMetadata")) }, + ], false), + "AppMetadata": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "description", js: "description", typ: u(undefined, "") }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "icons", js: "icons", typ: u(undefined, a(r("Icon"))) }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + { json: "instanceMetadata", js: "instanceMetadata", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "resultType", js: "resultType", typ: u(undefined, u(null, "")) }, + { json: "screenshots", js: "screenshots", typ: u(undefined, a(r("Image"))) }, + { json: "title", js: "title", typ: u(undefined, "") }, + { json: "tooltip", js: "tooltip", typ: u(undefined, "") }, + { json: "version", js: "version", typ: u(undefined, "") }, + ], false), + "Icon": o([ + { json: "size", js: "size", typ: u(undefined, "") }, + { json: "src", js: "src", typ: "" }, + { json: "type", js: "type", typ: u(undefined, "") }, + ], false), + "Image": o([ + { json: "label", js: "label", typ: u(undefined, "") }, + { json: "size", js: "size", typ: u(undefined, "") }, + { json: "src", js: "src", typ: "" }, + { json: "type", js: "type", typ: u(undefined, "") }, + ], false), + "FindInstancesBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindInstancesBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("MessagePayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, + ], false), + "FindInstancesBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "MessagePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindInstancesBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("FindInstancesBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentRequestType") }, + ], false), + "FindInstancesBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "MetaSourceObject": o([ + { json: "appId", js: "appId", typ: u(undefined, "") }, + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "FindInstancesBridgeRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + ], false), + "FindInstancesBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("BridgeResponseMessageMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, + ], false), + "FindInstancesBridgeResponsePayload": o([ + { json: "appIdentifiers", js: "appIdentifiers", typ: a(r("AppMetadata")) }, + ], false), + "FindIntentAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, + ], false), + "FindIntentAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindIntentAgentRequest": o([ + { json: "meta", js: "meta", typ: r("FindIntentAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentAgentRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentRequestType") }, + ], false), + "FindIntentAgentRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + ], false), + "FindIntentAgentRequestPayload": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "intent", js: "intent", typ: "" }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentAgentResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentAgentResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, + ], false), + "FindIntentAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentAgentResponsePayload": o([ + { json: "appIntent", js: "appIntent", typ: r("AppIntent") }, + ], false), + "AppIntent": o([ + { json: "apps", js: "apps", typ: a(r("AppMetadata")) }, + { json: "intent", js: "intent", typ: r("IntentMetadata") }, + ], false), + "IntentMetadata": o([ + { json: "displayName", js: "displayName", typ: u(undefined, "") }, + { json: "name", js: "name", typ: "" }, + ], false), + "FindIntentBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, + ], false), + "FindIntentBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindIntentBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("FindIntentBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentRequestType") }, + ], false), + "FindIntentBridgeRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("BridgeParticipantIdentifier") }, + { json: "timestamp", js: "timestamp", typ: Date }, + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + ], false), + "FindIntentBridgeRequestPayload": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "intent", js: "intent", typ: "" }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, + ], false), + "FindIntentBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentBridgeResponsePayload": o([ + { json: "appIntent", js: "appIntent", typ: r("AppIntent") }, + ], false), + "FindIntentsByContextAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, + ], false), + "FindIntentsByContextAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentsByContextAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindIntentsByContextAgentRequest": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentRequestType") }, + ], false), + "FindIntentsByContextAgentRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + ], false), + "FindIntentsByContextAgentRequestPayload": o([ + { json: "context", js: "context", typ: r("Context") }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentsByContextAgentResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, + ], false), + "FindIntentsByContextAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentsByContextAgentResponsePayload": o([ + { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, + ], false), + "FindIntentsByContextBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, + ], false), + "FindIntentsByContextBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentsByContextBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindIntentsByContextBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentRequestType") }, + ], false), + "FindIntentsByContextBridgeRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + ], false), + "FindIntentsByContextBridgeRequestPayload": o([ + { json: "context", js: "context", typ: r("Context") }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentsByContextBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, + ], false), + "FindIntentsByContextBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentsByContextBridgeResponsePayload": o([ + { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, + ], false), + "GetAppMetadataAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, + ], false), + "GetAppMetadataAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "GetAppMetadataAgentRequest": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataAgentRequestPayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentRequestType") }, + ], false), + "GetAppMetadataAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataAgentRequestPayload": o([ + { json: "app", js: "app", typ: r("AppObject") }, + ], false), + "AppObject": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "GetAppMetadataAgentResponse": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataAgentResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, + ], false), + "GetAppMetadataAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataAgentResponsePayload": o([ + { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, + ], false), + "GetAppMetadataBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, + ], false), + "GetAppMetadataBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "GetAppMetadataBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentRequestType") }, + ], false), + "GetAppMetadataBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataBridgeRequestPayload": o([ + { json: "app", js: "app", typ: r("AppObject") }, + ], false), + "GetAppMetadataBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, + ], false), + "GetAppMetadataBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataBridgeResponsePayload": o([ + { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, + ], false), + "OpenAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("OpenAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, + ], false), + "OpenAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("OpenErrorResponsePayload") }, + ], false), + "OpenAgentRequest": o([ + { json: "meta", js: "meta", typ: r("OpenAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("OpenAgentRequestPayload") }, + { json: "type", js: "type", typ: r("OpenAgentRequestType") }, + ], false), + "OpenAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("SourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenAgentRequestPayload": o([ + { json: "app", js: "app", typ: r("AppToOpen") }, + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + ], false), + "AppToOpen": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "OpenAgentResponse": o([ + { json: "meta", js: "meta", typ: r("OpenAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenAgentResponsePayload") }, + { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, + ], false), + "OpenAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenAgentResponsePayload": o([ + { json: "appIdentifier", js: "appIdentifier", typ: r("AppIdentifier") }, + ], false), + "OpenBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("OpenBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, + ], false), + "OpenBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("OpenErrorResponsePayload") }, + ], false), + "OpenBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("OpenBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("OpenBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("OpenAgentRequestType") }, + ], false), + "OpenBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenBridgeRequestPayload": o([ + { json: "app", js: "app", typ: r("AppToOpen") }, + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + ], false), + "OpenBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("OpenBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, + ], false), + "OpenBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenBridgeResponsePayload": o([ + { json: "appIdentifier", js: "appIdentifier", typ: r("AppIdentifier") }, + ], false), + "PrivateChannelBroadcastAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelBroadcastAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelBroadcastAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelBroadcastAgentRequestType") }, + ], false), + "PrivateChannelBroadcastAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "MetaDestination": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "PrivateChannelBroadcastAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "PrivateChannelBroadcastBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelBroadcastBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelBroadcastBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelBroadcastAgentRequestType") }, + ], false), + "PrivateChannelBroadcastBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelBroadcastBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "PrivateChannelEventListenerAddedAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerAddedAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerAddedAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelEventListenerAddedAgentRequestType") }, + ], false), + "PrivateChannelEventListenerAddedAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelEventListenerAddedAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + ], false), + "PrivateChannelEventListenerAddedBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerAddedBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerAddedBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelEventListenerAddedAgentRequestType") }, + ], false), + "PrivateChannelEventListenerAddedBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelEventListenerAddedBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + ], false), + "PrivateChannelEventListenerRemovedAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerRemovedAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerRemovedAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelEventListenerRemovedAgentRequestType") }, + ], false), + "PrivateChannelEventListenerRemovedAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelEventListenerRemovedAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + ], false), + "PrivateChannelEventListenerRemovedBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerRemovedBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerRemovedBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelEventListenerRemovedAgentRequestType") }, + ], false), + "PrivateChannelEventListenerRemovedBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelEventListenerRemovedBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + ], false), + "PrivateChannelOnAddContextListenerAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnAddContextListenerAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerAgentRequestType") }, + ], false), + "PrivateChannelOnAddContextListenerAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnAddContextListenerAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "PrivateChannelOnAddContextListenerBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnAddContextListenerBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerAgentRequestType") }, + ], false), + "PrivateChannelOnAddContextListenerBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnAddContextListenerBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "PrivateChannelOnDisconnectAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnDisconnectAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectAgentRequestType") }, + ], false), + "PrivateChannelOnDisconnectAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnDisconnectAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "PrivateChannelOnDisconnectBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnDisconnectBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectAgentRequestType") }, + ], false), + "PrivateChannelOnDisconnectBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnDisconnectBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "PrivateChannelOnUnsubscribeAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnUnsubscribeAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeAgentRequestType") }, + ], false), + "PrivateChannelOnUnsubscribeAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnUnsubscribeAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "PrivateChannelOnUnsubscribeBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("ERequestMetadata") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeAgentRequestType") }, + ], false), + "ERequestMetadata": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnUnsubscribeBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "RaiseIntentAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, + ], false), + "RaiseIntentAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "RaiseIntentAgentRequest": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentAgentRequestPayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentRequestType") }, + ], false), + "RaiseIntentAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: r("MetaDestination") }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("SourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentAgentRequestPayload": o([ + { json: "app", js: "app", typ: r("AppDestinationIdentifier") }, + { json: "context", js: "context", typ: r("Context") }, + { json: "intent", js: "intent", typ: "" }, + ], false), + "AppDestinationIdentifier": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "RaiseIntentAgentResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentAgentResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, + ], false), + "RaiseIntentAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentAgentResponsePayload": o([ + { json: "intentResolution", js: "intentResolution", typ: r("IntentResolution") }, + ], false), + "IntentResolution": o([ + { json: "intent", js: "intent", typ: "" }, + { json: "source", js: "source", typ: r("AppIdentifier") }, + ], false), + "RaiseIntentBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, + ], false), + "RaiseIntentBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "RaiseIntentBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentRequestType") }, + ], false), + "RaiseIntentBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: r("MetaDestination") }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentBridgeRequestPayload": o([ + { json: "app", js: "app", typ: r("AppDestinationIdentifier") }, + { json: "context", js: "context", typ: r("Context") }, + { json: "intent", js: "intent", typ: "" }, + ], false), + "RaiseIntentBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, + ], false), + "RaiseIntentBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentBridgeResponsePayload": o([ + { json: "intentResolution", js: "intentResolution", typ: r("IntentResolution") }, + ], false), + "RaiseIntentResultAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentResultAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, + ], false), + "RaiseIntentResultAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentResultAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("RaiseIntentResultErrorMessage") }, + ], false), + "RaiseIntentResultAgentResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentResultAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultAgentResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, + ], false), + "RaiseIntentResultAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentResultAgentResponsePayload": o([ + { json: "intentResult", js: "intentResult", typ: r("IntentResult") }, + ], false), + "IntentResult": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, + ], false), + "Channel": o([ + { json: "displayMetadata", js: "displayMetadata", typ: u(undefined, r("DisplayMetadata")) }, + { json: "id", js: "id", typ: "" }, + { json: "type", js: "type", typ: r("Type") }, + ], false), + "DisplayMetadata": o([ + { json: "color", js: "color", typ: u(undefined, "") }, + { json: "glyph", js: "glyph", typ: u(undefined, "") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], false), + "RaiseIntentResultBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentResultBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, + ], false), + "RaiseIntentResultBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentResultBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("RaiseIntentResultErrorMessage") }, + ], false), + "RaiseIntentResultBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentResultBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, + ], false), + "RaiseIntentResultBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentResultBridgeResponsePayload": o([ + { json: "intentResult", js: "intentResult", typ: r("IntentResult") }, + ], false), + "ResponseErrorDetail": [ + "AccessDenied", + "AgentDisconnected", + "AppNotFound", + "AppTimeout", + "CreationFailed", + "DesktopAgentNotFound", + "ErrorOnLaunch", + "IntentDeliveryFailed", + "IntentHandlerRejected", + "MalformedContext", + "MalformedMessage", + "NoAppsFound", + "NoChannelFound", + "NoResultReturned", + "NotConnectedToBridge", + "ResolverTimeout", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "ResponseMessageType": [ + "findInstancesResponse", + "findIntentResponse", + "findIntentsByContextResponse", + "getAppMetadataResponse", + "openResponse", + "raiseIntentResponse", + "raiseIntentResultResponse", + ], + "RequestMessageType": [ + "broadcastRequest", + "findInstancesRequest", + "findIntentRequest", + "findIntentsByContextRequest", + "getAppMetadataRequest", + "openRequest", + "PrivateChannel.broadcast", + "PrivateChannel.eventListenerAdded", + "PrivateChannel.eventListenerRemoved", + "PrivateChannel.onAddContextListener", + "PrivateChannel.onDisconnect", + "PrivateChannel.onUnsubscribe", + "raiseIntentRequest", + ], + "BroadcastAgentRequestType": [ + "broadcastRequest", + ], + "ConnectionStepMessageType": [ + "authenticationFailed", + "connectedAgentsUpdate", + "handshake", + "hello", + ], + "ConnectionStep2HelloType": [ + "hello", + ], + "ConnectionStep3HandshakeType": [ + "handshake", + ], + "ConnectionStep4AuthenticationFailedType": [ + "authenticationFailed", + ], + "ConnectionStep6ConnectedAgentsUpdateType": [ + "connectedAgentsUpdate", + ], + "FindInstancesErrors": [ + "AgentDisconnected", + "DesktopAgentNotFound", + "IntentDeliveryFailed", + "MalformedContext", + "MalformedMessage", + "NoAppsFound", + "NotConnectedToBridge", + "ResolverTimeout", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "FindInstancesAgentErrorResponseType": [ + "findInstancesResponse", + ], + "FindInstancesAgentRequestType": [ + "findInstancesRequest", + ], + "FindIntentAgentErrorResponseType": [ + "findIntentResponse", + ], + "FindIntentAgentRequestType": [ + "findIntentRequest", + ], + "FindIntentsByContextAgentErrorResponseType": [ + "findIntentsByContextResponse", + ], + "FindIntentsByContextAgentRequestType": [ + "findIntentsByContextRequest", + ], + "GetAppMetadataAgentErrorResponseType": [ + "getAppMetadataResponse", + ], + "GetAppMetadataAgentRequestType": [ + "getAppMetadataRequest", + ], + "OpenErrorResponsePayload": [ + "AgentDisconnected", + "AppNotFound", + "AppTimeout", + "DesktopAgentNotFound", + "ErrorOnLaunch", + "MalformedContext", + "MalformedMessage", + "NotConnectedToBridge", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + ], + "OpenAgentErrorResponseType": [ + "openResponse", + ], + "OpenAgentRequestType": [ + "openRequest", + ], + "PrivateChannelBroadcastAgentRequestType": [ + "PrivateChannel.broadcast", + ], + "PrivateChannelEventListenerTypes": [ + "onAddContextListener", + "onDisconnect", + "onUnsubscribe", + ], + "PrivateChannelEventListenerAddedAgentRequestType": [ + "PrivateChannel.eventListenerAdded", + ], + "PrivateChannelEventListenerRemovedAgentRequestType": [ + "PrivateChannel.eventListenerRemoved", + ], + "PrivateChannelOnAddContextListenerAgentRequestType": [ + "PrivateChannel.onAddContextListener", + ], + "PrivateChannelOnDisconnectAgentRequestType": [ + "PrivateChannel.onDisconnect", + ], + "PrivateChannelOnUnsubscribeAgentRequestType": [ + "PrivateChannel.onUnsubscribe", + ], + "RaiseIntentAgentErrorResponseType": [ + "raiseIntentResponse", + ], + "RaiseIntentAgentRequestType": [ + "raiseIntentRequest", + ], + "RaiseIntentResultErrorMessage": [ + "AgentDisconnected", + "IntentHandlerRejected", + "MalformedMessage", + "NoResultReturned", + "NotConnectedToBridge", + "ResponseToBridgeTimedOut", + ], + "RaiseIntentResultAgentErrorResponseType": [ + "raiseIntentResultResponse", + ], + "Type": [ + "app", + "private", + "user", + ], +}; diff --git a/packages/fdc3-schema/generated/context/ContextTypes.ts b/packages/fdc3-schema/generated/context/ContextTypes.ts new file mode 100644 index 000000000..8fccd9007 --- /dev/null +++ b/packages/fdc3-schema/generated/context/ContextTypes.ts @@ -0,0 +1,2901 @@ +// To parse this data: +// +// import { Convert, Action, Chart, ChatInitSettings, ChatMessage, ChatRoom, ChatSearchCriteria, Contact, ContactList, Context, Country, Currency, Email, Instrument, InstrumentList, Interaction, Message, Nothing, Order, OrderList, Organization, Portfolio, Position, Product, TimeRange, Trade, TradeList, TransactionResult, Valuation } from "./file"; +// +// const action = Convert.toAction(json); +// const chart = Convert.toChart(json); +// const chatInitSettings = Convert.toChatInitSettings(json); +// const chatMessage = Convert.toChatMessage(json); +// const chatRoom = Convert.toChatRoom(json); +// const chatSearchCriteria = Convert.toChatSearchCriteria(json); +// const contact = Convert.toContact(json); +// const contactList = Convert.toContactList(json); +// const context = Convert.toContext(json); +// const country = Convert.toCountry(json); +// const currency = Convert.toCurrency(json); +// const email = Convert.toEmail(json); +// const instrument = Convert.toInstrument(json); +// const instrumentList = Convert.toInstrumentList(json); +// const interaction = Convert.toInteraction(json); +// const message = Convert.toMessage(json); +// const nothing = Convert.toNothing(json); +// const order = Convert.toOrder(json); +// const orderList = Convert.toOrderList(json); +// const organization = Convert.toOrganization(json); +// const portfolio = Convert.toPortfolio(json); +// const position = Convert.toPosition(json); +// const product = Convert.toProduct(json); +// const timeRange = Convert.toTimeRange(json); +// const trade = Convert.toTrade(json); +// const tradeList = Convert.toTradeList(json); +// const transactionResult = Convert.toTransactionResult(json); +// const valuation = Convert.toValuation(json); +// +// These functions will throw an error if the JSON doesn't +// match the expected interface, even if the JSON is valid. + +/** + * 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. + */ +export interface Action { + /** + * An optional target application identifier that should perform the action + */ + app?: AppIdentifier; + /** + * A context object with which the action will be performed + */ + context: ContextElement; + /** + * 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. + */ + intent?: string; + /** + * A human readable display name for the action + */ + title: string; + type: "fdc3.action"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * An optional target application identifier that should perform the action + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + */ +export interface AppIdentifier { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * A context object with which the action will be performed + * + * A context object returned by the transaction, possibly with updated data. + * + * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by + * FDC3 operations. As such, it is not really meant to be used on its own, but is imported + * by more specific type definitions (standardized or custom) to provide the structure and + * properties shared by all FDC3 context data types. + * + * The key element of FDC3 context types is their mandatory `type` property, which is used + * to identify what type of data the object represents, and what shape it has. + * + * The FDC3 context type, and all derived types, define the minimum set of fields a context + * data object of a particular type can be expected to have, but this can always be extended + * with custom fields as appropriate. + */ +export interface ContextElement { + /** + * Context data objects may include a set of equivalent key-value pairs that can be used to + * help applications identify and look up the context type they receive in their own domain. + * The idea behind this design is that applications can provide as many equivalent + * identifiers to a target application as possible, e.g. an instrument may be represented by + * an ISIN, CUSIP or Bloomberg identifier. + * + * Identifiers do not make sense for all types of data, so the `id` property is therefore + * optional, but some derived types may choose to require at least one identifier. + * Identifier values SHOULD always be of type string. + */ + id?: { [key: string]: any }; + /** + * Context data objects may include a name property that can be used for more information, + * or display purposes. Some derived types may require the name object as mandatory, + * depending on use case. + */ + name?: string; + /** + * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 + * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present + * to route shared context data appropriately. + * + * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data + * types they support in an FDC3 [App + * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery + * and routing. + * + * Standardized FDC3 context types have well-known `type` properties prefixed with the + * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and + * used by a particular organization, the convention is to prefix them with an + * organization-specific namespace, e.g. `blackrock.fund`. + * + * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more + * information about context data types. + */ + type: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * 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. + * + * 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. + */ +export interface Chart { + /** + * An array of instrument contexts whose data should be plotted. + */ + instruments: InstrumentElement[]; + /** + * 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. + */ + otherConfig?: ContextElement[]; + /** + * The time range that should be plotted + */ + range?: TimeRangeObject; + /** + * The type of chart that should be plotted + */ + style?: ChartStyle; + type: "fdc3.chart"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * financial instrument that relates to the definition of this product + * + * + * + * A financial instrument from any asset class. + */ +export interface InstrumentElement { + /** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + */ + id: PurpleInstrumentIdentifiers; + /** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ + market?: OrganizationMarket; + type: "fdc3.instrument"; + name?: string; + [property: string]: any; +} + +/** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + */ +export interface PurpleInstrumentIdentifiers { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.cusip.com/ + */ + CUSIP?: string; + /** + * https://www.factset.com/ + */ + FDS_ID?: string; + /** + * https://www.openfigi.com/ + */ + FIGI?: string; + /** + * https://www.isin.org/ + */ + ISIN?: string; + /** + * https://permid.org/ + */ + PERMID?: string; + /** + * https://www.refinitiv.com/ + */ + RIC?: string; + /** + * https://www.lseg.com/sedol + */ + SEDOL?: string; + /** + * Unstandardized stock tickers + */ + ticker?: string; + [property: string]: any; +} + +/** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ +export interface OrganizationMarket { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.iso.org/iso-3166-country-codes.html + */ + COUNTRY_ISOALPHA2?: string; + /** + * https://en.wikipedia.org/wiki/Market_Identifier_Code + */ + MIC?: string; + /** + * Human readable market name + */ + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * The time range that should be plotted + * + * The time range over which the interaction occurred + * + * A context representing a period of time. Any user interfaces that represent or visualize + * events or activity over time can be filtered or focused on a particular time period, + * e.g.: + * + * - A pricing chart + * - A trade blotter + * - A record of client contact/activity in a CRM + * + * Example use cases: + * + * - User may want to view pricing/trades/customer activity for a security over a particular + * time period, the time range might be specified as the context for the `ViewChart` intent + * OR it might be embedded in another context (e.g. a context representing a chart to plot). + * - User filters a visualization (e.g. a pricing chart) to show a particular period, the + * `TimeRange` is broadcast and other visualizations (e.g. a heatmap of activity by + * instrument, or industry sector etc.) receive it and filter themselves to show data over + * the same range. + * + * Notes: + * + * - A `TimeRange` may be closed (i.e. `startTime` and `endTime` are both known) or open + * (i.e. only one of `startTime` or `endTime` is known). + * - Ranges corresponding to dates (e.g. `2022-05-12` to `2022-05-19`) should be specified + * using times as this prevents issues with timezone conversions and inclusive/exclusive + * date ranges. + * - String fields representing times are encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html). + * - A timezone indicator should be specified, e.g. `"2022-05-12T15:18:03Z"` or + * `"2022-05-12T16:18:03+01:00"` + * - Times MAY be specified with millisecond precision, e.g. `"2022-05-12T15:18:03.349Z"` + */ +export interface TimeRangeObject { + /** + * The end time of the range, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. + */ + endTime?: Date; + /** + * The start time of the range, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. + */ + startTime?: Date; + type: "fdc3.timeRange"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * The type of chart that should be plotted + */ +export type ChartStyle = "line" | "bar" | "stacked-bar" | "mountain" | "candle" | "pie" | "scatter" | "histogram" | "heatmap" | "custom"; + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A collection of settings to start a new chat conversation + */ +export interface ChatInitSettings { + /** + * Name to apply to the chat created + */ + chatName?: string; + /** + * Contacts to add to the chat + */ + members?: ContactListObject; + /** + * An initial message to post in the chat when created. + */ + message?: MessageObject | string; + /** + * Option settings that affect the creation of the chat + */ + options?: ChatOptions; + type: "fdc3.chat.initSettings"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Contacts to add to the chat + * + * A list of contacts involved in the interaction + * + * A collection of contacts, e.g. for chatting to or calling multiple contacts. + * + * The contact list schema does not explicitly include identifiers in the `id` section, as + * there is not a common standard for such identifiers. Applications can, however, populate + * this part of the contract with custom identifiers if so desired. + */ +export interface ContactListObject { + /** + * An array of contact contexts that forms the list. + */ + contacts: ContactElement[]; + type: "fdc3.contactList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * The contact that initiated the interaction + * + * A person contact that can be engaged with through email, calling, messaging, CMS, etc. + */ +export interface ContactElement { + /** + * Identifiers that relate to the Contact represented by this context + */ + id: PurpleContactIdentifiers; + type: "fdc3.contact"; + name?: string; + [property: string]: any; +} + +/** + * Identifiers that relate to the Contact represented by this context + */ +export interface PurpleContactIdentifiers { + /** + * The email address for the contact + */ + email?: string; + /** + * FactSet Permanent Identifier representing the contact + */ + FDS_ID?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A chat message to be sent through an instant messaging application. Can contain one or + * several text bodies (organized by mime-type, plaintext or markdown), as well as attached + * entities (either arbitrary file attachments or FDC3 actions to be embedded in the + * message). To be put inside a ChatInitSettings object. + */ +export interface MessageObject { + /** + * A map of string IDs to entities that should be attached to the message, such as an action + * to perform, a file attachment, or other FDC3 context object. + */ + entities?: { [key: string]: PurpleAction }; + /** + * A map of string mime-type to string content + */ + text?: PurpleMessageText; + type: "fdc3.message"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * 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. + * + * A File attachment encoded in the form of a data URI + */ +export interface PurpleAction { + /** + * An optional target application identifier that should perform the action + */ + app?: AppIdentifier; + /** + * A context object with which the action will be performed + */ + context?: ContextElement; + /** + * 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. + */ + intent?: string; + /** + * A human readable display name for the action + */ + title?: string; + type: EntityType; + id?: { [key: string]: any }; + name?: string; + data?: PurpleData; + [property: string]: any; +} + +export interface PurpleData { + /** + * A data URI encoding the content of the file to be attached + */ + dataUri: string; + /** + * The name of the attached file + */ + name: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ +export type EntityType = "fdc3.action" | "fdc3.entity.fileAttachment"; + +/** + * A map of string mime-type to string content + */ +export interface PurpleMessageText { + /** + * Markdown encoded content + */ + "text/markdown"?: string; + /** + * Plain text encoded content. + */ + "text/plain"?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Option settings that affect the creation of the chat + */ +export interface ChatOptions { + /** + * if true members will be allowed to add other members to the chat + */ + allowAddUser?: boolean; + /** + * if true members will be allowed to browse past messages + */ + allowHistoryBrowsing?: boolean; + /** + * if true members will be allowed to copy/paste messages + */ + allowMessageCopy?: boolean; + /** + * if false a separate chat will be created for each member + */ + groupRecipients?: boolean; + /** + * if true the room will be visible to everyone in the chat application + */ + isPublic?: boolean; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A context representing a chat message. Typically used to send the message or to + * pre-populate a message for sending. + */ +export interface ChatMessage { + chatRoom: ChatRoomObject; + message: MessageObject; + type: "fdc3.chat.message"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Reference to the chat room which could be used to send a message to the room + */ +export interface ChatRoomObject { + /** + * Identifier(s) for the chat - currently unstandardized + */ + id: { [key: string]: any }; + /** + * Display name for the chat room + */ + name?: string; + /** + * The name of the service that hosts the chat + */ + providerName: string; + type: "fdc3.chat.room"; + /** + * Universal url to access to the room. It could be opened from a browser, a mobile app, + * etc... + */ + url?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Reference to the chat room which could be used to send a message to the room + */ +export interface ChatRoom { + /** + * Identifier(s) for the chat - currently unstandardized + */ + id: { [key: string]: any }; + /** + * Display name for the chat room + */ + name?: string; + /** + * The name of the service that hosts the chat + */ + providerName: string; + type: "fdc3.chat.room"; + /** + * Universal url to access to the room. It could be opened from a browser, a mobile app, + * etc... + */ + url?: string; + [property: string]: any; +} + +/** + * A context type that represents a simple search criterion, based on a list of other + * context objects, that can be used to search or filter messages in a chat application. + */ +export interface ChatSearchCriteria { + /** + * An array of criteria that should match chats returned from by a search. + * + * ⚠️ Operators (and/or/not) are not defined in `fdc3.chat.searchCriteria`. It is up to the + * application that processes the FDC3 Intent to choose and apply the operators between the + * criteria. + * + * Empty search criteria can be supported to allow resetting of filters. + */ + criteria: Array; + type: "fdc3.chat.searchCriteria"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * financial instrument that relates to the definition of this product + * + * + * + * A financial instrument from any asset class. + * + * An entity that can be used when referencing private companies and other organizations + * where a specific instrument is not available or desired e.g. CRM and News workflows. + * + * It is valid to include extra properties and metadata as part of the organization payload, + * but the minimum requirement is for at least one specified identifier to be provided. + * + * The contact that initiated the interaction + * + * A person contact that can be engaged with through email, calling, messaging, CMS, etc. + */ +export interface OrganizationObject { + /** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + * + * Identifiers for the organization, at least one must be provided. + * + * Identifiers that relate to the Contact represented by this context + */ + id: Identifiers; + /** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ + market?: OrganizationMarket; + type: TentacledInteractionType; + name?: string; + [property: string]: any; +} + +/** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + * + * Identifiers for the organization, at least one must be provided. + * + * Identifiers that relate to the Contact represented by this context + */ +export interface Identifiers { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.cusip.com/ + */ + CUSIP?: string; + /** + * https://www.factset.com/ + * + * FactSet Permanent Identifier representing the organization + * + * FactSet Permanent Identifier representing the contact + */ + FDS_ID?: string; + /** + * https://www.openfigi.com/ + */ + FIGI?: string; + /** + * https://www.isin.org/ + */ + ISIN?: string; + /** + * https://permid.org/ + * + * Refinitiv Permanent Identifiers, or PermID for the organization + */ + PERMID?: string; + /** + * https://www.refinitiv.com/ + */ + RIC?: string; + /** + * https://www.lseg.com/sedol + */ + SEDOL?: string; + /** + * Unstandardized stock tickers + */ + ticker?: string; + /** + * The Legal Entity Identifier (LEI) is a 20-character, alpha-numeric code based on the ISO + * 17442 standard developed by the International Organization for Standardization (ISO). It + * connects to key reference information that enables clear and unique identification of + * legal entities participating in financial transactions. + */ + LEI?: string; + /** + * The email address for the contact + */ + email?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ +export type TentacledInteractionType = "fdc3.instrument" | "fdc3.organization" | "fdc3.contact"; + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A person contact that can be engaged with through email, calling, messaging, CMS, etc. + */ +export interface Contact { + /** + * Identifiers that relate to the Contact represented by this context + */ + id: FluffyContactIdentifiers; + type: "fdc3.contact"; + name?: string; + [property: string]: any; +} + +/** + * Identifiers that relate to the Contact represented by this context + */ +export interface FluffyContactIdentifiers { + /** + * The email address for the contact + */ + email?: string; + /** + * FactSet Permanent Identifier representing the contact + */ + FDS_ID?: string; + [property: string]: any; +} + +/** + * A collection of contacts, e.g. for chatting to or calling multiple contacts. + * + * The contact list schema does not explicitly include identifiers in the `id` section, as + * there is not a common standard for such identifiers. Applications can, however, populate + * this part of the contract with custom identifiers if so desired. + */ +export interface ContactList { + /** + * An array of contact contexts that forms the list. + */ + contacts: ContactElement[]; + type: "fdc3.contactList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by + * FDC3 operations. As such, it is not really meant to be used on its own, but is imported + * by more specific type definitions (standardized or custom) to provide the structure and + * properties shared by all FDC3 context data types. + * + * The key element of FDC3 context types is their mandatory `type` property, which is used + * to identify what type of data the object represents, and what shape it has. + * + * The FDC3 context type, and all derived types, define the minimum set of fields a context + * data object of a particular type can be expected to have, but this can always be extended + * with custom fields as appropriate. + */ +export interface Context { + /** + * Context data objects may include a set of equivalent key-value pairs that can be used to + * help applications identify and look up the context type they receive in their own domain. + * The idea behind this design is that applications can provide as many equivalent + * identifiers to a target application as possible, e.g. an instrument may be represented by + * an ISIN, CUSIP or Bloomberg identifier. + * + * Identifiers do not make sense for all types of data, so the `id` property is therefore + * optional, but some derived types may choose to require at least one identifier. + * Identifier values SHOULD always be of type string. + */ + id?: { [key: string]: any }; + /** + * Context data objects may include a name property that can be used for more information, + * or display purposes. Some derived types may require the name object as mandatory, + * depending on use case. + */ + name?: string; + /** + * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 + * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present + * to route shared context data appropriately. + * + * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data + * types they support in an FDC3 [App + * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery + * and routing. + * + * Standardized FDC3 context types have well-known `type` properties prefixed with the + * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and + * used by a particular organization, the convention is to prefix them with an + * organization-specific namespace, e.g. `blackrock.fund`. + * + * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more + * information about context data types. + */ + type: string; + [property: string]: any; +} + +/** + * A country entity. + * + * Notes: + * + * - It is valid to include extra properties and metadata as part of the country payload, + * but the minimum requirement is for at least one standardized identifier to be provided + * + * - `COUNTRY_ISOALPHA2` SHOULD be preferred. + * + * - Try to only use country identifiers as intended and specified in the [ISO + * standard](https://en.wikipedia.org/wiki/ISO_3166-1). E.g. the `COUNTRY_ISOALPHA2` + * property must be a recognized value and not a proprietary two-letter code. If the + * identifier you want to share is not a standardized and recognized one, rather define a + * property that makes it clear what value it is. This makes it easier for target + * applications. + */ +export interface Country { + id: CountryID; + type: "fdc3.country"; + name?: string; + [property: string]: any; +} + +export interface CountryID { + /** + * Two-letter ISO country code + */ + COUNTRY_ISOALPHA2?: string; + /** + * Three-letter ISO country code + */ + COUNTRY_ISOALPHA3?: string; + /** + * Two-letter ISO country code. Deprecated in FDC3 2.0 in favour of the version prefixed + * with `COUNTRY_`. + */ + ISOALPHA2?: string; + /** + * Three-letter ISO country code. Deprecated in FDC3 2.0 in favour of the version prefixed + * with `COUNTRY_`. + */ + ISOALPHA3?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A context representing an individual Currency. + */ +export interface Currency { + id: CurrencyID; + /** + * The name of the currency for display purposes + */ + name?: string; + type: "fdc3.currency"; + [property: string]: any; +} + +export interface CurrencyID { + /** + * The `CURRENCY_ISOCODE` should conform to 3 character alphabetic codes defined in [ISO + * 4217](https://www.iso.org/iso-4217-currency-codes.html) + */ + CURRENCY_ISOCODE?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A collection of information to be used to initiate an email with a Contact or ContactList. + */ +export interface Email { + /** + * One or more recipients for the email. + */ + recipients: EmailRecipients; + /** + * Subject line for the email. + */ + subject?: string; + /** + * Body content for the email. + */ + textBody?: string; + type: "fdc3.email"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * One or more recipients for the email. + * + * The contact that initiated the interaction + * + * A person contact that can be engaged with through email, calling, messaging, CMS, etc. + * + * Contacts to add to the chat + * + * A list of contacts involved in the interaction + * + * A collection of contacts, e.g. for chatting to or calling multiple contacts. + * + * The contact list schema does not explicitly include identifiers in the `id` section, as + * there is not a common standard for such identifiers. Applications can, however, populate + * this part of the contract with custom identifiers if so desired. + */ +export interface EmailRecipients { + /** + * Identifiers that relate to the Contact represented by this context + */ + id?: EmailRecipientsID; + type: EmailRecipientsType; + name?: string; + /** + * An array of contact contexts that forms the list. + */ + contacts?: ContactElement[]; + [property: string]: any; +} + +/** + * Identifiers that relate to the Contact represented by this context + */ +export interface EmailRecipientsID { + /** + * The email address for the contact + */ + email?: string; + /** + * FactSet Permanent Identifier representing the contact + */ + FDS_ID?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ +export type EmailRecipientsType = "fdc3.contact" | "fdc3.contactList"; + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A financial instrument from any asset class. + */ +export interface Instrument { + /** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + */ + id: FluffyInstrumentIdentifiers; + /** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ + market?: PurpleMarket; + type: "fdc3.instrument"; + name?: string; + [property: string]: any; +} + +/** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + */ +export interface FluffyInstrumentIdentifiers { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.cusip.com/ + */ + CUSIP?: string; + /** + * https://www.factset.com/ + */ + FDS_ID?: string; + /** + * https://www.openfigi.com/ + */ + FIGI?: string; + /** + * https://www.isin.org/ + */ + ISIN?: string; + /** + * https://permid.org/ + */ + PERMID?: string; + /** + * https://www.refinitiv.com/ + */ + RIC?: string; + /** + * https://www.lseg.com/sedol + */ + SEDOL?: string; + /** + * Unstandardized stock tickers + */ + ticker?: string; + [property: string]: any; +} + +/** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ +export interface PurpleMarket { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.iso.org/iso-3166-country-codes.html + */ + COUNTRY_ISOALPHA2?: string; + /** + * https://en.wikipedia.org/wiki/Market_Identifier_Code + */ + MIC?: string; + /** + * Human readable market name + */ + name?: string; + [property: string]: any; +} + +/** + * A collection of instruments. Use this type for use cases that require not just a single + * instrument, but multiple (e.g. to populate a watchlist). However, when holding + * information for each instrument is required, it is recommended to use the + * [Portfolio](Portfolio) type. + * + * The instrument list schema does not explicitly include identifiers in the `id` section, + * as there is not a common standard for such identifiers. Applications can, however, + * populate this part of the contract with custom identifiers if so desired. + */ +export interface InstrumentList { + /** + * An array of instrument contexts that forms the list. + */ + instruments: InstrumentElement[]; + type: "fdc3.instrumentList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * An `Interaction` is a significant direct exchange of ideas or information between a + * number of participants, e.g. a Sell Side party and one or more Buy Side parties. An + * `Interaction` might be a call, a meeting (physical or virtual), an IM or the preparation + * of some specialist data, such as financial data for a given company or sector. + */ +export interface Interaction { + /** + * A human-readable description of the interaction + */ + description: string; + /** + * Can be used by a target application to pass an identifier back to the originating + * application after an interaction record has been created, updated or deleted. An + * interaction ID does not need to be populated by the originating application, however the + * target application could store it for future reference and SHOULD return it in a + * `TransactionResult`. + */ + id?: InteractionID; + /** + * The contact that initiated the interaction + */ + initiator?: ContactElement; + /** + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + interactionType: string; + /** + * Used to represent the application or service that the interaction was created from to aid + * in tracing the source of an interaction. + */ + origin?: string; + /** + * A list of contacts involved in the interaction + */ + participants: ContactListObject; + /** + * The time range over which the interaction occurred + */ + timeRange: TimeRangeObject; + type: "fdc3.interaction"; + name?: string; + [property: string]: any; +} + +/** + * Can be used by a target application to pass an identifier back to the originating + * application after an interaction record has been created, updated or deleted. An + * interaction ID does not need to be populated by the originating application, however the + * target application could store it for future reference and SHOULD return it in a + * `TransactionResult`. + */ +export interface InteractionID { + /** + * Interactions ID in Salesforce + */ + SALESFORCE?: string; + /** + * Interaction ID in SingleTrack + */ + SINGLETRACK?: string; + /** + * Can be used by a target application to pass a record's link back to the originating + * application. This offers the originating application a way to open the record for a user + * to view. + */ + URI?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A chat message to be sent through an instant messaging application. Can contain one or + * several text bodies (organized by mime-type, plaintext or markdown), as well as attached + * entities (either arbitrary file attachments or FDC3 actions to be embedded in the + * message). To be put inside a ChatInitSettings object. + */ +export interface Message { + /** + * A map of string IDs to entities that should be attached to the message, such as an action + * to perform, a file attachment, or other FDC3 context object. + */ + entities?: { [key: string]: FluffyAction }; + /** + * A map of string mime-type to string content + */ + text?: FluffyMessageText; + type: "fdc3.message"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * 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. + * + * A File attachment encoded in the form of a data URI + */ +export interface FluffyAction { + /** + * An optional target application identifier that should perform the action + */ + app?: AppIdentifier; + /** + * A context object with which the action will be performed + */ + context?: ContextElement; + /** + * 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. + */ + intent?: string; + /** + * A human readable display name for the action + */ + title?: string; + type: EntityType; + id?: { [key: string]: any }; + name?: string; + data?: FluffyData; + [property: string]: any; +} + +export interface FluffyData { + /** + * A data URI encoding the content of the file to be attached + */ + dataUri: string; + /** + * The name of the attached file + */ + name: string; + [property: string]: any; +} + +/** + * A map of string mime-type to string content + */ +export interface FluffyMessageText { + /** + * Markdown encoded content + */ + "text/markdown"?: string; + /** + * Plain text encoded content. + */ + "text/plain"?: string; + [property: string]: any; +} + +/** + * A type that explicitly represents a lack of context. + * + * Notes: + * + * - Intended to be used in situations where no context is desired. + * - For example: + * - Raising an intent without context (e.g. opening a blank order form, or chat interface + * without a contact selected). + * - Resetting context on a channel (e.g. when context is used to set a filter in other + * applications a null context might release the filter). + * - An explicit representation of a Null or empty context allows apps to declare support + * for a lack of context, for example in their intent metadata in an app directory. + */ +export interface Nothing { + type: "fdc3.nothing"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * @experimental context type representing an order. To be used with OMS and EMS systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the order in one or more systems, an optional human readable `name` field to be used + * to summarize the order and an optional `details` field that may be used to provide + * additional detail about the order, including a context representing a `product`, which + * may be extended with arbitrary properties. The `details.product` field is currently typed + * as a unspecified Context type, but both `details` and `details.product` are expected to + * be standardized in future. + */ +export interface Order { + /** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ + details?: PurpleOrderDetails; + /** + * One or more identifiers that refer to the order in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * An optional human-readable summary of the order. + */ + name?: string; + type: "fdc3.order"; + [property: string]: any; +} + +/** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ +export interface PurpleOrderDetails { + product?: ProductObject; + [property: string]: any; +} + +/** + * A product that is the subject of the trade. + * + * @experimental context type representing a tradable product. To be used with OMS and EMS + * systems. + * + * This type is currently only loosely defined as an extensible context object, with an + * optional instrument field. + * + * The Product schema does not explicitly include identifiers in the id section, as there is + * not a common standard for such identifiers. Applications can, however, populate this part + * of the contract with custom identifiers if so desired. + */ +export interface ProductObject { + /** + * One or more identifiers that refer to the product. Specific key names for systems are + * expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * financial instrument that relates to the definition of this product + */ + instrument?: InstrumentElement; + /** + * A human-readable summary of the product. + */ + name?: string; + type: "fdc3.product"; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * @experimental A list of orders. Use this type for use cases that require not just a + * single order, but multiple. + * + * The OrderList schema does not explicitly include identifiers in the id section, as there + * is not a common standard for such identifiers. Applications can, however, populate this + * part of the contract with custom identifiers if so desired. + */ +export interface OrderList { + /** + * An array of order contexts that forms the list. + */ + orders: OrderElement[]; + type: "fdc3.orderList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing an order. To be used with OMS and EMS systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the order in one or more systems, an optional human readable `name` field to be used + * to summarize the order and an optional `details` field that may be used to provide + * additional detail about the order, including a context representing a `product`, which + * may be extended with arbitrary properties. The `details.product` field is currently typed + * as a unspecified Context type, but both `details` and `details.product` are expected to + * be standardized in future. + */ +export interface OrderElement { + /** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ + details?: FluffyOrderDetails; + /** + * One or more identifiers that refer to the order in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * An optional human-readable summary of the order. + */ + name?: string; + type: "fdc3.order"; + [property: string]: any; +} + +/** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ +export interface FluffyOrderDetails { + product?: ProductObject; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * An entity that can be used when referencing private companies and other organizations + * where a specific instrument is not available or desired e.g. CRM and News workflows. + * + * It is valid to include extra properties and metadata as part of the organization payload, + * but the minimum requirement is for at least one specified identifier to be provided. + */ +export interface Organization { + /** + * Identifiers for the organization, at least one must be provided. + */ + id: OrganizationIdentifiers; + type: "fdc3.organization"; + name?: string; + [property: string]: any; +} + +/** + * Identifiers for the organization, at least one must be provided. + */ +export interface OrganizationIdentifiers { + /** + * FactSet Permanent Identifier representing the organization + */ + FDS_ID?: string; + /** + * The Legal Entity Identifier (LEI) is a 20-character, alpha-numeric code based on the ISO + * 17442 standard developed by the International Organization for Standardization (ISO). It + * connects to key reference information that enables clear and unique identification of + * legal entities participating in financial transactions. + */ + LEI?: string; + /** + * Refinitiv Permanent Identifiers, or PermID for the organization + */ + PERMID?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A financial portfolio made up of multiple positions (holdings) in several instruments. + * Contrast this with e.g. the [InstrumentList](InstrumentList) type, which is just a list + * of instruments. + * + * This is a good example of how types can be composed and extended with extra properties to + * define more complex types. + * + * The Portfolio type consists of an array of [Position](Position) types, each of which + * refers to a single [Instrument](Instrument) and a holding amount for that instrument. + * + * The portfolio schema does not explicitly include identifiers in the `id` section, as + * there bis not a common standard for such identifiers. Applications can, however, populate + * this part of the contract with custom identifiers if so desired. + */ +export interface Portfolio { + /** + * The List of Positions which make up the Portfolio + */ + positions: PositionElement[]; + type: "fdc3.portfolio"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * A financial position made up of an instrument and a holding in that instrument. This type + * is a good example of how new context types can be composed from existing types. + * + * In this case, the instrument and the holding amount for that instrument are required + * values. + * + * The [Position](Position) type goes hand-in-hand with the [Portfolio](Portfolio) type, + * which represents multiple holdings in a combination of instruments. + * + * The position schema does not explicitly include identifiers in the `id` section, as there + * is not a common standard for such identifiers. Applications can, however, populate this + * part of the contract with custom identifiers if so desired. + */ +export interface PositionElement { + /** + * The amount of the holding, e.g. a number of shares + */ + holding: number; + instrument: InstrumentElement; + type: "fdc3.position"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A financial position made up of an instrument and a holding in that instrument. This type + * is a good example of how new context types can be composed from existing types. + * + * In this case, the instrument and the holding amount for that instrument are required + * values. + * + * The [Position](Position) type goes hand-in-hand with the [Portfolio](Portfolio) type, + * which represents multiple holdings in a combination of instruments. + * + * The position schema does not explicitly include identifiers in the `id` section, as there + * is not a common standard for such identifiers. Applications can, however, populate this + * part of the contract with custom identifiers if so desired. + */ +export interface Position { + /** + * The amount of the holding, e.g. a number of shares + */ + holding: number; + instrument: InstrumentElement; + type: "fdc3.position"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing a tradable product. To be used with OMS and EMS + * systems. + * + * This type is currently only loosely defined as an extensible context object, with an + * optional instrument field. + * + * The Product schema does not explicitly include identifiers in the id section, as there is + * not a common standard for such identifiers. Applications can, however, populate this part + * of the contract with custom identifiers if so desired. + */ +export interface Product { + /** + * One or more identifiers that refer to the product. Specific key names for systems are + * expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * financial instrument that relates to the definition of this product + */ + instrument?: InstrumentElement; + /** + * A human-readable summary of the product. + */ + name?: string; + type: "fdc3.product"; + [property: string]: any; +} + +/** + * A context representing a period of time. Any user interfaces that represent or visualize + * events or activity over time can be filtered or focused on a particular time period, + * e.g.: + * + * - A pricing chart + * - A trade blotter + * - A record of client contact/activity in a CRM + * + * Example use cases: + * + * - User may want to view pricing/trades/customer activity for a security over a particular + * time period, the time range might be specified as the context for the `ViewChart` intent + * OR it might be embedded in another context (e.g. a context representing a chart to plot). + * - User filters a visualization (e.g. a pricing chart) to show a particular period, the + * `TimeRange` is broadcast and other visualizations (e.g. a heatmap of activity by + * instrument, or industry sector etc.) receive it and filter themselves to show data over + * the same range. + * + * Notes: + * + * - A `TimeRange` may be closed (i.e. `startTime` and `endTime` are both known) or open + * (i.e. only one of `startTime` or `endTime` is known). + * - Ranges corresponding to dates (e.g. `2022-05-12` to `2022-05-19`) should be specified + * using times as this prevents issues with timezone conversions and inclusive/exclusive + * date ranges. + * - String fields representing times are encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html). + * - A timezone indicator should be specified, e.g. `"2022-05-12T15:18:03Z"` or + * `"2022-05-12T16:18:03+01:00"` + * - Times MAY be specified with millisecond precision, e.g. `"2022-05-12T15:18:03.349Z"` + */ +export interface TimeRange { + /** + * The end time of the range, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. + */ + endTime?: Date; + /** + * The start time of the range, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. + */ + startTime?: Date; + type: "fdc3.timeRange"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing a trade. To be used with execution systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the trade in one or more systems, an optional human readable `name` field to be used + * to summarize the trade and a required `product` field that may be used to provide + * additional detail about the trade, which is currently typed as a unspecified Context + * type, but `product` is expected to be standardized in future. + * + * The Trade schema does not explicitly include identifiers in the id section, as there is + * not a common standard for such identifiers. Applications can, however, populate this part + * of the contract with custom identifiers if so desired. + */ +export interface Trade { + /** + * One or more identifiers that refer to the trade in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * A human-readable summary of the trade. + */ + name?: string; + /** + * A product that is the subject of the trade. + */ + product: ProductObject; + type: "fdc3.trade"; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * @experimental A list of trades. Use this type for use cases that require not just a + * single trade, but multiple. + * + * The TradeList schema does not explicitly include identifiers in the id section, as there + * is not a common standard for such identifiers. Applications can, however, populate this + * part of the contract with custom identifiers if so desired. + */ +export interface TradeList { + /** + * An array of trade contexts that forms the list. + */ + trades: TradeElement[]; + type: "fdc3.tradeList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing a trade. To be used with execution systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the trade in one or more systems, an optional human readable `name` field to be used + * to summarize the trade and a required `product` field that may be used to provide + * additional detail about the trade, which is currently typed as a unspecified Context + * type, but `product` is expected to be standardized in future. + * + * The Trade schema does not explicitly include identifiers in the id section, as there is + * not a common standard for such identifiers. Applications can, however, populate this part + * of the contract with custom identifiers if so desired. + */ +export interface TradeElement { + /** + * One or more identifiers that refer to the trade in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * A human-readable summary of the trade. + */ + name?: string; + /** + * A product that is the subject of the trade. + */ + product: ProductObject; + type: "fdc3.trade"; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A context type representing the result of a transaction initiated via FDC3, which SHOULD + * be returned as an `IntentResult` by intents that create, retrieve, update or delete + * content or records in another application. Its purpose is to provide a status and message + * (where needed) for the transaction and MAY wrap a returned context object. + */ +export interface TransactionResult { + /** + * A context object returned by the transaction, possibly with updated data. + */ + context?: ContextElement; + /** + * A human readable message describing the outcome of the transaction. + */ + message?: string; + /** + * The status of the transaction being reported. + */ + status: TransactionStatus; + type: "fdc3.transactionResult"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * The status of the transaction being reported. + */ +export type TransactionStatus = "Created" | "Deleted" | "Updated" | "Failed"; + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A context type representing the price and value of a holding. + */ +export interface Valuation { + /** + * The valuation currency, which should conform to 3 character alphabetic codes defined in + * [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) + */ + CURRENCY_ISOCODE: string; + /** + * The time at which this valuation expires, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator included. + */ + expiryTime?: Date; + /** + * The price per unit the the valuation is based on. + */ + price?: number; + type: "fdc3.valuation"; + /** + * The time at which the valuation was performed, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator included. + */ + valuationTime?: Date; + /** + * The value of the holding, expresses in the nominated currency. + */ + value: number; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +// Converts JSON strings to/from your types +// and asserts the results of JSON.parse at runtime +export class Convert { + public static toAction(json: string): Action { + return cast(JSON.parse(json), r("Action")); + } + + public static actionToJson(value: Action): string { + return JSON.stringify(uncast(value, r("Action")), null, 2); + } + + public static toChart(json: string): Chart { + return cast(JSON.parse(json), r("Chart")); + } + + public static chartToJson(value: Chart): string { + return JSON.stringify(uncast(value, r("Chart")), null, 2); + } + + public static toChatInitSettings(json: string): ChatInitSettings { + return cast(JSON.parse(json), r("ChatInitSettings")); + } + + public static chatInitSettingsToJson(value: ChatInitSettings): string { + return JSON.stringify(uncast(value, r("ChatInitSettings")), null, 2); + } + + public static toChatMessage(json: string): ChatMessage { + return cast(JSON.parse(json), r("ChatMessage")); + } + + public static chatMessageToJson(value: ChatMessage): string { + return JSON.stringify(uncast(value, r("ChatMessage")), null, 2); + } + + public static toChatRoom(json: string): ChatRoom { + return cast(JSON.parse(json), r("ChatRoom")); + } + + public static chatRoomToJson(value: ChatRoom): string { + return JSON.stringify(uncast(value, r("ChatRoom")), null, 2); + } + + public static toChatSearchCriteria(json: string): ChatSearchCriteria { + return cast(JSON.parse(json), r("ChatSearchCriteria")); + } + + public static chatSearchCriteriaToJson(value: ChatSearchCriteria): string { + return JSON.stringify(uncast(value, r("ChatSearchCriteria")), null, 2); + } + + public static toContact(json: string): Contact { + return cast(JSON.parse(json), r("Contact")); + } + + public static contactToJson(value: Contact): string { + return JSON.stringify(uncast(value, r("Contact")), null, 2); + } + + public static toContactList(json: string): ContactList { + return cast(JSON.parse(json), r("ContactList")); + } + + public static contactListToJson(value: ContactList): string { + return JSON.stringify(uncast(value, r("ContactList")), null, 2); + } + + public static toContext(json: string): Context { + return cast(JSON.parse(json), r("Context")); + } + + public static contextToJson(value: Context): string { + return JSON.stringify(uncast(value, r("Context")), null, 2); + } + + public static toCountry(json: string): Country { + return cast(JSON.parse(json), r("Country")); + } + + public static countryToJson(value: Country): string { + return JSON.stringify(uncast(value, r("Country")), null, 2); + } + + public static toCurrency(json: string): Currency { + return cast(JSON.parse(json), r("Currency")); + } + + public static currencyToJson(value: Currency): string { + return JSON.stringify(uncast(value, r("Currency")), null, 2); + } + + public static toEmail(json: string): Email { + return cast(JSON.parse(json), r("Email")); + } + + public static emailToJson(value: Email): string { + return JSON.stringify(uncast(value, r("Email")), null, 2); + } + + public static toInstrument(json: string): Instrument { + return cast(JSON.parse(json), r("Instrument")); + } + + public static instrumentToJson(value: Instrument): string { + return JSON.stringify(uncast(value, r("Instrument")), null, 2); + } + + public static toInstrumentList(json: string): InstrumentList { + return cast(JSON.parse(json), r("InstrumentList")); + } + + public static instrumentListToJson(value: InstrumentList): string { + return JSON.stringify(uncast(value, r("InstrumentList")), null, 2); + } + + public static toInteraction(json: string): Interaction { + return cast(JSON.parse(json), r("Interaction")); + } + + public static interactionToJson(value: Interaction): string { + return JSON.stringify(uncast(value, r("Interaction")), null, 2); + } + + public static toMessage(json: string): Message { + return cast(JSON.parse(json), r("Message")); + } + + public static messageToJson(value: Message): string { + return JSON.stringify(uncast(value, r("Message")), null, 2); + } + + public static toNothing(json: string): Nothing { + return cast(JSON.parse(json), r("Nothing")); + } + + public static nothingToJson(value: Nothing): string { + return JSON.stringify(uncast(value, r("Nothing")), null, 2); + } + + public static toOrder(json: string): Order { + return cast(JSON.parse(json), r("Order")); + } + + public static orderToJson(value: Order): string { + return JSON.stringify(uncast(value, r("Order")), null, 2); + } + + public static toOrderList(json: string): OrderList { + return cast(JSON.parse(json), r("OrderList")); + } + + public static orderListToJson(value: OrderList): string { + return JSON.stringify(uncast(value, r("OrderList")), null, 2); + } + + public static toOrganization(json: string): Organization { + return cast(JSON.parse(json), r("Organization")); + } + + public static organizationToJson(value: Organization): string { + return JSON.stringify(uncast(value, r("Organization")), null, 2); + } + + public static toPortfolio(json: string): Portfolio { + return cast(JSON.parse(json), r("Portfolio")); + } + + public static portfolioToJson(value: Portfolio): string { + return JSON.stringify(uncast(value, r("Portfolio")), null, 2); + } + + public static toPosition(json: string): Position { + return cast(JSON.parse(json), r("Position")); + } + + public static positionToJson(value: Position): string { + return JSON.stringify(uncast(value, r("Position")), null, 2); + } + + public static toProduct(json: string): Product { + return cast(JSON.parse(json), r("Product")); + } + + public static productToJson(value: Product): string { + return JSON.stringify(uncast(value, r("Product")), null, 2); + } + + public static toTimeRange(json: string): TimeRange { + return cast(JSON.parse(json), r("TimeRange")); + } + + public static timeRangeToJson(value: TimeRange): string { + return JSON.stringify(uncast(value, r("TimeRange")), null, 2); + } + + public static toTrade(json: string): Trade { + return cast(JSON.parse(json), r("Trade")); + } + + public static tradeToJson(value: Trade): string { + return JSON.stringify(uncast(value, r("Trade")), null, 2); + } + + public static toTradeList(json: string): TradeList { + return cast(JSON.parse(json), r("TradeList")); + } + + public static tradeListToJson(value: TradeList): string { + return JSON.stringify(uncast(value, r("TradeList")), null, 2); + } + + public static toTransactionResult(json: string): TransactionResult { + return cast(JSON.parse(json), r("TransactionResult")); + } + + public static transactionResultToJson(value: TransactionResult): string { + return JSON.stringify(uncast(value, r("TransactionResult")), null, 2); + } + + public static toValuation(json: string): Valuation { + return cast(JSON.parse(json), r("Valuation")); + } + + public static valuationToJson(value: Valuation): string { + return JSON.stringify(uncast(value, r("Valuation")), null, 2); + } +} + +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { + const prettyTyp = prettyTypeName(typ); + const parentText = parent ? ` on ${parent}` : ''; + const keyText = key ? ` for key "${key}"` : ''; + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); +} + +function prettyTypeName(typ: any): string { + if (Array.isArray(typ)) { + if (typ.length === 2 && typ[0] === undefined) { + return `an optional ${prettyTypeName(typ[1])}`; + } else { + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; + } + } else if (typeof typ === "object" && typ.literal !== undefined) { + return typ.literal; + } else { + return typeof typ; + } +} + +function jsonToJSProps(typ: any): any { + if (typ.jsonToJS === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); + typ.jsonToJS = map; + } + return typ.jsonToJS; +} + +function jsToJSONProps(typ: any): any { + if (typ.jsToJSON === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); + typ.jsToJSON = map; + } + return typ.jsToJSON; +} + +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { + function transformPrimitive(typ: string, val: any): any { + if (typeof typ === typeof val) return val; + return invalidValue(typ, val, key, parent); + } + + function transformUnion(typs: any[], val: any): any { + // val must validate against one typ in typs + const l = typs.length; + for (let i = 0; i < l; i++) { + const typ = typs[i]; + try { + return transform(val, typ, getProps); + } catch (_) {} + } + return invalidValue(typs, val, key, parent); + } + + function transformEnum(cases: string[], val: any): any { + if (cases.indexOf(val) !== -1) return val; + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); + } + + function transformArray(typ: any, val: any): any { + // val must be an array with no invalid elements + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); + return val.map(el => transform(el, typ, getProps)); + } + + function transformDate(val: any): any { + if (val === null) { + return null; + } + const d = new Date(val); + if (isNaN(d.valueOf())) { + return invalidValue(l("Date"), val, key, parent); + } + return d; + } + + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { + if (val === null || typeof val !== "object" || Array.isArray(val)) { + return invalidValue(l(ref || "object"), val, key, parent); + } + const result: any = {}; + Object.getOwnPropertyNames(props).forEach(key => { + const prop = props[key]; + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; + result[prop.key] = transform(v, prop.typ, getProps, key, ref); + }); + Object.getOwnPropertyNames(val).forEach(key => { + if (!Object.prototype.hasOwnProperty.call(props, key)) { + result[key] = transform(val[key], additional, getProps, key, ref); + } + }); + return result; + } + + if (typ === "any") return val; + if (typ === null) { + if (val === null) return val; + return invalidValue(typ, val, key, parent); + } + if (typ === false) return invalidValue(typ, val, key, parent); + let ref: any = undefined; + while (typeof typ === "object" && typ.ref !== undefined) { + ref = typ.ref; + typ = typeMap[typ.ref]; + } + if (Array.isArray(typ)) return transformEnum(typ, val); + if (typeof typ === "object") { + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) + : invalidValue(typ, val, key, parent); + } + // Numbers can be parsed by Date but shouldn't be. + if (typ === Date && typeof val !== "number") return transformDate(val); + return transformPrimitive(typ, val); +} + +function cast(val: any, typ: any): T { + return transform(val, typ, jsonToJSProps); +} + +function uncast(val: T, typ: any): any { + return transform(val, typ, jsToJSONProps); +} + +function l(typ: any) { + return { literal: typ }; +} + +function a(typ: any) { + return { arrayItems: typ }; +} + +function u(...typs: any[]) { + return { unionMembers: typs }; +} + +function o(props: any[], additional: any) { + return { props, additional }; +} + +function m(additional: any) { + return { props: [], additional }; +} + +function r(name: string) { + return { ref: name }; +} + +const typeMap: any = { + "Action": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: r("ContextElement") }, + { json: "intent", js: "intent", typ: u(undefined, "") }, + { json: "title", js: "title", typ: "" }, + { json: "type", js: "type", typ: r("ActionType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "AppIdentifier": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "ContextElement": o([ + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: "" }, + ], "any"), + "Chart": o([ + { json: "instruments", js: "instruments", typ: a(r("InstrumentElement")) }, + { json: "otherConfig", js: "otherConfig", typ: u(undefined, a(r("ContextElement"))) }, + { json: "range", js: "range", typ: u(undefined, r("TimeRangeObject")) }, + { json: "style", js: "style", typ: u(undefined, r("ChartStyle")) }, + { json: "type", js: "type", typ: r("ChartType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "InstrumentElement": o([ + { json: "id", js: "id", typ: r("PurpleInstrumentIdentifiers") }, + { json: "market", js: "market", typ: u(undefined, r("OrganizationMarket")) }, + { json: "type", js: "type", typ: r("PurpleInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "PurpleInstrumentIdentifiers": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, + { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, + { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, + { json: "RIC", js: "RIC", typ: u(undefined, "") }, + { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, + { json: "ticker", js: "ticker", typ: u(undefined, "") }, + ], "any"), + "OrganizationMarket": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, + { json: "MIC", js: "MIC", typ: u(undefined, "") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "TimeRangeObject": o([ + { json: "endTime", js: "endTime", typ: u(undefined, Date) }, + { json: "startTime", js: "startTime", typ: u(undefined, Date) }, + { json: "type", js: "type", typ: r("TimeRangeType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ChatInitSettings": o([ + { json: "chatName", js: "chatName", typ: u(undefined, "") }, + { json: "members", js: "members", typ: u(undefined, r("ContactListObject")) }, + { json: "message", js: "message", typ: u(undefined, u(r("MessageObject"), "")) }, + { json: "options", js: "options", typ: u(undefined, r("ChatOptions")) }, + { json: "type", js: "type", typ: r("ChatInitSettingsType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ContactListObject": o([ + { json: "contacts", js: "contacts", typ: a(r("ContactElement")) }, + { json: "type", js: "type", typ: r("ContactListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ContactElement": o([ + { json: "id", js: "id", typ: r("PurpleContactIdentifiers") }, + { json: "type", js: "type", typ: r("FluffyInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "PurpleContactIdentifiers": o([ + { json: "email", js: "email", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + ], "any"), + "MessageObject": o([ + { json: "entities", js: "entities", typ: u(undefined, m(r("PurpleAction"))) }, + { json: "text", js: "text", typ: u(undefined, r("PurpleMessageText")) }, + { json: "type", js: "type", typ: r("MessageType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "PurpleAction": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, + { json: "intent", js: "intent", typ: u(undefined, "") }, + { json: "title", js: "title", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("EntityType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "data", js: "data", typ: u(undefined, r("PurpleData")) }, + ], "any"), + "PurpleData": o([ + { json: "dataUri", js: "dataUri", typ: "" }, + { json: "name", js: "name", typ: "" }, + ], "any"), + "PurpleMessageText": o([ + { json: "text/markdown", js: "text/markdown", typ: u(undefined, "") }, + { json: "text/plain", js: "text/plain", typ: u(undefined, "") }, + ], "any"), + "ChatOptions": o([ + { json: "allowAddUser", js: "allowAddUser", typ: u(undefined, true) }, + { json: "allowHistoryBrowsing", js: "allowHistoryBrowsing", typ: u(undefined, true) }, + { json: "allowMessageCopy", js: "allowMessageCopy", typ: u(undefined, true) }, + { json: "groupRecipients", js: "groupRecipients", typ: u(undefined, true) }, + { json: "isPublic", js: "isPublic", typ: u(undefined, true) }, + ], "any"), + "ChatMessage": o([ + { json: "chatRoom", js: "chatRoom", typ: r("ChatRoomObject") }, + { json: "message", js: "message", typ: r("MessageObject") }, + { json: "type", js: "type", typ: r("ChatMessageType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ChatRoomObject": o([ + { json: "id", js: "id", typ: m("any") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "providerName", js: "providerName", typ: "" }, + { json: "type", js: "type", typ: r("ChatRoomType") }, + { json: "url", js: "url", typ: u(undefined, "") }, + ], "any"), + "ChatRoom": o([ + { json: "id", js: "id", typ: m("any") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "providerName", js: "providerName", typ: "" }, + { json: "type", js: "type", typ: r("ChatRoomType") }, + { json: "url", js: "url", typ: u(undefined, "") }, + ], "any"), + "ChatSearchCriteria": o([ + { json: "criteria", js: "criteria", typ: a(u(r("OrganizationObject"), "")) }, + { json: "type", js: "type", typ: r("ChatSearchCriteriaType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "OrganizationObject": o([ + { json: "id", js: "id", typ: r("Identifiers") }, + { json: "market", js: "market", typ: u(undefined, r("OrganizationMarket")) }, + { json: "type", js: "type", typ: r("TentacledInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Identifiers": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, + { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, + { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, + { json: "RIC", js: "RIC", typ: u(undefined, "") }, + { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, + { json: "ticker", js: "ticker", typ: u(undefined, "") }, + { json: "LEI", js: "LEI", typ: u(undefined, "") }, + { json: "email", js: "email", typ: u(undefined, "") }, + ], "any"), + "Contact": o([ + { json: "id", js: "id", typ: r("FluffyContactIdentifiers") }, + { json: "type", js: "type", typ: r("FluffyInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "FluffyContactIdentifiers": o([ + { json: "email", js: "email", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + ], "any"), + "ContactList": o([ + { json: "contacts", js: "contacts", typ: a(r("ContactElement")) }, + { json: "type", js: "type", typ: r("ContactListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Context": o([ + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: "" }, + ], "any"), + "Country": o([ + { json: "id", js: "id", typ: r("CountryID") }, + { json: "type", js: "type", typ: r("CountryType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "CountryID": o([ + { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, + { json: "COUNTRY_ISOALPHA3", js: "COUNTRY_ISOALPHA3", typ: u(undefined, "") }, + { json: "ISOALPHA2", js: "ISOALPHA2", typ: u(undefined, "") }, + { json: "ISOALPHA3", js: "ISOALPHA3", typ: u(undefined, "") }, + ], "any"), + "Currency": o([ + { json: "id", js: "id", typ: r("CurrencyID") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("CurrencyType") }, + ], "any"), + "CurrencyID": o([ + { json: "CURRENCY_ISOCODE", js: "CURRENCY_ISOCODE", typ: u(undefined, "") }, + ], "any"), + "Email": o([ + { json: "recipients", js: "recipients", typ: r("EmailRecipients") }, + { json: "subject", js: "subject", typ: u(undefined, "") }, + { json: "textBody", js: "textBody", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("EmailType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "EmailRecipients": o([ + { json: "id", js: "id", typ: u(undefined, r("EmailRecipientsID")) }, + { json: "type", js: "type", typ: r("EmailRecipientsType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "contacts", js: "contacts", typ: u(undefined, a(r("ContactElement"))) }, + ], "any"), + "EmailRecipientsID": o([ + { json: "email", js: "email", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + ], "any"), + "Instrument": o([ + { json: "id", js: "id", typ: r("FluffyInstrumentIdentifiers") }, + { json: "market", js: "market", typ: u(undefined, r("PurpleMarket")) }, + { json: "type", js: "type", typ: r("PurpleInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "FluffyInstrumentIdentifiers": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, + { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, + { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, + { json: "RIC", js: "RIC", typ: u(undefined, "") }, + { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, + { json: "ticker", js: "ticker", typ: u(undefined, "") }, + ], "any"), + "PurpleMarket": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, + { json: "MIC", js: "MIC", typ: u(undefined, "") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "InstrumentList": o([ + { json: "instruments", js: "instruments", typ: a(r("InstrumentElement")) }, + { json: "type", js: "type", typ: r("InstrumentListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Interaction": o([ + { json: "description", js: "description", typ: "" }, + { json: "id", js: "id", typ: u(undefined, r("InteractionID")) }, + { json: "initiator", js: "initiator", typ: u(undefined, r("ContactElement")) }, + { json: "interactionType", js: "interactionType", typ: "" }, + { json: "origin", js: "origin", typ: u(undefined, "") }, + { json: "participants", js: "participants", typ: r("ContactListObject") }, + { json: "timeRange", js: "timeRange", typ: r("TimeRangeObject") }, + { json: "type", js: "type", typ: r("InteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "InteractionID": o([ + { json: "SALESFORCE", js: "SALESFORCE", typ: u(undefined, "") }, + { json: "SINGLETRACK", js: "SINGLETRACK", typ: u(undefined, "") }, + { json: "URI", js: "URI", typ: u(undefined, "") }, + ], "any"), + "Message": o([ + { json: "entities", js: "entities", typ: u(undefined, m(r("FluffyAction"))) }, + { json: "text", js: "text", typ: u(undefined, r("FluffyMessageText")) }, + { json: "type", js: "type", typ: r("MessageType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "FluffyAction": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, + { json: "intent", js: "intent", typ: u(undefined, "") }, + { json: "title", js: "title", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("EntityType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "data", js: "data", typ: u(undefined, r("FluffyData")) }, + ], "any"), + "FluffyData": o([ + { json: "dataUri", js: "dataUri", typ: "" }, + { json: "name", js: "name", typ: "" }, + ], "any"), + "FluffyMessageText": o([ + { json: "text/markdown", js: "text/markdown", typ: u(undefined, "") }, + { json: "text/plain", js: "text/plain", typ: u(undefined, "") }, + ], "any"), + "Nothing": o([ + { json: "type", js: "type", typ: r("NothingType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Order": o([ + { json: "details", js: "details", typ: u(undefined, r("PurpleOrderDetails")) }, + { json: "id", js: "id", typ: m("") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("OrderType") }, + ], "any"), + "PurpleOrderDetails": o([ + { json: "product", js: "product", typ: u(undefined, r("ProductObject")) }, + ], "any"), + "ProductObject": o([ + { json: "id", js: "id", typ: m("") }, + { json: "instrument", js: "instrument", typ: u(undefined, r("InstrumentElement")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("ProductType") }, + ], "any"), + "OrderList": o([ + { json: "orders", js: "orders", typ: a(r("OrderElement")) }, + { json: "type", js: "type", typ: r("OrderListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "OrderElement": o([ + { json: "details", js: "details", typ: u(undefined, r("FluffyOrderDetails")) }, + { json: "id", js: "id", typ: m("") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("OrderType") }, + ], "any"), + "FluffyOrderDetails": o([ + { json: "product", js: "product", typ: u(undefined, r("ProductObject")) }, + ], "any"), + "Organization": o([ + { json: "id", js: "id", typ: r("OrganizationIdentifiers") }, + { json: "type", js: "type", typ: r("StickyInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "OrganizationIdentifiers": o([ + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + { json: "LEI", js: "LEI", typ: u(undefined, "") }, + { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, + ], "any"), + "Portfolio": o([ + { json: "positions", js: "positions", typ: a(r("PositionElement")) }, + { json: "type", js: "type", typ: r("PortfolioType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "PositionElement": o([ + { json: "holding", js: "holding", typ: 3.14 }, + { json: "instrument", js: "instrument", typ: r("InstrumentElement") }, + { json: "type", js: "type", typ: r("PositionType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Position": o([ + { json: "holding", js: "holding", typ: 3.14 }, + { json: "instrument", js: "instrument", typ: r("InstrumentElement") }, + { json: "type", js: "type", typ: r("PositionType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Product": o([ + { json: "id", js: "id", typ: m("") }, + { json: "instrument", js: "instrument", typ: u(undefined, r("InstrumentElement")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("ProductType") }, + ], "any"), + "TimeRange": o([ + { json: "endTime", js: "endTime", typ: u(undefined, Date) }, + { json: "startTime", js: "startTime", typ: u(undefined, Date) }, + { json: "type", js: "type", typ: r("TimeRangeType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Trade": o([ + { json: "id", js: "id", typ: m("") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "product", js: "product", typ: r("ProductObject") }, + { json: "type", js: "type", typ: r("TradeType") }, + ], "any"), + "TradeList": o([ + { json: "trades", js: "trades", typ: a(r("TradeElement")) }, + { json: "type", js: "type", typ: r("TradeListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "TradeElement": o([ + { json: "id", js: "id", typ: m("") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "product", js: "product", typ: r("ProductObject") }, + { json: "type", js: "type", typ: r("TradeType") }, + ], "any"), + "TransactionResult": o([ + { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, + { json: "message", js: "message", typ: u(undefined, "") }, + { json: "status", js: "status", typ: r("TransactionStatus") }, + { json: "type", js: "type", typ: r("TransactionResultType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Valuation": o([ + { json: "CURRENCY_ISOCODE", js: "CURRENCY_ISOCODE", typ: "" }, + { json: "expiryTime", js: "expiryTime", typ: u(undefined, Date) }, + { json: "price", js: "price", typ: u(undefined, 3.14) }, + { json: "type", js: "type", typ: r("ValuationType") }, + { json: "valuationTime", js: "valuationTime", typ: u(undefined, Date) }, + { json: "value", js: "value", typ: 3.14 }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ActionType": [ + "fdc3.action", + ], + "PurpleInteractionType": [ + "fdc3.instrument", + ], + "TimeRangeType": [ + "fdc3.timeRange", + ], + "ChartStyle": [ + "bar", + "candle", + "custom", + "heatmap", + "histogram", + "line", + "mountain", + "pie", + "scatter", + "stacked-bar", + ], + "ChartType": [ + "fdc3.chart", + ], + "FluffyInteractionType": [ + "fdc3.contact", + ], + "ContactListType": [ + "fdc3.contactList", + ], + "EntityType": [ + "fdc3.action", + "fdc3.entity.fileAttachment", + ], + "MessageType": [ + "fdc3.message", + ], + "ChatInitSettingsType": [ + "fdc3.chat.initSettings", + ], + "ChatRoomType": [ + "fdc3.chat.room", + ], + "ChatMessageType": [ + "fdc3.chat.message", + ], + "TentacledInteractionType": [ + "fdc3.contact", + "fdc3.instrument", + "fdc3.organization", + ], + "ChatSearchCriteriaType": [ + "fdc3.chat.searchCriteria", + ], + "CountryType": [ + "fdc3.country", + ], + "CurrencyType": [ + "fdc3.currency", + ], + "EmailRecipientsType": [ + "fdc3.contact", + "fdc3.contactList", + ], + "EmailType": [ + "fdc3.email", + ], + "InstrumentListType": [ + "fdc3.instrumentList", + ], + "InteractionType": [ + "fdc3.interaction", + ], + "NothingType": [ + "fdc3.nothing", + ], + "ProductType": [ + "fdc3.product", + ], + "OrderType": [ + "fdc3.order", + ], + "OrderListType": [ + "fdc3.orderList", + ], + "StickyInteractionType": [ + "fdc3.organization", + ], + "PositionType": [ + "fdc3.position", + ], + "PortfolioType": [ + "fdc3.portfolio", + ], + "TradeType": [ + "fdc3.trade", + ], + "TradeListType": [ + "fdc3.tradeList", + ], + "TransactionStatus": [ + "Created", + "Deleted", + "Failed", + "Updated", + ], + "TransactionResultType": [ + "fdc3.transactionResult", + ], + "ValuationType": [ + "fdc3.valuation", + ], +}; From 8904993b8b7046939752bb59f35be5393068c2e9 Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 12:09:36 +0100 Subject: [PATCH 07/16] Added Build CI --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/test.yml | 4 ++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..74e2c0cd7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: Node.js CI Build + +# Controls when the workflow will run on any branch +on: + push: + pull_request: + +# Define the jobs for this workflow +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c80a3bae..8cef96f15 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Node.js CI +name: Node.js CI Test # Controls when the workflow will run on any branch on: @@ -12,7 +12,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [18.x, 20.x] steps: - name: Checkout repository From 8629642c980fabc829a8c7e104c58cb3631237fd Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 12:12:47 +0100 Subject: [PATCH 08/16] Renamed client to fdc3-get-agent --- .github/workflows/build.yml | 2 +- package-lock.json | 8 ++++---- package.json | 2 +- packages/{client => fdc3-get-agent}/cucumber.yml | 0 packages/{client => fdc3-get-agent}/package.json | 2 +- .../src/apps/NoopAppSupport.ts | 0 packages/{client => fdc3-get-agent}/src/index.ts | 0 .../src/messaging/AbstractWebMessaging.ts | 0 .../src/messaging/MessagePortMessaging.ts | 0 .../src/messaging/message-port.ts | 0 .../src/strategies/ElectronEventLoader.ts | 0 .../src/strategies/Loader.ts | 0 .../src/strategies/PostMessageLoader.ts | 0 .../src/strategies/TimeoutLoader.ts | 0 .../src/strategies/post-message.ts | 0 .../src/ui/AbstractUIComponent.ts | 0 .../src/ui/DefaultDesktopAgentChannelSelector.ts | 0 .../src/ui/DefaultDesktopAgentIntentResolver.ts | 0 .../src/ui/NullChannelSelector.ts | 0 .../src/ui/NullIIntentResolver.ts | 0 .../test/features/default-channel-selector.feature | 0 .../test/features/default-intent-resolver.feature | 0 .../test/features/desktop-agent-strategy.feature | 0 .../test/step-definitions/channel-selector.steps.ts | 0 .../test/step-definitions/desktop-agent.steps.ts | 0 .../test/step-definitions/intent-resolver.steps.ts | 0 .../test/step-definitions/port-creation.steps.ts | 0 .../test/support/FrameTypes.ts | 0 .../test/support/MockDocument.ts | 0 .../test/support/MockFDC3Server.ts | 0 .../test/support/MockStorage.ts | 0 .../test/support/TestServerContext.ts | 0 .../test/support/responses/AutomaticResponses.ts | 0 .../test/support/responses/CurrentChannel.ts | 0 .../test/support/responses/FindIntent.ts | 0 .../test/support/responses/Handshake.ts | 0 .../test/support/responses/RaiseIntent.ts | 0 .../test/support/responses/UserChannels.ts | 0 .../{client => fdc3-get-agent}/test/world/index.ts | 0 packages/{client => fdc3-get-agent}/tsconfig.json | 0 toolbox/fdc3-for-web/demo/package.json | 2 +- toolbox/fdc3-for-web/demo/src/client/apps/ag-grid.ts | 2 +- toolbox/fdc3-for-web/demo/src/client/apps/app1.ts | 2 +- toolbox/fdc3-for-web/demo/src/client/apps/app2.ts | 2 +- toolbox/fdc3-for-web/demo/src/client/apps/app4.ts | 2 +- toolbox/fdc3-for-web/demo/src/client/apps/app5.ts | 2 +- toolbox/fdc3-for-web/demo/src/client/apps/app6.ts | 2 +- toolbox/fdc3-for-web/demo/src/client/apps/app7.ts | 2 +- toolbox/fdc3-for-web/demo/src/client/apps/chartiq.ts | 2 +- toolbox/fdc3-workbench/package-lock.json | 10 +++++----- toolbox/fdc3-workbench/package.json | 4 ++-- toolbox/fdc3-workbench/src/utility/Fdc3Api.ts | 2 +- 52 files changed, 24 insertions(+), 24 deletions(-) rename packages/{client => fdc3-get-agent}/cucumber.yml (100%) rename packages/{client => fdc3-get-agent}/package.json (96%) rename packages/{client => fdc3-get-agent}/src/apps/NoopAppSupport.ts (100%) rename packages/{client => fdc3-get-agent}/src/index.ts (100%) rename packages/{client => fdc3-get-agent}/src/messaging/AbstractWebMessaging.ts (100%) rename packages/{client => fdc3-get-agent}/src/messaging/MessagePortMessaging.ts (100%) rename packages/{client => fdc3-get-agent}/src/messaging/message-port.ts (100%) rename packages/{client => fdc3-get-agent}/src/strategies/ElectronEventLoader.ts (100%) rename packages/{client => fdc3-get-agent}/src/strategies/Loader.ts (100%) rename packages/{client => fdc3-get-agent}/src/strategies/PostMessageLoader.ts (100%) rename packages/{client => fdc3-get-agent}/src/strategies/TimeoutLoader.ts (100%) rename packages/{client => fdc3-get-agent}/src/strategies/post-message.ts (100%) rename packages/{client => fdc3-get-agent}/src/ui/AbstractUIComponent.ts (100%) rename packages/{client => fdc3-get-agent}/src/ui/DefaultDesktopAgentChannelSelector.ts (100%) rename packages/{client => fdc3-get-agent}/src/ui/DefaultDesktopAgentIntentResolver.ts (100%) rename packages/{client => fdc3-get-agent}/src/ui/NullChannelSelector.ts (100%) rename packages/{client => fdc3-get-agent}/src/ui/NullIIntentResolver.ts (100%) rename packages/{client => fdc3-get-agent}/test/features/default-channel-selector.feature (100%) rename packages/{client => fdc3-get-agent}/test/features/default-intent-resolver.feature (100%) rename packages/{client => fdc3-get-agent}/test/features/desktop-agent-strategy.feature (100%) rename packages/{client => fdc3-get-agent}/test/step-definitions/channel-selector.steps.ts (100%) rename packages/{client => fdc3-get-agent}/test/step-definitions/desktop-agent.steps.ts (100%) rename packages/{client => fdc3-get-agent}/test/step-definitions/intent-resolver.steps.ts (100%) rename packages/{client => fdc3-get-agent}/test/step-definitions/port-creation.steps.ts (100%) rename packages/{client => fdc3-get-agent}/test/support/FrameTypes.ts (100%) rename packages/{client => fdc3-get-agent}/test/support/MockDocument.ts (100%) rename packages/{client => fdc3-get-agent}/test/support/MockFDC3Server.ts (100%) rename packages/{client => fdc3-get-agent}/test/support/MockStorage.ts (100%) rename packages/{client => fdc3-get-agent}/test/support/TestServerContext.ts (100%) rename packages/{client => fdc3-get-agent}/test/support/responses/AutomaticResponses.ts (100%) rename packages/{client => fdc3-get-agent}/test/support/responses/CurrentChannel.ts (100%) rename packages/{client => fdc3-get-agent}/test/support/responses/FindIntent.ts (100%) rename packages/{client => fdc3-get-agent}/test/support/responses/Handshake.ts (100%) rename packages/{client => fdc3-get-agent}/test/support/responses/RaiseIntent.ts (100%) rename packages/{client => fdc3-get-agent}/test/support/responses/UserChannels.ts (100%) rename packages/{client => fdc3-get-agent}/test/world/index.ts (100%) rename packages/{client => fdc3-get-agent}/tsconfig.json (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74e2c0cd7..5c98e7d11 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,4 +27,4 @@ jobs: run: npm install - name: Run tests - run: npm build + run: npm run build diff --git a/package-lock.json b/package-lock.json index 4639f7450..b26a8f44f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3392,7 +3392,7 @@ "jsep": "^0.4.0||^1.0.0" } }, - "node_modules/@kite9/client": { + "node_modules/@kite9/fdc3-get-agent": { "resolved": "packages/client", "link": true }, @@ -16391,7 +16391,7 @@ "toolbox/fdc3-for-web/demo": { "version": "2.2.0-beta.6", "dependencies": { - "@kite9/client": "2.2.0-beta.6", + "@kite9/fdc3-get-agent": "2.2.0-beta.6", "@kite9/da-server": "2.2.0-beta.6", "@kite9/fdc3-core": "2.2.0-beta.6", "@types/uuid": "^10.0.0", @@ -16419,7 +16419,7 @@ "@apidevtools/json-schema-ref-parser": "^9.0.9", "@fontsource/roboto": "^4.4.5", "@fontsource/source-code-pro": "^4.5.0", - "@kite9/client": "2.2.0-beta.6", + "@kite9/fdc3-get-agent": "2.2.0-beta.6", "@kite9/fdc3": "2.2.0-beta.6", "@material-ui/core": "^4.11.4", "@material-ui/icons": "^4.11.2", @@ -16455,4 +16455,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 9db58c5d7..83653ca62 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "packages/testing", "packages/da-proxy", "toolbox/fdc3-for-web/da-server", - "packages/client", + "packages/fdc3-get-agent", "toolbox/fdc3-for-web/demo", "toolbox/fdc3-workbench" ], diff --git a/packages/client/cucumber.yml b/packages/fdc3-get-agent/cucumber.yml similarity index 100% rename from packages/client/cucumber.yml rename to packages/fdc3-get-agent/cucumber.yml diff --git a/packages/client/package.json b/packages/fdc3-get-agent/package.json similarity index 96% rename from packages/client/package.json rename to packages/fdc3-get-agent/package.json index 2a24c7eff..6bce122b5 100644 --- a/packages/client/package.json +++ b/packages/fdc3-get-agent/package.json @@ -1,5 +1,5 @@ { - "name": "@kite9/client", + "name": "@kite9/fdc3-get-agent", "version": "2.2.0-beta.6", "files": [ "dist" diff --git a/packages/client/src/apps/NoopAppSupport.ts b/packages/fdc3-get-agent/src/apps/NoopAppSupport.ts similarity index 100% rename from packages/client/src/apps/NoopAppSupport.ts rename to packages/fdc3-get-agent/src/apps/NoopAppSupport.ts diff --git a/packages/client/src/index.ts b/packages/fdc3-get-agent/src/index.ts similarity index 100% rename from packages/client/src/index.ts rename to packages/fdc3-get-agent/src/index.ts diff --git a/packages/client/src/messaging/AbstractWebMessaging.ts b/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts similarity index 100% rename from packages/client/src/messaging/AbstractWebMessaging.ts rename to packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts diff --git a/packages/client/src/messaging/MessagePortMessaging.ts b/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts similarity index 100% rename from packages/client/src/messaging/MessagePortMessaging.ts rename to packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts diff --git a/packages/client/src/messaging/message-port.ts b/packages/fdc3-get-agent/src/messaging/message-port.ts similarity index 100% rename from packages/client/src/messaging/message-port.ts rename to packages/fdc3-get-agent/src/messaging/message-port.ts diff --git a/packages/client/src/strategies/ElectronEventLoader.ts b/packages/fdc3-get-agent/src/strategies/ElectronEventLoader.ts similarity index 100% rename from packages/client/src/strategies/ElectronEventLoader.ts rename to packages/fdc3-get-agent/src/strategies/ElectronEventLoader.ts diff --git a/packages/client/src/strategies/Loader.ts b/packages/fdc3-get-agent/src/strategies/Loader.ts similarity index 100% rename from packages/client/src/strategies/Loader.ts rename to packages/fdc3-get-agent/src/strategies/Loader.ts diff --git a/packages/client/src/strategies/PostMessageLoader.ts b/packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts similarity index 100% rename from packages/client/src/strategies/PostMessageLoader.ts rename to packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts diff --git a/packages/client/src/strategies/TimeoutLoader.ts b/packages/fdc3-get-agent/src/strategies/TimeoutLoader.ts similarity index 100% rename from packages/client/src/strategies/TimeoutLoader.ts rename to packages/fdc3-get-agent/src/strategies/TimeoutLoader.ts diff --git a/packages/client/src/strategies/post-message.ts b/packages/fdc3-get-agent/src/strategies/post-message.ts similarity index 100% rename from packages/client/src/strategies/post-message.ts rename to packages/fdc3-get-agent/src/strategies/post-message.ts diff --git a/packages/client/src/ui/AbstractUIComponent.ts b/packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts similarity index 100% rename from packages/client/src/ui/AbstractUIComponent.ts rename to packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts diff --git a/packages/client/src/ui/DefaultDesktopAgentChannelSelector.ts b/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts similarity index 100% rename from packages/client/src/ui/DefaultDesktopAgentChannelSelector.ts rename to packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts diff --git a/packages/client/src/ui/DefaultDesktopAgentIntentResolver.ts b/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts similarity index 100% rename from packages/client/src/ui/DefaultDesktopAgentIntentResolver.ts rename to packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts diff --git a/packages/client/src/ui/NullChannelSelector.ts b/packages/fdc3-get-agent/src/ui/NullChannelSelector.ts similarity index 100% rename from packages/client/src/ui/NullChannelSelector.ts rename to packages/fdc3-get-agent/src/ui/NullChannelSelector.ts diff --git a/packages/client/src/ui/NullIIntentResolver.ts b/packages/fdc3-get-agent/src/ui/NullIIntentResolver.ts similarity index 100% rename from packages/client/src/ui/NullIIntentResolver.ts rename to packages/fdc3-get-agent/src/ui/NullIIntentResolver.ts diff --git a/packages/client/test/features/default-channel-selector.feature b/packages/fdc3-get-agent/test/features/default-channel-selector.feature similarity index 100% rename from packages/client/test/features/default-channel-selector.feature rename to packages/fdc3-get-agent/test/features/default-channel-selector.feature diff --git a/packages/client/test/features/default-intent-resolver.feature b/packages/fdc3-get-agent/test/features/default-intent-resolver.feature similarity index 100% rename from packages/client/test/features/default-intent-resolver.feature rename to packages/fdc3-get-agent/test/features/default-intent-resolver.feature diff --git a/packages/client/test/features/desktop-agent-strategy.feature b/packages/fdc3-get-agent/test/features/desktop-agent-strategy.feature similarity index 100% rename from packages/client/test/features/desktop-agent-strategy.feature rename to packages/fdc3-get-agent/test/features/desktop-agent-strategy.feature diff --git a/packages/client/test/step-definitions/channel-selector.steps.ts b/packages/fdc3-get-agent/test/step-definitions/channel-selector.steps.ts similarity index 100% rename from packages/client/test/step-definitions/channel-selector.steps.ts rename to packages/fdc3-get-agent/test/step-definitions/channel-selector.steps.ts diff --git a/packages/client/test/step-definitions/desktop-agent.steps.ts b/packages/fdc3-get-agent/test/step-definitions/desktop-agent.steps.ts similarity index 100% rename from packages/client/test/step-definitions/desktop-agent.steps.ts rename to packages/fdc3-get-agent/test/step-definitions/desktop-agent.steps.ts diff --git a/packages/client/test/step-definitions/intent-resolver.steps.ts b/packages/fdc3-get-agent/test/step-definitions/intent-resolver.steps.ts similarity index 100% rename from packages/client/test/step-definitions/intent-resolver.steps.ts rename to packages/fdc3-get-agent/test/step-definitions/intent-resolver.steps.ts diff --git a/packages/client/test/step-definitions/port-creation.steps.ts b/packages/fdc3-get-agent/test/step-definitions/port-creation.steps.ts similarity index 100% rename from packages/client/test/step-definitions/port-creation.steps.ts rename to packages/fdc3-get-agent/test/step-definitions/port-creation.steps.ts diff --git a/packages/client/test/support/FrameTypes.ts b/packages/fdc3-get-agent/test/support/FrameTypes.ts similarity index 100% rename from packages/client/test/support/FrameTypes.ts rename to packages/fdc3-get-agent/test/support/FrameTypes.ts diff --git a/packages/client/test/support/MockDocument.ts b/packages/fdc3-get-agent/test/support/MockDocument.ts similarity index 100% rename from packages/client/test/support/MockDocument.ts rename to packages/fdc3-get-agent/test/support/MockDocument.ts diff --git a/packages/client/test/support/MockFDC3Server.ts b/packages/fdc3-get-agent/test/support/MockFDC3Server.ts similarity index 100% rename from packages/client/test/support/MockFDC3Server.ts rename to packages/fdc3-get-agent/test/support/MockFDC3Server.ts diff --git a/packages/client/test/support/MockStorage.ts b/packages/fdc3-get-agent/test/support/MockStorage.ts similarity index 100% rename from packages/client/test/support/MockStorage.ts rename to packages/fdc3-get-agent/test/support/MockStorage.ts diff --git a/packages/client/test/support/TestServerContext.ts b/packages/fdc3-get-agent/test/support/TestServerContext.ts similarity index 100% rename from packages/client/test/support/TestServerContext.ts rename to packages/fdc3-get-agent/test/support/TestServerContext.ts diff --git a/packages/client/test/support/responses/AutomaticResponses.ts b/packages/fdc3-get-agent/test/support/responses/AutomaticResponses.ts similarity index 100% rename from packages/client/test/support/responses/AutomaticResponses.ts rename to packages/fdc3-get-agent/test/support/responses/AutomaticResponses.ts diff --git a/packages/client/test/support/responses/CurrentChannel.ts b/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts similarity index 100% rename from packages/client/test/support/responses/CurrentChannel.ts rename to packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts diff --git a/packages/client/test/support/responses/FindIntent.ts b/packages/fdc3-get-agent/test/support/responses/FindIntent.ts similarity index 100% rename from packages/client/test/support/responses/FindIntent.ts rename to packages/fdc3-get-agent/test/support/responses/FindIntent.ts diff --git a/packages/client/test/support/responses/Handshake.ts b/packages/fdc3-get-agent/test/support/responses/Handshake.ts similarity index 100% rename from packages/client/test/support/responses/Handshake.ts rename to packages/fdc3-get-agent/test/support/responses/Handshake.ts diff --git a/packages/client/test/support/responses/RaiseIntent.ts b/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts similarity index 100% rename from packages/client/test/support/responses/RaiseIntent.ts rename to packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts diff --git a/packages/client/test/support/responses/UserChannels.ts b/packages/fdc3-get-agent/test/support/responses/UserChannels.ts similarity index 100% rename from packages/client/test/support/responses/UserChannels.ts rename to packages/fdc3-get-agent/test/support/responses/UserChannels.ts diff --git a/packages/client/test/world/index.ts b/packages/fdc3-get-agent/test/world/index.ts similarity index 100% rename from packages/client/test/world/index.ts rename to packages/fdc3-get-agent/test/world/index.ts diff --git a/packages/client/tsconfig.json b/packages/fdc3-get-agent/tsconfig.json similarity index 100% rename from packages/client/tsconfig.json rename to packages/fdc3-get-agent/tsconfig.json diff --git a/toolbox/fdc3-for-web/demo/package.json b/toolbox/fdc3-for-web/demo/package.json index 857dd1f36..fa662d4e7 100644 --- a/toolbox/fdc3-for-web/demo/package.json +++ b/toolbox/fdc3-for-web/demo/package.json @@ -13,7 +13,7 @@ "vite": "^5.2.0" }, "dependencies": { - "@kite9/client": "2.2.0-beta.6", + "@kite9/fdc3-get-agent": "2.2.0-beta.6", "@kite9/da-server": "2.2.0-beta.6", "@kite9/fdc3-core": "2.2.0-beta.6", "@types/uuid": "^10.0.0", diff --git a/toolbox/fdc3-for-web/demo/src/client/apps/ag-grid.ts b/toolbox/fdc3-for-web/demo/src/client/apps/ag-grid.ts index 2dc7e9346..2e514a710 100644 --- a/toolbox/fdc3-for-web/demo/src/client/apps/ag-grid.ts +++ b/toolbox/fdc3-for-web/demo/src/client/apps/ag-grid.ts @@ -1,4 +1,4 @@ -import { getAgent } from "@kite9/client"; +import { getAgent } from "@kite9/fdc3-get-agent"; import "./ag-grid.css"; // DATA diff --git a/toolbox/fdc3-for-web/demo/src/client/apps/app1.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app1.ts index 5bbd70800..9dfeb8ebd 100644 --- a/toolbox/fdc3-for-web/demo/src/client/apps/app1.ts +++ b/toolbox/fdc3-for-web/demo/src/client/apps/app1.ts @@ -1,4 +1,4 @@ -import { getAgent } from '@kite9/client' +import { getAgent } from '@kite9/fdc3-get-agent' function createContext(i: number) { return { diff --git a/toolbox/fdc3-for-web/demo/src/client/apps/app2.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app2.ts index cb34c73be..7e95699d6 100644 --- a/toolbox/fdc3-for-web/demo/src/client/apps/app2.ts +++ b/toolbox/fdc3-for-web/demo/src/client/apps/app2.ts @@ -1,4 +1,4 @@ -import { getAgent } from '@kite9/client' +import { getAgent } from '@kite9/fdc3-get-agent' /** * This demonstrates using the API via a promise diff --git a/toolbox/fdc3-for-web/demo/src/client/apps/app4.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app4.ts index 2dbc9028a..1cec789ef 100644 --- a/toolbox/fdc3-for-web/demo/src/client/apps/app4.ts +++ b/toolbox/fdc3-for-web/demo/src/client/apps/app4.ts @@ -1,4 +1,4 @@ -import { getAgent } from '@kite9/client' +import { getAgent } from '@kite9/fdc3-get-agent' /** * This demonstrates using the API via a promise diff --git a/toolbox/fdc3-for-web/demo/src/client/apps/app5.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app5.ts index af0c0edb7..6294f381a 100644 --- a/toolbox/fdc3-for-web/demo/src/client/apps/app5.ts +++ b/toolbox/fdc3-for-web/demo/src/client/apps/app5.ts @@ -1,4 +1,4 @@ -import { getAgent } from '@kite9/client' +import { getAgent } from '@kite9/fdc3-get-agent' /** * This demonstrates using the API via a promise diff --git a/toolbox/fdc3-for-web/demo/src/client/apps/app6.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app6.ts index 70db1f4d5..3c543b192 100644 --- a/toolbox/fdc3-for-web/demo/src/client/apps/app6.ts +++ b/toolbox/fdc3-for-web/demo/src/client/apps/app6.ts @@ -1,4 +1,4 @@ -import { getAgent } from '@kite9/client' +import { getAgent } from '@kite9/fdc3-get-agent' /** * This demonstrates using the API via a promise diff --git a/toolbox/fdc3-for-web/demo/src/client/apps/app7.ts b/toolbox/fdc3-for-web/demo/src/client/apps/app7.ts index d98d14f95..01a8442ec 100644 --- a/toolbox/fdc3-for-web/demo/src/client/apps/app7.ts +++ b/toolbox/fdc3-for-web/demo/src/client/apps/app7.ts @@ -1,4 +1,4 @@ -import { getAgent } from '@kite9/client' +import { getAgent } from '@kite9/fdc3-get-agent' /** * This demonstrates using the API via a promise diff --git a/toolbox/fdc3-for-web/demo/src/client/apps/chartiq.ts b/toolbox/fdc3-for-web/demo/src/client/apps/chartiq.ts index 513217733..6d90c0c5e 100644 --- a/toolbox/fdc3-for-web/demo/src/client/apps/chartiq.ts +++ b/toolbox/fdc3-for-web/demo/src/client/apps/chartiq.ts @@ -1,4 +1,4 @@ -import { getAgent } from "@kite9/client"; +import { getAgent } from "@kite9/fdc3-get-agent"; const init = async () => { const fdc3 = await getAgent(); diff --git a/toolbox/fdc3-workbench/package-lock.json b/toolbox/fdc3-workbench/package-lock.json index d92f74469..d469ddfa5 100644 --- a/toolbox/fdc3-workbench/package-lock.json +++ b/toolbox/fdc3-workbench/package-lock.json @@ -12,7 +12,7 @@ "@apidevtools/json-schema-ref-parser": "^9.0.9", "@fontsource/roboto": "^4.4.5", "@fontsource/source-code-pro": "^4.5.0", - "@kite9/client": "0.0.41", + "@kite9/fdc3-get-agent": "0.0.41", "@material-ui/core": "^4.11.4", "@material-ui/icons": "^4.11.2", "@material-ui/lab": "^4.0.0-alpha.59", @@ -961,9 +961,9 @@ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", "dev": true }, - "node_modules/@kite9/client": { + "node_modules/@kite9/fdc3-get-agent": { "version": "0.0.41", - "resolved": "https://registry.npmjs.org/@kite9/client/-/client-0.0.41.tgz", + "resolved": "https://registry.npmjs.org/@kite9/fdc3-get-agent/-/client-0.0.41.tgz", "integrity": "sha512-t92usxhnTXe+J5Nihshx3CBJP5OclVMIp3GBaQrlPXp9bFHZ4SIIMGbBgf4WsrGzBqlfNNvZkasU0KyuoEEieQ==", "dev": true, "dependencies": { @@ -974,7 +974,7 @@ "uuid": "^9.0.1" } }, - "node_modules/@kite9/client/node_modules/@types/uuid": { + "node_modules/@kite9/fdc3-get-agent/node_modules/@types/uuid": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", @@ -6574,4 +6574,4 @@ } } } -} +} \ No newline at end of file diff --git a/toolbox/fdc3-workbench/package.json b/toolbox/fdc3-workbench/package.json index c79eee4a8..559b1a01f 100644 --- a/toolbox/fdc3-workbench/package.json +++ b/toolbox/fdc3-workbench/package.json @@ -30,7 +30,7 @@ ] }, "devDependencies": { - "@kite9/client": "2.2.0-beta.6", + "@kite9/fdc3-get-agent": "2.2.0-beta.6", "@types/jsoneditor": "^8.6.1", "@typescript-eslint/eslint-plugin": "7.1.1", "@typescript-eslint/parser": "7.1.0", @@ -76,4 +76,4 @@ "*.js": "eslint --cache --fix", "*.{js,css,md}": "prettier --write" } -} +} \ No newline at end of file diff --git a/toolbox/fdc3-workbench/src/utility/Fdc3Api.ts b/toolbox/fdc3-workbench/src/utility/Fdc3Api.ts index 313ef8145..a1ed2cc98 100644 --- a/toolbox/fdc3-workbench/src/utility/Fdc3Api.ts +++ b/toolbox/fdc3-workbench/src/utility/Fdc3Api.ts @@ -5,7 +5,7 @@ import * as fdc3_2 from "@kite9/fdc3-core"; import * as fdc3_1 from "fdc3-1.2"; import { group } from "console"; -import { fdc3Ready } from '@kite9/client' +import { fdc3Ready } from '@kite9/fdc3-get-agent' const fdc3ReadyPromise = fdc3Ready() interface fdc3_1IntentResolution extends fdc3_1.IntentResolution { From 7274bc36d73ea944b3e0c52edd6ce548dca815b4 Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 12:18:56 +0100 Subject: [PATCH 09/16] Renamed fdc3-core to fdc3-standard --- .github/workflows/build.yml | 3 +- .github/workflows/test.yml | 1 - package-lock.json | 371 +++++------------- package.json | 2 +- packages/da-proxy/package.json | 2 +- packages/da-proxy/src/BasicDesktopAgent.ts | 4 +- packages/da-proxy/src/Messaging.ts | 2 +- packages/da-proxy/src/apps/AppSupport.ts | 2 +- .../da-proxy/src/apps/DefaultAppSupport.ts | 4 +- .../da-proxy/src/channels/ChannelSupport.ts | 2 +- .../da-proxy/src/channels/DefaultChannel.ts | 4 +- .../src/channels/DefaultChannelSupport.ts | 4 +- .../src/channels/DefaultPrivateChannel.ts | 4 +- .../src/handshake/DefaultHandshakeSupport.ts | 2 +- .../src/handshake/HandshakeSupport.ts | 2 +- packages/da-proxy/src/index.ts | 2 +- .../src/intents/DefaultIntentResolution.ts | 2 +- .../src/intents/DefaultIntentSupport.ts | 6 +- .../da-proxy/src/intents/IntentSupport.ts | 2 +- .../src/listeners/DefaultContextListener.ts | 4 +- .../src/listeners/DefaultIntentListener.ts | 4 +- .../listeners/PrivateChannelEventListener.ts | 2 +- .../src/listeners/RegisterableListener.ts | 2 +- .../src/messaging/AbstractMessaging.ts | 4 +- .../test/step-definitions/channels.steps.ts | 2 +- .../test/step-definitions/intents.steps.ts | 2 +- .../da-proxy/test/support/TestMessaging.ts | 4 +- .../test/support/responses/ChannelState.ts | 2 +- .../support/responses/CreatePrivateChannel.ts | 2 +- .../responses/DisconnectPrivateChannel.ts | 2 +- .../test/support/responses/FindInstances.ts | 2 +- .../test/support/responses/FindIntent.ts | 2 +- .../support/responses/FindIntentByContext.ts | 2 +- .../test/support/responses/GetAppMetadata.ts | 2 +- .../support/responses/GetOrCreateChannel.ts | 4 +- .../test/support/responses/GetUserChannels.ts | 2 +- .../test/support/responses/Handshake.ts | 2 +- .../test/support/responses/IntentResult.ts | 2 +- .../da-proxy/test/support/responses/Open.ts | 2 +- .../test/support/responses/RaiseIntent.ts | 4 +- .../responses/RaiseIntentForContext.ts | 4 +- .../test/support/responses/support.ts | 2 +- packages/da-proxy/tsconfig.json | 2 +- packages/fdc3-all/package.json | 2 +- packages/fdc3-get-agent/package.json | 2 +- .../fdc3-get-agent/src/apps/NoopAppSupport.ts | 2 +- packages/fdc3-get-agent/src/index.ts | 2 +- .../src/messaging/AbstractWebMessaging.ts | 2 +- .../src/messaging/MessagePortMessaging.ts | 2 +- .../src/messaging/message-port.ts | 4 +- .../src/strategies/ElectronEventLoader.ts | 4 +- .../fdc3-get-agent/src/strategies/Loader.ts | 4 +- .../src/strategies/PostMessageLoader.ts | 2 +- .../src/strategies/TimeoutLoader.ts | 2 +- .../src/strategies/post-message.ts | 2 +- .../src/ui/AbstractUIComponent.ts | 2 +- .../ui/DefaultDesktopAgentChannelSelector.ts | 4 +- .../ui/DefaultDesktopAgentIntentResolver.ts | 4 +- .../src/ui/NullChannelSelector.ts | 6 +- .../src/ui/NullIIntentResolver.ts | 4 +- .../step-definitions/desktop-agent.steps.ts | 2 +- .../fdc3-get-agent/test/support/FrameTypes.ts | 2 +- .../test/support/MockDocument.ts | 2 +- .../test/support/MockFDC3Server.ts | 2 +- .../test/support/responses/CurrentChannel.ts | 2 +- .../test/support/responses/FindIntent.ts | 2 +- .../test/support/responses/Handshake.ts | 2 +- .../test/support/responses/RaiseIntent.ts | 2 +- .../test/support/responses/UserChannels.ts | 2 +- packages/fdc3-get-agent/tsconfig.json | 2 +- .../.eslintrc.json | 0 .../jest.config.js | 0 .../{fdc3-core => fdc3-standard}/package.json | 2 +- .../src/api/AppIdentifier.ts | 0 .../src/api/AppIntent.ts | 0 .../src/api/AppMetadata.ts | 0 .../src/api/Channel.ts | 0 .../src/api/ContextMetadata.ts | 0 .../src/api/DesktopAgent.ts | 0 .../src/api/DesktopAgentIdentifier.ts | 0 .../src/api/DisplayMetadata.ts | 0 .../src/api/Errors.ts | 0 .../src/api/Events.ts | 0 .../src/api/GetAgent.ts | 0 .../src/api/Icon.ts | 0 .../src/api/Image.ts | 0 .../src/api/ImplementationMetadata.ts | 0 .../src/api/IntentMetadata.ts | 0 .../src/api/IntentResolution.ts | 0 .../src/api/Listener.ts | 0 .../src/api/Methods.ts | 0 .../src/api/PrivateChannel.ts | 0 .../src/api/RecommendedChannels.ts | 0 .../src/api/Types.ts | 0 .../specification/appd.schema.json | 0 .../examples/application/fdc3-workbench.json | 0 .../examples/application/myApplication.json | 0 .../app-directory/specification/test/index.js | 0 .../specification/test/package-lock.json | 0 .../specification/test/package.json | 0 .../src/context/ContextType.ts | 0 .../{fdc3-core => fdc3-standard}/src/index.ts | 0 .../src/intents/Intents.ts | 0 .../src/intents/standard intents.json | 0 .../src/internal/contextConfiguration.ts | 0 .../src/internal/intentConfiguration.ts | 0 .../src/internal/typeHelpers.ts | 0 .../src/protocols/bcp.ts | 2 +- .../src/protocols/wcp.ts | 2 +- .../src/ui/ChannelSelector.ts | 0 .../src/ui/Connectable.ts | 0 .../src/ui/IntentResolver.ts | 0 .../test/ContextTypes.test.ts | 0 .../test/Methods.test.ts | 0 .../test/window.test.ts | 0 .../tsconfig.json | 0 packages/testing/package.json | 2 +- packages/testing/src/agent/index.ts | 4 +- packages/testing/tsconfig.json | 2 +- toolbox/fdc3-for-web/da-server/package.json | 4 +- .../da-server/src/BasicFDC3Server.ts | 2 +- .../fdc3-for-web/da-server/src/FDC3Server.ts | 2 +- .../da-server/src/ServerContext.ts | 4 +- .../src/handlers/BroadcastHandler.ts | 4 +- .../da-server/src/handlers/IntentHandler.ts | 2 +- .../da-server/src/handlers/OpenHandler.ts | 2 +- .../da-server/src/handlers/support.ts | 2 +- .../step-definitions/app-channel.steps.ts | 2 +- .../test/step-definitions/broadcast.steps.ts | 2 +- .../test/step-definitions/intents.steps.ts | 2 +- .../step-definitions/private-channel.steps.ts | 2 +- .../test/step-definitions/start-app.steps.ts | 2 +- .../step-definitions/user-channel.steps.ts | 2 +- toolbox/fdc3-for-web/da-server/tsconfig.json | 2 +- toolbox/fdc3-for-web/demo/package.json | 2 +- .../demo/src/client/da/dummy-desktop-agent.ts | 2 +- .../demo/src/client/ui/channel-selector.ts | 2 +- .../demo/src/client/ui/intent-resolver.ts | 2 +- toolbox/fdc3-for-web/demo/tsconfig.json | 4 +- toolbox/fdc3-workbench/src/utility/Fdc3Api.ts | 2 +- 140 files changed, 215 insertions(+), 402 deletions(-) rename packages/{fdc3-core => fdc3-standard}/.eslintrc.json (100%) rename packages/{fdc3-core => fdc3-standard}/jest.config.js (100%) rename packages/{fdc3-core => fdc3-standard}/package.json (97%) rename packages/{fdc3-core => fdc3-standard}/src/api/AppIdentifier.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/AppIntent.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/AppMetadata.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/Channel.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/ContextMetadata.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/DesktopAgent.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/DesktopAgentIdentifier.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/DisplayMetadata.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/Errors.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/Events.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/GetAgent.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/Icon.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/Image.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/ImplementationMetadata.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/IntentMetadata.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/IntentResolution.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/Listener.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/Methods.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/PrivateChannel.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/RecommendedChannels.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/api/Types.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/app-directory/specification/appd.schema.json (100%) rename packages/{fdc3-core => fdc3-standard}/src/app-directory/specification/examples/application/fdc3-workbench.json (100%) rename packages/{fdc3-core => fdc3-standard}/src/app-directory/specification/examples/application/myApplication.json (100%) rename packages/{fdc3-core => fdc3-standard}/src/app-directory/specification/test/index.js (100%) rename packages/{fdc3-core => fdc3-standard}/src/app-directory/specification/test/package-lock.json (100%) rename packages/{fdc3-core => fdc3-standard}/src/app-directory/specification/test/package.json (100%) rename packages/{fdc3-core => fdc3-standard}/src/context/ContextType.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/index.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/intents/Intents.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/intents/standard intents.json (100%) rename packages/{fdc3-core => fdc3-standard}/src/internal/contextConfiguration.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/internal/intentConfiguration.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/internal/typeHelpers.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/protocols/bcp.ts (99%) rename packages/{fdc3-core => fdc3-standard}/src/protocols/wcp.ts (94%) rename packages/{fdc3-core => fdc3-standard}/src/ui/ChannelSelector.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/ui/Connectable.ts (100%) rename packages/{fdc3-core => fdc3-standard}/src/ui/IntentResolver.ts (100%) rename packages/{fdc3-core => fdc3-standard}/test/ContextTypes.test.ts (100%) rename packages/{fdc3-core => fdc3-standard}/test/Methods.test.ts (100%) rename packages/{fdc3-core => fdc3-standard}/test/window.test.ts (100%) rename packages/{fdc3-core => fdc3-standard}/tsconfig.json (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c98e7d11..a3d19af45 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,12 +2,11 @@ name: Node.js CI Build # Controls when the workflow will run on any branch on: - push: pull_request: # Define the jobs for this workflow jobs: - test: + build: runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8cef96f15..827377a53 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,6 @@ name: Node.js CI Test # Controls when the workflow will run on any branch on: - push: pull_request: # Define the jobs for this workflow diff --git a/package-lock.json b/package-lock.json index b26a8f44f..3ea5077fc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,11 +10,11 @@ "license": "Apache-2.0", "workspaces": [ "packages/fdc3-schema", - "packages/fdc3-core", + "packages/fdc3-standard", "packages/testing", "packages/da-proxy", "toolbox/fdc3-for-web/da-server", - "packages/client", + "packages/fdc3-get-agent", "toolbox/fdc3-for-web/demo", "toolbox/fdc3-workbench" ], @@ -3392,10 +3392,6 @@ "jsep": "^0.4.0||^1.0.0" } }, - "node_modules/@kite9/fdc3-get-agent": { - "resolved": "packages/client", - "link": true - }, "node_modules/@kite9/da-proxy": { "resolved": "packages/da-proxy", "link": true @@ -3424,14 +3420,18 @@ "@kite9/fdc3": "2.2.0-beta.6" } }, - "node_modules/@kite9/fdc3-core": { - "resolved": "packages/fdc3-core", + "node_modules/@kite9/fdc3-get-agent": { + "resolved": "packages/fdc3-get-agent", "link": true }, "node_modules/@kite9/fdc3-schema": { "resolved": "packages/fdc3-schema", "link": true }, + "node_modules/@kite9/fdc3-standard": { + "resolved": "packages/fdc3-standard", + "link": true + }, "node_modules/@kite9/testing": { "resolved": "packages/testing", "link": true @@ -6186,11 +6186,6 @@ "version": "1.0.1", "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==" }, - "node_modules/compare-versions": { - "version": "3.6.0", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, "node_modules/concat-map": { "version": "0.0.1", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" @@ -8112,27 +8107,6 @@ "url": "https://github.com/avajs/find-cache-dir?sponsor=1" } }, - "node_modules/find-cache-dir/node_modules/find-up": { - "version": "4.1.0", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-cache-dir/node_modules/locate-path": { - "version": "5.0.0", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/find-cache-dir/node_modules/make-dir": { "version": "3.1.0", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", @@ -8146,39 +8120,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/find-cache-dir/node_modules/p-limit": { - "version": "2.3.0", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/find-cache-dir/node_modules/p-locate": { - "version": "4.1.0", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-cache-dir/node_modules/pkg-dir": { - "version": "4.2.0", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/find-cache-dir/node_modules/semver": { "version": "6.3.1", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", @@ -8211,20 +8152,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/find-versions": { - "version": "4.0.0", - "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", - "dev": true, - "dependencies": { - "semver-regex": "^3.1.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/flat-cache": { "version": "3.2.0", "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", @@ -8859,74 +8786,6 @@ "node": ">=10.17.0" } }, - "node_modules/husky": { - "version": "4.3.8", - "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "chalk": "^4.0.0", - "ci-info": "^2.0.0", - "compare-versions": "^3.6.0", - "cosmiconfig": "^7.0.0", - "find-versions": "^4.0.0", - "opencollective-postinstall": "^2.0.2", - "pkg-dir": "^5.0.0", - "please-upgrade-node": "^3.2.0", - "slash": "^3.0.0", - "which-pm-runs": "^1.0.0" - }, - "bin": { - "husky-run": "bin/run.js", - "husky-upgrade": "lib/upgrader/bin.js" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/husky" - } - }, - "node_modules/husky/node_modules/cosmiconfig": { - "version": "7.1.0", - "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", - "dev": true, - "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/husky/node_modules/path-type": { - "version": "4.0.0", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/husky/node_modules/slash": { - "version": "3.0.0", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/husky/node_modules/yaml": { - "version": "1.10.2", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/hyphenate-style-name": { "version": "1.1.0", "integrity": "sha512-WDC/ui2VVRrz3jOVi+XtjqkDjiVjTtFaAGiW37k6b+ohyQ5wYDOGkvCZa8+H0nx3gyvv0+BST9xuOgIyGQ00gw==", @@ -9005,65 +8864,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/import-local/node_modules/find-up": { - "version": "4.1.0", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/import-local/node_modules/locate-path": { - "version": "5.0.0", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/import-local/node_modules/p-limit": { - "version": "2.3.0", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-local/node_modules/p-locate": { - "version": "4.1.0", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/import-local/node_modules/pkg-dir": { - "version": "4.2.0", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/imurmurhash": { "version": "0.1.4", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", @@ -12123,14 +11923,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/opencollective-postinstall": { - "version": "2.0.3", - "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", - "dev": true, - "bin": { - "opencollective-postinstall": "index.js" - } - }, "node_modules/optionator": { "version": "0.9.4", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", @@ -12436,14 +12228,57 @@ } }, "node_modules/pkg-dir": { + "version": "4.2.0", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { "version": "5.0.0", - "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", - "dev": true, + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dependencies": { - "find-up": "^5.0.0" + "p-locate": "^4.1.0" }, "engines": { - "node": ">=10" + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" } }, "node_modules/please-upgrade-node": { @@ -13617,17 +13452,6 @@ "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", "dev": true }, - "node_modules/semver-regex": { - "version": "3.1.4", - "integrity": "sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/send": { "version": "0.19.0", "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", @@ -15929,14 +15753,6 @@ "version": "2.0.1", "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" }, - "node_modules/which-pm-runs": { - "version": "1.1.0", - "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/which-typed-array": { "version": "1.1.15", "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", @@ -16220,33 +16036,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "packages/client": { - "version": "2.2.0-beta.6", - "dependencies": { - "@kite9/da-proxy": "2.2.0-beta.6", - "@kite9/fdc3-core": "2.2.0-beta.6", - "@types/uuid": "^10.0.0", - "uuid": "^9.0.1" - }, - "devDependencies": { - "@cucumber/cucumber": "10.3.1", - "@kite9/da-server": "2.2.0-beta.6", - "@kite9/testing": "2.2.0-beta.6", - "@types/node": "^20.14.11", - "@types/wtfnode": "^0.7.3", - "expect": "^29.7.0", - "jsonpath-plus": "^9.0.0", - "nyc": "15.1.0", - "rimraf": "^6.0.1", - "tsx": "^4.7.1", - "typescript": "^5.3.2", - "wtfnode": "^0.9.3" - } - }, "packages/da-proxy": { "version": "2.2.0-beta.6", "dependencies": { - "@kite9/fdc3-core": "2.2.0-beta.6" + "@kite9/fdc3-standard": "2.2.0-beta.6" }, "devDependencies": { "@cucumber/cucumber": "10.3.1", @@ -16276,12 +16069,32 @@ "uuid": "^9.0.1" } }, - "packages/fdc3-core": { + "packages/fdc3-get-agent": { "version": "2.2.0-beta.6", - "license": "Apache-2.0", "dependencies": { - "@kite9/fdc3-schema": "2.2.0-beta.6" + "@kite9/da-proxy": "2.2.0-beta.6", + "@kite9/fdc3-standard": "2.2.0-beta.6", + "@types/uuid": "^10.0.0", + "uuid": "^9.0.1" }, + "devDependencies": { + "@cucumber/cucumber": "10.3.1", + "@kite9/da-server": "2.2.0-beta.6", + "@kite9/testing": "2.2.0-beta.6", + "@types/node": "^20.14.11", + "@types/wtfnode": "^0.7.3", + "expect": "^29.7.0", + "jsonpath-plus": "^9.0.0", + "nyc": "15.1.0", + "rimraf": "^6.0.1", + "tsx": "^4.7.1", + "typescript": "^5.3.2", + "wtfnode": "^0.9.3" + } + }, + "packages/fdc3-schema": { + "version": "2.2.0-beta.6", + "license": "Apache-2.0", "devDependencies": { "@types/jest": "29.5.12", "@typescript-eslint/eslint-plugin": "7.1.1", @@ -16290,11 +16103,6 @@ "eslint-config-prettier": "9.1.0", "eslint-plugin-jest": "27.9.0", "eslint-plugin-jsx-a11y": "^6.8.0", - "husky": "^4.3.0", - "jest": "29.7.0", - "jest-environment-jsdom": "29.7.0", - "jest-mock-extended": "3.0.5", - "prettier": "3.2.5", "quicktype": "23.0.78", "rimraf": "^6.0.1", "ts-jest": "29.1.2", @@ -16302,9 +16110,12 @@ "typescript": "^5.3.2" } }, - "packages/fdc3-schema": { + "packages/fdc3-standard": { "version": "2.2.0-beta.6", "license": "Apache-2.0", + "dependencies": { + "@kite9/fdc3-schema": "2.2.0-beta.6" + }, "devDependencies": { "@types/jest": "29.5.12", "@typescript-eslint/eslint-plugin": "7.1.1", @@ -16313,6 +16124,10 @@ "eslint-config-prettier": "9.1.0", "eslint-plugin-jest": "27.9.0", "eslint-plugin-jsx-a11y": "^6.8.0", + "jest": "29.7.0", + "jest-environment-jsdom": "29.7.0", + "jest-mock-extended": "3.0.5", + "prettier": "3.2.5", "quicktype": "23.0.78", "rimraf": "^6.0.1", "ts-jest": "29.1.2", @@ -16326,7 +16141,7 @@ "@cucumber/cucumber": "10.3.1", "@cucumber/html-formatter": "11.0.4", "@cucumber/pretty-formatter": "1.0.1", - "@kite9/fdc3-core": "2.2.0-beta.6", + "@kite9/fdc3-standard": "2.2.0-beta.6", "@types/expect": "24.3.0", "@types/lodash": "4.14.167", "@types/node": "^20.14.11", @@ -16355,7 +16170,7 @@ "toolbox/fdc3-for-web/da-server": { "version": "2.2.0-beta.6", "dependencies": { - "@kite9/fdc3-core": "2.2.0-beta.6", + "@kite9/fdc3-standard": "2.2.0-beta.6", "@types/uuid": "^10.0.0", "uuid": "^9.0.1" }, @@ -16391,9 +16206,9 @@ "toolbox/fdc3-for-web/demo": { "version": "2.2.0-beta.6", "dependencies": { - "@kite9/fdc3-get-agent": "2.2.0-beta.6", "@kite9/da-server": "2.2.0-beta.6", - "@kite9/fdc3-core": "2.2.0-beta.6", + "@kite9/fdc3-get-agent": "2.2.0-beta.6", + "@kite9/fdc3-standard": "2.2.0-beta.6", "@types/uuid": "^10.0.0", "@types/ws": "^8.5.10", "express": "^4.18.3", @@ -16419,8 +16234,8 @@ "@apidevtools/json-schema-ref-parser": "^9.0.9", "@fontsource/roboto": "^4.4.5", "@fontsource/source-code-pro": "^4.5.0", - "@kite9/fdc3-get-agent": "2.2.0-beta.6", "@kite9/fdc3": "2.2.0-beta.6", + "@kite9/fdc3-get-agent": "2.2.0-beta.6", "@material-ui/core": "^4.11.4", "@material-ui/icons": "^4.11.2", "@material-ui/lab": "^4.0.0-alpha.59", @@ -16455,4 +16270,4 @@ } } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 83653ca62..a296a719e 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ ], "workspaces": [ "packages/fdc3-schema", - "packages/fdc3-core", + "packages/fdc3-standard", "packages/testing", "packages/da-proxy", "toolbox/fdc3-for-web/da-server", diff --git a/packages/da-proxy/package.json b/packages/da-proxy/package.json index d992cb691..d77fa7b25 100644 --- a/packages/da-proxy/package.json +++ b/packages/da-proxy/package.json @@ -12,7 +12,7 @@ "clean": "rimraf dist; rimraf cucumber-report.html; rimraf coverage; rimraf .nyc_output; rimraf node_modules" }, "dependencies": { - "@kite9/fdc3-core": "2.2.0-beta.6" + "@kite9/fdc3-standard": "2.2.0-beta.6" }, "devDependencies": { "@cucumber/cucumber": "10.3.1", diff --git a/packages/da-proxy/src/BasicDesktopAgent.ts b/packages/da-proxy/src/BasicDesktopAgent.ts index bcc6fc198..654920788 100644 --- a/packages/da-proxy/src/BasicDesktopAgent.ts +++ b/packages/da-proxy/src/BasicDesktopAgent.ts @@ -1,9 +1,9 @@ -import { AppIdentifier, AppMetadata, Context, ContextHandler, DesktopAgent, EventHandler, FDC3EventType, ImplementationMetadata, IntentHandler, IntentResolution, Listener } from "@kite9/fdc3-core"; +import { AppIdentifier, AppMetadata, Context, ContextHandler, DesktopAgent, EventHandler, FDC3EventType, ImplementationMetadata, IntentHandler, IntentResolution, Listener } from "@kite9/fdc3-standard"; import { ChannelSupport } from "./channels/ChannelSupport"; import { AppSupport } from "./apps/AppSupport"; import { IntentSupport } from "./intents/IntentSupport"; import { HandshakeSupport } from "./handshake/HandshakeSupport"; -import { DesktopAgentDetails, Connectable } from "@kite9/fdc3-core" +import { DesktopAgentDetails, Connectable } from "@kite9/fdc3-standard" /** * This splits out the functionality of the desktop agent into * app, channels and intents concerns. diff --git a/packages/da-proxy/src/Messaging.ts b/packages/da-proxy/src/Messaging.ts index c07b9d4e4..d27f6811b 100644 --- a/packages/da-proxy/src/Messaging.ts +++ b/packages/da-proxy/src/Messaging.ts @@ -1,4 +1,4 @@ -import { Connectable, AppIdentifier, ImplementationMetadata } from "@kite9/fdc3-core"; +import { Connectable, AppIdentifier, ImplementationMetadata } from "@kite9/fdc3-standard"; import { RegisterableListener } from "./listeners/RegisterableListener"; export interface Messaging extends Connectable { diff --git a/packages/da-proxy/src/apps/AppSupport.ts b/packages/da-proxy/src/apps/AppSupport.ts index 02e836355..771b04c1d 100644 --- a/packages/da-proxy/src/apps/AppSupport.ts +++ b/packages/da-proxy/src/apps/AppSupport.ts @@ -1,4 +1,4 @@ -import { AppIdentifier, AppMetadata, Context } from "@kite9/fdc3-core"; +import { AppIdentifier, AppMetadata, Context } from "@kite9/fdc3-standard"; export interface AppSupport { diff --git a/packages/da-proxy/src/apps/DefaultAppSupport.ts b/packages/da-proxy/src/apps/DefaultAppSupport.ts index 7a97689c1..b74a9b445 100644 --- a/packages/da-proxy/src/apps/DefaultAppSupport.ts +++ b/packages/da-proxy/src/apps/DefaultAppSupport.ts @@ -1,7 +1,7 @@ -import { AppIdentifier, AppMetadata, Context } from "@kite9/fdc3-core"; +import { AppIdentifier, AppMetadata, Context } from "@kite9/fdc3-standard"; import { AppSupport } from "./AppSupport"; import { Messaging } from "../Messaging"; -import { FindInstancesRequest, GetAppMetadataResponse, FindInstancesResponse, GetAppMetadataRequest, OpenRequest } from "@kite9/fdc3-core" +import { FindInstancesRequest, GetAppMetadataResponse, FindInstancesResponse, GetAppMetadataRequest, OpenRequest } from "@kite9/fdc3-standard" export class DefaultAppSupport implements AppSupport { diff --git a/packages/da-proxy/src/channels/ChannelSupport.ts b/packages/da-proxy/src/channels/ChannelSupport.ts index f28bc1a02..36591b668 100644 --- a/packages/da-proxy/src/channels/ChannelSupport.ts +++ b/packages/da-proxy/src/channels/ChannelSupport.ts @@ -1,4 +1,4 @@ -import { Channel, ContextHandler, Listener, PrivateChannel } from "@kite9/fdc3-core" +import { Channel, ContextHandler, Listener, PrivateChannel } from "@kite9/fdc3-standard" export interface ChannelSupport { diff --git a/packages/da-proxy/src/channels/DefaultChannel.ts b/packages/da-proxy/src/channels/DefaultChannel.ts index 6e423707a..1ce0ff262 100644 --- a/packages/da-proxy/src/channels/DefaultChannel.ts +++ b/packages/da-proxy/src/channels/DefaultChannel.ts @@ -1,7 +1,7 @@ -import { Context, ContextHandler, DisplayMetadata, Listener, Channel } from "@kite9/fdc3-core" +import { Context, ContextHandler, DisplayMetadata, Listener, Channel } from "@kite9/fdc3-standard" import { Messaging } from "../Messaging" import { DefaultContextListener } from "../listeners/DefaultContextListener" -import { BroadcastRequest, BroadcastResponse, GetCurrentContextResponse, GetCurrentContextRequest } from '@kite9/fdc3-core' +import { BroadcastRequest, BroadcastResponse, GetCurrentContextResponse, GetCurrentContextRequest } from '@kite9/fdc3-standard' export class DefaultChannel implements Channel { diff --git a/packages/da-proxy/src/channels/DefaultChannelSupport.ts b/packages/da-proxy/src/channels/DefaultChannelSupport.ts index 26afcfa88..3912940ea 100644 --- a/packages/da-proxy/src/channels/DefaultChannelSupport.ts +++ b/packages/da-proxy/src/channels/DefaultChannelSupport.ts @@ -1,4 +1,4 @@ -import { Channel, ContextHandler, Listener, PrivateChannel } from "@kite9/fdc3-core"; +import { Channel, ContextHandler, Listener, PrivateChannel } from "@kite9/fdc3-standard"; import { Messaging } from "../Messaging"; import { ChannelSupport } from "./ChannelSupport"; import { DefaultPrivateChannel } from "./DefaultPrivateChannel"; @@ -15,7 +15,7 @@ import { JoinUserChannelResponse, JoinUserChannelRequest, GetCurrentChannelResponse, GetCurrentChannelRequest, LeaveCurrentChannelRequest, LeaveCurrentChannelResponse, -} from "@kite9/fdc3-core"; +} from "@kite9/fdc3-standard"; import { FollowingContextListener } from "../listeners/FollowingContextListener"; diff --git a/packages/da-proxy/src/channels/DefaultPrivateChannel.ts b/packages/da-proxy/src/channels/DefaultPrivateChannel.ts index 42ced65a8..8e3e2da0a 100644 --- a/packages/da-proxy/src/channels/DefaultPrivateChannel.ts +++ b/packages/da-proxy/src/channels/DefaultPrivateChannel.ts @@ -1,9 +1,9 @@ -import { ContextHandler, Listener, PrivateChannel } from "@kite9/fdc3-core"; +import { ContextHandler, Listener, PrivateChannel } from "@kite9/fdc3-standard"; import { DefaultChannel } from "./DefaultChannel"; import { Messaging } from "../Messaging"; import { PrivateChannelEventListenerType, PrivateChannelEventListenerVoid } from "../listeners/PrivateChannelEventListener"; import { DefaultContextListener } from "../listeners/DefaultContextListener"; -import { PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse } from '@kite9/fdc3-core' +import { PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse } from '@kite9/fdc3-standard' export class DefaultPrivateChannel extends DefaultChannel implements PrivateChannel { diff --git a/packages/da-proxy/src/handshake/DefaultHandshakeSupport.ts b/packages/da-proxy/src/handshake/DefaultHandshakeSupport.ts index 0c9879a45..8d4724180 100644 --- a/packages/da-proxy/src/handshake/DefaultHandshakeSupport.ts +++ b/packages/da-proxy/src/handshake/DefaultHandshakeSupport.ts @@ -1,6 +1,6 @@ import { Messaging } from "../Messaging"; import { HandshakeSupport } from "./HandshakeSupport"; -import { ImplementationMetadata } from "@kite9/fdc3-core"; +import { ImplementationMetadata } from "@kite9/fdc3-standard"; /** * This will possibly eventually need extending to allow for auth handshaking. diff --git a/packages/da-proxy/src/handshake/HandshakeSupport.ts b/packages/da-proxy/src/handshake/HandshakeSupport.ts index b2ecf1183..913f08273 100644 --- a/packages/da-proxy/src/handshake/HandshakeSupport.ts +++ b/packages/da-proxy/src/handshake/HandshakeSupport.ts @@ -1,4 +1,4 @@ -import { ImplementationMetadata, Connectable } from "@kite9/fdc3-core" +import { ImplementationMetadata, Connectable } from "@kite9/fdc3-standard" /** * Handles messaging around connection and disconnection of the proxy diff --git a/packages/da-proxy/src/index.ts b/packages/da-proxy/src/index.ts index 758868847..052dae607 100644 --- a/packages/da-proxy/src/index.ts +++ b/packages/da-proxy/src/index.ts @@ -16,7 +16,7 @@ import { AppSupport } from "./apps/AppSupport"; import { HandshakeSupport } from "./handshake/HandshakeSupport"; import { DefaultHandshakeSupport } from "./handshake/DefaultHandshakeSupport"; -import { Connectable } from "@kite9/fdc3-core"; +import { Connectable } from "@kite9/fdc3-standard"; export { type Messaging, diff --git a/packages/da-proxy/src/intents/DefaultIntentResolution.ts b/packages/da-proxy/src/intents/DefaultIntentResolution.ts index 8f3e62922..29036616a 100644 --- a/packages/da-proxy/src/intents/DefaultIntentResolution.ts +++ b/packages/da-proxy/src/intents/DefaultIntentResolution.ts @@ -1,4 +1,4 @@ -import { AppIdentifier, IntentResolution, IntentResult } from "@kite9/fdc3-core"; +import { AppIdentifier, IntentResolution, IntentResult } from "@kite9/fdc3-standard"; import { Messaging } from "../Messaging"; export class DefaultIntentResolution implements IntentResolution { diff --git a/packages/da-proxy/src/intents/DefaultIntentSupport.ts b/packages/da-proxy/src/intents/DefaultIntentSupport.ts index f40bb280a..164fc3ddf 100644 --- a/packages/da-proxy/src/intents/DefaultIntentSupport.ts +++ b/packages/da-proxy/src/intents/DefaultIntentSupport.ts @@ -1,12 +1,12 @@ -import { Context, AppIntent, AppIdentifier, IntentResolution, IntentHandler, Listener, ResolveError, IntentResult } from "@kite9/fdc3-core"; +import { Context, AppIntent, AppIdentifier, IntentResolution, IntentHandler, Listener, ResolveError, IntentResult } from "@kite9/fdc3-standard"; import { IntentSupport } from "./IntentSupport"; import { Messaging } from "../Messaging"; import { DefaultIntentResolution } from "./DefaultIntentResolution"; import { DefaultIntentListener } from "../listeners/DefaultIntentListener"; -import { IntentResolutionChoice, IntentResolver, RaiseIntentForContextRequest, RaiseIntentForContextResponse } from "@kite9/fdc3-core"; +import { IntentResolutionChoice, IntentResolver, RaiseIntentForContextRequest, RaiseIntentForContextResponse } from "@kite9/fdc3-standard"; import { DefaultChannel } from "../channels/DefaultChannel"; import { DefaultPrivateChannel } from "../channels/DefaultPrivateChannel"; -import { FindIntentRequest, FindIntentResponse, AddContextListenerRequestMeta, FindIntentsByContextRequest, FindIntentsByContextResponse, RaiseIntentRequest, RaiseIntentResultResponse, RaiseIntentResponse } from "@kite9/fdc3-core" +import { FindIntentRequest, FindIntentResponse, AddContextListenerRequestMeta, FindIntentsByContextRequest, FindIntentsByContextResponse, RaiseIntentRequest, RaiseIntentResultResponse, RaiseIntentResponse } from "@kite9/fdc3-standard" function convertIntentResult(m: RaiseIntentResultResponse, messaging: Messaging): Promise { const result = m.payload.intentResult!! diff --git a/packages/da-proxy/src/intents/IntentSupport.ts b/packages/da-proxy/src/intents/IntentSupport.ts index 9d336fa04..381c5d7ee 100644 --- a/packages/da-proxy/src/intents/IntentSupport.ts +++ b/packages/da-proxy/src/intents/IntentSupport.ts @@ -1,4 +1,4 @@ -import { AppIdentifier, AppIntent, Context, IntentHandler, IntentResolution, Listener } from "@kite9/fdc3-core"; +import { AppIdentifier, AppIntent, Context, IntentHandler, IntentResolution, Listener } from "@kite9/fdc3-standard"; export interface IntentSupport { diff --git a/packages/da-proxy/src/listeners/DefaultContextListener.ts b/packages/da-proxy/src/listeners/DefaultContextListener.ts index 7153d604c..722aba80f 100644 --- a/packages/da-proxy/src/listeners/DefaultContextListener.ts +++ b/packages/da-proxy/src/listeners/DefaultContextListener.ts @@ -1,7 +1,7 @@ -import { ContextHandler, Channel } from "@kite9/fdc3-core"; +import { ContextHandler, Channel } from "@kite9/fdc3-standard"; import { Messaging } from "../Messaging"; import { AbstractListener } from "./AbstractListener"; -import { BroadcastEvent } from "@kite9/fdc3-core"; +import { BroadcastEvent } from "@kite9/fdc3-standard"; import { FollowingContextListener } from "./FollowingContextListener"; export class DefaultContextListener extends AbstractListener implements FollowingContextListener { diff --git a/packages/da-proxy/src/listeners/DefaultIntentListener.ts b/packages/da-proxy/src/listeners/DefaultIntentListener.ts index f230898f9..92fc85cbb 100644 --- a/packages/da-proxy/src/listeners/DefaultIntentListener.ts +++ b/packages/da-proxy/src/listeners/DefaultIntentListener.ts @@ -1,7 +1,7 @@ -import { IntentHandler, IntentResult, AppIdentifier, Context } from "@kite9/fdc3-core"; +import { IntentHandler, IntentResult, AppIdentifier, Context } from "@kite9/fdc3-standard"; import { Messaging } from "../Messaging"; import { AbstractListener } from "./AbstractListener"; -import { RaiseIntentResponse, IntentResultResponse, FluffyIntentResult as BridgeIntentResult, IntentEvent, IntentResultRequest } from "@kite9/fdc3-core" +import { RaiseIntentResponse, IntentResultResponse, FluffyIntentResult as BridgeIntentResult, IntentEvent, IntentResultRequest } from "@kite9/fdc3-standard" export class DefaultIntentListener extends AbstractListener { diff --git a/packages/da-proxy/src/listeners/PrivateChannelEventListener.ts b/packages/da-proxy/src/listeners/PrivateChannelEventListener.ts index 687b20998..1cef31c02 100644 --- a/packages/da-proxy/src/listeners/PrivateChannelEventListener.ts +++ b/packages/da-proxy/src/listeners/PrivateChannelEventListener.ts @@ -1,6 +1,6 @@ import { Messaging } from "../Messaging" import { AbstractListener } from "./AbstractListener" -import { BroadcastEvent } from "@kite9/fdc3-core" +import { BroadcastEvent } from "@kite9/fdc3-standard" type EVENT_TYPES_WITH_TYPE_HANDLER = "onAddContextListener" | "onUnsubscribe" export type EVENT_TYPES = EVENT_TYPES_WITH_TYPE_HANDLER | "onDisconnect" diff --git a/packages/da-proxy/src/listeners/RegisterableListener.ts b/packages/da-proxy/src/listeners/RegisterableListener.ts index ec5936261..c3e425915 100644 --- a/packages/da-proxy/src/listeners/RegisterableListener.ts +++ b/packages/da-proxy/src/listeners/RegisterableListener.ts @@ -1,4 +1,4 @@ -import { Listener } from "@kite9/fdc3-core"; +import { Listener } from "@kite9/fdc3-standard"; /** * Extends the basic concept of FDC3 listeners to include lifecycle methods. diff --git a/packages/da-proxy/src/messaging/AbstractMessaging.ts b/packages/da-proxy/src/messaging/AbstractMessaging.ts index 105464d70..79a182c6f 100644 --- a/packages/da-proxy/src/messaging/AbstractMessaging.ts +++ b/packages/da-proxy/src/messaging/AbstractMessaging.ts @@ -1,7 +1,7 @@ -import { AppIdentifier, ImplementationMetadata } from "@kite9/fdc3-core"; +import { AppIdentifier, ImplementationMetadata } from "@kite9/fdc3-standard"; import { Messaging } from "../Messaging"; import { RegisterableListener } from "../listeners/RegisterableListener"; -import { GetAgentParams, WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-core"; +import { GetAgentParams, WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-standard"; export abstract class AbstractMessaging implements Messaging { diff --git a/packages/da-proxy/test/step-definitions/channels.steps.ts b/packages/da-proxy/test/step-definitions/channels.steps.ts index 2e2f81313..4c1502a26 100644 --- a/packages/da-proxy/test/step-definitions/channels.steps.ts +++ b/packages/da-proxy/test/step-definitions/channels.steps.ts @@ -2,7 +2,7 @@ import { DataTable, Given, Then, When } from '@cucumber/cucumber' import { Context } from '@kite9/fdc3'; import { handleResolve, matchData } from '@kite9/testing'; import { CustomWorld } from '../world/index'; -import { BroadcastEvent, AgentResponseMessage, ResponseMessageType, PrivateChannelOnUnsubscribeEvent, PrivateChannelOnDisconnectEvent } from '@kite9/fdc3-core' +import { BroadcastEvent, AgentResponseMessage, ResponseMessageType, PrivateChannelOnUnsubscribeEvent, PrivateChannelOnDisconnectEvent } from '@kite9/fdc3-standard' import { CHANNEL_STATE } from '@kite9/testing'; const contextMap: Record = { diff --git a/packages/da-proxy/test/step-definitions/intents.steps.ts b/packages/da-proxy/test/step-definitions/intents.steps.ts index 9e302033e..58271f4f7 100644 --- a/packages/da-proxy/test/step-definitions/intents.steps.ts +++ b/packages/da-proxy/test/step-definitions/intents.steps.ts @@ -1,7 +1,7 @@ import { Given } from '@cucumber/cucumber' import { CustomWorld } from '../world/index'; import { handleResolve } from '@kite9/testing'; -import { IntentEvent } from '@kite9/fdc3-core'; +import { IntentEvent } from '@kite9/fdc3-standard'; import { Context, ContextMetadata } from '@kite9/fdc3'; Given("app {string}", function (this: CustomWorld, appStr: string) { diff --git a/packages/da-proxy/test/support/TestMessaging.ts b/packages/da-proxy/test/support/TestMessaging.ts index 87bc4db88..b19727dd9 100644 --- a/packages/da-proxy/test/support/TestMessaging.ts +++ b/packages/da-proxy/test/support/TestMessaging.ts @@ -1,5 +1,5 @@ -import { AppIdentifier, Context, Channel } from "@kite9/fdc3-core"; -import { AppRequestMessage, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-core"; +import { AppIdentifier, Context, Channel } from "@kite9/fdc3-standard"; +import { AppRequestMessage, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-standard"; import { v4 as uuidv4 } from 'uuid' import { AbstractMessaging } from "../../src/messaging/AbstractMessaging"; import { RegisterableListener } from "../../src/listeners/RegisterableListener"; diff --git a/packages/da-proxy/test/support/responses/ChannelState.ts b/packages/da-proxy/test/support/responses/ChannelState.ts index efc837ff2..a9a3252e0 100644 --- a/packages/da-proxy/test/support/responses/ChannelState.ts +++ b/packages/da-proxy/test/support/responses/ChannelState.ts @@ -8,7 +8,7 @@ import { GetCurrentContextRequest, GetCurrentContextResponse, BroadcastRequest, BroadcastResponse, AgentResponseMessage, Context -} from "@kite9/fdc3-core"; +} from "@kite9/fdc3-standard"; import { createResponseMeta } from "./support"; import { v4 as uuidv4 } from 'uuid' diff --git a/packages/da-proxy/test/support/responses/CreatePrivateChannel.ts b/packages/da-proxy/test/support/responses/CreatePrivateChannel.ts index b11dc4817..ebc5f7944 100644 --- a/packages/da-proxy/test/support/responses/CreatePrivateChannel.ts +++ b/packages/da-proxy/test/support/responses/CreatePrivateChannel.ts @@ -1,5 +1,5 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { CreatePrivateChannelRequest, CreatePrivateChannelResponse } from "@kite9/fdc3-core"; +import { CreatePrivateChannelRequest, CreatePrivateChannelResponse } from "@kite9/fdc3-standard"; import { createResponseMeta } from "./support"; import { v4 as uuidv4 } from 'uuid' diff --git a/packages/da-proxy/test/support/responses/DisconnectPrivateChannel.ts b/packages/da-proxy/test/support/responses/DisconnectPrivateChannel.ts index a4e605af4..a295debd7 100644 --- a/packages/da-proxy/test/support/responses/DisconnectPrivateChannel.ts +++ b/packages/da-proxy/test/support/responses/DisconnectPrivateChannel.ts @@ -1,5 +1,5 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse } from "@kite9/fdc3-core"; +import { PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse } from "@kite9/fdc3-standard"; import { createResponseMeta } from "./support"; export class DisconnectPrivateChannel implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/FindInstances.ts b/packages/da-proxy/test/support/responses/FindInstances.ts index 9a02cab66..a1f72eef7 100644 --- a/packages/da-proxy/test/support/responses/FindInstances.ts +++ b/packages/da-proxy/test/support/responses/FindInstances.ts @@ -1,5 +1,5 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { FindInstancesRequest, FindInstancesResponse } from "@kite9/fdc3-core"; +import { FindInstancesRequest, FindInstancesResponse } from "@kite9/fdc3-standard"; export class FindInstances implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/FindIntent.ts b/packages/da-proxy/test/support/responses/FindIntent.ts index b25fa502f..ffbf04dd2 100644 --- a/packages/da-proxy/test/support/responses/FindIntent.ts +++ b/packages/da-proxy/test/support/responses/FindIntent.ts @@ -1,5 +1,5 @@ import { AutomaticResponse, IntentDetail, TestMessaging, intentDetailMatches } from "../TestMessaging"; -import { FindIntentRequest, FindIntentResponse } from "@kite9/fdc3-core"; +import { FindIntentRequest, FindIntentResponse } from "@kite9/fdc3-standard"; export class FindIntent implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/FindIntentByContext.ts b/packages/da-proxy/test/support/responses/FindIntentByContext.ts index 2fad7333b..f4a33a6fc 100644 --- a/packages/da-proxy/test/support/responses/FindIntentByContext.ts +++ b/packages/da-proxy/test/support/responses/FindIntentByContext.ts @@ -1,5 +1,5 @@ import { AutomaticResponse, IntentDetail, TestMessaging, intentDetailMatches } from "../TestMessaging"; -import { FindIntentsByContextRequest, FindIntentsByContextResponse } from "@kite9/fdc3-core"; +import { FindIntentsByContextRequest, FindIntentsByContextResponse } from "@kite9/fdc3-standard"; export class FindIntentByContext implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/GetAppMetadata.ts b/packages/da-proxy/test/support/responses/GetAppMetadata.ts index cd8f79dbd..6f0dfcf9c 100644 --- a/packages/da-proxy/test/support/responses/GetAppMetadata.ts +++ b/packages/da-proxy/test/support/responses/GetAppMetadata.ts @@ -1,5 +1,5 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { GetAppMetadataRequest, GetAppMetadataResponse } from "@kite9/fdc3-core"; +import { GetAppMetadataRequest, GetAppMetadataResponse } from "@kite9/fdc3-standard"; export class GetAppMetadata implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/GetOrCreateChannel.ts b/packages/da-proxy/test/support/responses/GetOrCreateChannel.ts index 1356b363a..cbb231402 100644 --- a/packages/da-proxy/test/support/responses/GetOrCreateChannel.ts +++ b/packages/da-proxy/test/support/responses/GetOrCreateChannel.ts @@ -1,6 +1,6 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { ChannelError } from "@kite9/fdc3-core"; -import { GetOrCreateChannelRequest, GetOrCreateChannelResponse } from "@kite9/fdc3-core" +import { ChannelError } from "@kite9/fdc3-standard"; +import { GetOrCreateChannelRequest, GetOrCreateChannelResponse } from "@kite9/fdc3-standard" import { createResponseMeta } from "./support"; type ChannelType = { [channelId: string]: 'user' | 'app' | 'private' } diff --git a/packages/da-proxy/test/support/responses/GetUserChannels.ts b/packages/da-proxy/test/support/responses/GetUserChannels.ts index 2cb7d7985..08bf6bcf1 100644 --- a/packages/da-proxy/test/support/responses/GetUserChannels.ts +++ b/packages/da-proxy/test/support/responses/GetUserChannels.ts @@ -1,5 +1,5 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { GetUserChannelsRequest, GetUserChannelsResponse, Channel } from "@kite9/fdc3-core"; +import { GetUserChannelsRequest, GetUserChannelsResponse, Channel } from "@kite9/fdc3-standard"; import { createResponseMeta } from "./support"; export class GetUserChannels implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/Handshake.ts b/packages/da-proxy/test/support/responses/Handshake.ts index 7a3de51e6..ea44ab1a2 100644 --- a/packages/da-proxy/test/support/responses/Handshake.ts +++ b/packages/da-proxy/test/support/responses/Handshake.ts @@ -1,5 +1,5 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-core"; +import { WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-standard"; export class Handshake implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/IntentResult.ts b/packages/da-proxy/test/support/responses/IntentResult.ts index 46da60d68..566615105 100644 --- a/packages/da-proxy/test/support/responses/IntentResult.ts +++ b/packages/da-proxy/test/support/responses/IntentResult.ts @@ -1,5 +1,5 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { IntentResultRequest, IntentResultResponse } from "@kite9/fdc3-core"; +import { IntentResultRequest, IntentResultResponse } from "@kite9/fdc3-standard"; export class IntentResult implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/Open.ts b/packages/da-proxy/test/support/responses/Open.ts index 1a2ccf701..91872bb79 100644 --- a/packages/da-proxy/test/support/responses/Open.ts +++ b/packages/da-proxy/test/support/responses/Open.ts @@ -1,5 +1,5 @@ import { AutomaticResponse, IntentDetail, TestMessaging } from "../TestMessaging"; -import { OpenRequest, OpenResponse } from "@kite9/fdc3-core"; +import { OpenRequest, OpenResponse } from "@kite9/fdc3-standard"; export class Open implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/RaiseIntent.ts b/packages/da-proxy/test/support/responses/RaiseIntent.ts index 2b4601aa5..c9509e2ee 100644 --- a/packages/da-proxy/test/support/responses/RaiseIntent.ts +++ b/packages/da-proxy/test/support/responses/RaiseIntent.ts @@ -1,6 +1,6 @@ import { AutomaticResponse, IntentDetail, intentDetailMatches, TestMessaging } from "../TestMessaging"; -import { RaiseIntentRequest, RaiseIntentResponse, RaiseIntentResultResponse } from "@kite9/fdc3-core"; -import { ResolveError } from "@kite9/fdc3-core" +import { RaiseIntentRequest, RaiseIntentResponse, RaiseIntentResultResponse } from "@kite9/fdc3-standard"; +import { ResolveError } from "@kite9/fdc3-standard" export class RaiseIntent implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/RaiseIntentForContext.ts b/packages/da-proxy/test/support/responses/RaiseIntentForContext.ts index e2c0fa6d4..a6c21236d 100644 --- a/packages/da-proxy/test/support/responses/RaiseIntentForContext.ts +++ b/packages/da-proxy/test/support/responses/RaiseIntentForContext.ts @@ -1,6 +1,6 @@ import { AutomaticResponse, IntentDetail, intentDetailMatches, TestMessaging } from "../TestMessaging"; -import { RaiseIntentForContextRequest, RaiseIntentForContextResponse, RaiseIntentResultResponse } from "@kite9/fdc3-core"; -import { ResolveError } from "@kite9/fdc3-core" +import { RaiseIntentForContextRequest, RaiseIntentForContextResponse, RaiseIntentResultResponse } from "@kite9/fdc3-standard"; +import { ResolveError } from "@kite9/fdc3-standard" export class RaiseIntentForContext implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/support.ts b/packages/da-proxy/test/support/responses/support.ts index 6327d3846..5a361e804 100644 --- a/packages/da-proxy/test/support/responses/support.ts +++ b/packages/da-proxy/test/support/responses/support.ts @@ -1,4 +1,4 @@ -import { AppRequestMessageMeta, AgentResponseMessageMeta } from '@kite9/fdc3-core' +import { AppRequestMessageMeta, AgentResponseMessageMeta } from '@kite9/fdc3-standard' import { v4 as uuidv4 } from 'uuid' export function createResponseMeta(m: AppRequestMessageMeta): AgentResponseMessageMeta { diff --git a/packages/da-proxy/tsconfig.json b/packages/da-proxy/tsconfig.json index 946b19f42..dfba07e10 100644 --- a/packages/da-proxy/tsconfig.json +++ b/packages/da-proxy/tsconfig.json @@ -16,7 +16,7 @@ ], "references": [ { - "path": "../fdc3-core" + "path": "../fdc3-standard" }, { "path": "../testing" diff --git a/packages/fdc3-all/package.json b/packages/fdc3-all/package.json index f174c51c2..cc2288172 100644 --- a/packages/fdc3-all/package.json +++ b/packages/fdc3-all/package.json @@ -1,5 +1,5 @@ { - "name": "@kite9/fdc3-core", + "name": "@kite9/fdc3-standard", "version": "2.2.0-beta.6", "author": "Fintech Open Source Foundation (FINOS)", "homepage": "https://fdc3.finos.org", diff --git a/packages/fdc3-get-agent/package.json b/packages/fdc3-get-agent/package.json index 6bce122b5..4d82239ad 100644 --- a/packages/fdc3-get-agent/package.json +++ b/packages/fdc3-get-agent/package.json @@ -12,7 +12,7 @@ "clean": "rimraf dist; rimraf cucumber-report.html; rimraf coverage; rimraf .nyc_output; rimraf node_modules" }, "dependencies": { - "@kite9/fdc3-core": "2.2.0-beta.6", + "@kite9/fdc3-standard": "2.2.0-beta.6", "@kite9/da-proxy": "2.2.0-beta.6", "@types/uuid": "^10.0.0", "uuid": "^9.0.1" diff --git a/packages/fdc3-get-agent/src/apps/NoopAppSupport.ts b/packages/fdc3-get-agent/src/apps/NoopAppSupport.ts index f54c99006..76088de8b 100644 --- a/packages/fdc3-get-agent/src/apps/NoopAppSupport.ts +++ b/packages/fdc3-get-agent/src/apps/NoopAppSupport.ts @@ -1,4 +1,4 @@ -import { AppIdentifier, AppMetadata } from "@kite9/fdc3-core"; +import { AppIdentifier, AppMetadata } from "@kite9/fdc3-standard"; import { Messaging } from "@kite9/da-proxy"; import { DefaultAppSupport } from "@kite9/da-proxy"; diff --git a/packages/fdc3-get-agent/src/index.ts b/packages/fdc3-get-agent/src/index.ts index 4b201ab5a..bae3848f3 100644 --- a/packages/fdc3-get-agent/src/index.ts +++ b/packages/fdc3-get-agent/src/index.ts @@ -1,4 +1,4 @@ -import { DesktopAgent, getAgent as getAgentType, GetAgentParams } from '@kite9/fdc3-core' +import { DesktopAgent, getAgent as getAgentType, GetAgentParams } from '@kite9/fdc3-standard' import { ElectronEventLoader } from './strategies/ElectronEventLoader' import { handleWindowProxy, PostMessageLoader } from './strategies/PostMessageLoader' import { TimeoutLoader } from './strategies/TimeoutLoader' diff --git a/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts b/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts index d7c22eb13..8c1daac23 100644 --- a/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts +++ b/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts @@ -1,4 +1,4 @@ -import { DesktopAgentDetails, WebDesktopAgentType, GetAgentParams, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-core"; +import { DesktopAgentDetails, WebDesktopAgentType, GetAgentParams, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-standard"; import { RegisterableListener, AbstractMessaging } from "@kite9/da-proxy"; export const DESKTOP_AGENT_SESSION_STORAGE_DETAILS_KEY = "fdc3-desktop-agent-details" diff --git a/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts b/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts index 146d264af..cc62eaa8f 100644 --- a/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts +++ b/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts @@ -1,6 +1,6 @@ import { AbstractWebMessaging } from './AbstractWebMessaging' import { RegisterableListener } from "@kite9/da-proxy" -import { GetAgentParams, WebConnectionProtocol3Handshake } from "@kite9/fdc3-core" +import { GetAgentParams, WebConnectionProtocol3Handshake } from "@kite9/fdc3-standard" import { v4 as uuidv4 } from "uuid" /** diff --git a/packages/fdc3-get-agent/src/messaging/message-port.ts b/packages/fdc3-get-agent/src/messaging/message-port.ts index bd489743a..991e41a6b 100644 --- a/packages/fdc3-get-agent/src/messaging/message-port.ts +++ b/packages/fdc3-get-agent/src/messaging/message-port.ts @@ -1,11 +1,11 @@ -import { DesktopAgent } from "@kite9/fdc3-core"; +import { DesktopAgent } from "@kite9/fdc3-standard"; import { BasicDesktopAgent, DefaultChannelSupport, DefaultAppSupport, DefaultIntentSupport, DefaultHandshakeSupport, ChannelSupport } from "@kite9/da-proxy"; import { ConnectionDetails, MessagePortMessaging } from "./MessagePortMessaging"; import { DefaultDesktopAgentIntentResolver } from "../ui/DefaultDesktopAgentIntentResolver"; import { DefaultDesktopAgentChannelSelector } from "../ui/DefaultDesktopAgentChannelSelector"; import { NullIntentResolver } from "../ui/NullIIntentResolver"; import { NullChannelSelector } from "../ui/NullChannelSelector"; -import { ChannelSelector } from "@kite9/fdc3-core"; +import { ChannelSelector } from "@kite9/fdc3-standard"; /** * Given a message port, constructs a desktop agent to communicate via that. diff --git a/packages/fdc3-get-agent/src/strategies/ElectronEventLoader.ts b/packages/fdc3-get-agent/src/strategies/ElectronEventLoader.ts index bdf5418d6..ad5a7983b 100644 --- a/packages/fdc3-get-agent/src/strategies/ElectronEventLoader.ts +++ b/packages/fdc3-get-agent/src/strategies/ElectronEventLoader.ts @@ -1,5 +1,5 @@ -import { DesktopAgent } from "@kite9/fdc3-core"; -import { GetAgentParams } from "@kite9/fdc3-core"; +import { DesktopAgent } from "@kite9/fdc3-standard"; +import { GetAgentParams } from "@kite9/fdc3-standard"; import { Loader } from "./Loader"; diff --git a/packages/fdc3-get-agent/src/strategies/Loader.ts b/packages/fdc3-get-agent/src/strategies/Loader.ts index 9093471c9..8c105a7d9 100644 --- a/packages/fdc3-get-agent/src/strategies/Loader.ts +++ b/packages/fdc3-get-agent/src/strategies/Loader.ts @@ -1,5 +1,5 @@ -import { DesktopAgent } from "@kite9/fdc3-core" -import { GetAgentParams } from "@kite9/fdc3-core" +import { DesktopAgent } from "@kite9/fdc3-standard" +import { GetAgentParams } from "@kite9/fdc3-standard" /** * Represents the common interface for a loading strategy diff --git a/packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts b/packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts index 9915b71d6..97e4fa0d6 100644 --- a/packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts +++ b/packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts @@ -1,4 +1,4 @@ -import { DesktopAgent, GetAgentParams, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake } from '@kite9/fdc3-core' +import { DesktopAgent, GetAgentParams, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake } from '@kite9/fdc3-standard' import { FDC3_VERSION } from '..'; import { createDesktopAgentAPI } from '../messaging/message-port'; import { v4 as uuidv4 } from "uuid" diff --git a/packages/fdc3-get-agent/src/strategies/TimeoutLoader.ts b/packages/fdc3-get-agent/src/strategies/TimeoutLoader.ts index 4ecd2f181..32dfb939b 100644 --- a/packages/fdc3-get-agent/src/strategies/TimeoutLoader.ts +++ b/packages/fdc3-get-agent/src/strategies/TimeoutLoader.ts @@ -1,4 +1,4 @@ -import { DesktopAgent, GetAgentParams } from "@kite9/fdc3-core"; +import { DesktopAgent, GetAgentParams } from "@kite9/fdc3-standard"; import { Loader } from "./Loader"; diff --git a/packages/fdc3-get-agent/src/strategies/post-message.ts b/packages/fdc3-get-agent/src/strategies/post-message.ts index 9915b71d6..97e4fa0d6 100644 --- a/packages/fdc3-get-agent/src/strategies/post-message.ts +++ b/packages/fdc3-get-agent/src/strategies/post-message.ts @@ -1,4 +1,4 @@ -import { DesktopAgent, GetAgentParams, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake } from '@kite9/fdc3-core' +import { DesktopAgent, GetAgentParams, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake } from '@kite9/fdc3-standard' import { FDC3_VERSION } from '..'; import { createDesktopAgentAPI } from '../messaging/message-port'; import { v4 as uuidv4 } from "uuid" diff --git a/packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts b/packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts index 2054fad33..6861ad073 100644 --- a/packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts +++ b/packages/fdc3-get-agent/src/ui/AbstractUIComponent.ts @@ -1,4 +1,4 @@ -import { Connectable } from "@kite9/fdc3-core"; +import { Connectable } from "@kite9/fdc3-standard"; export interface CSSPositioning { [key: string]: string } diff --git a/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts b/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts index d6909b53d..be1a58035 100644 --- a/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts +++ b/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts @@ -1,5 +1,5 @@ -import { Channel, IframeChannels, IframeChannelSelected } from "@kite9/fdc3-core"; -import { ChannelSelector } from "@kite9/fdc3-core" +import { Channel, IframeChannels, IframeChannelSelected } from "@kite9/fdc3-standard"; +import { ChannelSelector } from "@kite9/fdc3-standard" import { AbstractUIComponent } from "./AbstractUIComponent"; diff --git a/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts b/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts index a159bc437..a95848831 100644 --- a/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts +++ b/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts @@ -1,5 +1,5 @@ -import { AppIntent, IframeResolveAction, Context, IframeResolve } from "@kite9/fdc3-core"; -import { IntentResolver, IntentResolutionChoice } from '@kite9/fdc3-core' +import { AppIntent, IframeResolveAction, Context, IframeResolve } from "@kite9/fdc3-standard"; +import { IntentResolver, IntentResolutionChoice } from '@kite9/fdc3-standard' import { AbstractUIComponent } from "./AbstractUIComponent"; /** diff --git a/packages/fdc3-get-agent/src/ui/NullChannelSelector.ts b/packages/fdc3-get-agent/src/ui/NullChannelSelector.ts index ecc81a8dc..11dc9cb20 100644 --- a/packages/fdc3-get-agent/src/ui/NullChannelSelector.ts +++ b/packages/fdc3-get-agent/src/ui/NullChannelSelector.ts @@ -1,6 +1,6 @@ -import { Channel, } from "@kite9/fdc3-core"; -import { Connectable } from "@kite9/fdc3-core"; -import { ChannelSelector } from "@kite9/fdc3-core"; +import { Channel, } from "@kite9/fdc3-standard"; +import { Connectable } from "@kite9/fdc3-standard"; +import { ChannelSelector } from "@kite9/fdc3-standard"; export class NullChannelSelector implements ChannelSelector, Connectable { diff --git a/packages/fdc3-get-agent/src/ui/NullIIntentResolver.ts b/packages/fdc3-get-agent/src/ui/NullIIntentResolver.ts index cac952160..bbb46e566 100644 --- a/packages/fdc3-get-agent/src/ui/NullIIntentResolver.ts +++ b/packages/fdc3-get-agent/src/ui/NullIIntentResolver.ts @@ -1,5 +1,5 @@ -import { AppIntent, Context } from "@kite9/fdc3-core"; -import { IntentResolver, IntentResolutionChoice } from "@kite9/fdc3-core"; +import { AppIntent, Context } from "@kite9/fdc3-standard"; +import { IntentResolver, IntentResolutionChoice } from "@kite9/fdc3-standard"; export class NullIntentResolver implements IntentResolver { diff --git a/packages/fdc3-get-agent/test/step-definitions/desktop-agent.steps.ts b/packages/fdc3-get-agent/test/step-definitions/desktop-agent.steps.ts index 8bb24d4e7..46481c22d 100644 --- a/packages/fdc3-get-agent/test/step-definitions/desktop-agent.steps.ts +++ b/packages/fdc3-get-agent/test/step-definitions/desktop-agent.steps.ts @@ -3,7 +3,7 @@ import { CustomWorld } from '../world'; import { handleResolve, setupGenericSteps } from '@kite9/testing'; import { MockDocument, MockWindow } from '../support/MockDocument'; import { getAgent } from '../../src'; -import { DesktopAgentDetails, GetAgentParams, WebDesktopAgentType } from '@kite9/fdc3-core'; +import { DesktopAgentDetails, GetAgentParams, WebDesktopAgentType } from '@kite9/fdc3-standard'; import { dummyInstanceId, EMBED_URL, MockFDC3Server } from '../support/MockFDC3Server'; import { MockStorage } from '../support/MockStorage'; import { DesktopAgent, ImplementationMetadata } from '@kite9/fdc3'; diff --git a/packages/fdc3-get-agent/test/support/FrameTypes.ts b/packages/fdc3-get-agent/test/support/FrameTypes.ts index 9cbea7dcc..e5e42155d 100644 --- a/packages/fdc3-get-agent/test/support/FrameTypes.ts +++ b/packages/fdc3-get-agent/test/support/FrameTypes.ts @@ -1,4 +1,4 @@ -import { IframeHello, WebConnectionProtocol3Handshake } from "@kite9/fdc3-core" +import { IframeHello, WebConnectionProtocol3Handshake } from "@kite9/fdc3-standard" import { CustomWorld } from "../world" import { MockWindow } from "./MockDocument" import { CHANNEL_SELECTOR_URL, EMBED_URL, INTENT_RESPOLVER_URL } from "./MockFDC3Server" diff --git a/packages/fdc3-get-agent/test/support/MockDocument.ts b/packages/fdc3-get-agent/test/support/MockDocument.ts index 958f34f9d..5ea67b403 100644 --- a/packages/fdc3-get-agent/test/support/MockDocument.ts +++ b/packages/fdc3-get-agent/test/support/MockDocument.ts @@ -1,6 +1,6 @@ import { CHANNEL_SELECTOR_URL, EMBED_URL, INTENT_RESPOLVER_URL } from "./MockFDC3Server" import { CustomWorld } from "../world" -import { DesktopAgent } from "@kite9/fdc3-core" +import { DesktopAgent } from "@kite9/fdc3-standard" import { handleChannelSelectorComms, handleEmbeddedIframeComms, handleIntentResolverComms } from "./FrameTypes" class MockCSSStyleDeclaration { diff --git a/packages/fdc3-get-agent/test/support/MockFDC3Server.ts b/packages/fdc3-get-agent/test/support/MockFDC3Server.ts index dc786e3c5..35de9699e 100644 --- a/packages/fdc3-get-agent/test/support/MockFDC3Server.ts +++ b/packages/fdc3-get-agent/test/support/MockFDC3Server.ts @@ -1,5 +1,5 @@ import { FDC3Server } from "@kite9/da-server" -import { AppRequestMessage, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake } from "@kite9/fdc3-core" +import { AppRequestMessage, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake } from "@kite9/fdc3-standard" import { TestServerContext } from "./TestServerContext" import { MockWindow } from "./MockDocument" import { AutomaticResponse } from "./responses/AutomaticResponses" diff --git a/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts b/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts index c82c8d3db..015b04db6 100644 --- a/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts +++ b/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts @@ -1,4 +1,4 @@ -import { GetCurrentChannelRequest, GetCurrentChannelResponse } from "@kite9/fdc3-core"; +import { GetCurrentChannelRequest, GetCurrentChannelResponse } from "@kite9/fdc3-standard"; import { TestServerContext } from "../TestServerContext"; import { InstanceID } from "@kite9/da-server"; import { AutomaticResponse } from "./AutomaticResponses"; diff --git a/packages/fdc3-get-agent/test/support/responses/FindIntent.ts b/packages/fdc3-get-agent/test/support/responses/FindIntent.ts index 1a2b5732c..5e66997c0 100644 --- a/packages/fdc3-get-agent/test/support/responses/FindIntent.ts +++ b/packages/fdc3-get-agent/test/support/responses/FindIntent.ts @@ -1,4 +1,4 @@ -import { FindIntentRequest, FindIntentResponse } from "@kite9/fdc3-core"; +import { FindIntentRequest, FindIntentResponse } from "@kite9/fdc3-standard"; import { TestServerContext } from "../TestServerContext"; import { InstanceID } from "@kite9/da-server"; import { AutomaticResponse } from "./AutomaticResponses"; diff --git a/packages/fdc3-get-agent/test/support/responses/Handshake.ts b/packages/fdc3-get-agent/test/support/responses/Handshake.ts index 73aa06432..bf25178e7 100644 --- a/packages/fdc3-get-agent/test/support/responses/Handshake.ts +++ b/packages/fdc3-get-agent/test/support/responses/Handshake.ts @@ -2,7 +2,7 @@ import { TestServerContext } from "../TestServerContext"; import { InstanceID } from "@kite9/da-server"; import { AutomaticResponse } from "./AutomaticResponses"; -import { WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentityFailedResponse, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-core"; +import { WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentityFailedResponse, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-standard"; export const BAD_INSTANCE_ID = "BAD_INSTANCE" diff --git a/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts b/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts index 7e65c5d44..03b777567 100644 --- a/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts +++ b/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts @@ -1,4 +1,4 @@ -import { RaiseIntentRequest, RaiseIntentResponse } from "@kite9/fdc3-core"; +import { RaiseIntentRequest, RaiseIntentResponse } from "@kite9/fdc3-standard"; import { TestServerContext } from "../TestServerContext"; import { InstanceID } from "@kite9/da-server"; import { AutomaticResponse } from "./AutomaticResponses"; diff --git a/packages/fdc3-get-agent/test/support/responses/UserChannels.ts b/packages/fdc3-get-agent/test/support/responses/UserChannels.ts index 32998e876..976167056 100644 --- a/packages/fdc3-get-agent/test/support/responses/UserChannels.ts +++ b/packages/fdc3-get-agent/test/support/responses/UserChannels.ts @@ -1,7 +1,7 @@ import { TestServerContext } from "../TestServerContext"; import { InstanceID } from "@kite9/da-server"; import { AutomaticResponse } from "./AutomaticResponses"; -import { GetUserChannelsRequest, GetUserChannelsResponse } from "@kite9/fdc3-core"; +import { GetUserChannelsRequest, GetUserChannelsResponse } from "@kite9/fdc3-standard"; export const USER_CHANNELS = [ { diff --git a/packages/fdc3-get-agent/tsconfig.json b/packages/fdc3-get-agent/tsconfig.json index 924f412f7..5db9c91a5 100644 --- a/packages/fdc3-get-agent/tsconfig.json +++ b/packages/fdc3-get-agent/tsconfig.json @@ -15,7 +15,7 @@ "path": "../da-proxy" }, { - "path": "../fdc3-core" + "path": "../fdc3-standard" }, { "path": "../testing" diff --git a/packages/fdc3-core/.eslintrc.json b/packages/fdc3-standard/.eslintrc.json similarity index 100% rename from packages/fdc3-core/.eslintrc.json rename to packages/fdc3-standard/.eslintrc.json diff --git a/packages/fdc3-core/jest.config.js b/packages/fdc3-standard/jest.config.js similarity index 100% rename from packages/fdc3-core/jest.config.js rename to packages/fdc3-standard/jest.config.js diff --git a/packages/fdc3-core/package.json b/packages/fdc3-standard/package.json similarity index 97% rename from packages/fdc3-core/package.json rename to packages/fdc3-standard/package.json index 9e8af62d7..3fd37a0ba 100644 --- a/packages/fdc3-core/package.json +++ b/packages/fdc3-standard/package.json @@ -1,5 +1,5 @@ { - "name": "@kite9/fdc3-core", + "name": "@kite9/fdc3-standard", "version": "2.2.0-beta.6", "author": "Fintech Open Source Foundation (FINOS)", "homepage": "https://fdc3.finos.org", diff --git a/packages/fdc3-core/src/api/AppIdentifier.ts b/packages/fdc3-standard/src/api/AppIdentifier.ts similarity index 100% rename from packages/fdc3-core/src/api/AppIdentifier.ts rename to packages/fdc3-standard/src/api/AppIdentifier.ts diff --git a/packages/fdc3-core/src/api/AppIntent.ts b/packages/fdc3-standard/src/api/AppIntent.ts similarity index 100% rename from packages/fdc3-core/src/api/AppIntent.ts rename to packages/fdc3-standard/src/api/AppIntent.ts diff --git a/packages/fdc3-core/src/api/AppMetadata.ts b/packages/fdc3-standard/src/api/AppMetadata.ts similarity index 100% rename from packages/fdc3-core/src/api/AppMetadata.ts rename to packages/fdc3-standard/src/api/AppMetadata.ts diff --git a/packages/fdc3-core/src/api/Channel.ts b/packages/fdc3-standard/src/api/Channel.ts similarity index 100% rename from packages/fdc3-core/src/api/Channel.ts rename to packages/fdc3-standard/src/api/Channel.ts diff --git a/packages/fdc3-core/src/api/ContextMetadata.ts b/packages/fdc3-standard/src/api/ContextMetadata.ts similarity index 100% rename from packages/fdc3-core/src/api/ContextMetadata.ts rename to packages/fdc3-standard/src/api/ContextMetadata.ts diff --git a/packages/fdc3-core/src/api/DesktopAgent.ts b/packages/fdc3-standard/src/api/DesktopAgent.ts similarity index 100% rename from packages/fdc3-core/src/api/DesktopAgent.ts rename to packages/fdc3-standard/src/api/DesktopAgent.ts diff --git a/packages/fdc3-core/src/api/DesktopAgentIdentifier.ts b/packages/fdc3-standard/src/api/DesktopAgentIdentifier.ts similarity index 100% rename from packages/fdc3-core/src/api/DesktopAgentIdentifier.ts rename to packages/fdc3-standard/src/api/DesktopAgentIdentifier.ts diff --git a/packages/fdc3-core/src/api/DisplayMetadata.ts b/packages/fdc3-standard/src/api/DisplayMetadata.ts similarity index 100% rename from packages/fdc3-core/src/api/DisplayMetadata.ts rename to packages/fdc3-standard/src/api/DisplayMetadata.ts diff --git a/packages/fdc3-core/src/api/Errors.ts b/packages/fdc3-standard/src/api/Errors.ts similarity index 100% rename from packages/fdc3-core/src/api/Errors.ts rename to packages/fdc3-standard/src/api/Errors.ts diff --git a/packages/fdc3-core/src/api/Events.ts b/packages/fdc3-standard/src/api/Events.ts similarity index 100% rename from packages/fdc3-core/src/api/Events.ts rename to packages/fdc3-standard/src/api/Events.ts diff --git a/packages/fdc3-core/src/api/GetAgent.ts b/packages/fdc3-standard/src/api/GetAgent.ts similarity index 100% rename from packages/fdc3-core/src/api/GetAgent.ts rename to packages/fdc3-standard/src/api/GetAgent.ts diff --git a/packages/fdc3-core/src/api/Icon.ts b/packages/fdc3-standard/src/api/Icon.ts similarity index 100% rename from packages/fdc3-core/src/api/Icon.ts rename to packages/fdc3-standard/src/api/Icon.ts diff --git a/packages/fdc3-core/src/api/Image.ts b/packages/fdc3-standard/src/api/Image.ts similarity index 100% rename from packages/fdc3-core/src/api/Image.ts rename to packages/fdc3-standard/src/api/Image.ts diff --git a/packages/fdc3-core/src/api/ImplementationMetadata.ts b/packages/fdc3-standard/src/api/ImplementationMetadata.ts similarity index 100% rename from packages/fdc3-core/src/api/ImplementationMetadata.ts rename to packages/fdc3-standard/src/api/ImplementationMetadata.ts diff --git a/packages/fdc3-core/src/api/IntentMetadata.ts b/packages/fdc3-standard/src/api/IntentMetadata.ts similarity index 100% rename from packages/fdc3-core/src/api/IntentMetadata.ts rename to packages/fdc3-standard/src/api/IntentMetadata.ts diff --git a/packages/fdc3-core/src/api/IntentResolution.ts b/packages/fdc3-standard/src/api/IntentResolution.ts similarity index 100% rename from packages/fdc3-core/src/api/IntentResolution.ts rename to packages/fdc3-standard/src/api/IntentResolution.ts diff --git a/packages/fdc3-core/src/api/Listener.ts b/packages/fdc3-standard/src/api/Listener.ts similarity index 100% rename from packages/fdc3-core/src/api/Listener.ts rename to packages/fdc3-standard/src/api/Listener.ts diff --git a/packages/fdc3-core/src/api/Methods.ts b/packages/fdc3-standard/src/api/Methods.ts similarity index 100% rename from packages/fdc3-core/src/api/Methods.ts rename to packages/fdc3-standard/src/api/Methods.ts diff --git a/packages/fdc3-core/src/api/PrivateChannel.ts b/packages/fdc3-standard/src/api/PrivateChannel.ts similarity index 100% rename from packages/fdc3-core/src/api/PrivateChannel.ts rename to packages/fdc3-standard/src/api/PrivateChannel.ts diff --git a/packages/fdc3-core/src/api/RecommendedChannels.ts b/packages/fdc3-standard/src/api/RecommendedChannels.ts similarity index 100% rename from packages/fdc3-core/src/api/RecommendedChannels.ts rename to packages/fdc3-standard/src/api/RecommendedChannels.ts diff --git a/packages/fdc3-core/src/api/Types.ts b/packages/fdc3-standard/src/api/Types.ts similarity index 100% rename from packages/fdc3-core/src/api/Types.ts rename to packages/fdc3-standard/src/api/Types.ts diff --git a/packages/fdc3-core/src/app-directory/specification/appd.schema.json b/packages/fdc3-standard/src/app-directory/specification/appd.schema.json similarity index 100% rename from packages/fdc3-core/src/app-directory/specification/appd.schema.json rename to packages/fdc3-standard/src/app-directory/specification/appd.schema.json diff --git a/packages/fdc3-core/src/app-directory/specification/examples/application/fdc3-workbench.json b/packages/fdc3-standard/src/app-directory/specification/examples/application/fdc3-workbench.json similarity index 100% rename from packages/fdc3-core/src/app-directory/specification/examples/application/fdc3-workbench.json rename to packages/fdc3-standard/src/app-directory/specification/examples/application/fdc3-workbench.json diff --git a/packages/fdc3-core/src/app-directory/specification/examples/application/myApplication.json b/packages/fdc3-standard/src/app-directory/specification/examples/application/myApplication.json similarity index 100% rename from packages/fdc3-core/src/app-directory/specification/examples/application/myApplication.json rename to packages/fdc3-standard/src/app-directory/specification/examples/application/myApplication.json diff --git a/packages/fdc3-core/src/app-directory/specification/test/index.js b/packages/fdc3-standard/src/app-directory/specification/test/index.js similarity index 100% rename from packages/fdc3-core/src/app-directory/specification/test/index.js rename to packages/fdc3-standard/src/app-directory/specification/test/index.js diff --git a/packages/fdc3-core/src/app-directory/specification/test/package-lock.json b/packages/fdc3-standard/src/app-directory/specification/test/package-lock.json similarity index 100% rename from packages/fdc3-core/src/app-directory/specification/test/package-lock.json rename to packages/fdc3-standard/src/app-directory/specification/test/package-lock.json diff --git a/packages/fdc3-core/src/app-directory/specification/test/package.json b/packages/fdc3-standard/src/app-directory/specification/test/package.json similarity index 100% rename from packages/fdc3-core/src/app-directory/specification/test/package.json rename to packages/fdc3-standard/src/app-directory/specification/test/package.json diff --git a/packages/fdc3-core/src/context/ContextType.ts b/packages/fdc3-standard/src/context/ContextType.ts similarity index 100% rename from packages/fdc3-core/src/context/ContextType.ts rename to packages/fdc3-standard/src/context/ContextType.ts diff --git a/packages/fdc3-core/src/index.ts b/packages/fdc3-standard/src/index.ts similarity index 100% rename from packages/fdc3-core/src/index.ts rename to packages/fdc3-standard/src/index.ts diff --git a/packages/fdc3-core/src/intents/Intents.ts b/packages/fdc3-standard/src/intents/Intents.ts similarity index 100% rename from packages/fdc3-core/src/intents/Intents.ts rename to packages/fdc3-standard/src/intents/Intents.ts diff --git a/packages/fdc3-core/src/intents/standard intents.json b/packages/fdc3-standard/src/intents/standard intents.json similarity index 100% rename from packages/fdc3-core/src/intents/standard intents.json rename to packages/fdc3-standard/src/intents/standard intents.json diff --git a/packages/fdc3-core/src/internal/contextConfiguration.ts b/packages/fdc3-standard/src/internal/contextConfiguration.ts similarity index 100% rename from packages/fdc3-core/src/internal/contextConfiguration.ts rename to packages/fdc3-standard/src/internal/contextConfiguration.ts diff --git a/packages/fdc3-core/src/internal/intentConfiguration.ts b/packages/fdc3-standard/src/internal/intentConfiguration.ts similarity index 100% rename from packages/fdc3-core/src/internal/intentConfiguration.ts rename to packages/fdc3-standard/src/internal/intentConfiguration.ts diff --git a/packages/fdc3-core/src/internal/typeHelpers.ts b/packages/fdc3-standard/src/internal/typeHelpers.ts similarity index 100% rename from packages/fdc3-core/src/internal/typeHelpers.ts rename to packages/fdc3-standard/src/internal/typeHelpers.ts diff --git a/packages/fdc3-core/src/protocols/bcp.ts b/packages/fdc3-standard/src/protocols/bcp.ts similarity index 99% rename from packages/fdc3-core/src/protocols/bcp.ts rename to packages/fdc3-standard/src/protocols/bcp.ts index a938a8663..3a617d77f 100644 --- a/packages/fdc3-core/src/protocols/bcp.ts +++ b/packages/fdc3-standard/src/protocols/bcp.ts @@ -1,5 +1,5 @@ /** - * Browser Communication Protocol (BCP) is used for communication between the "@kite9/fdc3-core" library and Browser-Resident DAs. + * Browser Communication Protocol (BCP) is used for communication between the "@kite9/fdc3-standard" library and Browser-Resident DAs. */ import { Context } from '@kite9/fdc3-schema' import { ContextType } from "../context/ContextType"; diff --git a/packages/fdc3-core/src/protocols/wcp.ts b/packages/fdc3-standard/src/protocols/wcp.ts similarity index 94% rename from packages/fdc3-core/src/protocols/wcp.ts rename to packages/fdc3-standard/src/protocols/wcp.ts index 3e0a6ff78..a40d7993c 100644 --- a/packages/fdc3-core/src/protocols/wcp.ts +++ b/packages/fdc3-standard/src/protocols/wcp.ts @@ -1,5 +1,5 @@ /** - * Web Connection Protocol (WCP) is used to establish connectivity between "@kite9/fdc3-core" and Browser-Resident DAs. + * Web Connection Protocol (WCP) is used to establish connectivity between "@kite9/fdc3-standard" and Browser-Resident DAs. */ import { AppMetadata } from "../api/AppMetadata"; diff --git a/packages/fdc3-core/src/ui/ChannelSelector.ts b/packages/fdc3-standard/src/ui/ChannelSelector.ts similarity index 100% rename from packages/fdc3-core/src/ui/ChannelSelector.ts rename to packages/fdc3-standard/src/ui/ChannelSelector.ts diff --git a/packages/fdc3-core/src/ui/Connectable.ts b/packages/fdc3-standard/src/ui/Connectable.ts similarity index 100% rename from packages/fdc3-core/src/ui/Connectable.ts rename to packages/fdc3-standard/src/ui/Connectable.ts diff --git a/packages/fdc3-core/src/ui/IntentResolver.ts b/packages/fdc3-standard/src/ui/IntentResolver.ts similarity index 100% rename from packages/fdc3-core/src/ui/IntentResolver.ts rename to packages/fdc3-standard/src/ui/IntentResolver.ts diff --git a/packages/fdc3-core/test/ContextTypes.test.ts b/packages/fdc3-standard/test/ContextTypes.test.ts similarity index 100% rename from packages/fdc3-core/test/ContextTypes.test.ts rename to packages/fdc3-standard/test/ContextTypes.test.ts diff --git a/packages/fdc3-core/test/Methods.test.ts b/packages/fdc3-standard/test/Methods.test.ts similarity index 100% rename from packages/fdc3-core/test/Methods.test.ts rename to packages/fdc3-standard/test/Methods.test.ts diff --git a/packages/fdc3-core/test/window.test.ts b/packages/fdc3-standard/test/window.test.ts similarity index 100% rename from packages/fdc3-core/test/window.test.ts rename to packages/fdc3-standard/test/window.test.ts diff --git a/packages/fdc3-core/tsconfig.json b/packages/fdc3-standard/tsconfig.json similarity index 100% rename from packages/fdc3-core/tsconfig.json rename to packages/fdc3-standard/tsconfig.json diff --git a/packages/testing/package.json b/packages/testing/package.json index 6d7f2897d..6fbff2679 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -15,7 +15,7 @@ "@cucumber/cucumber": "10.3.1", "@cucumber/html-formatter": "11.0.4", "@cucumber/pretty-formatter": "1.0.1", - "@kite9/fdc3-core": "2.2.0-beta.6", + "@kite9/fdc3-standard": "2.2.0-beta.6", "@types/expect": "24.3.0", "@types/lodash": "4.14.167", "@types/node": "^20.14.11", diff --git a/packages/testing/src/agent/index.ts b/packages/testing/src/agent/index.ts index db2f0b415..eeca2adfa 100644 --- a/packages/testing/src/agent/index.ts +++ b/packages/testing/src/agent/index.ts @@ -1,5 +1,5 @@ -import { AppIntent, Channel, Context, IntentResult } from "@kite9/fdc3-core"; -import { IntentResolver, IntentResolutionChoice, ChannelSelector } from "@kite9/fdc3-core"; +import { AppIntent, Channel, Context, IntentResult } from "@kite9/fdc3-standard"; +import { IntentResolver, IntentResolutionChoice, ChannelSelector } from "@kite9/fdc3-standard"; import { PropsWorld } from "../world"; /** diff --git a/packages/testing/tsconfig.json b/packages/testing/tsconfig.json index 7d59611c0..54616824d 100644 --- a/packages/testing/tsconfig.json +++ b/packages/testing/tsconfig.json @@ -15,7 +15,7 @@ ], "references": [ { - "path": "../fdc3-core" + "path": "../fdc3-standard" } ] } \ No newline at end of file diff --git a/toolbox/fdc3-for-web/da-server/package.json b/toolbox/fdc3-for-web/da-server/package.json index 04eed2870..de912b345 100644 --- a/toolbox/fdc3-for-web/da-server/package.json +++ b/toolbox/fdc3-for-web/da-server/package.json @@ -8,12 +8,12 @@ "types": "dist/src/index.d.ts", "scripts": { "clean": "rimraf dist; rimraf generated; rimraf node_modules; rimraf coverage; rimraf .nyc_output; rimraf cucumber-report.html", - "directory-openapi": "npx openapi-typescript ../../../packages/fdc3-core/src/app-directory/specification/appd.schema.json --output generated/directory-schema.ts", + "directory-openapi": "npx openapi-typescript ../../../packages/fdc3-standard/src/app-directory/specification/appd.schema.json --output generated/directory-schema.ts", "test": "npm run directory-openapi; tsc; nyc --reporter=lcov --reporter=text cucumber-js", "build": "npm run directory-openapi && tsc --module es2022" }, "dependencies": { - "@kite9/fdc3-core": "2.2.0-beta.6", + "@kite9/fdc3-standard": "2.2.0-beta.6", "@types/uuid": "^10.0.0", "uuid": "^9.0.1" }, diff --git a/toolbox/fdc3-for-web/da-server/src/BasicFDC3Server.ts b/toolbox/fdc3-for-web/da-server/src/BasicFDC3Server.ts index c67df7d0d..39c370def 100644 --- a/toolbox/fdc3-for-web/da-server/src/BasicFDC3Server.ts +++ b/toolbox/fdc3-for-web/da-server/src/BasicFDC3Server.ts @@ -4,7 +4,7 @@ import { BroadcastHandler, ChannelState } from "./handlers/BroadcastHandler"; import { IntentHandler } from "./handlers/IntentHandler"; import { Directory } from "./directory/DirectoryInterface"; import { OpenHandler } from "./handlers/OpenHandler"; -import { AppRequestMessage, WebConnectionProtocol4ValidateAppIdentity } from "@kite9/fdc3-core"; +import { AppRequestMessage, WebConnectionProtocol4ValidateAppIdentity } from "@kite9/fdc3-standard"; export interface MessageHandler { diff --git a/toolbox/fdc3-for-web/da-server/src/FDC3Server.ts b/toolbox/fdc3-for-web/da-server/src/FDC3Server.ts index 33f6c481e..7f83ab36a 100644 --- a/toolbox/fdc3-for-web/da-server/src/FDC3Server.ts +++ b/toolbox/fdc3-for-web/da-server/src/FDC3Server.ts @@ -1,4 +1,4 @@ -import { AppRequestMessage } from "@kite9/fdc3-core"; +import { AppRequestMessage } from "@kite9/fdc3-standard"; import { InstanceID } from "./ServerContext"; export interface FDC3Server { diff --git a/toolbox/fdc3-for-web/da-server/src/ServerContext.ts b/toolbox/fdc3-for-web/da-server/src/ServerContext.ts index 1165a8e6e..52b401644 100644 --- a/toolbox/fdc3-for-web/da-server/src/ServerContext.ts +++ b/toolbox/fdc3-for-web/da-server/src/ServerContext.ts @@ -1,5 +1,5 @@ -import { AppIntent, Context } from "@kite9/fdc3-core"; -import { AppIdentifier } from "@kite9/fdc3-core"; +import { AppIntent, Context } from "@kite9/fdc3-standard"; +import { AppIdentifier } from "@kite9/fdc3-standard"; /** diff --git a/toolbox/fdc3-for-web/da-server/src/handlers/BroadcastHandler.ts b/toolbox/fdc3-for-web/da-server/src/handlers/BroadcastHandler.ts index 0ed8cd677..c904d53bd 100644 --- a/toolbox/fdc3-for-web/da-server/src/handlers/BroadcastHandler.ts +++ b/toolbox/fdc3-for-web/da-server/src/handlers/BroadcastHandler.ts @@ -1,6 +1,6 @@ import { MessageHandler } from "../BasicFDC3Server"; import { InstanceID, ServerContext } from "../ServerContext"; -import { AppIdentifier, ChannelError, Context } from "@kite9/fdc3-core"; +import { AppIdentifier, ChannelError, Context } from "@kite9/fdc3-standard"; import { successResponse, errorResponse, onlyUnique } from "./support"; import { PrivateChannelEventListenerTypes, @@ -16,7 +16,7 @@ import { LeaveCurrentChannelRequest, JoinUserChannelRequest, GetCurrentChannelRequest, AgentEventMessage, CreatePrivateChannelRequest, DisplayMetadata -} from "@kite9/fdc3-core"; +} from "@kite9/fdc3-standard"; type ContextListenerRegistration = { appId: string, diff --git a/toolbox/fdc3-for-web/da-server/src/handlers/IntentHandler.ts b/toolbox/fdc3-for-web/da-server/src/handlers/IntentHandler.ts index 5a1b3e4b7..1a9d5eb13 100644 --- a/toolbox/fdc3-for-web/da-server/src/handlers/IntentHandler.ts +++ b/toolbox/fdc3-for-web/da-server/src/handlers/IntentHandler.ts @@ -10,7 +10,7 @@ import { IntentResultRequest, AppIdentifier, Context -} from "@kite9/fdc3-core"; +} from "@kite9/fdc3-standard"; import { errorResponse, errorResponseId, successResponse, successResponseId } from "./support"; diff --git a/toolbox/fdc3-for-web/da-server/src/handlers/OpenHandler.ts b/toolbox/fdc3-for-web/da-server/src/handlers/OpenHandler.ts index 501f22d44..ed194ad4a 100644 --- a/toolbox/fdc3-for-web/da-server/src/handlers/OpenHandler.ts +++ b/toolbox/fdc3-for-web/da-server/src/handlers/OpenHandler.ts @@ -12,7 +12,7 @@ import { WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentityFailedResponse, WebConnectionProtocol5ValidateAppIdentitySuccessResponse -} from "@kite9/fdc3-core"; +} from "@kite9/fdc3-standard"; import { errorResponse, successResponse } from './support' enum AppState { Opening, DeliveringContext, Done } diff --git a/toolbox/fdc3-for-web/da-server/src/handlers/support.ts b/toolbox/fdc3-for-web/da-server/src/handlers/support.ts index b4f593217..d11820921 100644 --- a/toolbox/fdc3-for-web/da-server/src/handlers/support.ts +++ b/toolbox/fdc3-for-web/da-server/src/handlers/support.ts @@ -1,5 +1,5 @@ import { ServerContext } from "../ServerContext"; -import { AgentResponseMessage, AppIdentifier, AppRequestMessage } from "@kite9/fdc3-core"; +import { AgentResponseMessage, AppIdentifier, AppRequestMessage } from "@kite9/fdc3-standard"; export function successResponse(sc: ServerContext, request: AppRequestMessage, to: AppIdentifier, payload: any, type: string) { diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/app-channel.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/app-channel.steps.ts index 548948270..556bb775c 100644 --- a/toolbox/fdc3-for-web/da-server/test/step-definitions/app-channel.steps.ts +++ b/toolbox/fdc3-for-web/da-server/test/step-definitions/app-channel.steps.ts @@ -3,7 +3,7 @@ import { CustomWorld } from '../world'; import { createMeta } from './generic.steps'; import { GetOrCreateChannelRequest -} from '@kite9/fdc3-core' +} from '@kite9/fdc3-standard' import { handleResolve } from "@kite9/testing"; When('{string} creates or gets an app channel called {string}', function (this: CustomWorld, app: string, channel: string) { diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/broadcast.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/broadcast.steps.ts index 06639f7d1..5a94cdd8b 100644 --- a/toolbox/fdc3-for-web/da-server/test/step-definitions/broadcast.steps.ts +++ b/toolbox/fdc3-for-web/da-server/test/step-definitions/broadcast.steps.ts @@ -1,7 +1,7 @@ import { When } from '@cucumber/cucumber' import { CustomWorld } from '../world'; import { createMeta } from './generic.steps'; -import { AddContextListenerRequest, ContextListenerUnsubscribeRequest, BroadcastRequest, GetCurrentContextRequest } from '@kite9/fdc3-core'; +import { AddContextListenerRequest, ContextListenerUnsubscribeRequest, BroadcastRequest, GetCurrentContextRequest } from '@kite9/fdc3-standard'; import { handleResolve } from "@kite9/testing"; import { contextMap } from './generic.steps'; diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/intents.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/intents.steps.ts index edae88b7a..e5e844831 100644 --- a/toolbox/fdc3-for-web/da-server/test/step-definitions/intents.steps.ts +++ b/toolbox/fdc3-for-web/da-server/test/step-definitions/intents.steps.ts @@ -11,7 +11,7 @@ import { RaiseIntentRequest, RaiseIntentForContextRequest, IntentResultRequest -} from "@kite9/fdc3-core"; +} from "@kite9/fdc3-standard"; type ListensFor = { [key: string]: { diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/private-channel.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/private-channel.steps.ts index 96c153141..48b9122ce 100644 --- a/toolbox/fdc3-for-web/da-server/test/step-definitions/private-channel.steps.ts +++ b/toolbox/fdc3-for-web/da-server/test/step-definitions/private-channel.steps.ts @@ -6,7 +6,7 @@ import { PrivateChannelAddEventListenerRequest, PrivateChannelUnsubscribeEventListenerRequest, PrivateChannelDisconnectRequest -} from '@kite9/fdc3-core' +} from '@kite9/fdc3-standard' import { handleResolve } from "@kite9/testing"; When('{string} creates a private channel', function (this: CustomWorld, app: string) { diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/start-app.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/start-app.steps.ts index aa1b3e74c..69766f155 100644 --- a/toolbox/fdc3-for-web/da-server/test/step-definitions/start-app.steps.ts +++ b/toolbox/fdc3-for-web/da-server/test/step-definitions/start-app.steps.ts @@ -2,7 +2,7 @@ import { DataTable, Then, When } from '@cucumber/cucumber' import { CustomWorld } from '../world'; import { contextMap, createMeta } from './generic.steps'; import { matchData } from '@kite9/testing'; -import { OpenRequest, GetAppMetadataRequest, FindInstancesRequest, WebConnectionProtocol4ValidateAppIdentity } from '@kite9/fdc3-core'; +import { OpenRequest, GetAppMetadataRequest, FindInstancesRequest, WebConnectionProtocol4ValidateAppIdentity } from '@kite9/fdc3-standard'; When('{string} is opened with connection id {string}', function (this: CustomWorld, app: string, uuid: string) { const meta = createMeta(this, app) diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/user-channel.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/user-channel.steps.ts index 1c2b91025..de7d2c79a 100644 --- a/toolbox/fdc3-for-web/da-server/test/step-definitions/user-channel.steps.ts +++ b/toolbox/fdc3-for-web/da-server/test/step-definitions/user-channel.steps.ts @@ -7,7 +7,7 @@ import { JoinUserChannelRequest, LeaveCurrentChannelRequest, GetCurrentContextRequest -} from '@kite9/fdc3-core' +} from '@kite9/fdc3-standard' import { handleResolve } from "@kite9/testing"; diff --git a/toolbox/fdc3-for-web/da-server/tsconfig.json b/toolbox/fdc3-for-web/da-server/tsconfig.json index 5ef9cad96..9d572e985 100644 --- a/toolbox/fdc3-for-web/da-server/tsconfig.json +++ b/toolbox/fdc3-for-web/da-server/tsconfig.json @@ -18,7 +18,7 @@ ], "references": [ { - "path": "../../../packages/fdc3-core" + "path": "../../../packages/fdc3-standard" }, { "path": "../../../packages/testing" diff --git a/toolbox/fdc3-for-web/demo/package.json b/toolbox/fdc3-for-web/demo/package.json index fa662d4e7..0ae26fb6e 100644 --- a/toolbox/fdc3-for-web/demo/package.json +++ b/toolbox/fdc3-for-web/demo/package.json @@ -15,7 +15,7 @@ "dependencies": { "@kite9/fdc3-get-agent": "2.2.0-beta.6", "@kite9/da-server": "2.2.0-beta.6", - "@kite9/fdc3-core": "2.2.0-beta.6", + "@kite9/fdc3-standard": "2.2.0-beta.6", "@types/uuid": "^10.0.0", "@types/ws": "^8.5.10", "express": "^4.18.3", diff --git a/toolbox/fdc3-for-web/demo/src/client/da/dummy-desktop-agent.ts b/toolbox/fdc3-for-web/demo/src/client/da/dummy-desktop-agent.ts index a9e43b1c8..579623de1 100644 --- a/toolbox/fdc3-for-web/demo/src/client/da/dummy-desktop-agent.ts +++ b/toolbox/fdc3-for-web/demo/src/client/da/dummy-desktop-agent.ts @@ -4,7 +4,7 @@ import { APP_GOODBYE, APP_HELLO, DA_HELLO, FDC3_APP_EVENT } from "../../message- import { DemoServerContext } from "./DemoServerContext"; import { FDC3_2_1_JSONDirectory } from "./FDC3_2_1_JSONDirectory"; import { DefaultFDC3Server, DirectoryApp, ServerContext } from "@kite9/da-server"; -import { WebConnectionProtocol2LoadURL } from "@kite9/fdc3-core"; +import { WebConnectionProtocol2LoadURL } from "@kite9/fdc3-standard"; import { ChannelState, ChannelType } from "@kite9/da-server/src/handlers/BroadcastHandler"; import { link } from "./util"; diff --git a/toolbox/fdc3-for-web/demo/src/client/ui/channel-selector.ts b/toolbox/fdc3-for-web/demo/src/client/ui/channel-selector.ts index 1156ee0ef..0448dbbe7 100644 --- a/toolbox/fdc3-for-web/demo/src/client/ui/channel-selector.ts +++ b/toolbox/fdc3-for-web/demo/src/client/ui/channel-selector.ts @@ -1,4 +1,4 @@ -import { IframeChannels } from "@kite9/fdc3-core"; +import { IframeChannels } from "@kite9/fdc3-standard"; var channels: any[] = [] var channelId: string | null = null diff --git a/toolbox/fdc3-for-web/demo/src/client/ui/intent-resolver.ts b/toolbox/fdc3-for-web/demo/src/client/ui/intent-resolver.ts index 5310506a8..d0390a528 100644 --- a/toolbox/fdc3-for-web/demo/src/client/ui/intent-resolver.ts +++ b/toolbox/fdc3-for-web/demo/src/client/ui/intent-resolver.ts @@ -1,4 +1,4 @@ -import { AppIdentifier, IframeResolveAction, IframeResolvePayload } from "@kite9/fdc3-core"; +import { AppIdentifier, IframeResolveAction, IframeResolvePayload } from "@kite9/fdc3-standard"; const DEFAULT_COLLAPSED_CSS = { position: "fixed", diff --git a/toolbox/fdc3-for-web/demo/tsconfig.json b/toolbox/fdc3-for-web/demo/tsconfig.json index 4640e702e..21eef46ab 100644 --- a/toolbox/fdc3-for-web/demo/tsconfig.json +++ b/toolbox/fdc3-for-web/demo/tsconfig.json @@ -23,10 +23,10 @@ ], "references": [ { - "path": "../../../packages/fdc3-core" + "path": "../../../packages/fdc3-standard" }, { - "path": "../../../packages/client" + "path": "../../../packages/fdc3-get-agent" }, { "path": "../da-server" diff --git a/toolbox/fdc3-workbench/src/utility/Fdc3Api.ts b/toolbox/fdc3-workbench/src/utility/Fdc3Api.ts index a1ed2cc98..b8ebd15fb 100644 --- a/toolbox/fdc3-workbench/src/utility/Fdc3Api.ts +++ b/toolbox/fdc3-workbench/src/utility/Fdc3Api.ts @@ -2,7 +2,7 @@ * SPDX-License-Identifier: Apache-2.0 * Copyright FINOS FDC3 contributors - see NOTICE file */ -import * as fdc3_2 from "@kite9/fdc3-core"; +import * as fdc3_2 from "@kite9/fdc3-standard"; import * as fdc3_1 from "fdc3-1.2"; import { group } from "console"; import { fdc3Ready } from '@kite9/fdc3-get-agent' From d73ec72cc906e35c3da10a2469f4fc17b059b869 Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 14:54:51 +0100 Subject: [PATCH 10/16] Fixing exports again --- package-lock.json | 24 + package.json | 4 +- packages/da-proxy/src/BasicDesktopAgent.ts | 6 +- packages/da-proxy/src/apps/AppSupport.ts | 3 +- .../da-proxy/src/apps/DefaultAppSupport.ts | 10 +- .../da-proxy/src/channels/DefaultChannel.ts | 11 +- .../src/channels/DefaultChannelSupport.ts | 30 +- .../src/channels/DefaultPrivateChannel.ts | 5 +- .../src/intents/DefaultIntentSupport.ts | 17 +- .../da-proxy/src/intents/IntentSupport.ts | 3 +- .../src/listeners/DefaultContextListener.ts | 4 +- .../src/listeners/DefaultIntentListener.ts | 10 +- .../src/listeners/FollowingContextListener.ts | 2 +- .../listeners/PrivateChannelEventListener.ts | 4 +- .../src/messaging/AbstractMessaging.ts | 8 +- .../test/step-definitions/channels.steps.ts | 8 +- .../test/step-definitions/intents.steps.ts | 3 +- .../da-proxy/test/support/TestMessaging.ts | 8 +- .../test/support/responses/ChannelState.ts | 30 +- .../support/responses/CreatePrivateChannel.ts | 5 +- .../responses/DisconnectPrivateChannel.ts | 5 +- .../test/support/responses/FindInstances.ts | 6 +- .../test/support/responses/FindIntent.ts | 5 +- .../support/responses/FindIntentByContext.ts | 4 +- .../test/support/responses/GetAppMetadata.ts | 5 +- .../support/responses/GetOrCreateChannel.ts | 4 +- .../test/support/responses/GetUserChannels.ts | 6 +- .../test/support/responses/Handshake.ts | 5 +- .../test/support/responses/IntentResult.ts | 5 +- .../da-proxy/test/support/responses/Open.ts | 5 +- .../test/support/responses/RaiseIntent.ts | 8 +- .../responses/RaiseIntentForContext.ts | 6 +- .../test/support/responses/support.ts | 5 +- packages/da-proxy/tsconfig.json | 3 + packages/fdc3-context/.eslintrc.json | 34 + packages/fdc3-context/README-Bridging.md | 53 + packages/fdc3-context/README-Context.md | 52 + .../generated/api/BrowserTypes.ts | 5682 ++++++++++++++++ .../generated/bridging/BridgingTypes.ts | 6058 +++++++++++++++++ .../generated/context/ContextTypes.ts | 2901 ++++++++ packages/fdc3-context/package.json | 42 + packages/fdc3-context/s2tQuicktypeUtil.js | 78 + .../schemas/context/action.schema.json | 0 .../schemas/context/chart.schema.json | 0 .../context/chatInitSettings.schema.json | 0 .../schemas/context/chatMessage.schema.json | 0 .../schemas/context/chatRoom.schema.json | 0 .../context/chatSearchCriteria.schema.json | 0 .../schemas/context/contact.schema.json | 0 .../schemas/context/contactList.schema.json | 0 .../schemas/context/context.schema.json | 0 .../schemas/context/country.schema.json | 0 .../schemas/context/currency.schema.json | 0 .../schemas/context/email.schema.json | 0 .../schemas/context/instrument.schema.json | 0 .../context/instrumentList.schema.json | 0 .../schemas/context/interaction.schema.json | 0 .../schemas/context/message.schema.json | 0 .../schemas/context/nothing.schema.json | 0 .../schemas/context/order.schema.json | 0 .../schemas/context/orderList.schema.json | 0 .../schemas/context/organization.schema.json | 0 .../schemas/context/portfolio.schema.json | 0 .../schemas/context/position.schema.json | 0 .../schemas/context/product.schema.json | 0 .../schemas/context/timeRange.schema.json | 0 .../schemas/context/trade.schema.json | 0 .../schemas/context/tradeList.schema.json | 0 .../context/transactionresult.schema.json | 0 .../schemas/context/valuation.schema.json | 0 packages/fdc3-context/src/index.ts | 1 + packages/fdc3-context/tsconfig.json | 19 + packages/fdc3-schema/package.json | 3 +- packages/fdc3-schema/src/index.ts | 19 +- packages/fdc3-standard/package.json | 3 +- packages/fdc3-standard/src/api/Channel.ts | 2 +- .../fdc3-standard/src/api/DesktopAgent.ts | 2 +- packages/fdc3-standard/src/api/Methods.ts | 2 +- packages/fdc3-standard/src/api/Types.ts | 2 +- packages/fdc3-standard/src/index.ts | 32 +- packages/fdc3-standard/src/protocols/bcp.ts | 2 +- .../fdc3-standard/src/ui/IntentResolver.ts | 2 +- packages/fdc3-standard/tsconfig.json | 9 +- packages/{fdc3-all => fdc3}/package.json | 8 +- packages/{fdc3-all => fdc3}/rollup.config.js | 0 packages/fdc3/src/index.ts | 21 + packages/{fdc3-all => fdc3}/tsconfig.json | 0 packages/testing/src/agent/index.ts | 3 +- packages/testing/src/steps/generic.steps.ts | 3 +- 89 files changed, 15194 insertions(+), 106 deletions(-) create mode 100644 packages/fdc3-context/.eslintrc.json create mode 100644 packages/fdc3-context/README-Bridging.md create mode 100644 packages/fdc3-context/README-Context.md create mode 100644 packages/fdc3-context/generated/api/BrowserTypes.ts create mode 100644 packages/fdc3-context/generated/bridging/BridgingTypes.ts create mode 100644 packages/fdc3-context/generated/context/ContextTypes.ts create mode 100644 packages/fdc3-context/package.json create mode 100644 packages/fdc3-context/s2tQuicktypeUtil.js rename packages/{fdc3-schema => fdc3-context}/schemas/context/action.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/chart.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/chatInitSettings.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/chatMessage.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/chatRoom.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/chatSearchCriteria.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/contact.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/contactList.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/context.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/country.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/currency.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/email.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/instrument.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/instrumentList.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/interaction.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/message.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/nothing.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/order.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/orderList.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/organization.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/portfolio.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/position.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/product.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/timeRange.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/trade.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/tradeList.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/transactionresult.schema.json (100%) rename packages/{fdc3-schema => fdc3-context}/schemas/context/valuation.schema.json (100%) create mode 100644 packages/fdc3-context/src/index.ts create mode 100644 packages/fdc3-context/tsconfig.json rename packages/{fdc3-all => fdc3}/package.json (92%) rename packages/{fdc3-all => fdc3}/rollup.config.js (100%) create mode 100644 packages/fdc3/src/index.ts rename packages/{fdc3-all => fdc3}/tsconfig.json (100%) diff --git a/package-lock.json b/package-lock.json index 3ea5077fc..905e75f88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "Apache-2.0", "workspaces": [ "packages/fdc3-schema", + "packages/fdc3-context", "packages/fdc3-standard", "packages/testing", "packages/da-proxy", @@ -3420,6 +3421,10 @@ "@kite9/fdc3": "2.2.0-beta.6" } }, + "node_modules/@kite9/fdc3-context": { + "resolved": "packages/fdc3-context", + "link": true + }, "node_modules/@kite9/fdc3-get-agent": { "resolved": "packages/fdc3-get-agent", "link": true @@ -16069,6 +16074,24 @@ "uuid": "^9.0.1" } }, + "packages/fdc3-context": { + "version": "2.2.0-beta.6", + "license": "Apache-2.0", + "devDependencies": { + "@types/jest": "29.5.12", + "@typescript-eslint/eslint-plugin": "7.1.1", + "@typescript-eslint/parser": "7.1.0", + "eslint": "8.57.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-jest": "27.9.0", + "eslint-plugin-jsx-a11y": "^6.8.0", + "quicktype": "23.0.78", + "rimraf": "^6.0.1", + "ts-jest": "29.1.2", + "tslib": "^2.0.1", + "typescript": "^5.3.2" + } + }, "packages/fdc3-get-agent": { "version": "2.2.0-beta.6", "dependencies": { @@ -16114,6 +16137,7 @@ "version": "2.2.0-beta.6", "license": "Apache-2.0", "dependencies": { + "@kite9/fdc3-context": "2.2.0-beta.6", "@kite9/fdc3-schema": "2.2.0-beta.6" }, "devDependencies": { diff --git a/package.json b/package.json index a296a719e..f2a17b4c3 100644 --- a/package.json +++ b/package.json @@ -19,13 +19,15 @@ ], "workspaces": [ "packages/fdc3-schema", + "packages/fdc3-context", "packages/fdc3-standard", "packages/testing", "packages/da-proxy", "toolbox/fdc3-for-web/da-server", "packages/fdc3-get-agent", "toolbox/fdc3-for-web/demo", - "toolbox/fdc3-workbench" + "toolbox/fdc3-workbench", + "package/fdc3" ], "scripts": { "clean": "npm run clean --workspaces --if-present", diff --git a/packages/da-proxy/src/BasicDesktopAgent.ts b/packages/da-proxy/src/BasicDesktopAgent.ts index 654920788..bab858927 100644 --- a/packages/da-proxy/src/BasicDesktopAgent.ts +++ b/packages/da-proxy/src/BasicDesktopAgent.ts @@ -1,9 +1,11 @@ -import { AppIdentifier, AppMetadata, Context, ContextHandler, DesktopAgent, EventHandler, FDC3EventType, ImplementationMetadata, IntentHandler, IntentResolution, Listener } from "@kite9/fdc3-standard"; +import { AppIdentifier, AppMetadata, ContextHandler, DesktopAgent, EventHandler, FDC3EventType, ImplementationMetadata, IntentHandler, IntentResolution, Listener } from "@kite9/fdc3-standard"; import { ChannelSupport } from "./channels/ChannelSupport"; import { AppSupport } from "./apps/AppSupport"; import { IntentSupport } from "./intents/IntentSupport"; import { HandshakeSupport } from "./handshake/HandshakeSupport"; -import { DesktopAgentDetails, Connectable } from "@kite9/fdc3-standard" +import { DesktopAgentDetails, Connectable } from "@kite9/fdc3-standard"; +import { Context } from "@kite9/fdc3-context"; + /** * This splits out the functionality of the desktop agent into * app, channels and intents concerns. diff --git a/packages/da-proxy/src/apps/AppSupport.ts b/packages/da-proxy/src/apps/AppSupport.ts index 771b04c1d..faa61e9c8 100644 --- a/packages/da-proxy/src/apps/AppSupport.ts +++ b/packages/da-proxy/src/apps/AppSupport.ts @@ -1,4 +1,5 @@ -import { AppIdentifier, AppMetadata, Context } from "@kite9/fdc3-standard"; +import { AppIdentifier, AppMetadata } from "@kite9/fdc3-standard"; +import { Context } from "@kite9/fdc3-context"; export interface AppSupport { diff --git a/packages/da-proxy/src/apps/DefaultAppSupport.ts b/packages/da-proxy/src/apps/DefaultAppSupport.ts index b74a9b445..65f151446 100644 --- a/packages/da-proxy/src/apps/DefaultAppSupport.ts +++ b/packages/da-proxy/src/apps/DefaultAppSupport.ts @@ -1,8 +1,14 @@ -import { AppIdentifier, AppMetadata, Context } from "@kite9/fdc3-standard"; +import { AppIdentifier, AppMetadata } from "@kite9/fdc3-standard"; +import { Context } from "@kite9/fdc3-context"; import { AppSupport } from "./AppSupport"; import { Messaging } from "../Messaging"; -import { FindInstancesRequest, GetAppMetadataResponse, FindInstancesResponse, GetAppMetadataRequest, OpenRequest } from "@kite9/fdc3-standard" +import { BrowserTypes } from "@kite9/fdc3-schema" +type FindInstancesRequest = BrowserTypes.FindInstancesRequest +type GetAppMetadataResponse = BrowserTypes.GetAppMetadataResponse +type FindInstancesResponse = BrowserTypes.FindInstancesResponse +type GetAppMetadataRequest = BrowserTypes.GetAppMetadataRequest +type OpenRequest = BrowserTypes.OpenRequest export class DefaultAppSupport implements AppSupport { diff --git a/packages/da-proxy/src/channels/DefaultChannel.ts b/packages/da-proxy/src/channels/DefaultChannel.ts index 1ce0ff262..92e06f5ad 100644 --- a/packages/da-proxy/src/channels/DefaultChannel.ts +++ b/packages/da-proxy/src/channels/DefaultChannel.ts @@ -1,7 +1,14 @@ -import { Context, ContextHandler, DisplayMetadata, Listener, Channel } from "@kite9/fdc3-standard" +import { ContextHandler, DisplayMetadata, Listener, Channel } from "@kite9/fdc3-standard" +import { Context } from "@kite9/fdc3-context"; + import { Messaging } from "../Messaging" import { DefaultContextListener } from "../listeners/DefaultContextListener" -import { BroadcastRequest, BroadcastResponse, GetCurrentContextResponse, GetCurrentContextRequest } from '@kite9/fdc3-standard' +import { BrowserTypes } from "@kite9/fdc3-schema" + +type BroadcastRequest = BrowserTypes.BroadcastRequest +type BroadcastResponse = BrowserTypes.BroadcastResponse +type GetCurrentContextResponse = BrowserTypes.GetCurrentContextResponse +type GetCurrentContextRequest = BrowserTypes.GetCurrentContextRequest export class DefaultChannel implements Channel { diff --git a/packages/da-proxy/src/channels/DefaultChannelSupport.ts b/packages/da-proxy/src/channels/DefaultChannelSupport.ts index 3912940ea..3deaec288 100644 --- a/packages/da-proxy/src/channels/DefaultChannelSupport.ts +++ b/packages/da-proxy/src/channels/DefaultChannelSupport.ts @@ -1,23 +1,27 @@ -import { Channel, ContextHandler, Listener, PrivateChannel } from "@kite9/fdc3-standard"; +import { Channel, ContextHandler, Listener, PrivateChannel, ChannelSelector } from "@kite9/fdc3-standard"; import { Messaging } from "../Messaging"; import { ChannelSupport } from "./ChannelSupport"; import { DefaultPrivateChannel } from "./DefaultPrivateChannel"; import { DefaultChannel } from "./DefaultChannel"; import { DefaultContextListener } from "../listeners/DefaultContextListener"; -import { - Channel as ChannelDetail, -} from '@kite9/fdc3-schema'; -import { - ChannelSelector, - GetUserChannelsRequest, GetUserChannelsResponse, - GetOrCreateChannelResponse, GetOrCreateChannelRequest, - CreatePrivateChannelRequest, CreatePrivateChannelResponse, - JoinUserChannelResponse, JoinUserChannelRequest, - GetCurrentChannelResponse, GetCurrentChannelRequest, - LeaveCurrentChannelRequest, LeaveCurrentChannelResponse, -} from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; import { FollowingContextListener } from "../listeners/FollowingContextListener"; +type ChannelDetail = BrowserTypes.Channel +type GetUserChannelsRequest = BrowserTypes.GetUserChannelsRequest +type GetUserChannelsResponse = BrowserTypes.GetUserChannelsResponse +type GetOrCreateChannelResponse = BrowserTypes.GetOrCreateChannelResponse +type GetOrCreateChannelRequest = BrowserTypes.GetOrCreateChannelRequest +type CreatePrivateChannelRequest = BrowserTypes.CreatePrivateChannelRequest +type CreatePrivateChannelResponse = BrowserTypes.CreatePrivateChannelResponse +type JoinUserChannelResponse = BrowserTypes.JoinUserChannelResponse +type JoinUserChannelRequest = BrowserTypes.JoinUserChannelRequest +type GetCurrentChannelResponse = BrowserTypes.GetCurrentChannelResponse +type GetCurrentChannelRequest = BrowserTypes.GetCurrentChannelRequest +type LeaveCurrentChannelRequest = BrowserTypes.LeaveCurrentChannelRequest +type LeaveCurrentChannelResponse = BrowserTypes.LeaveCurrentChannelResponse + + export class DefaultChannelSupport implements ChannelSupport { diff --git a/packages/da-proxy/src/channels/DefaultPrivateChannel.ts b/packages/da-proxy/src/channels/DefaultPrivateChannel.ts index 8e3e2da0a..3b24f2a43 100644 --- a/packages/da-proxy/src/channels/DefaultPrivateChannel.ts +++ b/packages/da-proxy/src/channels/DefaultPrivateChannel.ts @@ -1,9 +1,12 @@ import { ContextHandler, Listener, PrivateChannel } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; import { DefaultChannel } from "./DefaultChannel"; import { Messaging } from "../Messaging"; import { PrivateChannelEventListenerType, PrivateChannelEventListenerVoid } from "../listeners/PrivateChannelEventListener"; import { DefaultContextListener } from "../listeners/DefaultContextListener"; -import { PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse } from '@kite9/fdc3-standard' + +type PrivateChannelDisconnectRequest = BrowserTypes.PrivateChannelDisconnectRequest +type PrivateChannelDisconnectResponse = BrowserTypes.PrivateChannelDisconnectResponse export class DefaultPrivateChannel extends DefaultChannel implements PrivateChannel { diff --git a/packages/da-proxy/src/intents/DefaultIntentSupport.ts b/packages/da-proxy/src/intents/DefaultIntentSupport.ts index 164fc3ddf..7b600db5e 100644 --- a/packages/da-proxy/src/intents/DefaultIntentSupport.ts +++ b/packages/da-proxy/src/intents/DefaultIntentSupport.ts @@ -1,12 +1,23 @@ -import { Context, AppIntent, AppIdentifier, IntentResolution, IntentHandler, Listener, ResolveError, IntentResult } from "@kite9/fdc3-standard"; +import { AppIntent, AppIdentifier, IntentResolution, IntentHandler, Listener, ResolveError, IntentResult, IntentResolver, IntentResolutionChoice } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; import { IntentSupport } from "./IntentSupport"; import { Messaging } from "../Messaging"; import { DefaultIntentResolution } from "./DefaultIntentResolution"; import { DefaultIntentListener } from "../listeners/DefaultIntentListener"; -import { IntentResolutionChoice, IntentResolver, RaiseIntentForContextRequest, RaiseIntentForContextResponse } from "@kite9/fdc3-standard"; import { DefaultChannel } from "../channels/DefaultChannel"; import { DefaultPrivateChannel } from "../channels/DefaultPrivateChannel"; -import { FindIntentRequest, FindIntentResponse, AddContextListenerRequestMeta, FindIntentsByContextRequest, FindIntentsByContextResponse, RaiseIntentRequest, RaiseIntentResultResponse, RaiseIntentResponse } from "@kite9/fdc3-standard" +import { Context } from "@kite9/fdc3-context"; + +type RaiseIntentForContextRequest = BrowserTypes.RaiseIntentForContextRequest +type RaiseIntentForContextResponse = BrowserTypes.RaiseIntentForContextResponse +type FindIntentResponse = BrowserTypes.FindIntentResponse +type AddContextListenerRequestMeta = BrowserTypes.AddContextListenerRequestMeta +type FindIntentsByContextRequest = BrowserTypes.FindIntentsByContextRequest +type FindIntentsByContextResponse = BrowserTypes.FindIntentsByContextResponse +type RaiseIntentRequest = BrowserTypes.RaiseIntentRequest +type RaiseIntentResultResponse = BrowserTypes.RaiseIntentResultResponse +type RaiseIntentResponse = BrowserTypes.RaiseIntentResponse +type FindIntentRequest = BrowserTypes.FindIntentRequest function convertIntentResult(m: RaiseIntentResultResponse, messaging: Messaging): Promise { const result = m.payload.intentResult!! diff --git a/packages/da-proxy/src/intents/IntentSupport.ts b/packages/da-proxy/src/intents/IntentSupport.ts index 381c5d7ee..952acfb06 100644 --- a/packages/da-proxy/src/intents/IntentSupport.ts +++ b/packages/da-proxy/src/intents/IntentSupport.ts @@ -1,4 +1,5 @@ -import { AppIdentifier, AppIntent, Context, IntentHandler, IntentResolution, Listener } from "@kite9/fdc3-standard"; +import { AppIdentifier, AppIntent, IntentHandler, IntentResolution, Listener } from "@kite9/fdc3-standard"; +import { Context } from "@kite9/fdc3-context"; export interface IntentSupport { diff --git a/packages/da-proxy/src/listeners/DefaultContextListener.ts b/packages/da-proxy/src/listeners/DefaultContextListener.ts index 722aba80f..b522b0296 100644 --- a/packages/da-proxy/src/listeners/DefaultContextListener.ts +++ b/packages/da-proxy/src/listeners/DefaultContextListener.ts @@ -1,9 +1,11 @@ import { ContextHandler, Channel } from "@kite9/fdc3-standard"; import { Messaging } from "../Messaging"; import { AbstractListener } from "./AbstractListener"; -import { BroadcastEvent } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; import { FollowingContextListener } from "./FollowingContextListener"; +type BroadcastEvent = BrowserTypes.BroadcastEvent + export class DefaultContextListener extends AbstractListener implements FollowingContextListener { private channelId: string | null diff --git a/packages/da-proxy/src/listeners/DefaultIntentListener.ts b/packages/da-proxy/src/listeners/DefaultIntentListener.ts index 92fc85cbb..9aa117350 100644 --- a/packages/da-proxy/src/listeners/DefaultIntentListener.ts +++ b/packages/da-proxy/src/listeners/DefaultIntentListener.ts @@ -1,8 +1,14 @@ -import { IntentHandler, IntentResult, AppIdentifier, Context } from "@kite9/fdc3-standard"; +import { IntentHandler, IntentResult, AppIdentifier } from "@kite9/fdc3-standard"; +import { Context } from "@kite9/fdc3-context"; import { Messaging } from "../Messaging"; import { AbstractListener } from "./AbstractListener"; -import { RaiseIntentResponse, IntentResultResponse, FluffyIntentResult as BridgeIntentResult, IntentEvent, IntentResultRequest } from "@kite9/fdc3-standard" +import { BrowserTypes } from "@kite9/fdc3-schema"; +type RaiseIntentResponse = BrowserTypes.RaiseIntentResponse +type IntentResultResponse = BrowserTypes.IntentResultResponse +type BridgeIntentResult = BrowserTypes.FluffyIntentResult +type IntentEvent = BrowserTypes.IntentEvent +type IntentResultRequest = BrowserTypes.IntentResultRequest export class DefaultIntentListener extends AbstractListener { diff --git a/packages/da-proxy/src/listeners/FollowingContextListener.ts b/packages/da-proxy/src/listeners/FollowingContextListener.ts index fa867866b..1d46b8c00 100644 --- a/packages/da-proxy/src/listeners/FollowingContextListener.ts +++ b/packages/da-proxy/src/listeners/FollowingContextListener.ts @@ -1,4 +1,4 @@ -import { Channel, Listener } from '@kite9/fdc3'; +import { Channel, Listener } from '@kite9/fdc3-standard'; import { RegisterableListener } from './RegisterableListener'; /** diff --git a/packages/da-proxy/src/listeners/PrivateChannelEventListener.ts b/packages/da-proxy/src/listeners/PrivateChannelEventListener.ts index 1cef31c02..5a65d10f8 100644 --- a/packages/da-proxy/src/listeners/PrivateChannelEventListener.ts +++ b/packages/da-proxy/src/listeners/PrivateChannelEventListener.ts @@ -1,6 +1,8 @@ import { Messaging } from "../Messaging" import { AbstractListener } from "./AbstractListener" -import { BroadcastEvent } from "@kite9/fdc3-standard" +import { BrowserTypes } from "@kite9/fdc3-schema" + +type BroadcastEvent = BrowserTypes.BroadcastEvent type EVENT_TYPES_WITH_TYPE_HANDLER = "onAddContextListener" | "onUnsubscribe" export type EVENT_TYPES = EVENT_TYPES_WITH_TYPE_HANDLER | "onDisconnect" diff --git a/packages/da-proxy/src/messaging/AbstractMessaging.ts b/packages/da-proxy/src/messaging/AbstractMessaging.ts index 79a182c6f..8738fe0c7 100644 --- a/packages/da-proxy/src/messaging/AbstractMessaging.ts +++ b/packages/da-proxy/src/messaging/AbstractMessaging.ts @@ -1,7 +1,11 @@ -import { AppIdentifier, ImplementationMetadata } from "@kite9/fdc3-standard"; +import { AppIdentifier, ImplementationMetadata, GetAgentParams } from "@kite9/fdc3-standard"; import { Messaging } from "../Messaging"; import { RegisterableListener } from "../listeners/RegisterableListener"; -import { GetAgentParams, WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; + + +type WebConnectionProtocol4ValidateAppIdentity = BrowserTypes.WebConnectionProtocol4ValidateAppIdentity +type WebConnectionProtocol5ValidateAppIdentitySuccessResponse = BrowserTypes.WebConnectionProtocol5ValidateAppIdentitySuccessResponse export abstract class AbstractMessaging implements Messaging { diff --git a/packages/da-proxy/test/step-definitions/channels.steps.ts b/packages/da-proxy/test/step-definitions/channels.steps.ts index 4c1502a26..48c21b597 100644 --- a/packages/da-proxy/test/step-definitions/channels.steps.ts +++ b/packages/da-proxy/test/step-definitions/channels.steps.ts @@ -2,9 +2,15 @@ import { DataTable, Given, Then, When } from '@cucumber/cucumber' import { Context } from '@kite9/fdc3'; import { handleResolve, matchData } from '@kite9/testing'; import { CustomWorld } from '../world/index'; -import { BroadcastEvent, AgentResponseMessage, ResponseMessageType, PrivateChannelOnUnsubscribeEvent, PrivateChannelOnDisconnectEvent } from '@kite9/fdc3-standard' +import { BrowserTypes } from '@kite9/fdc3-schema'; import { CHANNEL_STATE } from '@kite9/testing'; +type BroadcastEvent = BrowserTypes.BroadcastEvent +type AgentResponseMessage = BrowserTypes.AgentResponseMessage +type ResponseMessageType = BrowserTypes.ResponseMessageType +type PrivateChannelOnUnsubscribeEvent = BrowserTypes.PrivateChannelOnUnsubscribeEvent +type PrivateChannelOnDisconnectEvent = BrowserTypes.PrivateChannelOnDisconnectEvent + const contextMap: Record = { "fdc3.instrument": { "type": "fdc3.instrument", diff --git a/packages/da-proxy/test/step-definitions/intents.steps.ts b/packages/da-proxy/test/step-definitions/intents.steps.ts index 58271f4f7..ec26dc5b0 100644 --- a/packages/da-proxy/test/step-definitions/intents.steps.ts +++ b/packages/da-proxy/test/step-definitions/intents.steps.ts @@ -1,8 +1,9 @@ import { Given } from '@cucumber/cucumber' import { CustomWorld } from '../world/index'; import { handleResolve } from '@kite9/testing'; -import { IntentEvent } from '@kite9/fdc3-standard'; +import { BrowserTypes } from '@kite9/fdc3-schema'; import { Context, ContextMetadata } from '@kite9/fdc3'; +type IntentEvent = BrowserTypes.IntentEvent Given("app {string}", function (this: CustomWorld, appStr: string) { const [appId, instanceId] = appStr.split("/") diff --git a/packages/da-proxy/test/support/TestMessaging.ts b/packages/da-proxy/test/support/TestMessaging.ts index b19727dd9..2b0da7434 100644 --- a/packages/da-proxy/test/support/TestMessaging.ts +++ b/packages/da-proxy/test/support/TestMessaging.ts @@ -1,5 +1,5 @@ -import { AppIdentifier, Context, Channel } from "@kite9/fdc3-standard"; -import { AppRequestMessage, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-standard"; +import { AppIdentifier, Channel } from "@kite9/fdc3-standard"; +import { Context } from "@kite9/fdc3-context"; import { v4 as uuidv4 } from 'uuid' import { AbstractMessaging } from "../../src/messaging/AbstractMessaging"; import { RegisterableListener } from "../../src/listeners/RegisterableListener"; @@ -20,6 +20,10 @@ import { CreatePrivateChannel } from "./responses/CreatePrivateChannel"; import { DisconnectPrivateChannel } from "./responses/DisconnectPrivateChannel"; import { IntentResult } from "./responses/IntentResult"; import { RaiseIntentForContext } from "./responses/RaiseIntentForContext"; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type AppRequestMessage = BrowserTypes.AppRequestMessage +type WebConnectionProtocol5ValidateAppIdentitySuccessResponse = BrowserTypes.WebConnectionProtocol5ValidateAppIdentitySuccessResponse export interface IntentDetail { app?: AppIdentifier, diff --git a/packages/da-proxy/test/support/responses/ChannelState.ts b/packages/da-proxy/test/support/responses/ChannelState.ts index a9a3252e0..032e5e602 100644 --- a/packages/da-proxy/test/support/responses/ChannelState.ts +++ b/packages/da-proxy/test/support/responses/ChannelState.ts @@ -1,14 +1,24 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { - JoinUserChannelRequest, JoinUserChannelResponse, - LeaveCurrentChannelResponse, LeaveCurrentChannelRequest, - GetCurrentChannelRequest, GetCurrentChannelResponse, - AddContextListenerRequest, AddContextListenerResponse, - ContextListenerUnsubscribeRequest, ContextListenerUnsubscribeResponse, - GetCurrentContextRequest, GetCurrentContextResponse, - BroadcastRequest, BroadcastResponse, - AgentResponseMessage, Context -} from "@kite9/fdc3-standard"; +import { Context } from "@kite9/fdc3-context"; + +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type JoinUserChannelRequest = BrowserTypes.JoinUserChannelRequest +type JoinUserChannelResponse = BrowserTypes.JoinUserChannelResponse +type LeaveCurrentChannelResponse = BrowserTypes.LeaveCurrentChannelResponse +type LeaveCurrentChannelRequest = BrowserTypes.LeaveCurrentChannelRequest +type GetCurrentChannelRequest = BrowserTypes.GetCurrentChannelRequest +type GetCurrentChannelResponse = BrowserTypes.GetCurrentChannelResponse +type AddContextListenerRequest = BrowserTypes.AddContextListenerRequest +type AddContextListenerResponse = BrowserTypes.AddContextListenerResponse +type ContextListenerUnsubscribeRequest = BrowserTypes.ContextListenerUnsubscribeRequest +type ContextListenerUnsubscribeResponse = BrowserTypes.ContextListenerUnsubscribeResponse +type GetCurrentContextRequest = BrowserTypes.GetCurrentContextRequest +type GetCurrentContextResponse = BrowserTypes.GetCurrentContextResponse +type BroadcastRequest = BrowserTypes.BroadcastRequest +type BroadcastResponse = BrowserTypes.BroadcastResponse +type AgentResponseMessage = BrowserTypes.AgentResponseMessage + import { createResponseMeta } from "./support"; import { v4 as uuidv4 } from 'uuid' diff --git a/packages/da-proxy/test/support/responses/CreatePrivateChannel.ts b/packages/da-proxy/test/support/responses/CreatePrivateChannel.ts index ebc5f7944..e815a69a0 100644 --- a/packages/da-proxy/test/support/responses/CreatePrivateChannel.ts +++ b/packages/da-proxy/test/support/responses/CreatePrivateChannel.ts @@ -1,8 +1,11 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { CreatePrivateChannelRequest, CreatePrivateChannelResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; import { createResponseMeta } from "./support"; import { v4 as uuidv4 } from 'uuid' +type CreatePrivateChannelRequest = BrowserTypes.CreatePrivateChannelRequest +type CreatePrivateChannelResponse = BrowserTypes.CreatePrivateChannelResponse + export class CreatePrivateChannel implements AutomaticResponse { count: number = 0 diff --git a/packages/da-proxy/test/support/responses/DisconnectPrivateChannel.ts b/packages/da-proxy/test/support/responses/DisconnectPrivateChannel.ts index a295debd7..677ad7723 100644 --- a/packages/da-proxy/test/support/responses/DisconnectPrivateChannel.ts +++ b/packages/da-proxy/test/support/responses/DisconnectPrivateChannel.ts @@ -1,7 +1,10 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; import { createResponseMeta } from "./support"; +type PrivateChannelDisconnectRequest = BrowserTypes.PrivateChannelDisconnectRequest +type PrivateChannelDisconnectResponse = BrowserTypes.PrivateChannelDisconnectResponse + export class DisconnectPrivateChannel implements AutomaticResponse { count: number = 0 diff --git a/packages/da-proxy/test/support/responses/FindInstances.ts b/packages/da-proxy/test/support/responses/FindInstances.ts index a1f72eef7..9e3212610 100644 --- a/packages/da-proxy/test/support/responses/FindInstances.ts +++ b/packages/da-proxy/test/support/responses/FindInstances.ts @@ -1,5 +1,9 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { FindInstancesRequest, FindInstancesResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type FindInstancesRequest = BrowserTypes.FindInstancesRequest +type FindInstancesResponse = BrowserTypes.FindInstancesResponse + export class FindInstances implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/FindIntent.ts b/packages/da-proxy/test/support/responses/FindIntent.ts index ffbf04dd2..847e9393f 100644 --- a/packages/da-proxy/test/support/responses/FindIntent.ts +++ b/packages/da-proxy/test/support/responses/FindIntent.ts @@ -1,5 +1,8 @@ import { AutomaticResponse, IntentDetail, TestMessaging, intentDetailMatches } from "../TestMessaging"; -import { FindIntentRequest, FindIntentResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type FindIntentRequest = BrowserTypes.FindIntentRequest +type FindIntentResponse = BrowserTypes.FindIntentResponse export class FindIntent implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/FindIntentByContext.ts b/packages/da-proxy/test/support/responses/FindIntentByContext.ts index f4a33a6fc..d1381d26d 100644 --- a/packages/da-proxy/test/support/responses/FindIntentByContext.ts +++ b/packages/da-proxy/test/support/responses/FindIntentByContext.ts @@ -1,6 +1,8 @@ import { AutomaticResponse, IntentDetail, TestMessaging, intentDetailMatches } from "../TestMessaging"; -import { FindIntentsByContextRequest, FindIntentsByContextResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; +type FindIntentsByContextRequest = BrowserTypes.FindIntentsByContextRequest +type FindIntentsByContextResponse = BrowserTypes.FindIntentsByContextResponse export class FindIntentByContext implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/GetAppMetadata.ts b/packages/da-proxy/test/support/responses/GetAppMetadata.ts index 6f0dfcf9c..5aa6cb72a 100644 --- a/packages/da-proxy/test/support/responses/GetAppMetadata.ts +++ b/packages/da-proxy/test/support/responses/GetAppMetadata.ts @@ -1,5 +1,8 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { GetAppMetadataRequest, GetAppMetadataResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type GetAppMetadataRequest = BrowserTypes.GetAppMetadataRequest +type GetAppMetadataResponse = BrowserTypes.GetAppMetadataResponse export class GetAppMetadata implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/GetOrCreateChannel.ts b/packages/da-proxy/test/support/responses/GetOrCreateChannel.ts index cbb231402..d5a757494 100644 --- a/packages/da-proxy/test/support/responses/GetOrCreateChannel.ts +++ b/packages/da-proxy/test/support/responses/GetOrCreateChannel.ts @@ -1,9 +1,11 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; import { ChannelError } from "@kite9/fdc3-standard"; -import { GetOrCreateChannelRequest, GetOrCreateChannelResponse } from "@kite9/fdc3-standard" +import { BrowserTypes } from "@kite9/fdc3-schema"; import { createResponseMeta } from "./support"; type ChannelType = { [channelId: string]: 'user' | 'app' | 'private' } +type GetOrCreateChannelRequest = BrowserTypes.GetOrCreateChannelRequest +type GetOrCreateChannelResponse = BrowserTypes.GetOrCreateChannelResponse export class GetOrCreateChannel implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/GetUserChannels.ts b/packages/da-proxy/test/support/responses/GetUserChannels.ts index 08bf6bcf1..6f68a8c3e 100644 --- a/packages/da-proxy/test/support/responses/GetUserChannels.ts +++ b/packages/da-proxy/test/support/responses/GetUserChannels.ts @@ -1,7 +1,11 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { GetUserChannelsRequest, GetUserChannelsResponse, Channel } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; import { createResponseMeta } from "./support"; +type GetUserChannelsRequest = BrowserTypes.GetUserChannelsRequest +type GetUserChannelsResponse = BrowserTypes.GetUserChannelsResponse +type Channel = BrowserTypes.Channel + export class GetUserChannels implements AutomaticResponse { filter(t: string) { diff --git a/packages/da-proxy/test/support/responses/Handshake.ts b/packages/da-proxy/test/support/responses/Handshake.ts index ea44ab1a2..f327f222f 100644 --- a/packages/da-proxy/test/support/responses/Handshake.ts +++ b/packages/da-proxy/test/support/responses/Handshake.ts @@ -1,5 +1,8 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type WebConnectionProtocol4ValidateAppIdentity = BrowserTypes.WebConnectionProtocol4ValidateAppIdentity +type WebConnectionProtocol5ValidateAppIdentitySuccessResponse = BrowserTypes.WebConnectionProtocol5ValidateAppIdentitySuccessResponse export class Handshake implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/IntentResult.ts b/packages/da-proxy/test/support/responses/IntentResult.ts index 566615105..eab1f1d9e 100644 --- a/packages/da-proxy/test/support/responses/IntentResult.ts +++ b/packages/da-proxy/test/support/responses/IntentResult.ts @@ -1,5 +1,8 @@ import { AutomaticResponse, TestMessaging } from "../TestMessaging"; -import { IntentResultRequest, IntentResultResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type IntentResultRequest = BrowserTypes.IntentResultRequest +type IntentResultResponse = BrowserTypes.IntentResultResponse export class IntentResult implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/Open.ts b/packages/da-proxy/test/support/responses/Open.ts index 91872bb79..fdd3e11d9 100644 --- a/packages/da-proxy/test/support/responses/Open.ts +++ b/packages/da-proxy/test/support/responses/Open.ts @@ -1,5 +1,8 @@ import { AutomaticResponse, IntentDetail, TestMessaging } from "../TestMessaging"; -import { OpenRequest, OpenResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type OpenRequest = BrowserTypes.OpenRequest +type OpenResponse = BrowserTypes.OpenResponse export class Open implements AutomaticResponse { diff --git a/packages/da-proxy/test/support/responses/RaiseIntent.ts b/packages/da-proxy/test/support/responses/RaiseIntent.ts index c9509e2ee..efb426301 100644 --- a/packages/da-proxy/test/support/responses/RaiseIntent.ts +++ b/packages/da-proxy/test/support/responses/RaiseIntent.ts @@ -1,7 +1,13 @@ import { AutomaticResponse, IntentDetail, intentDetailMatches, TestMessaging } from "../TestMessaging"; -import { RaiseIntentRequest, RaiseIntentResponse, RaiseIntentResultResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; import { ResolveError } from "@kite9/fdc3-standard" +type RaiseIntentRequest = BrowserTypes.RaiseIntentRequest +type RaiseIntentResponse = BrowserTypes.RaiseIntentResponse +type RaiseIntentResultResponse = BrowserTypes.RaiseIntentResultResponse + + + export class RaiseIntent implements AutomaticResponse { filter(t: string) { diff --git a/packages/da-proxy/test/support/responses/RaiseIntentForContext.ts b/packages/da-proxy/test/support/responses/RaiseIntentForContext.ts index a6c21236d..44a130700 100644 --- a/packages/da-proxy/test/support/responses/RaiseIntentForContext.ts +++ b/packages/da-proxy/test/support/responses/RaiseIntentForContext.ts @@ -1,7 +1,11 @@ import { AutomaticResponse, IntentDetail, intentDetailMatches, TestMessaging } from "../TestMessaging"; -import { RaiseIntentForContextRequest, RaiseIntentForContextResponse, RaiseIntentResultResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; import { ResolveError } from "@kite9/fdc3-standard" +type RaiseIntentForContextRequest = BrowserTypes.RaiseIntentForContextRequest +type RaiseIntentForContextResponse = BrowserTypes.RaiseIntentForContextResponse +type RaiseIntentResultResponse = BrowserTypes.RaiseIntentResultResponse + export class RaiseIntentForContext implements AutomaticResponse { filter(t: string) { diff --git a/packages/da-proxy/test/support/responses/support.ts b/packages/da-proxy/test/support/responses/support.ts index 5a361e804..c5b91f08b 100644 --- a/packages/da-proxy/test/support/responses/support.ts +++ b/packages/da-proxy/test/support/responses/support.ts @@ -1,6 +1,9 @@ -import { AppRequestMessageMeta, AgentResponseMessageMeta } from '@kite9/fdc3-standard' +import { BrowserTypes } from "@kite9/fdc3-schema"; import { v4 as uuidv4 } from 'uuid' +type AppRequestMessageMeta = BrowserTypes.AppRequestMessageMeta +type AgentResponseMessageMeta = BrowserTypes.AgentResponseMessageMeta + export function createResponseMeta(m: AppRequestMessageMeta): AgentResponseMessageMeta { return { requestUuid: m.requestUuid, diff --git a/packages/da-proxy/tsconfig.json b/packages/da-proxy/tsconfig.json index dfba07e10..54d31b7af 100644 --- a/packages/da-proxy/tsconfig.json +++ b/packages/da-proxy/tsconfig.json @@ -20,6 +20,9 @@ }, { "path": "../testing" + }, + { + "path": "../fdc3-context" } ] } \ No newline at end of file diff --git a/packages/fdc3-context/.eslintrc.json b/packages/fdc3-context/.eslintrc.json new file mode 100644 index 000000000..ba0d790d7 --- /dev/null +++ b/packages/fdc3-context/.eslintrc.json @@ -0,0 +1,34 @@ +{ + "root": true, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": [ + "./tsconfig.json" + ] + }, + "plugins": [ + "@typescript-eslint", + "jsx-a11y" + ], + "env": { + "browser": true, + "jest": true + }, + "extends": [ + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "prettier" + ], + "rules": { + "@typescript-eslint/adjacent-overload-signatures": "warn", + "@typescript-eslint/no-empty-interface": "warn", + "@typescript-eslint/no-empty-function": "warn", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_" + } + ] + } +} \ No newline at end of file diff --git a/packages/fdc3-context/README-Bridging.md b/packages/fdc3-context/README-Bridging.md new file mode 100644 index 000000000..5626b716a --- /dev/null +++ b/packages/fdc3-context/README-Bridging.md @@ -0,0 +1,53 @@ +# Bridging Message types generation README + +This folder contains Typescript interfaces, in BridgingTypes.ts generated from the context JSONSchema (https://json-schema.org/) files via quicktype (https://quicktype.io/). Source files may also be generated for us in other languages supported by Quicktype. + +Please note that these definitions are provided to help developers working in TypeScript to produce valid bridging messages objects - but should not be considered the 'source of truth' for message definitions (instead look to the schemas and documentation). + +It is not always possible to perfectly replicate a type/interface defined in JSONSchema via TypeScript. Hence, if there is any disagreement between the definitions, the JSON Schema should be assumed to be correct, rather than the TypeScript. For example, JSON Schema may define optional fields on an object + a restriction on the type of additional properties (via `"additionalProperties": { "type": "string"}`), which will result in an index signature `[property: string]: string;` in generated TypeScript. That signature is incompatible with optional properties (including string properties) as they have type `string | undefined`. A similar problem may occur in JSON Schema if the schema is used to create a subtype via composition as `additionalProperties` is not aware of the subschema's definitions. Both issues can be worked around by using `unevaluatedProperties` in the schema, which will defer to the declared type of the optional property in the subschema, but is also currently ignored by Quicktype - resulting in a type that will compile but doesn't restrict the type of optional property values as defined in the schema. + +Further, Quicktype doesn't always perfectly replicate polymorphic fields specified with `oneOf` in JSON Schema as it will usually merge the different objects into a single type (where fields not in one of the constituent schemas become optional) rather than creating a union type. In such situations, the type produced is usable (has all the necessary fields) but may allow the construction of invalid instances which are missing required properties or include properties from the multiple schemas combined, which are not possible/valid according to JSON Schema. + +Hence, the Types provided here can be used to provide valid message objects and to read/write their JSON encodings, but may not detect or prevent a limited set of invalid objects that would be identified by JSON Schema. + +Finally, Quicktype will generate types or interfaces representing subunits of the schema, which are then referenced in the primary interface definition. These often do not have unique names (generated from title fields in the schemas). If a name conflict is encountered, Quicktype will generate a random name for such an interface, to use to reference it, and as it is randomly generated it may appear oddly named (e.g. `PurpleId`, `FluffyMarket`, `TentacledIdentifier` etc.). Please ignore such names as these types/interfaces will not normally be used outside of the composition of the primary type, e.g.: + +```TypeScript +export interface Instrument { + id: StickyId; + market?: FluffyMarket; + type: string; + name?: string; + [property: string]: any; +} + +export interface StickyId { + BBG?: string; + CUSIP?: string; + FDS_ID?: string; + FIGI?: string; + ISIN?: string; + PERMID?: string; + RIC?: string; + SEDOL?: string; + ticker?: string; + [property: string]: any; +} + +export interface FluffyMarket { + BBG?: string; + COUNTRY_ISOALPHA2?: string; + MIC?: string; + name?: string; + [property: string]: any; +} +``` + +and should not be considered a planned part of the type structure (which should not be replicated in any derivative work). When applied, the naming of these sub-units is not used, rather they are replaced with their contents. Generating better names for these sub-units is usually a case of adding or adjusting `title` fields on the relevant elements of the schema documents. + +Finally, please note that the latest version of Quicktype (at the time of writing `23.0.49`) has a number of bugs that must be worked around: + +- Using a directory or .schema.json files as a source will cause the input type argument `-s schema` to be ignored, causing the files to be interpreted as JSON rather than JSON Schema. + - A utility is provided in this repository (_../../quicktypeUtil.js_) to work around this bug by listing directories and constructing a call to quicktype where each file is provided as an individual source. +- Setting the `--nice-property-names` TypeScript output option will crash the generator and can't be used. +- The --debug setting must be the first argument passed or it will be ignored. diff --git a/packages/fdc3-context/README-Context.md b/packages/fdc3-context/README-Context.md new file mode 100644 index 000000000..9fa44276e --- /dev/null +++ b/packages/fdc3-context/README-Context.md @@ -0,0 +1,52 @@ +# Context types generation README + +This folder contains Typescript interfaces, in ContextTypes.ts generated from the context JSONSchema (https://json-schema.org/) files via quicktype (https://quicktype.io/). + +Please note that these definitions are provided to help developers working in TypeScript to produce valid context objects - but should not be considered the 'source of truth' for context definitions (instead look to the schemas and documentation). Source files may also be generated for us in other languages supported by quicktype. + +It is not always possible to perfectly replicate a type/interface defined in JSONSchema via TypeScript. Hence, in the event of any disagreement between the definitions, the JSONSchema should be assumed to be correct, rather than the Typescript. For example, JSONSchema may define optional fields on an object + a restriction on the type of additional properties (via `"additionalProperties": { "type": "string"}`), which will result in an index signature `[property: string]: string;` in generated TypeScript. That signature, is incompatible with with an optional properties (including string properties) as they have type `string | undefined`. A similar problem may occur in JSON Schema if the schema is used to create a subtype via composition as `additionalProperties` is not aware of teh subschema's definitions. Both issues can be worked around by using `unevaluatedProperties` in the schema, which will defer to the declared type of the optional property in the subschema, but is also currently ignored by quicktype - resulting in a type that will compile, but doesn't restrict the type of optional property values as defined in the schema. + +Further, quicktype doesn't always perfectly replicate polymorphic fields specified with `oneOf` in JSONSchema as it will usually merge the different objects into a single type (where fields not in one of the constituent schemas become optional) rather than creating a union type. In such situations, the type produced is usable (has all the necessary fields) but may allow the construction of invalid instances which are missing required properties or include properties from the multiple schemas combined, which are not possible/valid according to JSONSchema. + +Hence, the Types provided here can be used to provide valid Context objects and to read/write their JSON encodings, but may not detect or prevent a limited set of invalid objects that would be identified by JSONSchema. + +Please also note that quicktype will generate types or interfaces representing subunits of the schema, which are then referenced in the main interface definition. These often do not have unique names (e.g. fields of the `id` object in the Context schema, defined for a specific context type such as fdc3.instrument). Quicktype will generate a random name for such an interface, to use to reference it, and as it is randomly generated it may appear oddly named (e.g. `PurpleId`, `FluffyMarket`, `TentacledIdentifier` etc.). Please ignore such names as these types/interfaces will not normally be used outside of the composition of the main type, e.g.: + +```TypeScript +export interface Instrument { + id: StickyId; + market?: FluffyMarket; + type: string; + name?: string; + [property: string]: any; +} + +export interface StickyId { + BBG?: string; + CUSIP?: string; + FDS_ID?: string; + FIGI?: string; + ISIN?: string; + PERMID?: string; + RIC?: string; + SEDOL?: string; + ticker?: string; + [property: string]: any; +} + +export interface FluffyMarket { + BBG?: string; + COUNTRY_ISOALPHA2?: string; + MIC?: string; + name?: string; + [property: string]: any; +} +``` + +and should not be considered a planned part of the type structure (which should not be replicated in any derivative work). When applied, the naming of these sub-units is not used, rather they are replaced with their contents. It is hoped that we will be to generate better names of these sub-units in future. + +Finally, please note that the latest version of quicktype (at the time of writing `23.0.19`) has a number of bugs that must be worked around: + +- Using a directory or .schema.json files as a source will cause the input type argument `-s schema` to be ignored, causing the files to be interpreted as JSON rather than JSON Schema. + - A utility is provided in this repository (_../../quicktypeUtil.js_) to work around this bug by listing directories and constructing a call to quicktype where each file is provided as an individual source. +- Setting the `--nice-property-names` TypeScript output option will crash the generator and can't be used. diff --git a/packages/fdc3-context/generated/api/BrowserTypes.ts b/packages/fdc3-context/generated/api/BrowserTypes.ts new file mode 100644 index 000000000..70b633b13 --- /dev/null +++ b/packages/fdc3-context/generated/api/BrowserTypes.ts @@ -0,0 +1,5682 @@ +// To parse this data: +// +// import { Convert, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake, WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentityFailedResponse, WebConnectionProtocol5ValidateAppIdentitySuccessResponse, WebConnectionProtocol6Goodbye, WebConnectionProtocolMessage, AddContextListenerRequest, AddContextListenerResponse, AddEventListenerEvent, AddEventListenerRequest, AddEventListenerResponse, AddIntentListenerRequest, AddIntentListenerResponse, AgentEventMessage, AgentResponseMessage, AppRequestMessage, BroadcastEvent, BroadcastRequest, BroadcastResponse, ChannelChangedEvent, ContextListenerUnsubscribeRequest, ContextListenerUnsubscribeResponse, CreatePrivateChannelRequest, CreatePrivateChannelResponse, EventListenerUnsubscribeRequest, EventListenerUnsubscribeResponse, FindInstancesRequest, FindInstancesResponse, FindIntentRequest, FindIntentResponse, FindIntentsByContextRequest, FindIntentsByContextResponse, GetAppMetadataRequest, GetAppMetadataResponse, GetCurrentChannelRequest, GetCurrentChannelResponse, GetCurrentContextRequest, GetCurrentContextResponse, GetInfoRequest, GetInfoResponse, GetOrCreateChannelRequest, GetOrCreateChannelResponse, GetUserChannelsRequest, GetUserChannelsResponse, IframeChannelDrag, IframeChannelResize, IframeChannelSelected, IframeChannels, IframeHandshake, IframeHello, IframeMessage, IframeResolve, IframeResolveAction, IntentEvent, IntentListenerUnsubscribeRequest, IntentListenerUnsubscribeResponse, IntentResultRequest, IntentResultResponse, JoinUserChannelRequest, JoinUserChannelResponse, LeaveCurrentChannelRequest, LeaveCurrentChannelResponse, OpenRequest, OpenResponse, PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse, PrivateChannelOnAddContextListenerEvent, PrivateChannelOnDisconnectEvent, PrivateChannelOnUnsubscribeEvent, PrivateChannelUnsubscribeEventListenerRequest, PrivateChannelUnsubscribeEventListenerResponse, PrivateChannelAddEventListenerRequest, PrivateChannelAddEventListenerResponse, RaiseIntentForContextRequest, RaiseIntentForContextResponse, RaiseIntentRequest, RaiseIntentResponse, RaiseIntentResultResponse } from "./file"; +// +// const webConnectionProtocol1Hello = Convert.toWebConnectionProtocol1Hello(json); +// const webConnectionProtocol2LoadURL = Convert.toWebConnectionProtocol2LoadURL(json); +// const webConnectionProtocol3Handshake = Convert.toWebConnectionProtocol3Handshake(json); +// const webConnectionProtocol4ValidateAppIdentity = Convert.toWebConnectionProtocol4ValidateAppIdentity(json); +// const webConnectionProtocol5ValidateAppIdentityFailedResponse = Convert.toWebConnectionProtocol5ValidateAppIdentityFailedResponse(json); +// const webConnectionProtocol5ValidateAppIdentitySuccessResponse = Convert.toWebConnectionProtocol5ValidateAppIdentitySuccessResponse(json); +// const webConnectionProtocol6Goodbye = Convert.toWebConnectionProtocol6Goodbye(json); +// const webConnectionProtocolMessage = Convert.toWebConnectionProtocolMessage(json); +// const addContextListenerRequest = Convert.toAddContextListenerRequest(json); +// const addContextListenerResponse = Convert.toAddContextListenerResponse(json); +// const addEventListenerEvent = Convert.toAddEventListenerEvent(json); +// const addEventListenerRequest = Convert.toAddEventListenerRequest(json); +// const addEventListenerResponse = Convert.toAddEventListenerResponse(json); +// const addIntentListenerRequest = Convert.toAddIntentListenerRequest(json); +// const addIntentListenerResponse = Convert.toAddIntentListenerResponse(json); +// const agentEventMessage = Convert.toAgentEventMessage(json); +// const agentResponseMessage = Convert.toAgentResponseMessage(json); +// const appRequestMessage = Convert.toAppRequestMessage(json); +// const broadcastEvent = Convert.toBroadcastEvent(json); +// const broadcastRequest = Convert.toBroadcastRequest(json); +// const broadcastResponse = Convert.toBroadcastResponse(json); +// const channelChangedEvent = Convert.toChannelChangedEvent(json); +// const contextListenerUnsubscribeRequest = Convert.toContextListenerUnsubscribeRequest(json); +// const contextListenerUnsubscribeResponse = Convert.toContextListenerUnsubscribeResponse(json); +// const createPrivateChannelRequest = Convert.toCreatePrivateChannelRequest(json); +// const createPrivateChannelResponse = Convert.toCreatePrivateChannelResponse(json); +// const eventListenerUnsubscribeRequest = Convert.toEventListenerUnsubscribeRequest(json); +// const eventListenerUnsubscribeResponse = Convert.toEventListenerUnsubscribeResponse(json); +// const findInstancesRequest = Convert.toFindInstancesRequest(json); +// const findInstancesResponse = Convert.toFindInstancesResponse(json); +// const findIntentRequest = Convert.toFindIntentRequest(json); +// const findIntentResponse = Convert.toFindIntentResponse(json); +// const findIntentsByContextRequest = Convert.toFindIntentsByContextRequest(json); +// const findIntentsByContextResponse = Convert.toFindIntentsByContextResponse(json); +// const getAppMetadataRequest = Convert.toGetAppMetadataRequest(json); +// const getAppMetadataResponse = Convert.toGetAppMetadataResponse(json); +// const getCurrentChannelRequest = Convert.toGetCurrentChannelRequest(json); +// const getCurrentChannelResponse = Convert.toGetCurrentChannelResponse(json); +// const getCurrentContextRequest = Convert.toGetCurrentContextRequest(json); +// const getCurrentContextResponse = Convert.toGetCurrentContextResponse(json); +// const getInfoRequest = Convert.toGetInfoRequest(json); +// const getInfoResponse = Convert.toGetInfoResponse(json); +// const getOrCreateChannelRequest = Convert.toGetOrCreateChannelRequest(json); +// const getOrCreateChannelResponse = Convert.toGetOrCreateChannelResponse(json); +// const getUserChannelsRequest = Convert.toGetUserChannelsRequest(json); +// const getUserChannelsResponse = Convert.toGetUserChannelsResponse(json); +// const iframeChannelDrag = Convert.toIframeChannelDrag(json); +// const iframeChannelResize = Convert.toIframeChannelResize(json); +// const iframeChannelSelected = Convert.toIframeChannelSelected(json); +// const iframeChannels = Convert.toIframeChannels(json); +// const iframeHandshake = Convert.toIframeHandshake(json); +// const iframeHello = Convert.toIframeHello(json); +// const iframeMessage = Convert.toIframeMessage(json); +// const iframeResolve = Convert.toIframeResolve(json); +// const iframeResolveAction = Convert.toIframeResolveAction(json); +// const intentEvent = Convert.toIntentEvent(json); +// const intentListenerUnsubscribeRequest = Convert.toIntentListenerUnsubscribeRequest(json); +// const intentListenerUnsubscribeResponse = Convert.toIntentListenerUnsubscribeResponse(json); +// const intentResultRequest = Convert.toIntentResultRequest(json); +// const intentResultResponse = Convert.toIntentResultResponse(json); +// const joinUserChannelRequest = Convert.toJoinUserChannelRequest(json); +// const joinUserChannelResponse = Convert.toJoinUserChannelResponse(json); +// const leaveCurrentChannelRequest = Convert.toLeaveCurrentChannelRequest(json); +// const leaveCurrentChannelResponse = Convert.toLeaveCurrentChannelResponse(json); +// const openRequest = Convert.toOpenRequest(json); +// const openResponse = Convert.toOpenResponse(json); +// const privateChannelDisconnectRequest = Convert.toPrivateChannelDisconnectRequest(json); +// const privateChannelDisconnectResponse = Convert.toPrivateChannelDisconnectResponse(json); +// const privateChannelOnAddContextListenerEvent = Convert.toPrivateChannelOnAddContextListenerEvent(json); +// const privateChannelOnDisconnectEvent = Convert.toPrivateChannelOnDisconnectEvent(json); +// const privateChannelOnUnsubscribeEvent = Convert.toPrivateChannelOnUnsubscribeEvent(json); +// const privateChannelUnsubscribeEventListenerRequest = Convert.toPrivateChannelUnsubscribeEventListenerRequest(json); +// const privateChannelUnsubscribeEventListenerResponse = Convert.toPrivateChannelUnsubscribeEventListenerResponse(json); +// const privateChannelAddEventListenerRequest = Convert.toPrivateChannelAddEventListenerRequest(json); +// const privateChannelAddEventListenerResponse = Convert.toPrivateChannelAddEventListenerResponse(json); +// const raiseIntentForContextRequest = Convert.toRaiseIntentForContextRequest(json); +// const raiseIntentForContextResponse = Convert.toRaiseIntentForContextResponse(json); +// const raiseIntentRequest = Convert.toRaiseIntentRequest(json); +// const raiseIntentResponse = Convert.toRaiseIntentResponse(json); +// const raiseIntentResultResponse = Convert.toRaiseIntentResultResponse(json); +// +// These functions will throw an error if the JSON doesn't +// match the expected interface, even if the JSON is valid. + +/** + * Hello message sent by an application to a parent window or frame when attempting to + * establish connectivity to a Desktop Agent + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol1Hello { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol1HelloPayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP1Hello"; +} + +/** + * Metadata for this connection step message + */ +export interface ConnectionStepMetadata { + connectionAttemptUuid: string; + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol1HelloPayload { + /** + * A flag that may be used to indicate that a channel selector UI is or is not required. If + * the app includes its own UI for displaying + */ + channelSelector?: boolean; + /** + * The version of FDC3 API that the app supports. + */ + fdc3Version: string; + /** + * URL to use for the identity of the application. Desktop Agents MUST validate that the + * origin of the message matches the URL, but MAY implement custom comparison logic. + */ + identityUrl: string; + /** + * A flag that may be used to indicate that an intent resolver is or is not required. Set to + * false if no intents, or only targeted intents, are raised + */ + resolver?: boolean; + [property: string]: any; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Response from a Desktop Agent to an application requesting access to it indicating that + * it should load a specified URL into a hidden iframe in order to establish connectivity to + * a Desktop Agent + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol2LoadURL { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol2LoadURLPayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP2LoadUrl"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol2LoadURLPayload { + /** + * A URL which can be used to establish communication with the Desktop Agent, via loading + * the URL into an iframe and restarting the Web Connection protocol with the iframe as the + * target + */ + iframeUrl: string; + [property: string]: any; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Handshake message sent by the Desktop Agent to the app (with a MessagePort appended) that + * should be used for subsequent communication steps. + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol3Handshake { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol3HandshakePayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP3Handshake"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol3HandshakePayload { + /** + * Indicates whether a channel selector UI is required and the URL to use to do so. Set to + * `true` to use the default or `false` to disable the channel selector (as the Desktop + * Agent will handle another way) + */ + channelSelector: boolean | string; + /** + * The version of FDC3 API that the Desktop Agent will provide support for. + */ + fdc3Version: string; + /** + * Indicates whether an intent resolver UI is required and the URL to use to do so. Set to + * `true` to use the default or `false` to disable the intent resolver (as the Desktop Agent + * will handle another way) + */ + resolver: boolean | string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Identity Validation request from an app attempting to connect to a Desktop Agent. + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol4ValidateAppIdentity { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol4ValidateAppIdentityPayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP4ValidateAppIdentity"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol4ValidateAppIdentityPayload { + /** + * URL to use for the identity of the application. Desktop Agents MUST validate that the + * origin of the message matches the URL, but MAY implement custom comparison logic. + */ + identityUrl: string; + /** + * If an application has previously connected to the desktop agent, it may specify its prior + * instance id and associated instance UUID to request the same same instance Id be assigned. + */ + instanceId?: string; + /** + * Instance UUID associated with the requested instanceId. + */ + instanceUuid?: string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Message sent by the Desktop Agent to an app if their identity validation fails. + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol5ValidateAppIdentityFailedResponse { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP5ValidateAppIdentityFailedResponse"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload { + message?: string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Message sent by the Desktop Agent to an app after successful identity validation + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol5ValidateAppIdentitySuccessResponse { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP5ValidateAppIdentityResponse"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload { + /** + * The appId that the app's identity was validated against + */ + appId: string; + /** + * Implementation metadata for the Desktop Agent, which includes an appMetadata element + * containing a copy of the app's own metadata + */ + implementationMetadata: ImplementationMetadata; + /** + * The instance Id granted to the application by the Desktop Agent. + */ + instanceId: string; + /** + * Instance UUID associated with the instanceId granted, which may be used to retrieve the + * same instance Id if the app is reloaded or navigates. + */ + instanceUuid: string; +} + +/** + * Implementation metadata for the Desktop Agent, which includes an appMetadata element + * containing a copy of the app's own metadata + * + * Includes Metadata for the current application. + * + * Metadata relating to the FDC3 Desktop Agent implementation and its provider. + */ +export interface ImplementationMetadata { + /** + * The calling application instance's own metadata, according to the Desktop Agent (MUST + * include at least the `appId` and `instanceId`). + */ + appMetadata: AppMetadata; + /** + * The version number of the FDC3 specification that the implementation provides. + * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. + */ + fdc3Version: string; + /** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ + optionalFeatures: OptionalFeatures; + /** + * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, + * OpenFin etc.). + */ + provider: string; + /** + * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). + */ + providerVersion?: string; +} + +/** + * The calling application instance's own metadata, according to the Desktop Agent (MUST + * include at least the `appId` and `instanceId`). + * + * Extends an `AppIdentifier`, describing an application or instance of an application, with + * additional descriptive metadata that is usually provided by an FDC3 App Directory that + * the desktop agent connects to. + * + * The additional information from an app directory can aid in rendering UI elements, such + * as a launcher menu or resolver UI. This includes a title, description, tooltip and icon + * and screenshot URLs. + * + * Note that as `AppMetadata` instances are also `AppIdentifiers` they may be passed to the + * `app` argument of `fdc3.open`, `fdc3.raiseIntent` etc. + */ +export interface AppMetadata { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * A longer, multi-paragraph description for the application that could include markup + */ + description?: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * A list of icon URLs for the application that can be used to render UI elements + */ + icons?: Icon[]; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + /** + * An optional set of, implementation specific, metadata fields that can be used to + * disambiguate instances, such as a window title or screen position. Must only be set if + * `instanceId` is set. + */ + instanceMetadata?: { [key: string]: any }; + /** + * The 'friendly' app name. + * This field was used with the `open` and `raiseIntent` calls in FDC3 <2.0, which now + * require an `AppIdentifier` wth `appId` set. + * Note that for display purposes the `title` field should be used, if set, in preference to + * this field. + */ + name?: string; + /** + * The type of output returned for any intent specified during resolution. May express a + * particular context type (e.g. "fdc3.instrument"), channel (e.g. "channel") or a channel + * that will receive a specified type (e.g. "channel"). + */ + resultType?: null | string; + /** + * Images representing the app in common usage scenarios that can be used to render UI + * elements + */ + screenshots?: Image[]; + /** + * A more user-friendly application title that can be used to render UI elements + */ + title?: string; + /** + * A tooltip for the application that can be used to render UI elements + */ + tooltip?: string; + /** + * The Version of the application. + */ + version?: string; +} + +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ +export interface Icon { + /** + * The icon dimension, formatted as `x`. + */ + size?: string; + /** + * The icon url + */ + src: string; + /** + * Icon media type. If not present the Desktop Agent may use the src file extension. + */ + type?: string; +} + +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ +export interface Image { + /** + * Caption for the image. + */ + label?: string; + /** + * The image dimension, formatted as `x`. + */ + size?: string; + /** + * The image url. + */ + src: string; + /** + * Image media type. If not present the Desktop Agent may use the src file extension. + */ + type?: string; +} + +/** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ +export interface OptionalFeatures { + /** + * Used to indicate whether the experimental Desktop Agent Bridging + * feature is implemented by the Desktop Agent. + */ + DesktopAgentBridging: boolean; + /** + * Used to indicate whether the exposure of 'originating app metadata' for + * context and intent messages is supported by the Desktop Agent. + */ + OriginatingAppMetadata: boolean; + /** + * Used to indicate whether the optional `fdc3.joinUserChannel`, + * `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by + * the Desktop Agent. + */ + UserChannelMembershipAPIs: boolean; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Goodbye message to be sent to the Desktop Agent when disconnecting (e.g. when closing the + * window or navigating). Desktop Agents should close the MessagePort after receiving this + * message, but retain instance details in case the application reconnects (e.g. after a + * navigation event). + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol6Goodbye { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the connection step message. + */ + type: "WCP6Goodbye"; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocolMessage { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the connection step message. + */ + type: ConnectionStepMessageType; +} + +/** + * Identifies the type of the connection step message. + */ +export type ConnectionStepMessageType = "WCP1Hello" | "WCP2LoadUrl" | "WCP3Handshake" | "WCP4ValidateAppIdentity" | "WCP5ValidateAppIdentityFailedResponse" | "WCP5ValidateAppIdentityResponse" | "WCP6Goodbye"; + +/** + * A request to add a context listener to a specified Channel OR to the current user + * channel. Where the listener is added to the current user channel (channelId == null), and + * this app has already been added to a user channel, client code should make a subsequent + * request to get the current context of that channel for this listener and then call its + * handler with it. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface AddContextListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: AddContextListenerRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "addContextListenerRequest"; +} + +/** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ +export interface AddContextListenerRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that a request or response was received + * from. Please note that this may be set by an app or Desktop Agent proxy for debugging + * purposes but a Desktop Agent should make its own determination of the source of a message + * to avoid spoofing. + */ + source?: AppIdentifier; + timestamp: Date; +} + +/** + * Field that represents the source application that a request or response was received + * from. Please note that this may be set by an app or Desktop Agent proxy for debugging + * purposes but a Desktop Agent should make its own determination of the source of a message + * to avoid spoofing. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that the request being responded to was + * received from, for debugging purposes. + * + * Details of the application instance that broadcast the context + * + * The App resolution option chosen + * + * Details of the application instance that raised the intent + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppIdentifier { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface AddContextListenerRequestPayload { + /** + * The id of the channel to add the listener to or `null` indicating that it should listen + * to the current user channel (at the time of broadcast). + */ + channelId: null | string; + /** + * The type of context to listen for OR `null` indicating that it should listen to all + * context types. + */ + contextType: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a addContextListener request. Where the listener was added to the current + * user channel (channelId == null), and this app has already been added to a user channel, + * client code should make a subsequent request to get the current context of that channel + * for this listener and then call its handler with it. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface AddContextListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: AddContextListenerResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "addContextListenerResponse"; +} + +/** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ +export interface AddContextListenerResponseMeta { + requestUuid: string; + responseUuid: string; + /** + * Field that represents the source application that the request being responded to was + * received from, for debugging purposes. + */ + source?: AppIdentifier; + timestamp: Date; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface AddContextListenerResponsePayload { + error?: PurpleError; + listenerUUID?: string; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type PurpleError = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app for a specified event type. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface AddEventListenerEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: AddEventListenerEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "addEventListenerEvent"; +} + +/** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ +export interface AddEventListenerEventMeta { + eventUuid: string; + timestamp: Date; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface AddEventListenerEventPayload { + event: FDC3Event; +} + +/** + * An event object received via the FDC3 API's addEventListener function. Will always + * include both type and details, which describe type of the event and any additional + * details respectively. + */ +export interface FDC3Event { + /** + * Additional details of the event, such as the `currentChannelId` for a CHANNEL_CHANGED + * event + */ + details: { [key: string]: any }; + type: "USER_CHANNEL_CHANGED"; +} + +/** + * The type of a (non-context and non-intent) event that may be received via the FDC3 API's + * addEventListener function. + * + * The type of the event to be listened to. + */ + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to add an event listener for a specified event type to the DesktopAgent. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface AddEventListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: AddEventListenerRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "addEventListenerRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface AddEventListenerRequestPayload { + /** + * The type of the event to be listened to. + */ + type: "USER_CHANNEL_CHANGED"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to an addEventListener request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface AddEventListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: AddEventListenerResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "addEventListenerResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface AddEventListenerResponsePayload { + error?: ResponsePayloadError; + listenerUUID?: string; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type ResponsePayloadError = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to add an Intent listener for a specified intent type. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface AddIntentListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: AddIntentListenerRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "addIntentListenerRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface AddIntentListenerRequestPayload { + /** + * The name of the intent to listen for. + */ + intent: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a addIntentListener request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface AddIntentListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: AddIntentListenerResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "addIntentListenerResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface AddIntentListenerResponsePayload { + error?: FluffyError; + listenerUUID?: string; + [property: string]: any; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type FluffyError = "MalformedContext" | "DesktopAgentNotFound" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface AgentEventMessage { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AgentEventMessageMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: EventMessageType; +} + +/** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ +export interface AgentEventMessageMeta { + eventUuid: string; + timestamp: Date; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ +export type EventMessageType = "intentEvent" | "broadcastEvent" | "channelChangedEvent" | "privateChannelOnAddContextListenerEvent" | "privateChannelOnDisconnectEvent" | "privateChannelOnUnsubscribeEvent" | "addEventListenerEvent"; + +/** + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface AgentResponseMessage { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AgentResponseMessageMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: AgentResponseMessageResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: ResponseMessageType; +} + +/** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ +export interface AgentResponseMessageMeta { + requestUuid: string; + responseUuid: string; + /** + * Field that represents the source application that the request being responded to was + * received from, for debugging purposes. + */ + source?: AppIdentifier; + timestamp: Date; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface AgentResponseMessageResponsePayload { + error?: ResponsePayloadError; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ +export type ResponseMessageType = "addContextListenerResponse" | "addEventListenerResponse" | "addIntentListenerResponse" | "broadcastResponse" | "contextListenerUnsubscribeResponse" | "createPrivateChannelResponse" | "eventListenerUnsubscribeResponse" | "findInstancesResponse" | "findIntentResponse" | "findIntentsByContextResponse" | "getAppMetadataResponse" | "getCurrentChannelResponse" | "getCurrentContextResponse" | "getInfoResponse" | "getOrCreateChannelResponse" | "getUserChannelsResponse" | "intentListenerUnsubscribeResponse" | "intentResultResponse" | "joinUserChannelResponse" | "leaveCurrentChannelResponse" | "openResponse" | "privateChannelAddEventListenerResponse" | "privateChannelDisconnectResponse" | "privateChannelUnsubscribeEventListenerResponse" | "raiseIntentForContextResponse" | "raiseIntentResponse" | "raiseIntentResultResponse"; + +/** + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface AppRequestMessage { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AppRequestMessageMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: RequestMessageType; +} + +/** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ +export interface AppRequestMessageMeta { + requestUuid: string; + /** + * Field that represents the source application that a request or response was received + * from. Please note that this may be set by an app or Desktop Agent proxy for debugging + * purposes but a Desktop Agent should make its own determination of the source of a message + * to avoid spoofing. + */ + source?: AppIdentifier; + timestamp: Date; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ +export type RequestMessageType = "addContextListenerRequest" | "addEventListenerRequest" | "addIntentListenerRequest" | "broadcastRequest" | "contextListenerUnsubscribeRequest" | "createPrivateChannelRequest" | "eventListenerUnsubscribeRequest" | "findInstancesRequest" | "findIntentRequest" | "findIntentsByContextRequest" | "getAppMetadataRequest" | "getCurrentChannelRequest" | "getCurrentContextRequest" | "getInfoRequest" | "getOrCreateChannelRequest" | "getUserChannelsRequest" | "intentListenerUnsubscribeRequest" | "intentResultRequest" | "joinUserChannelRequest" | "leaveCurrentChannelRequest" | "openRequest" | "privateChannelAddEventListenerRequest" | "privateChannelDisconnectRequest" | "privateChannelUnsubscribeEventListenerRequest" | "raiseIntentForContextRequest" | "raiseIntentRequest"; + +/** + * An event message from the Desktop Agent to an app indicating that context has been + * broadcast on a channel it is listening to, or specifically to this app instance if it was + * launched via `fdc3.open` and context was passed. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface BroadcastEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: BroadcastEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "broadcastEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface BroadcastEventPayload { + /** + * The Id of the channel that the broadcast was sent on. May be `null` if the context is + * being broadcast due to a call `fdc3.open` that passed context. + */ + channelId: null | string; + /** + * The context object that was broadcast. + */ + context: Context; + /** + * Details of the application instance that broadcast the context + */ + originatingApp?: AppIdentifier; +} + +/** + * The context object that was broadcast. + * + * The context object that is to be broadcast. + * + * The context object passed with the raised intent. + * + * If a Context object is passed in, this object will be provided to the opened application + * via a contextListener. The Context argument is functionally equivalent to opening the + * target app with no context and broadcasting the context directly to it. + * + * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by + * FDC3 operations. As such, it is not really meant to be used on its own, but is imported + * by more specific type definitions (standardized or custom) to provide the structure and + * properties shared by all FDC3 context data types. + * + * The key element of FDC3 context types is their mandatory `type` property, which is used + * to identify what type of data the object represents, and what shape it has. + * + * The FDC3 context type, and all derived types, define the minimum set of fields a context + * data object of a particular type can be expected to have, but this can always be extended + * with custom fields as appropriate. + */ +export interface Context { + /** + * Context data objects may include a set of equivalent key-value pairs that can be used to + * help applications identify and look up the context type they receive in their own domain. + * The idea behind this design is that applications can provide as many equivalent + * identifiers to a target application as possible, e.g. an instrument may be represented by + * an ISIN, CUSIP or Bloomberg identifier. + * + * Identifiers do not make sense for all types of data, so the `id` property is therefore + * optional, but some derived types may choose to require at least one identifier. + * Identifier values SHOULD always be of type string. + */ + id?: { [key: string]: any }; + /** + * Context data objects may include a name property that can be used for more information, + * or display purposes. Some derived types may require the name object as mandatory, + * depending on use case. + */ + name?: string; + /** + * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 + * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present + * to route shared context data appropriately. + * + * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data + * types they support in an FDC3 [App + * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery + * and routing. + * + * Standardized FDC3 context types have well-known `type` properties prefixed with the + * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and + * used by a particular organization, the convention is to prefix them with an + * organization-specific namespace, e.g. `blackrock.fund`. + * + * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more + * information about context data types. + */ + type: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to broadcast context on a channel. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface BroadcastRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: BroadcastRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "broadcastRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface BroadcastRequestPayload { + /** + * The Id of the Channel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that is to be broadcast. + */ + context: Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a request to broadcast context on a channel. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface BroadcastResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "broadcastResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface BroadcastResponseResponsePayload { + error?: ResponsePayloadError; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app indicating that its current user + * channel has changed. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface ChannelChangedEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: ChannelChangedEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "channelChangedEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface ChannelChangedEventPayload { + /** + * The Id of the channel that the app was added to or `null` if it was removed from a + * channel. + */ + newChannelId: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to unsubscribe a context listener. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface ContextListenerUnsubscribeRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: ContextListenerUnsubscribeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "contextListenerUnsubscribeRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface ContextListenerUnsubscribeRequestPayload { + listenerUUID: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a contextListenerUnsubscribe request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface ContextListenerUnsubscribeResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "contextListenerUnsubscribeResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to return a Channel with an auto-generated identity that is intended for private + * communication between applications. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface CreatePrivateChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: CreatePrivateChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "createPrivateChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface CreatePrivateChannelRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a createPrivateChannel request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface CreatePrivateChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: CreatePrivateChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "createPrivateChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface CreatePrivateChannelResponsePayload { + error?: PurpleError; + privateChannel?: Channel; +} + +/** + * Represents a context channel that applications can use to send and receive + * context data. + * + * Please note that There are differences in behavior when you interact with a + * User channel via the `DesktopAgent` interface and the `Channel` interface. + * Specifically, when 'joining' a User channel or adding a context listener + * when already joined to a channel via the `DesktopAgent` interface, existing + * context (matching the type of the context listener) on the channel is + * received by the context listener immediately. Whereas, when a context + * listener is added via the Channel interface, context is not received + * automatically, but may be retrieved manually via the `getCurrentContext()` + * function. + */ +export interface Channel { + /** + * Channels may be visualized and selectable by users. DisplayMetadata may be used to + * provide hints on how to see them. + * For App channels, displayMetadata would typically not be present. + */ + displayMetadata?: DisplayMetadata; + /** + * Constant that uniquely identifies this channel. + */ + id: string; + /** + * Uniquely defines each channel type. + * Can be "user", "app" or "private". + */ + type: Type; +} + +/** + * Channels may be visualized and selectable by users. DisplayMetadata may be used to + * provide hints on how to see them. + * For App channels, displayMetadata would typically not be present. + * + * A system channel will be global enough to have a presence across many apps. This gives us + * some hints + * to render them in a standard way. It is assumed it may have other properties too, but if + * it has these, + * this is their meaning. + */ +export interface DisplayMetadata { + /** + * The color that should be associated within this channel when displaying this channel in a + * UI, e.g: `0xFF0000`. + */ + color?: string; + /** + * A URL of an image that can be used to display this channel + */ + glyph?: string; + /** + * A user-readable name for this channel, e.g: `"Red"` + */ + name?: string; +} + +/** + * Uniquely defines each channel type. + * Can be "user", "app" or "private". + */ +export type Type = "app" | "private" | "user"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to unsubscribe an event listener. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface EventListenerUnsubscribeRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: EventListenerUnsubscribeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "eventListenerUnsubscribeRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface EventListenerUnsubscribeRequestPayload { + listenerUUID: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to an eventListenerUnsubscribe request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface EventListenerUnsubscribeResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "eventListenerUnsubscribeResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request for details of instances of a particular app. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface FindInstancesRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindInstancesRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findInstancesRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindInstancesRequestPayload { + app: AppIdentifier; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a findInstances request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface FindInstancesResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: FindInstancesResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * The message payload contains a flag indicating whether the API call was successful, plus + * any return values for the FDC3 API function called, or indicating that the request + * resulted in an error and including a standardized error message. + */ +export interface FindInstancesResponsePayload { + error?: FindInstancesErrors; + appIdentifiers?: AppMetadata[]; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + * + * Unique identifier for a for an attempt to connect to a Desktop Agent + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + * + * Unique identifier for a `listener` object returned by a Desktop Agent to an app in + * response to addContextListener, addIntentListener or one of the PrivateChannel event + * listeners and used to identify it in messages (e.g. when unsubscribing). + * + * Should be set if the raiseIntent request returned an error. + */ +export type FindInstancesErrors = "MalformedContext" | "DesktopAgentNotFound" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request for details of apps available to resolve a particular intent and context pair. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface FindIntentRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentRequestPayload { + context?: Context; + intent: string; + resultType?: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a findIntent request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface FindIntentResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: FindIntentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface FindIntentResponsePayload { + error?: FindInstancesErrors; + appIntent?: AppIntent; +} + +/** + * An interface that relates an intent to apps + * + * Used if a raiseIntent request requires additional resolution (e.g. by showing an intent + * resolver) before it can be handled. + */ +export interface AppIntent { + /** + * Details of applications that can resolve the intent. + */ + apps: AppMetadata[]; + /** + * Details of the intent whose relationship to resolving applications is being described. + */ + intent: IntentMetadata; +} + +/** + * Details of the intent whose relationship to resolving applications is being described. + * + * Intent descriptor + */ +export interface IntentMetadata { + /** + * Display name for the intent. + */ + displayName?: string; + /** + * The unique name of the intent that can be invoked by the raiseIntent call + */ + name: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request for details of intents and apps available to resolve them for a particular + * context. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface FindIntentsByContextRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentsByContextRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentsByContextRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentsByContextRequestPayload { + context: Context; + resultType?: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a findIntentsByContext request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface FindIntentsByContextResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: FindIntentsByContextResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface FindIntentsByContextResponsePayload { + error?: FindInstancesErrors; + appIntents?: AppIntent[]; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request for metadata about an app. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetAppMetadataRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetAppMetadataRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getAppMetadataRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetAppMetadataRequestPayload { + app: AppIdentifier; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getAppMetadata request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetAppMetadataResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetAppMetadataResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetAppMetadataResponsePayload { + error?: FindInstancesErrors; + appMetadata?: AppMetadata; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to return the Channel object for the current User channel membership. Returns + * `null` if the app is not joined to a channel. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetCurrentChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetCurrentChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getCurrentChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetCurrentChannelRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getCurrentChannel request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetCurrentChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetCurrentChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getCurrentChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetCurrentChannelResponsePayload { + error?: ResponsePayloadError; + channel?: Channel | null; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to return the current context (either of a specified type or most recent + * broadcast) of a specified Channel. Returns `null` if no context (of the requested type if + * one was specified) is available in the channel. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetCurrentContextRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetCurrentContextRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getCurrentContextRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetCurrentContextRequestPayload { + /** + * The id of the channel to return the current context of + */ + channelId: string; + /** + * The type of context to return for OR `null` indicating that the most recently broadcast + * context on the channel should be returned. + */ + contextType: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getCurrentContext request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetCurrentContextResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetCurrentContextResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getCurrentContextResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetCurrentContextResponsePayload { + error?: PurpleError; + /** + * The most recently broadcast context object (of the specified type, if one was specified), + * or `null` if none was available in the channel + */ + context?: null | Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to retrieve information about the FDC3 Desktop Agent implementation and the + * metadata of the calling application according to the desktop agent. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetInfoRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetInfoRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getInfoRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetInfoRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getInfo request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetInfoResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetInfoResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getInfoResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetInfoResponsePayload { + error?: ResponsePayloadError; + implementationMetadata?: ImplementationMetadata; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to return a Channel with an auto-generated identity that is intended for private + * communication between applications. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetOrCreateChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetOrCreateChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getOrCreateChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetOrCreateChannelRequestPayload { + /** + * The id of the channel to return + */ + channelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getOrCreateChannel request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetOrCreateChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetOrCreateChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getOrCreateChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetOrCreateChannelResponsePayload { + error?: PurpleError; + channel?: Channel; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to retrieve a list of the User Channels available for the app to join. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetUserChannelsRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetUserChannelsRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getUserChannelsRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetUserChannelsRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getUserChannels request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetUserChannelsResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetUserChannelsResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getUserChannelsResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetUserChannelsResponsePayload { + error?: PurpleError; + userChannels?: Channel[]; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Message from the channel selector UI to the DA proxy when the user drags the selector to + * a new location. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeChannelDrag { + /** + * The message payload + */ + payload: IframeChannelDragPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeChannelDrag"; +} + +/** + * The message payload + */ +export interface IframeChannelDragPayload { + /** + * The offset to move the frame by + */ + mouse: MouseClass; +} + +/** + * The offset to move the frame by + */ +export interface MouseClass { + offsetX: number; + offsetY: number; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Message from the channel selector UI to the DA proxy when the user hits a toggle button + * that opens or closes the selector or otherwise resizes it. Includes the size that it + * should change to and the corner (if any) at which the change should be made. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeChannelResize { + /** + * The message payload + */ + payload: IframeChannelResizePayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeChannelResize"; +} + +/** + * The message payload + */ +export interface IframeChannelResizePayload { + /** + * The updated dimensions of the UI + */ + dimensions: DimensionsClass; + /** + * When resizing anchor at the indicated location, + * e.g. + * - for top-left and a larger size: the bottom right corner should move down and out. + * - for top and smaller size: both the bottom corners should move in and up. + */ + resizeAnchor: Resizing; +} + +/** + * The updated dimensions of the UI + */ +export interface DimensionsClass { + height: number; + width: number; +} + +/** + * When resizing anchor at the indicated location, + * e.g. + * - for top-left and a larger size: the bottom right corner should move down and out. + * - for top and smaller size: both the bottom corners should move in and up. + */ +export type Resizing = "top-left" | "top" | "top-right" | "right" | "bottom-right" | "bottom" | "bottom-left" | "left" | "center"; + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Message from the channel selector UI to the DA proxy sent when the channel selection + * changes. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeChannelSelected { + /** + * The message payload + */ + payload: IframeChannelSelectedPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeChannelSelected"; +} + +/** + * The message payload + */ +export interface IframeChannelSelectedPayload { + /** + * The id of the channel that should be currently selected, or `null` if none should be + * selected + */ + selected: null | string; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Setup message sent by the DA proxy code in getAgent() to a channel selector UI in an + * iframe with the channel definitions and current channel selection. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeChannels { + /** + * The message payload + */ + payload: IframeChannelsPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeChannels"; +} + +/** + * The message payload + */ +export interface IframeChannelsPayload { + /** + * If the channel selector was previously displayed in this window its location may be + * restored by setting the location coordinates + */ + location?: Location; + /** + * The id of the channel that should be currently selected, or `null` if none should be + * selected + */ + selected: null | string; + /** + * User Channel definitions + */ + userChannels: Channel[]; +} + +/** + * If the channel selector was previously displayed in this window its location may be + * restored by setting the location coordinates + */ +export interface Location { + x: number; + y: number; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Handshake message sent back by an iframe to the DA proxy code indicating that it is setup + * and ready to communicate over the MessagePort. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeHandshake { + /** + * The message payload + */ + payload: IframeHandshakePayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeHandshake"; +} + +/** + * The message payload + */ +export interface IframeHandshakePayload { + /** + * Details about the UI implementation in the iframe, such as vendor and version, for + * logging purposes. + */ + implementationDetails: string; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Hello message sent by the DA proxy code in getAgent() to an iframe, that it has injected + * into the page, with a MessagePort appended that should be used for subsequent + * communication steps. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeHello { + /** + * The message payload + */ + payload: IframeHelloPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeHello"; +} + +/** + * The message payload + */ +export interface IframeHelloPayload { + /** + * The version of FDC3 API that the Desktop Agent proxy is providing support for. + */ + fdc3Version: string; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeMessage { + /** + * The message payload + */ + payload?: { [key: string]: any }; + /** + * Identifies the type of the message to or from the iframe. + */ + type: IframeMessageType; +} + +/** + * Identifies the type of the message to or from the iframe. + */ +export type IframeMessageType = "iframeHello" | "iframeHandshake" | "iframeResolve" | "iframeResolveAction" | "iframeChannels" | "iframeChannelSelected" | "iframeChannelResize" | "iframeChannelDrag"; + +/** + * Setup message sent by the DA proxy code in getAgent() to an intent resolver UI in an + * iframe with the resolver data to setup the UI. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeResolve { + /** + * The message payload + */ + payload: IframeResolvePayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeResolve"; +} + +/** + * The message payload + */ +export interface IframeResolvePayload { + /** + * An array of AppIntent objects defining the resolution options. + */ + appIntents: AppIntent[]; + context: Context; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Message from an intent resolver UI in an iframe to DA proxy code in getAgent() reporting + * a user action. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeResolveAction { + /** + * The message payload + */ + payload: IframeResolveActionPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeResolveAction"; +} + +/** + * The message payload + */ +export interface IframeResolveActionPayload { + action: Action; + /** + * The App resolution option chosen + */ + appIdentifier?: AppIdentifier; + /** + * The intent resolved + */ + intent?: string; +} + +export type Action = "hover" | "click" | "cancel"; + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * An event message from the Desktop Agent to an app indicating that it has been selected to + * resolve a raised intent and context. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface IntentEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: IntentEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "intentEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface IntentEventPayload { + /** + * The context object passed with the raised intent. + */ + context: Context; + /** + * The intent that was raised. + */ + intent: string; + /** + * Details of the application instance that raised the intent + */ + originatingApp?: AppIdentifier; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to unsubscribe a context listener. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface IntentListenerUnsubscribeRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: IntentListenerUnsubscribeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "intentListenerUnsubscribeRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface IntentListenerUnsubscribeRequestPayload { + listenerUUID: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a intentListenerUnsubscribe request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface IntentListenerUnsubscribeResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "intentListenerUnsubscribeResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to deliver a result for an intent (which may include a `void` result that just + * indicates that the handler has run, returning no result). + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface IntentResultRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: IntentResultRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "intentResultRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface IntentResultRequestPayload { + intentResult: PurpleIntentResult; +} + +export interface PurpleIntentResult { + context?: Context; + channel?: Channel; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a request to deliver an intent result. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface IntentResultResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "intentResultResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to join the app to the specified User channel. On successfully joining a channel, + * client code should make subsequent requests to get the current context of that channel + * for all registered context listeners and then call their handlers with it. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface JoinUserChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: JoinUserChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "joinUserChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface JoinUserChannelRequestPayload { + /** + * The id of the channel to join + */ + channelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a joinUserChannel request. On receipt of this response, client code should + * make subsequent requests to get the current context of that channel for all registered + * context listeners and then call their handlers with it. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface JoinUserChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: JoinUserChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "joinUserChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface JoinUserChannelResponsePayload { + error?: PurpleError; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to remove the app from any User channel membership. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface LeaveCurrentChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: LeaveCurrentChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "leaveCurrentChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface LeaveCurrentChannelRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a leaveCurrentChannel request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface LeaveCurrentChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: LeaveCurrentChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "leaveCurrentChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface LeaveCurrentChannelResponsePayload { + error?: PurpleError; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to open an application. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface OpenRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: OpenRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "openRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface OpenRequestPayload { + app: AppIdentifier; + /** + * If a Context object is passed in, this object will be provided to the opened application + * via a contextListener. The Context argument is functionally equivalent to opening the + * target app with no context and broadcasting the context directly to it. + */ + context?: Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a open request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface OpenResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: OpenResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface OpenResponsePayload { + error?: OpenErrorResponsePayload; + appIdentifier?: AppIdentifier; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type OpenErrorResponsePayload = "MalformedContext" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request that indicates that a participant will no longer interact with a specified + * `PrivateChannel`. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface PrivateChannelDisconnectRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelDisconnectRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "privateChannelDisconnectRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelDisconnectRequestPayload { + /** + * The Id of the Channel that should be disconnected from + */ + channelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a privateChannelDisconnect request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface PrivateChannelDisconnectResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: PrivateChannelDisconnectResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelDisconnectResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface PrivateChannelDisconnectResponsePayload { + error?: PurpleError; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app indicating that another app has added a + * context listener to a specific PrivateChannel. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface PrivateChannelOnAddContextListenerEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: PrivateChannelOnAddContextListenerEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelOnAddContextListenerEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface PrivateChannelOnAddContextListenerEventPayload { + /** + * The type of the context listener added to the channel by another app, or null if it will + * listen to all types. + */ + contextType: null | string; + /** + * The Id of the PrivateChannel that the listener was added to. + */ + privateChannelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app indicating that another app has + * disconnected from a specific PrivateChannel and will no longer interact with it. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface PrivateChannelOnDisconnectEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: PrivateChannelOnDisconnectEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelOnDisconnectEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface PrivateChannelOnDisconnectEventPayload { + /** + * The Id of the PrivateChannel that the app has disconnected from. + */ + privateChannelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app indicating that another app has + * unsubscribed a context listener from a specific PrivateChannel. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface PrivateChannelOnUnsubscribeEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: PrivateChannelOnUnsubscribeEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelOnUnsubscribeEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface PrivateChannelOnUnsubscribeEventPayload { + /** + * The type of the context listener unsubscribed from the channel by another app, or null if + * it was listening to all types. + */ + contextType: null | string; + /** + * The Id of the PrivateChannel that the listener was unsubscribed from. + */ + privateChannelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to unsubscribe a context listener. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface PrivateChannelUnsubscribeEventListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelUnsubscribeEventListenerRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "privateChannelUnsubscribeEventListenerRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelUnsubscribeEventListenerRequestPayload { + listenerUUID: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a privateChannelUnsubscribeEventListener request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface PrivateChannelUnsubscribeEventListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelUnsubscribeEventListenerResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to add an event listener to a specific PrivateChannel. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface PrivateChannelAddEventListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: TPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "privateChannelAddEventListenerRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface TPayload { + /** + * The type of PrivateChannel event that the listener should be applied to. + */ + listenerType: PrivateChannelEventListenerTypes; + /** + * The Id of the PrivateChannel that the listener should be added to. + */ + privateChannelId: string; +} + +/** + * The type of PrivateChannel event that the listener should be applied to. + * + * Event listener type names for Private Channel events + */ +export type PrivateChannelEventListenerTypes = "onAddContextListener" | "onUnsubscribe" | "onDisconnect"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a privateChannelAddEventListener request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface PrivateChannelAddEventListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: PrivateChannelAddEventListenerResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelAddEventListenerResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface PrivateChannelAddEventListenerResponsePayload { + error?: PurpleError; + listenerUUID?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to raise an unspecified intent for a specified context. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface RaiseIntentForContextRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: RaiseIntentForContextRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "raiseIntentForContextRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface RaiseIntentForContextRequestPayload { + app?: AppIdentifier; + context: Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a raiseIntentForContext request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface RaiseIntentForContextResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * There are 3 possible responses to a raiseIntentForContext request, each of which sets a + * single property in the payload: Success (`intentResolution`), Needs further resolution + * (`appIntents`) or Error (`error`). + */ + payload: RaiseIntentForContextResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentForContextResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * There are 3 possible responses to a raiseIntentForContext request, each of which sets a + * single property in the payload: Success (`intentResolution`), Needs further resolution + * (`appIntents`) or Error (`error`). + * + * Response to a raiseIntentForContext request that needs additional resolution (i.e. show + * an intent resolver UI) + * + * Used if a raiseIntent request resulted in an error + */ +export interface RaiseIntentForContextResponsePayload { + /** + * Should be set if the raiseIntent request returned an error. + */ + error?: FindInstancesErrors; + /** + * Used if the raiseIntent request was successfully resolved + */ + intentResolution?: IntentResolution; + /** + * Used if a raiseIntentForContext request requires additional resolution (e.g. by showing + * an intent resolver) before it can be handled. + */ + appIntents?: AppIntent[]; +} + +/** + * Used if the raiseIntent request was successfully resolved + * + * IntentResolution provides a standard format for data returned upon resolving an intent. + * + * ```javascript + * //resolve a "Chain" type intent + * let resolution = await agent.raiseIntent("intentName", context); + * + * //resolve a "Client-Service" type intent with a data response or a Channel + * let resolution = await agent.raiseIntent("intentName", context); + * try { + * const result = await resolution.getResult(); + * if (result && result.broadcast) { + * console.log(`${resolution.source} returned a channel with id ${result.id}`); + * } else if (result){ + * console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`); + * } else { + * console.error(`${resolution.source} didn't return data` + * } + * } catch(error) { + * console.error(`${resolution.source} returned an error: ${error}`); + * } + * + * // Use metadata about the resolving app instance to target a further intent + * await agent.raiseIntent("intentName", context, resolution.source); + * ``` + */ +export interface IntentResolution { + /** + * The intent that was raised. May be used to determine which intent the user + * chose in response to `fdc3.raiseIntentForContext()`. + */ + intent: string; + /** + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ + source: AppIdentifier; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to raise an intent for a context. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface RaiseIntentRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: RaiseIntentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "raiseIntentRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface RaiseIntentRequestPayload { + app?: AppIdentifier; + context: Context; + intent: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a raiseIntent request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface RaiseIntentResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * There are 3 possible responses to a raiseIntent request, each of which sets a single + * property in the payload: Success (`intentResolution`), Needs further resolution + * (`appIntent`) or Error (`error`). + */ + payload: RaiseIntentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * There are 3 possible responses to a raiseIntent request, each of which sets a single + * property in the payload: Success (`intentResolution`), Needs further resolution + * (`appIntent`) or Error (`error`). + * + * Response to a raiseIntent request that needs additional resolution (i.e. show an intent + * resolver UI). + * + * Used if a raiseIntent request resulted in an error + */ +export interface RaiseIntentResponsePayload { + /** + * Should be set if the raiseIntent request returned an error. + */ + error?: FindInstancesErrors; + /** + * Used if the raiseIntent request was successfully resolved + */ + intentResolution?: IntentResolution; + /** + * Used if a raiseIntent request requires additional resolution (e.g. by showing an intent + * resolver) before it can be handled. + */ + appIntent?: AppIntent; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A secondary response to a request to raise an intent used to deliver the intent result. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface RaiseIntentResultResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: RaiseIntentResultResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface RaiseIntentResultResponsePayload { + error?: ResponsePayloadError; + intentResult?: FluffyIntentResult; +} + +export interface FluffyIntentResult { + context?: Context; + channel?: Channel; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +// Converts JSON strings to/from your types +// and asserts the results of JSON.parse at runtime +export class Convert { + public static toWebConnectionProtocol1Hello(json: string): WebConnectionProtocol1Hello { + return cast(JSON.parse(json), r("WebConnectionProtocol1Hello")); + } + + public static webConnectionProtocol1HelloToJson(value: WebConnectionProtocol1Hello): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol1Hello")), null, 2); + } + + public static toWebConnectionProtocol2LoadURL(json: string): WebConnectionProtocol2LoadURL { + return cast(JSON.parse(json), r("WebConnectionProtocol2LoadURL")); + } + + public static webConnectionProtocol2LoadURLToJson(value: WebConnectionProtocol2LoadURL): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol2LoadURL")), null, 2); + } + + public static toWebConnectionProtocol3Handshake(json: string): WebConnectionProtocol3Handshake { + return cast(JSON.parse(json), r("WebConnectionProtocol3Handshake")); + } + + public static webConnectionProtocol3HandshakeToJson(value: WebConnectionProtocol3Handshake): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol3Handshake")), null, 2); + } + + public static toWebConnectionProtocol4ValidateAppIdentity(json: string): WebConnectionProtocol4ValidateAppIdentity { + return cast(JSON.parse(json), r("WebConnectionProtocol4ValidateAppIdentity")); + } + + public static webConnectionProtocol4ValidateAppIdentityToJson(value: WebConnectionProtocol4ValidateAppIdentity): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol4ValidateAppIdentity")), null, 2); + } + + public static toWebConnectionProtocol5ValidateAppIdentityFailedResponse(json: string): WebConnectionProtocol5ValidateAppIdentityFailedResponse { + return cast(JSON.parse(json), r("WebConnectionProtocol5ValidateAppIdentityFailedResponse")); + } + + public static webConnectionProtocol5ValidateAppIdentityFailedResponseToJson(value: WebConnectionProtocol5ValidateAppIdentityFailedResponse): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol5ValidateAppIdentityFailedResponse")), null, 2); + } + + public static toWebConnectionProtocol5ValidateAppIdentitySuccessResponse(json: string): WebConnectionProtocol5ValidateAppIdentitySuccessResponse { + return cast(JSON.parse(json), r("WebConnectionProtocol5ValidateAppIdentitySuccessResponse")); + } + + public static webConnectionProtocol5ValidateAppIdentitySuccessResponseToJson(value: WebConnectionProtocol5ValidateAppIdentitySuccessResponse): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol5ValidateAppIdentitySuccessResponse")), null, 2); + } + + public static toWebConnectionProtocol6Goodbye(json: string): WebConnectionProtocol6Goodbye { + return cast(JSON.parse(json), r("WebConnectionProtocol6Goodbye")); + } + + public static webConnectionProtocol6GoodbyeToJson(value: WebConnectionProtocol6Goodbye): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol6Goodbye")), null, 2); + } + + public static toWebConnectionProtocolMessage(json: string): WebConnectionProtocolMessage { + return cast(JSON.parse(json), r("WebConnectionProtocolMessage")); + } + + public static webConnectionProtocolMessageToJson(value: WebConnectionProtocolMessage): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocolMessage")), null, 2); + } + + public static toAddContextListenerRequest(json: string): AddContextListenerRequest { + return cast(JSON.parse(json), r("AddContextListenerRequest")); + } + + public static addContextListenerRequestToJson(value: AddContextListenerRequest): string { + return JSON.stringify(uncast(value, r("AddContextListenerRequest")), null, 2); + } + + public static toAddContextListenerResponse(json: string): AddContextListenerResponse { + return cast(JSON.parse(json), r("AddContextListenerResponse")); + } + + public static addContextListenerResponseToJson(value: AddContextListenerResponse): string { + return JSON.stringify(uncast(value, r("AddContextListenerResponse")), null, 2); + } + + public static toAddEventListenerEvent(json: string): AddEventListenerEvent { + return cast(JSON.parse(json), r("AddEventListenerEvent")); + } + + public static addEventListenerEventToJson(value: AddEventListenerEvent): string { + return JSON.stringify(uncast(value, r("AddEventListenerEvent")), null, 2); + } + + public static toAddEventListenerRequest(json: string): AddEventListenerRequest { + return cast(JSON.parse(json), r("AddEventListenerRequest")); + } + + public static addEventListenerRequestToJson(value: AddEventListenerRequest): string { + return JSON.stringify(uncast(value, r("AddEventListenerRequest")), null, 2); + } + + public static toAddEventListenerResponse(json: string): AddEventListenerResponse { + return cast(JSON.parse(json), r("AddEventListenerResponse")); + } + + public static addEventListenerResponseToJson(value: AddEventListenerResponse): string { + return JSON.stringify(uncast(value, r("AddEventListenerResponse")), null, 2); + } + + public static toAddIntentListenerRequest(json: string): AddIntentListenerRequest { + return cast(JSON.parse(json), r("AddIntentListenerRequest")); + } + + public static addIntentListenerRequestToJson(value: AddIntentListenerRequest): string { + return JSON.stringify(uncast(value, r("AddIntentListenerRequest")), null, 2); + } + + public static toAddIntentListenerResponse(json: string): AddIntentListenerResponse { + return cast(JSON.parse(json), r("AddIntentListenerResponse")); + } + + public static addIntentListenerResponseToJson(value: AddIntentListenerResponse): string { + return JSON.stringify(uncast(value, r("AddIntentListenerResponse")), null, 2); + } + + public static toAgentEventMessage(json: string): AgentEventMessage { + return cast(JSON.parse(json), r("AgentEventMessage")); + } + + public static agentEventMessageToJson(value: AgentEventMessage): string { + return JSON.stringify(uncast(value, r("AgentEventMessage")), null, 2); + } + + public static toAgentResponseMessage(json: string): AgentResponseMessage { + return cast(JSON.parse(json), r("AgentResponseMessage")); + } + + public static agentResponseMessageToJson(value: AgentResponseMessage): string { + return JSON.stringify(uncast(value, r("AgentResponseMessage")), null, 2); + } + + public static toAppRequestMessage(json: string): AppRequestMessage { + return cast(JSON.parse(json), r("AppRequestMessage")); + } + + public static appRequestMessageToJson(value: AppRequestMessage): string { + return JSON.stringify(uncast(value, r("AppRequestMessage")), null, 2); + } + + public static toBroadcastEvent(json: string): BroadcastEvent { + return cast(JSON.parse(json), r("BroadcastEvent")); + } + + public static broadcastEventToJson(value: BroadcastEvent): string { + return JSON.stringify(uncast(value, r("BroadcastEvent")), null, 2); + } + + public static toBroadcastRequest(json: string): BroadcastRequest { + return cast(JSON.parse(json), r("BroadcastRequest")); + } + + public static broadcastRequestToJson(value: BroadcastRequest): string { + return JSON.stringify(uncast(value, r("BroadcastRequest")), null, 2); + } + + public static toBroadcastResponse(json: string): BroadcastResponse { + return cast(JSON.parse(json), r("BroadcastResponse")); + } + + public static broadcastResponseToJson(value: BroadcastResponse): string { + return JSON.stringify(uncast(value, r("BroadcastResponse")), null, 2); + } + + public static toChannelChangedEvent(json: string): ChannelChangedEvent { + return cast(JSON.parse(json), r("ChannelChangedEvent")); + } + + public static channelChangedEventToJson(value: ChannelChangedEvent): string { + return JSON.stringify(uncast(value, r("ChannelChangedEvent")), null, 2); + } + + public static toContextListenerUnsubscribeRequest(json: string): ContextListenerUnsubscribeRequest { + return cast(JSON.parse(json), r("ContextListenerUnsubscribeRequest")); + } + + public static contextListenerUnsubscribeRequestToJson(value: ContextListenerUnsubscribeRequest): string { + return JSON.stringify(uncast(value, r("ContextListenerUnsubscribeRequest")), null, 2); + } + + public static toContextListenerUnsubscribeResponse(json: string): ContextListenerUnsubscribeResponse { + return cast(JSON.parse(json), r("ContextListenerUnsubscribeResponse")); + } + + public static contextListenerUnsubscribeResponseToJson(value: ContextListenerUnsubscribeResponse): string { + return JSON.stringify(uncast(value, r("ContextListenerUnsubscribeResponse")), null, 2); + } + + public static toCreatePrivateChannelRequest(json: string): CreatePrivateChannelRequest { + return cast(JSON.parse(json), r("CreatePrivateChannelRequest")); + } + + public static createPrivateChannelRequestToJson(value: CreatePrivateChannelRequest): string { + return JSON.stringify(uncast(value, r("CreatePrivateChannelRequest")), null, 2); + } + + public static toCreatePrivateChannelResponse(json: string): CreatePrivateChannelResponse { + return cast(JSON.parse(json), r("CreatePrivateChannelResponse")); + } + + public static createPrivateChannelResponseToJson(value: CreatePrivateChannelResponse): string { + return JSON.stringify(uncast(value, r("CreatePrivateChannelResponse")), null, 2); + } + + public static toEventListenerUnsubscribeRequest(json: string): EventListenerUnsubscribeRequest { + return cast(JSON.parse(json), r("EventListenerUnsubscribeRequest")); + } + + public static eventListenerUnsubscribeRequestToJson(value: EventListenerUnsubscribeRequest): string { + return JSON.stringify(uncast(value, r("EventListenerUnsubscribeRequest")), null, 2); + } + + public static toEventListenerUnsubscribeResponse(json: string): EventListenerUnsubscribeResponse { + return cast(JSON.parse(json), r("EventListenerUnsubscribeResponse")); + } + + public static eventListenerUnsubscribeResponseToJson(value: EventListenerUnsubscribeResponse): string { + return JSON.stringify(uncast(value, r("EventListenerUnsubscribeResponse")), null, 2); + } + + public static toFindInstancesRequest(json: string): FindInstancesRequest { + return cast(JSON.parse(json), r("FindInstancesRequest")); + } + + public static findInstancesRequestToJson(value: FindInstancesRequest): string { + return JSON.stringify(uncast(value, r("FindInstancesRequest")), null, 2); + } + + public static toFindInstancesResponse(json: string): FindInstancesResponse { + return cast(JSON.parse(json), r("FindInstancesResponse")); + } + + public static findInstancesResponseToJson(value: FindInstancesResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesResponse")), null, 2); + } + + public static toFindIntentRequest(json: string): FindIntentRequest { + return cast(JSON.parse(json), r("FindIntentRequest")); + } + + public static findIntentRequestToJson(value: FindIntentRequest): string { + return JSON.stringify(uncast(value, r("FindIntentRequest")), null, 2); + } + + public static toFindIntentResponse(json: string): FindIntentResponse { + return cast(JSON.parse(json), r("FindIntentResponse")); + } + + public static findIntentResponseToJson(value: FindIntentResponse): string { + return JSON.stringify(uncast(value, r("FindIntentResponse")), null, 2); + } + + public static toFindIntentsByContextRequest(json: string): FindIntentsByContextRequest { + return cast(JSON.parse(json), r("FindIntentsByContextRequest")); + } + + public static findIntentsByContextRequestToJson(value: FindIntentsByContextRequest): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextRequest")), null, 2); + } + + public static toFindIntentsByContextResponse(json: string): FindIntentsByContextResponse { + return cast(JSON.parse(json), r("FindIntentsByContextResponse")); + } + + public static findIntentsByContextResponseToJson(value: FindIntentsByContextResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextResponse")), null, 2); + } + + public static toGetAppMetadataRequest(json: string): GetAppMetadataRequest { + return cast(JSON.parse(json), r("GetAppMetadataRequest")); + } + + public static getAppMetadataRequestToJson(value: GetAppMetadataRequest): string { + return JSON.stringify(uncast(value, r("GetAppMetadataRequest")), null, 2); + } + + public static toGetAppMetadataResponse(json: string): GetAppMetadataResponse { + return cast(JSON.parse(json), r("GetAppMetadataResponse")); + } + + public static getAppMetadataResponseToJson(value: GetAppMetadataResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataResponse")), null, 2); + } + + public static toGetCurrentChannelRequest(json: string): GetCurrentChannelRequest { + return cast(JSON.parse(json), r("GetCurrentChannelRequest")); + } + + public static getCurrentChannelRequestToJson(value: GetCurrentChannelRequest): string { + return JSON.stringify(uncast(value, r("GetCurrentChannelRequest")), null, 2); + } + + public static toGetCurrentChannelResponse(json: string): GetCurrentChannelResponse { + return cast(JSON.parse(json), r("GetCurrentChannelResponse")); + } + + public static getCurrentChannelResponseToJson(value: GetCurrentChannelResponse): string { + return JSON.stringify(uncast(value, r("GetCurrentChannelResponse")), null, 2); + } + + public static toGetCurrentContextRequest(json: string): GetCurrentContextRequest { + return cast(JSON.parse(json), r("GetCurrentContextRequest")); + } + + public static getCurrentContextRequestToJson(value: GetCurrentContextRequest): string { + return JSON.stringify(uncast(value, r("GetCurrentContextRequest")), null, 2); + } + + public static toGetCurrentContextResponse(json: string): GetCurrentContextResponse { + return cast(JSON.parse(json), r("GetCurrentContextResponse")); + } + + public static getCurrentContextResponseToJson(value: GetCurrentContextResponse): string { + return JSON.stringify(uncast(value, r("GetCurrentContextResponse")), null, 2); + } + + public static toGetInfoRequest(json: string): GetInfoRequest { + return cast(JSON.parse(json), r("GetInfoRequest")); + } + + public static getInfoRequestToJson(value: GetInfoRequest): string { + return JSON.stringify(uncast(value, r("GetInfoRequest")), null, 2); + } + + public static toGetInfoResponse(json: string): GetInfoResponse { + return cast(JSON.parse(json), r("GetInfoResponse")); + } + + public static getInfoResponseToJson(value: GetInfoResponse): string { + return JSON.stringify(uncast(value, r("GetInfoResponse")), null, 2); + } + + public static toGetOrCreateChannelRequest(json: string): GetOrCreateChannelRequest { + return cast(JSON.parse(json), r("GetOrCreateChannelRequest")); + } + + public static getOrCreateChannelRequestToJson(value: GetOrCreateChannelRequest): string { + return JSON.stringify(uncast(value, r("GetOrCreateChannelRequest")), null, 2); + } + + public static toGetOrCreateChannelResponse(json: string): GetOrCreateChannelResponse { + return cast(JSON.parse(json), r("GetOrCreateChannelResponse")); + } + + public static getOrCreateChannelResponseToJson(value: GetOrCreateChannelResponse): string { + return JSON.stringify(uncast(value, r("GetOrCreateChannelResponse")), null, 2); + } + + public static toGetUserChannelsRequest(json: string): GetUserChannelsRequest { + return cast(JSON.parse(json), r("GetUserChannelsRequest")); + } + + public static getUserChannelsRequestToJson(value: GetUserChannelsRequest): string { + return JSON.stringify(uncast(value, r("GetUserChannelsRequest")), null, 2); + } + + public static toGetUserChannelsResponse(json: string): GetUserChannelsResponse { + return cast(JSON.parse(json), r("GetUserChannelsResponse")); + } + + public static getUserChannelsResponseToJson(value: GetUserChannelsResponse): string { + return JSON.stringify(uncast(value, r("GetUserChannelsResponse")), null, 2); + } + + public static toIframeChannelDrag(json: string): IframeChannelDrag { + return cast(JSON.parse(json), r("IframeChannelDrag")); + } + + public static iframeChannelDragToJson(value: IframeChannelDrag): string { + return JSON.stringify(uncast(value, r("IframeChannelDrag")), null, 2); + } + + public static toIframeChannelResize(json: string): IframeChannelResize { + return cast(JSON.parse(json), r("IframeChannelResize")); + } + + public static iframeChannelResizeToJson(value: IframeChannelResize): string { + return JSON.stringify(uncast(value, r("IframeChannelResize")), null, 2); + } + + public static toIframeChannelSelected(json: string): IframeChannelSelected { + return cast(JSON.parse(json), r("IframeChannelSelected")); + } + + public static iframeChannelSelectedToJson(value: IframeChannelSelected): string { + return JSON.stringify(uncast(value, r("IframeChannelSelected")), null, 2); + } + + public static toIframeChannels(json: string): IframeChannels { + return cast(JSON.parse(json), r("IframeChannels")); + } + + public static iframeChannelsToJson(value: IframeChannels): string { + return JSON.stringify(uncast(value, r("IframeChannels")), null, 2); + } + + public static toIframeHandshake(json: string): IframeHandshake { + return cast(JSON.parse(json), r("IframeHandshake")); + } + + public static iframeHandshakeToJson(value: IframeHandshake): string { + return JSON.stringify(uncast(value, r("IframeHandshake")), null, 2); + } + + public static toIframeHello(json: string): IframeHello { + return cast(JSON.parse(json), r("IframeHello")); + } + + public static iframeHelloToJson(value: IframeHello): string { + return JSON.stringify(uncast(value, r("IframeHello")), null, 2); + } + + public static toIframeMessage(json: string): IframeMessage { + return cast(JSON.parse(json), r("IframeMessage")); + } + + public static iframeMessageToJson(value: IframeMessage): string { + return JSON.stringify(uncast(value, r("IframeMessage")), null, 2); + } + + public static toIframeResolve(json: string): IframeResolve { + return cast(JSON.parse(json), r("IframeResolve")); + } + + public static iframeResolveToJson(value: IframeResolve): string { + return JSON.stringify(uncast(value, r("IframeResolve")), null, 2); + } + + public static toIframeResolveAction(json: string): IframeResolveAction { + return cast(JSON.parse(json), r("IframeResolveAction")); + } + + public static iframeResolveActionToJson(value: IframeResolveAction): string { + return JSON.stringify(uncast(value, r("IframeResolveAction")), null, 2); + } + + public static toIntentEvent(json: string): IntentEvent { + return cast(JSON.parse(json), r("IntentEvent")); + } + + public static intentEventToJson(value: IntentEvent): string { + return JSON.stringify(uncast(value, r("IntentEvent")), null, 2); + } + + public static toIntentListenerUnsubscribeRequest(json: string): IntentListenerUnsubscribeRequest { + return cast(JSON.parse(json), r("IntentListenerUnsubscribeRequest")); + } + + public static intentListenerUnsubscribeRequestToJson(value: IntentListenerUnsubscribeRequest): string { + return JSON.stringify(uncast(value, r("IntentListenerUnsubscribeRequest")), null, 2); + } + + public static toIntentListenerUnsubscribeResponse(json: string): IntentListenerUnsubscribeResponse { + return cast(JSON.parse(json), r("IntentListenerUnsubscribeResponse")); + } + + public static intentListenerUnsubscribeResponseToJson(value: IntentListenerUnsubscribeResponse): string { + return JSON.stringify(uncast(value, r("IntentListenerUnsubscribeResponse")), null, 2); + } + + public static toIntentResultRequest(json: string): IntentResultRequest { + return cast(JSON.parse(json), r("IntentResultRequest")); + } + + public static intentResultRequestToJson(value: IntentResultRequest): string { + return JSON.stringify(uncast(value, r("IntentResultRequest")), null, 2); + } + + public static toIntentResultResponse(json: string): IntentResultResponse { + return cast(JSON.parse(json), r("IntentResultResponse")); + } + + public static intentResultResponseToJson(value: IntentResultResponse): string { + return JSON.stringify(uncast(value, r("IntentResultResponse")), null, 2); + } + + public static toJoinUserChannelRequest(json: string): JoinUserChannelRequest { + return cast(JSON.parse(json), r("JoinUserChannelRequest")); + } + + public static joinUserChannelRequestToJson(value: JoinUserChannelRequest): string { + return JSON.stringify(uncast(value, r("JoinUserChannelRequest")), null, 2); + } + + public static toJoinUserChannelResponse(json: string): JoinUserChannelResponse { + return cast(JSON.parse(json), r("JoinUserChannelResponse")); + } + + public static joinUserChannelResponseToJson(value: JoinUserChannelResponse): string { + return JSON.stringify(uncast(value, r("JoinUserChannelResponse")), null, 2); + } + + public static toLeaveCurrentChannelRequest(json: string): LeaveCurrentChannelRequest { + return cast(JSON.parse(json), r("LeaveCurrentChannelRequest")); + } + + public static leaveCurrentChannelRequestToJson(value: LeaveCurrentChannelRequest): string { + return JSON.stringify(uncast(value, r("LeaveCurrentChannelRequest")), null, 2); + } + + public static toLeaveCurrentChannelResponse(json: string): LeaveCurrentChannelResponse { + return cast(JSON.parse(json), r("LeaveCurrentChannelResponse")); + } + + public static leaveCurrentChannelResponseToJson(value: LeaveCurrentChannelResponse): string { + return JSON.stringify(uncast(value, r("LeaveCurrentChannelResponse")), null, 2); + } + + public static toOpenRequest(json: string): OpenRequest { + return cast(JSON.parse(json), r("OpenRequest")); + } + + public static openRequestToJson(value: OpenRequest): string { + return JSON.stringify(uncast(value, r("OpenRequest")), null, 2); + } + + public static toOpenResponse(json: string): OpenResponse { + return cast(JSON.parse(json), r("OpenResponse")); + } + + public static openResponseToJson(value: OpenResponse): string { + return JSON.stringify(uncast(value, r("OpenResponse")), null, 2); + } + + public static toPrivateChannelDisconnectRequest(json: string): PrivateChannelDisconnectRequest { + return cast(JSON.parse(json), r("PrivateChannelDisconnectRequest")); + } + + public static privateChannelDisconnectRequestToJson(value: PrivateChannelDisconnectRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelDisconnectRequest")), null, 2); + } + + public static toPrivateChannelDisconnectResponse(json: string): PrivateChannelDisconnectResponse { + return cast(JSON.parse(json), r("PrivateChannelDisconnectResponse")); + } + + public static privateChannelDisconnectResponseToJson(value: PrivateChannelDisconnectResponse): string { + return JSON.stringify(uncast(value, r("PrivateChannelDisconnectResponse")), null, 2); + } + + public static toPrivateChannelOnAddContextListenerEvent(json: string): PrivateChannelOnAddContextListenerEvent { + return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerEvent")); + } + + public static privateChannelOnAddContextListenerEventToJson(value: PrivateChannelOnAddContextListenerEvent): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerEvent")), null, 2); + } + + public static toPrivateChannelOnDisconnectEvent(json: string): PrivateChannelOnDisconnectEvent { + return cast(JSON.parse(json), r("PrivateChannelOnDisconnectEvent")); + } + + public static privateChannelOnDisconnectEventToJson(value: PrivateChannelOnDisconnectEvent): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectEvent")), null, 2); + } + + public static toPrivateChannelOnUnsubscribeEvent(json: string): PrivateChannelOnUnsubscribeEvent { + return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeEvent")); + } + + public static privateChannelOnUnsubscribeEventToJson(value: PrivateChannelOnUnsubscribeEvent): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeEvent")), null, 2); + } + + public static toPrivateChannelUnsubscribeEventListenerRequest(json: string): PrivateChannelUnsubscribeEventListenerRequest { + return cast(JSON.parse(json), r("PrivateChannelUnsubscribeEventListenerRequest")); + } + + public static privateChannelUnsubscribeEventListenerRequestToJson(value: PrivateChannelUnsubscribeEventListenerRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelUnsubscribeEventListenerRequest")), null, 2); + } + + public static toPrivateChannelUnsubscribeEventListenerResponse(json: string): PrivateChannelUnsubscribeEventListenerResponse { + return cast(JSON.parse(json), r("PrivateChannelUnsubscribeEventListenerResponse")); + } + + public static privateChannelUnsubscribeEventListenerResponseToJson(value: PrivateChannelUnsubscribeEventListenerResponse): string { + return JSON.stringify(uncast(value, r("PrivateChannelUnsubscribeEventListenerResponse")), null, 2); + } + + public static toPrivateChannelAddEventListenerRequest(json: string): PrivateChannelAddEventListenerRequest { + return cast(JSON.parse(json), r("PrivateChannelAddEventListenerRequest")); + } + + public static privateChannelAddEventListenerRequestToJson(value: PrivateChannelAddEventListenerRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelAddEventListenerRequest")), null, 2); + } + + public static toPrivateChannelAddEventListenerResponse(json: string): PrivateChannelAddEventListenerResponse { + return cast(JSON.parse(json), r("PrivateChannelAddEventListenerResponse")); + } + + public static privateChannelAddEventListenerResponseToJson(value: PrivateChannelAddEventListenerResponse): string { + return JSON.stringify(uncast(value, r("PrivateChannelAddEventListenerResponse")), null, 2); + } + + public static toRaiseIntentForContextRequest(json: string): RaiseIntentForContextRequest { + return cast(JSON.parse(json), r("RaiseIntentForContextRequest")); + } + + public static raiseIntentForContextRequestToJson(value: RaiseIntentForContextRequest): string { + return JSON.stringify(uncast(value, r("RaiseIntentForContextRequest")), null, 2); + } + + public static toRaiseIntentForContextResponse(json: string): RaiseIntentForContextResponse { + return cast(JSON.parse(json), r("RaiseIntentForContextResponse")); + } + + public static raiseIntentForContextResponseToJson(value: RaiseIntentForContextResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentForContextResponse")), null, 2); + } + + public static toRaiseIntentRequest(json: string): RaiseIntentRequest { + return cast(JSON.parse(json), r("RaiseIntentRequest")); + } + + public static raiseIntentRequestToJson(value: RaiseIntentRequest): string { + return JSON.stringify(uncast(value, r("RaiseIntentRequest")), null, 2); + } + + public static toRaiseIntentResponse(json: string): RaiseIntentResponse { + return cast(JSON.parse(json), r("RaiseIntentResponse")); + } + + public static raiseIntentResponseToJson(value: RaiseIntentResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResponse")), null, 2); + } + + public static toRaiseIntentResultResponse(json: string): RaiseIntentResultResponse { + return cast(JSON.parse(json), r("RaiseIntentResultResponse")); + } + + public static raiseIntentResultResponseToJson(value: RaiseIntentResultResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultResponse")), null, 2); + } +} + +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { + const prettyTyp = prettyTypeName(typ); + const parentText = parent ? ` on ${parent}` : ''; + const keyText = key ? ` for key "${key}"` : ''; + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); +} + +function prettyTypeName(typ: any): string { + if (Array.isArray(typ)) { + if (typ.length === 2 && typ[0] === undefined) { + return `an optional ${prettyTypeName(typ[1])}`; + } else { + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; + } + } else if (typeof typ === "object" && typ.literal !== undefined) { + return typ.literal; + } else { + return typeof typ; + } +} + +function jsonToJSProps(typ: any): any { + if (typ.jsonToJS === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); + typ.jsonToJS = map; + } + return typ.jsonToJS; +} + +function jsToJSONProps(typ: any): any { + if (typ.jsToJSON === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); + typ.jsToJSON = map; + } + return typ.jsToJSON; +} + +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { + function transformPrimitive(typ: string, val: any): any { + if (typeof typ === typeof val) return val; + return invalidValue(typ, val, key, parent); + } + + function transformUnion(typs: any[], val: any): any { + // val must validate against one typ in typs + const l = typs.length; + for (let i = 0; i < l; i++) { + const typ = typs[i]; + try { + return transform(val, typ, getProps); + } catch (_) {} + } + return invalidValue(typs, val, key, parent); + } + + function transformEnum(cases: string[], val: any): any { + if (cases.indexOf(val) !== -1) return val; + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); + } + + function transformArray(typ: any, val: any): any { + // val must be an array with no invalid elements + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); + return val.map(el => transform(el, typ, getProps)); + } + + function transformDate(val: any): any { + if (val === null) { + return null; + } + const d = new Date(val); + if (isNaN(d.valueOf())) { + return invalidValue(l("Date"), val, key, parent); + } + return d; + } + + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { + if (val === null || typeof val !== "object" || Array.isArray(val)) { + return invalidValue(l(ref || "object"), val, key, parent); + } + const result: any = {}; + Object.getOwnPropertyNames(props).forEach(key => { + const prop = props[key]; + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; + result[prop.key] = transform(v, prop.typ, getProps, key, ref); + }); + Object.getOwnPropertyNames(val).forEach(key => { + if (!Object.prototype.hasOwnProperty.call(props, key)) { + result[key] = transform(val[key], additional, getProps, key, ref); + } + }); + return result; + } + + if (typ === "any") return val; + if (typ === null) { + if (val === null) return val; + return invalidValue(typ, val, key, parent); + } + if (typ === false) return invalidValue(typ, val, key, parent); + let ref: any = undefined; + while (typeof typ === "object" && typ.ref !== undefined) { + ref = typ.ref; + typ = typeMap[typ.ref]; + } + if (Array.isArray(typ)) return transformEnum(typ, val); + if (typeof typ === "object") { + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) + : invalidValue(typ, val, key, parent); + } + // Numbers can be parsed by Date but shouldn't be. + if (typ === Date && typeof val !== "number") return transformDate(val); + return transformPrimitive(typ, val); +} + +function cast(val: any, typ: any): T { + return transform(val, typ, jsonToJSProps); +} + +function uncast(val: T, typ: any): any { + return transform(val, typ, jsToJSONProps); +} + +function l(typ: any) { + return { literal: typ }; +} + +function a(typ: any) { + return { arrayItems: typ }; +} + +function u(...typs: any[]) { + return { unionMembers: typs }; +} + +function o(props: any[], additional: any) { + return { props, additional }; +} + +function m(additional: any) { + return { props: [], additional }; +} + +function r(name: string) { + return { ref: name }; +} + +const typeMap: any = { + "WebConnectionProtocol1Hello": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol1HelloPayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol1HelloType") }, + ], false), + "ConnectionStepMetadata": o([ + { json: "connectionAttemptUuid", js: "connectionAttemptUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "WebConnectionProtocol1HelloPayload": o([ + { json: "channelSelector", js: "channelSelector", typ: u(undefined, true) }, + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "identityUrl", js: "identityUrl", typ: "" }, + { json: "resolver", js: "resolver", typ: u(undefined, true) }, + ], "any"), + "WebConnectionProtocol2LoadURL": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol2LoadURLPayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol2LoadURLType") }, + ], false), + "WebConnectionProtocol2LoadURLPayload": o([ + { json: "iframeUrl", js: "iframeUrl", typ: "" }, + ], "any"), + "WebConnectionProtocol3Handshake": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol3HandshakePayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol3HandshakeType") }, + ], false), + "WebConnectionProtocol3HandshakePayload": o([ + { json: "channelSelector", js: "channelSelector", typ: u(true, "") }, + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "resolver", js: "resolver", typ: u(true, "") }, + ], false), + "WebConnectionProtocol4ValidateAppIdentity": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol4ValidateAppIdentityPayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol4ValidateAppIdentityType") }, + ], false), + "WebConnectionProtocol4ValidateAppIdentityPayload": o([ + { json: "identityUrl", js: "identityUrl", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + { json: "instanceUuid", js: "instanceUuid", typ: u(undefined, "") }, + ], false), + "WebConnectionProtocol5ValidateAppIdentityFailedResponse": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol5ValidateAppIdentityFailedResponseType") }, + ], false), + "WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload": o([ + { json: "message", js: "message", typ: u(undefined, "") }, + ], false), + "WebConnectionProtocol5ValidateAppIdentitySuccessResponse": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol5ValidateAppIdentitySuccessResponseType") }, + ], false), + "WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "implementationMetadata", js: "implementationMetadata", typ: r("ImplementationMetadata") }, + { json: "instanceId", js: "instanceId", typ: "" }, + { json: "instanceUuid", js: "instanceUuid", typ: "" }, + ], false), + "ImplementationMetadata": o([ + { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, + { json: "provider", js: "provider", typ: "" }, + { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, + ], false), + "AppMetadata": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "description", js: "description", typ: u(undefined, "") }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "icons", js: "icons", typ: u(undefined, a(r("Icon"))) }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + { json: "instanceMetadata", js: "instanceMetadata", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "resultType", js: "resultType", typ: u(undefined, u(null, "")) }, + { json: "screenshots", js: "screenshots", typ: u(undefined, a(r("Image"))) }, + { json: "title", js: "title", typ: u(undefined, "") }, + { json: "tooltip", js: "tooltip", typ: u(undefined, "") }, + { json: "version", js: "version", typ: u(undefined, "") }, + ], false), + "Icon": o([ + { json: "size", js: "size", typ: u(undefined, "") }, + { json: "src", js: "src", typ: "" }, + { json: "type", js: "type", typ: u(undefined, "") }, + ], false), + "Image": o([ + { json: "label", js: "label", typ: u(undefined, "") }, + { json: "size", js: "size", typ: u(undefined, "") }, + { json: "src", js: "src", typ: "" }, + { json: "type", js: "type", typ: u(undefined, "") }, + ], false), + "OptionalFeatures": o([ + { json: "DesktopAgentBridging", js: "DesktopAgentBridging", typ: true }, + { json: "OriginatingAppMetadata", js: "OriginatingAppMetadata", typ: true }, + { json: "UserChannelMembershipAPIs", js: "UserChannelMembershipAPIs", typ: true }, + ], false), + "WebConnectionProtocol6Goodbye": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol6GoodbyeType") }, + ], false), + "WebConnectionProtocolMessage": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("ConnectionStepMessageType") }, + ], false), + "AddContextListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("AddContextListenerRequestPayload") }, + { json: "type", js: "type", typ: r("AddContextListenerRequestType") }, + ], false), + "AddContextListenerRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AppIdentifier": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "AddContextListenerRequestPayload": o([ + { json: "channelId", js: "channelId", typ: u(null, "") }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "AddContextListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("AddContextListenerResponsePayload") }, + { json: "type", js: "type", typ: r("AddContextListenerResponseType") }, + ], false), + "AddContextListenerResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AddContextListenerResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, + ], false), + "AddEventListenerEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("AddEventListenerEventPayload") }, + { json: "type", js: "type", typ: r("AddEventListenerEventType") }, + ], false), + "AddEventListenerEventMeta": o([ + { json: "eventUuid", js: "eventUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AddEventListenerEventPayload": o([ + { json: "event", js: "event", typ: r("FDC3Event") }, + ], false), + "FDC3Event": o([ + { json: "details", js: "details", typ: m("any") }, + { json: "type", js: "type", typ: r("FDC3EventType") }, + ], false), + "AddEventListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("AddEventListenerRequestPayload") }, + { json: "type", js: "type", typ: r("AddEventListenerRequestType") }, + ], false), + "AddEventListenerRequestPayload": o([ + { json: "type", js: "type", typ: r("FDC3EventType") }, + ], false), + "AddEventListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("AddEventListenerResponsePayload") }, + { json: "type", js: "type", typ: r("AddEventListenerResponseType") }, + ], false), + "AddEventListenerResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, + ], false), + "AddIntentListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("AddIntentListenerRequestPayload") }, + { json: "type", js: "type", typ: r("AddIntentListenerRequestType") }, + ], false), + "AddIntentListenerRequestPayload": o([ + { json: "intent", js: "intent", typ: "" }, + ], false), + "AddIntentListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("AddIntentListenerResponsePayload") }, + { json: "type", js: "type", typ: r("AddIntentListenerResponseType") }, + ], false), + "AddIntentListenerResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FluffyError")) }, + { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, + ], "any"), + "AgentEventMessage": o([ + { json: "meta", js: "meta", typ: r("AgentEventMessageMeta") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("EventMessageType") }, + ], false), + "AgentEventMessageMeta": o([ + { json: "eventUuid", js: "eventUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AgentResponseMessage": o([ + { json: "meta", js: "meta", typ: r("AgentResponseMessageMeta") }, + { json: "payload", js: "payload", typ: r("AgentResponseMessageResponsePayload") }, + { json: "type", js: "type", typ: r("ResponseMessageType") }, + ], false), + "AgentResponseMessageMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AgentResponseMessageResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + ], "any"), + "AppRequestMessage": o([ + { json: "meta", js: "meta", typ: r("AppRequestMessageMeta") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("RequestMessageType") }, + ], false), + "AppRequestMessageMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "BroadcastEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastEventPayload") }, + { json: "type", js: "type", typ: r("BroadcastEventType") }, + ], false), + "BroadcastEventPayload": o([ + { json: "channelId", js: "channelId", typ: u(null, "") }, + { json: "context", js: "context", typ: r("Context") }, + { json: "originatingApp", js: "originatingApp", typ: u(undefined, r("AppIdentifier")) }, + ], false), + "Context": o([ + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: "" }, + ], "any"), + "BroadcastRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastRequestPayload") }, + { json: "type", js: "type", typ: r("BroadcastRequestType") }, + ], false), + "BroadcastRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "BroadcastResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("BroadcastResponseType") }, + ], false), + "BroadcastResponseResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + ], "any"), + "ChannelChangedEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("ChannelChangedEventPayload") }, + { json: "type", js: "type", typ: r("ChannelChangedEventType") }, + ], false), + "ChannelChangedEventPayload": o([ + { json: "newChannelId", js: "newChannelId", typ: u(null, "") }, + ], false), + "ContextListenerUnsubscribeRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("ContextListenerUnsubscribeRequestPayload") }, + { json: "type", js: "type", typ: r("ContextListenerUnsubscribeRequestType") }, + ], false), + "ContextListenerUnsubscribeRequestPayload": o([ + { json: "listenerUUID", js: "listenerUUID", typ: "" }, + ], false), + "ContextListenerUnsubscribeResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("ContextListenerUnsubscribeResponseType") }, + ], false), + "CreatePrivateChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("CreatePrivateChannelRequestPayload") }, + { json: "type", js: "type", typ: r("CreatePrivateChannelRequestType") }, + ], false), + "CreatePrivateChannelRequestPayload": o([ + ], false), + "CreatePrivateChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("CreatePrivateChannelResponsePayload") }, + { json: "type", js: "type", typ: r("CreatePrivateChannelResponseType") }, + ], false), + "CreatePrivateChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "privateChannel", js: "privateChannel", typ: u(undefined, r("Channel")) }, + ], false), + "Channel": o([ + { json: "displayMetadata", js: "displayMetadata", typ: u(undefined, r("DisplayMetadata")) }, + { json: "id", js: "id", typ: "" }, + { json: "type", js: "type", typ: r("Type") }, + ], false), + "DisplayMetadata": o([ + { json: "color", js: "color", typ: u(undefined, "") }, + { json: "glyph", js: "glyph", typ: u(undefined, "") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], false), + "EventListenerUnsubscribeRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("EventListenerUnsubscribeRequestPayload") }, + { json: "type", js: "type", typ: r("EventListenerUnsubscribeRequestType") }, + ], false), + "EventListenerUnsubscribeRequestPayload": o([ + { json: "listenerUUID", js: "listenerUUID", typ: "" }, + ], false), + "EventListenerUnsubscribeResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("EventListenerUnsubscribeResponseType") }, + ], false), + "FindInstancesRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesRequestPayload") }, + { json: "type", js: "type", typ: r("FindInstancesRequestType") }, + ], false), + "FindInstancesRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + ], false), + "FindInstancesResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesResponsePayload") }, + { json: "type", js: "type", typ: r("FindInstancesResponseType") }, + ], false), + "FindInstancesResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "appIdentifiers", js: "appIdentifiers", typ: u(undefined, a(r("AppMetadata"))) }, + ], false), + "FindIntentRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentRequestType") }, + ], false), + "FindIntentRequestPayload": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "intent", js: "intent", typ: "" }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentResponseType") }, + ], false), + "FindIntentResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "appIntent", js: "appIntent", typ: u(undefined, r("AppIntent")) }, + ], false), + "AppIntent": o([ + { json: "apps", js: "apps", typ: a(r("AppMetadata")) }, + { json: "intent", js: "intent", typ: r("IntentMetadata") }, + ], false), + "IntentMetadata": o([ + { json: "displayName", js: "displayName", typ: u(undefined, "") }, + { json: "name", js: "name", typ: "" }, + ], false), + "FindIntentsByContextRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextRequestType") }, + ], false), + "FindIntentsByContextRequestPayload": o([ + { json: "context", js: "context", typ: r("Context") }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentsByContextResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextResponseType") }, + ], false), + "FindIntentsByContextResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "appIntents", js: "appIntents", typ: u(undefined, a(r("AppIntent"))) }, + ], false), + "GetAppMetadataRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataRequestPayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataRequestType") }, + ], false), + "GetAppMetadataRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + ], false), + "GetAppMetadataResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataResponseType") }, + ], false), + "GetAppMetadataResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "appMetadata", js: "appMetadata", typ: u(undefined, r("AppMetadata")) }, + ], false), + "GetCurrentChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetCurrentChannelRequestPayload") }, + { json: "type", js: "type", typ: r("GetCurrentChannelRequestType") }, + ], false), + "GetCurrentChannelRequestPayload": o([ + ], false), + "GetCurrentChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetCurrentChannelResponsePayload") }, + { json: "type", js: "type", typ: r("GetCurrentChannelResponseType") }, + ], false), + "GetCurrentChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + { json: "channel", js: "channel", typ: u(undefined, u(r("Channel"), null)) }, + ], false), + "GetCurrentContextRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetCurrentContextRequestPayload") }, + { json: "type", js: "type", typ: r("GetCurrentContextRequestType") }, + ], false), + "GetCurrentContextRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "GetCurrentContextResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetCurrentContextResponsePayload") }, + { json: "type", js: "type", typ: r("GetCurrentContextResponseType") }, + ], false), + "GetCurrentContextResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "context", js: "context", typ: u(undefined, u(null, r("Context"))) }, + ], false), + "GetInfoRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetInfoRequestPayload") }, + { json: "type", js: "type", typ: r("GetInfoRequestType") }, + ], false), + "GetInfoRequestPayload": o([ + ], false), + "GetInfoResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetInfoResponsePayload") }, + { json: "type", js: "type", typ: r("GetInfoResponseType") }, + ], false), + "GetInfoResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + { json: "implementationMetadata", js: "implementationMetadata", typ: u(undefined, r("ImplementationMetadata")) }, + ], false), + "GetOrCreateChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetOrCreateChannelRequestPayload") }, + { json: "type", js: "type", typ: r("GetOrCreateChannelRequestType") }, + ], false), + "GetOrCreateChannelRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "GetOrCreateChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetOrCreateChannelResponsePayload") }, + { json: "type", js: "type", typ: r("GetOrCreateChannelResponseType") }, + ], false), + "GetOrCreateChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, + ], false), + "GetUserChannelsRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetUserChannelsRequestPayload") }, + { json: "type", js: "type", typ: r("GetUserChannelsRequestType") }, + ], false), + "GetUserChannelsRequestPayload": o([ + ], false), + "GetUserChannelsResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetUserChannelsResponsePayload") }, + { json: "type", js: "type", typ: r("GetUserChannelsResponseType") }, + ], false), + "GetUserChannelsResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "userChannels", js: "userChannels", typ: u(undefined, a(r("Channel"))) }, + ], false), + "IframeChannelDrag": o([ + { json: "payload", js: "payload", typ: r("IframeChannelDragPayload") }, + { json: "type", js: "type", typ: r("IframeChannelDragType") }, + ], false), + "IframeChannelDragPayload": o([ + { json: "mouse", js: "mouse", typ: r("MouseClass") }, + ], false), + "MouseClass": o([ + { json: "offsetX", js: "offsetX", typ: 0 }, + { json: "offsetY", js: "offsetY", typ: 0 }, + ], false), + "IframeChannelResize": o([ + { json: "payload", js: "payload", typ: r("IframeChannelResizePayload") }, + { json: "type", js: "type", typ: r("IframeChannelResizeType") }, + ], false), + "IframeChannelResizePayload": o([ + { json: "dimensions", js: "dimensions", typ: r("DimensionsClass") }, + { json: "resizeAnchor", js: "resizeAnchor", typ: r("Resizing") }, + ], false), + "DimensionsClass": o([ + { json: "height", js: "height", typ: 0 }, + { json: "width", js: "width", typ: 0 }, + ], false), + "IframeChannelSelected": o([ + { json: "payload", js: "payload", typ: r("IframeChannelSelectedPayload") }, + { json: "type", js: "type", typ: r("IframeChannelSelectedType") }, + ], false), + "IframeChannelSelectedPayload": o([ + { json: "selected", js: "selected", typ: u(null, "") }, + ], false), + "IframeChannels": o([ + { json: "payload", js: "payload", typ: r("IframeChannelsPayload") }, + { json: "type", js: "type", typ: r("IframeChannelsType") }, + ], false), + "IframeChannelsPayload": o([ + { json: "location", js: "location", typ: u(undefined, r("Location")) }, + { json: "selected", js: "selected", typ: u(null, "") }, + { json: "userChannels", js: "userChannels", typ: a(r("Channel")) }, + ], false), + "Location": o([ + { json: "x", js: "x", typ: 0 }, + { json: "y", js: "y", typ: 0 }, + ], false), + "IframeHandshake": o([ + { json: "payload", js: "payload", typ: r("IframeHandshakePayload") }, + { json: "type", js: "type", typ: r("IframeHandshakeType") }, + ], false), + "IframeHandshakePayload": o([ + { json: "implementationDetails", js: "implementationDetails", typ: "" }, + ], false), + "IframeHello": o([ + { json: "payload", js: "payload", typ: r("IframeHelloPayload") }, + { json: "type", js: "type", typ: r("IframeHelloType") }, + ], false), + "IframeHelloPayload": o([ + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + ], false), + "IframeMessage": o([ + { json: "payload", js: "payload", typ: u(undefined, m("any")) }, + { json: "type", js: "type", typ: r("IframeMessageType") }, + ], false), + "IframeResolve": o([ + { json: "payload", js: "payload", typ: r("IframeResolvePayload") }, + { json: "type", js: "type", typ: r("IframeResolveType") }, + ], false), + "IframeResolvePayload": o([ + { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "IframeResolveAction": o([ + { json: "payload", js: "payload", typ: r("IframeResolveActionPayload") }, + { json: "type", js: "type", typ: r("IframeResolveActionType") }, + ], false), + "IframeResolveActionPayload": o([ + { json: "action", js: "action", typ: r("Action") }, + { json: "appIdentifier", js: "appIdentifier", typ: u(undefined, r("AppIdentifier")) }, + { json: "intent", js: "intent", typ: u(undefined, "") }, + ], false), + "IntentEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("IntentEventPayload") }, + { json: "type", js: "type", typ: r("IntentEventType") }, + ], false), + "IntentEventPayload": o([ + { json: "context", js: "context", typ: r("Context") }, + { json: "intent", js: "intent", typ: "" }, + { json: "originatingApp", js: "originatingApp", typ: u(undefined, r("AppIdentifier")) }, + ], false), + "IntentListenerUnsubscribeRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("IntentListenerUnsubscribeRequestPayload") }, + { json: "type", js: "type", typ: r("IntentListenerUnsubscribeRequestType") }, + ], false), + "IntentListenerUnsubscribeRequestPayload": o([ + { json: "listenerUUID", js: "listenerUUID", typ: "" }, + ], false), + "IntentListenerUnsubscribeResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("IntentListenerUnsubscribeResponseType") }, + ], false), + "IntentResultRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("IntentResultRequestPayload") }, + { json: "type", js: "type", typ: r("IntentResultRequestType") }, + ], false), + "IntentResultRequestPayload": o([ + { json: "intentResult", js: "intentResult", typ: r("PurpleIntentResult") }, + ], false), + "PurpleIntentResult": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, + ], false), + "IntentResultResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("IntentResultResponseType") }, + ], false), + "JoinUserChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("JoinUserChannelRequestPayload") }, + { json: "type", js: "type", typ: r("JoinUserChannelRequestType") }, + ], false), + "JoinUserChannelRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "JoinUserChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("JoinUserChannelResponsePayload") }, + { json: "type", js: "type", typ: r("JoinUserChannelResponseType") }, + ], false), + "JoinUserChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + ], false), + "LeaveCurrentChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("LeaveCurrentChannelRequestPayload") }, + { json: "type", js: "type", typ: r("LeaveCurrentChannelRequestType") }, + ], false), + "LeaveCurrentChannelRequestPayload": o([ + ], false), + "LeaveCurrentChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("LeaveCurrentChannelResponsePayload") }, + { json: "type", js: "type", typ: r("LeaveCurrentChannelResponseType") }, + ], false), + "LeaveCurrentChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + ], false), + "OpenRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("OpenRequestPayload") }, + { json: "type", js: "type", typ: r("OpenRequestType") }, + ], false), + "OpenRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + ], false), + "OpenResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenResponsePayload") }, + { json: "type", js: "type", typ: r("OpenResponseType") }, + ], false), + "OpenResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("OpenErrorResponsePayload")) }, + { json: "appIdentifier", js: "appIdentifier", typ: u(undefined, r("AppIdentifier")) }, + ], false), + "PrivateChannelDisconnectRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelDisconnectRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelDisconnectRequestType") }, + ], false), + "PrivateChannelDisconnectRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "PrivateChannelDisconnectResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelDisconnectResponsePayload") }, + { json: "type", js: "type", typ: r("PrivateChannelDisconnectResponseType") }, + ], false), + "PrivateChannelDisconnectResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + ], false), + "PrivateChannelOnAddContextListenerEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerEventPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerEventType") }, + ], false), + "PrivateChannelOnAddContextListenerEventPayload": o([ + { json: "contextType", js: "contextType", typ: u(null, "") }, + { json: "privateChannelId", js: "privateChannelId", typ: "" }, + ], false), + "PrivateChannelOnDisconnectEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectEventPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectEventType") }, + ], false), + "PrivateChannelOnDisconnectEventPayload": o([ + { json: "privateChannelId", js: "privateChannelId", typ: "" }, + ], false), + "PrivateChannelOnUnsubscribeEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeEventPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeEventType") }, + ], false), + "PrivateChannelOnUnsubscribeEventPayload": o([ + { json: "contextType", js: "contextType", typ: u(null, "") }, + { json: "privateChannelId", js: "privateChannelId", typ: "" }, + ], false), + "PrivateChannelUnsubscribeEventListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelUnsubscribeEventListenerRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelUnsubscribeEventListenerRequestType") }, + ], false), + "PrivateChannelUnsubscribeEventListenerRequestPayload": o([ + { json: "listenerUUID", js: "listenerUUID", typ: "" }, + ], false), + "PrivateChannelUnsubscribeEventListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("PrivateChannelUnsubscribeEventListenerResponseType") }, + ], false), + "PrivateChannelAddEventListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("TPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelAddEventListenerRequestType") }, + ], false), + "TPayload": o([ + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + { json: "privateChannelId", js: "privateChannelId", typ: "" }, + ], false), + "PrivateChannelAddEventListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelAddEventListenerResponsePayload") }, + { json: "type", js: "type", typ: r("PrivateChannelAddEventListenerResponseType") }, + ], false), + "PrivateChannelAddEventListenerResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, + ], "any"), + "RaiseIntentForContextRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentForContextRequestPayload") }, + { json: "type", js: "type", typ: r("RaiseIntentForContextRequestType") }, + ], false), + "RaiseIntentForContextRequestPayload": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "RaiseIntentForContextResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentForContextResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentForContextResponseType") }, + ], false), + "RaiseIntentForContextResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "intentResolution", js: "intentResolution", typ: u(undefined, r("IntentResolution")) }, + { json: "appIntents", js: "appIntents", typ: u(undefined, a(r("AppIntent"))) }, + ], false), + "IntentResolution": o([ + { json: "intent", js: "intent", typ: "" }, + { json: "source", js: "source", typ: r("AppIdentifier") }, + ], false), + "RaiseIntentRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentRequestPayload") }, + { json: "type", js: "type", typ: r("RaiseIntentRequestType") }, + ], false), + "RaiseIntentRequestPayload": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: r("Context") }, + { json: "intent", js: "intent", typ: "" }, + ], false), + "RaiseIntentResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResponseType") }, + ], false), + "RaiseIntentResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "intentResolution", js: "intentResolution", typ: u(undefined, r("IntentResolution")) }, + { json: "appIntent", js: "appIntent", typ: u(undefined, r("AppIntent")) }, + ], false), + "RaiseIntentResultResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultResponseType") }, + ], false), + "RaiseIntentResultResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + { json: "intentResult", js: "intentResult", typ: u(undefined, r("FluffyIntentResult")) }, + ], false), + "FluffyIntentResult": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, + ], false), + "WebConnectionProtocol1HelloType": [ + "WCP1Hello", + ], + "WebConnectionProtocol2LoadURLType": [ + "WCP2LoadUrl", + ], + "WebConnectionProtocol3HandshakeType": [ + "WCP3Handshake", + ], + "WebConnectionProtocol4ValidateAppIdentityType": [ + "WCP4ValidateAppIdentity", + ], + "WebConnectionProtocol5ValidateAppIdentityFailedResponseType": [ + "WCP5ValidateAppIdentityFailedResponse", + ], + "WebConnectionProtocol5ValidateAppIdentitySuccessResponseType": [ + "WCP5ValidateAppIdentityResponse", + ], + "WebConnectionProtocol6GoodbyeType": [ + "WCP6Goodbye", + ], + "ConnectionStepMessageType": [ + "WCP1Hello", + "WCP2LoadUrl", + "WCP3Handshake", + "WCP4ValidateAppIdentity", + "WCP5ValidateAppIdentityFailedResponse", + "WCP5ValidateAppIdentityResponse", + "WCP6Goodbye", + ], + "AddContextListenerRequestType": [ + "addContextListenerRequest", + ], + "PurpleError": [ + "AccessDenied", + "CreationFailed", + "MalformedContext", + "NoChannelFound", + ], + "AddContextListenerResponseType": [ + "addContextListenerResponse", + ], + "FDC3EventType": [ + "USER_CHANNEL_CHANGED", + ], + "AddEventListenerEventType": [ + "addEventListenerEvent", + ], + "AddEventListenerRequestType": [ + "addEventListenerRequest", + ], + "ResponsePayloadError": [ + "AccessDenied", + "AgentDisconnected", + "AppNotFound", + "AppTimeout", + "CreationFailed", + "DesktopAgentNotFound", + "ErrorOnLaunch", + "IntentDeliveryFailed", + "IntentHandlerRejected", + "MalformedContext", + "MalformedMessage", + "NoAppsFound", + "NoChannelFound", + "NoResultReturned", + "NotConnectedToBridge", + "ResolverTimeout", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "AddEventListenerResponseType": [ + "addEventListenerResponse", + ], + "AddIntentListenerRequestType": [ + "addIntentListenerRequest", + ], + "FluffyError": [ + "DesktopAgentNotFound", + "IntentDeliveryFailed", + "MalformedContext", + "NoAppsFound", + "ResolverTimeout", + "ResolverUnavailable", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "AddIntentListenerResponseType": [ + "addIntentListenerResponse", + ], + "EventMessageType": [ + "addEventListenerEvent", + "broadcastEvent", + "channelChangedEvent", + "intentEvent", + "privateChannelOnAddContextListenerEvent", + "privateChannelOnDisconnectEvent", + "privateChannelOnUnsubscribeEvent", + ], + "ResponseMessageType": [ + "addContextListenerResponse", + "addEventListenerResponse", + "addIntentListenerResponse", + "broadcastResponse", + "contextListenerUnsubscribeResponse", + "createPrivateChannelResponse", + "eventListenerUnsubscribeResponse", + "findInstancesResponse", + "findIntentResponse", + "findIntentsByContextResponse", + "getAppMetadataResponse", + "getCurrentChannelResponse", + "getCurrentContextResponse", + "getInfoResponse", + "getOrCreateChannelResponse", + "getUserChannelsResponse", + "intentListenerUnsubscribeResponse", + "intentResultResponse", + "joinUserChannelResponse", + "leaveCurrentChannelResponse", + "openResponse", + "privateChannelAddEventListenerResponse", + "privateChannelDisconnectResponse", + "privateChannelUnsubscribeEventListenerResponse", + "raiseIntentForContextResponse", + "raiseIntentResponse", + "raiseIntentResultResponse", + ], + "RequestMessageType": [ + "addContextListenerRequest", + "addEventListenerRequest", + "addIntentListenerRequest", + "broadcastRequest", + "contextListenerUnsubscribeRequest", + "createPrivateChannelRequest", + "eventListenerUnsubscribeRequest", + "findInstancesRequest", + "findIntentRequest", + "findIntentsByContextRequest", + "getAppMetadataRequest", + "getCurrentChannelRequest", + "getCurrentContextRequest", + "getInfoRequest", + "getOrCreateChannelRequest", + "getUserChannelsRequest", + "intentListenerUnsubscribeRequest", + "intentResultRequest", + "joinUserChannelRequest", + "leaveCurrentChannelRequest", + "openRequest", + "privateChannelAddEventListenerRequest", + "privateChannelDisconnectRequest", + "privateChannelUnsubscribeEventListenerRequest", + "raiseIntentForContextRequest", + "raiseIntentRequest", + ], + "BroadcastEventType": [ + "broadcastEvent", + ], + "BroadcastRequestType": [ + "broadcastRequest", + ], + "BroadcastResponseType": [ + "broadcastResponse", + ], + "ChannelChangedEventType": [ + "channelChangedEvent", + ], + "ContextListenerUnsubscribeRequestType": [ + "contextListenerUnsubscribeRequest", + ], + "ContextListenerUnsubscribeResponseType": [ + "contextListenerUnsubscribeResponse", + ], + "CreatePrivateChannelRequestType": [ + "createPrivateChannelRequest", + ], + "Type": [ + "app", + "private", + "user", + ], + "CreatePrivateChannelResponseType": [ + "createPrivateChannelResponse", + ], + "EventListenerUnsubscribeRequestType": [ + "eventListenerUnsubscribeRequest", + ], + "EventListenerUnsubscribeResponseType": [ + "eventListenerUnsubscribeResponse", + ], + "FindInstancesRequestType": [ + "findInstancesRequest", + ], + "FindInstancesErrors": [ + "AgentDisconnected", + "DesktopAgentNotFound", + "IntentDeliveryFailed", + "MalformedContext", + "MalformedMessage", + "NoAppsFound", + "NotConnectedToBridge", + "ResolverTimeout", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "FindInstancesResponseType": [ + "findInstancesResponse", + ], + "FindIntentRequestType": [ + "findIntentRequest", + ], + "FindIntentResponseType": [ + "findIntentResponse", + ], + "FindIntentsByContextRequestType": [ + "findIntentsByContextRequest", + ], + "FindIntentsByContextResponseType": [ + "findIntentsByContextResponse", + ], + "GetAppMetadataRequestType": [ + "getAppMetadataRequest", + ], + "GetAppMetadataResponseType": [ + "getAppMetadataResponse", + ], + "GetCurrentChannelRequestType": [ + "getCurrentChannelRequest", + ], + "GetCurrentChannelResponseType": [ + "getCurrentChannelResponse", + ], + "GetCurrentContextRequestType": [ + "getCurrentContextRequest", + ], + "GetCurrentContextResponseType": [ + "getCurrentContextResponse", + ], + "GetInfoRequestType": [ + "getInfoRequest", + ], + "GetInfoResponseType": [ + "getInfoResponse", + ], + "GetOrCreateChannelRequestType": [ + "getOrCreateChannelRequest", + ], + "GetOrCreateChannelResponseType": [ + "getOrCreateChannelResponse", + ], + "GetUserChannelsRequestType": [ + "getUserChannelsRequest", + ], + "GetUserChannelsResponseType": [ + "getUserChannelsResponse", + ], + "IframeChannelDragType": [ + "iframeChannelDrag", + ], + "Resizing": [ + "bottom", + "bottom-left", + "bottom-right", + "center", + "left", + "right", + "top", + "top-left", + "top-right", + ], + "IframeChannelResizeType": [ + "iframeChannelResize", + ], + "IframeChannelSelectedType": [ + "iframeChannelSelected", + ], + "IframeChannelsType": [ + "iframeChannels", + ], + "IframeHandshakeType": [ + "iframeHandshake", + ], + "IframeHelloType": [ + "iframeHello", + ], + "IframeMessageType": [ + "iframeChannelDrag", + "iframeChannelResize", + "iframeChannelSelected", + "iframeChannels", + "iframeHandshake", + "iframeHello", + "iframeResolve", + "iframeResolveAction", + ], + "IframeResolveType": [ + "iframeResolve", + ], + "Action": [ + "cancel", + "click", + "hover", + ], + "IframeResolveActionType": [ + "iframeResolveAction", + ], + "IntentEventType": [ + "intentEvent", + ], + "IntentListenerUnsubscribeRequestType": [ + "intentListenerUnsubscribeRequest", + ], + "IntentListenerUnsubscribeResponseType": [ + "intentListenerUnsubscribeResponse", + ], + "IntentResultRequestType": [ + "intentResultRequest", + ], + "IntentResultResponseType": [ + "intentResultResponse", + ], + "JoinUserChannelRequestType": [ + "joinUserChannelRequest", + ], + "JoinUserChannelResponseType": [ + "joinUserChannelResponse", + ], + "LeaveCurrentChannelRequestType": [ + "leaveCurrentChannelRequest", + ], + "LeaveCurrentChannelResponseType": [ + "leaveCurrentChannelResponse", + ], + "OpenRequestType": [ + "openRequest", + ], + "OpenErrorResponsePayload": [ + "AgentDisconnected", + "AppNotFound", + "AppTimeout", + "DesktopAgentNotFound", + "ErrorOnLaunch", + "MalformedContext", + "MalformedMessage", + "NotConnectedToBridge", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + ], + "OpenResponseType": [ + "openResponse", + ], + "PrivateChannelDisconnectRequestType": [ + "privateChannelDisconnectRequest", + ], + "PrivateChannelDisconnectResponseType": [ + "privateChannelDisconnectResponse", + ], + "PrivateChannelOnAddContextListenerEventType": [ + "privateChannelOnAddContextListenerEvent", + ], + "PrivateChannelOnDisconnectEventType": [ + "privateChannelOnDisconnectEvent", + ], + "PrivateChannelOnUnsubscribeEventType": [ + "privateChannelOnUnsubscribeEvent", + ], + "PrivateChannelUnsubscribeEventListenerRequestType": [ + "privateChannelUnsubscribeEventListenerRequest", + ], + "PrivateChannelUnsubscribeEventListenerResponseType": [ + "privateChannelUnsubscribeEventListenerResponse", + ], + "PrivateChannelEventListenerTypes": [ + "onAddContextListener", + "onDisconnect", + "onUnsubscribe", + ], + "PrivateChannelAddEventListenerRequestType": [ + "privateChannelAddEventListenerRequest", + ], + "PrivateChannelAddEventListenerResponseType": [ + "privateChannelAddEventListenerResponse", + ], + "RaiseIntentForContextRequestType": [ + "raiseIntentForContextRequest", + ], + "RaiseIntentForContextResponseType": [ + "raiseIntentForContextResponse", + ], + "RaiseIntentRequestType": [ + "raiseIntentRequest", + ], + "RaiseIntentResponseType": [ + "raiseIntentResponse", + ], + "RaiseIntentResultResponseType": [ + "raiseIntentResultResponse", + ], +}; diff --git a/packages/fdc3-context/generated/bridging/BridgingTypes.ts b/packages/fdc3-context/generated/bridging/BridgingTypes.ts new file mode 100644 index 000000000..ec0a3b481 --- /dev/null +++ b/packages/fdc3-context/generated/bridging/BridgingTypes.ts @@ -0,0 +1,6058 @@ +// To parse this data: +// +// import { Convert, AgentErrorResponseMessage, AgentRequestMessage, AgentResponseMessage, BridgeErrorResponseMessage, BridgeRequestMessage, BridgeResponseMessage, BroadcastAgentRequest, BroadcastBridgeRequest, ConnectionStepMessage, ConnectionStep2Hello, ConnectionStep3Handshake, ConnectionStep4AuthenticationFailed, ConnectionStep6ConnectedAgentsUpdate, FindInstancesAgentErrorResponse, FindInstancesAgentRequest, FindInstancesAgentResponse, FindInstancesBridgeErrorResponse, FindInstancesBridgeRequest, FindInstancesBridgeResponse, FindIntentAgentErrorResponse, FindIntentAgentRequest, FindIntentAgentResponse, FindIntentBridgeErrorResponse, FindIntentBridgeRequest, FindIntentBridgeResponse, FindIntentsByContextAgentErrorResponse, FindIntentsByContextAgentRequest, FindIntentsByContextAgentResponse, FindIntentsByContextBridgeErrorResponse, FindIntentsByContextBridgeRequest, FindIntentsByContextBridgeResponse, GetAppMetadataAgentErrorResponse, GetAppMetadataAgentRequest, GetAppMetadataAgentResponse, GetAppMetadataBridgeErrorResponse, GetAppMetadataBridgeRequest, GetAppMetadataBridgeResponse, OpenAgentErrorResponse, OpenAgentRequest, OpenAgentResponse, OpenBridgeErrorResponse, OpenBridgeRequest, OpenBridgeResponse, PrivateChannelBroadcastAgentRequest, PrivateChannelBroadcastBridgeRequest, PrivateChannelEventListenerAddedAgentRequest, PrivateChannelEventListenerAddedBridgeRequest, PrivateChannelEventListenerRemovedAgentRequest, PrivateChannelEventListenerRemovedBridgeRequest, PrivateChannelOnAddContextListenerAgentRequest, PrivateChannelOnAddContextListenerBridgeRequest, PrivateChannelOnDisconnectAgentRequest, PrivateChannelOnDisconnectBridgeRequest, PrivateChannelOnUnsubscribeAgentRequest, PrivateChannelOnUnsubscribeBridgeRequest, RaiseIntentAgentErrorResponse, RaiseIntentAgentRequest, RaiseIntentAgentResponse, RaiseIntentBridgeErrorResponse, RaiseIntentBridgeRequest, RaiseIntentBridgeResponse, RaiseIntentResultAgentErrorResponse, RaiseIntentResultAgentResponse, RaiseIntentResultBridgeErrorResponse, RaiseIntentResultBridgeResponse } from "./file"; +// +// const agentErrorResponseMessage = Convert.toAgentErrorResponseMessage(json); +// const agentRequestMessage = Convert.toAgentRequestMessage(json); +// const agentResponseMessage = Convert.toAgentResponseMessage(json); +// const bridgeErrorResponseMessage = Convert.toBridgeErrorResponseMessage(json); +// const bridgeRequestMessage = Convert.toBridgeRequestMessage(json); +// const bridgeResponseMessage = Convert.toBridgeResponseMessage(json); +// const broadcastAgentRequest = Convert.toBroadcastAgentRequest(json); +// const broadcastBridgeRequest = Convert.toBroadcastBridgeRequest(json); +// const bridgeCommonDefinitions = Convert.toBridgeCommonDefinitions(json); +// const connectionStepMessage = Convert.toConnectionStepMessage(json); +// const connectionStep2Hello = Convert.toConnectionStep2Hello(json); +// const connectionStep3Handshake = Convert.toConnectionStep3Handshake(json); +// const connectionStep4AuthenticationFailed = Convert.toConnectionStep4AuthenticationFailed(json); +// const connectionStep6ConnectedAgentsUpdate = Convert.toConnectionStep6ConnectedAgentsUpdate(json); +// const findInstancesAgentErrorResponse = Convert.toFindInstancesAgentErrorResponse(json); +// const findInstancesAgentRequest = Convert.toFindInstancesAgentRequest(json); +// const findInstancesAgentResponse = Convert.toFindInstancesAgentResponse(json); +// const findInstancesBridgeErrorResponse = Convert.toFindInstancesBridgeErrorResponse(json); +// const findInstancesBridgeRequest = Convert.toFindInstancesBridgeRequest(json); +// const findInstancesBridgeResponse = Convert.toFindInstancesBridgeResponse(json); +// const findIntentAgentErrorResponse = Convert.toFindIntentAgentErrorResponse(json); +// const findIntentAgentRequest = Convert.toFindIntentAgentRequest(json); +// const findIntentAgentResponse = Convert.toFindIntentAgentResponse(json); +// const findIntentBridgeErrorResponse = Convert.toFindIntentBridgeErrorResponse(json); +// const findIntentBridgeRequest = Convert.toFindIntentBridgeRequest(json); +// const findIntentBridgeResponse = Convert.toFindIntentBridgeResponse(json); +// const findIntentsByContextAgentErrorResponse = Convert.toFindIntentsByContextAgentErrorResponse(json); +// const findIntentsByContextAgentRequest = Convert.toFindIntentsByContextAgentRequest(json); +// const findIntentsByContextAgentResponse = Convert.toFindIntentsByContextAgentResponse(json); +// const findIntentsByContextBridgeErrorResponse = Convert.toFindIntentsByContextBridgeErrorResponse(json); +// const findIntentsByContextBridgeRequest = Convert.toFindIntentsByContextBridgeRequest(json); +// const findIntentsByContextBridgeResponse = Convert.toFindIntentsByContextBridgeResponse(json); +// const getAppMetadataAgentErrorResponse = Convert.toGetAppMetadataAgentErrorResponse(json); +// const getAppMetadataAgentRequest = Convert.toGetAppMetadataAgentRequest(json); +// const getAppMetadataAgentResponse = Convert.toGetAppMetadataAgentResponse(json); +// const getAppMetadataBridgeErrorResponse = Convert.toGetAppMetadataBridgeErrorResponse(json); +// const getAppMetadataBridgeRequest = Convert.toGetAppMetadataBridgeRequest(json); +// const getAppMetadataBridgeResponse = Convert.toGetAppMetadataBridgeResponse(json); +// const openAgentErrorResponse = Convert.toOpenAgentErrorResponse(json); +// const openAgentRequest = Convert.toOpenAgentRequest(json); +// const openAgentResponse = Convert.toOpenAgentResponse(json); +// const openBridgeErrorResponse = Convert.toOpenBridgeErrorResponse(json); +// const openBridgeRequest = Convert.toOpenBridgeRequest(json); +// const openBridgeResponse = Convert.toOpenBridgeResponse(json); +// const privateChannelBroadcastAgentRequest = Convert.toPrivateChannelBroadcastAgentRequest(json); +// const privateChannelBroadcastBridgeRequest = Convert.toPrivateChannelBroadcastBridgeRequest(json); +// const privateChannelEventListenerAddedAgentRequest = Convert.toPrivateChannelEventListenerAddedAgentRequest(json); +// const privateChannelEventListenerAddedBridgeRequest = Convert.toPrivateChannelEventListenerAddedBridgeRequest(json); +// const privateChannelEventListenerRemovedAgentRequest = Convert.toPrivateChannelEventListenerRemovedAgentRequest(json); +// const privateChannelEventListenerRemovedBridgeRequest = Convert.toPrivateChannelEventListenerRemovedBridgeRequest(json); +// const privateChannelOnAddContextListenerAgentRequest = Convert.toPrivateChannelOnAddContextListenerAgentRequest(json); +// const privateChannelOnAddContextListenerBridgeRequest = Convert.toPrivateChannelOnAddContextListenerBridgeRequest(json); +// const privateChannelOnDisconnectAgentRequest = Convert.toPrivateChannelOnDisconnectAgentRequest(json); +// const privateChannelOnDisconnectBridgeRequest = Convert.toPrivateChannelOnDisconnectBridgeRequest(json); +// const privateChannelOnUnsubscribeAgentRequest = Convert.toPrivateChannelOnUnsubscribeAgentRequest(json); +// const privateChannelOnUnsubscribeBridgeRequest = Convert.toPrivateChannelOnUnsubscribeBridgeRequest(json); +// const raiseIntentAgentErrorResponse = Convert.toRaiseIntentAgentErrorResponse(json); +// const raiseIntentAgentRequest = Convert.toRaiseIntentAgentRequest(json); +// const raiseIntentAgentResponse = Convert.toRaiseIntentAgentResponse(json); +// const raiseIntentBridgeErrorResponse = Convert.toRaiseIntentBridgeErrorResponse(json); +// const raiseIntentBridgeRequest = Convert.toRaiseIntentBridgeRequest(json); +// const raiseIntentBridgeResponse = Convert.toRaiseIntentBridgeResponse(json); +// const raiseIntentResultAgentErrorResponse = Convert.toRaiseIntentResultAgentErrorResponse(json); +// const raiseIntentResultAgentResponse = Convert.toRaiseIntentResultAgentResponse(json); +// const raiseIntentResultBridgeErrorResponse = Convert.toRaiseIntentResultBridgeErrorResponse(json); +// const raiseIntentResultBridgeResponse = Convert.toRaiseIntentResultBridgeResponse(json); +// +// These functions will throw an error if the JSON doesn't +// match the expected interface, even if the JSON is valid. + +/** + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface AgentErrorResponseMessage { + meta: AgentResponseMetadata; + /** + * Error message payload containing an standardized error string. + */ + payload: ErrorResponseMessagePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: ResponseMessageType; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface AgentResponseMetadata { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface ErrorResponseMessagePayload { + error: ResponseErrorDetail; + [property: string]: any; +} + +/** + * Array of error message strings for responses that were not returned to the bridge before + * the timeout or because an error occurred. Should be the same length as the `errorSources` + * array and ordered the same. May be omitted if all sources responded without errors. + * + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type ResponseErrorDetail = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ +export type ResponseMessageType = "findInstancesResponse" | "findIntentResponse" | "findIntentsByContextResponse" | "getAppMetadataResponse" | "openResponse" | "raiseIntentResponse" | "raiseIntentResultResponse"; + +/** + * A request message from a Desktop Agent to the Bridge. + */ +export interface AgentRequestMessage { + meta: AgentRequestMetadata; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: RequestMessageType; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface AgentRequestMetadata { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceIdentifier; + timestamp: Date; +} + +/** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface BridgeParticipantIdentifier { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + * + * Field that represents the source application that a request or response was received + * from, or the source Desktop Agent if it issued the request or response itself. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + */ +export interface SourceIdentifier { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId?: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + * + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ +export type RequestMessageType = "broadcastRequest" | "findInstancesRequest" | "findIntentRequest" | "findIntentsByContextRequest" | "getAppMetadataRequest" | "openRequest" | "PrivateChannel.broadcast" | "PrivateChannel.eventListenerAdded" | "PrivateChannel.eventListenerRemoved" | "PrivateChannel.onAddContextListener" | "PrivateChannel.onDisconnect" | "PrivateChannel.onUnsubscribe" | "raiseIntentRequest"; + +/** + * A response message from a Desktop Agent to the Bridge. + */ +export interface AgentResponseMessage { + meta: AgentResponseMetadata; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: ResponseMessageType; +} + +/** + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface BridgeErrorResponseMessage { + meta: BridgeErrorResponseMessageMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: ResponseErrorMessagePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: string; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface BridgeErrorResponseMessageMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + */ +export interface DesktopAgentIdentifier { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent: string; + [property: string]: any; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface ResponseErrorMessagePayload { + error?: ResponseErrorDetail; + [property: string]: any; +} + +/** + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface BridgeRequestMessage { + meta: BridgeRequestMetadata; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: string; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface BridgeRequestMetadata { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: BridgeParticipantIdentifier; + timestamp: Date; +} + +/** + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface BridgeResponseMessage { + meta: BridgeResponseMessageMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: string; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface BridgeResponseMessageMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * A request to broadcast context on a channel. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface BroadcastAgentRequest { + meta: BroadcastAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: BroadcastAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "broadcastRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface BroadcastAgentRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source: SourceObject; + timestamp: Date; +} + +/** + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + * + * Field that represents the source application that a request or response was received + * from, or the source Desktop Agent if it issued the request or response itself. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + */ +export interface SourceObject { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + * + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface BroadcastAgentRequestPayload { + /** + * The Id of the Channel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that is to be broadcast. + */ + context: Context; +} + +/** + * The context object that is to be broadcast. + * + * The context object that was the payload of a broadcast message. + * + * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by + * FDC3 operations. As such, it is not really meant to be used on its own, but is imported + * by more specific type definitions (standardized or custom) to provide the structure and + * properties shared by all FDC3 context data types. + * + * The key element of FDC3 context types is their mandatory `type` property, which is used + * to identify what type of data the object represents, and what shape it has. + * + * The FDC3 context type, and all derived types, define the minimum set of fields a context + * data object of a particular type can be expected to have, but this can always be extended + * with custom fields as appropriate. + */ +export interface Context { + /** + * Context data objects may include a set of equivalent key-value pairs that can be used to + * help applications identify and look up the context type they receive in their own domain. + * The idea behind this design is that applications can provide as many equivalent + * identifiers to a target application as possible, e.g. an instrument may be represented by + * an ISIN, CUSIP or Bloomberg identifier. + * + * Identifiers do not make sense for all types of data, so the `id` property is therefore + * optional, but some derived types may choose to require at least one identifier. + * Identifier values SHOULD always be of type string. + */ + id?: { [key: string]: any }; + /** + * Context data objects may include a name property that can be used for more information, + * or display purposes. Some derived types may require the name object as mandatory, + * depending on use case. + */ + name?: string; + /** + * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 + * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present + * to route shared context data appropriately. + * + * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data + * types they support in an FDC3 [App + * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery + * and routing. + * + * Standardized FDC3 context types have well-known `type` properties prefixed with the + * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and + * used by a particular organization, the convention is to prefix them with an + * organization-specific namespace, e.g. `blackrock.fund`. + * + * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more + * information about context data types. + */ + type: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to broadcast context on a channel. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface BroadcastBridgeRequest { + meta: BroadcastBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: BroadcastBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "broadcastRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface BroadcastBridgeRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + */ +export interface MetaSource { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + * + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface BroadcastBridgeRequestPayload { + /** + * The Id of the Channel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that is to be broadcast. + */ + context: Context; +} + +/** + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStepMessage { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the connection step message. + */ + type: ConnectionStepMessageType; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStepMetadata { + requestUuid?: string; + responseUuid?: string; + timestamp: Date; +} + +/** + * Identifies the type of the connection step message. + */ +export type ConnectionStepMessageType = "hello" | "handshake" | "authenticationFailed" | "connectedAgentsUpdate"; + +/** + * Hello message sent by the Bridge to anyone connecting to the Bridge (enables + * identification as a bridge and confirmation of whether authentication is required) + * + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStep2Hello { + meta: ConnectionStep2HelloMeta; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: ConnectionStep2HelloPayload; + /** + * Identifies the type of the connection step message. + */ + type: "hello"; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStep2HelloMeta { + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface ConnectionStep2HelloPayload { + /** + * A flag indicating whether the Desktop Agent Bridge requires authentication or not. + */ + authRequired: boolean; + /** + * An optional Desktop Agent Bridge JWT authentication token if the Desktop Agent want to + * authenticate a bridge. + */ + authToken?: string; + /** + * The version of the Bridge + */ + desktopAgentBridgeVersion: string; + /** + * The FDC3 versions supported by the Bridge + */ + supportedFDC3Versions: string[]; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Handshake message sent by the Desktop Agent to the Bridge (including requested name, + * channel state and authentication data) + * + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStep3Handshake { + meta: ConnectionStep3HandshakeMeta; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: ConnectionStep3HandshakePayload; + /** + * Identifies the type of the connection step message. + */ + type: "handshake"; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStep3HandshakeMeta { + requestUuid: string; + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface ConnectionStep3HandshakePayload { + authToken?: string; + /** + * 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]: Context[] }; + /** + * Desktop Agent ImplementationMetadata trying to connect to the bridge. + */ + implementationMetadata: ConnectingAgentImplementationMetadata; + /** + * The requested Desktop Agent name + */ + requestedName: string; +} + +/** + * Desktop Agent ImplementationMetadata trying to connect to the bridge. + * + * Metadata relating to the FDC3 Desktop Agent implementation and its provider. + */ +export interface ConnectingAgentImplementationMetadata { + /** + * The version number of the FDC3 specification that the implementation provides. + * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. + */ + fdc3Version: string; + /** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ + optionalFeatures: OptionalFeatures; + /** + * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, + * OpenFin etc.). + */ + provider: string; + /** + * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). + */ + providerVersion?: string; +} + +/** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ +export interface OptionalFeatures { + /** + * Used to indicate whether the experimental Desktop Agent Bridging + * feature is implemented by the Desktop Agent. + */ + DesktopAgentBridging: boolean; + /** + * Used to indicate whether the exposure of 'originating app metadata' for + * context and intent messages is supported by the Desktop Agent. + */ + OriginatingAppMetadata: boolean; + /** + * Used to indicate whether the optional `fdc3.joinUserChannel`, + * `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by + * the Desktop Agent. + */ + UserChannelMembershipAPIs: boolean; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Message sent by Bridge to Desktop Agent if their authentication fails. + * + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStep4AuthenticationFailed { + meta: ConnectionStep4AuthenticationFailedMeta; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: ConnectionStep4AuthenticationFailedPayload; + /** + * Identifies the type of the connection step message. + */ + type: "authenticationFailed"; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStep4AuthenticationFailedMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface ConnectionStep4AuthenticationFailedPayload { + message?: string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Message sent by Bridge to all Desktop Agent when an agent joins or leaves the bridge, + * includes the details of all agents, the change made and the expected channel state for + * all agents. + * + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStep6ConnectedAgentsUpdate { + meta: ConnectionStep6ConnectedAgentsUpdateMeta; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: ConnectionStep6ConnectedAgentsUpdatePayload; + /** + * Identifies the type of the connection step message. + */ + type: "connectedAgentsUpdate"; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStep6ConnectedAgentsUpdateMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface ConnectionStep6ConnectedAgentsUpdatePayload { + /** + * Should be set when an agent first connects to the bridge and provide its assigned name. + */ + addAgent?: string; + /** + * Desktop Agent Bridge implementation metadata of all connected agents. + */ + allAgents: DesktopAgentImplementationMetadata[]; + /** + * The updated state of channels that should be adopted by the agents. Should only be set + * when an agent is connecting to the bridge. + */ + channelsState?: { [key: string]: Context[] }; + /** + * Should be set when an agent disconnects from the bridge and provide the name that no + * longer is assigned. + */ + removeAgent?: string; +} + +/** + * Includes the name assigned to the Desktop Agent by the Bridge. + * + * Metadata relating to the FDC3 Desktop Agent implementation and its provider. + */ +export interface DesktopAgentImplementationMetadata { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a particular Desktop + * Agent. + */ + desktopAgent: string; + /** + * The version number of the FDC3 specification that the implementation provides. + * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. + */ + fdc3Version: string; + /** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ + optionalFeatures: OptionalFeatures; + /** + * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, + * OpenFin etc.). + */ + provider: string; + /** + * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). + */ + providerVersion?: string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * A response to a findInstances request that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface FindInstancesAgentErrorResponse { + meta: FindInstancesAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: PayloadClass; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindInstancesAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface PayloadClass { + error: FindInstancesErrors; +} + +/** + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + * + * Should be set if the raiseIntent request returned an error. + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + * + * Array of error message strings for responses that were not returned to the bridge before + * the timeout or because an error occurred. Should be the same length as the `errorSources` + * array and ordered the same. May be omitted if all sources responded without errors. + * + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + */ +export type FindInstancesErrors = "DesktopAgentNotFound" | "IntentDeliveryFailed" | "MalformedContext" | "NoAppsFound" | "ResolverTimeout" | "ResolverUnavailable" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request for details of instances of a particular app + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface FindInstancesAgentRequest { + meta: FindInstancesAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindInstancesAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findInstancesRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface FindInstancesAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceIdentifier; + timestamp: Date; +} + +/** + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + * + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface DestinationObject { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindInstancesAgentRequestPayload { + app: AppIdentifier; +} + +/** + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppIdentifier { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a findInstances request. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface FindInstancesAgentResponse { + meta: AgentResponseMetadata; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindInstancesAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * The message payload contains a flag indicating whether the API call was successful, plus + * any return values for the FDC3 API function called, or indicating that the request + * resulted in an error and including a standardized error message. + * + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindInstancesAgentResponsePayload { + appIdentifiers: AppMetadata[]; +} + +/** + * Extends an `AppIdentifier`, describing an application or instance of an application, with + * additional descriptive metadata that is usually provided by an FDC3 App Directory that + * the desktop agent connects to. + * + * The additional information from an app directory can aid in rendering UI elements, such + * as a launcher menu or resolver UI. This includes a title, description, tooltip and icon + * and screenshot URLs. + * + * Note that as `AppMetadata` instances are also `AppIdentifiers` they may be passed to the + * `app` argument of `fdc3.open`, `fdc3.raiseIntent` etc. + */ +export interface AppMetadata { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * A longer, multi-paragraph description for the application that could include markup + */ + description?: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * A list of icon URLs for the application that can be used to render UI elements + */ + icons?: Icon[]; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + /** + * An optional set of, implementation specific, metadata fields that can be used to + * disambiguate instances, such as a window title or screen position. Must only be set if + * `instanceId` is set. + */ + instanceMetadata?: { [key: string]: any }; + /** + * The 'friendly' app name. + * This field was used with the `open` and `raiseIntent` calls in FDC3 <2.0, which now + * require an `AppIdentifier` wth `appId` set. + * Note that for display purposes the `title` field should be used, if set, in preference to + * this field. + */ + name?: string; + /** + * The type of output returned for any intent specified during resolution. May express a + * particular context type (e.g. "fdc3.instrument"), channel (e.g. "channel") or a channel + * that will receive a specified type (e.g. "channel"). + */ + resultType?: null | string; + /** + * Images representing the app in common usage scenarios that can be used to render UI + * elements + */ + screenshots?: Image[]; + /** + * A more user-friendly application title that can be used to render UI elements + */ + title?: string; + /** + * A tooltip for the application that can be used to render UI elements + */ + tooltip?: string; + /** + * The Version of the application. + */ + version?: string; +} + +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ +export interface Icon { + /** + * The icon dimension, formatted as `x`. + */ + size?: string; + /** + * The icon url + */ + src: string; + /** + * Icon media type. If not present the Desktop Agent may use the src file extension. + */ + type?: string; +} + +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ +export interface Image { + /** + * Caption for the image. + */ + label?: string; + /** + * The image dimension, formatted as `x`. + */ + size?: string; + /** + * The image url. + */ + src: string; + /** + * Image media type. If not present the Desktop Agent may use the src file extension. + */ + type?: string; +} + +/** + * A response to a findInstances request that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface FindInstancesBridgeErrorResponse { + meta: FindInstancesBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: MessagePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindInstancesBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface MessagePayload { + error: FindInstancesErrors; +} + +/** + * A request for details of instances of a particular app + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface FindInstancesBridgeRequest { + meta: FindInstancesBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindInstancesBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findInstancesRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface FindInstancesBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSourceObject; + timestamp: Date; +} + +/** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + * + * Field that represents the source application that a request or response was received + * from, or the source Desktop Agent if it issued the request or response itself. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + * + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + */ +export interface MetaSourceObject { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId?: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + * + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindInstancesBridgeRequestPayload { + app: AppIdentifier; +} + +/** + * A response to a findInstances request. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface FindInstancesBridgeResponse { + meta: BridgeResponseMessageMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindInstancesBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * The message payload contains a flag indicating whether the API call was successful, plus + * any return values for the FDC3 API function called, or indicating that the request + * resulted in an error and including a standardized error message. + * + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindInstancesBridgeResponsePayload { + appIdentifiers: AppMetadata[]; +} + +/** + * A response to a findIntent request that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface FindIntentAgentErrorResponse { + meta: FindIntentAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: FindIntentAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindIntentAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface FindIntentAgentErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request for details of apps available to resolve a particular intent and context pair. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface FindIntentAgentRequest { + meta: FindIntentAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface FindIntentAgentRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceIdentifier; + timestamp: Date; + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentAgentRequestPayload { + context?: Context; + intent: string; + resultType?: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a findIntent request. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface FindIntentAgentResponse { + meta: FindIntentAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindIntentAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindIntentAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindIntentAgentResponsePayload { + appIntent: AppIntent; +} + +/** + * An interface that relates an intent to apps + */ +export interface AppIntent { + /** + * Details of applications that can resolve the intent. + */ + apps: AppMetadata[]; + /** + * Details of the intent whose relationship to resolving applications is being described. + */ + intent: IntentMetadata; +} + +/** + * Details of the intent whose relationship to resolving applications is being described. + * + * Intent descriptor + */ +export interface IntentMetadata { + /** + * Display name for the intent. + */ + displayName?: string; + /** + * The unique name of the intent that can be invoked by the raiseIntent call + */ + name: string; +} + +/** + * A response to a findIntent request that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface FindIntentBridgeErrorResponse { + meta: FindIntentBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: FindIntentBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindIntentBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface FindIntentBridgeErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * A request for details of apps available to resolve a particular intent and context pair. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface FindIntentBridgeRequest { + meta: FindIntentBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface FindIntentBridgeRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: BridgeParticipantIdentifier; + timestamp: Date; + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentBridgeRequestPayload { + context?: Context; + intent: string; + resultType?: string; +} + +/** + * A response to a findIntent request. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface FindIntentBridgeResponse { + meta: FindIntentBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindIntentBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindIntentBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindIntentBridgeResponsePayload { + appIntent: AppIntent; +} + +/** + * A response to a findIntentsByContext request that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface FindIntentsByContextAgentErrorResponse { + meta: FindIntentsByContextAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: FindIntentsByContextAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindIntentsByContextAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface FindIntentsByContextAgentErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request for details of intents and apps available to resolve them for a particular + * context. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface FindIntentsByContextAgentRequest { + meta: FindIntentsByContextAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentsByContextAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentsByContextRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface FindIntentsByContextAgentRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentsByContextAgentRequestPayload { + context: Context; + resultType?: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a findIntentsByContext request. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface FindIntentsByContextAgentResponse { + meta: FindIntentsByContextAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindIntentsByContextAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindIntentsByContextAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindIntentsByContextAgentResponsePayload { + appIntents: AppIntent[]; +} + +/** + * A response to a findIntentsByContext request that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface FindIntentsByContextBridgeErrorResponse { + meta: FindIntentsByContextBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: FindIntentsByContextBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindIntentsByContextBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface FindIntentsByContextBridgeErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * A request for details of intents and apps available to resolve them for a particular + * context. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface FindIntentsByContextBridgeRequest { + meta: FindIntentsByContextBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentsByContextBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentsByContextRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface FindIntentsByContextBridgeRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentsByContextBridgeRequestPayload { + context: Context; + resultType?: string; +} + +/** + * A response to a findIntentsByContext request. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface FindIntentsByContextBridgeResponse { + meta: FindIntentsByContextBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindIntentsByContextBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindIntentsByContextBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindIntentsByContextBridgeResponsePayload { + appIntents: AppIntent[]; +} + +/** + * A response to a getAppMetadata request that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface GetAppMetadataAgentErrorResponse { + meta: GetAppMetadataAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: GetAppMetadataAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface GetAppMetadataAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface GetAppMetadataAgentErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request for metadata about an app + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface GetAppMetadataAgentRequest { + meta: GetAppMetadataAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetAppMetadataAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getAppMetadataRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface GetAppMetadataAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceIdentifier; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetAppMetadataAgentRequestPayload { + app: AppObject; +} + +/** + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppObject { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a getAppMetadata request. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface GetAppMetadataAgentResponse { + meta: GetAppMetadataAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: GetAppMetadataAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface GetAppMetadataAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface GetAppMetadataAgentResponsePayload { + appMetadata: AppMetadata; +} + +/** + * A response to a getAppMetadata request that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface GetAppMetadataBridgeErrorResponse { + meta: GetAppMetadataBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: GetAppMetadataBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface GetAppMetadataBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface GetAppMetadataBridgeErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * A request for metadata about an app + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface GetAppMetadataBridgeRequest { + meta: GetAppMetadataBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetAppMetadataBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getAppMetadataRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface GetAppMetadataBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetAppMetadataBridgeRequestPayload { + app: AppObject; +} + +/** + * A response to a getAppMetadata request. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface GetAppMetadataBridgeResponse { + meta: GetAppMetadataBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: GetAppMetadataBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface GetAppMetadataBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface GetAppMetadataBridgeResponsePayload { + appMetadata: AppMetadata; +} + +/** + * A response to an open request that contains an error + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface OpenAgentErrorResponse { + meta: OpenAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: OpenAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface OpenAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface OpenAgentErrorResponsePayload { + error: OpenErrorResponsePayload; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Array of error message strings for responses that were not returned to the bridge before + * the timeout or because an error occurred. Should be the same length as the `errorSources` + * array and ordered the same. May be omitted if all sources responded without errors. + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type OpenErrorResponsePayload = "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "MalformedContext" | "ResolverUnavailable" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to open an application + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface OpenAgentRequest { + meta: OpenAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: OpenAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "openRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface OpenAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface OpenAgentRequestPayload { + /** + * The application to open on the specified Desktop Agent + */ + app: AppToOpen; + context?: Context; +} + +/** + * The application to open on the specified Desktop Agent + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppToOpen { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to an open request + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface OpenAgentResponse { + meta: OpenAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: OpenAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface OpenAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface OpenAgentResponsePayload { + appIdentifier: AppIdentifier; +} + +/** + * A response to an open request that contains an error + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface OpenBridgeErrorResponse { + meta: OpenBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: OpenBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface OpenBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface OpenBridgeErrorResponsePayload { + error: OpenErrorResponsePayload; +} + +/** + * A request to open an application + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface OpenBridgeRequest { + meta: OpenBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: OpenBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "openRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface OpenBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface OpenBridgeRequestPayload { + /** + * The application to open on the specified Desktop Agent + */ + app: AppToOpen; + context?: Context; +} + +/** + * A response to an open request + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface OpenBridgeResponse { + meta: OpenBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: OpenBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface OpenBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface OpenBridgeResponsePayload { + appIdentifier: AppIdentifier; +} + +/** + * A request to broadcast on a PrivateChannel. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelBroadcastAgentRequest { + meta: PrivateChannelBroadcastAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelBroadcastAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.broadcast"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelBroadcastAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ +export interface MetaDestination { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelBroadcastAgentRequestPayload { + /** + * The Id of the PrivateChannel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that was the payload of a broadcast message. + */ + context: Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to broadcast on a PrivateChannel. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelBroadcastBridgeRequest { + meta: PrivateChannelBroadcastBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelBroadcastBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.broadcast"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelBroadcastBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelBroadcastBridgeRequestPayload { + /** + * The Id of the PrivateChannel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that was the payload of a broadcast message. + */ + context: Context; +} + +/** + * A request to forward on an EventListenerAdded event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelEventListenerAddedAgentRequest { + meta: PrivateChannelEventListenerAddedAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelEventListenerAddedAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.eventListenerAdded"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelEventListenerAddedAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelEventListenerAddedAgentRequestPayload { + /** + * The id of the PrivateChannel that the event listener was added to. + */ + channelId: string; + listenerType: PrivateChannelEventListenerTypes; +} + +/** + * Event listener type names for Private Channel events + */ +export type PrivateChannelEventListenerTypes = "onAddContextListener" | "onUnsubscribe" | "onDisconnect"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on an EventListenerAdded event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelEventListenerAddedBridgeRequest { + meta: PrivateChannelEventListenerAddedBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelEventListenerAddedBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.eventListenerAdded"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelEventListenerAddedBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelEventListenerAddedBridgeRequestPayload { + /** + * The id of the PrivateChannel that the event listener was added to. + */ + channelId: string; + listenerType: PrivateChannelEventListenerTypes; +} + +/** + * A request to forward on an EventListenerRemoved event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelEventListenerRemovedAgentRequest { + meta: PrivateChannelEventListenerRemovedAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelEventListenerRemovedAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.eventListenerRemoved"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelEventListenerRemovedAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelEventListenerRemovedAgentRequestPayload { + /** + * The id of the PrivateChannel that the event listener was removed from. + */ + channelId: string; + listenerType: PrivateChannelEventListenerTypes; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on an EventListenerRemoved event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelEventListenerRemovedBridgeRequest { + meta: PrivateChannelEventListenerRemovedBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelEventListenerRemovedBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.eventListenerRemoved"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelEventListenerRemovedBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelEventListenerRemovedBridgeRequestPayload { + /** + * The id of the PrivateChannel that the event listener was removed from. + */ + channelId: string; + listenerType: PrivateChannelEventListenerTypes; +} + +/** + * A request to forward on an AddContextListener event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelOnAddContextListenerAgentRequest { + meta: PrivateChannelOnAddContextListenerAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnAddContextListenerAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onAddContextListener"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelOnAddContextListenerAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnAddContextListenerAgentRequestPayload { + /** + * The id of the PrivateChannel that the context listener was added to. + */ + channelId: string; + /** + * The type of the context listener added. Should be null for an untyped listener. + */ + contextType: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on an AddContextListener event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelOnAddContextListenerBridgeRequest { + meta: PrivateChannelOnAddContextListenerBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnAddContextListenerBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onAddContextListener"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelOnAddContextListenerBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnAddContextListenerBridgeRequestPayload { + /** + * The id of the PrivateChannel that the context listener was added to. + */ + channelId: string; + /** + * The type of the context listener added. Should be null for an untyped listener. + */ + contextType: null | string; +} + +/** + * A request to forward on a Disconnect event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelOnDisconnectAgentRequest { + meta: PrivateChannelOnDisconnectAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnDisconnectAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onDisconnect"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelOnDisconnectAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnDisconnectAgentRequestPayload { + /** + * The id of the PrivateChannel that the agent discconnected from. + */ + channelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on a Disconnect event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelOnDisconnectBridgeRequest { + meta: PrivateChannelOnDisconnectBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnDisconnectBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onDisconnect"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelOnDisconnectBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnDisconnectBridgeRequestPayload { + /** + * The id of the PrivateChannel that the agent discconnected from. + */ + channelId: string; +} + +/** + * A request to forward on an Unsubscribe event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelOnUnsubscribeAgentRequest { + meta: PrivateChannelOnUnsubscribeAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnUnsubscribeAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onUnsubscribe"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelOnUnsubscribeAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnUnsubscribeAgentRequestPayload { + /** + * The id of the PrivateChannel that the context listener was unsubscribed from. + */ + channelId: string; + /** + * The type of the context listener that was unsubscribed. Should be null for an untyped + * listener. + */ + contextType: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on an Unsubscribe event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelOnUnsubscribeBridgeRequest { + meta: ERequestMetadata; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnUnsubscribeBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onUnsubscribe"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface ERequestMetadata { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnUnsubscribeBridgeRequestPayload { + /** + * The id of the PrivateChannel that the context listener was unsubscribed from. + */ + channelId: string; + /** + * The type of the context listener that was unsubscribed. Should be null for an untyped + * listener. + */ + contextType: null | string; +} + +/** + * A response to a request to raise an intent that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface RaiseIntentAgentErrorResponse { + meta: RaiseIntentAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: RaiseIntentAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface RaiseIntentAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Used if a raiseIntent request resulted in an error + * + * Error message payload containing an standardized error string. + */ +export interface RaiseIntentAgentErrorResponsePayload { + /** + * Should be set if the raiseIntent request returned an error. + */ + error: FindInstancesErrors; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to raise an intent. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface RaiseIntentAgentRequest { + meta: RaiseIntentAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: RaiseIntentAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "raiseIntentRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface RaiseIntentAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface RaiseIntentAgentRequestPayload { + app: AppDestinationIdentifier; + context: Context; + intent: string; +} + +/** + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppDestinationIdentifier { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a request to raise an intent. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface RaiseIntentAgentResponse { + meta: RaiseIntentAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: RaiseIntentAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface RaiseIntentAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface RaiseIntentAgentResponsePayload { + /** + * Used if the raiseIntent request was successfully resolved + */ + intentResolution: IntentResolution; +} + +/** + * Used if the raiseIntent request was successfully resolved + * + * IntentResolution provides a standard format for data returned upon resolving an intent. + * + * ```javascript + * //resolve a "Chain" type intent + * let resolution = await agent.raiseIntent("intentName", context); + * + * //resolve a "Client-Service" type intent with a data response or a Channel + * let resolution = await agent.raiseIntent("intentName", context); + * try { + * const result = await resolution.getResult(); + * if (result && result.broadcast) { + * console.log(`${resolution.source} returned a channel with id ${result.id}`); + * } else if (result){ + * console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`); + * } else { + * console.error(`${resolution.source} didn't return data` + * } + * } catch(error) { + * console.error(`${resolution.source} returned an error: ${error}`); + * } + * + * // Use metadata about the resolving app instance to target a further intent + * await agent.raiseIntent("intentName", context, resolution.source); + * ``` + */ +export interface IntentResolution { + /** + * The intent that was raised. May be used to determine which intent the user + * chose in response to `fdc3.raiseIntentForContext()`. + */ + intent: string; + /** + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ + source: AppIdentifier; +} + +/** + * A response to a request to raise an intent that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface RaiseIntentBridgeErrorResponse { + meta: RaiseIntentBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: RaiseIntentBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface RaiseIntentBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Used if a raiseIntent request resulted in an error + * + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface RaiseIntentBridgeErrorResponsePayload { + /** + * Should be set if the raiseIntent request returned an error. + */ + error: FindInstancesErrors; +} + +/** + * A request to raise an intent. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface RaiseIntentBridgeRequest { + meta: RaiseIntentBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: RaiseIntentBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "raiseIntentRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface RaiseIntentBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface RaiseIntentBridgeRequestPayload { + app: AppDestinationIdentifier; + context: Context; + intent: string; +} + +/** + * A response to a request to raise an intent. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface RaiseIntentBridgeResponse { + meta: RaiseIntentBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: RaiseIntentBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface RaiseIntentBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface RaiseIntentBridgeResponsePayload { + /** + * Used if the raiseIntent request was successfully resolved + */ + intentResolution: IntentResolution; +} + +/** + * A secondary response to a request to raise an intent used to deliver the intent result, + * which contains an error + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface RaiseIntentResultAgentErrorResponse { + meta: RaiseIntentResultAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: RaiseIntentResultAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface RaiseIntentResultAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface RaiseIntentResultAgentErrorResponsePayload { + error: RaiseIntentResultErrorMessage; +} + +/** + * Array of error message strings for responses that were not returned to the bridge before + * the timeout or because an error occurred. Should be the same length as the `errorSources` + * array and ordered the same. May be omitted if all sources responded without errors. + * + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type RaiseIntentResultErrorMessage = "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A secondary response to a request to raise an intent used to deliver the intent result + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface RaiseIntentResultAgentResponse { + meta: RaiseIntentResultAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: RaiseIntentResultAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface RaiseIntentResultAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface RaiseIntentResultAgentResponsePayload { + intentResult: IntentResult; +} + +export interface IntentResult { + context?: Context; + channel?: Channel; +} + +/** + * Represents a context channel that applications can use to send and receive + * context data. + * + * Please note that There are differences in behavior when you interact with a + * User channel via the `DesktopAgent` interface and the `Channel` interface. + * Specifically, when 'joining' a User channel or adding a context listener + * when already joined to a channel via the `DesktopAgent` interface, existing + * context (matching the type of the context listener) on the channel is + * received by the context listener immediately. Whereas, when a context + * listener is added via the Channel interface, context is not received + * automatically, but may be retrieved manually via the `getCurrentContext()` + * function. + */ +export interface Channel { + /** + * Channels may be visualized and selectable by users. DisplayMetadata may be used to + * provide hints on how to see them. + * For App channels, displayMetadata would typically not be present. + */ + displayMetadata?: DisplayMetadata; + /** + * Constant that uniquely identifies this channel. + */ + id: string; + /** + * Uniquely defines each channel type. + * Can be "user", "app" or "private". + */ + type: Type; +} + +/** + * Channels may be visualized and selectable by users. DisplayMetadata may be used to + * provide hints on how to see them. + * For App channels, displayMetadata would typically not be present. + * + * A system channel will be global enough to have a presence across many apps. This gives us + * some hints + * to render them in a standard way. It is assumed it may have other properties too, but if + * it has these, + * this is their meaning. + */ +export interface DisplayMetadata { + /** + * The color that should be associated within this channel when displaying this channel in a + * UI, e.g: `0xFF0000`. + */ + color?: string; + /** + * A URL of an image that can be used to display this channel + */ + glyph?: string; + /** + * A user-readable name for this channel, e.g: `"Red"` + */ + name?: string; +} + +/** + * Uniquely defines each channel type. + * Can be "user", "app" or "private". + */ +export type Type = "app" | "private" | "user"; + +/** + * A secondary response to a request to raise an intent used to deliver the intent result, + * which contains an error + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface RaiseIntentResultBridgeErrorResponse { + meta: RaiseIntentResultBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: RaiseIntentResultBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface RaiseIntentResultBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface RaiseIntentResultBridgeErrorResponsePayload { + error: RaiseIntentResultErrorMessage; +} + +/** + * A secondary response to a request to raise an intent used to deliver the intent result + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface RaiseIntentResultBridgeResponse { + meta: RaiseIntentResultBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: RaiseIntentResultBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface RaiseIntentResultBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface RaiseIntentResultBridgeResponsePayload { + intentResult: IntentResult; +} + +// Converts JSON strings to/from your types +// and asserts the results of JSON.parse at runtime +export class Convert { + public static toAgentErrorResponseMessage(json: string): AgentErrorResponseMessage { + return cast(JSON.parse(json), r("AgentErrorResponseMessage")); + } + + public static agentErrorResponseMessageToJson(value: AgentErrorResponseMessage): string { + return JSON.stringify(uncast(value, r("AgentErrorResponseMessage")), null, 2); + } + + public static toAgentRequestMessage(json: string): AgentRequestMessage { + return cast(JSON.parse(json), r("AgentRequestMessage")); + } + + public static agentRequestMessageToJson(value: AgentRequestMessage): string { + return JSON.stringify(uncast(value, r("AgentRequestMessage")), null, 2); + } + + public static toAgentResponseMessage(json: string): AgentResponseMessage { + return cast(JSON.parse(json), r("AgentResponseMessage")); + } + + public static agentResponseMessageToJson(value: AgentResponseMessage): string { + return JSON.stringify(uncast(value, r("AgentResponseMessage")), null, 2); + } + + public static toBridgeErrorResponseMessage(json: string): BridgeErrorResponseMessage { + return cast(JSON.parse(json), r("BridgeErrorResponseMessage")); + } + + public static bridgeErrorResponseMessageToJson(value: BridgeErrorResponseMessage): string { + return JSON.stringify(uncast(value, r("BridgeErrorResponseMessage")), null, 2); + } + + public static toBridgeRequestMessage(json: string): BridgeRequestMessage { + return cast(JSON.parse(json), r("BridgeRequestMessage")); + } + + public static bridgeRequestMessageToJson(value: BridgeRequestMessage): string { + return JSON.stringify(uncast(value, r("BridgeRequestMessage")), null, 2); + } + + public static toBridgeResponseMessage(json: string): BridgeResponseMessage { + return cast(JSON.parse(json), r("BridgeResponseMessage")); + } + + public static bridgeResponseMessageToJson(value: BridgeResponseMessage): string { + return JSON.stringify(uncast(value, r("BridgeResponseMessage")), null, 2); + } + + public static toBroadcastAgentRequest(json: string): BroadcastAgentRequest { + return cast(JSON.parse(json), r("BroadcastAgentRequest")); + } + + public static broadcastAgentRequestToJson(value: BroadcastAgentRequest): string { + return JSON.stringify(uncast(value, r("BroadcastAgentRequest")), null, 2); + } + + public static toBroadcastBridgeRequest(json: string): BroadcastBridgeRequest { + return cast(JSON.parse(json), r("BroadcastBridgeRequest")); + } + + public static broadcastBridgeRequestToJson(value: BroadcastBridgeRequest): string { + return JSON.stringify(uncast(value, r("BroadcastBridgeRequest")), null, 2); + } + + public static toBridgeCommonDefinitions(json: string): { [key: string]: any } { + return cast(JSON.parse(json), m("any")); + } + + public static bridgeCommonDefinitionsToJson(value: { [key: string]: any }): string { + return JSON.stringify(uncast(value, m("any")), null, 2); + } + + public static toConnectionStepMessage(json: string): ConnectionStepMessage { + return cast(JSON.parse(json), r("ConnectionStepMessage")); + } + + public static connectionStepMessageToJson(value: ConnectionStepMessage): string { + return JSON.stringify(uncast(value, r("ConnectionStepMessage")), null, 2); + } + + public static toConnectionStep2Hello(json: string): ConnectionStep2Hello { + return cast(JSON.parse(json), r("ConnectionStep2Hello")); + } + + public static connectionStep2HelloToJson(value: ConnectionStep2Hello): string { + return JSON.stringify(uncast(value, r("ConnectionStep2Hello")), null, 2); + } + + public static toConnectionStep3Handshake(json: string): ConnectionStep3Handshake { + return cast(JSON.parse(json), r("ConnectionStep3Handshake")); + } + + public static connectionStep3HandshakeToJson(value: ConnectionStep3Handshake): string { + return JSON.stringify(uncast(value, r("ConnectionStep3Handshake")), null, 2); + } + + public static toConnectionStep4AuthenticationFailed(json: string): ConnectionStep4AuthenticationFailed { + return cast(JSON.parse(json), r("ConnectionStep4AuthenticationFailed")); + } + + public static connectionStep4AuthenticationFailedToJson(value: ConnectionStep4AuthenticationFailed): string { + return JSON.stringify(uncast(value, r("ConnectionStep4AuthenticationFailed")), null, 2); + } + + public static toConnectionStep6ConnectedAgentsUpdate(json: string): ConnectionStep6ConnectedAgentsUpdate { + return cast(JSON.parse(json), r("ConnectionStep6ConnectedAgentsUpdate")); + } + + public static connectionStep6ConnectedAgentsUpdateToJson(value: ConnectionStep6ConnectedAgentsUpdate): string { + return JSON.stringify(uncast(value, r("ConnectionStep6ConnectedAgentsUpdate")), null, 2); + } + + public static toFindInstancesAgentErrorResponse(json: string): FindInstancesAgentErrorResponse { + return cast(JSON.parse(json), r("FindInstancesAgentErrorResponse")); + } + + public static findInstancesAgentErrorResponseToJson(value: FindInstancesAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesAgentErrorResponse")), null, 2); + } + + public static toFindInstancesAgentRequest(json: string): FindInstancesAgentRequest { + return cast(JSON.parse(json), r("FindInstancesAgentRequest")); + } + + public static findInstancesAgentRequestToJson(value: FindInstancesAgentRequest): string { + return JSON.stringify(uncast(value, r("FindInstancesAgentRequest")), null, 2); + } + + public static toFindInstancesAgentResponse(json: string): FindInstancesAgentResponse { + return cast(JSON.parse(json), r("FindInstancesAgentResponse")); + } + + public static findInstancesAgentResponseToJson(value: FindInstancesAgentResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesAgentResponse")), null, 2); + } + + public static toFindInstancesBridgeErrorResponse(json: string): FindInstancesBridgeErrorResponse { + return cast(JSON.parse(json), r("FindInstancesBridgeErrorResponse")); + } + + public static findInstancesBridgeErrorResponseToJson(value: FindInstancesBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesBridgeErrorResponse")), null, 2); + } + + public static toFindInstancesBridgeRequest(json: string): FindInstancesBridgeRequest { + return cast(JSON.parse(json), r("FindInstancesBridgeRequest")); + } + + public static findInstancesBridgeRequestToJson(value: FindInstancesBridgeRequest): string { + return JSON.stringify(uncast(value, r("FindInstancesBridgeRequest")), null, 2); + } + + public static toFindInstancesBridgeResponse(json: string): FindInstancesBridgeResponse { + return cast(JSON.parse(json), r("FindInstancesBridgeResponse")); + } + + public static findInstancesBridgeResponseToJson(value: FindInstancesBridgeResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesBridgeResponse")), null, 2); + } + + public static toFindIntentAgentErrorResponse(json: string): FindIntentAgentErrorResponse { + return cast(JSON.parse(json), r("FindIntentAgentErrorResponse")); + } + + public static findIntentAgentErrorResponseToJson(value: FindIntentAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("FindIntentAgentErrorResponse")), null, 2); + } + + public static toFindIntentAgentRequest(json: string): FindIntentAgentRequest { + return cast(JSON.parse(json), r("FindIntentAgentRequest")); + } + + public static findIntentAgentRequestToJson(value: FindIntentAgentRequest): string { + return JSON.stringify(uncast(value, r("FindIntentAgentRequest")), null, 2); + } + + public static toFindIntentAgentResponse(json: string): FindIntentAgentResponse { + return cast(JSON.parse(json), r("FindIntentAgentResponse")); + } + + public static findIntentAgentResponseToJson(value: FindIntentAgentResponse): string { + return JSON.stringify(uncast(value, r("FindIntentAgentResponse")), null, 2); + } + + public static toFindIntentBridgeErrorResponse(json: string): FindIntentBridgeErrorResponse { + return cast(JSON.parse(json), r("FindIntentBridgeErrorResponse")); + } + + public static findIntentBridgeErrorResponseToJson(value: FindIntentBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("FindIntentBridgeErrorResponse")), null, 2); + } + + public static toFindIntentBridgeRequest(json: string): FindIntentBridgeRequest { + return cast(JSON.parse(json), r("FindIntentBridgeRequest")); + } + + public static findIntentBridgeRequestToJson(value: FindIntentBridgeRequest): string { + return JSON.stringify(uncast(value, r("FindIntentBridgeRequest")), null, 2); + } + + public static toFindIntentBridgeResponse(json: string): FindIntentBridgeResponse { + return cast(JSON.parse(json), r("FindIntentBridgeResponse")); + } + + public static findIntentBridgeResponseToJson(value: FindIntentBridgeResponse): string { + return JSON.stringify(uncast(value, r("FindIntentBridgeResponse")), null, 2); + } + + public static toFindIntentsByContextAgentErrorResponse(json: string): FindIntentsByContextAgentErrorResponse { + return cast(JSON.parse(json), r("FindIntentsByContextAgentErrorResponse")); + } + + public static findIntentsByContextAgentErrorResponseToJson(value: FindIntentsByContextAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextAgentErrorResponse")), null, 2); + } + + public static toFindIntentsByContextAgentRequest(json: string): FindIntentsByContextAgentRequest { + return cast(JSON.parse(json), r("FindIntentsByContextAgentRequest")); + } + + public static findIntentsByContextAgentRequestToJson(value: FindIntentsByContextAgentRequest): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextAgentRequest")), null, 2); + } + + public static toFindIntentsByContextAgentResponse(json: string): FindIntentsByContextAgentResponse { + return cast(JSON.parse(json), r("FindIntentsByContextAgentResponse")); + } + + public static findIntentsByContextAgentResponseToJson(value: FindIntentsByContextAgentResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextAgentResponse")), null, 2); + } + + public static toFindIntentsByContextBridgeErrorResponse(json: string): FindIntentsByContextBridgeErrorResponse { + return cast(JSON.parse(json), r("FindIntentsByContextBridgeErrorResponse")); + } + + public static findIntentsByContextBridgeErrorResponseToJson(value: FindIntentsByContextBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeErrorResponse")), null, 2); + } + + public static toFindIntentsByContextBridgeRequest(json: string): FindIntentsByContextBridgeRequest { + return cast(JSON.parse(json), r("FindIntentsByContextBridgeRequest")); + } + + public static findIntentsByContextBridgeRequestToJson(value: FindIntentsByContextBridgeRequest): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeRequest")), null, 2); + } + + public static toFindIntentsByContextBridgeResponse(json: string): FindIntentsByContextBridgeResponse { + return cast(JSON.parse(json), r("FindIntentsByContextBridgeResponse")); + } + + public static findIntentsByContextBridgeResponseToJson(value: FindIntentsByContextBridgeResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeResponse")), null, 2); + } + + public static toGetAppMetadataAgentErrorResponse(json: string): GetAppMetadataAgentErrorResponse { + return cast(JSON.parse(json), r("GetAppMetadataAgentErrorResponse")); + } + + public static getAppMetadataAgentErrorResponseToJson(value: GetAppMetadataAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataAgentErrorResponse")), null, 2); + } + + public static toGetAppMetadataAgentRequest(json: string): GetAppMetadataAgentRequest { + return cast(JSON.parse(json), r("GetAppMetadataAgentRequest")); + } + + public static getAppMetadataAgentRequestToJson(value: GetAppMetadataAgentRequest): string { + return JSON.stringify(uncast(value, r("GetAppMetadataAgentRequest")), null, 2); + } + + public static toGetAppMetadataAgentResponse(json: string): GetAppMetadataAgentResponse { + return cast(JSON.parse(json), r("GetAppMetadataAgentResponse")); + } + + public static getAppMetadataAgentResponseToJson(value: GetAppMetadataAgentResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataAgentResponse")), null, 2); + } + + public static toGetAppMetadataBridgeErrorResponse(json: string): GetAppMetadataBridgeErrorResponse { + return cast(JSON.parse(json), r("GetAppMetadataBridgeErrorResponse")); + } + + public static getAppMetadataBridgeErrorResponseToJson(value: GetAppMetadataBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataBridgeErrorResponse")), null, 2); + } + + public static toGetAppMetadataBridgeRequest(json: string): GetAppMetadataBridgeRequest { + return cast(JSON.parse(json), r("GetAppMetadataBridgeRequest")); + } + + public static getAppMetadataBridgeRequestToJson(value: GetAppMetadataBridgeRequest): string { + return JSON.stringify(uncast(value, r("GetAppMetadataBridgeRequest")), null, 2); + } + + public static toGetAppMetadataBridgeResponse(json: string): GetAppMetadataBridgeResponse { + return cast(JSON.parse(json), r("GetAppMetadataBridgeResponse")); + } + + public static getAppMetadataBridgeResponseToJson(value: GetAppMetadataBridgeResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataBridgeResponse")), null, 2); + } + + public static toOpenAgentErrorResponse(json: string): OpenAgentErrorResponse { + return cast(JSON.parse(json), r("OpenAgentErrorResponse")); + } + + public static openAgentErrorResponseToJson(value: OpenAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("OpenAgentErrorResponse")), null, 2); + } + + public static toOpenAgentRequest(json: string): OpenAgentRequest { + return cast(JSON.parse(json), r("OpenAgentRequest")); + } + + public static openAgentRequestToJson(value: OpenAgentRequest): string { + return JSON.stringify(uncast(value, r("OpenAgentRequest")), null, 2); + } + + public static toOpenAgentResponse(json: string): OpenAgentResponse { + return cast(JSON.parse(json), r("OpenAgentResponse")); + } + + public static openAgentResponseToJson(value: OpenAgentResponse): string { + return JSON.stringify(uncast(value, r("OpenAgentResponse")), null, 2); + } + + public static toOpenBridgeErrorResponse(json: string): OpenBridgeErrorResponse { + return cast(JSON.parse(json), r("OpenBridgeErrorResponse")); + } + + public static openBridgeErrorResponseToJson(value: OpenBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("OpenBridgeErrorResponse")), null, 2); + } + + public static toOpenBridgeRequest(json: string): OpenBridgeRequest { + return cast(JSON.parse(json), r("OpenBridgeRequest")); + } + + public static openBridgeRequestToJson(value: OpenBridgeRequest): string { + return JSON.stringify(uncast(value, r("OpenBridgeRequest")), null, 2); + } + + public static toOpenBridgeResponse(json: string): OpenBridgeResponse { + return cast(JSON.parse(json), r("OpenBridgeResponse")); + } + + public static openBridgeResponseToJson(value: OpenBridgeResponse): string { + return JSON.stringify(uncast(value, r("OpenBridgeResponse")), null, 2); + } + + public static toPrivateChannelBroadcastAgentRequest(json: string): PrivateChannelBroadcastAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelBroadcastAgentRequest")); + } + + public static privateChannelBroadcastAgentRequestToJson(value: PrivateChannelBroadcastAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelBroadcastAgentRequest")), null, 2); + } + + public static toPrivateChannelBroadcastBridgeRequest(json: string): PrivateChannelBroadcastBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelBroadcastBridgeRequest")); + } + + public static privateChannelBroadcastBridgeRequestToJson(value: PrivateChannelBroadcastBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelBroadcastBridgeRequest")), null, 2); + } + + public static toPrivateChannelEventListenerAddedAgentRequest(json: string): PrivateChannelEventListenerAddedAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelEventListenerAddedAgentRequest")); + } + + public static privateChannelEventListenerAddedAgentRequestToJson(value: PrivateChannelEventListenerAddedAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelEventListenerAddedAgentRequest")), null, 2); + } + + public static toPrivateChannelEventListenerAddedBridgeRequest(json: string): PrivateChannelEventListenerAddedBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelEventListenerAddedBridgeRequest")); + } + + public static privateChannelEventListenerAddedBridgeRequestToJson(value: PrivateChannelEventListenerAddedBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelEventListenerAddedBridgeRequest")), null, 2); + } + + public static toPrivateChannelEventListenerRemovedAgentRequest(json: string): PrivateChannelEventListenerRemovedAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelEventListenerRemovedAgentRequest")); + } + + public static privateChannelEventListenerRemovedAgentRequestToJson(value: PrivateChannelEventListenerRemovedAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelEventListenerRemovedAgentRequest")), null, 2); + } + + public static toPrivateChannelEventListenerRemovedBridgeRequest(json: string): PrivateChannelEventListenerRemovedBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelEventListenerRemovedBridgeRequest")); + } + + public static privateChannelEventListenerRemovedBridgeRequestToJson(value: PrivateChannelEventListenerRemovedBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelEventListenerRemovedBridgeRequest")), null, 2); + } + + public static toPrivateChannelOnAddContextListenerAgentRequest(json: string): PrivateChannelOnAddContextListenerAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerAgentRequest")); + } + + public static privateChannelOnAddContextListenerAgentRequestToJson(value: PrivateChannelOnAddContextListenerAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerAgentRequest")), null, 2); + } + + public static toPrivateChannelOnAddContextListenerBridgeRequest(json: string): PrivateChannelOnAddContextListenerBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerBridgeRequest")); + } + + public static privateChannelOnAddContextListenerBridgeRequestToJson(value: PrivateChannelOnAddContextListenerBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerBridgeRequest")), null, 2); + } + + public static toPrivateChannelOnDisconnectAgentRequest(json: string): PrivateChannelOnDisconnectAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelOnDisconnectAgentRequest")); + } + + public static privateChannelOnDisconnectAgentRequestToJson(value: PrivateChannelOnDisconnectAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectAgentRequest")), null, 2); + } + + public static toPrivateChannelOnDisconnectBridgeRequest(json: string): PrivateChannelOnDisconnectBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelOnDisconnectBridgeRequest")); + } + + public static privateChannelOnDisconnectBridgeRequestToJson(value: PrivateChannelOnDisconnectBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectBridgeRequest")), null, 2); + } + + public static toPrivateChannelOnUnsubscribeAgentRequest(json: string): PrivateChannelOnUnsubscribeAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeAgentRequest")); + } + + public static privateChannelOnUnsubscribeAgentRequestToJson(value: PrivateChannelOnUnsubscribeAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeAgentRequest")), null, 2); + } + + public static toPrivateChannelOnUnsubscribeBridgeRequest(json: string): PrivateChannelOnUnsubscribeBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeBridgeRequest")); + } + + public static privateChannelOnUnsubscribeBridgeRequestToJson(value: PrivateChannelOnUnsubscribeBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeBridgeRequest")), null, 2); + } + + public static toRaiseIntentAgentErrorResponse(json: string): RaiseIntentAgentErrorResponse { + return cast(JSON.parse(json), r("RaiseIntentAgentErrorResponse")); + } + + public static raiseIntentAgentErrorResponseToJson(value: RaiseIntentAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentAgentErrorResponse")), null, 2); + } + + public static toRaiseIntentAgentRequest(json: string): RaiseIntentAgentRequest { + return cast(JSON.parse(json), r("RaiseIntentAgentRequest")); + } + + public static raiseIntentAgentRequestToJson(value: RaiseIntentAgentRequest): string { + return JSON.stringify(uncast(value, r("RaiseIntentAgentRequest")), null, 2); + } + + public static toRaiseIntentAgentResponse(json: string): RaiseIntentAgentResponse { + return cast(JSON.parse(json), r("RaiseIntentAgentResponse")); + } + + public static raiseIntentAgentResponseToJson(value: RaiseIntentAgentResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentAgentResponse")), null, 2); + } + + public static toRaiseIntentBridgeErrorResponse(json: string): RaiseIntentBridgeErrorResponse { + return cast(JSON.parse(json), r("RaiseIntentBridgeErrorResponse")); + } + + public static raiseIntentBridgeErrorResponseToJson(value: RaiseIntentBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentBridgeErrorResponse")), null, 2); + } + + public static toRaiseIntentBridgeRequest(json: string): RaiseIntentBridgeRequest { + return cast(JSON.parse(json), r("RaiseIntentBridgeRequest")); + } + + public static raiseIntentBridgeRequestToJson(value: RaiseIntentBridgeRequest): string { + return JSON.stringify(uncast(value, r("RaiseIntentBridgeRequest")), null, 2); + } + + public static toRaiseIntentBridgeResponse(json: string): RaiseIntentBridgeResponse { + return cast(JSON.parse(json), r("RaiseIntentBridgeResponse")); + } + + public static raiseIntentBridgeResponseToJson(value: RaiseIntentBridgeResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentBridgeResponse")), null, 2); + } + + public static toRaiseIntentResultAgentErrorResponse(json: string): RaiseIntentResultAgentErrorResponse { + return cast(JSON.parse(json), r("RaiseIntentResultAgentErrorResponse")); + } + + public static raiseIntentResultAgentErrorResponseToJson(value: RaiseIntentResultAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultAgentErrorResponse")), null, 2); + } + + public static toRaiseIntentResultAgentResponse(json: string): RaiseIntentResultAgentResponse { + return cast(JSON.parse(json), r("RaiseIntentResultAgentResponse")); + } + + public static raiseIntentResultAgentResponseToJson(value: RaiseIntentResultAgentResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultAgentResponse")), null, 2); + } + + public static toRaiseIntentResultBridgeErrorResponse(json: string): RaiseIntentResultBridgeErrorResponse { + return cast(JSON.parse(json), r("RaiseIntentResultBridgeErrorResponse")); + } + + public static raiseIntentResultBridgeErrorResponseToJson(value: RaiseIntentResultBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultBridgeErrorResponse")), null, 2); + } + + public static toRaiseIntentResultBridgeResponse(json: string): RaiseIntentResultBridgeResponse { + return cast(JSON.parse(json), r("RaiseIntentResultBridgeResponse")); + } + + public static raiseIntentResultBridgeResponseToJson(value: RaiseIntentResultBridgeResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultBridgeResponse")), null, 2); + } +} + +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { + const prettyTyp = prettyTypeName(typ); + const parentText = parent ? ` on ${parent}` : ''; + const keyText = key ? ` for key "${key}"` : ''; + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); +} + +function prettyTypeName(typ: any): string { + if (Array.isArray(typ)) { + if (typ.length === 2 && typ[0] === undefined) { + return `an optional ${prettyTypeName(typ[1])}`; + } else { + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; + } + } else if (typeof typ === "object" && typ.literal !== undefined) { + return typ.literal; + } else { + return typeof typ; + } +} + +function jsonToJSProps(typ: any): any { + if (typ.jsonToJS === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); + typ.jsonToJS = map; + } + return typ.jsonToJS; +} + +function jsToJSONProps(typ: any): any { + if (typ.jsToJSON === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); + typ.jsToJSON = map; + } + return typ.jsToJSON; +} + +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { + function transformPrimitive(typ: string, val: any): any { + if (typeof typ === typeof val) return val; + return invalidValue(typ, val, key, parent); + } + + function transformUnion(typs: any[], val: any): any { + // val must validate against one typ in typs + const l = typs.length; + for (let i = 0; i < l; i++) { + const typ = typs[i]; + try { + return transform(val, typ, getProps); + } catch (_) {} + } + return invalidValue(typs, val, key, parent); + } + + function transformEnum(cases: string[], val: any): any { + if (cases.indexOf(val) !== -1) return val; + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); + } + + function transformArray(typ: any, val: any): any { + // val must be an array with no invalid elements + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); + return val.map(el => transform(el, typ, getProps)); + } + + function transformDate(val: any): any { + if (val === null) { + return null; + } + const d = new Date(val); + if (isNaN(d.valueOf())) { + return invalidValue(l("Date"), val, key, parent); + } + return d; + } + + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { + if (val === null || typeof val !== "object" || Array.isArray(val)) { + return invalidValue(l(ref || "object"), val, key, parent); + } + const result: any = {}; + Object.getOwnPropertyNames(props).forEach(key => { + const prop = props[key]; + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; + result[prop.key] = transform(v, prop.typ, getProps, key, ref); + }); + Object.getOwnPropertyNames(val).forEach(key => { + if (!Object.prototype.hasOwnProperty.call(props, key)) { + result[key] = transform(val[key], additional, getProps, key, ref); + } + }); + return result; + } + + if (typ === "any") return val; + if (typ === null) { + if (val === null) return val; + return invalidValue(typ, val, key, parent); + } + if (typ === false) return invalidValue(typ, val, key, parent); + let ref: any = undefined; + while (typeof typ === "object" && typ.ref !== undefined) { + ref = typ.ref; + typ = typeMap[typ.ref]; + } + if (Array.isArray(typ)) return transformEnum(typ, val); + if (typeof typ === "object") { + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) + : invalidValue(typ, val, key, parent); + } + // Numbers can be parsed by Date but shouldn't be. + if (typ === Date && typeof val !== "number") return transformDate(val); + return transformPrimitive(typ, val); +} + +function cast(val: any, typ: any): T { + return transform(val, typ, jsonToJSProps); +} + +function uncast(val: T, typ: any): any { + return transform(val, typ, jsToJSONProps); +} + +function l(typ: any) { + return { literal: typ }; +} + +function a(typ: any) { + return { arrayItems: typ }; +} + +function u(...typs: any[]) { + return { unionMembers: typs }; +} + +function o(props: any[], additional: any) { + return { props, additional }; +} + +function m(additional: any) { + return { props: [], additional }; +} + +function r(name: string) { + return { ref: name }; +} + +const typeMap: any = { + "AgentErrorResponseMessage": o([ + { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, + { json: "payload", js: "payload", typ: r("ErrorResponseMessagePayload") }, + { json: "type", js: "type", typ: r("ResponseMessageType") }, + ], false), + "AgentResponseMetadata": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ErrorResponseMessagePayload": o([ + { json: "error", js: "error", typ: r("ResponseErrorDetail") }, + ], "any"), + "AgentRequestMessage": o([ + { json: "meta", js: "meta", typ: r("AgentRequestMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("RequestMessageType") }, + ], false), + "AgentRequestMetadata": o([ + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "BridgeParticipantIdentifier": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "SourceIdentifier": o([ + { json: "appId", js: "appId", typ: u(undefined, "") }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "AgentResponseMessage": o([ + { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("ResponseMessageType") }, + ], false), + "BridgeErrorResponseMessage": o([ + { json: "meta", js: "meta", typ: r("BridgeErrorResponseMessageMeta") }, + { json: "payload", js: "payload", typ: r("ResponseErrorMessagePayload") }, + { json: "type", js: "type", typ: "" }, + ], false), + "BridgeErrorResponseMessageMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "DesktopAgentIdentifier": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + ], "any"), + "ResponseErrorMessagePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponseErrorDetail")) }, + ], "any"), + "BridgeRequestMessage": o([ + { json: "meta", js: "meta", typ: r("BridgeRequestMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: "" }, + ], false), + "BridgeRequestMetadata": o([ + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("BridgeParticipantIdentifier") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "BridgeResponseMessage": o([ + { json: "meta", js: "meta", typ: r("BridgeResponseMessageMeta") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: "" }, + ], false), + "BridgeResponseMessageMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "BroadcastAgentRequest": o([ + { json: "meta", js: "meta", typ: r("BroadcastAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastAgentRequestPayload") }, + { json: "type", js: "type", typ: r("BroadcastAgentRequestType") }, + ], false), + "BroadcastAgentRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("SourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "SourceObject": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "BroadcastAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "Context": o([ + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: "" }, + ], "any"), + "BroadcastBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("BroadcastBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("BroadcastAgentRequestType") }, + ], false), + "BroadcastBridgeRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "MetaSource": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "BroadcastBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "ConnectionStepMessage": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("ConnectionStepMessageType") }, + ], false), + "ConnectionStepMetadata": o([ + { json: "requestUuid", js: "requestUuid", typ: u(undefined, "") }, + { json: "responseUuid", js: "responseUuid", typ: u(undefined, "") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep2Hello": o([ + { json: "meta", js: "meta", typ: r("ConnectionStep2HelloMeta") }, + { json: "payload", js: "payload", typ: r("ConnectionStep2HelloPayload") }, + { json: "type", js: "type", typ: r("ConnectionStep2HelloType") }, + ], false), + "ConnectionStep2HelloMeta": o([ + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep2HelloPayload": o([ + { json: "authRequired", js: "authRequired", typ: true }, + { json: "authToken", js: "authToken", typ: u(undefined, "") }, + { json: "desktopAgentBridgeVersion", js: "desktopAgentBridgeVersion", typ: "" }, + { json: "supportedFDC3Versions", js: "supportedFDC3Versions", typ: a("") }, + ], false), + "ConnectionStep3Handshake": o([ + { json: "meta", js: "meta", typ: r("ConnectionStep3HandshakeMeta") }, + { json: "payload", js: "payload", typ: r("ConnectionStep3HandshakePayload") }, + { json: "type", js: "type", typ: r("ConnectionStep3HandshakeType") }, + ], false), + "ConnectionStep3HandshakeMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep3HandshakePayload": o([ + { json: "authToken", js: "authToken", typ: u(undefined, "") }, + { json: "channelsState", js: "channelsState", typ: m(a(r("Context"))) }, + { json: "implementationMetadata", js: "implementationMetadata", typ: r("ConnectingAgentImplementationMetadata") }, + { json: "requestedName", js: "requestedName", typ: "" }, + ], false), + "ConnectingAgentImplementationMetadata": o([ + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, + { json: "provider", js: "provider", typ: "" }, + { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, + ], false), + "OptionalFeatures": o([ + { json: "DesktopAgentBridging", js: "DesktopAgentBridging", typ: true }, + { json: "OriginatingAppMetadata", js: "OriginatingAppMetadata", typ: true }, + { json: "UserChannelMembershipAPIs", js: "UserChannelMembershipAPIs", typ: true }, + ], false), + "ConnectionStep4AuthenticationFailed": o([ + { json: "meta", js: "meta", typ: r("ConnectionStep4AuthenticationFailedMeta") }, + { json: "payload", js: "payload", typ: r("ConnectionStep4AuthenticationFailedPayload") }, + { json: "type", js: "type", typ: r("ConnectionStep4AuthenticationFailedType") }, + ], false), + "ConnectionStep4AuthenticationFailedMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep4AuthenticationFailedPayload": o([ + { json: "message", js: "message", typ: u(undefined, "") }, + ], false), + "ConnectionStep6ConnectedAgentsUpdate": o([ + { json: "meta", js: "meta", typ: r("ConnectionStep6ConnectedAgentsUpdateMeta") }, + { json: "payload", js: "payload", typ: r("ConnectionStep6ConnectedAgentsUpdatePayload") }, + { json: "type", js: "type", typ: r("ConnectionStep6ConnectedAgentsUpdateType") }, + ], false), + "ConnectionStep6ConnectedAgentsUpdateMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep6ConnectedAgentsUpdatePayload": o([ + { json: "addAgent", js: "addAgent", typ: u(undefined, "") }, + { json: "allAgents", js: "allAgents", typ: a(r("DesktopAgentImplementationMetadata")) }, + { json: "channelsState", js: "channelsState", typ: u(undefined, m(a(r("Context")))) }, + { json: "removeAgent", js: "removeAgent", typ: u(undefined, "") }, + ], false), + "DesktopAgentImplementationMetadata": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, + { json: "provider", js: "provider", typ: "" }, + { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, + ], false), + "FindInstancesAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindInstancesAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("PayloadClass") }, + { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, + ], false), + "FindInstancesAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PayloadClass": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindInstancesAgentRequest": o([ + { json: "meta", js: "meta", typ: r("FindInstancesAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesAgentRequestPayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentRequestType") }, + ], false), + "FindInstancesAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "DestinationObject": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "FindInstancesAgentRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + ], false), + "AppIdentifier": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "FindInstancesAgentResponse": o([ + { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, + { json: "payload", js: "payload", typ: r("FindInstancesAgentResponsePayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, + ], false), + "FindInstancesAgentResponsePayload": o([ + { json: "appIdentifiers", js: "appIdentifiers", typ: a(r("AppMetadata")) }, + ], false), + "AppMetadata": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "description", js: "description", typ: u(undefined, "") }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "icons", js: "icons", typ: u(undefined, a(r("Icon"))) }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + { json: "instanceMetadata", js: "instanceMetadata", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "resultType", js: "resultType", typ: u(undefined, u(null, "")) }, + { json: "screenshots", js: "screenshots", typ: u(undefined, a(r("Image"))) }, + { json: "title", js: "title", typ: u(undefined, "") }, + { json: "tooltip", js: "tooltip", typ: u(undefined, "") }, + { json: "version", js: "version", typ: u(undefined, "") }, + ], false), + "Icon": o([ + { json: "size", js: "size", typ: u(undefined, "") }, + { json: "src", js: "src", typ: "" }, + { json: "type", js: "type", typ: u(undefined, "") }, + ], false), + "Image": o([ + { json: "label", js: "label", typ: u(undefined, "") }, + { json: "size", js: "size", typ: u(undefined, "") }, + { json: "src", js: "src", typ: "" }, + { json: "type", js: "type", typ: u(undefined, "") }, + ], false), + "FindInstancesBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindInstancesBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("MessagePayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, + ], false), + "FindInstancesBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "MessagePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindInstancesBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("FindInstancesBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentRequestType") }, + ], false), + "FindInstancesBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "MetaSourceObject": o([ + { json: "appId", js: "appId", typ: u(undefined, "") }, + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "FindInstancesBridgeRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + ], false), + "FindInstancesBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("BridgeResponseMessageMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, + ], false), + "FindInstancesBridgeResponsePayload": o([ + { json: "appIdentifiers", js: "appIdentifiers", typ: a(r("AppMetadata")) }, + ], false), + "FindIntentAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, + ], false), + "FindIntentAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindIntentAgentRequest": o([ + { json: "meta", js: "meta", typ: r("FindIntentAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentAgentRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentRequestType") }, + ], false), + "FindIntentAgentRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + ], false), + "FindIntentAgentRequestPayload": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "intent", js: "intent", typ: "" }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentAgentResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentAgentResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, + ], false), + "FindIntentAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentAgentResponsePayload": o([ + { json: "appIntent", js: "appIntent", typ: r("AppIntent") }, + ], false), + "AppIntent": o([ + { json: "apps", js: "apps", typ: a(r("AppMetadata")) }, + { json: "intent", js: "intent", typ: r("IntentMetadata") }, + ], false), + "IntentMetadata": o([ + { json: "displayName", js: "displayName", typ: u(undefined, "") }, + { json: "name", js: "name", typ: "" }, + ], false), + "FindIntentBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, + ], false), + "FindIntentBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindIntentBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("FindIntentBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentRequestType") }, + ], false), + "FindIntentBridgeRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("BridgeParticipantIdentifier") }, + { json: "timestamp", js: "timestamp", typ: Date }, + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + ], false), + "FindIntentBridgeRequestPayload": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "intent", js: "intent", typ: "" }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, + ], false), + "FindIntentBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentBridgeResponsePayload": o([ + { json: "appIntent", js: "appIntent", typ: r("AppIntent") }, + ], false), + "FindIntentsByContextAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, + ], false), + "FindIntentsByContextAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentsByContextAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindIntentsByContextAgentRequest": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentRequestType") }, + ], false), + "FindIntentsByContextAgentRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + ], false), + "FindIntentsByContextAgentRequestPayload": o([ + { json: "context", js: "context", typ: r("Context") }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentsByContextAgentResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, + ], false), + "FindIntentsByContextAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentsByContextAgentResponsePayload": o([ + { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, + ], false), + "FindIntentsByContextBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, + ], false), + "FindIntentsByContextBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentsByContextBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindIntentsByContextBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentRequestType") }, + ], false), + "FindIntentsByContextBridgeRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + ], false), + "FindIntentsByContextBridgeRequestPayload": o([ + { json: "context", js: "context", typ: r("Context") }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentsByContextBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, + ], false), + "FindIntentsByContextBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentsByContextBridgeResponsePayload": o([ + { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, + ], false), + "GetAppMetadataAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, + ], false), + "GetAppMetadataAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "GetAppMetadataAgentRequest": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataAgentRequestPayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentRequestType") }, + ], false), + "GetAppMetadataAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataAgentRequestPayload": o([ + { json: "app", js: "app", typ: r("AppObject") }, + ], false), + "AppObject": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "GetAppMetadataAgentResponse": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataAgentResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, + ], false), + "GetAppMetadataAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataAgentResponsePayload": o([ + { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, + ], false), + "GetAppMetadataBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, + ], false), + "GetAppMetadataBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "GetAppMetadataBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentRequestType") }, + ], false), + "GetAppMetadataBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataBridgeRequestPayload": o([ + { json: "app", js: "app", typ: r("AppObject") }, + ], false), + "GetAppMetadataBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, + ], false), + "GetAppMetadataBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataBridgeResponsePayload": o([ + { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, + ], false), + "OpenAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("OpenAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, + ], false), + "OpenAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("OpenErrorResponsePayload") }, + ], false), + "OpenAgentRequest": o([ + { json: "meta", js: "meta", typ: r("OpenAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("OpenAgentRequestPayload") }, + { json: "type", js: "type", typ: r("OpenAgentRequestType") }, + ], false), + "OpenAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("SourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenAgentRequestPayload": o([ + { json: "app", js: "app", typ: r("AppToOpen") }, + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + ], false), + "AppToOpen": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "OpenAgentResponse": o([ + { json: "meta", js: "meta", typ: r("OpenAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenAgentResponsePayload") }, + { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, + ], false), + "OpenAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenAgentResponsePayload": o([ + { json: "appIdentifier", js: "appIdentifier", typ: r("AppIdentifier") }, + ], false), + "OpenBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("OpenBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, + ], false), + "OpenBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("OpenErrorResponsePayload") }, + ], false), + "OpenBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("OpenBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("OpenBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("OpenAgentRequestType") }, + ], false), + "OpenBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenBridgeRequestPayload": o([ + { json: "app", js: "app", typ: r("AppToOpen") }, + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + ], false), + "OpenBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("OpenBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, + ], false), + "OpenBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenBridgeResponsePayload": o([ + { json: "appIdentifier", js: "appIdentifier", typ: r("AppIdentifier") }, + ], false), + "PrivateChannelBroadcastAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelBroadcastAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelBroadcastAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelBroadcastAgentRequestType") }, + ], false), + "PrivateChannelBroadcastAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "MetaDestination": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "PrivateChannelBroadcastAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "PrivateChannelBroadcastBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelBroadcastBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelBroadcastBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelBroadcastAgentRequestType") }, + ], false), + "PrivateChannelBroadcastBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelBroadcastBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "PrivateChannelEventListenerAddedAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerAddedAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerAddedAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelEventListenerAddedAgentRequestType") }, + ], false), + "PrivateChannelEventListenerAddedAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelEventListenerAddedAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + ], false), + "PrivateChannelEventListenerAddedBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerAddedBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerAddedBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelEventListenerAddedAgentRequestType") }, + ], false), + "PrivateChannelEventListenerAddedBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelEventListenerAddedBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + ], false), + "PrivateChannelEventListenerRemovedAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerRemovedAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerRemovedAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelEventListenerRemovedAgentRequestType") }, + ], false), + "PrivateChannelEventListenerRemovedAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelEventListenerRemovedAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + ], false), + "PrivateChannelEventListenerRemovedBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerRemovedBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerRemovedBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelEventListenerRemovedAgentRequestType") }, + ], false), + "PrivateChannelEventListenerRemovedBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelEventListenerRemovedBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + ], false), + "PrivateChannelOnAddContextListenerAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnAddContextListenerAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerAgentRequestType") }, + ], false), + "PrivateChannelOnAddContextListenerAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnAddContextListenerAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "PrivateChannelOnAddContextListenerBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnAddContextListenerBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerAgentRequestType") }, + ], false), + "PrivateChannelOnAddContextListenerBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnAddContextListenerBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "PrivateChannelOnDisconnectAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnDisconnectAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectAgentRequestType") }, + ], false), + "PrivateChannelOnDisconnectAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnDisconnectAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "PrivateChannelOnDisconnectBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnDisconnectBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectAgentRequestType") }, + ], false), + "PrivateChannelOnDisconnectBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnDisconnectBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "PrivateChannelOnUnsubscribeAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnUnsubscribeAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeAgentRequestType") }, + ], false), + "PrivateChannelOnUnsubscribeAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnUnsubscribeAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "PrivateChannelOnUnsubscribeBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("ERequestMetadata") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeAgentRequestType") }, + ], false), + "ERequestMetadata": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnUnsubscribeBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "RaiseIntentAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, + ], false), + "RaiseIntentAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "RaiseIntentAgentRequest": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentAgentRequestPayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentRequestType") }, + ], false), + "RaiseIntentAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: r("MetaDestination") }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("SourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentAgentRequestPayload": o([ + { json: "app", js: "app", typ: r("AppDestinationIdentifier") }, + { json: "context", js: "context", typ: r("Context") }, + { json: "intent", js: "intent", typ: "" }, + ], false), + "AppDestinationIdentifier": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "RaiseIntentAgentResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentAgentResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, + ], false), + "RaiseIntentAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentAgentResponsePayload": o([ + { json: "intentResolution", js: "intentResolution", typ: r("IntentResolution") }, + ], false), + "IntentResolution": o([ + { json: "intent", js: "intent", typ: "" }, + { json: "source", js: "source", typ: r("AppIdentifier") }, + ], false), + "RaiseIntentBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, + ], false), + "RaiseIntentBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "RaiseIntentBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentRequestType") }, + ], false), + "RaiseIntentBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: r("MetaDestination") }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentBridgeRequestPayload": o([ + { json: "app", js: "app", typ: r("AppDestinationIdentifier") }, + { json: "context", js: "context", typ: r("Context") }, + { json: "intent", js: "intent", typ: "" }, + ], false), + "RaiseIntentBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, + ], false), + "RaiseIntentBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentBridgeResponsePayload": o([ + { json: "intentResolution", js: "intentResolution", typ: r("IntentResolution") }, + ], false), + "RaiseIntentResultAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentResultAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, + ], false), + "RaiseIntentResultAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentResultAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("RaiseIntentResultErrorMessage") }, + ], false), + "RaiseIntentResultAgentResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentResultAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultAgentResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, + ], false), + "RaiseIntentResultAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentResultAgentResponsePayload": o([ + { json: "intentResult", js: "intentResult", typ: r("IntentResult") }, + ], false), + "IntentResult": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, + ], false), + "Channel": o([ + { json: "displayMetadata", js: "displayMetadata", typ: u(undefined, r("DisplayMetadata")) }, + { json: "id", js: "id", typ: "" }, + { json: "type", js: "type", typ: r("Type") }, + ], false), + "DisplayMetadata": o([ + { json: "color", js: "color", typ: u(undefined, "") }, + { json: "glyph", js: "glyph", typ: u(undefined, "") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], false), + "RaiseIntentResultBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentResultBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, + ], false), + "RaiseIntentResultBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentResultBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("RaiseIntentResultErrorMessage") }, + ], false), + "RaiseIntentResultBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentResultBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, + ], false), + "RaiseIntentResultBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentResultBridgeResponsePayload": o([ + { json: "intentResult", js: "intentResult", typ: r("IntentResult") }, + ], false), + "ResponseErrorDetail": [ + "AccessDenied", + "AgentDisconnected", + "AppNotFound", + "AppTimeout", + "CreationFailed", + "DesktopAgentNotFound", + "ErrorOnLaunch", + "IntentDeliveryFailed", + "IntentHandlerRejected", + "MalformedContext", + "MalformedMessage", + "NoAppsFound", + "NoChannelFound", + "NoResultReturned", + "NotConnectedToBridge", + "ResolverTimeout", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "ResponseMessageType": [ + "findInstancesResponse", + "findIntentResponse", + "findIntentsByContextResponse", + "getAppMetadataResponse", + "openResponse", + "raiseIntentResponse", + "raiseIntentResultResponse", + ], + "RequestMessageType": [ + "broadcastRequest", + "findInstancesRequest", + "findIntentRequest", + "findIntentsByContextRequest", + "getAppMetadataRequest", + "openRequest", + "PrivateChannel.broadcast", + "PrivateChannel.eventListenerAdded", + "PrivateChannel.eventListenerRemoved", + "PrivateChannel.onAddContextListener", + "PrivateChannel.onDisconnect", + "PrivateChannel.onUnsubscribe", + "raiseIntentRequest", + ], + "BroadcastAgentRequestType": [ + "broadcastRequest", + ], + "ConnectionStepMessageType": [ + "authenticationFailed", + "connectedAgentsUpdate", + "handshake", + "hello", + ], + "ConnectionStep2HelloType": [ + "hello", + ], + "ConnectionStep3HandshakeType": [ + "handshake", + ], + "ConnectionStep4AuthenticationFailedType": [ + "authenticationFailed", + ], + "ConnectionStep6ConnectedAgentsUpdateType": [ + "connectedAgentsUpdate", + ], + "FindInstancesErrors": [ + "AgentDisconnected", + "DesktopAgentNotFound", + "IntentDeliveryFailed", + "MalformedContext", + "MalformedMessage", + "NoAppsFound", + "NotConnectedToBridge", + "ResolverTimeout", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "FindInstancesAgentErrorResponseType": [ + "findInstancesResponse", + ], + "FindInstancesAgentRequestType": [ + "findInstancesRequest", + ], + "FindIntentAgentErrorResponseType": [ + "findIntentResponse", + ], + "FindIntentAgentRequestType": [ + "findIntentRequest", + ], + "FindIntentsByContextAgentErrorResponseType": [ + "findIntentsByContextResponse", + ], + "FindIntentsByContextAgentRequestType": [ + "findIntentsByContextRequest", + ], + "GetAppMetadataAgentErrorResponseType": [ + "getAppMetadataResponse", + ], + "GetAppMetadataAgentRequestType": [ + "getAppMetadataRequest", + ], + "OpenErrorResponsePayload": [ + "AgentDisconnected", + "AppNotFound", + "AppTimeout", + "DesktopAgentNotFound", + "ErrorOnLaunch", + "MalformedContext", + "MalformedMessage", + "NotConnectedToBridge", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + ], + "OpenAgentErrorResponseType": [ + "openResponse", + ], + "OpenAgentRequestType": [ + "openRequest", + ], + "PrivateChannelBroadcastAgentRequestType": [ + "PrivateChannel.broadcast", + ], + "PrivateChannelEventListenerTypes": [ + "onAddContextListener", + "onDisconnect", + "onUnsubscribe", + ], + "PrivateChannelEventListenerAddedAgentRequestType": [ + "PrivateChannel.eventListenerAdded", + ], + "PrivateChannelEventListenerRemovedAgentRequestType": [ + "PrivateChannel.eventListenerRemoved", + ], + "PrivateChannelOnAddContextListenerAgentRequestType": [ + "PrivateChannel.onAddContextListener", + ], + "PrivateChannelOnDisconnectAgentRequestType": [ + "PrivateChannel.onDisconnect", + ], + "PrivateChannelOnUnsubscribeAgentRequestType": [ + "PrivateChannel.onUnsubscribe", + ], + "RaiseIntentAgentErrorResponseType": [ + "raiseIntentResponse", + ], + "RaiseIntentAgentRequestType": [ + "raiseIntentRequest", + ], + "RaiseIntentResultErrorMessage": [ + "AgentDisconnected", + "IntentHandlerRejected", + "MalformedMessage", + "NoResultReturned", + "NotConnectedToBridge", + "ResponseToBridgeTimedOut", + ], + "RaiseIntentResultAgentErrorResponseType": [ + "raiseIntentResultResponse", + ], + "Type": [ + "app", + "private", + "user", + ], +}; diff --git a/packages/fdc3-context/generated/context/ContextTypes.ts b/packages/fdc3-context/generated/context/ContextTypes.ts new file mode 100644 index 000000000..8fccd9007 --- /dev/null +++ b/packages/fdc3-context/generated/context/ContextTypes.ts @@ -0,0 +1,2901 @@ +// To parse this data: +// +// import { Convert, Action, Chart, ChatInitSettings, ChatMessage, ChatRoom, ChatSearchCriteria, Contact, ContactList, Context, Country, Currency, Email, Instrument, InstrumentList, Interaction, Message, Nothing, Order, OrderList, Organization, Portfolio, Position, Product, TimeRange, Trade, TradeList, TransactionResult, Valuation } from "./file"; +// +// const action = Convert.toAction(json); +// const chart = Convert.toChart(json); +// const chatInitSettings = Convert.toChatInitSettings(json); +// const chatMessage = Convert.toChatMessage(json); +// const chatRoom = Convert.toChatRoom(json); +// const chatSearchCriteria = Convert.toChatSearchCriteria(json); +// const contact = Convert.toContact(json); +// const contactList = Convert.toContactList(json); +// const context = Convert.toContext(json); +// const country = Convert.toCountry(json); +// const currency = Convert.toCurrency(json); +// const email = Convert.toEmail(json); +// const instrument = Convert.toInstrument(json); +// const instrumentList = Convert.toInstrumentList(json); +// const interaction = Convert.toInteraction(json); +// const message = Convert.toMessage(json); +// const nothing = Convert.toNothing(json); +// const order = Convert.toOrder(json); +// const orderList = Convert.toOrderList(json); +// const organization = Convert.toOrganization(json); +// const portfolio = Convert.toPortfolio(json); +// const position = Convert.toPosition(json); +// const product = Convert.toProduct(json); +// const timeRange = Convert.toTimeRange(json); +// const trade = Convert.toTrade(json); +// const tradeList = Convert.toTradeList(json); +// const transactionResult = Convert.toTransactionResult(json); +// const valuation = Convert.toValuation(json); +// +// These functions will throw an error if the JSON doesn't +// match the expected interface, even if the JSON is valid. + +/** + * 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. + */ +export interface Action { + /** + * An optional target application identifier that should perform the action + */ + app?: AppIdentifier; + /** + * A context object with which the action will be performed + */ + context: ContextElement; + /** + * 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. + */ + intent?: string; + /** + * A human readable display name for the action + */ + title: string; + type: "fdc3.action"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * An optional target application identifier that should perform the action + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + */ +export interface AppIdentifier { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * A context object with which the action will be performed + * + * A context object returned by the transaction, possibly with updated data. + * + * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by + * FDC3 operations. As such, it is not really meant to be used on its own, but is imported + * by more specific type definitions (standardized or custom) to provide the structure and + * properties shared by all FDC3 context data types. + * + * The key element of FDC3 context types is their mandatory `type` property, which is used + * to identify what type of data the object represents, and what shape it has. + * + * The FDC3 context type, and all derived types, define the minimum set of fields a context + * data object of a particular type can be expected to have, but this can always be extended + * with custom fields as appropriate. + */ +export interface ContextElement { + /** + * Context data objects may include a set of equivalent key-value pairs that can be used to + * help applications identify and look up the context type they receive in their own domain. + * The idea behind this design is that applications can provide as many equivalent + * identifiers to a target application as possible, e.g. an instrument may be represented by + * an ISIN, CUSIP or Bloomberg identifier. + * + * Identifiers do not make sense for all types of data, so the `id` property is therefore + * optional, but some derived types may choose to require at least one identifier. + * Identifier values SHOULD always be of type string. + */ + id?: { [key: string]: any }; + /** + * Context data objects may include a name property that can be used for more information, + * or display purposes. Some derived types may require the name object as mandatory, + * depending on use case. + */ + name?: string; + /** + * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 + * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present + * to route shared context data appropriately. + * + * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data + * types they support in an FDC3 [App + * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery + * and routing. + * + * Standardized FDC3 context types have well-known `type` properties prefixed with the + * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and + * used by a particular organization, the convention is to prefix them with an + * organization-specific namespace, e.g. `blackrock.fund`. + * + * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more + * information about context data types. + */ + type: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * 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. + * + * 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. + */ +export interface Chart { + /** + * An array of instrument contexts whose data should be plotted. + */ + instruments: InstrumentElement[]; + /** + * 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. + */ + otherConfig?: ContextElement[]; + /** + * The time range that should be plotted + */ + range?: TimeRangeObject; + /** + * The type of chart that should be plotted + */ + style?: ChartStyle; + type: "fdc3.chart"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * financial instrument that relates to the definition of this product + * + * + * + * A financial instrument from any asset class. + */ +export interface InstrumentElement { + /** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + */ + id: PurpleInstrumentIdentifiers; + /** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ + market?: OrganizationMarket; + type: "fdc3.instrument"; + name?: string; + [property: string]: any; +} + +/** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + */ +export interface PurpleInstrumentIdentifiers { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.cusip.com/ + */ + CUSIP?: string; + /** + * https://www.factset.com/ + */ + FDS_ID?: string; + /** + * https://www.openfigi.com/ + */ + FIGI?: string; + /** + * https://www.isin.org/ + */ + ISIN?: string; + /** + * https://permid.org/ + */ + PERMID?: string; + /** + * https://www.refinitiv.com/ + */ + RIC?: string; + /** + * https://www.lseg.com/sedol + */ + SEDOL?: string; + /** + * Unstandardized stock tickers + */ + ticker?: string; + [property: string]: any; +} + +/** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ +export interface OrganizationMarket { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.iso.org/iso-3166-country-codes.html + */ + COUNTRY_ISOALPHA2?: string; + /** + * https://en.wikipedia.org/wiki/Market_Identifier_Code + */ + MIC?: string; + /** + * Human readable market name + */ + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * The time range that should be plotted + * + * The time range over which the interaction occurred + * + * A context representing a period of time. Any user interfaces that represent or visualize + * events or activity over time can be filtered or focused on a particular time period, + * e.g.: + * + * - A pricing chart + * - A trade blotter + * - A record of client contact/activity in a CRM + * + * Example use cases: + * + * - User may want to view pricing/trades/customer activity for a security over a particular + * time period, the time range might be specified as the context for the `ViewChart` intent + * OR it might be embedded in another context (e.g. a context representing a chart to plot). + * - User filters a visualization (e.g. a pricing chart) to show a particular period, the + * `TimeRange` is broadcast and other visualizations (e.g. a heatmap of activity by + * instrument, or industry sector etc.) receive it and filter themselves to show data over + * the same range. + * + * Notes: + * + * - A `TimeRange` may be closed (i.e. `startTime` and `endTime` are both known) or open + * (i.e. only one of `startTime` or `endTime` is known). + * - Ranges corresponding to dates (e.g. `2022-05-12` to `2022-05-19`) should be specified + * using times as this prevents issues with timezone conversions and inclusive/exclusive + * date ranges. + * - String fields representing times are encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html). + * - A timezone indicator should be specified, e.g. `"2022-05-12T15:18:03Z"` or + * `"2022-05-12T16:18:03+01:00"` + * - Times MAY be specified with millisecond precision, e.g. `"2022-05-12T15:18:03.349Z"` + */ +export interface TimeRangeObject { + /** + * The end time of the range, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. + */ + endTime?: Date; + /** + * The start time of the range, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. + */ + startTime?: Date; + type: "fdc3.timeRange"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * The type of chart that should be plotted + */ +export type ChartStyle = "line" | "bar" | "stacked-bar" | "mountain" | "candle" | "pie" | "scatter" | "histogram" | "heatmap" | "custom"; + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A collection of settings to start a new chat conversation + */ +export interface ChatInitSettings { + /** + * Name to apply to the chat created + */ + chatName?: string; + /** + * Contacts to add to the chat + */ + members?: ContactListObject; + /** + * An initial message to post in the chat when created. + */ + message?: MessageObject | string; + /** + * Option settings that affect the creation of the chat + */ + options?: ChatOptions; + type: "fdc3.chat.initSettings"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Contacts to add to the chat + * + * A list of contacts involved in the interaction + * + * A collection of contacts, e.g. for chatting to or calling multiple contacts. + * + * The contact list schema does not explicitly include identifiers in the `id` section, as + * there is not a common standard for such identifiers. Applications can, however, populate + * this part of the contract with custom identifiers if so desired. + */ +export interface ContactListObject { + /** + * An array of contact contexts that forms the list. + */ + contacts: ContactElement[]; + type: "fdc3.contactList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * The contact that initiated the interaction + * + * A person contact that can be engaged with through email, calling, messaging, CMS, etc. + */ +export interface ContactElement { + /** + * Identifiers that relate to the Contact represented by this context + */ + id: PurpleContactIdentifiers; + type: "fdc3.contact"; + name?: string; + [property: string]: any; +} + +/** + * Identifiers that relate to the Contact represented by this context + */ +export interface PurpleContactIdentifiers { + /** + * The email address for the contact + */ + email?: string; + /** + * FactSet Permanent Identifier representing the contact + */ + FDS_ID?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A chat message to be sent through an instant messaging application. Can contain one or + * several text bodies (organized by mime-type, plaintext or markdown), as well as attached + * entities (either arbitrary file attachments or FDC3 actions to be embedded in the + * message). To be put inside a ChatInitSettings object. + */ +export interface MessageObject { + /** + * A map of string IDs to entities that should be attached to the message, such as an action + * to perform, a file attachment, or other FDC3 context object. + */ + entities?: { [key: string]: PurpleAction }; + /** + * A map of string mime-type to string content + */ + text?: PurpleMessageText; + type: "fdc3.message"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * 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. + * + * A File attachment encoded in the form of a data URI + */ +export interface PurpleAction { + /** + * An optional target application identifier that should perform the action + */ + app?: AppIdentifier; + /** + * A context object with which the action will be performed + */ + context?: ContextElement; + /** + * 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. + */ + intent?: string; + /** + * A human readable display name for the action + */ + title?: string; + type: EntityType; + id?: { [key: string]: any }; + name?: string; + data?: PurpleData; + [property: string]: any; +} + +export interface PurpleData { + /** + * A data URI encoding the content of the file to be attached + */ + dataUri: string; + /** + * The name of the attached file + */ + name: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ +export type EntityType = "fdc3.action" | "fdc3.entity.fileAttachment"; + +/** + * A map of string mime-type to string content + */ +export interface PurpleMessageText { + /** + * Markdown encoded content + */ + "text/markdown"?: string; + /** + * Plain text encoded content. + */ + "text/plain"?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Option settings that affect the creation of the chat + */ +export interface ChatOptions { + /** + * if true members will be allowed to add other members to the chat + */ + allowAddUser?: boolean; + /** + * if true members will be allowed to browse past messages + */ + allowHistoryBrowsing?: boolean; + /** + * if true members will be allowed to copy/paste messages + */ + allowMessageCopy?: boolean; + /** + * if false a separate chat will be created for each member + */ + groupRecipients?: boolean; + /** + * if true the room will be visible to everyone in the chat application + */ + isPublic?: boolean; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A context representing a chat message. Typically used to send the message or to + * pre-populate a message for sending. + */ +export interface ChatMessage { + chatRoom: ChatRoomObject; + message: MessageObject; + type: "fdc3.chat.message"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Reference to the chat room which could be used to send a message to the room + */ +export interface ChatRoomObject { + /** + * Identifier(s) for the chat - currently unstandardized + */ + id: { [key: string]: any }; + /** + * Display name for the chat room + */ + name?: string; + /** + * The name of the service that hosts the chat + */ + providerName: string; + type: "fdc3.chat.room"; + /** + * Universal url to access to the room. It could be opened from a browser, a mobile app, + * etc... + */ + url?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Reference to the chat room which could be used to send a message to the room + */ +export interface ChatRoom { + /** + * Identifier(s) for the chat - currently unstandardized + */ + id: { [key: string]: any }; + /** + * Display name for the chat room + */ + name?: string; + /** + * The name of the service that hosts the chat + */ + providerName: string; + type: "fdc3.chat.room"; + /** + * Universal url to access to the room. It could be opened from a browser, a mobile app, + * etc... + */ + url?: string; + [property: string]: any; +} + +/** + * A context type that represents a simple search criterion, based on a list of other + * context objects, that can be used to search or filter messages in a chat application. + */ +export interface ChatSearchCriteria { + /** + * An array of criteria that should match chats returned from by a search. + * + * ⚠️ Operators (and/or/not) are not defined in `fdc3.chat.searchCriteria`. It is up to the + * application that processes the FDC3 Intent to choose and apply the operators between the + * criteria. + * + * Empty search criteria can be supported to allow resetting of filters. + */ + criteria: Array; + type: "fdc3.chat.searchCriteria"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * financial instrument that relates to the definition of this product + * + * + * + * A financial instrument from any asset class. + * + * An entity that can be used when referencing private companies and other organizations + * where a specific instrument is not available or desired e.g. CRM and News workflows. + * + * It is valid to include extra properties and metadata as part of the organization payload, + * but the minimum requirement is for at least one specified identifier to be provided. + * + * The contact that initiated the interaction + * + * A person contact that can be engaged with through email, calling, messaging, CMS, etc. + */ +export interface OrganizationObject { + /** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + * + * Identifiers for the organization, at least one must be provided. + * + * Identifiers that relate to the Contact represented by this context + */ + id: Identifiers; + /** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ + market?: OrganizationMarket; + type: TentacledInteractionType; + name?: string; + [property: string]: any; +} + +/** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + * + * Identifiers for the organization, at least one must be provided. + * + * Identifiers that relate to the Contact represented by this context + */ +export interface Identifiers { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.cusip.com/ + */ + CUSIP?: string; + /** + * https://www.factset.com/ + * + * FactSet Permanent Identifier representing the organization + * + * FactSet Permanent Identifier representing the contact + */ + FDS_ID?: string; + /** + * https://www.openfigi.com/ + */ + FIGI?: string; + /** + * https://www.isin.org/ + */ + ISIN?: string; + /** + * https://permid.org/ + * + * Refinitiv Permanent Identifiers, or PermID for the organization + */ + PERMID?: string; + /** + * https://www.refinitiv.com/ + */ + RIC?: string; + /** + * https://www.lseg.com/sedol + */ + SEDOL?: string; + /** + * Unstandardized stock tickers + */ + ticker?: string; + /** + * The Legal Entity Identifier (LEI) is a 20-character, alpha-numeric code based on the ISO + * 17442 standard developed by the International Organization for Standardization (ISO). It + * connects to key reference information that enables clear and unique identification of + * legal entities participating in financial transactions. + */ + LEI?: string; + /** + * The email address for the contact + */ + email?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ +export type TentacledInteractionType = "fdc3.instrument" | "fdc3.organization" | "fdc3.contact"; + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A person contact that can be engaged with through email, calling, messaging, CMS, etc. + */ +export interface Contact { + /** + * Identifiers that relate to the Contact represented by this context + */ + id: FluffyContactIdentifiers; + type: "fdc3.contact"; + name?: string; + [property: string]: any; +} + +/** + * Identifiers that relate to the Contact represented by this context + */ +export interface FluffyContactIdentifiers { + /** + * The email address for the contact + */ + email?: string; + /** + * FactSet Permanent Identifier representing the contact + */ + FDS_ID?: string; + [property: string]: any; +} + +/** + * A collection of contacts, e.g. for chatting to or calling multiple contacts. + * + * The contact list schema does not explicitly include identifiers in the `id` section, as + * there is not a common standard for such identifiers. Applications can, however, populate + * this part of the contract with custom identifiers if so desired. + */ +export interface ContactList { + /** + * An array of contact contexts that forms the list. + */ + contacts: ContactElement[]; + type: "fdc3.contactList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by + * FDC3 operations. As such, it is not really meant to be used on its own, but is imported + * by more specific type definitions (standardized or custom) to provide the structure and + * properties shared by all FDC3 context data types. + * + * The key element of FDC3 context types is their mandatory `type` property, which is used + * to identify what type of data the object represents, and what shape it has. + * + * The FDC3 context type, and all derived types, define the minimum set of fields a context + * data object of a particular type can be expected to have, but this can always be extended + * with custom fields as appropriate. + */ +export interface Context { + /** + * Context data objects may include a set of equivalent key-value pairs that can be used to + * help applications identify and look up the context type they receive in their own domain. + * The idea behind this design is that applications can provide as many equivalent + * identifiers to a target application as possible, e.g. an instrument may be represented by + * an ISIN, CUSIP or Bloomberg identifier. + * + * Identifiers do not make sense for all types of data, so the `id` property is therefore + * optional, but some derived types may choose to require at least one identifier. + * Identifier values SHOULD always be of type string. + */ + id?: { [key: string]: any }; + /** + * Context data objects may include a name property that can be used for more information, + * or display purposes. Some derived types may require the name object as mandatory, + * depending on use case. + */ + name?: string; + /** + * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 + * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present + * to route shared context data appropriately. + * + * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data + * types they support in an FDC3 [App + * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery + * and routing. + * + * Standardized FDC3 context types have well-known `type` properties prefixed with the + * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and + * used by a particular organization, the convention is to prefix them with an + * organization-specific namespace, e.g. `blackrock.fund`. + * + * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more + * information about context data types. + */ + type: string; + [property: string]: any; +} + +/** + * A country entity. + * + * Notes: + * + * - It is valid to include extra properties and metadata as part of the country payload, + * but the minimum requirement is for at least one standardized identifier to be provided + * + * - `COUNTRY_ISOALPHA2` SHOULD be preferred. + * + * - Try to only use country identifiers as intended and specified in the [ISO + * standard](https://en.wikipedia.org/wiki/ISO_3166-1). E.g. the `COUNTRY_ISOALPHA2` + * property must be a recognized value and not a proprietary two-letter code. If the + * identifier you want to share is not a standardized and recognized one, rather define a + * property that makes it clear what value it is. This makes it easier for target + * applications. + */ +export interface Country { + id: CountryID; + type: "fdc3.country"; + name?: string; + [property: string]: any; +} + +export interface CountryID { + /** + * Two-letter ISO country code + */ + COUNTRY_ISOALPHA2?: string; + /** + * Three-letter ISO country code + */ + COUNTRY_ISOALPHA3?: string; + /** + * Two-letter ISO country code. Deprecated in FDC3 2.0 in favour of the version prefixed + * with `COUNTRY_`. + */ + ISOALPHA2?: string; + /** + * Three-letter ISO country code. Deprecated in FDC3 2.0 in favour of the version prefixed + * with `COUNTRY_`. + */ + ISOALPHA3?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A context representing an individual Currency. + */ +export interface Currency { + id: CurrencyID; + /** + * The name of the currency for display purposes + */ + name?: string; + type: "fdc3.currency"; + [property: string]: any; +} + +export interface CurrencyID { + /** + * The `CURRENCY_ISOCODE` should conform to 3 character alphabetic codes defined in [ISO + * 4217](https://www.iso.org/iso-4217-currency-codes.html) + */ + CURRENCY_ISOCODE?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A collection of information to be used to initiate an email with a Contact or ContactList. + */ +export interface Email { + /** + * One or more recipients for the email. + */ + recipients: EmailRecipients; + /** + * Subject line for the email. + */ + subject?: string; + /** + * Body content for the email. + */ + textBody?: string; + type: "fdc3.email"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * One or more recipients for the email. + * + * The contact that initiated the interaction + * + * A person contact that can be engaged with through email, calling, messaging, CMS, etc. + * + * Contacts to add to the chat + * + * A list of contacts involved in the interaction + * + * A collection of contacts, e.g. for chatting to or calling multiple contacts. + * + * The contact list schema does not explicitly include identifiers in the `id` section, as + * there is not a common standard for such identifiers. Applications can, however, populate + * this part of the contract with custom identifiers if so desired. + */ +export interface EmailRecipients { + /** + * Identifiers that relate to the Contact represented by this context + */ + id?: EmailRecipientsID; + type: EmailRecipientsType; + name?: string; + /** + * An array of contact contexts that forms the list. + */ + contacts?: ContactElement[]; + [property: string]: any; +} + +/** + * Identifiers that relate to the Contact represented by this context + */ +export interface EmailRecipientsID { + /** + * The email address for the contact + */ + email?: string; + /** + * FactSet Permanent Identifier representing the contact + */ + FDS_ID?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ +export type EmailRecipientsType = "fdc3.contact" | "fdc3.contactList"; + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A financial instrument from any asset class. + */ +export interface Instrument { + /** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + */ + id: FluffyInstrumentIdentifiers; + /** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ + market?: PurpleMarket; + type: "fdc3.instrument"; + name?: string; + [property: string]: any; +} + +/** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + */ +export interface FluffyInstrumentIdentifiers { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.cusip.com/ + */ + CUSIP?: string; + /** + * https://www.factset.com/ + */ + FDS_ID?: string; + /** + * https://www.openfigi.com/ + */ + FIGI?: string; + /** + * https://www.isin.org/ + */ + ISIN?: string; + /** + * https://permid.org/ + */ + PERMID?: string; + /** + * https://www.refinitiv.com/ + */ + RIC?: string; + /** + * https://www.lseg.com/sedol + */ + SEDOL?: string; + /** + * Unstandardized stock tickers + */ + ticker?: string; + [property: string]: any; +} + +/** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ +export interface PurpleMarket { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.iso.org/iso-3166-country-codes.html + */ + COUNTRY_ISOALPHA2?: string; + /** + * https://en.wikipedia.org/wiki/Market_Identifier_Code + */ + MIC?: string; + /** + * Human readable market name + */ + name?: string; + [property: string]: any; +} + +/** + * A collection of instruments. Use this type for use cases that require not just a single + * instrument, but multiple (e.g. to populate a watchlist). However, when holding + * information for each instrument is required, it is recommended to use the + * [Portfolio](Portfolio) type. + * + * The instrument list schema does not explicitly include identifiers in the `id` section, + * as there is not a common standard for such identifiers. Applications can, however, + * populate this part of the contract with custom identifiers if so desired. + */ +export interface InstrumentList { + /** + * An array of instrument contexts that forms the list. + */ + instruments: InstrumentElement[]; + type: "fdc3.instrumentList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * An `Interaction` is a significant direct exchange of ideas or information between a + * number of participants, e.g. a Sell Side party and one or more Buy Side parties. An + * `Interaction` might be a call, a meeting (physical or virtual), an IM or the preparation + * of some specialist data, such as financial data for a given company or sector. + */ +export interface Interaction { + /** + * A human-readable description of the interaction + */ + description: string; + /** + * Can be used by a target application to pass an identifier back to the originating + * application after an interaction record has been created, updated or deleted. An + * interaction ID does not need to be populated by the originating application, however the + * target application could store it for future reference and SHOULD return it in a + * `TransactionResult`. + */ + id?: InteractionID; + /** + * The contact that initiated the interaction + */ + initiator?: ContactElement; + /** + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + interactionType: string; + /** + * Used to represent the application or service that the interaction was created from to aid + * in tracing the source of an interaction. + */ + origin?: string; + /** + * A list of contacts involved in the interaction + */ + participants: ContactListObject; + /** + * The time range over which the interaction occurred + */ + timeRange: TimeRangeObject; + type: "fdc3.interaction"; + name?: string; + [property: string]: any; +} + +/** + * Can be used by a target application to pass an identifier back to the originating + * application after an interaction record has been created, updated or deleted. An + * interaction ID does not need to be populated by the originating application, however the + * target application could store it for future reference and SHOULD return it in a + * `TransactionResult`. + */ +export interface InteractionID { + /** + * Interactions ID in Salesforce + */ + SALESFORCE?: string; + /** + * Interaction ID in SingleTrack + */ + SINGLETRACK?: string; + /** + * Can be used by a target application to pass a record's link back to the originating + * application. This offers the originating application a way to open the record for a user + * to view. + */ + URI?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A chat message to be sent through an instant messaging application. Can contain one or + * several text bodies (organized by mime-type, plaintext or markdown), as well as attached + * entities (either arbitrary file attachments or FDC3 actions to be embedded in the + * message). To be put inside a ChatInitSettings object. + */ +export interface Message { + /** + * A map of string IDs to entities that should be attached to the message, such as an action + * to perform, a file attachment, or other FDC3 context object. + */ + entities?: { [key: string]: FluffyAction }; + /** + * A map of string mime-type to string content + */ + text?: FluffyMessageText; + type: "fdc3.message"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * 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. + * + * A File attachment encoded in the form of a data URI + */ +export interface FluffyAction { + /** + * An optional target application identifier that should perform the action + */ + app?: AppIdentifier; + /** + * A context object with which the action will be performed + */ + context?: ContextElement; + /** + * 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. + */ + intent?: string; + /** + * A human readable display name for the action + */ + title?: string; + type: EntityType; + id?: { [key: string]: any }; + name?: string; + data?: FluffyData; + [property: string]: any; +} + +export interface FluffyData { + /** + * A data URI encoding the content of the file to be attached + */ + dataUri: string; + /** + * The name of the attached file + */ + name: string; + [property: string]: any; +} + +/** + * A map of string mime-type to string content + */ +export interface FluffyMessageText { + /** + * Markdown encoded content + */ + "text/markdown"?: string; + /** + * Plain text encoded content. + */ + "text/plain"?: string; + [property: string]: any; +} + +/** + * A type that explicitly represents a lack of context. + * + * Notes: + * + * - Intended to be used in situations where no context is desired. + * - For example: + * - Raising an intent without context (e.g. opening a blank order form, or chat interface + * without a contact selected). + * - Resetting context on a channel (e.g. when context is used to set a filter in other + * applications a null context might release the filter). + * - An explicit representation of a Null or empty context allows apps to declare support + * for a lack of context, for example in their intent metadata in an app directory. + */ +export interface Nothing { + type: "fdc3.nothing"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * @experimental context type representing an order. To be used with OMS and EMS systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the order in one or more systems, an optional human readable `name` field to be used + * to summarize the order and an optional `details` field that may be used to provide + * additional detail about the order, including a context representing a `product`, which + * may be extended with arbitrary properties. The `details.product` field is currently typed + * as a unspecified Context type, but both `details` and `details.product` are expected to + * be standardized in future. + */ +export interface Order { + /** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ + details?: PurpleOrderDetails; + /** + * One or more identifiers that refer to the order in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * An optional human-readable summary of the order. + */ + name?: string; + type: "fdc3.order"; + [property: string]: any; +} + +/** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ +export interface PurpleOrderDetails { + product?: ProductObject; + [property: string]: any; +} + +/** + * A product that is the subject of the trade. + * + * @experimental context type representing a tradable product. To be used with OMS and EMS + * systems. + * + * This type is currently only loosely defined as an extensible context object, with an + * optional instrument field. + * + * The Product schema does not explicitly include identifiers in the id section, as there is + * not a common standard for such identifiers. Applications can, however, populate this part + * of the contract with custom identifiers if so desired. + */ +export interface ProductObject { + /** + * One or more identifiers that refer to the product. Specific key names for systems are + * expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * financial instrument that relates to the definition of this product + */ + instrument?: InstrumentElement; + /** + * A human-readable summary of the product. + */ + name?: string; + type: "fdc3.product"; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * @experimental A list of orders. Use this type for use cases that require not just a + * single order, but multiple. + * + * The OrderList schema does not explicitly include identifiers in the id section, as there + * is not a common standard for such identifiers. Applications can, however, populate this + * part of the contract with custom identifiers if so desired. + */ +export interface OrderList { + /** + * An array of order contexts that forms the list. + */ + orders: OrderElement[]; + type: "fdc3.orderList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing an order. To be used with OMS and EMS systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the order in one or more systems, an optional human readable `name` field to be used + * to summarize the order and an optional `details` field that may be used to provide + * additional detail about the order, including a context representing a `product`, which + * may be extended with arbitrary properties. The `details.product` field is currently typed + * as a unspecified Context type, but both `details` and `details.product` are expected to + * be standardized in future. + */ +export interface OrderElement { + /** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ + details?: FluffyOrderDetails; + /** + * One or more identifiers that refer to the order in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * An optional human-readable summary of the order. + */ + name?: string; + type: "fdc3.order"; + [property: string]: any; +} + +/** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ +export interface FluffyOrderDetails { + product?: ProductObject; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * An entity that can be used when referencing private companies and other organizations + * where a specific instrument is not available or desired e.g. CRM and News workflows. + * + * It is valid to include extra properties and metadata as part of the organization payload, + * but the minimum requirement is for at least one specified identifier to be provided. + */ +export interface Organization { + /** + * Identifiers for the organization, at least one must be provided. + */ + id: OrganizationIdentifiers; + type: "fdc3.organization"; + name?: string; + [property: string]: any; +} + +/** + * Identifiers for the organization, at least one must be provided. + */ +export interface OrganizationIdentifiers { + /** + * FactSet Permanent Identifier representing the organization + */ + FDS_ID?: string; + /** + * The Legal Entity Identifier (LEI) is a 20-character, alpha-numeric code based on the ISO + * 17442 standard developed by the International Organization for Standardization (ISO). It + * connects to key reference information that enables clear and unique identification of + * legal entities participating in financial transactions. + */ + LEI?: string; + /** + * Refinitiv Permanent Identifiers, or PermID for the organization + */ + PERMID?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A financial portfolio made up of multiple positions (holdings) in several instruments. + * Contrast this with e.g. the [InstrumentList](InstrumentList) type, which is just a list + * of instruments. + * + * This is a good example of how types can be composed and extended with extra properties to + * define more complex types. + * + * The Portfolio type consists of an array of [Position](Position) types, each of which + * refers to a single [Instrument](Instrument) and a holding amount for that instrument. + * + * The portfolio schema does not explicitly include identifiers in the `id` section, as + * there bis not a common standard for such identifiers. Applications can, however, populate + * this part of the contract with custom identifiers if so desired. + */ +export interface Portfolio { + /** + * The List of Positions which make up the Portfolio + */ + positions: PositionElement[]; + type: "fdc3.portfolio"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * A financial position made up of an instrument and a holding in that instrument. This type + * is a good example of how new context types can be composed from existing types. + * + * In this case, the instrument and the holding amount for that instrument are required + * values. + * + * The [Position](Position) type goes hand-in-hand with the [Portfolio](Portfolio) type, + * which represents multiple holdings in a combination of instruments. + * + * The position schema does not explicitly include identifiers in the `id` section, as there + * is not a common standard for such identifiers. Applications can, however, populate this + * part of the contract with custom identifiers if so desired. + */ +export interface PositionElement { + /** + * The amount of the holding, e.g. a number of shares + */ + holding: number; + instrument: InstrumentElement; + type: "fdc3.position"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A financial position made up of an instrument and a holding in that instrument. This type + * is a good example of how new context types can be composed from existing types. + * + * In this case, the instrument and the holding amount for that instrument are required + * values. + * + * The [Position](Position) type goes hand-in-hand with the [Portfolio](Portfolio) type, + * which represents multiple holdings in a combination of instruments. + * + * The position schema does not explicitly include identifiers in the `id` section, as there + * is not a common standard for such identifiers. Applications can, however, populate this + * part of the contract with custom identifiers if so desired. + */ +export interface Position { + /** + * The amount of the holding, e.g. a number of shares + */ + holding: number; + instrument: InstrumentElement; + type: "fdc3.position"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing a tradable product. To be used with OMS and EMS + * systems. + * + * This type is currently only loosely defined as an extensible context object, with an + * optional instrument field. + * + * The Product schema does not explicitly include identifiers in the id section, as there is + * not a common standard for such identifiers. Applications can, however, populate this part + * of the contract with custom identifiers if so desired. + */ +export interface Product { + /** + * One or more identifiers that refer to the product. Specific key names for systems are + * expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * financial instrument that relates to the definition of this product + */ + instrument?: InstrumentElement; + /** + * A human-readable summary of the product. + */ + name?: string; + type: "fdc3.product"; + [property: string]: any; +} + +/** + * A context representing a period of time. Any user interfaces that represent or visualize + * events or activity over time can be filtered or focused on a particular time period, + * e.g.: + * + * - A pricing chart + * - A trade blotter + * - A record of client contact/activity in a CRM + * + * Example use cases: + * + * - User may want to view pricing/trades/customer activity for a security over a particular + * time period, the time range might be specified as the context for the `ViewChart` intent + * OR it might be embedded in another context (e.g. a context representing a chart to plot). + * - User filters a visualization (e.g. a pricing chart) to show a particular period, the + * `TimeRange` is broadcast and other visualizations (e.g. a heatmap of activity by + * instrument, or industry sector etc.) receive it and filter themselves to show data over + * the same range. + * + * Notes: + * + * - A `TimeRange` may be closed (i.e. `startTime` and `endTime` are both known) or open + * (i.e. only one of `startTime` or `endTime` is known). + * - Ranges corresponding to dates (e.g. `2022-05-12` to `2022-05-19`) should be specified + * using times as this prevents issues with timezone conversions and inclusive/exclusive + * date ranges. + * - String fields representing times are encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html). + * - A timezone indicator should be specified, e.g. `"2022-05-12T15:18:03Z"` or + * `"2022-05-12T16:18:03+01:00"` + * - Times MAY be specified with millisecond precision, e.g. `"2022-05-12T15:18:03.349Z"` + */ +export interface TimeRange { + /** + * The end time of the range, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. + */ + endTime?: Date; + /** + * The start time of the range, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. + */ + startTime?: Date; + type: "fdc3.timeRange"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing a trade. To be used with execution systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the trade in one or more systems, an optional human readable `name` field to be used + * to summarize the trade and a required `product` field that may be used to provide + * additional detail about the trade, which is currently typed as a unspecified Context + * type, but `product` is expected to be standardized in future. + * + * The Trade schema does not explicitly include identifiers in the id section, as there is + * not a common standard for such identifiers. Applications can, however, populate this part + * of the contract with custom identifiers if so desired. + */ +export interface Trade { + /** + * One or more identifiers that refer to the trade in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * A human-readable summary of the trade. + */ + name?: string; + /** + * A product that is the subject of the trade. + */ + product: ProductObject; + type: "fdc3.trade"; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * @experimental A list of trades. Use this type for use cases that require not just a + * single trade, but multiple. + * + * The TradeList schema does not explicitly include identifiers in the id section, as there + * is not a common standard for such identifiers. Applications can, however, populate this + * part of the contract with custom identifiers if so desired. + */ +export interface TradeList { + /** + * An array of trade contexts that forms the list. + */ + trades: TradeElement[]; + type: "fdc3.tradeList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing a trade. To be used with execution systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the trade in one or more systems, an optional human readable `name` field to be used + * to summarize the trade and a required `product` field that may be used to provide + * additional detail about the trade, which is currently typed as a unspecified Context + * type, but `product` is expected to be standardized in future. + * + * The Trade schema does not explicitly include identifiers in the id section, as there is + * not a common standard for such identifiers. Applications can, however, populate this part + * of the contract with custom identifiers if so desired. + */ +export interface TradeElement { + /** + * One or more identifiers that refer to the trade in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * A human-readable summary of the trade. + */ + name?: string; + /** + * A product that is the subject of the trade. + */ + product: ProductObject; + type: "fdc3.trade"; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A context type representing the result of a transaction initiated via FDC3, which SHOULD + * be returned as an `IntentResult` by intents that create, retrieve, update or delete + * content or records in another application. Its purpose is to provide a status and message + * (where needed) for the transaction and MAY wrap a returned context object. + */ +export interface TransactionResult { + /** + * A context object returned by the transaction, possibly with updated data. + */ + context?: ContextElement; + /** + * A human readable message describing the outcome of the transaction. + */ + message?: string; + /** + * The status of the transaction being reported. + */ + status: TransactionStatus; + type: "fdc3.transactionResult"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * The status of the transaction being reported. + */ +export type TransactionStatus = "Created" | "Deleted" | "Updated" | "Failed"; + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A context type representing the price and value of a holding. + */ +export interface Valuation { + /** + * The valuation currency, which should conform to 3 character alphabetic codes defined in + * [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) + */ + CURRENCY_ISOCODE: string; + /** + * The time at which this valuation expires, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator included. + */ + expiryTime?: Date; + /** + * The price per unit the the valuation is based on. + */ + price?: number; + type: "fdc3.valuation"; + /** + * The time at which the valuation was performed, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator included. + */ + valuationTime?: Date; + /** + * The value of the holding, expresses in the nominated currency. + */ + value: number; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +// Converts JSON strings to/from your types +// and asserts the results of JSON.parse at runtime +export class Convert { + public static toAction(json: string): Action { + return cast(JSON.parse(json), r("Action")); + } + + public static actionToJson(value: Action): string { + return JSON.stringify(uncast(value, r("Action")), null, 2); + } + + public static toChart(json: string): Chart { + return cast(JSON.parse(json), r("Chart")); + } + + public static chartToJson(value: Chart): string { + return JSON.stringify(uncast(value, r("Chart")), null, 2); + } + + public static toChatInitSettings(json: string): ChatInitSettings { + return cast(JSON.parse(json), r("ChatInitSettings")); + } + + public static chatInitSettingsToJson(value: ChatInitSettings): string { + return JSON.stringify(uncast(value, r("ChatInitSettings")), null, 2); + } + + public static toChatMessage(json: string): ChatMessage { + return cast(JSON.parse(json), r("ChatMessage")); + } + + public static chatMessageToJson(value: ChatMessage): string { + return JSON.stringify(uncast(value, r("ChatMessage")), null, 2); + } + + public static toChatRoom(json: string): ChatRoom { + return cast(JSON.parse(json), r("ChatRoom")); + } + + public static chatRoomToJson(value: ChatRoom): string { + return JSON.stringify(uncast(value, r("ChatRoom")), null, 2); + } + + public static toChatSearchCriteria(json: string): ChatSearchCriteria { + return cast(JSON.parse(json), r("ChatSearchCriteria")); + } + + public static chatSearchCriteriaToJson(value: ChatSearchCriteria): string { + return JSON.stringify(uncast(value, r("ChatSearchCriteria")), null, 2); + } + + public static toContact(json: string): Contact { + return cast(JSON.parse(json), r("Contact")); + } + + public static contactToJson(value: Contact): string { + return JSON.stringify(uncast(value, r("Contact")), null, 2); + } + + public static toContactList(json: string): ContactList { + return cast(JSON.parse(json), r("ContactList")); + } + + public static contactListToJson(value: ContactList): string { + return JSON.stringify(uncast(value, r("ContactList")), null, 2); + } + + public static toContext(json: string): Context { + return cast(JSON.parse(json), r("Context")); + } + + public static contextToJson(value: Context): string { + return JSON.stringify(uncast(value, r("Context")), null, 2); + } + + public static toCountry(json: string): Country { + return cast(JSON.parse(json), r("Country")); + } + + public static countryToJson(value: Country): string { + return JSON.stringify(uncast(value, r("Country")), null, 2); + } + + public static toCurrency(json: string): Currency { + return cast(JSON.parse(json), r("Currency")); + } + + public static currencyToJson(value: Currency): string { + return JSON.stringify(uncast(value, r("Currency")), null, 2); + } + + public static toEmail(json: string): Email { + return cast(JSON.parse(json), r("Email")); + } + + public static emailToJson(value: Email): string { + return JSON.stringify(uncast(value, r("Email")), null, 2); + } + + public static toInstrument(json: string): Instrument { + return cast(JSON.parse(json), r("Instrument")); + } + + public static instrumentToJson(value: Instrument): string { + return JSON.stringify(uncast(value, r("Instrument")), null, 2); + } + + public static toInstrumentList(json: string): InstrumentList { + return cast(JSON.parse(json), r("InstrumentList")); + } + + public static instrumentListToJson(value: InstrumentList): string { + return JSON.stringify(uncast(value, r("InstrumentList")), null, 2); + } + + public static toInteraction(json: string): Interaction { + return cast(JSON.parse(json), r("Interaction")); + } + + public static interactionToJson(value: Interaction): string { + return JSON.stringify(uncast(value, r("Interaction")), null, 2); + } + + public static toMessage(json: string): Message { + return cast(JSON.parse(json), r("Message")); + } + + public static messageToJson(value: Message): string { + return JSON.stringify(uncast(value, r("Message")), null, 2); + } + + public static toNothing(json: string): Nothing { + return cast(JSON.parse(json), r("Nothing")); + } + + public static nothingToJson(value: Nothing): string { + return JSON.stringify(uncast(value, r("Nothing")), null, 2); + } + + public static toOrder(json: string): Order { + return cast(JSON.parse(json), r("Order")); + } + + public static orderToJson(value: Order): string { + return JSON.stringify(uncast(value, r("Order")), null, 2); + } + + public static toOrderList(json: string): OrderList { + return cast(JSON.parse(json), r("OrderList")); + } + + public static orderListToJson(value: OrderList): string { + return JSON.stringify(uncast(value, r("OrderList")), null, 2); + } + + public static toOrganization(json: string): Organization { + return cast(JSON.parse(json), r("Organization")); + } + + public static organizationToJson(value: Organization): string { + return JSON.stringify(uncast(value, r("Organization")), null, 2); + } + + public static toPortfolio(json: string): Portfolio { + return cast(JSON.parse(json), r("Portfolio")); + } + + public static portfolioToJson(value: Portfolio): string { + return JSON.stringify(uncast(value, r("Portfolio")), null, 2); + } + + public static toPosition(json: string): Position { + return cast(JSON.parse(json), r("Position")); + } + + public static positionToJson(value: Position): string { + return JSON.stringify(uncast(value, r("Position")), null, 2); + } + + public static toProduct(json: string): Product { + return cast(JSON.parse(json), r("Product")); + } + + public static productToJson(value: Product): string { + return JSON.stringify(uncast(value, r("Product")), null, 2); + } + + public static toTimeRange(json: string): TimeRange { + return cast(JSON.parse(json), r("TimeRange")); + } + + public static timeRangeToJson(value: TimeRange): string { + return JSON.stringify(uncast(value, r("TimeRange")), null, 2); + } + + public static toTrade(json: string): Trade { + return cast(JSON.parse(json), r("Trade")); + } + + public static tradeToJson(value: Trade): string { + return JSON.stringify(uncast(value, r("Trade")), null, 2); + } + + public static toTradeList(json: string): TradeList { + return cast(JSON.parse(json), r("TradeList")); + } + + public static tradeListToJson(value: TradeList): string { + return JSON.stringify(uncast(value, r("TradeList")), null, 2); + } + + public static toTransactionResult(json: string): TransactionResult { + return cast(JSON.parse(json), r("TransactionResult")); + } + + public static transactionResultToJson(value: TransactionResult): string { + return JSON.stringify(uncast(value, r("TransactionResult")), null, 2); + } + + public static toValuation(json: string): Valuation { + return cast(JSON.parse(json), r("Valuation")); + } + + public static valuationToJson(value: Valuation): string { + return JSON.stringify(uncast(value, r("Valuation")), null, 2); + } +} + +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { + const prettyTyp = prettyTypeName(typ); + const parentText = parent ? ` on ${parent}` : ''; + const keyText = key ? ` for key "${key}"` : ''; + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); +} + +function prettyTypeName(typ: any): string { + if (Array.isArray(typ)) { + if (typ.length === 2 && typ[0] === undefined) { + return `an optional ${prettyTypeName(typ[1])}`; + } else { + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; + } + } else if (typeof typ === "object" && typ.literal !== undefined) { + return typ.literal; + } else { + return typeof typ; + } +} + +function jsonToJSProps(typ: any): any { + if (typ.jsonToJS === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); + typ.jsonToJS = map; + } + return typ.jsonToJS; +} + +function jsToJSONProps(typ: any): any { + if (typ.jsToJSON === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); + typ.jsToJSON = map; + } + return typ.jsToJSON; +} + +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { + function transformPrimitive(typ: string, val: any): any { + if (typeof typ === typeof val) return val; + return invalidValue(typ, val, key, parent); + } + + function transformUnion(typs: any[], val: any): any { + // val must validate against one typ in typs + const l = typs.length; + for (let i = 0; i < l; i++) { + const typ = typs[i]; + try { + return transform(val, typ, getProps); + } catch (_) {} + } + return invalidValue(typs, val, key, parent); + } + + function transformEnum(cases: string[], val: any): any { + if (cases.indexOf(val) !== -1) return val; + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); + } + + function transformArray(typ: any, val: any): any { + // val must be an array with no invalid elements + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); + return val.map(el => transform(el, typ, getProps)); + } + + function transformDate(val: any): any { + if (val === null) { + return null; + } + const d = new Date(val); + if (isNaN(d.valueOf())) { + return invalidValue(l("Date"), val, key, parent); + } + return d; + } + + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { + if (val === null || typeof val !== "object" || Array.isArray(val)) { + return invalidValue(l(ref || "object"), val, key, parent); + } + const result: any = {}; + Object.getOwnPropertyNames(props).forEach(key => { + const prop = props[key]; + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; + result[prop.key] = transform(v, prop.typ, getProps, key, ref); + }); + Object.getOwnPropertyNames(val).forEach(key => { + if (!Object.prototype.hasOwnProperty.call(props, key)) { + result[key] = transform(val[key], additional, getProps, key, ref); + } + }); + return result; + } + + if (typ === "any") return val; + if (typ === null) { + if (val === null) return val; + return invalidValue(typ, val, key, parent); + } + if (typ === false) return invalidValue(typ, val, key, parent); + let ref: any = undefined; + while (typeof typ === "object" && typ.ref !== undefined) { + ref = typ.ref; + typ = typeMap[typ.ref]; + } + if (Array.isArray(typ)) return transformEnum(typ, val); + if (typeof typ === "object") { + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) + : invalidValue(typ, val, key, parent); + } + // Numbers can be parsed by Date but shouldn't be. + if (typ === Date && typeof val !== "number") return transformDate(val); + return transformPrimitive(typ, val); +} + +function cast(val: any, typ: any): T { + return transform(val, typ, jsonToJSProps); +} + +function uncast(val: T, typ: any): any { + return transform(val, typ, jsToJSONProps); +} + +function l(typ: any) { + return { literal: typ }; +} + +function a(typ: any) { + return { arrayItems: typ }; +} + +function u(...typs: any[]) { + return { unionMembers: typs }; +} + +function o(props: any[], additional: any) { + return { props, additional }; +} + +function m(additional: any) { + return { props: [], additional }; +} + +function r(name: string) { + return { ref: name }; +} + +const typeMap: any = { + "Action": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: r("ContextElement") }, + { json: "intent", js: "intent", typ: u(undefined, "") }, + { json: "title", js: "title", typ: "" }, + { json: "type", js: "type", typ: r("ActionType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "AppIdentifier": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "ContextElement": o([ + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: "" }, + ], "any"), + "Chart": o([ + { json: "instruments", js: "instruments", typ: a(r("InstrumentElement")) }, + { json: "otherConfig", js: "otherConfig", typ: u(undefined, a(r("ContextElement"))) }, + { json: "range", js: "range", typ: u(undefined, r("TimeRangeObject")) }, + { json: "style", js: "style", typ: u(undefined, r("ChartStyle")) }, + { json: "type", js: "type", typ: r("ChartType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "InstrumentElement": o([ + { json: "id", js: "id", typ: r("PurpleInstrumentIdentifiers") }, + { json: "market", js: "market", typ: u(undefined, r("OrganizationMarket")) }, + { json: "type", js: "type", typ: r("PurpleInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "PurpleInstrumentIdentifiers": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, + { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, + { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, + { json: "RIC", js: "RIC", typ: u(undefined, "") }, + { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, + { json: "ticker", js: "ticker", typ: u(undefined, "") }, + ], "any"), + "OrganizationMarket": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, + { json: "MIC", js: "MIC", typ: u(undefined, "") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "TimeRangeObject": o([ + { json: "endTime", js: "endTime", typ: u(undefined, Date) }, + { json: "startTime", js: "startTime", typ: u(undefined, Date) }, + { json: "type", js: "type", typ: r("TimeRangeType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ChatInitSettings": o([ + { json: "chatName", js: "chatName", typ: u(undefined, "") }, + { json: "members", js: "members", typ: u(undefined, r("ContactListObject")) }, + { json: "message", js: "message", typ: u(undefined, u(r("MessageObject"), "")) }, + { json: "options", js: "options", typ: u(undefined, r("ChatOptions")) }, + { json: "type", js: "type", typ: r("ChatInitSettingsType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ContactListObject": o([ + { json: "contacts", js: "contacts", typ: a(r("ContactElement")) }, + { json: "type", js: "type", typ: r("ContactListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ContactElement": o([ + { json: "id", js: "id", typ: r("PurpleContactIdentifiers") }, + { json: "type", js: "type", typ: r("FluffyInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "PurpleContactIdentifiers": o([ + { json: "email", js: "email", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + ], "any"), + "MessageObject": o([ + { json: "entities", js: "entities", typ: u(undefined, m(r("PurpleAction"))) }, + { json: "text", js: "text", typ: u(undefined, r("PurpleMessageText")) }, + { json: "type", js: "type", typ: r("MessageType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "PurpleAction": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, + { json: "intent", js: "intent", typ: u(undefined, "") }, + { json: "title", js: "title", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("EntityType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "data", js: "data", typ: u(undefined, r("PurpleData")) }, + ], "any"), + "PurpleData": o([ + { json: "dataUri", js: "dataUri", typ: "" }, + { json: "name", js: "name", typ: "" }, + ], "any"), + "PurpleMessageText": o([ + { json: "text/markdown", js: "text/markdown", typ: u(undefined, "") }, + { json: "text/plain", js: "text/plain", typ: u(undefined, "") }, + ], "any"), + "ChatOptions": o([ + { json: "allowAddUser", js: "allowAddUser", typ: u(undefined, true) }, + { json: "allowHistoryBrowsing", js: "allowHistoryBrowsing", typ: u(undefined, true) }, + { json: "allowMessageCopy", js: "allowMessageCopy", typ: u(undefined, true) }, + { json: "groupRecipients", js: "groupRecipients", typ: u(undefined, true) }, + { json: "isPublic", js: "isPublic", typ: u(undefined, true) }, + ], "any"), + "ChatMessage": o([ + { json: "chatRoom", js: "chatRoom", typ: r("ChatRoomObject") }, + { json: "message", js: "message", typ: r("MessageObject") }, + { json: "type", js: "type", typ: r("ChatMessageType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ChatRoomObject": o([ + { json: "id", js: "id", typ: m("any") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "providerName", js: "providerName", typ: "" }, + { json: "type", js: "type", typ: r("ChatRoomType") }, + { json: "url", js: "url", typ: u(undefined, "") }, + ], "any"), + "ChatRoom": o([ + { json: "id", js: "id", typ: m("any") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "providerName", js: "providerName", typ: "" }, + { json: "type", js: "type", typ: r("ChatRoomType") }, + { json: "url", js: "url", typ: u(undefined, "") }, + ], "any"), + "ChatSearchCriteria": o([ + { json: "criteria", js: "criteria", typ: a(u(r("OrganizationObject"), "")) }, + { json: "type", js: "type", typ: r("ChatSearchCriteriaType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "OrganizationObject": o([ + { json: "id", js: "id", typ: r("Identifiers") }, + { json: "market", js: "market", typ: u(undefined, r("OrganizationMarket")) }, + { json: "type", js: "type", typ: r("TentacledInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Identifiers": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, + { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, + { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, + { json: "RIC", js: "RIC", typ: u(undefined, "") }, + { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, + { json: "ticker", js: "ticker", typ: u(undefined, "") }, + { json: "LEI", js: "LEI", typ: u(undefined, "") }, + { json: "email", js: "email", typ: u(undefined, "") }, + ], "any"), + "Contact": o([ + { json: "id", js: "id", typ: r("FluffyContactIdentifiers") }, + { json: "type", js: "type", typ: r("FluffyInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "FluffyContactIdentifiers": o([ + { json: "email", js: "email", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + ], "any"), + "ContactList": o([ + { json: "contacts", js: "contacts", typ: a(r("ContactElement")) }, + { json: "type", js: "type", typ: r("ContactListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Context": o([ + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: "" }, + ], "any"), + "Country": o([ + { json: "id", js: "id", typ: r("CountryID") }, + { json: "type", js: "type", typ: r("CountryType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "CountryID": o([ + { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, + { json: "COUNTRY_ISOALPHA3", js: "COUNTRY_ISOALPHA3", typ: u(undefined, "") }, + { json: "ISOALPHA2", js: "ISOALPHA2", typ: u(undefined, "") }, + { json: "ISOALPHA3", js: "ISOALPHA3", typ: u(undefined, "") }, + ], "any"), + "Currency": o([ + { json: "id", js: "id", typ: r("CurrencyID") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("CurrencyType") }, + ], "any"), + "CurrencyID": o([ + { json: "CURRENCY_ISOCODE", js: "CURRENCY_ISOCODE", typ: u(undefined, "") }, + ], "any"), + "Email": o([ + { json: "recipients", js: "recipients", typ: r("EmailRecipients") }, + { json: "subject", js: "subject", typ: u(undefined, "") }, + { json: "textBody", js: "textBody", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("EmailType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "EmailRecipients": o([ + { json: "id", js: "id", typ: u(undefined, r("EmailRecipientsID")) }, + { json: "type", js: "type", typ: r("EmailRecipientsType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "contacts", js: "contacts", typ: u(undefined, a(r("ContactElement"))) }, + ], "any"), + "EmailRecipientsID": o([ + { json: "email", js: "email", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + ], "any"), + "Instrument": o([ + { json: "id", js: "id", typ: r("FluffyInstrumentIdentifiers") }, + { json: "market", js: "market", typ: u(undefined, r("PurpleMarket")) }, + { json: "type", js: "type", typ: r("PurpleInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "FluffyInstrumentIdentifiers": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, + { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, + { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, + { json: "RIC", js: "RIC", typ: u(undefined, "") }, + { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, + { json: "ticker", js: "ticker", typ: u(undefined, "") }, + ], "any"), + "PurpleMarket": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, + { json: "MIC", js: "MIC", typ: u(undefined, "") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "InstrumentList": o([ + { json: "instruments", js: "instruments", typ: a(r("InstrumentElement")) }, + { json: "type", js: "type", typ: r("InstrumentListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Interaction": o([ + { json: "description", js: "description", typ: "" }, + { json: "id", js: "id", typ: u(undefined, r("InteractionID")) }, + { json: "initiator", js: "initiator", typ: u(undefined, r("ContactElement")) }, + { json: "interactionType", js: "interactionType", typ: "" }, + { json: "origin", js: "origin", typ: u(undefined, "") }, + { json: "participants", js: "participants", typ: r("ContactListObject") }, + { json: "timeRange", js: "timeRange", typ: r("TimeRangeObject") }, + { json: "type", js: "type", typ: r("InteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "InteractionID": o([ + { json: "SALESFORCE", js: "SALESFORCE", typ: u(undefined, "") }, + { json: "SINGLETRACK", js: "SINGLETRACK", typ: u(undefined, "") }, + { json: "URI", js: "URI", typ: u(undefined, "") }, + ], "any"), + "Message": o([ + { json: "entities", js: "entities", typ: u(undefined, m(r("FluffyAction"))) }, + { json: "text", js: "text", typ: u(undefined, r("FluffyMessageText")) }, + { json: "type", js: "type", typ: r("MessageType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "FluffyAction": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, + { json: "intent", js: "intent", typ: u(undefined, "") }, + { json: "title", js: "title", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("EntityType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "data", js: "data", typ: u(undefined, r("FluffyData")) }, + ], "any"), + "FluffyData": o([ + { json: "dataUri", js: "dataUri", typ: "" }, + { json: "name", js: "name", typ: "" }, + ], "any"), + "FluffyMessageText": o([ + { json: "text/markdown", js: "text/markdown", typ: u(undefined, "") }, + { json: "text/plain", js: "text/plain", typ: u(undefined, "") }, + ], "any"), + "Nothing": o([ + { json: "type", js: "type", typ: r("NothingType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Order": o([ + { json: "details", js: "details", typ: u(undefined, r("PurpleOrderDetails")) }, + { json: "id", js: "id", typ: m("") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("OrderType") }, + ], "any"), + "PurpleOrderDetails": o([ + { json: "product", js: "product", typ: u(undefined, r("ProductObject")) }, + ], "any"), + "ProductObject": o([ + { json: "id", js: "id", typ: m("") }, + { json: "instrument", js: "instrument", typ: u(undefined, r("InstrumentElement")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("ProductType") }, + ], "any"), + "OrderList": o([ + { json: "orders", js: "orders", typ: a(r("OrderElement")) }, + { json: "type", js: "type", typ: r("OrderListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "OrderElement": o([ + { json: "details", js: "details", typ: u(undefined, r("FluffyOrderDetails")) }, + { json: "id", js: "id", typ: m("") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("OrderType") }, + ], "any"), + "FluffyOrderDetails": o([ + { json: "product", js: "product", typ: u(undefined, r("ProductObject")) }, + ], "any"), + "Organization": o([ + { json: "id", js: "id", typ: r("OrganizationIdentifiers") }, + { json: "type", js: "type", typ: r("StickyInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "OrganizationIdentifiers": o([ + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + { json: "LEI", js: "LEI", typ: u(undefined, "") }, + { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, + ], "any"), + "Portfolio": o([ + { json: "positions", js: "positions", typ: a(r("PositionElement")) }, + { json: "type", js: "type", typ: r("PortfolioType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "PositionElement": o([ + { json: "holding", js: "holding", typ: 3.14 }, + { json: "instrument", js: "instrument", typ: r("InstrumentElement") }, + { json: "type", js: "type", typ: r("PositionType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Position": o([ + { json: "holding", js: "holding", typ: 3.14 }, + { json: "instrument", js: "instrument", typ: r("InstrumentElement") }, + { json: "type", js: "type", typ: r("PositionType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Product": o([ + { json: "id", js: "id", typ: m("") }, + { json: "instrument", js: "instrument", typ: u(undefined, r("InstrumentElement")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("ProductType") }, + ], "any"), + "TimeRange": o([ + { json: "endTime", js: "endTime", typ: u(undefined, Date) }, + { json: "startTime", js: "startTime", typ: u(undefined, Date) }, + { json: "type", js: "type", typ: r("TimeRangeType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Trade": o([ + { json: "id", js: "id", typ: m("") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "product", js: "product", typ: r("ProductObject") }, + { json: "type", js: "type", typ: r("TradeType") }, + ], "any"), + "TradeList": o([ + { json: "trades", js: "trades", typ: a(r("TradeElement")) }, + { json: "type", js: "type", typ: r("TradeListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "TradeElement": o([ + { json: "id", js: "id", typ: m("") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "product", js: "product", typ: r("ProductObject") }, + { json: "type", js: "type", typ: r("TradeType") }, + ], "any"), + "TransactionResult": o([ + { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, + { json: "message", js: "message", typ: u(undefined, "") }, + { json: "status", js: "status", typ: r("TransactionStatus") }, + { json: "type", js: "type", typ: r("TransactionResultType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Valuation": o([ + { json: "CURRENCY_ISOCODE", js: "CURRENCY_ISOCODE", typ: "" }, + { json: "expiryTime", js: "expiryTime", typ: u(undefined, Date) }, + { json: "price", js: "price", typ: u(undefined, 3.14) }, + { json: "type", js: "type", typ: r("ValuationType") }, + { json: "valuationTime", js: "valuationTime", typ: u(undefined, Date) }, + { json: "value", js: "value", typ: 3.14 }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ActionType": [ + "fdc3.action", + ], + "PurpleInteractionType": [ + "fdc3.instrument", + ], + "TimeRangeType": [ + "fdc3.timeRange", + ], + "ChartStyle": [ + "bar", + "candle", + "custom", + "heatmap", + "histogram", + "line", + "mountain", + "pie", + "scatter", + "stacked-bar", + ], + "ChartType": [ + "fdc3.chart", + ], + "FluffyInteractionType": [ + "fdc3.contact", + ], + "ContactListType": [ + "fdc3.contactList", + ], + "EntityType": [ + "fdc3.action", + "fdc3.entity.fileAttachment", + ], + "MessageType": [ + "fdc3.message", + ], + "ChatInitSettingsType": [ + "fdc3.chat.initSettings", + ], + "ChatRoomType": [ + "fdc3.chat.room", + ], + "ChatMessageType": [ + "fdc3.chat.message", + ], + "TentacledInteractionType": [ + "fdc3.contact", + "fdc3.instrument", + "fdc3.organization", + ], + "ChatSearchCriteriaType": [ + "fdc3.chat.searchCriteria", + ], + "CountryType": [ + "fdc3.country", + ], + "CurrencyType": [ + "fdc3.currency", + ], + "EmailRecipientsType": [ + "fdc3.contact", + "fdc3.contactList", + ], + "EmailType": [ + "fdc3.email", + ], + "InstrumentListType": [ + "fdc3.instrumentList", + ], + "InteractionType": [ + "fdc3.interaction", + ], + "NothingType": [ + "fdc3.nothing", + ], + "ProductType": [ + "fdc3.product", + ], + "OrderType": [ + "fdc3.order", + ], + "OrderListType": [ + "fdc3.orderList", + ], + "StickyInteractionType": [ + "fdc3.organization", + ], + "PositionType": [ + "fdc3.position", + ], + "PortfolioType": [ + "fdc3.portfolio", + ], + "TradeType": [ + "fdc3.trade", + ], + "TradeListType": [ + "fdc3.tradeList", + ], + "TransactionStatus": [ + "Created", + "Deleted", + "Failed", + "Updated", + ], + "TransactionResultType": [ + "fdc3.transactionResult", + ], + "ValuationType": [ + "fdc3.valuation", + ], +}; diff --git a/packages/fdc3-context/package.json b/packages/fdc3-context/package.json new file mode 100644 index 000000000..fc7e27f50 --- /dev/null +++ b/packages/fdc3-context/package.json @@ -0,0 +1,42 @@ +{ + "name": "@kite9/fdc3-context", + "version": "2.2.0-beta.6", + "author": "Fintech Open Source Foundation (FINOS)", + "homepage": "https://fdc3.finos.org", + "repository": { + "type": "git", + "url": "git+https://github.com/finos/FDC3.git" + }, + "publishConfig": { + "tag": "latest" + }, + "license": "Apache-2.0", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "clean": "rimraf dist && rimraf generated", + "mkdirs": "mkdirp generated/context && mkdirp generated/api && mkdirp generated/bridging", + "generate": "npm run mkdirs && npm run typegen && npm run lint", + "build": "npm run generate && tsc --module es2022", + "test": "npm run generate && tsc", + "lint": "eslint generated/ --ext .ts --fix", + "typegen": "cd schemas && node ../s2tQuicktypeUtil.js context ../generated/context/ContextTypes.ts" + }, + "devDependencies": { + "@types/jest": "29.5.12", + "@typescript-eslint/eslint-plugin": "7.1.1", + "@typescript-eslint/parser": "7.1.0", + "eslint": "8.57.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-jest": "27.9.0", + "eslint-plugin-jsx-a11y": "^6.8.0", + "quicktype": "23.0.78", + "rimraf": "^6.0.1", + "ts-jest": "29.1.2", + "tslib": "^2.0.1", + "typescript": "^5.3.2" + } +} \ No newline at end of file diff --git a/packages/fdc3-context/s2tQuicktypeUtil.js b/packages/fdc3-context/s2tQuicktypeUtil.js new file mode 100644 index 000000000..4b586d301 --- /dev/null +++ b/packages/fdc3-context/s2tQuicktypeUtil.js @@ -0,0 +1,78 @@ +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ + +/** Utility for preparing arguments to quicktype, which workaround a specific + * quicktype bug in command line argument handling (where a directory is used + * as input the source language argument is ignored which causes our schemas + * to be interpreted as JSON input, rather than JSONSchema). + * + * Individual file arguments will be interpreted as 'additional' schema files + * that will be referenced from the other schemas and may not have top-level output + * schemas generated, while folders of files w + * + * */ + +const path = require('path'); +const fs = require('fs'); +const { forEachChild } = require('typescript'); +const exec = require('child_process').exec; + +const args = process.argv.slice(2); +const outputFile = args.pop(); +const inputs = args; +const toProcess = []; + +console.log('Inputs schema files: ' + inputs.join(' | ')); +console.log('Output file argument: ' + outputFile); + +let sources = ''; +let additionalSchemaFiles = '' + +//skip duplicate paths (we might want to specify some files to go first, and might duplicate them) +const allPaths = new Set(); + +const addAPath = (aPath,paths,sources,type) => { + if (!paths.has(aPath)) { + paths.add(aPath) + return sources + ` ${type} ${aPath}`; + } else { + console.log(`skipping duplicate path ${aPath}`); + return sources; + } +} + +//process the content of folders to produce code for top-level types +let inputIndex = 0; +while (inputIndex < inputs.length) { + if (inputs[inputIndex].endsWith('.schema.json')) { + //add individual files with -S as additional schema files used in references (rather than ones that need a top-level output) + additionalSchemaFiles = addAPath(path.join(inputs[inputIndex]),allPaths,additionalSchemaFiles, "-S"); + } else { + fs.readdirSync(inputs[inputIndex], { withFileTypes: true }).forEach(file => { + if (file.isDirectory()) { + inputs.push(path.join(inputs[inputIndex], file.name)); + } else if (file.name.endsWith('.schema.json')) { + sources = addAPath(path.join(inputs[inputIndex], file.name),allPaths,sources, "--src"); + } + }); + } + inputIndex++; +} + +// Normalise path to local quicktype executable. +//const quicktypeExec = "node " + ["..","quicktype","dist","index.js"].join(path.sep); +const quicktypeExec = ['..', '..', '..', 'node_modules', '.bin', 'quicktype'].join(path.sep); + +const command = `${quicktypeExec} --prefer-const-values --prefer-unions -s schema -o ${outputFile} ${additionalSchemaFiles} ${sources}`; +console.log('command to run: ' + command); + +exec(command, function(error, stdout, stderr) { + if (stdout) { + console.log(stdout); + } + if (stderr) { + console.log(stderr); + } +}); diff --git a/packages/fdc3-schema/schemas/context/action.schema.json b/packages/fdc3-context/schemas/context/action.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/action.schema.json rename to packages/fdc3-context/schemas/context/action.schema.json diff --git a/packages/fdc3-schema/schemas/context/chart.schema.json b/packages/fdc3-context/schemas/context/chart.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/chart.schema.json rename to packages/fdc3-context/schemas/context/chart.schema.json diff --git a/packages/fdc3-schema/schemas/context/chatInitSettings.schema.json b/packages/fdc3-context/schemas/context/chatInitSettings.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/chatInitSettings.schema.json rename to packages/fdc3-context/schemas/context/chatInitSettings.schema.json diff --git a/packages/fdc3-schema/schemas/context/chatMessage.schema.json b/packages/fdc3-context/schemas/context/chatMessage.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/chatMessage.schema.json rename to packages/fdc3-context/schemas/context/chatMessage.schema.json diff --git a/packages/fdc3-schema/schemas/context/chatRoom.schema.json b/packages/fdc3-context/schemas/context/chatRoom.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/chatRoom.schema.json rename to packages/fdc3-context/schemas/context/chatRoom.schema.json diff --git a/packages/fdc3-schema/schemas/context/chatSearchCriteria.schema.json b/packages/fdc3-context/schemas/context/chatSearchCriteria.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/chatSearchCriteria.schema.json rename to packages/fdc3-context/schemas/context/chatSearchCriteria.schema.json diff --git a/packages/fdc3-schema/schemas/context/contact.schema.json b/packages/fdc3-context/schemas/context/contact.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/contact.schema.json rename to packages/fdc3-context/schemas/context/contact.schema.json diff --git a/packages/fdc3-schema/schemas/context/contactList.schema.json b/packages/fdc3-context/schemas/context/contactList.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/contactList.schema.json rename to packages/fdc3-context/schemas/context/contactList.schema.json diff --git a/packages/fdc3-schema/schemas/context/context.schema.json b/packages/fdc3-context/schemas/context/context.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/context.schema.json rename to packages/fdc3-context/schemas/context/context.schema.json diff --git a/packages/fdc3-schema/schemas/context/country.schema.json b/packages/fdc3-context/schemas/context/country.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/country.schema.json rename to packages/fdc3-context/schemas/context/country.schema.json diff --git a/packages/fdc3-schema/schemas/context/currency.schema.json b/packages/fdc3-context/schemas/context/currency.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/currency.schema.json rename to packages/fdc3-context/schemas/context/currency.schema.json diff --git a/packages/fdc3-schema/schemas/context/email.schema.json b/packages/fdc3-context/schemas/context/email.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/email.schema.json rename to packages/fdc3-context/schemas/context/email.schema.json diff --git a/packages/fdc3-schema/schemas/context/instrument.schema.json b/packages/fdc3-context/schemas/context/instrument.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/instrument.schema.json rename to packages/fdc3-context/schemas/context/instrument.schema.json diff --git a/packages/fdc3-schema/schemas/context/instrumentList.schema.json b/packages/fdc3-context/schemas/context/instrumentList.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/instrumentList.schema.json rename to packages/fdc3-context/schemas/context/instrumentList.schema.json diff --git a/packages/fdc3-schema/schemas/context/interaction.schema.json b/packages/fdc3-context/schemas/context/interaction.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/interaction.schema.json rename to packages/fdc3-context/schemas/context/interaction.schema.json diff --git a/packages/fdc3-schema/schemas/context/message.schema.json b/packages/fdc3-context/schemas/context/message.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/message.schema.json rename to packages/fdc3-context/schemas/context/message.schema.json diff --git a/packages/fdc3-schema/schemas/context/nothing.schema.json b/packages/fdc3-context/schemas/context/nothing.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/nothing.schema.json rename to packages/fdc3-context/schemas/context/nothing.schema.json diff --git a/packages/fdc3-schema/schemas/context/order.schema.json b/packages/fdc3-context/schemas/context/order.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/order.schema.json rename to packages/fdc3-context/schemas/context/order.schema.json diff --git a/packages/fdc3-schema/schemas/context/orderList.schema.json b/packages/fdc3-context/schemas/context/orderList.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/orderList.schema.json rename to packages/fdc3-context/schemas/context/orderList.schema.json diff --git a/packages/fdc3-schema/schemas/context/organization.schema.json b/packages/fdc3-context/schemas/context/organization.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/organization.schema.json rename to packages/fdc3-context/schemas/context/organization.schema.json diff --git a/packages/fdc3-schema/schemas/context/portfolio.schema.json b/packages/fdc3-context/schemas/context/portfolio.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/portfolio.schema.json rename to packages/fdc3-context/schemas/context/portfolio.schema.json diff --git a/packages/fdc3-schema/schemas/context/position.schema.json b/packages/fdc3-context/schemas/context/position.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/position.schema.json rename to packages/fdc3-context/schemas/context/position.schema.json diff --git a/packages/fdc3-schema/schemas/context/product.schema.json b/packages/fdc3-context/schemas/context/product.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/product.schema.json rename to packages/fdc3-context/schemas/context/product.schema.json diff --git a/packages/fdc3-schema/schemas/context/timeRange.schema.json b/packages/fdc3-context/schemas/context/timeRange.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/timeRange.schema.json rename to packages/fdc3-context/schemas/context/timeRange.schema.json diff --git a/packages/fdc3-schema/schemas/context/trade.schema.json b/packages/fdc3-context/schemas/context/trade.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/trade.schema.json rename to packages/fdc3-context/schemas/context/trade.schema.json diff --git a/packages/fdc3-schema/schemas/context/tradeList.schema.json b/packages/fdc3-context/schemas/context/tradeList.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/tradeList.schema.json rename to packages/fdc3-context/schemas/context/tradeList.schema.json diff --git a/packages/fdc3-schema/schemas/context/transactionresult.schema.json b/packages/fdc3-context/schemas/context/transactionresult.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/transactionresult.schema.json rename to packages/fdc3-context/schemas/context/transactionresult.schema.json diff --git a/packages/fdc3-schema/schemas/context/valuation.schema.json b/packages/fdc3-context/schemas/context/valuation.schema.json similarity index 100% rename from packages/fdc3-schema/schemas/context/valuation.schema.json rename to packages/fdc3-context/schemas/context/valuation.schema.json diff --git a/packages/fdc3-context/src/index.ts b/packages/fdc3-context/src/index.ts new file mode 100644 index 000000000..996ccfffb --- /dev/null +++ b/packages/fdc3-context/src/index.ts @@ -0,0 +1 @@ +export * from '../generated/context/ContextTypes'; diff --git a/packages/fdc3-context/tsconfig.json b/packages/fdc3-context/tsconfig.json new file mode 100644 index 000000000..5273a6e11 --- /dev/null +++ b/packages/fdc3-context/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../tsconfig.root.json", + "compilerOptions": { + "rootDirs": [ + "src", + "generated" + ], + "outDir": "dist", + }, + "include": [ + "src/**/*.ts", + "generated/**/*.ts", + "schemas/**/*.json" + ], + "exclude": [ + "dist/**" + ], + "references": [] +} \ No newline at end of file diff --git a/packages/fdc3-schema/package.json b/packages/fdc3-schema/package.json index fbd29fd16..8ca94fe84 100644 --- a/packages/fdc3-schema/package.json +++ b/packages/fdc3-schema/package.json @@ -19,11 +19,10 @@ "scripts": { "clean": "rimraf dist && rimraf generated", "mkdirs": "mkdirp generated/context && mkdirp generated/api && mkdirp generated/bridging", - "generate": "npm run mkdirs && npm run typegen && npm run typegen-browser && npm run typegen-bridging && npm run lint", + "generate": "npm run mkdirs && npm run typegen-browser && npm run typegen-bridging && npm run lint", "build": "npm run generate && tsc --module es2022", "test": "npm run generate && tsc", "lint": "eslint generated/ --ext .ts --fix", - "typegen": "cd schemas && node ../s2tQuicktypeUtil.js context ../generated/context/ContextTypes.ts", "typegen-browser": "cd schemas && node ../s2tQuicktypeUtil.js api/api.schema.json api/common.schema.json context/context.schema.json api ../generated/api/BrowserTypes.ts", "typegen-bridging": "cd schemas && node ../s2tQuicktypeUtil.js api/api.schema.json api/common.schema.json api/broadcastRequest.schema.json api/findInstancesRequest.schema.json api/findInstancesResponse.schema.json api/findIntentRequest.schema.json api/findIntentResponse.schema.json api/findIntentsByContextRequest.schema.json api/findIntentsByContextResponse.schema.json api/getAppMetadataRequest.schema.json api/getAppMetadataResponse.schema.json api/openRequest.schema.json api/openResponse.schema.json api/raiseIntentRequest.schema.json api/raiseIntentResponse.schema.json api/raiseIntentResultResponse.schema.json context/context.schema.json bridging ../generated/bridging/BridgingTypes.ts" }, diff --git a/packages/fdc3-schema/src/index.ts b/packages/fdc3-schema/src/index.ts index 93e3581c9..1a67369ad 100644 --- a/packages/fdc3-schema/src/index.ts +++ b/packages/fdc3-schema/src/index.ts @@ -1,19 +1,6 @@ -export * from '../generated/api/BrowserTypes'; -export * from '../generated/context/ContextTypes'; -export * from '../generated/bridging/BridgingTypes'; -export { - Action, AppMetadata, Channel, - ConnectionStepMetadata, - FindInstancesErrors, IntentMetadata, IntentResolution, - OpenErrorResponsePayload, OptionalFeatures, - AppIdentifier, Context, PrivateChannelEventListenerTypes, - AgentResponseMessage, AppIntent, - DisplayMetadata, ConnectionStepMessageType, Type, - Icon, Image, ImplementationMetadata, - ResponseMessageType, RequestMessageType -} from '../generated/api/BrowserTypes'; - -export { Convert } from '../generated/context/ContextTypes' +import * as BrowserTypes from '../generated/api/BrowserTypes'; +import * as BridgingTypes from '../generated/bridging/BridgingTypes'; +export { BrowserTypes, BridgingTypes }; \ No newline at end of file diff --git a/packages/fdc3-standard/package.json b/packages/fdc3-standard/package.json index 3fd37a0ba..e94cb189d 100644 --- a/packages/fdc3-standard/package.json +++ b/packages/fdc3-standard/package.json @@ -31,7 +31,8 @@ "printWidth": 120 }, "dependencies": { - "@kite9/fdc3-schema": "2.2.0-beta.6" + "@kite9/fdc3-schema": "2.2.0-beta.6", + "@kite9/fdc3-context": "2.2.0-beta.6" }, "devDependencies": { "@types/jest": "29.5.12", diff --git a/packages/fdc3-standard/src/api/Channel.ts b/packages/fdc3-standard/src/api/Channel.ts index 785e5263d..4908a4543 100644 --- a/packages/fdc3-standard/src/api/Channel.ts +++ b/packages/fdc3-standard/src/api/Channel.ts @@ -3,7 +3,7 @@ * Copyright FINOS FDC3 contributors - see NOTICE file */ -import { Context } from '@kite9/fdc3-schema'; +import { Context } from '@kite9/fdc3-context'; import { ContextHandler } from './Types'; import { DisplayMetadata } from './DisplayMetadata'; import { Listener } from './Listener'; diff --git a/packages/fdc3-standard/src/api/DesktopAgent.ts b/packages/fdc3-standard/src/api/DesktopAgent.ts index 4531246b1..bc4794519 100644 --- a/packages/fdc3-standard/src/api/DesktopAgent.ts +++ b/packages/fdc3-standard/src/api/DesktopAgent.ts @@ -8,7 +8,7 @@ import { Channel } from './Channel'; import { ContextHandler, IntentHandler } from './Types'; import { IntentResolution } from './IntentResolution'; import { Listener } from './Listener'; -import { Context } from '@kite9/fdc3-schema'; +import { Context } from '@kite9/fdc3-context'; import { ImplementationMetadata } from './ImplementationMetadata'; import { PrivateChannel } from './PrivateChannel'; import { AppIdentifier } from './AppIdentifier'; diff --git a/packages/fdc3-standard/src/api/Methods.ts b/packages/fdc3-standard/src/api/Methods.ts index 4dea07f98..e03daeb4e 100644 --- a/packages/fdc3-standard/src/api/Methods.ts +++ b/packages/fdc3-standard/src/api/Methods.ts @@ -22,7 +22,7 @@ import { } from '..'; import { StandardContextsSet } from '../internal/contextConfiguration'; import { StandardIntentsSet } from '../internal/intentConfiguration'; -import { Context } from '@kite9/fdc3-schema' +import { Context } from '@kite9/fdc3-context' const DEFAULT_TIMEOUT = 5000; diff --git a/packages/fdc3-standard/src/api/Types.ts b/packages/fdc3-standard/src/api/Types.ts index 721fe0a76..1329b53dc 100644 --- a/packages/fdc3-standard/src/api/Types.ts +++ b/packages/fdc3-standard/src/api/Types.ts @@ -4,7 +4,7 @@ */ import { Channel, ContextMetadata } from '..'; -import { Context } from '@kite9/fdc3-schema' +import { Context } from '@kite9/fdc3-context' /** * Describes a callback that handles a context event. diff --git a/packages/fdc3-standard/src/index.ts b/packages/fdc3-standard/src/index.ts index 8bc10030d..716c1be3c 100644 --- a/packages/fdc3-standard/src/index.ts +++ b/packages/fdc3-standard/src/index.ts @@ -5,37 +5,37 @@ import { DesktopAgent } from './api/DesktopAgent'; -export * from '@kite9/fdc3-schema' +//explicit overwrite of conflicting & equivalent export from ContextTypes export { AppIdentifier } from './api/AppIdentifier'; -export { AppIntent } from './api/AppIntent'; -export { AppMetadata } from './api/AppMetadata'; +export * from './api/AppIntent'; +export * from './api/AppMetadata'; +export * from './api/Channel'; export * from './api/ContextMetadata'; export * from './api/DesktopAgent'; -export { DisplayMetadata } from './api/DisplayMetadata'; +export * from './api/DisplayMetadata'; export * from './api/Errors'; -export { Icon } from './api/Icon'; -export { Image } from './api/Image'; -export { ImplementationMetadata } from './api/ImplementationMetadata'; -export { IntentMetadata } from './api/IntentMetadata'; -export { IntentResolution } from './api/IntentResolution'; +export * from './api/Icon'; +export * from './api/Image'; +export * from './api/ImplementationMetadata'; +export * from './api/IntentMetadata'; +export * from './api/IntentResolution'; export * from './api/Listener'; export * from './api/Methods'; export * from './api/PrivateChannel'; export * from './api/RecommendedChannels'; -export { ContextHandler, IntentHandler, IntentResult } from './api/Types'; +export * from './api/Types'; export * from './context/ContextType'; export * from './intents/Intents'; +export * from './api/Events'; export * from './api/GetAgent'; -export { EventHandler, FDC3ChannelChangedEvent, FDC3Event, FDC3EventType } from './api/Events' -export * from './ui/ChannelSelector' -export * from './ui/IntentResolver' -export * from './ui/Connectable' -export { Channel } from './api/Channel'; +export { IntentResolver, IntentResolutionChoice } from './ui/IntentResolver'; +export { ChannelSelector } from './ui/ChannelSelector'; +export { Connectable } from './ui/Connectable' declare global { interface Window { fdc3: DesktopAgent; } -} +} \ No newline at end of file diff --git a/packages/fdc3-standard/src/protocols/bcp.ts b/packages/fdc3-standard/src/protocols/bcp.ts index 3a617d77f..1434b5c9c 100644 --- a/packages/fdc3-standard/src/protocols/bcp.ts +++ b/packages/fdc3-standard/src/protocols/bcp.ts @@ -1,7 +1,7 @@ /** * Browser Communication Protocol (BCP) is used for communication between the "@kite9/fdc3-standard" library and Browser-Resident DAs. */ -import { Context } from '@kite9/fdc3-schema' +import { Context } from '@kite9/fdc3-context' import { ContextType } from "../context/ContextType"; import { AppIdentifier } from "../api/AppIdentifier"; import { AppMetadata } from "../api/AppMetadata"; diff --git a/packages/fdc3-standard/src/ui/IntentResolver.ts b/packages/fdc3-standard/src/ui/IntentResolver.ts index 16f2b478c..bbd54e0d4 100644 --- a/packages/fdc3-standard/src/ui/IntentResolver.ts +++ b/packages/fdc3-standard/src/ui/IntentResolver.ts @@ -1,4 +1,4 @@ -import { Context } from "@kite9/fdc3-schema"; +import { Context } from "@kite9/fdc3-context"; import { AppIdentifier } from "../api/AppIdentifier"; import { AppIntent } from "../api/AppIntent"; import { Connectable } from "./Connectable"; diff --git a/packages/fdc3-standard/tsconfig.json b/packages/fdc3-standard/tsconfig.json index fd2952148..d5ed268be 100644 --- a/packages/fdc3-standard/tsconfig.json +++ b/packages/fdc3-standard/tsconfig.json @@ -13,5 +13,12 @@ "test/**", "dist/**" ], - "references": [] + "references": [ + { + "path": "../fdc3-schema" + }, + { + "path": "../fdc3-context" + } + ] } \ No newline at end of file diff --git a/packages/fdc3-all/package.json b/packages/fdc3/package.json similarity index 92% rename from packages/fdc3-all/package.json rename to packages/fdc3/package.json index cc2288172..4346d88c8 100644 --- a/packages/fdc3-all/package.json +++ b/packages/fdc3/package.json @@ -1,5 +1,5 @@ { - "name": "@kite9/fdc3-standard", + "name": "@kite9/fdc3", "version": "2.2.0-beta.6", "author": "Fintech Open Source Foundation (FINOS)", "homepage": "https://fdc3.finos.org", @@ -37,6 +37,12 @@ "endOfLine": "auto", "printWidth": 120 }, + "dependencies": { + "@kite9/fdc3-standard": "2.2.0-beta.6", + "@kite9/fdc3-schema": "2.2.0-beta.6", + "@kite9/fdc3-get-agent": "2.2.0-beta.6", + "@kite9/fdc3-context": "2.2.0-beta.6" + }, "devDependencies": { "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.1.0", diff --git a/packages/fdc3-all/rollup.config.js b/packages/fdc3/rollup.config.js similarity index 100% rename from packages/fdc3-all/rollup.config.js rename to packages/fdc3/rollup.config.js diff --git a/packages/fdc3/src/index.ts b/packages/fdc3/src/index.ts new file mode 100644 index 000000000..d7755bf79 --- /dev/null +++ b/packages/fdc3/src/index.ts @@ -0,0 +1,21 @@ + +export * from "@kite9/fdc3-context" + +import { BrowserTypes, BridgingTypes } from "@kite9/fdc3-schema"; +export { BridgingTypes, BrowserTypes }; + +import { getAgent } from "@kite9/fdc3-get-agent"; +export { getAgent }; + +export * from '@kite9/fdc3-standard'; + +import { DesktopAgent, AppIdentifier } from "@kite9/fdc3-standard"; + +export { AppIdentifier }; + +/** Might not be needed */ +declare global { + interface Window { + fdc3: DesktopAgent; + } +} \ No newline at end of file diff --git a/packages/fdc3-all/tsconfig.json b/packages/fdc3/tsconfig.json similarity index 100% rename from packages/fdc3-all/tsconfig.json rename to packages/fdc3/tsconfig.json diff --git a/packages/testing/src/agent/index.ts b/packages/testing/src/agent/index.ts index eeca2adfa..d58d587fb 100644 --- a/packages/testing/src/agent/index.ts +++ b/packages/testing/src/agent/index.ts @@ -1,4 +1,5 @@ -import { AppIntent, Channel, Context, IntentResult } from "@kite9/fdc3-standard"; +import { AppIntent, Channel, IntentResult } from "@kite9/fdc3-standard"; +import { Context } from "@kite9/fdc3-context"; import { IntentResolver, IntentResolutionChoice, ChannelSelector } from "@kite9/fdc3-standard"; import { PropsWorld } from "../world"; diff --git a/packages/testing/src/steps/generic.steps.ts b/packages/testing/src/steps/generic.steps.ts index 996249cf5..80d213f3a 100644 --- a/packages/testing/src/steps/generic.steps.ts +++ b/packages/testing/src/steps/generic.steps.ts @@ -140,6 +140,7 @@ export function setupGenericSteps() { const p = path const schemaDir = p.join(__dirname, '../../../../fdc3-schema/schemas') + const contextDir = p.join(__dirname, '../../../../fdc3-context/schemas') const abspath = p.join(schemaDir, 'api') @@ -157,7 +158,7 @@ export function setupGenericSteps() { console.log(error) } - const contextPath = p.join(schemaDir, 'context/context.schema.json') + const contextPath = p.join(contextDir, 'context/context.schema.json') const contents = fs.readFileSync(contextPath, 'utf8') const schema = JSON.parse(contents); ajv.addSchema(schema); From 00b33e96ab6d5a2f6742e2e1354be31b4db43bcc Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 15:39:54 +0100 Subject: [PATCH 11/16] Fixed da-server imports --- packages/testing/package.json | 1 + .../da-server/src/BasicFDC3Server.ts | 4 ++- .../fdc3-for-web/da-server/src/FDC3Server.ts | 4 ++- .../da-server/src/ServerContext.ts | 4 +-- .../src/handlers/BroadcastHandler.ts | 35 ++++++++++--------- .../da-server/src/handlers/IntentHandler.ts | 23 ++++++------ .../da-server/src/handlers/OpenHandler.ts | 22 +++++++----- .../da-server/src/handlers/support.ts | 5 ++- .../step-definitions/app-channel.steps.ts | 5 ++- .../test/step-definitions/broadcast.steps.ts | 8 ++++- .../test/step-definitions/intents.steps.ts | 19 +++++----- .../step-definitions/private-channel.steps.ts | 12 +++---- .../test/step-definitions/start-app.steps.ts | 8 ++++- .../step-definitions/user-channel.steps.ts | 14 ++++---- toolbox/fdc3-workbench/package.json | 2 +- toolbox/fdc3-workbench/src/utility/Fdc3Api.ts | 5 ++- 16 files changed, 99 insertions(+), 72 deletions(-) diff --git a/packages/testing/package.json b/packages/testing/package.json index 6fbff2679..69f887276 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,6 +1,7 @@ { "name": "@kite9/testing", "version": "2.2.0-beta.6", + "private": true, "files": [ "dist" ], diff --git a/toolbox/fdc3-for-web/da-server/src/BasicFDC3Server.ts b/toolbox/fdc3-for-web/da-server/src/BasicFDC3Server.ts index 39c370def..05580fbb3 100644 --- a/toolbox/fdc3-for-web/da-server/src/BasicFDC3Server.ts +++ b/toolbox/fdc3-for-web/da-server/src/BasicFDC3Server.ts @@ -4,8 +4,10 @@ import { BroadcastHandler, ChannelState } from "./handlers/BroadcastHandler"; import { IntentHandler } from "./handlers/IntentHandler"; import { Directory } from "./directory/DirectoryInterface"; import { OpenHandler } from "./handlers/OpenHandler"; -import { AppRequestMessage, WebConnectionProtocol4ValidateAppIdentity } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; +type AppRequestMessage = BrowserTypes.AppRequestMessage +type WebConnectionProtocol4ValidateAppIdentity = BrowserTypes.WebConnectionProtocol4ValidateAppIdentity export interface MessageHandler { diff --git a/toolbox/fdc3-for-web/da-server/src/FDC3Server.ts b/toolbox/fdc3-for-web/da-server/src/FDC3Server.ts index 7f83ab36a..fea90855c 100644 --- a/toolbox/fdc3-for-web/da-server/src/FDC3Server.ts +++ b/toolbox/fdc3-for-web/da-server/src/FDC3Server.ts @@ -1,5 +1,7 @@ -import { AppRequestMessage } from "@kite9/fdc3-standard"; import { InstanceID } from "./ServerContext"; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type AppRequestMessage = BrowserTypes.AppRequestMessage export interface FDC3Server { diff --git a/toolbox/fdc3-for-web/da-server/src/ServerContext.ts b/toolbox/fdc3-for-web/da-server/src/ServerContext.ts index 52b401644..744ad6922 100644 --- a/toolbox/fdc3-for-web/da-server/src/ServerContext.ts +++ b/toolbox/fdc3-for-web/da-server/src/ServerContext.ts @@ -1,5 +1,5 @@ -import { AppIntent, Context } from "@kite9/fdc3-standard"; -import { AppIdentifier } from "@kite9/fdc3-standard"; +import { AppIntent, AppIdentifier } from "@kite9/fdc3-standard"; +import { Context } from "@kite9/fdc3-context"; /** diff --git a/toolbox/fdc3-for-web/da-server/src/handlers/BroadcastHandler.ts b/toolbox/fdc3-for-web/da-server/src/handlers/BroadcastHandler.ts index c904d53bd..3090c753b 100644 --- a/toolbox/fdc3-for-web/da-server/src/handlers/BroadcastHandler.ts +++ b/toolbox/fdc3-for-web/da-server/src/handlers/BroadcastHandler.ts @@ -1,22 +1,25 @@ import { MessageHandler } from "../BasicFDC3Server"; import { InstanceID, ServerContext } from "../ServerContext"; -import { AppIdentifier, ChannelError, Context } from "@kite9/fdc3-standard"; +import { Context } from "@kite9/fdc3-context"; +import { AppIdentifier, ChannelError, DisplayMetadata } from "@kite9/fdc3-standard"; import { successResponse, errorResponse, onlyUnique } from "./support"; -import { - PrivateChannelEventListenerTypes, - GetCurrentContextRequest, - BroadcastRequest, - ContextListenerUnsubscribeRequest, - AddContextListenerRequest, - PrivateChannelDisconnectRequest, - PrivateChannelAddEventListenerRequest, - PrivateChannelUnsubscribeEventListenerRequest, - GetOrCreateChannelRequest, - GetUserChannelsRequest, - LeaveCurrentChannelRequest, - JoinUserChannelRequest, - GetCurrentChannelRequest, AgentEventMessage, CreatePrivateChannelRequest, DisplayMetadata -} from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type PrivateChannelEventListenerTypes = BrowserTypes.PrivateChannelEventListenerTypes +type GetCurrentContextRequest = BrowserTypes.GetCurrentContextRequest +type BroadcastRequest = BrowserTypes.BroadcastRequest +type ContextListenerUnsubscribeRequest = BrowserTypes.ContextListenerUnsubscribeRequest +type AddContextListenerRequest = BrowserTypes.AddContextListenerRequest +type PrivateChannelDisconnectRequest = BrowserTypes.PrivateChannelDisconnectRequest +type PrivateChannelAddEventListenerRequest = BrowserTypes.PrivateChannelAddEventListenerRequest +type PrivateChannelUnsubscribeEventListenerRequest = BrowserTypes.PrivateChannelUnsubscribeEventListenerRequest +type GetOrCreateChannelRequest = BrowserTypes.GetOrCreateChannelRequest +type GetUserChannelsRequest = BrowserTypes.GetUserChannelsRequest +type LeaveCurrentChannelRequest = BrowserTypes.LeaveCurrentChannelRequest +type JoinUserChannelRequest = BrowserTypes.JoinUserChannelRequest +type GetCurrentChannelRequest = BrowserTypes.GetCurrentChannelRequest +type AgentEventMessage = BrowserTypes.AgentEventMessage +type CreatePrivateChannelRequest = BrowserTypes.CreatePrivateChannelRequest type ContextListenerRegistration = { appId: string, diff --git a/toolbox/fdc3-for-web/da-server/src/handlers/IntentHandler.ts b/toolbox/fdc3-for-web/da-server/src/handlers/IntentHandler.ts index 1a9d5eb13..92b1665ff 100644 --- a/toolbox/fdc3-for-web/da-server/src/handlers/IntentHandler.ts +++ b/toolbox/fdc3-for-web/da-server/src/handlers/IntentHandler.ts @@ -1,18 +1,19 @@ import { MessageHandler } from "../BasicFDC3Server"; import { InstanceID, ServerContext } from "../ServerContext"; import { Directory } from "../directory/DirectoryInterface"; -import { - AppIntent, ResolveError, AddIntentListenerRequest, - FindIntentRequest, FindIntentsByContextRequest, - IntentEvent, - IntentListenerUnsubscribeRequest, - RaiseIntentRequest, RaiseIntentForContextRequest, - IntentResultRequest, - AppIdentifier, - Context -} from "@kite9/fdc3-standard"; +import { Context } from "@kite9/fdc3-context"; +import { AppIntent, ResolveError, AppIdentifier, } from "@kite9/fdc3-standard"; import { errorResponse, errorResponseId, successResponse, successResponseId } from "./support"; - +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type AddIntentListenerRequest = BrowserTypes.AddIntentListenerRequest +type FindIntentRequest = BrowserTypes.FindIntentRequest +type FindIntentsByContextRequest = BrowserTypes.FindIntentsByContextRequest +type IntentEvent = BrowserTypes.IntentEvent +type IntentListenerUnsubscribeRequest = BrowserTypes.IntentListenerUnsubscribeRequest +type RaiseIntentRequest = BrowserTypes.RaiseIntentRequest +type RaiseIntentForContextRequest = BrowserTypes.RaiseIntentForContextRequest +type IntentResultRequest = BrowserTypes.IntentResultRequest type ListenerRegistration = { appId: string | undefined, diff --git a/toolbox/fdc3-for-web/da-server/src/handlers/OpenHandler.ts b/toolbox/fdc3-for-web/da-server/src/handlers/OpenHandler.ts index ed194ad4a..7df114ed1 100644 --- a/toolbox/fdc3-for-web/da-server/src/handlers/OpenHandler.ts +++ b/toolbox/fdc3-for-web/da-server/src/handlers/OpenHandler.ts @@ -1,20 +1,24 @@ import { MessageHandler } from "../BasicFDC3Server"; import { InstanceID, ServerContext } from "../ServerContext"; import { Directory, DirectoryApp } from "../directory/DirectoryInterface"; +import { ContextElement } from "@kite9/fdc3-context"; import { - ContextElement, OpenError, ResolveError, - AddContextListenerRequest, + OpenError, ResolveError, AppIdentifier, AppMetadata, - BroadcastEvent, - FindInstancesRequest, - GetAppMetadataRequest, - OpenRequest, - WebConnectionProtocol4ValidateAppIdentity, - WebConnectionProtocol5ValidateAppIdentityFailedResponse, - WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; import { errorResponse, successResponse } from './support' + +type BroadcastEvent = BrowserTypes.BroadcastEvent +type AddContextListenerRequest = BrowserTypes.AddContextListenerRequest +type FindInstancesRequest = BrowserTypes.FindInstancesRequest +type GetAppMetadataRequest = BrowserTypes.GetAppMetadataRequest +type OpenRequest = BrowserTypes.OpenRequest +type WebConnectionProtocol4ValidateAppIdentity = BrowserTypes.WebConnectionProtocol4ValidateAppIdentity +type WebConnectionProtocol5ValidateAppIdentityFailedResponse = BrowserTypes.WebConnectionProtocol5ValidateAppIdentityFailedResponse +type WebConnectionProtocol5ValidateAppIdentitySuccessResponse = BrowserTypes.WebConnectionProtocol5ValidateAppIdentitySuccessResponse + enum AppState { Opening, DeliveringContext, Done } class PendingApp { diff --git a/toolbox/fdc3-for-web/da-server/src/handlers/support.ts b/toolbox/fdc3-for-web/da-server/src/handlers/support.ts index d11820921..ef56c27f7 100644 --- a/toolbox/fdc3-for-web/da-server/src/handlers/support.ts +++ b/toolbox/fdc3-for-web/da-server/src/handlers/support.ts @@ -1,6 +1,9 @@ import { ServerContext } from "../ServerContext"; -import { AgentResponseMessage, AppIdentifier, AppRequestMessage } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; +import { AppIdentifier } from "@kite9/fdc3-standard"; +type AppRequestMessage = BrowserTypes.AppRequestMessage +type AgentResponseMessage = BrowserTypes.AgentResponseMessage export function successResponse(sc: ServerContext, request: AppRequestMessage, to: AppIdentifier, payload: any, type: string) { return successResponseId(sc, request.meta.requestUuid, to, payload, type); diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/app-channel.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/app-channel.steps.ts index 556bb775c..a99e94d00 100644 --- a/toolbox/fdc3-for-web/da-server/test/step-definitions/app-channel.steps.ts +++ b/toolbox/fdc3-for-web/da-server/test/step-definitions/app-channel.steps.ts @@ -1,10 +1,9 @@ import { When } from '@cucumber/cucumber' import { CustomWorld } from '../world'; import { createMeta } from './generic.steps'; -import { - GetOrCreateChannelRequest -} from '@kite9/fdc3-standard' import { handleResolve } from "@kite9/testing"; +import { BrowserTypes } from '@kite9/fdc3-schema'; +type GetOrCreateChannelRequest = BrowserTypes.GetOrCreateChannelRequest When('{string} creates or gets an app channel called {string}', function (this: CustomWorld, app: string, channel: string) { const meta = createMeta(this, app) diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/broadcast.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/broadcast.steps.ts index 5a94cdd8b..8d96c297d 100644 --- a/toolbox/fdc3-for-web/da-server/test/step-definitions/broadcast.steps.ts +++ b/toolbox/fdc3-for-web/da-server/test/step-definitions/broadcast.steps.ts @@ -1,9 +1,15 @@ import { When } from '@cucumber/cucumber' import { CustomWorld } from '../world'; import { createMeta } from './generic.steps'; -import { AddContextListenerRequest, ContextListenerUnsubscribeRequest, BroadcastRequest, GetCurrentContextRequest } from '@kite9/fdc3-standard'; +import { } from '@kite9/fdc3-standard'; import { handleResolve } from "@kite9/testing"; import { contextMap } from './generic.steps'; +import { BrowserTypes } from '@kite9/fdc3-schema'; + +type AddContextListenerRequest = BrowserTypes.AddContextListenerRequest +type ContextListenerUnsubscribeRequest = BrowserTypes.ContextListenerUnsubscribeRequest +type BroadcastRequest = BrowserTypes.BroadcastRequest +type GetCurrentContextRequest = BrowserTypes.GetCurrentContextRequest When('{string} adds a context listener on {string} with type {string}', function (this: CustomWorld, app: string, channelId: string, contextType: string) { const meta = createMeta(this, app) diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/intents.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/intents.steps.ts index e5e844831..ab05eec52 100644 --- a/toolbox/fdc3-for-web/da-server/test/step-definitions/intents.steps.ts +++ b/toolbox/fdc3-for-web/da-server/test/step-definitions/intents.steps.ts @@ -3,15 +3,16 @@ import { CustomWorld } from "../world"; import { DirectoryApp } from "../../src/directory/DirectoryInterface"; import { APP_FIELD, contextMap, createMeta } from "./generic.steps"; import { handleResolve } from "@kite9/testing"; -import { - FindIntentRequest, - FindIntentsByContextRequest, - AddIntentListenerRequest, - IntentListenerUnsubscribeRequest, - RaiseIntentRequest, - RaiseIntentForContextRequest, - IntentResultRequest -} from "@kite9/fdc3-standard"; +import { BrowserTypes } from '@kite9/fdc3-schema'; + + +type FindIntentRequest = BrowserTypes.FindIntentRequest +type FindIntentsByContextRequest = BrowserTypes.FindIntentsByContextRequest +type AddIntentListenerRequest = BrowserTypes.AddIntentListenerRequest +type IntentListenerUnsubscribeRequest = BrowserTypes.IntentListenerUnsubscribeRequest +type RaiseIntentRequest = BrowserTypes.RaiseIntentRequest +type RaiseIntentForContextRequest = BrowserTypes.RaiseIntentForContextRequest +type IntentResultRequest = BrowserTypes.IntentResultRequest type ListensFor = { [key: string]: { diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/private-channel.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/private-channel.steps.ts index 48b9122ce..1e2978fc9 100644 --- a/toolbox/fdc3-for-web/da-server/test/step-definitions/private-channel.steps.ts +++ b/toolbox/fdc3-for-web/da-server/test/step-definitions/private-channel.steps.ts @@ -1,14 +1,14 @@ import { When } from '@cucumber/cucumber' import { CustomWorld } from '../world'; import { createMeta } from './generic.steps'; -import { - CreatePrivateChannelRequest, - PrivateChannelAddEventListenerRequest, - PrivateChannelUnsubscribeEventListenerRequest, - PrivateChannelDisconnectRequest -} from '@kite9/fdc3-standard' +import { BrowserTypes } from '@kite9/fdc3-schema'; import { handleResolve } from "@kite9/testing"; +type CreatePrivateChannelRequest = BrowserTypes.CreatePrivateChannelRequest +type PrivateChannelAddEventListenerRequest = BrowserTypes.PrivateChannelAddEventListenerRequest +type PrivateChannelUnsubscribeEventListenerRequest = BrowserTypes.PrivateChannelUnsubscribeEventListenerRequest +type PrivateChannelDisconnectRequest = BrowserTypes.PrivateChannelDisconnectRequest + When('{string} creates a private channel', function (this: CustomWorld, app: string) { const meta = createMeta(this, app) const uuid = this.sc.getInstanceUUID(meta.source)!! diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/start-app.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/start-app.steps.ts index 69766f155..ccdafc2f5 100644 --- a/toolbox/fdc3-for-web/da-server/test/step-definitions/start-app.steps.ts +++ b/toolbox/fdc3-for-web/da-server/test/step-definitions/start-app.steps.ts @@ -2,7 +2,13 @@ import { DataTable, Then, When } from '@cucumber/cucumber' import { CustomWorld } from '../world'; import { contextMap, createMeta } from './generic.steps'; import { matchData } from '@kite9/testing'; -import { OpenRequest, GetAppMetadataRequest, FindInstancesRequest, WebConnectionProtocol4ValidateAppIdentity } from '@kite9/fdc3-standard'; +import { BrowserTypes } from '@kite9/fdc3-schema'; + +type OpenRequest = BrowserTypes.OpenRequest +type GetAppMetadataRequest = BrowserTypes.GetAppMetadataRequest +type FindInstancesRequest = BrowserTypes.FindInstancesRequest +type WebConnectionProtocol4ValidateAppIdentity = BrowserTypes.WebConnectionProtocol4ValidateAppIdentity + When('{string} is opened with connection id {string}', function (this: CustomWorld, app: string, uuid: string) { const meta = createMeta(this, app) diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/user-channel.steps.ts b/toolbox/fdc3-for-web/da-server/test/step-definitions/user-channel.steps.ts index de7d2c79a..db8837f10 100644 --- a/toolbox/fdc3-for-web/da-server/test/step-definitions/user-channel.steps.ts +++ b/toolbox/fdc3-for-web/da-server/test/step-definitions/user-channel.steps.ts @@ -1,15 +1,15 @@ import { When } from '@cucumber/cucumber' import { CustomWorld } from '../world'; import { createMeta } from './generic.steps'; -import { - GetUserChannelsRequest, - GetCurrentChannelRequest, - JoinUserChannelRequest, - LeaveCurrentChannelRequest, - GetCurrentContextRequest -} from '@kite9/fdc3-standard' +import { BrowserTypes } from '@kite9/fdc3-schema'; import { handleResolve } from "@kite9/testing"; +type GetUserChannelsRequest = BrowserTypes.GetUserChannelsRequest +type GetCurrentChannelRequest = BrowserTypes.GetCurrentChannelRequest +type JoinUserChannelRequest = BrowserTypes.JoinUserChannelRequest +type LeaveCurrentChannelRequest = BrowserTypes.LeaveCurrentChannelRequest +type GetCurrentContextRequest = BrowserTypes.GetCurrentContextRequest + When('{string} gets the list of user channels', function (this: CustomWorld, app: string) { const meta = createMeta(this, app) diff --git a/toolbox/fdc3-workbench/package.json b/toolbox/fdc3-workbench/package.json index 559b1a01f..2ea53a11b 100644 --- a/toolbox/fdc3-workbench/package.json +++ b/toolbox/fdc3-workbench/package.json @@ -30,7 +30,7 @@ ] }, "devDependencies": { - "@kite9/fdc3-get-agent": "2.2.0-beta.6", + "@kite9/fdc3": "2.2.0-beta.6", "@types/jsoneditor": "^8.6.1", "@typescript-eslint/eslint-plugin": "7.1.1", "@typescript-eslint/parser": "7.1.0", diff --git a/toolbox/fdc3-workbench/src/utility/Fdc3Api.ts b/toolbox/fdc3-workbench/src/utility/Fdc3Api.ts index b8ebd15fb..444622862 100644 --- a/toolbox/fdc3-workbench/src/utility/Fdc3Api.ts +++ b/toolbox/fdc3-workbench/src/utility/Fdc3Api.ts @@ -2,10 +2,9 @@ * SPDX-License-Identifier: Apache-2.0 * Copyright FINOS FDC3 contributors - see NOTICE file */ -import * as fdc3_2 from "@kite9/fdc3-standard"; +import * as fdc3_2 from "@kite9/fdc3"; import * as fdc3_1 from "fdc3-1.2"; -import { group } from "console"; -import { fdc3Ready } from '@kite9/fdc3-get-agent' +import { fdc3Ready } from '@kite9/fdc3' const fdc3ReadyPromise = fdc3Ready() interface fdc3_1IntentResolution extends fdc3_1.IntentResolution { From c6c8b118dcf6deae6a8f2f5c67b860eff3a59aa6 Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 15:57:33 +0100 Subject: [PATCH 12/16] Fixed fdc3-get-agent imports --- .../fdc3-get-agent/src/messaging/AbstractWebMessaging.ts | 4 +++- .../fdc3-get-agent/src/messaging/MessagePortMessaging.ts | 4 +++- .../fdc3-get-agent/src/strategies/PostMessageLoader.ts | 7 ++++++- packages/fdc3-get-agent/src/strategies/post-message.ts | 7 ++++++- .../src/ui/DefaultDesktopAgentChannelSelector.ts | 5 ++++- .../src/ui/DefaultDesktopAgentIntentResolver.ts | 7 ++++++- packages/fdc3-get-agent/src/ui/NullIIntentResolver.ts | 3 ++- packages/fdc3-get-agent/test/support/FrameTypes.ts | 4 +++- packages/fdc3-get-agent/test/support/MockFDC3Server.ts | 6 +++++- .../test/support/responses/CurrentChannel.ts | 5 +++-- .../fdc3-get-agent/test/support/responses/FindIntent.ts | 4 +++- .../fdc3-get-agent/test/support/responses/Handshake.ts | 5 ++++- .../fdc3-get-agent/test/support/responses/RaiseIntent.ts | 5 ++++- .../fdc3-get-agent/test/support/responses/UserChannels.ts | 5 ++++- packages/fdc3-standard/test/ContextTypes.test.ts | 2 +- toolbox/fdc3-workbench/package.json | 1 - 16 files changed, 57 insertions(+), 17 deletions(-) diff --git a/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts b/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts index 8c1daac23..13ba8163b 100644 --- a/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts +++ b/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts @@ -1,5 +1,7 @@ -import { DesktopAgentDetails, WebDesktopAgentType, GetAgentParams, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-standard"; +import { DesktopAgentDetails, WebDesktopAgentType, GetAgentParams, } from "@kite9/fdc3-standard"; import { RegisterableListener, AbstractMessaging } from "@kite9/da-proxy"; +import { BrowserTypes } from "@kite9/fdc3-schema"; +type WebConnectionProtocol5ValidateAppIdentitySuccessResponse = BrowserTypes.WebConnectionProtocol5ValidateAppIdentitySuccessResponse export const DESKTOP_AGENT_SESSION_STORAGE_DETAILS_KEY = "fdc3-desktop-agent-details" diff --git a/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts b/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts index cc62eaa8f..ea38775c8 100644 --- a/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts +++ b/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts @@ -1,7 +1,9 @@ import { AbstractWebMessaging } from './AbstractWebMessaging' import { RegisterableListener } from "@kite9/da-proxy" -import { GetAgentParams, WebConnectionProtocol3Handshake } from "@kite9/fdc3-standard" +import { GetAgentParams } from "@kite9/fdc3-standard" import { v4 as uuidv4 } from "uuid" +import { BrowserTypes } from "@kite9/fdc3-schema"; +type WebConnectionProtocol3Handshake = BrowserTypes.WebConnectionProtocol3Handshake /** * Details needed to set up the Messaging instance diff --git a/packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts b/packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts index 97e4fa0d6..e335b37e7 100644 --- a/packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts +++ b/packages/fdc3-get-agent/src/strategies/PostMessageLoader.ts @@ -1,9 +1,14 @@ -import { DesktopAgent, GetAgentParams, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake } from '@kite9/fdc3-standard' +import { DesktopAgent, GetAgentParams } from '@kite9/fdc3-standard' import { FDC3_VERSION } from '..'; import { createDesktopAgentAPI } from '../messaging/message-port'; import { v4 as uuidv4 } from "uuid" import { ConnectionDetails } from '../messaging/MessagePortMessaging'; import { Loader } from './Loader'; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type WebConnectionProtocol1Hello = BrowserTypes.WebConnectionProtocol1Hello +type WebConnectionProtocol2LoadURL = BrowserTypes.WebConnectionProtocol2LoadURL +type WebConnectionProtocol3Handshake = BrowserTypes.WebConnectionProtocol3Handshake function collectPossibleTargets(w: Window, found: Window[]) { if (w) { diff --git a/packages/fdc3-get-agent/src/strategies/post-message.ts b/packages/fdc3-get-agent/src/strategies/post-message.ts index 97e4fa0d6..e335b37e7 100644 --- a/packages/fdc3-get-agent/src/strategies/post-message.ts +++ b/packages/fdc3-get-agent/src/strategies/post-message.ts @@ -1,9 +1,14 @@ -import { DesktopAgent, GetAgentParams, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake } from '@kite9/fdc3-standard' +import { DesktopAgent, GetAgentParams } from '@kite9/fdc3-standard' import { FDC3_VERSION } from '..'; import { createDesktopAgentAPI } from '../messaging/message-port'; import { v4 as uuidv4 } from "uuid" import { ConnectionDetails } from '../messaging/MessagePortMessaging'; import { Loader } from './Loader'; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type WebConnectionProtocol1Hello = BrowserTypes.WebConnectionProtocol1Hello +type WebConnectionProtocol2LoadURL = BrowserTypes.WebConnectionProtocol2LoadURL +type WebConnectionProtocol3Handshake = BrowserTypes.WebConnectionProtocol3Handshake function collectPossibleTargets(w: Window, found: Window[]) { if (w) { diff --git a/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts b/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts index be1a58035..4ea029c51 100644 --- a/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts +++ b/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentChannelSelector.ts @@ -1,7 +1,10 @@ -import { Channel, IframeChannels, IframeChannelSelected } from "@kite9/fdc3-standard"; +import { Channel } from "@kite9/fdc3-standard"; import { ChannelSelector } from "@kite9/fdc3-standard" import { AbstractUIComponent } from "./AbstractUIComponent"; +import { BrowserTypes } from "@kite9/fdc3-schema"; +type IframeChannels = BrowserTypes.IframeChannels +type IframeChannelSelected = BrowserTypes.IframeChannelSelected /** * Works with the desktop agent to provide a simple channel selector. diff --git a/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts b/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts index a95848831..3c245b43d 100644 --- a/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts +++ b/packages/fdc3-get-agent/src/ui/DefaultDesktopAgentIntentResolver.ts @@ -1,6 +1,11 @@ -import { AppIntent, IframeResolveAction, Context, IframeResolve } from "@kite9/fdc3-standard"; +import { AppIntent } from "@kite9/fdc3-standard"; import { IntentResolver, IntentResolutionChoice } from '@kite9/fdc3-standard' import { AbstractUIComponent } from "./AbstractUIComponent"; +import { BrowserTypes } from "@kite9/fdc3-schema"; +import { Context } from "@kite9/fdc3-context"; + +type IframeResolveAction = BrowserTypes.IframeResolveAction +type IframeResolve = BrowserTypes.IframeResolve /** * Works with the desktop agent to provide a resolution to the intent choices. diff --git a/packages/fdc3-get-agent/src/ui/NullIIntentResolver.ts b/packages/fdc3-get-agent/src/ui/NullIIntentResolver.ts index bbb46e566..4a8229986 100644 --- a/packages/fdc3-get-agent/src/ui/NullIIntentResolver.ts +++ b/packages/fdc3-get-agent/src/ui/NullIIntentResolver.ts @@ -1,5 +1,6 @@ -import { AppIntent, Context } from "@kite9/fdc3-standard"; +import { AppIntent } from "@kite9/fdc3-standard"; import { IntentResolver, IntentResolutionChoice } from "@kite9/fdc3-standard"; +import { Context } from "@kite9/fdc3-context"; export class NullIntentResolver implements IntentResolver { diff --git a/packages/fdc3-get-agent/test/support/FrameTypes.ts b/packages/fdc3-get-agent/test/support/FrameTypes.ts index e5e42155d..52ac79587 100644 --- a/packages/fdc3-get-agent/test/support/FrameTypes.ts +++ b/packages/fdc3-get-agent/test/support/FrameTypes.ts @@ -1,8 +1,10 @@ -import { IframeHello, WebConnectionProtocol3Handshake } from "@kite9/fdc3-standard" import { CustomWorld } from "../world" import { MockWindow } from "./MockDocument" import { CHANNEL_SELECTOR_URL, EMBED_URL, INTENT_RESPOLVER_URL } from "./MockFDC3Server" +import { BrowserTypes } from "@kite9/fdc3-schema" +type IframeHello = BrowserTypes.IframeHello +type WebConnectionProtocol3Handshake = BrowserTypes.WebConnectionProtocol3Handshake /** * This handles the frame communications when we're using the embedded iframe approach diff --git a/packages/fdc3-get-agent/test/support/MockFDC3Server.ts b/packages/fdc3-get-agent/test/support/MockFDC3Server.ts index 35de9699e..95dc56fb9 100644 --- a/packages/fdc3-get-agent/test/support/MockFDC3Server.ts +++ b/packages/fdc3-get-agent/test/support/MockFDC3Server.ts @@ -1,5 +1,4 @@ import { FDC3Server } from "@kite9/da-server" -import { AppRequestMessage, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake } from "@kite9/fdc3-standard" import { TestServerContext } from "./TestServerContext" import { MockWindow } from "./MockDocument" import { AutomaticResponse } from "./responses/AutomaticResponses" @@ -8,6 +7,11 @@ import { RaiseIntent } from "./responses/RaiseIntent" import { Handshake } from "./responses/Handshake" import { UserChannels } from "./responses/UserChannels" import { CurrentChannel } from "./responses/CurrentChannel" +import { BrowserTypes } from "@kite9/fdc3-schema" + +type AppRequestMessage = BrowserTypes.AppRequestMessage +type WebConnectionProtocol2LoadURL = BrowserTypes.WebConnectionProtocol2LoadURL +type WebConnectionProtocol3Handshake = BrowserTypes.WebConnectionProtocol3Handshake export const dummyInstanceId = { appId: "Test App Id", instanceId: "1" } diff --git a/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts b/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts index 015b04db6..63b2ce280 100644 --- a/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts +++ b/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts @@ -1,8 +1,9 @@ -import { GetCurrentChannelRequest, GetCurrentChannelResponse } from "@kite9/fdc3-standard"; import { TestServerContext } from "../TestServerContext"; import { InstanceID } from "@kite9/da-server"; import { AutomaticResponse } from "./AutomaticResponses"; - +import { BrowserTypes } from "@kite9/fdc3-schema"; +type GetCurrentChannelRequest = BrowserTypes.GetCurrentChannelRequest +type GetCurrentChannelResponse = BrowserTypes.GetCurrentChannelResponse export class CurrentChannel implements AutomaticResponse { filter(t: string) { diff --git a/packages/fdc3-get-agent/test/support/responses/FindIntent.ts b/packages/fdc3-get-agent/test/support/responses/FindIntent.ts index 5e66997c0..5ce59c0e9 100644 --- a/packages/fdc3-get-agent/test/support/responses/FindIntent.ts +++ b/packages/fdc3-get-agent/test/support/responses/FindIntent.ts @@ -1,8 +1,10 @@ -import { FindIntentRequest, FindIntentResponse } from "@kite9/fdc3-standard"; import { TestServerContext } from "../TestServerContext"; import { InstanceID } from "@kite9/da-server"; import { AutomaticResponse } from "./AutomaticResponses"; +import { BrowserTypes } from "@kite9/fdc3-schema"; +type FindIntentRequest = BrowserTypes.FindIntentRequest +type FindIntentResponse = BrowserTypes.FindIntentResponse export class FindIntent implements AutomaticResponse { diff --git a/packages/fdc3-get-agent/test/support/responses/Handshake.ts b/packages/fdc3-get-agent/test/support/responses/Handshake.ts index bf25178e7..192d61b8f 100644 --- a/packages/fdc3-get-agent/test/support/responses/Handshake.ts +++ b/packages/fdc3-get-agent/test/support/responses/Handshake.ts @@ -1,8 +1,11 @@ import { TestServerContext } from "../TestServerContext"; import { InstanceID } from "@kite9/da-server"; import { AutomaticResponse } from "./AutomaticResponses"; +import { BrowserTypes } from "@kite9/fdc3-schema"; -import { WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentityFailedResponse, WebConnectionProtocol5ValidateAppIdentitySuccessResponse } from "@kite9/fdc3-standard"; +type WebConnectionProtocol4ValidateAppIdentity = BrowserTypes.WebConnectionProtocol4ValidateAppIdentity +type WebConnectionProtocol5ValidateAppIdentityFailedResponse = BrowserTypes.WebConnectionProtocol5ValidateAppIdentityFailedResponse +type WebConnectionProtocol5ValidateAppIdentitySuccessResponse = BrowserTypes.WebConnectionProtocol5ValidateAppIdentitySuccessResponse export const BAD_INSTANCE_ID = "BAD_INSTANCE" diff --git a/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts b/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts index 03b777567..6ef14be28 100644 --- a/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts +++ b/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts @@ -1,7 +1,10 @@ -import { RaiseIntentRequest, RaiseIntentResponse } from "@kite9/fdc3-standard"; import { TestServerContext } from "../TestServerContext"; import { InstanceID } from "@kite9/da-server"; import { AutomaticResponse } from "./AutomaticResponses"; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type RaiseIntentRequest = BrowserTypes.RaiseIntentRequest +type RaiseIntentResponse = BrowserTypes.RaiseIntentResponse export class RaiseIntent implements AutomaticResponse { diff --git a/packages/fdc3-get-agent/test/support/responses/UserChannels.ts b/packages/fdc3-get-agent/test/support/responses/UserChannels.ts index 976167056..e100dd11f 100644 --- a/packages/fdc3-get-agent/test/support/responses/UserChannels.ts +++ b/packages/fdc3-get-agent/test/support/responses/UserChannels.ts @@ -1,7 +1,10 @@ import { TestServerContext } from "../TestServerContext"; import { InstanceID } from "@kite9/da-server"; import { AutomaticResponse } from "./AutomaticResponses"; -import { GetUserChannelsRequest, GetUserChannelsResponse } from "@kite9/fdc3-standard"; +import { BrowserTypes } from "@kite9/fdc3-schema"; + +type GetUserChannelsRequest = BrowserTypes.GetUserChannelsRequest +type GetUserChannelsResponse = BrowserTypes.GetUserChannelsResponse export const USER_CHANNELS = [ { diff --git a/packages/fdc3-standard/test/ContextTypes.test.ts b/packages/fdc3-standard/test/ContextTypes.test.ts index 569c3333f..f57bf363f 100644 --- a/packages/fdc3-standard/test/ContextTypes.test.ts +++ b/packages/fdc3-standard/test/ContextTypes.test.ts @@ -1,4 +1,4 @@ -import { Convert, Contact } from '@kite9/fdc3-schema'; +import { Convert, Contact } from '@kite9/fdc3-context'; const json = '{ "type": "fdc3.contact", "id": { "email": "joe@mail.com" } }'; const contact: Contact = { diff --git a/toolbox/fdc3-workbench/package.json b/toolbox/fdc3-workbench/package.json index 2ea53a11b..bc82f4840 100644 --- a/toolbox/fdc3-workbench/package.json +++ b/toolbox/fdc3-workbench/package.json @@ -55,7 +55,6 @@ "@types/react-dom": "^17.0.0", "@types/uuid": "^10.0.0", "fdc3-1.2": "npm:@finos/fdc3@1.2.x", - "@kite9/fdc3": "2.2.0-beta.6", "jsoneditor": "^9.5.6", "mobx": "^6.3.2", "mobx-react": "^7.2.0", From ed4444a2bc5840aa5a1af823c3c17cce264de730 Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 15:58:53 +0100 Subject: [PATCH 13/16] removed unnecessary mkdirs --- .../generated/api/BrowserTypes.ts | 5682 ---------------- .../generated/bridging/BridgingTypes.ts | 6058 ----------------- .../generated/context/ContextTypes.ts | 2901 -------- packages/fdc3-context/package.json | 2 +- .../fdc3-schema/generated/api/BrowserTypes.ts | 5682 ---------------- .../generated/bridging/BridgingTypes.ts | 6058 ----------------- .../generated/context/ContextTypes.ts | 2901 -------- packages/fdc3-schema/package.json | 2 +- 8 files changed, 2 insertions(+), 29284 deletions(-) delete mode 100644 packages/fdc3-context/generated/api/BrowserTypes.ts delete mode 100644 packages/fdc3-context/generated/bridging/BridgingTypes.ts delete mode 100644 packages/fdc3-context/generated/context/ContextTypes.ts delete mode 100644 packages/fdc3-schema/generated/api/BrowserTypes.ts delete mode 100644 packages/fdc3-schema/generated/bridging/BridgingTypes.ts delete mode 100644 packages/fdc3-schema/generated/context/ContextTypes.ts diff --git a/packages/fdc3-context/generated/api/BrowserTypes.ts b/packages/fdc3-context/generated/api/BrowserTypes.ts deleted file mode 100644 index 70b633b13..000000000 --- a/packages/fdc3-context/generated/api/BrowserTypes.ts +++ /dev/null @@ -1,5682 +0,0 @@ -// To parse this data: -// -// import { Convert, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake, WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentityFailedResponse, WebConnectionProtocol5ValidateAppIdentitySuccessResponse, WebConnectionProtocol6Goodbye, WebConnectionProtocolMessage, AddContextListenerRequest, AddContextListenerResponse, AddEventListenerEvent, AddEventListenerRequest, AddEventListenerResponse, AddIntentListenerRequest, AddIntentListenerResponse, AgentEventMessage, AgentResponseMessage, AppRequestMessage, BroadcastEvent, BroadcastRequest, BroadcastResponse, ChannelChangedEvent, ContextListenerUnsubscribeRequest, ContextListenerUnsubscribeResponse, CreatePrivateChannelRequest, CreatePrivateChannelResponse, EventListenerUnsubscribeRequest, EventListenerUnsubscribeResponse, FindInstancesRequest, FindInstancesResponse, FindIntentRequest, FindIntentResponse, FindIntentsByContextRequest, FindIntentsByContextResponse, GetAppMetadataRequest, GetAppMetadataResponse, GetCurrentChannelRequest, GetCurrentChannelResponse, GetCurrentContextRequest, GetCurrentContextResponse, GetInfoRequest, GetInfoResponse, GetOrCreateChannelRequest, GetOrCreateChannelResponse, GetUserChannelsRequest, GetUserChannelsResponse, IframeChannelDrag, IframeChannelResize, IframeChannelSelected, IframeChannels, IframeHandshake, IframeHello, IframeMessage, IframeResolve, IframeResolveAction, IntentEvent, IntentListenerUnsubscribeRequest, IntentListenerUnsubscribeResponse, IntentResultRequest, IntentResultResponse, JoinUserChannelRequest, JoinUserChannelResponse, LeaveCurrentChannelRequest, LeaveCurrentChannelResponse, OpenRequest, OpenResponse, PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse, PrivateChannelOnAddContextListenerEvent, PrivateChannelOnDisconnectEvent, PrivateChannelOnUnsubscribeEvent, PrivateChannelUnsubscribeEventListenerRequest, PrivateChannelUnsubscribeEventListenerResponse, PrivateChannelAddEventListenerRequest, PrivateChannelAddEventListenerResponse, RaiseIntentForContextRequest, RaiseIntentForContextResponse, RaiseIntentRequest, RaiseIntentResponse, RaiseIntentResultResponse } from "./file"; -// -// const webConnectionProtocol1Hello = Convert.toWebConnectionProtocol1Hello(json); -// const webConnectionProtocol2LoadURL = Convert.toWebConnectionProtocol2LoadURL(json); -// const webConnectionProtocol3Handshake = Convert.toWebConnectionProtocol3Handshake(json); -// const webConnectionProtocol4ValidateAppIdentity = Convert.toWebConnectionProtocol4ValidateAppIdentity(json); -// const webConnectionProtocol5ValidateAppIdentityFailedResponse = Convert.toWebConnectionProtocol5ValidateAppIdentityFailedResponse(json); -// const webConnectionProtocol5ValidateAppIdentitySuccessResponse = Convert.toWebConnectionProtocol5ValidateAppIdentitySuccessResponse(json); -// const webConnectionProtocol6Goodbye = Convert.toWebConnectionProtocol6Goodbye(json); -// const webConnectionProtocolMessage = Convert.toWebConnectionProtocolMessage(json); -// const addContextListenerRequest = Convert.toAddContextListenerRequest(json); -// const addContextListenerResponse = Convert.toAddContextListenerResponse(json); -// const addEventListenerEvent = Convert.toAddEventListenerEvent(json); -// const addEventListenerRequest = Convert.toAddEventListenerRequest(json); -// const addEventListenerResponse = Convert.toAddEventListenerResponse(json); -// const addIntentListenerRequest = Convert.toAddIntentListenerRequest(json); -// const addIntentListenerResponse = Convert.toAddIntentListenerResponse(json); -// const agentEventMessage = Convert.toAgentEventMessage(json); -// const agentResponseMessage = Convert.toAgentResponseMessage(json); -// const appRequestMessage = Convert.toAppRequestMessage(json); -// const broadcastEvent = Convert.toBroadcastEvent(json); -// const broadcastRequest = Convert.toBroadcastRequest(json); -// const broadcastResponse = Convert.toBroadcastResponse(json); -// const channelChangedEvent = Convert.toChannelChangedEvent(json); -// const contextListenerUnsubscribeRequest = Convert.toContextListenerUnsubscribeRequest(json); -// const contextListenerUnsubscribeResponse = Convert.toContextListenerUnsubscribeResponse(json); -// const createPrivateChannelRequest = Convert.toCreatePrivateChannelRequest(json); -// const createPrivateChannelResponse = Convert.toCreatePrivateChannelResponse(json); -// const eventListenerUnsubscribeRequest = Convert.toEventListenerUnsubscribeRequest(json); -// const eventListenerUnsubscribeResponse = Convert.toEventListenerUnsubscribeResponse(json); -// const findInstancesRequest = Convert.toFindInstancesRequest(json); -// const findInstancesResponse = Convert.toFindInstancesResponse(json); -// const findIntentRequest = Convert.toFindIntentRequest(json); -// const findIntentResponse = Convert.toFindIntentResponse(json); -// const findIntentsByContextRequest = Convert.toFindIntentsByContextRequest(json); -// const findIntentsByContextResponse = Convert.toFindIntentsByContextResponse(json); -// const getAppMetadataRequest = Convert.toGetAppMetadataRequest(json); -// const getAppMetadataResponse = Convert.toGetAppMetadataResponse(json); -// const getCurrentChannelRequest = Convert.toGetCurrentChannelRequest(json); -// const getCurrentChannelResponse = Convert.toGetCurrentChannelResponse(json); -// const getCurrentContextRequest = Convert.toGetCurrentContextRequest(json); -// const getCurrentContextResponse = Convert.toGetCurrentContextResponse(json); -// const getInfoRequest = Convert.toGetInfoRequest(json); -// const getInfoResponse = Convert.toGetInfoResponse(json); -// const getOrCreateChannelRequest = Convert.toGetOrCreateChannelRequest(json); -// const getOrCreateChannelResponse = Convert.toGetOrCreateChannelResponse(json); -// const getUserChannelsRequest = Convert.toGetUserChannelsRequest(json); -// const getUserChannelsResponse = Convert.toGetUserChannelsResponse(json); -// const iframeChannelDrag = Convert.toIframeChannelDrag(json); -// const iframeChannelResize = Convert.toIframeChannelResize(json); -// const iframeChannelSelected = Convert.toIframeChannelSelected(json); -// const iframeChannels = Convert.toIframeChannels(json); -// const iframeHandshake = Convert.toIframeHandshake(json); -// const iframeHello = Convert.toIframeHello(json); -// const iframeMessage = Convert.toIframeMessage(json); -// const iframeResolve = Convert.toIframeResolve(json); -// const iframeResolveAction = Convert.toIframeResolveAction(json); -// const intentEvent = Convert.toIntentEvent(json); -// const intentListenerUnsubscribeRequest = Convert.toIntentListenerUnsubscribeRequest(json); -// const intentListenerUnsubscribeResponse = Convert.toIntentListenerUnsubscribeResponse(json); -// const intentResultRequest = Convert.toIntentResultRequest(json); -// const intentResultResponse = Convert.toIntentResultResponse(json); -// const joinUserChannelRequest = Convert.toJoinUserChannelRequest(json); -// const joinUserChannelResponse = Convert.toJoinUserChannelResponse(json); -// const leaveCurrentChannelRequest = Convert.toLeaveCurrentChannelRequest(json); -// const leaveCurrentChannelResponse = Convert.toLeaveCurrentChannelResponse(json); -// const openRequest = Convert.toOpenRequest(json); -// const openResponse = Convert.toOpenResponse(json); -// const privateChannelDisconnectRequest = Convert.toPrivateChannelDisconnectRequest(json); -// const privateChannelDisconnectResponse = Convert.toPrivateChannelDisconnectResponse(json); -// const privateChannelOnAddContextListenerEvent = Convert.toPrivateChannelOnAddContextListenerEvent(json); -// const privateChannelOnDisconnectEvent = Convert.toPrivateChannelOnDisconnectEvent(json); -// const privateChannelOnUnsubscribeEvent = Convert.toPrivateChannelOnUnsubscribeEvent(json); -// const privateChannelUnsubscribeEventListenerRequest = Convert.toPrivateChannelUnsubscribeEventListenerRequest(json); -// const privateChannelUnsubscribeEventListenerResponse = Convert.toPrivateChannelUnsubscribeEventListenerResponse(json); -// const privateChannelAddEventListenerRequest = Convert.toPrivateChannelAddEventListenerRequest(json); -// const privateChannelAddEventListenerResponse = Convert.toPrivateChannelAddEventListenerResponse(json); -// const raiseIntentForContextRequest = Convert.toRaiseIntentForContextRequest(json); -// const raiseIntentForContextResponse = Convert.toRaiseIntentForContextResponse(json); -// const raiseIntentRequest = Convert.toRaiseIntentRequest(json); -// const raiseIntentResponse = Convert.toRaiseIntentResponse(json); -// const raiseIntentResultResponse = Convert.toRaiseIntentResultResponse(json); -// -// These functions will throw an error if the JSON doesn't -// match the expected interface, even if the JSON is valid. - -/** - * Hello message sent by an application to a parent window or frame when attempting to - * establish connectivity to a Desktop Agent - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol1Hello { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: WebConnectionProtocol1HelloPayload; - /** - * Identifies the type of the connection step message. - */ - type: "WCP1Hello"; -} - -/** - * Metadata for this connection step message - */ -export interface ConnectionStepMetadata { - connectionAttemptUuid: string; - timestamp: Date; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface WebConnectionProtocol1HelloPayload { - /** - * A flag that may be used to indicate that a channel selector UI is or is not required. If - * the app includes its own UI for displaying - */ - channelSelector?: boolean; - /** - * The version of FDC3 API that the app supports. - */ - fdc3Version: string; - /** - * URL to use for the identity of the application. Desktop Agents MUST validate that the - * origin of the message matches the URL, but MAY implement custom comparison logic. - */ - identityUrl: string; - /** - * A flag that may be used to indicate that an intent resolver is or is not required. Set to - * false if no intents, or only targeted intents, are raised - */ - resolver?: boolean; - [property: string]: any; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Response from a Desktop Agent to an application requesting access to it indicating that - * it should load a specified URL into a hidden iframe in order to establish connectivity to - * a Desktop Agent - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol2LoadURL { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: WebConnectionProtocol2LoadURLPayload; - /** - * Identifies the type of the connection step message. - */ - type: "WCP2LoadUrl"; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface WebConnectionProtocol2LoadURLPayload { - /** - * A URL which can be used to establish communication with the Desktop Agent, via loading - * the URL into an iframe and restarting the Web Connection protocol with the iframe as the - * target - */ - iframeUrl: string; - [property: string]: any; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Handshake message sent by the Desktop Agent to the app (with a MessagePort appended) that - * should be used for subsequent communication steps. - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol3Handshake { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: WebConnectionProtocol3HandshakePayload; - /** - * Identifies the type of the connection step message. - */ - type: "WCP3Handshake"; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface WebConnectionProtocol3HandshakePayload { - /** - * Indicates whether a channel selector UI is required and the URL to use to do so. Set to - * `true` to use the default or `false` to disable the channel selector (as the Desktop - * Agent will handle another way) - */ - channelSelector: boolean | string; - /** - * The version of FDC3 API that the Desktop Agent will provide support for. - */ - fdc3Version: string; - /** - * Indicates whether an intent resolver UI is required and the URL to use to do so. Set to - * `true` to use the default or `false` to disable the intent resolver (as the Desktop Agent - * will handle another way) - */ - resolver: boolean | string; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Identity Validation request from an app attempting to connect to a Desktop Agent. - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol4ValidateAppIdentity { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: WebConnectionProtocol4ValidateAppIdentityPayload; - /** - * Identifies the type of the connection step message. - */ - type: "WCP4ValidateAppIdentity"; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface WebConnectionProtocol4ValidateAppIdentityPayload { - /** - * URL to use for the identity of the application. Desktop Agents MUST validate that the - * origin of the message matches the URL, but MAY implement custom comparison logic. - */ - identityUrl: string; - /** - * If an application has previously connected to the desktop agent, it may specify its prior - * instance id and associated instance UUID to request the same same instance Id be assigned. - */ - instanceId?: string; - /** - * Instance UUID associated with the requested instanceId. - */ - instanceUuid?: string; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Message sent by the Desktop Agent to an app if their identity validation fails. - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol5ValidateAppIdentityFailedResponse { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload; - /** - * Identifies the type of the connection step message. - */ - type: "WCP5ValidateAppIdentityFailedResponse"; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload { - message?: string; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Message sent by the Desktop Agent to an app after successful identity validation - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol5ValidateAppIdentitySuccessResponse { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload; - /** - * Identifies the type of the connection step message. - */ - type: "WCP5ValidateAppIdentityResponse"; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload { - /** - * The appId that the app's identity was validated against - */ - appId: string; - /** - * Implementation metadata for the Desktop Agent, which includes an appMetadata element - * containing a copy of the app's own metadata - */ - implementationMetadata: ImplementationMetadata; - /** - * The instance Id granted to the application by the Desktop Agent. - */ - instanceId: string; - /** - * Instance UUID associated with the instanceId granted, which may be used to retrieve the - * same instance Id if the app is reloaded or navigates. - */ - instanceUuid: string; -} - -/** - * Implementation metadata for the Desktop Agent, which includes an appMetadata element - * containing a copy of the app's own metadata - * - * Includes Metadata for the current application. - * - * Metadata relating to the FDC3 Desktop Agent implementation and its provider. - */ -export interface ImplementationMetadata { - /** - * The calling application instance's own metadata, according to the Desktop Agent (MUST - * include at least the `appId` and `instanceId`). - */ - appMetadata: AppMetadata; - /** - * The version number of the FDC3 specification that the implementation provides. - * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. - */ - fdc3Version: string; - /** - * Metadata indicating whether the Desktop Agent implements optional features of - * the Desktop Agent API. - */ - optionalFeatures: OptionalFeatures; - /** - * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, - * OpenFin etc.). - */ - provider: string; - /** - * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). - */ - providerVersion?: string; -} - -/** - * The calling application instance's own metadata, according to the Desktop Agent (MUST - * include at least the `appId` and `instanceId`). - * - * Extends an `AppIdentifier`, describing an application or instance of an application, with - * additional descriptive metadata that is usually provided by an FDC3 App Directory that - * the desktop agent connects to. - * - * The additional information from an app directory can aid in rendering UI elements, such - * as a launcher menu or resolver UI. This includes a title, description, tooltip and icon - * and screenshot URLs. - * - * Note that as `AppMetadata` instances are also `AppIdentifiers` they may be passed to the - * `app` argument of `fdc3.open`, `fdc3.raiseIntent` etc. - */ -export interface AppMetadata { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * A longer, multi-paragraph description for the application that could include markup - */ - description?: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent?: string; - /** - * A list of icon URLs for the application that can be used to render UI elements - */ - icons?: Icon[]; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - /** - * An optional set of, implementation specific, metadata fields that can be used to - * disambiguate instances, such as a window title or screen position. Must only be set if - * `instanceId` is set. - */ - instanceMetadata?: { [key: string]: any }; - /** - * The 'friendly' app name. - * This field was used with the `open` and `raiseIntent` calls in FDC3 <2.0, which now - * require an `AppIdentifier` wth `appId` set. - * Note that for display purposes the `title` field should be used, if set, in preference to - * this field. - */ - name?: string; - /** - * The type of output returned for any intent specified during resolution. May express a - * particular context type (e.g. "fdc3.instrument"), channel (e.g. "channel") or a channel - * that will receive a specified type (e.g. "channel"). - */ - resultType?: null | string; - /** - * Images representing the app in common usage scenarios that can be used to render UI - * elements - */ - screenshots?: Image[]; - /** - * A more user-friendly application title that can be used to render UI elements - */ - title?: string; - /** - * A tooltip for the application that can be used to render UI elements - */ - tooltip?: string; - /** - * The Version of the application. - */ - version?: string; -} - -/** - * SPDX-License-Identifier: Apache-2.0 - * Copyright FINOS FDC3 contributors - see NOTICE file - */ -export interface Icon { - /** - * The icon dimension, formatted as `x`. - */ - size?: string; - /** - * The icon url - */ - src: string; - /** - * Icon media type. If not present the Desktop Agent may use the src file extension. - */ - type?: string; -} - -/** - * SPDX-License-Identifier: Apache-2.0 - * Copyright FINOS FDC3 contributors - see NOTICE file - */ -export interface Image { - /** - * Caption for the image. - */ - label?: string; - /** - * The image dimension, formatted as `x`. - */ - size?: string; - /** - * The image url. - */ - src: string; - /** - * Image media type. If not present the Desktop Agent may use the src file extension. - */ - type?: string; -} - -/** - * Metadata indicating whether the Desktop Agent implements optional features of - * the Desktop Agent API. - */ -export interface OptionalFeatures { - /** - * Used to indicate whether the experimental Desktop Agent Bridging - * feature is implemented by the Desktop Agent. - */ - DesktopAgentBridging: boolean; - /** - * Used to indicate whether the exposure of 'originating app metadata' for - * context and intent messages is supported by the Desktop Agent. - */ - OriginatingAppMetadata: boolean; - /** - * Used to indicate whether the optional `fdc3.joinUserChannel`, - * `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by - * the Desktop Agent. - */ - UserChannelMembershipAPIs: boolean; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Goodbye message to be sent to the Desktop Agent when disconnecting (e.g. when closing the - * window or navigating). Desktop Agents should close the MessagePort after receiving this - * message, but retain instance details in case the application reconnects (e.g. after a - * navigation event). - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol6Goodbye { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the connection step message. - */ - type: "WCP6Goodbye"; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocolMessage { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the connection step message. - */ - type: ConnectionStepMessageType; -} - -/** - * Identifies the type of the connection step message. - */ -export type ConnectionStepMessageType = "WCP1Hello" | "WCP2LoadUrl" | "WCP3Handshake" | "WCP4ValidateAppIdentity" | "WCP5ValidateAppIdentityFailedResponse" | "WCP5ValidateAppIdentityResponse" | "WCP6Goodbye"; - -/** - * A request to add a context listener to a specified Channel OR to the current user - * channel. Where the listener is added to the current user channel (channelId == null), and - * this app has already been added to a user channel, client code should make a subsequent - * request to get the current context of that channel for this listener and then call its - * handler with it. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface AddContextListenerRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: AddContextListenerRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "addContextListenerRequest"; -} - -/** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ -export interface AddContextListenerRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that a request or response was received - * from. Please note that this may be set by an app or Desktop Agent proxy for debugging - * purposes but a Desktop Agent should make its own determination of the source of a message - * to avoid spoofing. - */ - source?: AppIdentifier; - timestamp: Date; -} - -/** - * Field that represents the source application that a request or response was received - * from. Please note that this may be set by an app or Desktop Agent proxy for debugging - * purposes but a Desktop Agent should make its own determination of the source of a message - * to avoid spoofing. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that the request being responded to was - * received from, for debugging purposes. - * - * Details of the application instance that broadcast the context - * - * The App resolution option chosen - * - * Details of the application instance that raised the intent - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface AppIdentifier { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface AddContextListenerRequestPayload { - /** - * The id of the channel to add the listener to or `null` indicating that it should listen - * to the current user channel (at the time of broadcast). - */ - channelId: null | string; - /** - * The type of context to listen for OR `null` indicating that it should listen to all - * context types. - */ - contextType: null | string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a addContextListener request. Where the listener was added to the current - * user channel (channelId == null), and this app has already been added to a user channel, - * client code should make a subsequent request to get the current context of that channel - * for this listener and then call its handler with it. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface AddContextListenerResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: AddContextListenerResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "addContextListenerResponse"; -} - -/** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ -export interface AddContextListenerResponseMeta { - requestUuid: string; - responseUuid: string; - /** - * Field that represents the source application that the request being responded to was - * received from, for debugging purposes. - */ - source?: AppIdentifier; - timestamp: Date; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface AddContextListenerResponsePayload { - error?: PurpleError; - listenerUUID?: string; -} - -/** - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type PurpleError = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * An event message from the Desktop Agent to an app for a specified event type. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface AddEventListenerEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: AddEventListenerEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "addEventListenerEvent"; -} - -/** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ -export interface AddEventListenerEventMeta { - eventUuid: string; - timestamp: Date; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface AddEventListenerEventPayload { - event: FDC3Event; -} - -/** - * An event object received via the FDC3 API's addEventListener function. Will always - * include both type and details, which describe type of the event and any additional - * details respectively. - */ -export interface FDC3Event { - /** - * Additional details of the event, such as the `currentChannelId` for a CHANNEL_CHANGED - * event - */ - details: { [key: string]: any }; - type: "USER_CHANNEL_CHANGED"; -} - -/** - * The type of a (non-context and non-intent) event that may be received via the FDC3 API's - * addEventListener function. - * - * The type of the event to be listened to. - */ - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to add an event listener for a specified event type to the DesktopAgent. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface AddEventListenerRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: AddEventListenerRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "addEventListenerRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface AddEventListenerRequestPayload { - /** - * The type of the event to be listened to. - */ - type: "USER_CHANNEL_CHANGED"; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to an addEventListener request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface AddEventListenerResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: AddEventListenerResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "addEventListenerResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface AddEventListenerResponsePayload { - error?: ResponsePayloadError; - listenerUUID?: string; -} - -/** - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type ResponsePayloadError = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to add an Intent listener for a specified intent type. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface AddIntentListenerRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: AddIntentListenerRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "addIntentListenerRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface AddIntentListenerRequestPayload { - /** - * The name of the intent to listen for. - */ - intent: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a addIntentListener request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface AddIntentListenerResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: AddIntentListenerResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "addIntentListenerResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface AddIntentListenerResponsePayload { - error?: FluffyError; - listenerUUID?: string; - [property: string]: any; -} - -/** - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type FluffyError = "MalformedContext" | "DesktopAgentNotFound" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface AgentEventMessage { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AgentEventMessageMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: EventMessageType; -} - -/** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ -export interface AgentEventMessageMeta { - eventUuid: string; - timestamp: Date; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ -export type EventMessageType = "intentEvent" | "broadcastEvent" | "channelChangedEvent" | "privateChannelOnAddContextListenerEvent" | "privateChannelOnDisconnectEvent" | "privateChannelOnUnsubscribeEvent" | "addEventListenerEvent"; - -/** - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface AgentResponseMessage { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AgentResponseMessageMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: AgentResponseMessageResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: ResponseMessageType; -} - -/** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ -export interface AgentResponseMessageMeta { - requestUuid: string; - responseUuid: string; - /** - * Field that represents the source application that the request being responded to was - * received from, for debugging purposes. - */ - source?: AppIdentifier; - timestamp: Date; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface AgentResponseMessageResponsePayload { - error?: ResponsePayloadError; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ -export type ResponseMessageType = "addContextListenerResponse" | "addEventListenerResponse" | "addIntentListenerResponse" | "broadcastResponse" | "contextListenerUnsubscribeResponse" | "createPrivateChannelResponse" | "eventListenerUnsubscribeResponse" | "findInstancesResponse" | "findIntentResponse" | "findIntentsByContextResponse" | "getAppMetadataResponse" | "getCurrentChannelResponse" | "getCurrentContextResponse" | "getInfoResponse" | "getOrCreateChannelResponse" | "getUserChannelsResponse" | "intentListenerUnsubscribeResponse" | "intentResultResponse" | "joinUserChannelResponse" | "leaveCurrentChannelResponse" | "openResponse" | "privateChannelAddEventListenerResponse" | "privateChannelDisconnectResponse" | "privateChannelUnsubscribeEventListenerResponse" | "raiseIntentForContextResponse" | "raiseIntentResponse" | "raiseIntentResultResponse"; - -/** - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface AppRequestMessage { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AppRequestMessageMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: RequestMessageType; -} - -/** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ -export interface AppRequestMessageMeta { - requestUuid: string; - /** - * Field that represents the source application that a request or response was received - * from. Please note that this may be set by an app or Desktop Agent proxy for debugging - * purposes but a Desktop Agent should make its own determination of the source of a message - * to avoid spoofing. - */ - source?: AppIdentifier; - timestamp: Date; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ -export type RequestMessageType = "addContextListenerRequest" | "addEventListenerRequest" | "addIntentListenerRequest" | "broadcastRequest" | "contextListenerUnsubscribeRequest" | "createPrivateChannelRequest" | "eventListenerUnsubscribeRequest" | "findInstancesRequest" | "findIntentRequest" | "findIntentsByContextRequest" | "getAppMetadataRequest" | "getCurrentChannelRequest" | "getCurrentContextRequest" | "getInfoRequest" | "getOrCreateChannelRequest" | "getUserChannelsRequest" | "intentListenerUnsubscribeRequest" | "intentResultRequest" | "joinUserChannelRequest" | "leaveCurrentChannelRequest" | "openRequest" | "privateChannelAddEventListenerRequest" | "privateChannelDisconnectRequest" | "privateChannelUnsubscribeEventListenerRequest" | "raiseIntentForContextRequest" | "raiseIntentRequest"; - -/** - * An event message from the Desktop Agent to an app indicating that context has been - * broadcast on a channel it is listening to, or specifically to this app instance if it was - * launched via `fdc3.open` and context was passed. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface BroadcastEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: BroadcastEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "broadcastEvent"; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface BroadcastEventPayload { - /** - * The Id of the channel that the broadcast was sent on. May be `null` if the context is - * being broadcast due to a call `fdc3.open` that passed context. - */ - channelId: null | string; - /** - * The context object that was broadcast. - */ - context: Context; - /** - * Details of the application instance that broadcast the context - */ - originatingApp?: AppIdentifier; -} - -/** - * The context object that was broadcast. - * - * The context object that is to be broadcast. - * - * The context object passed with the raised intent. - * - * If a Context object is passed in, this object will be provided to the opened application - * via a contextListener. The Context argument is functionally equivalent to opening the - * target app with no context and broadcasting the context directly to it. - * - * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by - * FDC3 operations. As such, it is not really meant to be used on its own, but is imported - * by more specific type definitions (standardized or custom) to provide the structure and - * properties shared by all FDC3 context data types. - * - * The key element of FDC3 context types is their mandatory `type` property, which is used - * to identify what type of data the object represents, and what shape it has. - * - * The FDC3 context type, and all derived types, define the minimum set of fields a context - * data object of a particular type can be expected to have, but this can always be extended - * with custom fields as appropriate. - */ -export interface Context { - /** - * Context data objects may include a set of equivalent key-value pairs that can be used to - * help applications identify and look up the context type they receive in their own domain. - * The idea behind this design is that applications can provide as many equivalent - * identifiers to a target application as possible, e.g. an instrument may be represented by - * an ISIN, CUSIP or Bloomberg identifier. - * - * Identifiers do not make sense for all types of data, so the `id` property is therefore - * optional, but some derived types may choose to require at least one identifier. - * Identifier values SHOULD always be of type string. - */ - id?: { [key: string]: any }; - /** - * Context data objects may include a name property that can be used for more information, - * or display purposes. Some derived types may require the name object as mandatory, - * depending on use case. - */ - name?: string; - /** - * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 - * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present - * to route shared context data appropriately. - * - * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data - * types they support in an FDC3 [App - * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery - * and routing. - * - * Standardized FDC3 context types have well-known `type` properties prefixed with the - * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and - * used by a particular organization, the convention is to prefix them with an - * organization-specific namespace, e.g. `blackrock.fund`. - * - * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more - * information about context data types. - */ - type: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to broadcast context on a channel. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface BroadcastRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: BroadcastRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "broadcastRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface BroadcastRequestPayload { - /** - * The Id of the Channel that the broadcast was sent on - */ - channelId: string; - /** - * The context object that is to be broadcast. - */ - context: Context; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a request to broadcast context on a channel. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface BroadcastResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: BroadcastResponseResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "broadcastResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface BroadcastResponseResponsePayload { - error?: ResponsePayloadError; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * An event message from the Desktop Agent to an app indicating that its current user - * channel has changed. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface ChannelChangedEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: ChannelChangedEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "channelChangedEvent"; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface ChannelChangedEventPayload { - /** - * The Id of the channel that the app was added to or `null` if it was removed from a - * channel. - */ - newChannelId: null | string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to unsubscribe a context listener. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface ContextListenerUnsubscribeRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: ContextListenerUnsubscribeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "contextListenerUnsubscribeRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface ContextListenerUnsubscribeRequestPayload { - listenerUUID: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a contextListenerUnsubscribe request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface ContextListenerUnsubscribeResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: BroadcastResponseResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "contextListenerUnsubscribeResponse"; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request to return a Channel with an auto-generated identity that is intended for private - * communication between applications. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface CreatePrivateChannelRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: CreatePrivateChannelRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "createPrivateChannelRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface CreatePrivateChannelRequestPayload { -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a createPrivateChannel request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface CreatePrivateChannelResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: CreatePrivateChannelResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "createPrivateChannelResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface CreatePrivateChannelResponsePayload { - error?: PurpleError; - privateChannel?: Channel; -} - -/** - * Represents a context channel that applications can use to send and receive - * context data. - * - * Please note that There are differences in behavior when you interact with a - * User channel via the `DesktopAgent` interface and the `Channel` interface. - * Specifically, when 'joining' a User channel or adding a context listener - * when already joined to a channel via the `DesktopAgent` interface, existing - * context (matching the type of the context listener) on the channel is - * received by the context listener immediately. Whereas, when a context - * listener is added via the Channel interface, context is not received - * automatically, but may be retrieved manually via the `getCurrentContext()` - * function. - */ -export interface Channel { - /** - * Channels may be visualized and selectable by users. DisplayMetadata may be used to - * provide hints on how to see them. - * For App channels, displayMetadata would typically not be present. - */ - displayMetadata?: DisplayMetadata; - /** - * Constant that uniquely identifies this channel. - */ - id: string; - /** - * Uniquely defines each channel type. - * Can be "user", "app" or "private". - */ - type: Type; -} - -/** - * Channels may be visualized and selectable by users. DisplayMetadata may be used to - * provide hints on how to see them. - * For App channels, displayMetadata would typically not be present. - * - * A system channel will be global enough to have a presence across many apps. This gives us - * some hints - * to render them in a standard way. It is assumed it may have other properties too, but if - * it has these, - * this is their meaning. - */ -export interface DisplayMetadata { - /** - * The color that should be associated within this channel when displaying this channel in a - * UI, e.g: `0xFF0000`. - */ - color?: string; - /** - * A URL of an image that can be used to display this channel - */ - glyph?: string; - /** - * A user-readable name for this channel, e.g: `"Red"` - */ - name?: string; -} - -/** - * Uniquely defines each channel type. - * Can be "user", "app" or "private". - */ -export type Type = "app" | "private" | "user"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to unsubscribe an event listener. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface EventListenerUnsubscribeRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: EventListenerUnsubscribeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "eventListenerUnsubscribeRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface EventListenerUnsubscribeRequestPayload { - listenerUUID: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to an eventListenerUnsubscribe request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface EventListenerUnsubscribeResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: BroadcastResponseResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "eventListenerUnsubscribeResponse"; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request for details of instances of a particular app. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface FindInstancesRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindInstancesRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findInstancesRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindInstancesRequestPayload { - app: AppIdentifier; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a findInstances request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface FindInstancesResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: FindInstancesResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findInstancesResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - * - * The message payload contains a flag indicating whether the API call was successful, plus - * any return values for the FDC3 API function called, or indicating that the request - * resulted in an error and including a standardized error message. - */ -export interface FindInstancesResponsePayload { - error?: FindInstancesErrors; - appIdentifiers?: AppMetadata[]; -} - -/** - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - * - * Unique identifier for a for an attempt to connect to a Desktop Agent - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - * - * Unique identifier for a `listener` object returned by a Desktop Agent to an app in - * response to addContextListener, addIntentListener or one of the PrivateChannel event - * listeners and used to identify it in messages (e.g. when unsubscribing). - * - * Should be set if the raiseIntent request returned an error. - */ -export type FindInstancesErrors = "MalformedContext" | "DesktopAgentNotFound" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request for details of apps available to resolve a particular intent and context pair. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface FindIntentRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindIntentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findIntentRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindIntentRequestPayload { - context?: Context; - intent: string; - resultType?: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a findIntent request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface FindIntentResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: FindIntentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface FindIntentResponsePayload { - error?: FindInstancesErrors; - appIntent?: AppIntent; -} - -/** - * An interface that relates an intent to apps - * - * Used if a raiseIntent request requires additional resolution (e.g. by showing an intent - * resolver) before it can be handled. - */ -export interface AppIntent { - /** - * Details of applications that can resolve the intent. - */ - apps: AppMetadata[]; - /** - * Details of the intent whose relationship to resolving applications is being described. - */ - intent: IntentMetadata; -} - -/** - * Details of the intent whose relationship to resolving applications is being described. - * - * Intent descriptor - */ -export interface IntentMetadata { - /** - * Display name for the intent. - */ - displayName?: string; - /** - * The unique name of the intent that can be invoked by the raiseIntent call - */ - name: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request for details of intents and apps available to resolve them for a particular - * context. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface FindIntentsByContextRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindIntentsByContextRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findIntentsByContextRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindIntentsByContextRequestPayload { - context: Context; - resultType?: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a findIntentsByContext request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface FindIntentsByContextResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: FindIntentsByContextResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentsByContextResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface FindIntentsByContextResponsePayload { - error?: FindInstancesErrors; - appIntents?: AppIntent[]; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request for metadata about an app. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface GetAppMetadataRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetAppMetadataRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getAppMetadataRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetAppMetadataRequestPayload { - app: AppIdentifier; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a getAppMetadata request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface GetAppMetadataResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: GetAppMetadataResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getAppMetadataResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface GetAppMetadataResponsePayload { - error?: FindInstancesErrors; - appMetadata?: AppMetadata; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to return the Channel object for the current User channel membership. Returns - * `null` if the app is not joined to a channel. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface GetCurrentChannelRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetCurrentChannelRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getCurrentChannelRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetCurrentChannelRequestPayload { -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a getCurrentChannel request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface GetCurrentChannelResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: GetCurrentChannelResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getCurrentChannelResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface GetCurrentChannelResponsePayload { - error?: ResponsePayloadError; - channel?: Channel | null; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to return the current context (either of a specified type or most recent - * broadcast) of a specified Channel. Returns `null` if no context (of the requested type if - * one was specified) is available in the channel. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface GetCurrentContextRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetCurrentContextRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getCurrentContextRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetCurrentContextRequestPayload { - /** - * The id of the channel to return the current context of - */ - channelId: string; - /** - * The type of context to return for OR `null` indicating that the most recently broadcast - * context on the channel should be returned. - */ - contextType: null | string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a getCurrentContext request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface GetCurrentContextResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: GetCurrentContextResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getCurrentContextResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface GetCurrentContextResponsePayload { - error?: PurpleError; - /** - * The most recently broadcast context object (of the specified type, if one was specified), - * or `null` if none was available in the channel - */ - context?: null | Context; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request to retrieve information about the FDC3 Desktop Agent implementation and the - * metadata of the calling application according to the desktop agent. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface GetInfoRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetInfoRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getInfoRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetInfoRequestPayload { -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a getInfo request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface GetInfoResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: GetInfoResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getInfoResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface GetInfoResponsePayload { - error?: ResponsePayloadError; - implementationMetadata?: ImplementationMetadata; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request to return a Channel with an auto-generated identity that is intended for private - * communication between applications. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface GetOrCreateChannelRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetOrCreateChannelRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getOrCreateChannelRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetOrCreateChannelRequestPayload { - /** - * The id of the channel to return - */ - channelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a getOrCreateChannel request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface GetOrCreateChannelResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: GetOrCreateChannelResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getOrCreateChannelResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface GetOrCreateChannelResponsePayload { - error?: PurpleError; - channel?: Channel; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request to retrieve a list of the User Channels available for the app to join. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface GetUserChannelsRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetUserChannelsRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getUserChannelsRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetUserChannelsRequestPayload { -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a getUserChannels request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface GetUserChannelsResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: GetUserChannelsResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getUserChannelsResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface GetUserChannelsResponsePayload { - error?: PurpleError; - userChannels?: Channel[]; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Message from the channel selector UI to the DA proxy when the user drags the selector to - * a new location. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeChannelDrag { - /** - * The message payload - */ - payload: IframeChannelDragPayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeChannelDrag"; -} - -/** - * The message payload - */ -export interface IframeChannelDragPayload { - /** - * The offset to move the frame by - */ - mouse: MouseClass; -} - -/** - * The offset to move the frame by - */ -export interface MouseClass { - offsetX: number; - offsetY: number; -} - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * Message from the channel selector UI to the DA proxy when the user hits a toggle button - * that opens or closes the selector or otherwise resizes it. Includes the size that it - * should change to and the corner (if any) at which the change should be made. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeChannelResize { - /** - * The message payload - */ - payload: IframeChannelResizePayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeChannelResize"; -} - -/** - * The message payload - */ -export interface IframeChannelResizePayload { - /** - * The updated dimensions of the UI - */ - dimensions: DimensionsClass; - /** - * When resizing anchor at the indicated location, - * e.g. - * - for top-left and a larger size: the bottom right corner should move down and out. - * - for top and smaller size: both the bottom corners should move in and up. - */ - resizeAnchor: Resizing; -} - -/** - * The updated dimensions of the UI - */ -export interface DimensionsClass { - height: number; - width: number; -} - -/** - * When resizing anchor at the indicated location, - * e.g. - * - for top-left and a larger size: the bottom right corner should move down and out. - * - for top and smaller size: both the bottom corners should move in and up. - */ -export type Resizing = "top-left" | "top" | "top-right" | "right" | "bottom-right" | "bottom" | "bottom-left" | "left" | "center"; - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * Message from the channel selector UI to the DA proxy sent when the channel selection - * changes. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeChannelSelected { - /** - * The message payload - */ - payload: IframeChannelSelectedPayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeChannelSelected"; -} - -/** - * The message payload - */ -export interface IframeChannelSelectedPayload { - /** - * The id of the channel that should be currently selected, or `null` if none should be - * selected - */ - selected: null | string; -} - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * Setup message sent by the DA proxy code in getAgent() to a channel selector UI in an - * iframe with the channel definitions and current channel selection. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeChannels { - /** - * The message payload - */ - payload: IframeChannelsPayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeChannels"; -} - -/** - * The message payload - */ -export interface IframeChannelsPayload { - /** - * If the channel selector was previously displayed in this window its location may be - * restored by setting the location coordinates - */ - location?: Location; - /** - * The id of the channel that should be currently selected, or `null` if none should be - * selected - */ - selected: null | string; - /** - * User Channel definitions - */ - userChannels: Channel[]; -} - -/** - * If the channel selector was previously displayed in this window its location may be - * restored by setting the location coordinates - */ -export interface Location { - x: number; - y: number; -} - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * Handshake message sent back by an iframe to the DA proxy code indicating that it is setup - * and ready to communicate over the MessagePort. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeHandshake { - /** - * The message payload - */ - payload: IframeHandshakePayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeHandshake"; -} - -/** - * The message payload - */ -export interface IframeHandshakePayload { - /** - * Details about the UI implementation in the iframe, such as vendor and version, for - * logging purposes. - */ - implementationDetails: string; -} - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * Hello message sent by the DA proxy code in getAgent() to an iframe, that it has injected - * into the page, with a MessagePort appended that should be used for subsequent - * communication steps. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeHello { - /** - * The message payload - */ - payload: IframeHelloPayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeHello"; -} - -/** - * The message payload - */ -export interface IframeHelloPayload { - /** - * The version of FDC3 API that the Desktop Agent proxy is providing support for. - */ - fdc3Version: string; -} - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeMessage { - /** - * The message payload - */ - payload?: { [key: string]: any }; - /** - * Identifies the type of the message to or from the iframe. - */ - type: IframeMessageType; -} - -/** - * Identifies the type of the message to or from the iframe. - */ -export type IframeMessageType = "iframeHello" | "iframeHandshake" | "iframeResolve" | "iframeResolveAction" | "iframeChannels" | "iframeChannelSelected" | "iframeChannelResize" | "iframeChannelDrag"; - -/** - * Setup message sent by the DA proxy code in getAgent() to an intent resolver UI in an - * iframe with the resolver data to setup the UI. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeResolve { - /** - * The message payload - */ - payload: IframeResolvePayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeResolve"; -} - -/** - * The message payload - */ -export interface IframeResolvePayload { - /** - * An array of AppIntent objects defining the resolution options. - */ - appIntents: AppIntent[]; - context: Context; -} - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * Message from an intent resolver UI in an iframe to DA proxy code in getAgent() reporting - * a user action. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeResolveAction { - /** - * The message payload - */ - payload: IframeResolveActionPayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeResolveAction"; -} - -/** - * The message payload - */ -export interface IframeResolveActionPayload { - action: Action; - /** - * The App resolution option chosen - */ - appIdentifier?: AppIdentifier; - /** - * The intent resolved - */ - intent?: string; -} - -export type Action = "hover" | "click" | "cancel"; - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * An event message from the Desktop Agent to an app indicating that it has been selected to - * resolve a raised intent and context. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface IntentEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: IntentEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "intentEvent"; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface IntentEventPayload { - /** - * The context object passed with the raised intent. - */ - context: Context; - /** - * The intent that was raised. - */ - intent: string; - /** - * Details of the application instance that raised the intent - */ - originatingApp?: AppIdentifier; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to unsubscribe a context listener. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface IntentListenerUnsubscribeRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: IntentListenerUnsubscribeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "intentListenerUnsubscribeRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface IntentListenerUnsubscribeRequestPayload { - listenerUUID: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a intentListenerUnsubscribe request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface IntentListenerUnsubscribeResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: BroadcastResponseResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "intentListenerUnsubscribeResponse"; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to deliver a result for an intent (which may include a `void` result that just - * indicates that the handler has run, returning no result). - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface IntentResultRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: IntentResultRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "intentResultRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface IntentResultRequestPayload { - intentResult: PurpleIntentResult; -} - -export interface PurpleIntentResult { - context?: Context; - channel?: Channel; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a request to deliver an intent result. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface IntentResultResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: BroadcastResponseResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "intentResultResponse"; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request to join the app to the specified User channel. On successfully joining a channel, - * client code should make subsequent requests to get the current context of that channel - * for all registered context listeners and then call their handlers with it. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface JoinUserChannelRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: JoinUserChannelRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "joinUserChannelRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface JoinUserChannelRequestPayload { - /** - * The id of the channel to join - */ - channelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a joinUserChannel request. On receipt of this response, client code should - * make subsequent requests to get the current context of that channel for all registered - * context listeners and then call their handlers with it. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface JoinUserChannelResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: JoinUserChannelResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "joinUserChannelResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface JoinUserChannelResponsePayload { - error?: PurpleError; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request to remove the app from any User channel membership. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface LeaveCurrentChannelRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: LeaveCurrentChannelRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "leaveCurrentChannelRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface LeaveCurrentChannelRequestPayload { -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a leaveCurrentChannel request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface LeaveCurrentChannelResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: LeaveCurrentChannelResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "leaveCurrentChannelResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface LeaveCurrentChannelResponsePayload { - error?: PurpleError; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to open an application. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface OpenRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: OpenRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "openRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface OpenRequestPayload { - app: AppIdentifier; - /** - * If a Context object is passed in, this object will be provided to the opened application - * via a contextListener. The Context argument is functionally equivalent to opening the - * target app with no context and broadcasting the context directly to it. - */ - context?: Context; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a open request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface OpenResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: OpenResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "openResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface OpenResponsePayload { - error?: OpenErrorResponsePayload; - appIdentifier?: AppIdentifier; -} - -/** - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type OpenErrorResponsePayload = "MalformedContext" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request that indicates that a participant will no longer interact with a specified - * `PrivateChannel`. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface PrivateChannelDisconnectRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelDisconnectRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "privateChannelDisconnectRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelDisconnectRequestPayload { - /** - * The Id of the Channel that should be disconnected from - */ - channelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a privateChannelDisconnect request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface PrivateChannelDisconnectResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: PrivateChannelDisconnectResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "privateChannelDisconnectResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface PrivateChannelDisconnectResponsePayload { - error?: PurpleError; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * An event message from the Desktop Agent to an app indicating that another app has added a - * context listener to a specific PrivateChannel. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface PrivateChannelOnAddContextListenerEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: PrivateChannelOnAddContextListenerEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "privateChannelOnAddContextListenerEvent"; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface PrivateChannelOnAddContextListenerEventPayload { - /** - * The type of the context listener added to the channel by another app, or null if it will - * listen to all types. - */ - contextType: null | string; - /** - * The Id of the PrivateChannel that the listener was added to. - */ - privateChannelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * An event message from the Desktop Agent to an app indicating that another app has - * disconnected from a specific PrivateChannel and will no longer interact with it. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface PrivateChannelOnDisconnectEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: PrivateChannelOnDisconnectEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "privateChannelOnDisconnectEvent"; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface PrivateChannelOnDisconnectEventPayload { - /** - * The Id of the PrivateChannel that the app has disconnected from. - */ - privateChannelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * An event message from the Desktop Agent to an app indicating that another app has - * unsubscribed a context listener from a specific PrivateChannel. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface PrivateChannelOnUnsubscribeEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: PrivateChannelOnUnsubscribeEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "privateChannelOnUnsubscribeEvent"; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface PrivateChannelOnUnsubscribeEventPayload { - /** - * The type of the context listener unsubscribed from the channel by another app, or null if - * it was listening to all types. - */ - contextType: null | string; - /** - * The Id of the PrivateChannel that the listener was unsubscribed from. - */ - privateChannelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to unsubscribe a context listener. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface PrivateChannelUnsubscribeEventListenerRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelUnsubscribeEventListenerRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "privateChannelUnsubscribeEventListenerRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelUnsubscribeEventListenerRequestPayload { - listenerUUID: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a privateChannelUnsubscribeEventListener request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface PrivateChannelUnsubscribeEventListenerResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: BroadcastResponseResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "privateChannelUnsubscribeEventListenerResponse"; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to add an event listener to a specific PrivateChannel. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface PrivateChannelAddEventListenerRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: TPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "privateChannelAddEventListenerRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface TPayload { - /** - * The type of PrivateChannel event that the listener should be applied to. - */ - listenerType: PrivateChannelEventListenerTypes; - /** - * The Id of the PrivateChannel that the listener should be added to. - */ - privateChannelId: string; -} - -/** - * The type of PrivateChannel event that the listener should be applied to. - * - * Event listener type names for Private Channel events - */ -export type PrivateChannelEventListenerTypes = "onAddContextListener" | "onUnsubscribe" | "onDisconnect"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a privateChannelAddEventListener request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface PrivateChannelAddEventListenerResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: PrivateChannelAddEventListenerResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "privateChannelAddEventListenerResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface PrivateChannelAddEventListenerResponsePayload { - error?: PurpleError; - listenerUUID?: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to raise an unspecified intent for a specified context. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface RaiseIntentForContextRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: RaiseIntentForContextRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "raiseIntentForContextRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface RaiseIntentForContextRequestPayload { - app?: AppIdentifier; - context: Context; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a raiseIntentForContext request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface RaiseIntentForContextResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - * - * There are 3 possible responses to a raiseIntentForContext request, each of which sets a - * single property in the payload: Success (`intentResolution`), Needs further resolution - * (`appIntents`) or Error (`error`). - */ - payload: RaiseIntentForContextResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentForContextResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - * - * There are 3 possible responses to a raiseIntentForContext request, each of which sets a - * single property in the payload: Success (`intentResolution`), Needs further resolution - * (`appIntents`) or Error (`error`). - * - * Response to a raiseIntentForContext request that needs additional resolution (i.e. show - * an intent resolver UI) - * - * Used if a raiseIntent request resulted in an error - */ -export interface RaiseIntentForContextResponsePayload { - /** - * Should be set if the raiseIntent request returned an error. - */ - error?: FindInstancesErrors; - /** - * Used if the raiseIntent request was successfully resolved - */ - intentResolution?: IntentResolution; - /** - * Used if a raiseIntentForContext request requires additional resolution (e.g. by showing - * an intent resolver) before it can be handled. - */ - appIntents?: AppIntent[]; -} - -/** - * Used if the raiseIntent request was successfully resolved - * - * IntentResolution provides a standard format for data returned upon resolving an intent. - * - * ```javascript - * //resolve a "Chain" type intent - * let resolution = await agent.raiseIntent("intentName", context); - * - * //resolve a "Client-Service" type intent with a data response or a Channel - * let resolution = await agent.raiseIntent("intentName", context); - * try { - * const result = await resolution.getResult(); - * if (result && result.broadcast) { - * console.log(`${resolution.source} returned a channel with id ${result.id}`); - * } else if (result){ - * console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`); - * } else { - * console.error(`${resolution.source} didn't return data` - * } - * } catch(error) { - * console.error(`${resolution.source} returned an error: ${error}`); - * } - * - * // Use metadata about the resolving app instance to target a further intent - * await agent.raiseIntent("intentName", context, resolution.source); - * ``` - */ -export interface IntentResolution { - /** - * The intent that was raised. May be used to determine which intent the user - * chose in response to `fdc3.raiseIntentForContext()`. - */ - intent: string; - /** - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ - source: AppIdentifier; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to raise an intent for a context. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface RaiseIntentRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: RaiseIntentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "raiseIntentRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface RaiseIntentRequestPayload { - app?: AppIdentifier; - context: Context; - intent: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a raiseIntent request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface RaiseIntentResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - * - * There are 3 possible responses to a raiseIntent request, each of which sets a single - * property in the payload: Success (`intentResolution`), Needs further resolution - * (`appIntent`) or Error (`error`). - */ - payload: RaiseIntentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - * - * There are 3 possible responses to a raiseIntent request, each of which sets a single - * property in the payload: Success (`intentResolution`), Needs further resolution - * (`appIntent`) or Error (`error`). - * - * Response to a raiseIntent request that needs additional resolution (i.e. show an intent - * resolver UI). - * - * Used if a raiseIntent request resulted in an error - */ -export interface RaiseIntentResponsePayload { - /** - * Should be set if the raiseIntent request returned an error. - */ - error?: FindInstancesErrors; - /** - * Used if the raiseIntent request was successfully resolved - */ - intentResolution?: IntentResolution; - /** - * Used if a raiseIntent request requires additional resolution (e.g. by showing an intent - * resolver) before it can be handled. - */ - appIntent?: AppIntent; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A secondary response to a request to raise an intent used to deliver the intent result. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface RaiseIntentResultResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: RaiseIntentResultResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResultResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface RaiseIntentResultResponsePayload { - error?: ResponsePayloadError; - intentResult?: FluffyIntentResult; -} - -export interface FluffyIntentResult { - context?: Context; - channel?: Channel; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -// Converts JSON strings to/from your types -// and asserts the results of JSON.parse at runtime -export class Convert { - public static toWebConnectionProtocol1Hello(json: string): WebConnectionProtocol1Hello { - return cast(JSON.parse(json), r("WebConnectionProtocol1Hello")); - } - - public static webConnectionProtocol1HelloToJson(value: WebConnectionProtocol1Hello): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol1Hello")), null, 2); - } - - public static toWebConnectionProtocol2LoadURL(json: string): WebConnectionProtocol2LoadURL { - return cast(JSON.parse(json), r("WebConnectionProtocol2LoadURL")); - } - - public static webConnectionProtocol2LoadURLToJson(value: WebConnectionProtocol2LoadURL): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol2LoadURL")), null, 2); - } - - public static toWebConnectionProtocol3Handshake(json: string): WebConnectionProtocol3Handshake { - return cast(JSON.parse(json), r("WebConnectionProtocol3Handshake")); - } - - public static webConnectionProtocol3HandshakeToJson(value: WebConnectionProtocol3Handshake): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol3Handshake")), null, 2); - } - - public static toWebConnectionProtocol4ValidateAppIdentity(json: string): WebConnectionProtocol4ValidateAppIdentity { - return cast(JSON.parse(json), r("WebConnectionProtocol4ValidateAppIdentity")); - } - - public static webConnectionProtocol4ValidateAppIdentityToJson(value: WebConnectionProtocol4ValidateAppIdentity): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol4ValidateAppIdentity")), null, 2); - } - - public static toWebConnectionProtocol5ValidateAppIdentityFailedResponse(json: string): WebConnectionProtocol5ValidateAppIdentityFailedResponse { - return cast(JSON.parse(json), r("WebConnectionProtocol5ValidateAppIdentityFailedResponse")); - } - - public static webConnectionProtocol5ValidateAppIdentityFailedResponseToJson(value: WebConnectionProtocol5ValidateAppIdentityFailedResponse): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol5ValidateAppIdentityFailedResponse")), null, 2); - } - - public static toWebConnectionProtocol5ValidateAppIdentitySuccessResponse(json: string): WebConnectionProtocol5ValidateAppIdentitySuccessResponse { - return cast(JSON.parse(json), r("WebConnectionProtocol5ValidateAppIdentitySuccessResponse")); - } - - public static webConnectionProtocol5ValidateAppIdentitySuccessResponseToJson(value: WebConnectionProtocol5ValidateAppIdentitySuccessResponse): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol5ValidateAppIdentitySuccessResponse")), null, 2); - } - - public static toWebConnectionProtocol6Goodbye(json: string): WebConnectionProtocol6Goodbye { - return cast(JSON.parse(json), r("WebConnectionProtocol6Goodbye")); - } - - public static webConnectionProtocol6GoodbyeToJson(value: WebConnectionProtocol6Goodbye): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol6Goodbye")), null, 2); - } - - public static toWebConnectionProtocolMessage(json: string): WebConnectionProtocolMessage { - return cast(JSON.parse(json), r("WebConnectionProtocolMessage")); - } - - public static webConnectionProtocolMessageToJson(value: WebConnectionProtocolMessage): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocolMessage")), null, 2); - } - - public static toAddContextListenerRequest(json: string): AddContextListenerRequest { - return cast(JSON.parse(json), r("AddContextListenerRequest")); - } - - public static addContextListenerRequestToJson(value: AddContextListenerRequest): string { - return JSON.stringify(uncast(value, r("AddContextListenerRequest")), null, 2); - } - - public static toAddContextListenerResponse(json: string): AddContextListenerResponse { - return cast(JSON.parse(json), r("AddContextListenerResponse")); - } - - public static addContextListenerResponseToJson(value: AddContextListenerResponse): string { - return JSON.stringify(uncast(value, r("AddContextListenerResponse")), null, 2); - } - - public static toAddEventListenerEvent(json: string): AddEventListenerEvent { - return cast(JSON.parse(json), r("AddEventListenerEvent")); - } - - public static addEventListenerEventToJson(value: AddEventListenerEvent): string { - return JSON.stringify(uncast(value, r("AddEventListenerEvent")), null, 2); - } - - public static toAddEventListenerRequest(json: string): AddEventListenerRequest { - return cast(JSON.parse(json), r("AddEventListenerRequest")); - } - - public static addEventListenerRequestToJson(value: AddEventListenerRequest): string { - return JSON.stringify(uncast(value, r("AddEventListenerRequest")), null, 2); - } - - public static toAddEventListenerResponse(json: string): AddEventListenerResponse { - return cast(JSON.parse(json), r("AddEventListenerResponse")); - } - - public static addEventListenerResponseToJson(value: AddEventListenerResponse): string { - return JSON.stringify(uncast(value, r("AddEventListenerResponse")), null, 2); - } - - public static toAddIntentListenerRequest(json: string): AddIntentListenerRequest { - return cast(JSON.parse(json), r("AddIntentListenerRequest")); - } - - public static addIntentListenerRequestToJson(value: AddIntentListenerRequest): string { - return JSON.stringify(uncast(value, r("AddIntentListenerRequest")), null, 2); - } - - public static toAddIntentListenerResponse(json: string): AddIntentListenerResponse { - return cast(JSON.parse(json), r("AddIntentListenerResponse")); - } - - public static addIntentListenerResponseToJson(value: AddIntentListenerResponse): string { - return JSON.stringify(uncast(value, r("AddIntentListenerResponse")), null, 2); - } - - public static toAgentEventMessage(json: string): AgentEventMessage { - return cast(JSON.parse(json), r("AgentEventMessage")); - } - - public static agentEventMessageToJson(value: AgentEventMessage): string { - return JSON.stringify(uncast(value, r("AgentEventMessage")), null, 2); - } - - public static toAgentResponseMessage(json: string): AgentResponseMessage { - return cast(JSON.parse(json), r("AgentResponseMessage")); - } - - public static agentResponseMessageToJson(value: AgentResponseMessage): string { - return JSON.stringify(uncast(value, r("AgentResponseMessage")), null, 2); - } - - public static toAppRequestMessage(json: string): AppRequestMessage { - return cast(JSON.parse(json), r("AppRequestMessage")); - } - - public static appRequestMessageToJson(value: AppRequestMessage): string { - return JSON.stringify(uncast(value, r("AppRequestMessage")), null, 2); - } - - public static toBroadcastEvent(json: string): BroadcastEvent { - return cast(JSON.parse(json), r("BroadcastEvent")); - } - - public static broadcastEventToJson(value: BroadcastEvent): string { - return JSON.stringify(uncast(value, r("BroadcastEvent")), null, 2); - } - - public static toBroadcastRequest(json: string): BroadcastRequest { - return cast(JSON.parse(json), r("BroadcastRequest")); - } - - public static broadcastRequestToJson(value: BroadcastRequest): string { - return JSON.stringify(uncast(value, r("BroadcastRequest")), null, 2); - } - - public static toBroadcastResponse(json: string): BroadcastResponse { - return cast(JSON.parse(json), r("BroadcastResponse")); - } - - public static broadcastResponseToJson(value: BroadcastResponse): string { - return JSON.stringify(uncast(value, r("BroadcastResponse")), null, 2); - } - - public static toChannelChangedEvent(json: string): ChannelChangedEvent { - return cast(JSON.parse(json), r("ChannelChangedEvent")); - } - - public static channelChangedEventToJson(value: ChannelChangedEvent): string { - return JSON.stringify(uncast(value, r("ChannelChangedEvent")), null, 2); - } - - public static toContextListenerUnsubscribeRequest(json: string): ContextListenerUnsubscribeRequest { - return cast(JSON.parse(json), r("ContextListenerUnsubscribeRequest")); - } - - public static contextListenerUnsubscribeRequestToJson(value: ContextListenerUnsubscribeRequest): string { - return JSON.stringify(uncast(value, r("ContextListenerUnsubscribeRequest")), null, 2); - } - - public static toContextListenerUnsubscribeResponse(json: string): ContextListenerUnsubscribeResponse { - return cast(JSON.parse(json), r("ContextListenerUnsubscribeResponse")); - } - - public static contextListenerUnsubscribeResponseToJson(value: ContextListenerUnsubscribeResponse): string { - return JSON.stringify(uncast(value, r("ContextListenerUnsubscribeResponse")), null, 2); - } - - public static toCreatePrivateChannelRequest(json: string): CreatePrivateChannelRequest { - return cast(JSON.parse(json), r("CreatePrivateChannelRequest")); - } - - public static createPrivateChannelRequestToJson(value: CreatePrivateChannelRequest): string { - return JSON.stringify(uncast(value, r("CreatePrivateChannelRequest")), null, 2); - } - - public static toCreatePrivateChannelResponse(json: string): CreatePrivateChannelResponse { - return cast(JSON.parse(json), r("CreatePrivateChannelResponse")); - } - - public static createPrivateChannelResponseToJson(value: CreatePrivateChannelResponse): string { - return JSON.stringify(uncast(value, r("CreatePrivateChannelResponse")), null, 2); - } - - public static toEventListenerUnsubscribeRequest(json: string): EventListenerUnsubscribeRequest { - return cast(JSON.parse(json), r("EventListenerUnsubscribeRequest")); - } - - public static eventListenerUnsubscribeRequestToJson(value: EventListenerUnsubscribeRequest): string { - return JSON.stringify(uncast(value, r("EventListenerUnsubscribeRequest")), null, 2); - } - - public static toEventListenerUnsubscribeResponse(json: string): EventListenerUnsubscribeResponse { - return cast(JSON.parse(json), r("EventListenerUnsubscribeResponse")); - } - - public static eventListenerUnsubscribeResponseToJson(value: EventListenerUnsubscribeResponse): string { - return JSON.stringify(uncast(value, r("EventListenerUnsubscribeResponse")), null, 2); - } - - public static toFindInstancesRequest(json: string): FindInstancesRequest { - return cast(JSON.parse(json), r("FindInstancesRequest")); - } - - public static findInstancesRequestToJson(value: FindInstancesRequest): string { - return JSON.stringify(uncast(value, r("FindInstancesRequest")), null, 2); - } - - public static toFindInstancesResponse(json: string): FindInstancesResponse { - return cast(JSON.parse(json), r("FindInstancesResponse")); - } - - public static findInstancesResponseToJson(value: FindInstancesResponse): string { - return JSON.stringify(uncast(value, r("FindInstancesResponse")), null, 2); - } - - public static toFindIntentRequest(json: string): FindIntentRequest { - return cast(JSON.parse(json), r("FindIntentRequest")); - } - - public static findIntentRequestToJson(value: FindIntentRequest): string { - return JSON.stringify(uncast(value, r("FindIntentRequest")), null, 2); - } - - public static toFindIntentResponse(json: string): FindIntentResponse { - return cast(JSON.parse(json), r("FindIntentResponse")); - } - - public static findIntentResponseToJson(value: FindIntentResponse): string { - return JSON.stringify(uncast(value, r("FindIntentResponse")), null, 2); - } - - public static toFindIntentsByContextRequest(json: string): FindIntentsByContextRequest { - return cast(JSON.parse(json), r("FindIntentsByContextRequest")); - } - - public static findIntentsByContextRequestToJson(value: FindIntentsByContextRequest): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextRequest")), null, 2); - } - - public static toFindIntentsByContextResponse(json: string): FindIntentsByContextResponse { - return cast(JSON.parse(json), r("FindIntentsByContextResponse")); - } - - public static findIntentsByContextResponseToJson(value: FindIntentsByContextResponse): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextResponse")), null, 2); - } - - public static toGetAppMetadataRequest(json: string): GetAppMetadataRequest { - return cast(JSON.parse(json), r("GetAppMetadataRequest")); - } - - public static getAppMetadataRequestToJson(value: GetAppMetadataRequest): string { - return JSON.stringify(uncast(value, r("GetAppMetadataRequest")), null, 2); - } - - public static toGetAppMetadataResponse(json: string): GetAppMetadataResponse { - return cast(JSON.parse(json), r("GetAppMetadataResponse")); - } - - public static getAppMetadataResponseToJson(value: GetAppMetadataResponse): string { - return JSON.stringify(uncast(value, r("GetAppMetadataResponse")), null, 2); - } - - public static toGetCurrentChannelRequest(json: string): GetCurrentChannelRequest { - return cast(JSON.parse(json), r("GetCurrentChannelRequest")); - } - - public static getCurrentChannelRequestToJson(value: GetCurrentChannelRequest): string { - return JSON.stringify(uncast(value, r("GetCurrentChannelRequest")), null, 2); - } - - public static toGetCurrentChannelResponse(json: string): GetCurrentChannelResponse { - return cast(JSON.parse(json), r("GetCurrentChannelResponse")); - } - - public static getCurrentChannelResponseToJson(value: GetCurrentChannelResponse): string { - return JSON.stringify(uncast(value, r("GetCurrentChannelResponse")), null, 2); - } - - public static toGetCurrentContextRequest(json: string): GetCurrentContextRequest { - return cast(JSON.parse(json), r("GetCurrentContextRequest")); - } - - public static getCurrentContextRequestToJson(value: GetCurrentContextRequest): string { - return JSON.stringify(uncast(value, r("GetCurrentContextRequest")), null, 2); - } - - public static toGetCurrentContextResponse(json: string): GetCurrentContextResponse { - return cast(JSON.parse(json), r("GetCurrentContextResponse")); - } - - public static getCurrentContextResponseToJson(value: GetCurrentContextResponse): string { - return JSON.stringify(uncast(value, r("GetCurrentContextResponse")), null, 2); - } - - public static toGetInfoRequest(json: string): GetInfoRequest { - return cast(JSON.parse(json), r("GetInfoRequest")); - } - - public static getInfoRequestToJson(value: GetInfoRequest): string { - return JSON.stringify(uncast(value, r("GetInfoRequest")), null, 2); - } - - public static toGetInfoResponse(json: string): GetInfoResponse { - return cast(JSON.parse(json), r("GetInfoResponse")); - } - - public static getInfoResponseToJson(value: GetInfoResponse): string { - return JSON.stringify(uncast(value, r("GetInfoResponse")), null, 2); - } - - public static toGetOrCreateChannelRequest(json: string): GetOrCreateChannelRequest { - return cast(JSON.parse(json), r("GetOrCreateChannelRequest")); - } - - public static getOrCreateChannelRequestToJson(value: GetOrCreateChannelRequest): string { - return JSON.stringify(uncast(value, r("GetOrCreateChannelRequest")), null, 2); - } - - public static toGetOrCreateChannelResponse(json: string): GetOrCreateChannelResponse { - return cast(JSON.parse(json), r("GetOrCreateChannelResponse")); - } - - public static getOrCreateChannelResponseToJson(value: GetOrCreateChannelResponse): string { - return JSON.stringify(uncast(value, r("GetOrCreateChannelResponse")), null, 2); - } - - public static toGetUserChannelsRequest(json: string): GetUserChannelsRequest { - return cast(JSON.parse(json), r("GetUserChannelsRequest")); - } - - public static getUserChannelsRequestToJson(value: GetUserChannelsRequest): string { - return JSON.stringify(uncast(value, r("GetUserChannelsRequest")), null, 2); - } - - public static toGetUserChannelsResponse(json: string): GetUserChannelsResponse { - return cast(JSON.parse(json), r("GetUserChannelsResponse")); - } - - public static getUserChannelsResponseToJson(value: GetUserChannelsResponse): string { - return JSON.stringify(uncast(value, r("GetUserChannelsResponse")), null, 2); - } - - public static toIframeChannelDrag(json: string): IframeChannelDrag { - return cast(JSON.parse(json), r("IframeChannelDrag")); - } - - public static iframeChannelDragToJson(value: IframeChannelDrag): string { - return JSON.stringify(uncast(value, r("IframeChannelDrag")), null, 2); - } - - public static toIframeChannelResize(json: string): IframeChannelResize { - return cast(JSON.parse(json), r("IframeChannelResize")); - } - - public static iframeChannelResizeToJson(value: IframeChannelResize): string { - return JSON.stringify(uncast(value, r("IframeChannelResize")), null, 2); - } - - public static toIframeChannelSelected(json: string): IframeChannelSelected { - return cast(JSON.parse(json), r("IframeChannelSelected")); - } - - public static iframeChannelSelectedToJson(value: IframeChannelSelected): string { - return JSON.stringify(uncast(value, r("IframeChannelSelected")), null, 2); - } - - public static toIframeChannels(json: string): IframeChannels { - return cast(JSON.parse(json), r("IframeChannels")); - } - - public static iframeChannelsToJson(value: IframeChannels): string { - return JSON.stringify(uncast(value, r("IframeChannels")), null, 2); - } - - public static toIframeHandshake(json: string): IframeHandshake { - return cast(JSON.parse(json), r("IframeHandshake")); - } - - public static iframeHandshakeToJson(value: IframeHandshake): string { - return JSON.stringify(uncast(value, r("IframeHandshake")), null, 2); - } - - public static toIframeHello(json: string): IframeHello { - return cast(JSON.parse(json), r("IframeHello")); - } - - public static iframeHelloToJson(value: IframeHello): string { - return JSON.stringify(uncast(value, r("IframeHello")), null, 2); - } - - public static toIframeMessage(json: string): IframeMessage { - return cast(JSON.parse(json), r("IframeMessage")); - } - - public static iframeMessageToJson(value: IframeMessage): string { - return JSON.stringify(uncast(value, r("IframeMessage")), null, 2); - } - - public static toIframeResolve(json: string): IframeResolve { - return cast(JSON.parse(json), r("IframeResolve")); - } - - public static iframeResolveToJson(value: IframeResolve): string { - return JSON.stringify(uncast(value, r("IframeResolve")), null, 2); - } - - public static toIframeResolveAction(json: string): IframeResolveAction { - return cast(JSON.parse(json), r("IframeResolveAction")); - } - - public static iframeResolveActionToJson(value: IframeResolveAction): string { - return JSON.stringify(uncast(value, r("IframeResolveAction")), null, 2); - } - - public static toIntentEvent(json: string): IntentEvent { - return cast(JSON.parse(json), r("IntentEvent")); - } - - public static intentEventToJson(value: IntentEvent): string { - return JSON.stringify(uncast(value, r("IntentEvent")), null, 2); - } - - public static toIntentListenerUnsubscribeRequest(json: string): IntentListenerUnsubscribeRequest { - return cast(JSON.parse(json), r("IntentListenerUnsubscribeRequest")); - } - - public static intentListenerUnsubscribeRequestToJson(value: IntentListenerUnsubscribeRequest): string { - return JSON.stringify(uncast(value, r("IntentListenerUnsubscribeRequest")), null, 2); - } - - public static toIntentListenerUnsubscribeResponse(json: string): IntentListenerUnsubscribeResponse { - return cast(JSON.parse(json), r("IntentListenerUnsubscribeResponse")); - } - - public static intentListenerUnsubscribeResponseToJson(value: IntentListenerUnsubscribeResponse): string { - return JSON.stringify(uncast(value, r("IntentListenerUnsubscribeResponse")), null, 2); - } - - public static toIntentResultRequest(json: string): IntentResultRequest { - return cast(JSON.parse(json), r("IntentResultRequest")); - } - - public static intentResultRequestToJson(value: IntentResultRequest): string { - return JSON.stringify(uncast(value, r("IntentResultRequest")), null, 2); - } - - public static toIntentResultResponse(json: string): IntentResultResponse { - return cast(JSON.parse(json), r("IntentResultResponse")); - } - - public static intentResultResponseToJson(value: IntentResultResponse): string { - return JSON.stringify(uncast(value, r("IntentResultResponse")), null, 2); - } - - public static toJoinUserChannelRequest(json: string): JoinUserChannelRequest { - return cast(JSON.parse(json), r("JoinUserChannelRequest")); - } - - public static joinUserChannelRequestToJson(value: JoinUserChannelRequest): string { - return JSON.stringify(uncast(value, r("JoinUserChannelRequest")), null, 2); - } - - public static toJoinUserChannelResponse(json: string): JoinUserChannelResponse { - return cast(JSON.parse(json), r("JoinUserChannelResponse")); - } - - public static joinUserChannelResponseToJson(value: JoinUserChannelResponse): string { - return JSON.stringify(uncast(value, r("JoinUserChannelResponse")), null, 2); - } - - public static toLeaveCurrentChannelRequest(json: string): LeaveCurrentChannelRequest { - return cast(JSON.parse(json), r("LeaveCurrentChannelRequest")); - } - - public static leaveCurrentChannelRequestToJson(value: LeaveCurrentChannelRequest): string { - return JSON.stringify(uncast(value, r("LeaveCurrentChannelRequest")), null, 2); - } - - public static toLeaveCurrentChannelResponse(json: string): LeaveCurrentChannelResponse { - return cast(JSON.parse(json), r("LeaveCurrentChannelResponse")); - } - - public static leaveCurrentChannelResponseToJson(value: LeaveCurrentChannelResponse): string { - return JSON.stringify(uncast(value, r("LeaveCurrentChannelResponse")), null, 2); - } - - public static toOpenRequest(json: string): OpenRequest { - return cast(JSON.parse(json), r("OpenRequest")); - } - - public static openRequestToJson(value: OpenRequest): string { - return JSON.stringify(uncast(value, r("OpenRequest")), null, 2); - } - - public static toOpenResponse(json: string): OpenResponse { - return cast(JSON.parse(json), r("OpenResponse")); - } - - public static openResponseToJson(value: OpenResponse): string { - return JSON.stringify(uncast(value, r("OpenResponse")), null, 2); - } - - public static toPrivateChannelDisconnectRequest(json: string): PrivateChannelDisconnectRequest { - return cast(JSON.parse(json), r("PrivateChannelDisconnectRequest")); - } - - public static privateChannelDisconnectRequestToJson(value: PrivateChannelDisconnectRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelDisconnectRequest")), null, 2); - } - - public static toPrivateChannelDisconnectResponse(json: string): PrivateChannelDisconnectResponse { - return cast(JSON.parse(json), r("PrivateChannelDisconnectResponse")); - } - - public static privateChannelDisconnectResponseToJson(value: PrivateChannelDisconnectResponse): string { - return JSON.stringify(uncast(value, r("PrivateChannelDisconnectResponse")), null, 2); - } - - public static toPrivateChannelOnAddContextListenerEvent(json: string): PrivateChannelOnAddContextListenerEvent { - return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerEvent")); - } - - public static privateChannelOnAddContextListenerEventToJson(value: PrivateChannelOnAddContextListenerEvent): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerEvent")), null, 2); - } - - public static toPrivateChannelOnDisconnectEvent(json: string): PrivateChannelOnDisconnectEvent { - return cast(JSON.parse(json), r("PrivateChannelOnDisconnectEvent")); - } - - public static privateChannelOnDisconnectEventToJson(value: PrivateChannelOnDisconnectEvent): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectEvent")), null, 2); - } - - public static toPrivateChannelOnUnsubscribeEvent(json: string): PrivateChannelOnUnsubscribeEvent { - return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeEvent")); - } - - public static privateChannelOnUnsubscribeEventToJson(value: PrivateChannelOnUnsubscribeEvent): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeEvent")), null, 2); - } - - public static toPrivateChannelUnsubscribeEventListenerRequest(json: string): PrivateChannelUnsubscribeEventListenerRequest { - return cast(JSON.parse(json), r("PrivateChannelUnsubscribeEventListenerRequest")); - } - - public static privateChannelUnsubscribeEventListenerRequestToJson(value: PrivateChannelUnsubscribeEventListenerRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelUnsubscribeEventListenerRequest")), null, 2); - } - - public static toPrivateChannelUnsubscribeEventListenerResponse(json: string): PrivateChannelUnsubscribeEventListenerResponse { - return cast(JSON.parse(json), r("PrivateChannelUnsubscribeEventListenerResponse")); - } - - public static privateChannelUnsubscribeEventListenerResponseToJson(value: PrivateChannelUnsubscribeEventListenerResponse): string { - return JSON.stringify(uncast(value, r("PrivateChannelUnsubscribeEventListenerResponse")), null, 2); - } - - public static toPrivateChannelAddEventListenerRequest(json: string): PrivateChannelAddEventListenerRequest { - return cast(JSON.parse(json), r("PrivateChannelAddEventListenerRequest")); - } - - public static privateChannelAddEventListenerRequestToJson(value: PrivateChannelAddEventListenerRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelAddEventListenerRequest")), null, 2); - } - - public static toPrivateChannelAddEventListenerResponse(json: string): PrivateChannelAddEventListenerResponse { - return cast(JSON.parse(json), r("PrivateChannelAddEventListenerResponse")); - } - - public static privateChannelAddEventListenerResponseToJson(value: PrivateChannelAddEventListenerResponse): string { - return JSON.stringify(uncast(value, r("PrivateChannelAddEventListenerResponse")), null, 2); - } - - public static toRaiseIntentForContextRequest(json: string): RaiseIntentForContextRequest { - return cast(JSON.parse(json), r("RaiseIntentForContextRequest")); - } - - public static raiseIntentForContextRequestToJson(value: RaiseIntentForContextRequest): string { - return JSON.stringify(uncast(value, r("RaiseIntentForContextRequest")), null, 2); - } - - public static toRaiseIntentForContextResponse(json: string): RaiseIntentForContextResponse { - return cast(JSON.parse(json), r("RaiseIntentForContextResponse")); - } - - public static raiseIntentForContextResponseToJson(value: RaiseIntentForContextResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentForContextResponse")), null, 2); - } - - public static toRaiseIntentRequest(json: string): RaiseIntentRequest { - return cast(JSON.parse(json), r("RaiseIntentRequest")); - } - - public static raiseIntentRequestToJson(value: RaiseIntentRequest): string { - return JSON.stringify(uncast(value, r("RaiseIntentRequest")), null, 2); - } - - public static toRaiseIntentResponse(json: string): RaiseIntentResponse { - return cast(JSON.parse(json), r("RaiseIntentResponse")); - } - - public static raiseIntentResponseToJson(value: RaiseIntentResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentResponse")), null, 2); - } - - public static toRaiseIntentResultResponse(json: string): RaiseIntentResultResponse { - return cast(JSON.parse(json), r("RaiseIntentResultResponse")); - } - - public static raiseIntentResultResponseToJson(value: RaiseIntentResultResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentResultResponse")), null, 2); - } -} - -function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { - const prettyTyp = prettyTypeName(typ); - const parentText = parent ? ` on ${parent}` : ''; - const keyText = key ? ` for key "${key}"` : ''; - throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); -} - -function prettyTypeName(typ: any): string { - if (Array.isArray(typ)) { - if (typ.length === 2 && typ[0] === undefined) { - return `an optional ${prettyTypeName(typ[1])}`; - } else { - return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; - } - } else if (typeof typ === "object" && typ.literal !== undefined) { - return typ.literal; - } else { - return typeof typ; - } -} - -function jsonToJSProps(typ: any): any { - if (typ.jsonToJS === undefined) { - const map: any = {}; - typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); - typ.jsonToJS = map; - } - return typ.jsonToJS; -} - -function jsToJSONProps(typ: any): any { - if (typ.jsToJSON === undefined) { - const map: any = {}; - typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); - typ.jsToJSON = map; - } - return typ.jsToJSON; -} - -function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { - function transformPrimitive(typ: string, val: any): any { - if (typeof typ === typeof val) return val; - return invalidValue(typ, val, key, parent); - } - - function transformUnion(typs: any[], val: any): any { - // val must validate against one typ in typs - const l = typs.length; - for (let i = 0; i < l; i++) { - const typ = typs[i]; - try { - return transform(val, typ, getProps); - } catch (_) {} - } - return invalidValue(typs, val, key, parent); - } - - function transformEnum(cases: string[], val: any): any { - if (cases.indexOf(val) !== -1) return val; - return invalidValue(cases.map(a => { return l(a); }), val, key, parent); - } - - function transformArray(typ: any, val: any): any { - // val must be an array with no invalid elements - if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); - return val.map(el => transform(el, typ, getProps)); - } - - function transformDate(val: any): any { - if (val === null) { - return null; - } - const d = new Date(val); - if (isNaN(d.valueOf())) { - return invalidValue(l("Date"), val, key, parent); - } - return d; - } - - function transformObject(props: { [k: string]: any }, additional: any, val: any): any { - if (val === null || typeof val !== "object" || Array.isArray(val)) { - return invalidValue(l(ref || "object"), val, key, parent); - } - const result: any = {}; - Object.getOwnPropertyNames(props).forEach(key => { - const prop = props[key]; - const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; - result[prop.key] = transform(v, prop.typ, getProps, key, ref); - }); - Object.getOwnPropertyNames(val).forEach(key => { - if (!Object.prototype.hasOwnProperty.call(props, key)) { - result[key] = transform(val[key], additional, getProps, key, ref); - } - }); - return result; - } - - if (typ === "any") return val; - if (typ === null) { - if (val === null) return val; - return invalidValue(typ, val, key, parent); - } - if (typ === false) return invalidValue(typ, val, key, parent); - let ref: any = undefined; - while (typeof typ === "object" && typ.ref !== undefined) { - ref = typ.ref; - typ = typeMap[typ.ref]; - } - if (Array.isArray(typ)) return transformEnum(typ, val); - if (typeof typ === "object") { - return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) - : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) - : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) - : invalidValue(typ, val, key, parent); - } - // Numbers can be parsed by Date but shouldn't be. - if (typ === Date && typeof val !== "number") return transformDate(val); - return transformPrimitive(typ, val); -} - -function cast(val: any, typ: any): T { - return transform(val, typ, jsonToJSProps); -} - -function uncast(val: T, typ: any): any { - return transform(val, typ, jsToJSONProps); -} - -function l(typ: any) { - return { literal: typ }; -} - -function a(typ: any) { - return { arrayItems: typ }; -} - -function u(...typs: any[]) { - return { unionMembers: typs }; -} - -function o(props: any[], additional: any) { - return { props, additional }; -} - -function m(additional: any) { - return { props: [], additional }; -} - -function r(name: string) { - return { ref: name }; -} - -const typeMap: any = { - "WebConnectionProtocol1Hello": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: r("WebConnectionProtocol1HelloPayload") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol1HelloType") }, - ], false), - "ConnectionStepMetadata": o([ - { json: "connectionAttemptUuid", js: "connectionAttemptUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "WebConnectionProtocol1HelloPayload": o([ - { json: "channelSelector", js: "channelSelector", typ: u(undefined, true) }, - { json: "fdc3Version", js: "fdc3Version", typ: "" }, - { json: "identityUrl", js: "identityUrl", typ: "" }, - { json: "resolver", js: "resolver", typ: u(undefined, true) }, - ], "any"), - "WebConnectionProtocol2LoadURL": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: r("WebConnectionProtocol2LoadURLPayload") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol2LoadURLType") }, - ], false), - "WebConnectionProtocol2LoadURLPayload": o([ - { json: "iframeUrl", js: "iframeUrl", typ: "" }, - ], "any"), - "WebConnectionProtocol3Handshake": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: r("WebConnectionProtocol3HandshakePayload") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol3HandshakeType") }, - ], false), - "WebConnectionProtocol3HandshakePayload": o([ - { json: "channelSelector", js: "channelSelector", typ: u(true, "") }, - { json: "fdc3Version", js: "fdc3Version", typ: "" }, - { json: "resolver", js: "resolver", typ: u(true, "") }, - ], false), - "WebConnectionProtocol4ValidateAppIdentity": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: r("WebConnectionProtocol4ValidateAppIdentityPayload") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol4ValidateAppIdentityType") }, - ], false), - "WebConnectionProtocol4ValidateAppIdentityPayload": o([ - { json: "identityUrl", js: "identityUrl", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - { json: "instanceUuid", js: "instanceUuid", typ: u(undefined, "") }, - ], false), - "WebConnectionProtocol5ValidateAppIdentityFailedResponse": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: r("WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol5ValidateAppIdentityFailedResponseType") }, - ], false), - "WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload": o([ - { json: "message", js: "message", typ: u(undefined, "") }, - ], false), - "WebConnectionProtocol5ValidateAppIdentitySuccessResponse": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: r("WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol5ValidateAppIdentitySuccessResponseType") }, - ], false), - "WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "implementationMetadata", js: "implementationMetadata", typ: r("ImplementationMetadata") }, - { json: "instanceId", js: "instanceId", typ: "" }, - { json: "instanceUuid", js: "instanceUuid", typ: "" }, - ], false), - "ImplementationMetadata": o([ - { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, - { json: "fdc3Version", js: "fdc3Version", typ: "" }, - { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, - { json: "provider", js: "provider", typ: "" }, - { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, - ], false), - "AppMetadata": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "description", js: "description", typ: u(undefined, "") }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "icons", js: "icons", typ: u(undefined, a(r("Icon"))) }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - { json: "instanceMetadata", js: "instanceMetadata", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "resultType", js: "resultType", typ: u(undefined, u(null, "")) }, - { json: "screenshots", js: "screenshots", typ: u(undefined, a(r("Image"))) }, - { json: "title", js: "title", typ: u(undefined, "") }, - { json: "tooltip", js: "tooltip", typ: u(undefined, "") }, - { json: "version", js: "version", typ: u(undefined, "") }, - ], false), - "Icon": o([ - { json: "size", js: "size", typ: u(undefined, "") }, - { json: "src", js: "src", typ: "" }, - { json: "type", js: "type", typ: u(undefined, "") }, - ], false), - "Image": o([ - { json: "label", js: "label", typ: u(undefined, "") }, - { json: "size", js: "size", typ: u(undefined, "") }, - { json: "src", js: "src", typ: "" }, - { json: "type", js: "type", typ: u(undefined, "") }, - ], false), - "OptionalFeatures": o([ - { json: "DesktopAgentBridging", js: "DesktopAgentBridging", typ: true }, - { json: "OriginatingAppMetadata", js: "OriginatingAppMetadata", typ: true }, - { json: "UserChannelMembershipAPIs", js: "UserChannelMembershipAPIs", typ: true }, - ], false), - "WebConnectionProtocol6Goodbye": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol6GoodbyeType") }, - ], false), - "WebConnectionProtocolMessage": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("ConnectionStepMessageType") }, - ], false), - "AddContextListenerRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("AddContextListenerRequestPayload") }, - { json: "type", js: "type", typ: r("AddContextListenerRequestType") }, - ], false), - "AddContextListenerRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "AppIdentifier": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "AddContextListenerRequestPayload": o([ - { json: "channelId", js: "channelId", typ: u(null, "") }, - { json: "contextType", js: "contextType", typ: u(null, "") }, - ], false), - "AddContextListenerResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("AddContextListenerResponsePayload") }, - { json: "type", js: "type", typ: r("AddContextListenerResponseType") }, - ], false), - "AddContextListenerResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "AddContextListenerResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, - ], false), - "AddEventListenerEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("AddEventListenerEventPayload") }, - { json: "type", js: "type", typ: r("AddEventListenerEventType") }, - ], false), - "AddEventListenerEventMeta": o([ - { json: "eventUuid", js: "eventUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "AddEventListenerEventPayload": o([ - { json: "event", js: "event", typ: r("FDC3Event") }, - ], false), - "FDC3Event": o([ - { json: "details", js: "details", typ: m("any") }, - { json: "type", js: "type", typ: r("FDC3EventType") }, - ], false), - "AddEventListenerRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("AddEventListenerRequestPayload") }, - { json: "type", js: "type", typ: r("AddEventListenerRequestType") }, - ], false), - "AddEventListenerRequestPayload": o([ - { json: "type", js: "type", typ: r("FDC3EventType") }, - ], false), - "AddEventListenerResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("AddEventListenerResponsePayload") }, - { json: "type", js: "type", typ: r("AddEventListenerResponseType") }, - ], false), - "AddEventListenerResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, - { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, - ], false), - "AddIntentListenerRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("AddIntentListenerRequestPayload") }, - { json: "type", js: "type", typ: r("AddIntentListenerRequestType") }, - ], false), - "AddIntentListenerRequestPayload": o([ - { json: "intent", js: "intent", typ: "" }, - ], false), - "AddIntentListenerResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("AddIntentListenerResponsePayload") }, - { json: "type", js: "type", typ: r("AddIntentListenerResponseType") }, - ], false), - "AddIntentListenerResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FluffyError")) }, - { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, - ], "any"), - "AgentEventMessage": o([ - { json: "meta", js: "meta", typ: r("AgentEventMessageMeta") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("EventMessageType") }, - ], false), - "AgentEventMessageMeta": o([ - { json: "eventUuid", js: "eventUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "AgentResponseMessage": o([ - { json: "meta", js: "meta", typ: r("AgentResponseMessageMeta") }, - { json: "payload", js: "payload", typ: r("AgentResponseMessageResponsePayload") }, - { json: "type", js: "type", typ: r("ResponseMessageType") }, - ], false), - "AgentResponseMessageMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "AgentResponseMessageResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, - ], "any"), - "AppRequestMessage": o([ - { json: "meta", js: "meta", typ: r("AppRequestMessageMeta") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("RequestMessageType") }, - ], false), - "AppRequestMessageMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "BroadcastEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastEventPayload") }, - { json: "type", js: "type", typ: r("BroadcastEventType") }, - ], false), - "BroadcastEventPayload": o([ - { json: "channelId", js: "channelId", typ: u(null, "") }, - { json: "context", js: "context", typ: r("Context") }, - { json: "originatingApp", js: "originatingApp", typ: u(undefined, r("AppIdentifier")) }, - ], false), - "Context": o([ - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: "" }, - ], "any"), - "BroadcastRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastRequestPayload") }, - { json: "type", js: "type", typ: r("BroadcastRequestType") }, - ], false), - "BroadcastRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "BroadcastResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, - { json: "type", js: "type", typ: r("BroadcastResponseType") }, - ], false), - "BroadcastResponseResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, - ], "any"), - "ChannelChangedEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("ChannelChangedEventPayload") }, - { json: "type", js: "type", typ: r("ChannelChangedEventType") }, - ], false), - "ChannelChangedEventPayload": o([ - { json: "newChannelId", js: "newChannelId", typ: u(null, "") }, - ], false), - "ContextListenerUnsubscribeRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("ContextListenerUnsubscribeRequestPayload") }, - { json: "type", js: "type", typ: r("ContextListenerUnsubscribeRequestType") }, - ], false), - "ContextListenerUnsubscribeRequestPayload": o([ - { json: "listenerUUID", js: "listenerUUID", typ: "" }, - ], false), - "ContextListenerUnsubscribeResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, - { json: "type", js: "type", typ: r("ContextListenerUnsubscribeResponseType") }, - ], false), - "CreatePrivateChannelRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("CreatePrivateChannelRequestPayload") }, - { json: "type", js: "type", typ: r("CreatePrivateChannelRequestType") }, - ], false), - "CreatePrivateChannelRequestPayload": o([ - ], false), - "CreatePrivateChannelResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("CreatePrivateChannelResponsePayload") }, - { json: "type", js: "type", typ: r("CreatePrivateChannelResponseType") }, - ], false), - "CreatePrivateChannelResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - { json: "privateChannel", js: "privateChannel", typ: u(undefined, r("Channel")) }, - ], false), - "Channel": o([ - { json: "displayMetadata", js: "displayMetadata", typ: u(undefined, r("DisplayMetadata")) }, - { json: "id", js: "id", typ: "" }, - { json: "type", js: "type", typ: r("Type") }, - ], false), - "DisplayMetadata": o([ - { json: "color", js: "color", typ: u(undefined, "") }, - { json: "glyph", js: "glyph", typ: u(undefined, "") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], false), - "EventListenerUnsubscribeRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("EventListenerUnsubscribeRequestPayload") }, - { json: "type", js: "type", typ: r("EventListenerUnsubscribeRequestType") }, - ], false), - "EventListenerUnsubscribeRequestPayload": o([ - { json: "listenerUUID", js: "listenerUUID", typ: "" }, - ], false), - "EventListenerUnsubscribeResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, - { json: "type", js: "type", typ: r("EventListenerUnsubscribeResponseType") }, - ], false), - "FindInstancesRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindInstancesRequestPayload") }, - { json: "type", js: "type", typ: r("FindInstancesRequestType") }, - ], false), - "FindInstancesRequestPayload": o([ - { json: "app", js: "app", typ: r("AppIdentifier") }, - ], false), - "FindInstancesResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindInstancesResponsePayload") }, - { json: "type", js: "type", typ: r("FindInstancesResponseType") }, - ], false), - "FindInstancesResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, - { json: "appIdentifiers", js: "appIdentifiers", typ: u(undefined, a(r("AppMetadata"))) }, - ], false), - "FindIntentRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentRequestPayload") }, - { json: "type", js: "type", typ: r("FindIntentRequestType") }, - ], false), - "FindIntentRequestPayload": o([ - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - { json: "intent", js: "intent", typ: "" }, - { json: "resultType", js: "resultType", typ: u(undefined, "") }, - ], false), - "FindIntentResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentResponseType") }, - ], false), - "FindIntentResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, - { json: "appIntent", js: "appIntent", typ: u(undefined, r("AppIntent")) }, - ], false), - "AppIntent": o([ - { json: "apps", js: "apps", typ: a(r("AppMetadata")) }, - { json: "intent", js: "intent", typ: r("IntentMetadata") }, - ], false), - "IntentMetadata": o([ - { json: "displayName", js: "displayName", typ: u(undefined, "") }, - { json: "name", js: "name", typ: "" }, - ], false), - "FindIntentsByContextRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextRequestPayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextRequestType") }, - ], false), - "FindIntentsByContextRequestPayload": o([ - { json: "context", js: "context", typ: r("Context") }, - { json: "resultType", js: "resultType", typ: u(undefined, "") }, - ], false), - "FindIntentsByContextResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextResponseType") }, - ], false), - "FindIntentsByContextResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, - { json: "appIntents", js: "appIntents", typ: u(undefined, a(r("AppIntent"))) }, - ], false), - "GetAppMetadataRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataRequestPayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataRequestType") }, - ], false), - "GetAppMetadataRequestPayload": o([ - { json: "app", js: "app", typ: r("AppIdentifier") }, - ], false), - "GetAppMetadataResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataResponsePayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataResponseType") }, - ], false), - "GetAppMetadataResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, - { json: "appMetadata", js: "appMetadata", typ: u(undefined, r("AppMetadata")) }, - ], false), - "GetCurrentChannelRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetCurrentChannelRequestPayload") }, - { json: "type", js: "type", typ: r("GetCurrentChannelRequestType") }, - ], false), - "GetCurrentChannelRequestPayload": o([ - ], false), - "GetCurrentChannelResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetCurrentChannelResponsePayload") }, - { json: "type", js: "type", typ: r("GetCurrentChannelResponseType") }, - ], false), - "GetCurrentChannelResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, - { json: "channel", js: "channel", typ: u(undefined, u(r("Channel"), null)) }, - ], false), - "GetCurrentContextRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetCurrentContextRequestPayload") }, - { json: "type", js: "type", typ: r("GetCurrentContextRequestType") }, - ], false), - "GetCurrentContextRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "contextType", js: "contextType", typ: u(null, "") }, - ], false), - "GetCurrentContextResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetCurrentContextResponsePayload") }, - { json: "type", js: "type", typ: r("GetCurrentContextResponseType") }, - ], false), - "GetCurrentContextResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - { json: "context", js: "context", typ: u(undefined, u(null, r("Context"))) }, - ], false), - "GetInfoRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetInfoRequestPayload") }, - { json: "type", js: "type", typ: r("GetInfoRequestType") }, - ], false), - "GetInfoRequestPayload": o([ - ], false), - "GetInfoResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetInfoResponsePayload") }, - { json: "type", js: "type", typ: r("GetInfoResponseType") }, - ], false), - "GetInfoResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, - { json: "implementationMetadata", js: "implementationMetadata", typ: u(undefined, r("ImplementationMetadata")) }, - ], false), - "GetOrCreateChannelRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetOrCreateChannelRequestPayload") }, - { json: "type", js: "type", typ: r("GetOrCreateChannelRequestType") }, - ], false), - "GetOrCreateChannelRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - ], false), - "GetOrCreateChannelResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetOrCreateChannelResponsePayload") }, - { json: "type", js: "type", typ: r("GetOrCreateChannelResponseType") }, - ], false), - "GetOrCreateChannelResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, - ], false), - "GetUserChannelsRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetUserChannelsRequestPayload") }, - { json: "type", js: "type", typ: r("GetUserChannelsRequestType") }, - ], false), - "GetUserChannelsRequestPayload": o([ - ], false), - "GetUserChannelsResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetUserChannelsResponsePayload") }, - { json: "type", js: "type", typ: r("GetUserChannelsResponseType") }, - ], false), - "GetUserChannelsResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - { json: "userChannels", js: "userChannels", typ: u(undefined, a(r("Channel"))) }, - ], false), - "IframeChannelDrag": o([ - { json: "payload", js: "payload", typ: r("IframeChannelDragPayload") }, - { json: "type", js: "type", typ: r("IframeChannelDragType") }, - ], false), - "IframeChannelDragPayload": o([ - { json: "mouse", js: "mouse", typ: r("MouseClass") }, - ], false), - "MouseClass": o([ - { json: "offsetX", js: "offsetX", typ: 0 }, - { json: "offsetY", js: "offsetY", typ: 0 }, - ], false), - "IframeChannelResize": o([ - { json: "payload", js: "payload", typ: r("IframeChannelResizePayload") }, - { json: "type", js: "type", typ: r("IframeChannelResizeType") }, - ], false), - "IframeChannelResizePayload": o([ - { json: "dimensions", js: "dimensions", typ: r("DimensionsClass") }, - { json: "resizeAnchor", js: "resizeAnchor", typ: r("Resizing") }, - ], false), - "DimensionsClass": o([ - { json: "height", js: "height", typ: 0 }, - { json: "width", js: "width", typ: 0 }, - ], false), - "IframeChannelSelected": o([ - { json: "payload", js: "payload", typ: r("IframeChannelSelectedPayload") }, - { json: "type", js: "type", typ: r("IframeChannelSelectedType") }, - ], false), - "IframeChannelSelectedPayload": o([ - { json: "selected", js: "selected", typ: u(null, "") }, - ], false), - "IframeChannels": o([ - { json: "payload", js: "payload", typ: r("IframeChannelsPayload") }, - { json: "type", js: "type", typ: r("IframeChannelsType") }, - ], false), - "IframeChannelsPayload": o([ - { json: "location", js: "location", typ: u(undefined, r("Location")) }, - { json: "selected", js: "selected", typ: u(null, "") }, - { json: "userChannels", js: "userChannels", typ: a(r("Channel")) }, - ], false), - "Location": o([ - { json: "x", js: "x", typ: 0 }, - { json: "y", js: "y", typ: 0 }, - ], false), - "IframeHandshake": o([ - { json: "payload", js: "payload", typ: r("IframeHandshakePayload") }, - { json: "type", js: "type", typ: r("IframeHandshakeType") }, - ], false), - "IframeHandshakePayload": o([ - { json: "implementationDetails", js: "implementationDetails", typ: "" }, - ], false), - "IframeHello": o([ - { json: "payload", js: "payload", typ: r("IframeHelloPayload") }, - { json: "type", js: "type", typ: r("IframeHelloType") }, - ], false), - "IframeHelloPayload": o([ - { json: "fdc3Version", js: "fdc3Version", typ: "" }, - ], false), - "IframeMessage": o([ - { json: "payload", js: "payload", typ: u(undefined, m("any")) }, - { json: "type", js: "type", typ: r("IframeMessageType") }, - ], false), - "IframeResolve": o([ - { json: "payload", js: "payload", typ: r("IframeResolvePayload") }, - { json: "type", js: "type", typ: r("IframeResolveType") }, - ], false), - "IframeResolvePayload": o([ - { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "IframeResolveAction": o([ - { json: "payload", js: "payload", typ: r("IframeResolveActionPayload") }, - { json: "type", js: "type", typ: r("IframeResolveActionType") }, - ], false), - "IframeResolveActionPayload": o([ - { json: "action", js: "action", typ: r("Action") }, - { json: "appIdentifier", js: "appIdentifier", typ: u(undefined, r("AppIdentifier")) }, - { json: "intent", js: "intent", typ: u(undefined, "") }, - ], false), - "IntentEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("IntentEventPayload") }, - { json: "type", js: "type", typ: r("IntentEventType") }, - ], false), - "IntentEventPayload": o([ - { json: "context", js: "context", typ: r("Context") }, - { json: "intent", js: "intent", typ: "" }, - { json: "originatingApp", js: "originatingApp", typ: u(undefined, r("AppIdentifier")) }, - ], false), - "IntentListenerUnsubscribeRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("IntentListenerUnsubscribeRequestPayload") }, - { json: "type", js: "type", typ: r("IntentListenerUnsubscribeRequestType") }, - ], false), - "IntentListenerUnsubscribeRequestPayload": o([ - { json: "listenerUUID", js: "listenerUUID", typ: "" }, - ], false), - "IntentListenerUnsubscribeResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, - { json: "type", js: "type", typ: r("IntentListenerUnsubscribeResponseType") }, - ], false), - "IntentResultRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("IntentResultRequestPayload") }, - { json: "type", js: "type", typ: r("IntentResultRequestType") }, - ], false), - "IntentResultRequestPayload": o([ - { json: "intentResult", js: "intentResult", typ: r("PurpleIntentResult") }, - ], false), - "PurpleIntentResult": o([ - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, - ], false), - "IntentResultResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, - { json: "type", js: "type", typ: r("IntentResultResponseType") }, - ], false), - "JoinUserChannelRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("JoinUserChannelRequestPayload") }, - { json: "type", js: "type", typ: r("JoinUserChannelRequestType") }, - ], false), - "JoinUserChannelRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - ], false), - "JoinUserChannelResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("JoinUserChannelResponsePayload") }, - { json: "type", js: "type", typ: r("JoinUserChannelResponseType") }, - ], false), - "JoinUserChannelResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - ], false), - "LeaveCurrentChannelRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("LeaveCurrentChannelRequestPayload") }, - { json: "type", js: "type", typ: r("LeaveCurrentChannelRequestType") }, - ], false), - "LeaveCurrentChannelRequestPayload": o([ - ], false), - "LeaveCurrentChannelResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("LeaveCurrentChannelResponsePayload") }, - { json: "type", js: "type", typ: r("LeaveCurrentChannelResponseType") }, - ], false), - "LeaveCurrentChannelResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - ], false), - "OpenRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("OpenRequestPayload") }, - { json: "type", js: "type", typ: r("OpenRequestType") }, - ], false), - "OpenRequestPayload": o([ - { json: "app", js: "app", typ: r("AppIdentifier") }, - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - ], false), - "OpenResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("OpenResponsePayload") }, - { json: "type", js: "type", typ: r("OpenResponseType") }, - ], false), - "OpenResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("OpenErrorResponsePayload")) }, - { json: "appIdentifier", js: "appIdentifier", typ: u(undefined, r("AppIdentifier")) }, - ], false), - "PrivateChannelDisconnectRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelDisconnectRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelDisconnectRequestType") }, - ], false), - "PrivateChannelDisconnectRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - ], false), - "PrivateChannelDisconnectResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelDisconnectResponsePayload") }, - { json: "type", js: "type", typ: r("PrivateChannelDisconnectResponseType") }, - ], false), - "PrivateChannelDisconnectResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - ], false), - "PrivateChannelOnAddContextListenerEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerEventPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerEventType") }, - ], false), - "PrivateChannelOnAddContextListenerEventPayload": o([ - { json: "contextType", js: "contextType", typ: u(null, "") }, - { json: "privateChannelId", js: "privateChannelId", typ: "" }, - ], false), - "PrivateChannelOnDisconnectEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectEventPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectEventType") }, - ], false), - "PrivateChannelOnDisconnectEventPayload": o([ - { json: "privateChannelId", js: "privateChannelId", typ: "" }, - ], false), - "PrivateChannelOnUnsubscribeEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeEventPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeEventType") }, - ], false), - "PrivateChannelOnUnsubscribeEventPayload": o([ - { json: "contextType", js: "contextType", typ: u(null, "") }, - { json: "privateChannelId", js: "privateChannelId", typ: "" }, - ], false), - "PrivateChannelUnsubscribeEventListenerRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelUnsubscribeEventListenerRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelUnsubscribeEventListenerRequestType") }, - ], false), - "PrivateChannelUnsubscribeEventListenerRequestPayload": o([ - { json: "listenerUUID", js: "listenerUUID", typ: "" }, - ], false), - "PrivateChannelUnsubscribeEventListenerResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, - { json: "type", js: "type", typ: r("PrivateChannelUnsubscribeEventListenerResponseType") }, - ], false), - "PrivateChannelAddEventListenerRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("TPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelAddEventListenerRequestType") }, - ], false), - "TPayload": o([ - { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, - { json: "privateChannelId", js: "privateChannelId", typ: "" }, - ], false), - "PrivateChannelAddEventListenerResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelAddEventListenerResponsePayload") }, - { json: "type", js: "type", typ: r("PrivateChannelAddEventListenerResponseType") }, - ], false), - "PrivateChannelAddEventListenerResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, - ], "any"), - "RaiseIntentForContextRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentForContextRequestPayload") }, - { json: "type", js: "type", typ: r("RaiseIntentForContextRequestType") }, - ], false), - "RaiseIntentForContextRequestPayload": o([ - { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "RaiseIntentForContextResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentForContextResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentForContextResponseType") }, - ], false), - "RaiseIntentForContextResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, - { json: "intentResolution", js: "intentResolution", typ: u(undefined, r("IntentResolution")) }, - { json: "appIntents", js: "appIntents", typ: u(undefined, a(r("AppIntent"))) }, - ], false), - "IntentResolution": o([ - { json: "intent", js: "intent", typ: "" }, - { json: "source", js: "source", typ: r("AppIdentifier") }, - ], false), - "RaiseIntentRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentRequestPayload") }, - { json: "type", js: "type", typ: r("RaiseIntentRequestType") }, - ], false), - "RaiseIntentRequestPayload": o([ - { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, - { json: "context", js: "context", typ: r("Context") }, - { json: "intent", js: "intent", typ: "" }, - ], false), - "RaiseIntentResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentResponseType") }, - ], false), - "RaiseIntentResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, - { json: "intentResolution", js: "intentResolution", typ: u(undefined, r("IntentResolution")) }, - { json: "appIntent", js: "appIntent", typ: u(undefined, r("AppIntent")) }, - ], false), - "RaiseIntentResultResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentResultResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentResultResponseType") }, - ], false), - "RaiseIntentResultResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, - { json: "intentResult", js: "intentResult", typ: u(undefined, r("FluffyIntentResult")) }, - ], false), - "FluffyIntentResult": o([ - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, - ], false), - "WebConnectionProtocol1HelloType": [ - "WCP1Hello", - ], - "WebConnectionProtocol2LoadURLType": [ - "WCP2LoadUrl", - ], - "WebConnectionProtocol3HandshakeType": [ - "WCP3Handshake", - ], - "WebConnectionProtocol4ValidateAppIdentityType": [ - "WCP4ValidateAppIdentity", - ], - "WebConnectionProtocol5ValidateAppIdentityFailedResponseType": [ - "WCP5ValidateAppIdentityFailedResponse", - ], - "WebConnectionProtocol5ValidateAppIdentitySuccessResponseType": [ - "WCP5ValidateAppIdentityResponse", - ], - "WebConnectionProtocol6GoodbyeType": [ - "WCP6Goodbye", - ], - "ConnectionStepMessageType": [ - "WCP1Hello", - "WCP2LoadUrl", - "WCP3Handshake", - "WCP4ValidateAppIdentity", - "WCP5ValidateAppIdentityFailedResponse", - "WCP5ValidateAppIdentityResponse", - "WCP6Goodbye", - ], - "AddContextListenerRequestType": [ - "addContextListenerRequest", - ], - "PurpleError": [ - "AccessDenied", - "CreationFailed", - "MalformedContext", - "NoChannelFound", - ], - "AddContextListenerResponseType": [ - "addContextListenerResponse", - ], - "FDC3EventType": [ - "USER_CHANNEL_CHANGED", - ], - "AddEventListenerEventType": [ - "addEventListenerEvent", - ], - "AddEventListenerRequestType": [ - "addEventListenerRequest", - ], - "ResponsePayloadError": [ - "AccessDenied", - "AgentDisconnected", - "AppNotFound", - "AppTimeout", - "CreationFailed", - "DesktopAgentNotFound", - "ErrorOnLaunch", - "IntentDeliveryFailed", - "IntentHandlerRejected", - "MalformedContext", - "MalformedMessage", - "NoAppsFound", - "NoChannelFound", - "NoResultReturned", - "NotConnectedToBridge", - "ResolverTimeout", - "ResolverUnavailable", - "ResponseToBridgeTimedOut", - "TargetAppUnavailable", - "TargetInstanceUnavailable", - "UserCancelledResolution", - ], - "AddEventListenerResponseType": [ - "addEventListenerResponse", - ], - "AddIntentListenerRequestType": [ - "addIntentListenerRequest", - ], - "FluffyError": [ - "DesktopAgentNotFound", - "IntentDeliveryFailed", - "MalformedContext", - "NoAppsFound", - "ResolverTimeout", - "ResolverUnavailable", - "TargetAppUnavailable", - "TargetInstanceUnavailable", - "UserCancelledResolution", - ], - "AddIntentListenerResponseType": [ - "addIntentListenerResponse", - ], - "EventMessageType": [ - "addEventListenerEvent", - "broadcastEvent", - "channelChangedEvent", - "intentEvent", - "privateChannelOnAddContextListenerEvent", - "privateChannelOnDisconnectEvent", - "privateChannelOnUnsubscribeEvent", - ], - "ResponseMessageType": [ - "addContextListenerResponse", - "addEventListenerResponse", - "addIntentListenerResponse", - "broadcastResponse", - "contextListenerUnsubscribeResponse", - "createPrivateChannelResponse", - "eventListenerUnsubscribeResponse", - "findInstancesResponse", - "findIntentResponse", - "findIntentsByContextResponse", - "getAppMetadataResponse", - "getCurrentChannelResponse", - "getCurrentContextResponse", - "getInfoResponse", - "getOrCreateChannelResponse", - "getUserChannelsResponse", - "intentListenerUnsubscribeResponse", - "intentResultResponse", - "joinUserChannelResponse", - "leaveCurrentChannelResponse", - "openResponse", - "privateChannelAddEventListenerResponse", - "privateChannelDisconnectResponse", - "privateChannelUnsubscribeEventListenerResponse", - "raiseIntentForContextResponse", - "raiseIntentResponse", - "raiseIntentResultResponse", - ], - "RequestMessageType": [ - "addContextListenerRequest", - "addEventListenerRequest", - "addIntentListenerRequest", - "broadcastRequest", - "contextListenerUnsubscribeRequest", - "createPrivateChannelRequest", - "eventListenerUnsubscribeRequest", - "findInstancesRequest", - "findIntentRequest", - "findIntentsByContextRequest", - "getAppMetadataRequest", - "getCurrentChannelRequest", - "getCurrentContextRequest", - "getInfoRequest", - "getOrCreateChannelRequest", - "getUserChannelsRequest", - "intentListenerUnsubscribeRequest", - "intentResultRequest", - "joinUserChannelRequest", - "leaveCurrentChannelRequest", - "openRequest", - "privateChannelAddEventListenerRequest", - "privateChannelDisconnectRequest", - "privateChannelUnsubscribeEventListenerRequest", - "raiseIntentForContextRequest", - "raiseIntentRequest", - ], - "BroadcastEventType": [ - "broadcastEvent", - ], - "BroadcastRequestType": [ - "broadcastRequest", - ], - "BroadcastResponseType": [ - "broadcastResponse", - ], - "ChannelChangedEventType": [ - "channelChangedEvent", - ], - "ContextListenerUnsubscribeRequestType": [ - "contextListenerUnsubscribeRequest", - ], - "ContextListenerUnsubscribeResponseType": [ - "contextListenerUnsubscribeResponse", - ], - "CreatePrivateChannelRequestType": [ - "createPrivateChannelRequest", - ], - "Type": [ - "app", - "private", - "user", - ], - "CreatePrivateChannelResponseType": [ - "createPrivateChannelResponse", - ], - "EventListenerUnsubscribeRequestType": [ - "eventListenerUnsubscribeRequest", - ], - "EventListenerUnsubscribeResponseType": [ - "eventListenerUnsubscribeResponse", - ], - "FindInstancesRequestType": [ - "findInstancesRequest", - ], - "FindInstancesErrors": [ - "AgentDisconnected", - "DesktopAgentNotFound", - "IntentDeliveryFailed", - "MalformedContext", - "MalformedMessage", - "NoAppsFound", - "NotConnectedToBridge", - "ResolverTimeout", - "ResolverUnavailable", - "ResponseToBridgeTimedOut", - "TargetAppUnavailable", - "TargetInstanceUnavailable", - "UserCancelledResolution", - ], - "FindInstancesResponseType": [ - "findInstancesResponse", - ], - "FindIntentRequestType": [ - "findIntentRequest", - ], - "FindIntentResponseType": [ - "findIntentResponse", - ], - "FindIntentsByContextRequestType": [ - "findIntentsByContextRequest", - ], - "FindIntentsByContextResponseType": [ - "findIntentsByContextResponse", - ], - "GetAppMetadataRequestType": [ - "getAppMetadataRequest", - ], - "GetAppMetadataResponseType": [ - "getAppMetadataResponse", - ], - "GetCurrentChannelRequestType": [ - "getCurrentChannelRequest", - ], - "GetCurrentChannelResponseType": [ - "getCurrentChannelResponse", - ], - "GetCurrentContextRequestType": [ - "getCurrentContextRequest", - ], - "GetCurrentContextResponseType": [ - "getCurrentContextResponse", - ], - "GetInfoRequestType": [ - "getInfoRequest", - ], - "GetInfoResponseType": [ - "getInfoResponse", - ], - "GetOrCreateChannelRequestType": [ - "getOrCreateChannelRequest", - ], - "GetOrCreateChannelResponseType": [ - "getOrCreateChannelResponse", - ], - "GetUserChannelsRequestType": [ - "getUserChannelsRequest", - ], - "GetUserChannelsResponseType": [ - "getUserChannelsResponse", - ], - "IframeChannelDragType": [ - "iframeChannelDrag", - ], - "Resizing": [ - "bottom", - "bottom-left", - "bottom-right", - "center", - "left", - "right", - "top", - "top-left", - "top-right", - ], - "IframeChannelResizeType": [ - "iframeChannelResize", - ], - "IframeChannelSelectedType": [ - "iframeChannelSelected", - ], - "IframeChannelsType": [ - "iframeChannels", - ], - "IframeHandshakeType": [ - "iframeHandshake", - ], - "IframeHelloType": [ - "iframeHello", - ], - "IframeMessageType": [ - "iframeChannelDrag", - "iframeChannelResize", - "iframeChannelSelected", - "iframeChannels", - "iframeHandshake", - "iframeHello", - "iframeResolve", - "iframeResolveAction", - ], - "IframeResolveType": [ - "iframeResolve", - ], - "Action": [ - "cancel", - "click", - "hover", - ], - "IframeResolveActionType": [ - "iframeResolveAction", - ], - "IntentEventType": [ - "intentEvent", - ], - "IntentListenerUnsubscribeRequestType": [ - "intentListenerUnsubscribeRequest", - ], - "IntentListenerUnsubscribeResponseType": [ - "intentListenerUnsubscribeResponse", - ], - "IntentResultRequestType": [ - "intentResultRequest", - ], - "IntentResultResponseType": [ - "intentResultResponse", - ], - "JoinUserChannelRequestType": [ - "joinUserChannelRequest", - ], - "JoinUserChannelResponseType": [ - "joinUserChannelResponse", - ], - "LeaveCurrentChannelRequestType": [ - "leaveCurrentChannelRequest", - ], - "LeaveCurrentChannelResponseType": [ - "leaveCurrentChannelResponse", - ], - "OpenRequestType": [ - "openRequest", - ], - "OpenErrorResponsePayload": [ - "AgentDisconnected", - "AppNotFound", - "AppTimeout", - "DesktopAgentNotFound", - "ErrorOnLaunch", - "MalformedContext", - "MalformedMessage", - "NotConnectedToBridge", - "ResolverUnavailable", - "ResponseToBridgeTimedOut", - ], - "OpenResponseType": [ - "openResponse", - ], - "PrivateChannelDisconnectRequestType": [ - "privateChannelDisconnectRequest", - ], - "PrivateChannelDisconnectResponseType": [ - "privateChannelDisconnectResponse", - ], - "PrivateChannelOnAddContextListenerEventType": [ - "privateChannelOnAddContextListenerEvent", - ], - "PrivateChannelOnDisconnectEventType": [ - "privateChannelOnDisconnectEvent", - ], - "PrivateChannelOnUnsubscribeEventType": [ - "privateChannelOnUnsubscribeEvent", - ], - "PrivateChannelUnsubscribeEventListenerRequestType": [ - "privateChannelUnsubscribeEventListenerRequest", - ], - "PrivateChannelUnsubscribeEventListenerResponseType": [ - "privateChannelUnsubscribeEventListenerResponse", - ], - "PrivateChannelEventListenerTypes": [ - "onAddContextListener", - "onDisconnect", - "onUnsubscribe", - ], - "PrivateChannelAddEventListenerRequestType": [ - "privateChannelAddEventListenerRequest", - ], - "PrivateChannelAddEventListenerResponseType": [ - "privateChannelAddEventListenerResponse", - ], - "RaiseIntentForContextRequestType": [ - "raiseIntentForContextRequest", - ], - "RaiseIntentForContextResponseType": [ - "raiseIntentForContextResponse", - ], - "RaiseIntentRequestType": [ - "raiseIntentRequest", - ], - "RaiseIntentResponseType": [ - "raiseIntentResponse", - ], - "RaiseIntentResultResponseType": [ - "raiseIntentResultResponse", - ], -}; diff --git a/packages/fdc3-context/generated/bridging/BridgingTypes.ts b/packages/fdc3-context/generated/bridging/BridgingTypes.ts deleted file mode 100644 index ec0a3b481..000000000 --- a/packages/fdc3-context/generated/bridging/BridgingTypes.ts +++ /dev/null @@ -1,6058 +0,0 @@ -// To parse this data: -// -// import { Convert, AgentErrorResponseMessage, AgentRequestMessage, AgentResponseMessage, BridgeErrorResponseMessage, BridgeRequestMessage, BridgeResponseMessage, BroadcastAgentRequest, BroadcastBridgeRequest, ConnectionStepMessage, ConnectionStep2Hello, ConnectionStep3Handshake, ConnectionStep4AuthenticationFailed, ConnectionStep6ConnectedAgentsUpdate, FindInstancesAgentErrorResponse, FindInstancesAgentRequest, FindInstancesAgentResponse, FindInstancesBridgeErrorResponse, FindInstancesBridgeRequest, FindInstancesBridgeResponse, FindIntentAgentErrorResponse, FindIntentAgentRequest, FindIntentAgentResponse, FindIntentBridgeErrorResponse, FindIntentBridgeRequest, FindIntentBridgeResponse, FindIntentsByContextAgentErrorResponse, FindIntentsByContextAgentRequest, FindIntentsByContextAgentResponse, FindIntentsByContextBridgeErrorResponse, FindIntentsByContextBridgeRequest, FindIntentsByContextBridgeResponse, GetAppMetadataAgentErrorResponse, GetAppMetadataAgentRequest, GetAppMetadataAgentResponse, GetAppMetadataBridgeErrorResponse, GetAppMetadataBridgeRequest, GetAppMetadataBridgeResponse, OpenAgentErrorResponse, OpenAgentRequest, OpenAgentResponse, OpenBridgeErrorResponse, OpenBridgeRequest, OpenBridgeResponse, PrivateChannelBroadcastAgentRequest, PrivateChannelBroadcastBridgeRequest, PrivateChannelEventListenerAddedAgentRequest, PrivateChannelEventListenerAddedBridgeRequest, PrivateChannelEventListenerRemovedAgentRequest, PrivateChannelEventListenerRemovedBridgeRequest, PrivateChannelOnAddContextListenerAgentRequest, PrivateChannelOnAddContextListenerBridgeRequest, PrivateChannelOnDisconnectAgentRequest, PrivateChannelOnDisconnectBridgeRequest, PrivateChannelOnUnsubscribeAgentRequest, PrivateChannelOnUnsubscribeBridgeRequest, RaiseIntentAgentErrorResponse, RaiseIntentAgentRequest, RaiseIntentAgentResponse, RaiseIntentBridgeErrorResponse, RaiseIntentBridgeRequest, RaiseIntentBridgeResponse, RaiseIntentResultAgentErrorResponse, RaiseIntentResultAgentResponse, RaiseIntentResultBridgeErrorResponse, RaiseIntentResultBridgeResponse } from "./file"; -// -// const agentErrorResponseMessage = Convert.toAgentErrorResponseMessage(json); -// const agentRequestMessage = Convert.toAgentRequestMessage(json); -// const agentResponseMessage = Convert.toAgentResponseMessage(json); -// const bridgeErrorResponseMessage = Convert.toBridgeErrorResponseMessage(json); -// const bridgeRequestMessage = Convert.toBridgeRequestMessage(json); -// const bridgeResponseMessage = Convert.toBridgeResponseMessage(json); -// const broadcastAgentRequest = Convert.toBroadcastAgentRequest(json); -// const broadcastBridgeRequest = Convert.toBroadcastBridgeRequest(json); -// const bridgeCommonDefinitions = Convert.toBridgeCommonDefinitions(json); -// const connectionStepMessage = Convert.toConnectionStepMessage(json); -// const connectionStep2Hello = Convert.toConnectionStep2Hello(json); -// const connectionStep3Handshake = Convert.toConnectionStep3Handshake(json); -// const connectionStep4AuthenticationFailed = Convert.toConnectionStep4AuthenticationFailed(json); -// const connectionStep6ConnectedAgentsUpdate = Convert.toConnectionStep6ConnectedAgentsUpdate(json); -// const findInstancesAgentErrorResponse = Convert.toFindInstancesAgentErrorResponse(json); -// const findInstancesAgentRequest = Convert.toFindInstancesAgentRequest(json); -// const findInstancesAgentResponse = Convert.toFindInstancesAgentResponse(json); -// const findInstancesBridgeErrorResponse = Convert.toFindInstancesBridgeErrorResponse(json); -// const findInstancesBridgeRequest = Convert.toFindInstancesBridgeRequest(json); -// const findInstancesBridgeResponse = Convert.toFindInstancesBridgeResponse(json); -// const findIntentAgentErrorResponse = Convert.toFindIntentAgentErrorResponse(json); -// const findIntentAgentRequest = Convert.toFindIntentAgentRequest(json); -// const findIntentAgentResponse = Convert.toFindIntentAgentResponse(json); -// const findIntentBridgeErrorResponse = Convert.toFindIntentBridgeErrorResponse(json); -// const findIntentBridgeRequest = Convert.toFindIntentBridgeRequest(json); -// const findIntentBridgeResponse = Convert.toFindIntentBridgeResponse(json); -// const findIntentsByContextAgentErrorResponse = Convert.toFindIntentsByContextAgentErrorResponse(json); -// const findIntentsByContextAgentRequest = Convert.toFindIntentsByContextAgentRequest(json); -// const findIntentsByContextAgentResponse = Convert.toFindIntentsByContextAgentResponse(json); -// const findIntentsByContextBridgeErrorResponse = Convert.toFindIntentsByContextBridgeErrorResponse(json); -// const findIntentsByContextBridgeRequest = Convert.toFindIntentsByContextBridgeRequest(json); -// const findIntentsByContextBridgeResponse = Convert.toFindIntentsByContextBridgeResponse(json); -// const getAppMetadataAgentErrorResponse = Convert.toGetAppMetadataAgentErrorResponse(json); -// const getAppMetadataAgentRequest = Convert.toGetAppMetadataAgentRequest(json); -// const getAppMetadataAgentResponse = Convert.toGetAppMetadataAgentResponse(json); -// const getAppMetadataBridgeErrorResponse = Convert.toGetAppMetadataBridgeErrorResponse(json); -// const getAppMetadataBridgeRequest = Convert.toGetAppMetadataBridgeRequest(json); -// const getAppMetadataBridgeResponse = Convert.toGetAppMetadataBridgeResponse(json); -// const openAgentErrorResponse = Convert.toOpenAgentErrorResponse(json); -// const openAgentRequest = Convert.toOpenAgentRequest(json); -// const openAgentResponse = Convert.toOpenAgentResponse(json); -// const openBridgeErrorResponse = Convert.toOpenBridgeErrorResponse(json); -// const openBridgeRequest = Convert.toOpenBridgeRequest(json); -// const openBridgeResponse = Convert.toOpenBridgeResponse(json); -// const privateChannelBroadcastAgentRequest = Convert.toPrivateChannelBroadcastAgentRequest(json); -// const privateChannelBroadcastBridgeRequest = Convert.toPrivateChannelBroadcastBridgeRequest(json); -// const privateChannelEventListenerAddedAgentRequest = Convert.toPrivateChannelEventListenerAddedAgentRequest(json); -// const privateChannelEventListenerAddedBridgeRequest = Convert.toPrivateChannelEventListenerAddedBridgeRequest(json); -// const privateChannelEventListenerRemovedAgentRequest = Convert.toPrivateChannelEventListenerRemovedAgentRequest(json); -// const privateChannelEventListenerRemovedBridgeRequest = Convert.toPrivateChannelEventListenerRemovedBridgeRequest(json); -// const privateChannelOnAddContextListenerAgentRequest = Convert.toPrivateChannelOnAddContextListenerAgentRequest(json); -// const privateChannelOnAddContextListenerBridgeRequest = Convert.toPrivateChannelOnAddContextListenerBridgeRequest(json); -// const privateChannelOnDisconnectAgentRequest = Convert.toPrivateChannelOnDisconnectAgentRequest(json); -// const privateChannelOnDisconnectBridgeRequest = Convert.toPrivateChannelOnDisconnectBridgeRequest(json); -// const privateChannelOnUnsubscribeAgentRequest = Convert.toPrivateChannelOnUnsubscribeAgentRequest(json); -// const privateChannelOnUnsubscribeBridgeRequest = Convert.toPrivateChannelOnUnsubscribeBridgeRequest(json); -// const raiseIntentAgentErrorResponse = Convert.toRaiseIntentAgentErrorResponse(json); -// const raiseIntentAgentRequest = Convert.toRaiseIntentAgentRequest(json); -// const raiseIntentAgentResponse = Convert.toRaiseIntentAgentResponse(json); -// const raiseIntentBridgeErrorResponse = Convert.toRaiseIntentBridgeErrorResponse(json); -// const raiseIntentBridgeRequest = Convert.toRaiseIntentBridgeRequest(json); -// const raiseIntentBridgeResponse = Convert.toRaiseIntentBridgeResponse(json); -// const raiseIntentResultAgentErrorResponse = Convert.toRaiseIntentResultAgentErrorResponse(json); -// const raiseIntentResultAgentResponse = Convert.toRaiseIntentResultAgentResponse(json); -// const raiseIntentResultBridgeErrorResponse = Convert.toRaiseIntentResultBridgeErrorResponse(json); -// const raiseIntentResultBridgeResponse = Convert.toRaiseIntentResultBridgeResponse(json); -// -// These functions will throw an error if the JSON doesn't -// match the expected interface, even if the JSON is valid. - -/** - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface AgentErrorResponseMessage { - meta: AgentResponseMetadata; - /** - * Error message payload containing an standardized error string. - */ - payload: ErrorResponseMessagePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: ResponseMessageType; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface AgentResponseMetadata { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface ErrorResponseMessagePayload { - error: ResponseErrorDetail; - [property: string]: any; -} - -/** - * Array of error message strings for responses that were not returned to the bridge before - * the timeout or because an error occurred. Should be the same length as the `errorSources` - * array and ordered the same. May be omitted if all sources responded without errors. - * - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type ResponseErrorDetail = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ -export type ResponseMessageType = "findInstancesResponse" | "findIntentResponse" | "findIntentsByContextResponse" | "getAppMetadataResponse" | "openResponse" | "raiseIntentResponse" | "raiseIntentResultResponse"; - -/** - * A request message from a Desktop Agent to the Bridge. - */ -export interface AgentRequestMessage { - meta: AgentRequestMetadata; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: RequestMessageType; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface AgentRequestMetadata { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: BridgeParticipantIdentifier; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceIdentifier; - timestamp: Date; -} - -/** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - * - * Represents identifiers that MUST include the Desktop Agent name and MAY identify a - * specific app or instance. - * - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface BridgeParticipantIdentifier { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - * - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent: string; - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - * - * Field that represents the source application that a request or response was received - * from, or the source Desktop Agent if it issued the request or response itself. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - */ -export interface SourceIdentifier { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId?: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - * - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - */ - desktopAgent?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ -export type RequestMessageType = "broadcastRequest" | "findInstancesRequest" | "findIntentRequest" | "findIntentsByContextRequest" | "getAppMetadataRequest" | "openRequest" | "PrivateChannel.broadcast" | "PrivateChannel.eventListenerAdded" | "PrivateChannel.eventListenerRemoved" | "PrivateChannel.onAddContextListener" | "PrivateChannel.onDisconnect" | "PrivateChannel.onUnsubscribe" | "raiseIntentRequest"; - -/** - * A response message from a Desktop Agent to the Bridge. - */ -export interface AgentResponseMessage { - meta: AgentResponseMetadata; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: ResponseMessageType; -} - -/** - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface BridgeErrorResponseMessage { - meta: BridgeErrorResponseMessageMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: ResponseErrorMessagePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: string; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface BridgeErrorResponseMessageMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - */ -export interface DesktopAgentIdentifier { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - */ - desktopAgent: string; - [property: string]: any; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface ResponseErrorMessagePayload { - error?: ResponseErrorDetail; - [property: string]: any; -} - -/** - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface BridgeRequestMessage { - meta: BridgeRequestMetadata; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: string; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface BridgeRequestMetadata { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: BridgeParticipantIdentifier; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: BridgeParticipantIdentifier; - timestamp: Date; -} - -/** - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface BridgeResponseMessage { - meta: BridgeResponseMessageMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: string; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface BridgeResponseMessageMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * A request to broadcast context on a channel. - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface BroadcastAgentRequest { - meta: BroadcastAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: BroadcastAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "broadcastRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface BroadcastAgentRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source: SourceObject; - timestamp: Date; -} - -/** - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - * - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - * - * Field that represents the source application that a request or response was received - * from, or the source Desktop Agent if it issued the request or response itself. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - */ -export interface SourceObject { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - * - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - */ - desktopAgent?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface BroadcastAgentRequestPayload { - /** - * The Id of the Channel that the broadcast was sent on - */ - channelId: string; - /** - * The context object that is to be broadcast. - */ - context: Context; -} - -/** - * The context object that is to be broadcast. - * - * The context object that was the payload of a broadcast message. - * - * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by - * FDC3 operations. As such, it is not really meant to be used on its own, but is imported - * by more specific type definitions (standardized or custom) to provide the structure and - * properties shared by all FDC3 context data types. - * - * The key element of FDC3 context types is their mandatory `type` property, which is used - * to identify what type of data the object represents, and what shape it has. - * - * The FDC3 context type, and all derived types, define the minimum set of fields a context - * data object of a particular type can be expected to have, but this can always be extended - * with custom fields as appropriate. - */ -export interface Context { - /** - * Context data objects may include a set of equivalent key-value pairs that can be used to - * help applications identify and look up the context type they receive in their own domain. - * The idea behind this design is that applications can provide as many equivalent - * identifiers to a target application as possible, e.g. an instrument may be represented by - * an ISIN, CUSIP or Bloomberg identifier. - * - * Identifiers do not make sense for all types of data, so the `id` property is therefore - * optional, but some derived types may choose to require at least one identifier. - * Identifier values SHOULD always be of type string. - */ - id?: { [key: string]: any }; - /** - * Context data objects may include a name property that can be used for more information, - * or display purposes. Some derived types may require the name object as mandatory, - * depending on use case. - */ - name?: string; - /** - * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 - * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present - * to route shared context data appropriately. - * - * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data - * types they support in an FDC3 [App - * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery - * and routing. - * - * Standardized FDC3 context types have well-known `type` properties prefixed with the - * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and - * used by a particular organization, the convention is to prefix them with an - * organization-specific namespace, e.g. `blackrock.fund`. - * - * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more - * information about context data types. - */ - type: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to broadcast context on a channel. - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface BroadcastBridgeRequest { - meta: BroadcastBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: BroadcastBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "broadcastRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface BroadcastBridgeRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - * - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - * - * Represents identifiers that MUST include the Desktop Agent name and MAY identify a - * specific app or instance. - * - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - */ -export interface MetaSource { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - * - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - */ - desktopAgent: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface BroadcastBridgeRequestPayload { - /** - * The Id of the Channel that the broadcast was sent on - */ - channelId: string; - /** - * The context object that is to be broadcast. - */ - context: Context; -} - -/** - * A message used during the connection flow for a Desktop Agent to the Bridge. Used for - * messages sent in either direction. - */ -export interface ConnectionStepMessage { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the connection step message. - */ - type: ConnectionStepMessageType; -} - -/** - * Metadata for this connection step message. - */ -export interface ConnectionStepMetadata { - requestUuid?: string; - responseUuid?: string; - timestamp: Date; -} - -/** - * Identifies the type of the connection step message. - */ -export type ConnectionStepMessageType = "hello" | "handshake" | "authenticationFailed" | "connectedAgentsUpdate"; - -/** - * Hello message sent by the Bridge to anyone connecting to the Bridge (enables - * identification as a bridge and confirmation of whether authentication is required) - * - * A message used during the connection flow for a Desktop Agent to the Bridge. Used for - * messages sent in either direction. - */ -export interface ConnectionStep2Hello { - meta: ConnectionStep2HelloMeta; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: ConnectionStep2HelloPayload; - /** - * Identifies the type of the connection step message. - */ - type: "hello"; -} - -/** - * Metadata for this connection step message. - */ -export interface ConnectionStep2HelloMeta { - timestamp: Date; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface ConnectionStep2HelloPayload { - /** - * A flag indicating whether the Desktop Agent Bridge requires authentication or not. - */ - authRequired: boolean; - /** - * An optional Desktop Agent Bridge JWT authentication token if the Desktop Agent want to - * authenticate a bridge. - */ - authToken?: string; - /** - * The version of the Bridge - */ - desktopAgentBridgeVersion: string; - /** - * The FDC3 versions supported by the Bridge - */ - supportedFDC3Versions: string[]; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Handshake message sent by the Desktop Agent to the Bridge (including requested name, - * channel state and authentication data) - * - * A message used during the connection flow for a Desktop Agent to the Bridge. Used for - * messages sent in either direction. - */ -export interface ConnectionStep3Handshake { - meta: ConnectionStep3HandshakeMeta; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: ConnectionStep3HandshakePayload; - /** - * Identifies the type of the connection step message. - */ - type: "handshake"; -} - -/** - * Metadata for this connection step message. - */ -export interface ConnectionStep3HandshakeMeta { - requestUuid: string; - timestamp: Date; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface ConnectionStep3HandshakePayload { - authToken?: string; - /** - * 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]: Context[] }; - /** - * Desktop Agent ImplementationMetadata trying to connect to the bridge. - */ - implementationMetadata: ConnectingAgentImplementationMetadata; - /** - * The requested Desktop Agent name - */ - requestedName: string; -} - -/** - * Desktop Agent ImplementationMetadata trying to connect to the bridge. - * - * Metadata relating to the FDC3 Desktop Agent implementation and its provider. - */ -export interface ConnectingAgentImplementationMetadata { - /** - * The version number of the FDC3 specification that the implementation provides. - * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. - */ - fdc3Version: string; - /** - * Metadata indicating whether the Desktop Agent implements optional features of - * the Desktop Agent API. - */ - optionalFeatures: OptionalFeatures; - /** - * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, - * OpenFin etc.). - */ - provider: string; - /** - * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). - */ - providerVersion?: string; -} - -/** - * Metadata indicating whether the Desktop Agent implements optional features of - * the Desktop Agent API. - */ -export interface OptionalFeatures { - /** - * Used to indicate whether the experimental Desktop Agent Bridging - * feature is implemented by the Desktop Agent. - */ - DesktopAgentBridging: boolean; - /** - * Used to indicate whether the exposure of 'originating app metadata' for - * context and intent messages is supported by the Desktop Agent. - */ - OriginatingAppMetadata: boolean; - /** - * Used to indicate whether the optional `fdc3.joinUserChannel`, - * `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by - * the Desktop Agent. - */ - UserChannelMembershipAPIs: boolean; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Message sent by Bridge to Desktop Agent if their authentication fails. - * - * A message used during the connection flow for a Desktop Agent to the Bridge. Used for - * messages sent in either direction. - */ -export interface ConnectionStep4AuthenticationFailed { - meta: ConnectionStep4AuthenticationFailedMeta; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: ConnectionStep4AuthenticationFailedPayload; - /** - * Identifies the type of the connection step message. - */ - type: "authenticationFailed"; -} - -/** - * Metadata for this connection step message. - */ -export interface ConnectionStep4AuthenticationFailedMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface ConnectionStep4AuthenticationFailedPayload { - message?: string; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Message sent by Bridge to all Desktop Agent when an agent joins or leaves the bridge, - * includes the details of all agents, the change made and the expected channel state for - * all agents. - * - * A message used during the connection flow for a Desktop Agent to the Bridge. Used for - * messages sent in either direction. - */ -export interface ConnectionStep6ConnectedAgentsUpdate { - meta: ConnectionStep6ConnectedAgentsUpdateMeta; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: ConnectionStep6ConnectedAgentsUpdatePayload; - /** - * Identifies the type of the connection step message. - */ - type: "connectedAgentsUpdate"; -} - -/** - * Metadata for this connection step message. - */ -export interface ConnectionStep6ConnectedAgentsUpdateMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface ConnectionStep6ConnectedAgentsUpdatePayload { - /** - * Should be set when an agent first connects to the bridge and provide its assigned name. - */ - addAgent?: string; - /** - * Desktop Agent Bridge implementation metadata of all connected agents. - */ - allAgents: DesktopAgentImplementationMetadata[]; - /** - * The updated state of channels that should be adopted by the agents. Should only be set - * when an agent is connecting to the bridge. - */ - channelsState?: { [key: string]: Context[] }; - /** - * Should be set when an agent disconnects from the bridge and provide the name that no - * longer is assigned. - */ - removeAgent?: string; -} - -/** - * Includes the name assigned to the Desktop Agent by the Bridge. - * - * Metadata relating to the FDC3 Desktop Agent implementation and its provider. - */ -export interface DesktopAgentImplementationMetadata { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a particular Desktop - * Agent. - */ - desktopAgent: string; - /** - * The version number of the FDC3 specification that the implementation provides. - * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. - */ - fdc3Version: string; - /** - * Metadata indicating whether the Desktop Agent implements optional features of - * the Desktop Agent API. - */ - optionalFeatures: OptionalFeatures; - /** - * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, - * OpenFin etc.). - */ - provider: string; - /** - * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). - */ - providerVersion?: string; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * A response to a findInstances request that contains an error. - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface FindInstancesAgentErrorResponse { - meta: FindInstancesAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: PayloadClass; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findInstancesResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface FindInstancesAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface PayloadClass { - error: FindInstancesErrors; -} - -/** - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - * - * Should be set if the raiseIntent request returned an error. - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - * - * Array of error message strings for responses that were not returned to the bridge before - * the timeout or because an error occurred. Should be the same length as the `errorSources` - * array and ordered the same. May be omitted if all sources responded without errors. - * - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - */ -export type FindInstancesErrors = "DesktopAgentNotFound" | "IntentDeliveryFailed" | "MalformedContext" | "NoAppsFound" | "ResolverTimeout" | "ResolverUnavailable" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request for details of instances of a particular app - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface FindInstancesAgentRequest { - meta: FindInstancesAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindInstancesAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findInstancesRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface FindInstancesAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: DestinationObject; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceIdentifier; - timestamp: Date; -} - -/** - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - * - * Represents identifiers that MUST include the Desktop Agent name and MAY identify a - * specific app or instance. - * - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - * - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface DestinationObject { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - * - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent: string; - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindInstancesAgentRequestPayload { - app: AppIdentifier; -} - -/** - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface AppIdentifier { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A response to a findInstances request. - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface FindInstancesAgentResponse { - meta: AgentResponseMetadata; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: FindInstancesAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findInstancesResponse"; -} - -/** - * The message payload contains a flag indicating whether the API call was successful, plus - * any return values for the FDC3 API function called, or indicating that the request - * resulted in an error and including a standardized error message. - * - * The message payload typically contains return values for FDC3 API functions. - */ -export interface FindInstancesAgentResponsePayload { - appIdentifiers: AppMetadata[]; -} - -/** - * Extends an `AppIdentifier`, describing an application or instance of an application, with - * additional descriptive metadata that is usually provided by an FDC3 App Directory that - * the desktop agent connects to. - * - * The additional information from an app directory can aid in rendering UI elements, such - * as a launcher menu or resolver UI. This includes a title, description, tooltip and icon - * and screenshot URLs. - * - * Note that as `AppMetadata` instances are also `AppIdentifiers` they may be passed to the - * `app` argument of `fdc3.open`, `fdc3.raiseIntent` etc. - */ -export interface AppMetadata { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * A longer, multi-paragraph description for the application that could include markup - */ - description?: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent?: string; - /** - * A list of icon URLs for the application that can be used to render UI elements - */ - icons?: Icon[]; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - /** - * An optional set of, implementation specific, metadata fields that can be used to - * disambiguate instances, such as a window title or screen position. Must only be set if - * `instanceId` is set. - */ - instanceMetadata?: { [key: string]: any }; - /** - * The 'friendly' app name. - * This field was used with the `open` and `raiseIntent` calls in FDC3 <2.0, which now - * require an `AppIdentifier` wth `appId` set. - * Note that for display purposes the `title` field should be used, if set, in preference to - * this field. - */ - name?: string; - /** - * The type of output returned for any intent specified during resolution. May express a - * particular context type (e.g. "fdc3.instrument"), channel (e.g. "channel") or a channel - * that will receive a specified type (e.g. "channel"). - */ - resultType?: null | string; - /** - * Images representing the app in common usage scenarios that can be used to render UI - * elements - */ - screenshots?: Image[]; - /** - * A more user-friendly application title that can be used to render UI elements - */ - title?: string; - /** - * A tooltip for the application that can be used to render UI elements - */ - tooltip?: string; - /** - * The Version of the application. - */ - version?: string; -} - -/** - * SPDX-License-Identifier: Apache-2.0 - * Copyright FINOS FDC3 contributors - see NOTICE file - */ -export interface Icon { - /** - * The icon dimension, formatted as `x`. - */ - size?: string; - /** - * The icon url - */ - src: string; - /** - * Icon media type. If not present the Desktop Agent may use the src file extension. - */ - type?: string; -} - -/** - * SPDX-License-Identifier: Apache-2.0 - * Copyright FINOS FDC3 contributors - see NOTICE file - */ -export interface Image { - /** - * Caption for the image. - */ - label?: string; - /** - * The image dimension, formatted as `x`. - */ - size?: string; - /** - * The image url. - */ - src: string; - /** - * Image media type. If not present the Desktop Agent may use the src file extension. - */ - type?: string; -} - -/** - * A response to a findInstances request that contains an error. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface FindInstancesBridgeErrorResponse { - meta: FindInstancesBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: MessagePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findInstancesResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface FindInstancesBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface MessagePayload { - error: FindInstancesErrors; -} - -/** - * A request for details of instances of a particular app - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface FindInstancesBridgeRequest { - meta: FindInstancesBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindInstancesBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findInstancesRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface FindInstancesBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: DestinationObject; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSourceObject; - timestamp: Date; -} - -/** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - * - * Field that represents the source application that a request or response was received - * from, or the source Desktop Agent if it issued the request or response itself. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - * - * Represents identifiers that MUST include the Desktop Agent name and MAY identify a - * specific app or instance. - * - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - * - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - */ -export interface MetaSourceObject { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId?: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - * - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - */ - desktopAgent: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindInstancesBridgeRequestPayload { - app: AppIdentifier; -} - -/** - * A response to a findInstances request. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface FindInstancesBridgeResponse { - meta: BridgeResponseMessageMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: FindInstancesBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findInstancesResponse"; -} - -/** - * The message payload contains a flag indicating whether the API call was successful, plus - * any return values for the FDC3 API function called, or indicating that the request - * resulted in an error and including a standardized error message. - * - * The message payload typically contains return values for FDC3 API functions. - */ -export interface FindInstancesBridgeResponsePayload { - appIdentifiers: AppMetadata[]; -} - -/** - * A response to a findIntent request that contains an error. - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface FindIntentAgentErrorResponse { - meta: FindIntentAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: FindIntentAgentErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface FindIntentAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface FindIntentAgentErrorResponsePayload { - error: FindInstancesErrors; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request for details of apps available to resolve a particular intent and context pair. - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface FindIntentAgentRequest { - meta: FindIntentAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindIntentAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findIntentRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface FindIntentAgentRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceIdentifier; - timestamp: Date; - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: BridgeParticipantIdentifier; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindIntentAgentRequestPayload { - context?: Context; - intent: string; - resultType?: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A response to a findIntent request. - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface FindIntentAgentResponse { - meta: FindIntentAgentResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: FindIntentAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface FindIntentAgentResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface FindIntentAgentResponsePayload { - appIntent: AppIntent; -} - -/** - * An interface that relates an intent to apps - */ -export interface AppIntent { - /** - * Details of applications that can resolve the intent. - */ - apps: AppMetadata[]; - /** - * Details of the intent whose relationship to resolving applications is being described. - */ - intent: IntentMetadata; -} - -/** - * Details of the intent whose relationship to resolving applications is being described. - * - * Intent descriptor - */ -export interface IntentMetadata { - /** - * Display name for the intent. - */ - displayName?: string; - /** - * The unique name of the intent that can be invoked by the raiseIntent call - */ - name: string; -} - -/** - * A response to a findIntent request that contains an error. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface FindIntentBridgeErrorResponse { - meta: FindIntentBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: FindIntentBridgeErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface FindIntentBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface FindIntentBridgeErrorResponsePayload { - error: FindInstancesErrors; -} - -/** - * A request for details of apps available to resolve a particular intent and context pair. - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface FindIntentBridgeRequest { - meta: FindIntentBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindIntentBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findIntentRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface FindIntentBridgeRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: BridgeParticipantIdentifier; - timestamp: Date; - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: BridgeParticipantIdentifier; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindIntentBridgeRequestPayload { - context?: Context; - intent: string; - resultType?: string; -} - -/** - * A response to a findIntent request. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface FindIntentBridgeResponse { - meta: FindIntentBridgeResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: FindIntentBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface FindIntentBridgeResponseMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface FindIntentBridgeResponsePayload { - appIntent: AppIntent; -} - -/** - * A response to a findIntentsByContext request that contains an error. - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface FindIntentsByContextAgentErrorResponse { - meta: FindIntentsByContextAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: FindIntentsByContextAgentErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentsByContextResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface FindIntentsByContextAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface FindIntentsByContextAgentErrorResponsePayload { - error: FindInstancesErrors; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request for details of intents and apps available to resolve them for a particular - * context. - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface FindIntentsByContextAgentRequest { - meta: FindIntentsByContextAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindIntentsByContextAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findIntentsByContextRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface FindIntentsByContextAgentRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: BridgeParticipantIdentifier; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindIntentsByContextAgentRequestPayload { - context: Context; - resultType?: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A response to a findIntentsByContext request. - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface FindIntentsByContextAgentResponse { - meta: FindIntentsByContextAgentResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: FindIntentsByContextAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentsByContextResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface FindIntentsByContextAgentResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface FindIntentsByContextAgentResponsePayload { - appIntents: AppIntent[]; -} - -/** - * A response to a findIntentsByContext request that contains an error. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface FindIntentsByContextBridgeErrorResponse { - meta: FindIntentsByContextBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: FindIntentsByContextBridgeErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentsByContextResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface FindIntentsByContextBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface FindIntentsByContextBridgeErrorResponsePayload { - error: FindInstancesErrors; -} - -/** - * A request for details of intents and apps available to resolve them for a particular - * context. - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface FindIntentsByContextBridgeRequest { - meta: FindIntentsByContextBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindIntentsByContextBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findIntentsByContextRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface FindIntentsByContextBridgeRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: BridgeParticipantIdentifier; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindIntentsByContextBridgeRequestPayload { - context: Context; - resultType?: string; -} - -/** - * A response to a findIntentsByContext request. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface FindIntentsByContextBridgeResponse { - meta: FindIntentsByContextBridgeResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: FindIntentsByContextBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentsByContextResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface FindIntentsByContextBridgeResponseMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface FindIntentsByContextBridgeResponsePayload { - appIntents: AppIntent[]; -} - -/** - * A response to a getAppMetadata request that contains an error. - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface GetAppMetadataAgentErrorResponse { - meta: GetAppMetadataAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: GetAppMetadataAgentErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getAppMetadataResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface GetAppMetadataAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface GetAppMetadataAgentErrorResponsePayload { - error: FindInstancesErrors; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request for metadata about an app - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface GetAppMetadataAgentRequest { - meta: GetAppMetadataAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetAppMetadataAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getAppMetadataRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface GetAppMetadataAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: DestinationObject; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceIdentifier; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetAppMetadataAgentRequestPayload { - app: AppObject; -} - -/** - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface AppObject { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - * - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent: string; - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A response to a getAppMetadata request. - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface GetAppMetadataAgentResponse { - meta: GetAppMetadataAgentResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: GetAppMetadataAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getAppMetadataResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface GetAppMetadataAgentResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface GetAppMetadataAgentResponsePayload { - appMetadata: AppMetadata; -} - -/** - * A response to a getAppMetadata request that contains an error. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface GetAppMetadataBridgeErrorResponse { - meta: GetAppMetadataBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: GetAppMetadataBridgeErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getAppMetadataResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface GetAppMetadataBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface GetAppMetadataBridgeErrorResponsePayload { - error: FindInstancesErrors; -} - -/** - * A request for metadata about an app - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface GetAppMetadataBridgeRequest { - meta: GetAppMetadataBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetAppMetadataBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getAppMetadataRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface GetAppMetadataBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: DestinationObject; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetAppMetadataBridgeRequestPayload { - app: AppObject; -} - -/** - * A response to a getAppMetadata request. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface GetAppMetadataBridgeResponse { - meta: GetAppMetadataBridgeResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: GetAppMetadataBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getAppMetadataResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface GetAppMetadataBridgeResponseMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface GetAppMetadataBridgeResponsePayload { - appMetadata: AppMetadata; -} - -/** - * A response to an open request that contains an error - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface OpenAgentErrorResponse { - meta: OpenAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: OpenAgentErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "openResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface OpenAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface OpenAgentErrorResponsePayload { - error: OpenErrorResponsePayload; -} - -/** - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Array of error message strings for responses that were not returned to the bridge before - * the timeout or because an error occurred. Should be the same length as the `errorSources` - * array and ordered the same. May be omitted if all sources responded without errors. - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type OpenErrorResponsePayload = "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "MalformedContext" | "ResolverUnavailable" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to open an application - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface OpenAgentRequest { - meta: OpenAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: OpenAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "openRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface OpenAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: DestinationObject; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface OpenAgentRequestPayload { - /** - * The application to open on the specified Desktop Agent - */ - app: AppToOpen; - context?: Context; -} - -/** - * The application to open on the specified Desktop Agent - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface AppToOpen { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - * - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent: string; - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A response to an open request - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface OpenAgentResponse { - meta: OpenAgentResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: OpenAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "openResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface OpenAgentResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface OpenAgentResponsePayload { - appIdentifier: AppIdentifier; -} - -/** - * A response to an open request that contains an error - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface OpenBridgeErrorResponse { - meta: OpenBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: OpenBridgeErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "openResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface OpenBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface OpenBridgeErrorResponsePayload { - error: OpenErrorResponsePayload; -} - -/** - * A request to open an application - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface OpenBridgeRequest { - meta: OpenBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: OpenBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "openRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface OpenBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: DestinationObject; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface OpenBridgeRequestPayload { - /** - * The application to open on the specified Desktop Agent - */ - app: AppToOpen; - context?: Context; -} - -/** - * A response to an open request - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface OpenBridgeResponse { - meta: OpenBridgeResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: OpenBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "openResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface OpenBridgeResponseMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface OpenBridgeResponsePayload { - appIdentifier: AppIdentifier; -} - -/** - * A request to broadcast on a PrivateChannel. - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface PrivateChannelBroadcastAgentRequest { - meta: PrivateChannelBroadcastAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelBroadcastAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.broadcast"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface PrivateChannelBroadcastAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; -} - -/** - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - * - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - * - * Represents identifiers that MUST include the Desktop Agent name and MAY identify a - * specific app or instance. - * - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ -export interface MetaDestination { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - * - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent: string; - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelBroadcastAgentRequestPayload { - /** - * The Id of the PrivateChannel that the broadcast was sent on - */ - channelId: string; - /** - * The context object that was the payload of a broadcast message. - */ - context: Context; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to broadcast on a PrivateChannel. - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface PrivateChannelBroadcastBridgeRequest { - meta: PrivateChannelBroadcastBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelBroadcastBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.broadcast"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface PrivateChannelBroadcastBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelBroadcastBridgeRequestPayload { - /** - * The Id of the PrivateChannel that the broadcast was sent on - */ - channelId: string; - /** - * The context object that was the payload of a broadcast message. - */ - context: Context; -} - -/** - * A request to forward on an EventListenerAdded event, relating to a PrivateChannel - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface PrivateChannelEventListenerAddedAgentRequest { - meta: PrivateChannelEventListenerAddedAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelEventListenerAddedAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.eventListenerAdded"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface PrivateChannelEventListenerAddedAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelEventListenerAddedAgentRequestPayload { - /** - * The id of the PrivateChannel that the event listener was added to. - */ - channelId: string; - listenerType: PrivateChannelEventListenerTypes; -} - -/** - * Event listener type names for Private Channel events - */ -export type PrivateChannelEventListenerTypes = "onAddContextListener" | "onUnsubscribe" | "onDisconnect"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to forward on an EventListenerAdded event, relating to a PrivateChannel - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface PrivateChannelEventListenerAddedBridgeRequest { - meta: PrivateChannelEventListenerAddedBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelEventListenerAddedBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.eventListenerAdded"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface PrivateChannelEventListenerAddedBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelEventListenerAddedBridgeRequestPayload { - /** - * The id of the PrivateChannel that the event listener was added to. - */ - channelId: string; - listenerType: PrivateChannelEventListenerTypes; -} - -/** - * A request to forward on an EventListenerRemoved event, relating to a PrivateChannel - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface PrivateChannelEventListenerRemovedAgentRequest { - meta: PrivateChannelEventListenerRemovedAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelEventListenerRemovedAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.eventListenerRemoved"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface PrivateChannelEventListenerRemovedAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelEventListenerRemovedAgentRequestPayload { - /** - * The id of the PrivateChannel that the event listener was removed from. - */ - channelId: string; - listenerType: PrivateChannelEventListenerTypes; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to forward on an EventListenerRemoved event, relating to a PrivateChannel - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface PrivateChannelEventListenerRemovedBridgeRequest { - meta: PrivateChannelEventListenerRemovedBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelEventListenerRemovedBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.eventListenerRemoved"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface PrivateChannelEventListenerRemovedBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelEventListenerRemovedBridgeRequestPayload { - /** - * The id of the PrivateChannel that the event listener was removed from. - */ - channelId: string; - listenerType: PrivateChannelEventListenerTypes; -} - -/** - * A request to forward on an AddContextListener event, relating to a PrivateChannel - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface PrivateChannelOnAddContextListenerAgentRequest { - meta: PrivateChannelOnAddContextListenerAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelOnAddContextListenerAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.onAddContextListener"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface PrivateChannelOnAddContextListenerAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelOnAddContextListenerAgentRequestPayload { - /** - * The id of the PrivateChannel that the context listener was added to. - */ - channelId: string; - /** - * The type of the context listener added. Should be null for an untyped listener. - */ - contextType: null | string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to forward on an AddContextListener event, relating to a PrivateChannel - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface PrivateChannelOnAddContextListenerBridgeRequest { - meta: PrivateChannelOnAddContextListenerBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelOnAddContextListenerBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.onAddContextListener"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface PrivateChannelOnAddContextListenerBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelOnAddContextListenerBridgeRequestPayload { - /** - * The id of the PrivateChannel that the context listener was added to. - */ - channelId: string; - /** - * The type of the context listener added. Should be null for an untyped listener. - */ - contextType: null | string; -} - -/** - * A request to forward on a Disconnect event, relating to a PrivateChannel - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface PrivateChannelOnDisconnectAgentRequest { - meta: PrivateChannelOnDisconnectAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelOnDisconnectAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.onDisconnect"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface PrivateChannelOnDisconnectAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelOnDisconnectAgentRequestPayload { - /** - * The id of the PrivateChannel that the agent discconnected from. - */ - channelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to forward on a Disconnect event, relating to a PrivateChannel - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface PrivateChannelOnDisconnectBridgeRequest { - meta: PrivateChannelOnDisconnectBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelOnDisconnectBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.onDisconnect"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface PrivateChannelOnDisconnectBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelOnDisconnectBridgeRequestPayload { - /** - * The id of the PrivateChannel that the agent discconnected from. - */ - channelId: string; -} - -/** - * A request to forward on an Unsubscribe event, relating to a PrivateChannel - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface PrivateChannelOnUnsubscribeAgentRequest { - meta: PrivateChannelOnUnsubscribeAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelOnUnsubscribeAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.onUnsubscribe"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface PrivateChannelOnUnsubscribeAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelOnUnsubscribeAgentRequestPayload { - /** - * The id of the PrivateChannel that the context listener was unsubscribed from. - */ - channelId: string; - /** - * The type of the context listener that was unsubscribed. Should be null for an untyped - * listener. - */ - contextType: null | string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to forward on an Unsubscribe event, relating to a PrivateChannel - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface PrivateChannelOnUnsubscribeBridgeRequest { - meta: ERequestMetadata; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelOnUnsubscribeBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.onUnsubscribe"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface ERequestMetadata { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelOnUnsubscribeBridgeRequestPayload { - /** - * The id of the PrivateChannel that the context listener was unsubscribed from. - */ - channelId: string; - /** - * The type of the context listener that was unsubscribed. Should be null for an untyped - * listener. - */ - contextType: null | string; -} - -/** - * A response to a request to raise an intent that contains an error. - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface RaiseIntentAgentErrorResponse { - meta: RaiseIntentAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: RaiseIntentAgentErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface RaiseIntentAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Used if a raiseIntent request resulted in an error - * - * Error message payload containing an standardized error string. - */ -export interface RaiseIntentAgentErrorResponsePayload { - /** - * Should be set if the raiseIntent request returned an error. - */ - error: FindInstancesErrors; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to raise an intent. - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface RaiseIntentAgentRequest { - meta: RaiseIntentAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: RaiseIntentAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "raiseIntentRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface RaiseIntentAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface RaiseIntentAgentRequestPayload { - app: AppDestinationIdentifier; - context: Context; - intent: string; -} - -/** - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface AppDestinationIdentifier { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - * - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent: string; - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A response to a request to raise an intent. - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface RaiseIntentAgentResponse { - meta: RaiseIntentAgentResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: RaiseIntentAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface RaiseIntentAgentResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface RaiseIntentAgentResponsePayload { - /** - * Used if the raiseIntent request was successfully resolved - */ - intentResolution: IntentResolution; -} - -/** - * Used if the raiseIntent request was successfully resolved - * - * IntentResolution provides a standard format for data returned upon resolving an intent. - * - * ```javascript - * //resolve a "Chain" type intent - * let resolution = await agent.raiseIntent("intentName", context); - * - * //resolve a "Client-Service" type intent with a data response or a Channel - * let resolution = await agent.raiseIntent("intentName", context); - * try { - * const result = await resolution.getResult(); - * if (result && result.broadcast) { - * console.log(`${resolution.source} returned a channel with id ${result.id}`); - * } else if (result){ - * console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`); - * } else { - * console.error(`${resolution.source} didn't return data` - * } - * } catch(error) { - * console.error(`${resolution.source} returned an error: ${error}`); - * } - * - * // Use metadata about the resolving app instance to target a further intent - * await agent.raiseIntent("intentName", context, resolution.source); - * ``` - */ -export interface IntentResolution { - /** - * The intent that was raised. May be used to determine which intent the user - * chose in response to `fdc3.raiseIntentForContext()`. - */ - intent: string; - /** - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ - source: AppIdentifier; -} - -/** - * A response to a request to raise an intent that contains an error. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface RaiseIntentBridgeErrorResponse { - meta: RaiseIntentBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: RaiseIntentBridgeErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface RaiseIntentBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Used if a raiseIntent request resulted in an error - * - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface RaiseIntentBridgeErrorResponsePayload { - /** - * Should be set if the raiseIntent request returned an error. - */ - error: FindInstancesErrors; -} - -/** - * A request to raise an intent. - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface RaiseIntentBridgeRequest { - meta: RaiseIntentBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: RaiseIntentBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "raiseIntentRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface RaiseIntentBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface RaiseIntentBridgeRequestPayload { - app: AppDestinationIdentifier; - context: Context; - intent: string; -} - -/** - * A response to a request to raise an intent. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface RaiseIntentBridgeResponse { - meta: RaiseIntentBridgeResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: RaiseIntentBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface RaiseIntentBridgeResponseMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface RaiseIntentBridgeResponsePayload { - /** - * Used if the raiseIntent request was successfully resolved - */ - intentResolution: IntentResolution; -} - -/** - * A secondary response to a request to raise an intent used to deliver the intent result, - * which contains an error - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface RaiseIntentResultAgentErrorResponse { - meta: RaiseIntentResultAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: RaiseIntentResultAgentErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResultResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface RaiseIntentResultAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface RaiseIntentResultAgentErrorResponsePayload { - error: RaiseIntentResultErrorMessage; -} - -/** - * Array of error message strings for responses that were not returned to the bridge before - * the timeout or because an error occurred. Should be the same length as the `errorSources` - * array and ordered the same. May be omitted if all sources responded without errors. - * - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type RaiseIntentResultErrorMessage = "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A secondary response to a request to raise an intent used to deliver the intent result - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface RaiseIntentResultAgentResponse { - meta: RaiseIntentResultAgentResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: RaiseIntentResultAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResultResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface RaiseIntentResultAgentResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface RaiseIntentResultAgentResponsePayload { - intentResult: IntentResult; -} - -export interface IntentResult { - context?: Context; - channel?: Channel; -} - -/** - * Represents a context channel that applications can use to send and receive - * context data. - * - * Please note that There are differences in behavior when you interact with a - * User channel via the `DesktopAgent` interface and the `Channel` interface. - * Specifically, when 'joining' a User channel or adding a context listener - * when already joined to a channel via the `DesktopAgent` interface, existing - * context (matching the type of the context listener) on the channel is - * received by the context listener immediately. Whereas, when a context - * listener is added via the Channel interface, context is not received - * automatically, but may be retrieved manually via the `getCurrentContext()` - * function. - */ -export interface Channel { - /** - * Channels may be visualized and selectable by users. DisplayMetadata may be used to - * provide hints on how to see them. - * For App channels, displayMetadata would typically not be present. - */ - displayMetadata?: DisplayMetadata; - /** - * Constant that uniquely identifies this channel. - */ - id: string; - /** - * Uniquely defines each channel type. - * Can be "user", "app" or "private". - */ - type: Type; -} - -/** - * Channels may be visualized and selectable by users. DisplayMetadata may be used to - * provide hints on how to see them. - * For App channels, displayMetadata would typically not be present. - * - * A system channel will be global enough to have a presence across many apps. This gives us - * some hints - * to render them in a standard way. It is assumed it may have other properties too, but if - * it has these, - * this is their meaning. - */ -export interface DisplayMetadata { - /** - * The color that should be associated within this channel when displaying this channel in a - * UI, e.g: `0xFF0000`. - */ - color?: string; - /** - * A URL of an image that can be used to display this channel - */ - glyph?: string; - /** - * A user-readable name for this channel, e.g: `"Red"` - */ - name?: string; -} - -/** - * Uniquely defines each channel type. - * Can be "user", "app" or "private". - */ -export type Type = "app" | "private" | "user"; - -/** - * A secondary response to a request to raise an intent used to deliver the intent result, - * which contains an error - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface RaiseIntentResultBridgeErrorResponse { - meta: RaiseIntentResultBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: RaiseIntentResultBridgeErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResultResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface RaiseIntentResultBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface RaiseIntentResultBridgeErrorResponsePayload { - error: RaiseIntentResultErrorMessage; -} - -/** - * A secondary response to a request to raise an intent used to deliver the intent result - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface RaiseIntentResultBridgeResponse { - meta: RaiseIntentResultBridgeResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: RaiseIntentResultBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResultResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface RaiseIntentResultBridgeResponseMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface RaiseIntentResultBridgeResponsePayload { - intentResult: IntentResult; -} - -// Converts JSON strings to/from your types -// and asserts the results of JSON.parse at runtime -export class Convert { - public static toAgentErrorResponseMessage(json: string): AgentErrorResponseMessage { - return cast(JSON.parse(json), r("AgentErrorResponseMessage")); - } - - public static agentErrorResponseMessageToJson(value: AgentErrorResponseMessage): string { - return JSON.stringify(uncast(value, r("AgentErrorResponseMessage")), null, 2); - } - - public static toAgentRequestMessage(json: string): AgentRequestMessage { - return cast(JSON.parse(json), r("AgentRequestMessage")); - } - - public static agentRequestMessageToJson(value: AgentRequestMessage): string { - return JSON.stringify(uncast(value, r("AgentRequestMessage")), null, 2); - } - - public static toAgentResponseMessage(json: string): AgentResponseMessage { - return cast(JSON.parse(json), r("AgentResponseMessage")); - } - - public static agentResponseMessageToJson(value: AgentResponseMessage): string { - return JSON.stringify(uncast(value, r("AgentResponseMessage")), null, 2); - } - - public static toBridgeErrorResponseMessage(json: string): BridgeErrorResponseMessage { - return cast(JSON.parse(json), r("BridgeErrorResponseMessage")); - } - - public static bridgeErrorResponseMessageToJson(value: BridgeErrorResponseMessage): string { - return JSON.stringify(uncast(value, r("BridgeErrorResponseMessage")), null, 2); - } - - public static toBridgeRequestMessage(json: string): BridgeRequestMessage { - return cast(JSON.parse(json), r("BridgeRequestMessage")); - } - - public static bridgeRequestMessageToJson(value: BridgeRequestMessage): string { - return JSON.stringify(uncast(value, r("BridgeRequestMessage")), null, 2); - } - - public static toBridgeResponseMessage(json: string): BridgeResponseMessage { - return cast(JSON.parse(json), r("BridgeResponseMessage")); - } - - public static bridgeResponseMessageToJson(value: BridgeResponseMessage): string { - return JSON.stringify(uncast(value, r("BridgeResponseMessage")), null, 2); - } - - public static toBroadcastAgentRequest(json: string): BroadcastAgentRequest { - return cast(JSON.parse(json), r("BroadcastAgentRequest")); - } - - public static broadcastAgentRequestToJson(value: BroadcastAgentRequest): string { - return JSON.stringify(uncast(value, r("BroadcastAgentRequest")), null, 2); - } - - public static toBroadcastBridgeRequest(json: string): BroadcastBridgeRequest { - return cast(JSON.parse(json), r("BroadcastBridgeRequest")); - } - - public static broadcastBridgeRequestToJson(value: BroadcastBridgeRequest): string { - return JSON.stringify(uncast(value, r("BroadcastBridgeRequest")), null, 2); - } - - public static toBridgeCommonDefinitions(json: string): { [key: string]: any } { - return cast(JSON.parse(json), m("any")); - } - - public static bridgeCommonDefinitionsToJson(value: { [key: string]: any }): string { - return JSON.stringify(uncast(value, m("any")), null, 2); - } - - public static toConnectionStepMessage(json: string): ConnectionStepMessage { - return cast(JSON.parse(json), r("ConnectionStepMessage")); - } - - public static connectionStepMessageToJson(value: ConnectionStepMessage): string { - return JSON.stringify(uncast(value, r("ConnectionStepMessage")), null, 2); - } - - public static toConnectionStep2Hello(json: string): ConnectionStep2Hello { - return cast(JSON.parse(json), r("ConnectionStep2Hello")); - } - - public static connectionStep2HelloToJson(value: ConnectionStep2Hello): string { - return JSON.stringify(uncast(value, r("ConnectionStep2Hello")), null, 2); - } - - public static toConnectionStep3Handshake(json: string): ConnectionStep3Handshake { - return cast(JSON.parse(json), r("ConnectionStep3Handshake")); - } - - public static connectionStep3HandshakeToJson(value: ConnectionStep3Handshake): string { - return JSON.stringify(uncast(value, r("ConnectionStep3Handshake")), null, 2); - } - - public static toConnectionStep4AuthenticationFailed(json: string): ConnectionStep4AuthenticationFailed { - return cast(JSON.parse(json), r("ConnectionStep4AuthenticationFailed")); - } - - public static connectionStep4AuthenticationFailedToJson(value: ConnectionStep4AuthenticationFailed): string { - return JSON.stringify(uncast(value, r("ConnectionStep4AuthenticationFailed")), null, 2); - } - - public static toConnectionStep6ConnectedAgentsUpdate(json: string): ConnectionStep6ConnectedAgentsUpdate { - return cast(JSON.parse(json), r("ConnectionStep6ConnectedAgentsUpdate")); - } - - public static connectionStep6ConnectedAgentsUpdateToJson(value: ConnectionStep6ConnectedAgentsUpdate): string { - return JSON.stringify(uncast(value, r("ConnectionStep6ConnectedAgentsUpdate")), null, 2); - } - - public static toFindInstancesAgentErrorResponse(json: string): FindInstancesAgentErrorResponse { - return cast(JSON.parse(json), r("FindInstancesAgentErrorResponse")); - } - - public static findInstancesAgentErrorResponseToJson(value: FindInstancesAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("FindInstancesAgentErrorResponse")), null, 2); - } - - public static toFindInstancesAgentRequest(json: string): FindInstancesAgentRequest { - return cast(JSON.parse(json), r("FindInstancesAgentRequest")); - } - - public static findInstancesAgentRequestToJson(value: FindInstancesAgentRequest): string { - return JSON.stringify(uncast(value, r("FindInstancesAgentRequest")), null, 2); - } - - public static toFindInstancesAgentResponse(json: string): FindInstancesAgentResponse { - return cast(JSON.parse(json), r("FindInstancesAgentResponse")); - } - - public static findInstancesAgentResponseToJson(value: FindInstancesAgentResponse): string { - return JSON.stringify(uncast(value, r("FindInstancesAgentResponse")), null, 2); - } - - public static toFindInstancesBridgeErrorResponse(json: string): FindInstancesBridgeErrorResponse { - return cast(JSON.parse(json), r("FindInstancesBridgeErrorResponse")); - } - - public static findInstancesBridgeErrorResponseToJson(value: FindInstancesBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("FindInstancesBridgeErrorResponse")), null, 2); - } - - public static toFindInstancesBridgeRequest(json: string): FindInstancesBridgeRequest { - return cast(JSON.parse(json), r("FindInstancesBridgeRequest")); - } - - public static findInstancesBridgeRequestToJson(value: FindInstancesBridgeRequest): string { - return JSON.stringify(uncast(value, r("FindInstancesBridgeRequest")), null, 2); - } - - public static toFindInstancesBridgeResponse(json: string): FindInstancesBridgeResponse { - return cast(JSON.parse(json), r("FindInstancesBridgeResponse")); - } - - public static findInstancesBridgeResponseToJson(value: FindInstancesBridgeResponse): string { - return JSON.stringify(uncast(value, r("FindInstancesBridgeResponse")), null, 2); - } - - public static toFindIntentAgentErrorResponse(json: string): FindIntentAgentErrorResponse { - return cast(JSON.parse(json), r("FindIntentAgentErrorResponse")); - } - - public static findIntentAgentErrorResponseToJson(value: FindIntentAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("FindIntentAgentErrorResponse")), null, 2); - } - - public static toFindIntentAgentRequest(json: string): FindIntentAgentRequest { - return cast(JSON.parse(json), r("FindIntentAgentRequest")); - } - - public static findIntentAgentRequestToJson(value: FindIntentAgentRequest): string { - return JSON.stringify(uncast(value, r("FindIntentAgentRequest")), null, 2); - } - - public static toFindIntentAgentResponse(json: string): FindIntentAgentResponse { - return cast(JSON.parse(json), r("FindIntentAgentResponse")); - } - - public static findIntentAgentResponseToJson(value: FindIntentAgentResponse): string { - return JSON.stringify(uncast(value, r("FindIntentAgentResponse")), null, 2); - } - - public static toFindIntentBridgeErrorResponse(json: string): FindIntentBridgeErrorResponse { - return cast(JSON.parse(json), r("FindIntentBridgeErrorResponse")); - } - - public static findIntentBridgeErrorResponseToJson(value: FindIntentBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("FindIntentBridgeErrorResponse")), null, 2); - } - - public static toFindIntentBridgeRequest(json: string): FindIntentBridgeRequest { - return cast(JSON.parse(json), r("FindIntentBridgeRequest")); - } - - public static findIntentBridgeRequestToJson(value: FindIntentBridgeRequest): string { - return JSON.stringify(uncast(value, r("FindIntentBridgeRequest")), null, 2); - } - - public static toFindIntentBridgeResponse(json: string): FindIntentBridgeResponse { - return cast(JSON.parse(json), r("FindIntentBridgeResponse")); - } - - public static findIntentBridgeResponseToJson(value: FindIntentBridgeResponse): string { - return JSON.stringify(uncast(value, r("FindIntentBridgeResponse")), null, 2); - } - - public static toFindIntentsByContextAgentErrorResponse(json: string): FindIntentsByContextAgentErrorResponse { - return cast(JSON.parse(json), r("FindIntentsByContextAgentErrorResponse")); - } - - public static findIntentsByContextAgentErrorResponseToJson(value: FindIntentsByContextAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextAgentErrorResponse")), null, 2); - } - - public static toFindIntentsByContextAgentRequest(json: string): FindIntentsByContextAgentRequest { - return cast(JSON.parse(json), r("FindIntentsByContextAgentRequest")); - } - - public static findIntentsByContextAgentRequestToJson(value: FindIntentsByContextAgentRequest): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextAgentRequest")), null, 2); - } - - public static toFindIntentsByContextAgentResponse(json: string): FindIntentsByContextAgentResponse { - return cast(JSON.parse(json), r("FindIntentsByContextAgentResponse")); - } - - public static findIntentsByContextAgentResponseToJson(value: FindIntentsByContextAgentResponse): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextAgentResponse")), null, 2); - } - - public static toFindIntentsByContextBridgeErrorResponse(json: string): FindIntentsByContextBridgeErrorResponse { - return cast(JSON.parse(json), r("FindIntentsByContextBridgeErrorResponse")); - } - - public static findIntentsByContextBridgeErrorResponseToJson(value: FindIntentsByContextBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeErrorResponse")), null, 2); - } - - public static toFindIntentsByContextBridgeRequest(json: string): FindIntentsByContextBridgeRequest { - return cast(JSON.parse(json), r("FindIntentsByContextBridgeRequest")); - } - - public static findIntentsByContextBridgeRequestToJson(value: FindIntentsByContextBridgeRequest): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeRequest")), null, 2); - } - - public static toFindIntentsByContextBridgeResponse(json: string): FindIntentsByContextBridgeResponse { - return cast(JSON.parse(json), r("FindIntentsByContextBridgeResponse")); - } - - public static findIntentsByContextBridgeResponseToJson(value: FindIntentsByContextBridgeResponse): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeResponse")), null, 2); - } - - public static toGetAppMetadataAgentErrorResponse(json: string): GetAppMetadataAgentErrorResponse { - return cast(JSON.parse(json), r("GetAppMetadataAgentErrorResponse")); - } - - public static getAppMetadataAgentErrorResponseToJson(value: GetAppMetadataAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("GetAppMetadataAgentErrorResponse")), null, 2); - } - - public static toGetAppMetadataAgentRequest(json: string): GetAppMetadataAgentRequest { - return cast(JSON.parse(json), r("GetAppMetadataAgentRequest")); - } - - public static getAppMetadataAgentRequestToJson(value: GetAppMetadataAgentRequest): string { - return JSON.stringify(uncast(value, r("GetAppMetadataAgentRequest")), null, 2); - } - - public static toGetAppMetadataAgentResponse(json: string): GetAppMetadataAgentResponse { - return cast(JSON.parse(json), r("GetAppMetadataAgentResponse")); - } - - public static getAppMetadataAgentResponseToJson(value: GetAppMetadataAgentResponse): string { - return JSON.stringify(uncast(value, r("GetAppMetadataAgentResponse")), null, 2); - } - - public static toGetAppMetadataBridgeErrorResponse(json: string): GetAppMetadataBridgeErrorResponse { - return cast(JSON.parse(json), r("GetAppMetadataBridgeErrorResponse")); - } - - public static getAppMetadataBridgeErrorResponseToJson(value: GetAppMetadataBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("GetAppMetadataBridgeErrorResponse")), null, 2); - } - - public static toGetAppMetadataBridgeRequest(json: string): GetAppMetadataBridgeRequest { - return cast(JSON.parse(json), r("GetAppMetadataBridgeRequest")); - } - - public static getAppMetadataBridgeRequestToJson(value: GetAppMetadataBridgeRequest): string { - return JSON.stringify(uncast(value, r("GetAppMetadataBridgeRequest")), null, 2); - } - - public static toGetAppMetadataBridgeResponse(json: string): GetAppMetadataBridgeResponse { - return cast(JSON.parse(json), r("GetAppMetadataBridgeResponse")); - } - - public static getAppMetadataBridgeResponseToJson(value: GetAppMetadataBridgeResponse): string { - return JSON.stringify(uncast(value, r("GetAppMetadataBridgeResponse")), null, 2); - } - - public static toOpenAgentErrorResponse(json: string): OpenAgentErrorResponse { - return cast(JSON.parse(json), r("OpenAgentErrorResponse")); - } - - public static openAgentErrorResponseToJson(value: OpenAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("OpenAgentErrorResponse")), null, 2); - } - - public static toOpenAgentRequest(json: string): OpenAgentRequest { - return cast(JSON.parse(json), r("OpenAgentRequest")); - } - - public static openAgentRequestToJson(value: OpenAgentRequest): string { - return JSON.stringify(uncast(value, r("OpenAgentRequest")), null, 2); - } - - public static toOpenAgentResponse(json: string): OpenAgentResponse { - return cast(JSON.parse(json), r("OpenAgentResponse")); - } - - public static openAgentResponseToJson(value: OpenAgentResponse): string { - return JSON.stringify(uncast(value, r("OpenAgentResponse")), null, 2); - } - - public static toOpenBridgeErrorResponse(json: string): OpenBridgeErrorResponse { - return cast(JSON.parse(json), r("OpenBridgeErrorResponse")); - } - - public static openBridgeErrorResponseToJson(value: OpenBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("OpenBridgeErrorResponse")), null, 2); - } - - public static toOpenBridgeRequest(json: string): OpenBridgeRequest { - return cast(JSON.parse(json), r("OpenBridgeRequest")); - } - - public static openBridgeRequestToJson(value: OpenBridgeRequest): string { - return JSON.stringify(uncast(value, r("OpenBridgeRequest")), null, 2); - } - - public static toOpenBridgeResponse(json: string): OpenBridgeResponse { - return cast(JSON.parse(json), r("OpenBridgeResponse")); - } - - public static openBridgeResponseToJson(value: OpenBridgeResponse): string { - return JSON.stringify(uncast(value, r("OpenBridgeResponse")), null, 2); - } - - public static toPrivateChannelBroadcastAgentRequest(json: string): PrivateChannelBroadcastAgentRequest { - return cast(JSON.parse(json), r("PrivateChannelBroadcastAgentRequest")); - } - - public static privateChannelBroadcastAgentRequestToJson(value: PrivateChannelBroadcastAgentRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelBroadcastAgentRequest")), null, 2); - } - - public static toPrivateChannelBroadcastBridgeRequest(json: string): PrivateChannelBroadcastBridgeRequest { - return cast(JSON.parse(json), r("PrivateChannelBroadcastBridgeRequest")); - } - - public static privateChannelBroadcastBridgeRequestToJson(value: PrivateChannelBroadcastBridgeRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelBroadcastBridgeRequest")), null, 2); - } - - public static toPrivateChannelEventListenerAddedAgentRequest(json: string): PrivateChannelEventListenerAddedAgentRequest { - return cast(JSON.parse(json), r("PrivateChannelEventListenerAddedAgentRequest")); - } - - public static privateChannelEventListenerAddedAgentRequestToJson(value: PrivateChannelEventListenerAddedAgentRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelEventListenerAddedAgentRequest")), null, 2); - } - - public static toPrivateChannelEventListenerAddedBridgeRequest(json: string): PrivateChannelEventListenerAddedBridgeRequest { - return cast(JSON.parse(json), r("PrivateChannelEventListenerAddedBridgeRequest")); - } - - public static privateChannelEventListenerAddedBridgeRequestToJson(value: PrivateChannelEventListenerAddedBridgeRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelEventListenerAddedBridgeRequest")), null, 2); - } - - public static toPrivateChannelEventListenerRemovedAgentRequest(json: string): PrivateChannelEventListenerRemovedAgentRequest { - return cast(JSON.parse(json), r("PrivateChannelEventListenerRemovedAgentRequest")); - } - - public static privateChannelEventListenerRemovedAgentRequestToJson(value: PrivateChannelEventListenerRemovedAgentRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelEventListenerRemovedAgentRequest")), null, 2); - } - - public static toPrivateChannelEventListenerRemovedBridgeRequest(json: string): PrivateChannelEventListenerRemovedBridgeRequest { - return cast(JSON.parse(json), r("PrivateChannelEventListenerRemovedBridgeRequest")); - } - - public static privateChannelEventListenerRemovedBridgeRequestToJson(value: PrivateChannelEventListenerRemovedBridgeRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelEventListenerRemovedBridgeRequest")), null, 2); - } - - public static toPrivateChannelOnAddContextListenerAgentRequest(json: string): PrivateChannelOnAddContextListenerAgentRequest { - return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerAgentRequest")); - } - - public static privateChannelOnAddContextListenerAgentRequestToJson(value: PrivateChannelOnAddContextListenerAgentRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerAgentRequest")), null, 2); - } - - public static toPrivateChannelOnAddContextListenerBridgeRequest(json: string): PrivateChannelOnAddContextListenerBridgeRequest { - return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerBridgeRequest")); - } - - public static privateChannelOnAddContextListenerBridgeRequestToJson(value: PrivateChannelOnAddContextListenerBridgeRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerBridgeRequest")), null, 2); - } - - public static toPrivateChannelOnDisconnectAgentRequest(json: string): PrivateChannelOnDisconnectAgentRequest { - return cast(JSON.parse(json), r("PrivateChannelOnDisconnectAgentRequest")); - } - - public static privateChannelOnDisconnectAgentRequestToJson(value: PrivateChannelOnDisconnectAgentRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectAgentRequest")), null, 2); - } - - public static toPrivateChannelOnDisconnectBridgeRequest(json: string): PrivateChannelOnDisconnectBridgeRequest { - return cast(JSON.parse(json), r("PrivateChannelOnDisconnectBridgeRequest")); - } - - public static privateChannelOnDisconnectBridgeRequestToJson(value: PrivateChannelOnDisconnectBridgeRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectBridgeRequest")), null, 2); - } - - public static toPrivateChannelOnUnsubscribeAgentRequest(json: string): PrivateChannelOnUnsubscribeAgentRequest { - return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeAgentRequest")); - } - - public static privateChannelOnUnsubscribeAgentRequestToJson(value: PrivateChannelOnUnsubscribeAgentRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeAgentRequest")), null, 2); - } - - public static toPrivateChannelOnUnsubscribeBridgeRequest(json: string): PrivateChannelOnUnsubscribeBridgeRequest { - return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeBridgeRequest")); - } - - public static privateChannelOnUnsubscribeBridgeRequestToJson(value: PrivateChannelOnUnsubscribeBridgeRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeBridgeRequest")), null, 2); - } - - public static toRaiseIntentAgentErrorResponse(json: string): RaiseIntentAgentErrorResponse { - return cast(JSON.parse(json), r("RaiseIntentAgentErrorResponse")); - } - - public static raiseIntentAgentErrorResponseToJson(value: RaiseIntentAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentAgentErrorResponse")), null, 2); - } - - public static toRaiseIntentAgentRequest(json: string): RaiseIntentAgentRequest { - return cast(JSON.parse(json), r("RaiseIntentAgentRequest")); - } - - public static raiseIntentAgentRequestToJson(value: RaiseIntentAgentRequest): string { - return JSON.stringify(uncast(value, r("RaiseIntentAgentRequest")), null, 2); - } - - public static toRaiseIntentAgentResponse(json: string): RaiseIntentAgentResponse { - return cast(JSON.parse(json), r("RaiseIntentAgentResponse")); - } - - public static raiseIntentAgentResponseToJson(value: RaiseIntentAgentResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentAgentResponse")), null, 2); - } - - public static toRaiseIntentBridgeErrorResponse(json: string): RaiseIntentBridgeErrorResponse { - return cast(JSON.parse(json), r("RaiseIntentBridgeErrorResponse")); - } - - public static raiseIntentBridgeErrorResponseToJson(value: RaiseIntentBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentBridgeErrorResponse")), null, 2); - } - - public static toRaiseIntentBridgeRequest(json: string): RaiseIntentBridgeRequest { - return cast(JSON.parse(json), r("RaiseIntentBridgeRequest")); - } - - public static raiseIntentBridgeRequestToJson(value: RaiseIntentBridgeRequest): string { - return JSON.stringify(uncast(value, r("RaiseIntentBridgeRequest")), null, 2); - } - - public static toRaiseIntentBridgeResponse(json: string): RaiseIntentBridgeResponse { - return cast(JSON.parse(json), r("RaiseIntentBridgeResponse")); - } - - public static raiseIntentBridgeResponseToJson(value: RaiseIntentBridgeResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentBridgeResponse")), null, 2); - } - - public static toRaiseIntentResultAgentErrorResponse(json: string): RaiseIntentResultAgentErrorResponse { - return cast(JSON.parse(json), r("RaiseIntentResultAgentErrorResponse")); - } - - public static raiseIntentResultAgentErrorResponseToJson(value: RaiseIntentResultAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentResultAgentErrorResponse")), null, 2); - } - - public static toRaiseIntentResultAgentResponse(json: string): RaiseIntentResultAgentResponse { - return cast(JSON.parse(json), r("RaiseIntentResultAgentResponse")); - } - - public static raiseIntentResultAgentResponseToJson(value: RaiseIntentResultAgentResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentResultAgentResponse")), null, 2); - } - - public static toRaiseIntentResultBridgeErrorResponse(json: string): RaiseIntentResultBridgeErrorResponse { - return cast(JSON.parse(json), r("RaiseIntentResultBridgeErrorResponse")); - } - - public static raiseIntentResultBridgeErrorResponseToJson(value: RaiseIntentResultBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentResultBridgeErrorResponse")), null, 2); - } - - public static toRaiseIntentResultBridgeResponse(json: string): RaiseIntentResultBridgeResponse { - return cast(JSON.parse(json), r("RaiseIntentResultBridgeResponse")); - } - - public static raiseIntentResultBridgeResponseToJson(value: RaiseIntentResultBridgeResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentResultBridgeResponse")), null, 2); - } -} - -function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { - const prettyTyp = prettyTypeName(typ); - const parentText = parent ? ` on ${parent}` : ''; - const keyText = key ? ` for key "${key}"` : ''; - throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); -} - -function prettyTypeName(typ: any): string { - if (Array.isArray(typ)) { - if (typ.length === 2 && typ[0] === undefined) { - return `an optional ${prettyTypeName(typ[1])}`; - } else { - return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; - } - } else if (typeof typ === "object" && typ.literal !== undefined) { - return typ.literal; - } else { - return typeof typ; - } -} - -function jsonToJSProps(typ: any): any { - if (typ.jsonToJS === undefined) { - const map: any = {}; - typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); - typ.jsonToJS = map; - } - return typ.jsonToJS; -} - -function jsToJSONProps(typ: any): any { - if (typ.jsToJSON === undefined) { - const map: any = {}; - typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); - typ.jsToJSON = map; - } - return typ.jsToJSON; -} - -function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { - function transformPrimitive(typ: string, val: any): any { - if (typeof typ === typeof val) return val; - return invalidValue(typ, val, key, parent); - } - - function transformUnion(typs: any[], val: any): any { - // val must validate against one typ in typs - const l = typs.length; - for (let i = 0; i < l; i++) { - const typ = typs[i]; - try { - return transform(val, typ, getProps); - } catch (_) {} - } - return invalidValue(typs, val, key, parent); - } - - function transformEnum(cases: string[], val: any): any { - if (cases.indexOf(val) !== -1) return val; - return invalidValue(cases.map(a => { return l(a); }), val, key, parent); - } - - function transformArray(typ: any, val: any): any { - // val must be an array with no invalid elements - if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); - return val.map(el => transform(el, typ, getProps)); - } - - function transformDate(val: any): any { - if (val === null) { - return null; - } - const d = new Date(val); - if (isNaN(d.valueOf())) { - return invalidValue(l("Date"), val, key, parent); - } - return d; - } - - function transformObject(props: { [k: string]: any }, additional: any, val: any): any { - if (val === null || typeof val !== "object" || Array.isArray(val)) { - return invalidValue(l(ref || "object"), val, key, parent); - } - const result: any = {}; - Object.getOwnPropertyNames(props).forEach(key => { - const prop = props[key]; - const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; - result[prop.key] = transform(v, prop.typ, getProps, key, ref); - }); - Object.getOwnPropertyNames(val).forEach(key => { - if (!Object.prototype.hasOwnProperty.call(props, key)) { - result[key] = transform(val[key], additional, getProps, key, ref); - } - }); - return result; - } - - if (typ === "any") return val; - if (typ === null) { - if (val === null) return val; - return invalidValue(typ, val, key, parent); - } - if (typ === false) return invalidValue(typ, val, key, parent); - let ref: any = undefined; - while (typeof typ === "object" && typ.ref !== undefined) { - ref = typ.ref; - typ = typeMap[typ.ref]; - } - if (Array.isArray(typ)) return transformEnum(typ, val); - if (typeof typ === "object") { - return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) - : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) - : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) - : invalidValue(typ, val, key, parent); - } - // Numbers can be parsed by Date but shouldn't be. - if (typ === Date && typeof val !== "number") return transformDate(val); - return transformPrimitive(typ, val); -} - -function cast(val: any, typ: any): T { - return transform(val, typ, jsonToJSProps); -} - -function uncast(val: T, typ: any): any { - return transform(val, typ, jsToJSONProps); -} - -function l(typ: any) { - return { literal: typ }; -} - -function a(typ: any) { - return { arrayItems: typ }; -} - -function u(...typs: any[]) { - return { unionMembers: typs }; -} - -function o(props: any[], additional: any) { - return { props, additional }; -} - -function m(additional: any) { - return { props: [], additional }; -} - -function r(name: string) { - return { ref: name }; -} - -const typeMap: any = { - "AgentErrorResponseMessage": o([ - { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, - { json: "payload", js: "payload", typ: r("ErrorResponseMessagePayload") }, - { json: "type", js: "type", typ: r("ResponseMessageType") }, - ], false), - "AgentResponseMetadata": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "ErrorResponseMessagePayload": o([ - { json: "error", js: "error", typ: r("ResponseErrorDetail") }, - ], "any"), - "AgentRequestMessage": o([ - { json: "meta", js: "meta", typ: r("AgentRequestMetadata") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("RequestMessageType") }, - ], false), - "AgentRequestMetadata": o([ - { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "BridgeParticipantIdentifier": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "appId", js: "appId", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "SourceIdentifier": o([ - { json: "appId", js: "appId", typ: u(undefined, "") }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "AgentResponseMessage": o([ - { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("ResponseMessageType") }, - ], false), - "BridgeErrorResponseMessage": o([ - { json: "meta", js: "meta", typ: r("BridgeErrorResponseMessageMeta") }, - { json: "payload", js: "payload", typ: r("ResponseErrorMessagePayload") }, - { json: "type", js: "type", typ: "" }, - ], false), - "BridgeErrorResponseMessageMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "DesktopAgentIdentifier": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - ], "any"), - "ResponseErrorMessagePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponseErrorDetail")) }, - ], "any"), - "BridgeRequestMessage": o([ - { json: "meta", js: "meta", typ: r("BridgeRequestMetadata") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: "" }, - ], false), - "BridgeRequestMetadata": o([ - { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("BridgeParticipantIdentifier") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "BridgeResponseMessage": o([ - { json: "meta", js: "meta", typ: r("BridgeResponseMessageMeta") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: "" }, - ], false), - "BridgeResponseMessageMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "BroadcastAgentRequest": o([ - { json: "meta", js: "meta", typ: r("BroadcastAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastAgentRequestPayload") }, - { json: "type", js: "type", typ: r("BroadcastAgentRequestType") }, - ], false), - "BroadcastAgentRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("SourceObject") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "SourceObject": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "BroadcastAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "Context": o([ - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: "" }, - ], "any"), - "BroadcastBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("BroadcastBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("BroadcastAgentRequestType") }, - ], false), - "BroadcastBridgeRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "MetaSource": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "BroadcastBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "ConnectionStepMessage": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("ConnectionStepMessageType") }, - ], false), - "ConnectionStepMetadata": o([ - { json: "requestUuid", js: "requestUuid", typ: u(undefined, "") }, - { json: "responseUuid", js: "responseUuid", typ: u(undefined, "") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "ConnectionStep2Hello": o([ - { json: "meta", js: "meta", typ: r("ConnectionStep2HelloMeta") }, - { json: "payload", js: "payload", typ: r("ConnectionStep2HelloPayload") }, - { json: "type", js: "type", typ: r("ConnectionStep2HelloType") }, - ], false), - "ConnectionStep2HelloMeta": o([ - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "ConnectionStep2HelloPayload": o([ - { json: "authRequired", js: "authRequired", typ: true }, - { json: "authToken", js: "authToken", typ: u(undefined, "") }, - { json: "desktopAgentBridgeVersion", js: "desktopAgentBridgeVersion", typ: "" }, - { json: "supportedFDC3Versions", js: "supportedFDC3Versions", typ: a("") }, - ], false), - "ConnectionStep3Handshake": o([ - { json: "meta", js: "meta", typ: r("ConnectionStep3HandshakeMeta") }, - { json: "payload", js: "payload", typ: r("ConnectionStep3HandshakePayload") }, - { json: "type", js: "type", typ: r("ConnectionStep3HandshakeType") }, - ], false), - "ConnectionStep3HandshakeMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "ConnectionStep3HandshakePayload": o([ - { json: "authToken", js: "authToken", typ: u(undefined, "") }, - { json: "channelsState", js: "channelsState", typ: m(a(r("Context"))) }, - { json: "implementationMetadata", js: "implementationMetadata", typ: r("ConnectingAgentImplementationMetadata") }, - { json: "requestedName", js: "requestedName", typ: "" }, - ], false), - "ConnectingAgentImplementationMetadata": o([ - { json: "fdc3Version", js: "fdc3Version", typ: "" }, - { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, - { json: "provider", js: "provider", typ: "" }, - { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, - ], false), - "OptionalFeatures": o([ - { json: "DesktopAgentBridging", js: "DesktopAgentBridging", typ: true }, - { json: "OriginatingAppMetadata", js: "OriginatingAppMetadata", typ: true }, - { json: "UserChannelMembershipAPIs", js: "UserChannelMembershipAPIs", typ: true }, - ], false), - "ConnectionStep4AuthenticationFailed": o([ - { json: "meta", js: "meta", typ: r("ConnectionStep4AuthenticationFailedMeta") }, - { json: "payload", js: "payload", typ: r("ConnectionStep4AuthenticationFailedPayload") }, - { json: "type", js: "type", typ: r("ConnectionStep4AuthenticationFailedType") }, - ], false), - "ConnectionStep4AuthenticationFailedMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "ConnectionStep4AuthenticationFailedPayload": o([ - { json: "message", js: "message", typ: u(undefined, "") }, - ], false), - "ConnectionStep6ConnectedAgentsUpdate": o([ - { json: "meta", js: "meta", typ: r("ConnectionStep6ConnectedAgentsUpdateMeta") }, - { json: "payload", js: "payload", typ: r("ConnectionStep6ConnectedAgentsUpdatePayload") }, - { json: "type", js: "type", typ: r("ConnectionStep6ConnectedAgentsUpdateType") }, - ], false), - "ConnectionStep6ConnectedAgentsUpdateMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "ConnectionStep6ConnectedAgentsUpdatePayload": o([ - { json: "addAgent", js: "addAgent", typ: u(undefined, "") }, - { json: "allAgents", js: "allAgents", typ: a(r("DesktopAgentImplementationMetadata")) }, - { json: "channelsState", js: "channelsState", typ: u(undefined, m(a(r("Context")))) }, - { json: "removeAgent", js: "removeAgent", typ: u(undefined, "") }, - ], false), - "DesktopAgentImplementationMetadata": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "fdc3Version", js: "fdc3Version", typ: "" }, - { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, - { json: "provider", js: "provider", typ: "" }, - { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, - ], false), - "FindInstancesAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("FindInstancesAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("PayloadClass") }, - { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, - ], false), - "FindInstancesAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PayloadClass": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "FindInstancesAgentRequest": o([ - { json: "meta", js: "meta", typ: r("FindInstancesAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindInstancesAgentRequestPayload") }, - { json: "type", js: "type", typ: r("FindInstancesAgentRequestType") }, - ], false), - "FindInstancesAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "DestinationObject": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "appId", js: "appId", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "FindInstancesAgentRequestPayload": o([ - { json: "app", js: "app", typ: r("AppIdentifier") }, - ], false), - "AppIdentifier": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "FindInstancesAgentResponse": o([ - { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, - { json: "payload", js: "payload", typ: r("FindInstancesAgentResponsePayload") }, - { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, - ], false), - "FindInstancesAgentResponsePayload": o([ - { json: "appIdentifiers", js: "appIdentifiers", typ: a(r("AppMetadata")) }, - ], false), - "AppMetadata": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "description", js: "description", typ: u(undefined, "") }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "icons", js: "icons", typ: u(undefined, a(r("Icon"))) }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - { json: "instanceMetadata", js: "instanceMetadata", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "resultType", js: "resultType", typ: u(undefined, u(null, "")) }, - { json: "screenshots", js: "screenshots", typ: u(undefined, a(r("Image"))) }, - { json: "title", js: "title", typ: u(undefined, "") }, - { json: "tooltip", js: "tooltip", typ: u(undefined, "") }, - { json: "version", js: "version", typ: u(undefined, "") }, - ], false), - "Icon": o([ - { json: "size", js: "size", typ: u(undefined, "") }, - { json: "src", js: "src", typ: "" }, - { json: "type", js: "type", typ: u(undefined, "") }, - ], false), - "Image": o([ - { json: "label", js: "label", typ: u(undefined, "") }, - { json: "size", js: "size", typ: u(undefined, "") }, - { json: "src", js: "src", typ: "" }, - { json: "type", js: "type", typ: u(undefined, "") }, - ], false), - "FindInstancesBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("FindInstancesBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("MessagePayload") }, - { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, - ], false), - "FindInstancesBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "MessagePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "FindInstancesBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("FindInstancesBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindInstancesBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("FindInstancesAgentRequestType") }, - ], false), - "FindInstancesBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSourceObject") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "MetaSourceObject": o([ - { json: "appId", js: "appId", typ: u(undefined, "") }, - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "FindInstancesBridgeRequestPayload": o([ - { json: "app", js: "app", typ: r("AppIdentifier") }, - ], false), - "FindInstancesBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("BridgeResponseMessageMeta") }, - { json: "payload", js: "payload", typ: r("FindInstancesBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, - ], false), - "FindInstancesBridgeResponsePayload": o([ - { json: "appIdentifiers", js: "appIdentifiers", typ: a(r("AppMetadata")) }, - ], false), - "FindIntentAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentAgentErrorResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, - ], false), - "FindIntentAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentAgentErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "FindIntentAgentRequest": o([ - { json: "meta", js: "meta", typ: r("FindIntentAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentAgentRequestPayload") }, - { json: "type", js: "type", typ: r("FindIntentAgentRequestType") }, - ], false), - "FindIntentAgentRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, - ], false), - "FindIntentAgentRequestPayload": o([ - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - { json: "intent", js: "intent", typ: "" }, - { json: "resultType", js: "resultType", typ: u(undefined, "") }, - ], false), - "FindIntentAgentResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentAgentResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentAgentResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, - ], false), - "FindIntentAgentResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentAgentResponsePayload": o([ - { json: "appIntent", js: "appIntent", typ: r("AppIntent") }, - ], false), - "AppIntent": o([ - { json: "apps", js: "apps", typ: a(r("AppMetadata")) }, - { json: "intent", js: "intent", typ: r("IntentMetadata") }, - ], false), - "IntentMetadata": o([ - { json: "displayName", js: "displayName", typ: u(undefined, "") }, - { json: "name", js: "name", typ: "" }, - ], false), - "FindIntentBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentBridgeErrorResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, - ], false), - "FindIntentBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentBridgeErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "FindIntentBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("FindIntentBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("FindIntentAgentRequestType") }, - ], false), - "FindIntentBridgeRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("BridgeParticipantIdentifier") }, - { json: "timestamp", js: "timestamp", typ: Date }, - { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, - ], false), - "FindIntentBridgeRequestPayload": o([ - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - { json: "intent", js: "intent", typ: "" }, - { json: "resultType", js: "resultType", typ: u(undefined, "") }, - ], false), - "FindIntentBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentBridgeResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, - ], false), - "FindIntentBridgeResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentBridgeResponsePayload": o([ - { json: "appIntent", js: "appIntent", typ: r("AppIntent") }, - ], false), - "FindIntentsByContextAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentErrorResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, - ], false), - "FindIntentsByContextAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentsByContextAgentErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "FindIntentsByContextAgentRequest": o([ - { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentRequestPayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextAgentRequestType") }, - ], false), - "FindIntentsByContextAgentRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, - ], false), - "FindIntentsByContextAgentRequestPayload": o([ - { json: "context", js: "context", typ: r("Context") }, - { json: "resultType", js: "resultType", typ: u(undefined, "") }, - ], false), - "FindIntentsByContextAgentResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, - ], false), - "FindIntentsByContextAgentResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentsByContextAgentResponsePayload": o([ - { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, - ], false), - "FindIntentsByContextBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeErrorResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, - ], false), - "FindIntentsByContextBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentsByContextBridgeErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "FindIntentsByContextBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextAgentRequestType") }, - ], false), - "FindIntentsByContextBridgeRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, - ], false), - "FindIntentsByContextBridgeRequestPayload": o([ - { json: "context", js: "context", typ: r("Context") }, - { json: "resultType", js: "resultType", typ: u(undefined, "") }, - ], false), - "FindIntentsByContextBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, - ], false), - "FindIntentsByContextBridgeResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentsByContextBridgeResponsePayload": o([ - { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, - ], false), - "GetAppMetadataAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("GetAppMetadataAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataAgentErrorResponsePayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, - ], false), - "GetAppMetadataAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "GetAppMetadataAgentErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "GetAppMetadataAgentRequest": o([ - { json: "meta", js: "meta", typ: r("GetAppMetadataAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataAgentRequestPayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataAgentRequestType") }, - ], false), - "GetAppMetadataAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "GetAppMetadataAgentRequestPayload": o([ - { json: "app", js: "app", typ: r("AppObject") }, - ], false), - "AppObject": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "appId", js: "appId", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "GetAppMetadataAgentResponse": o([ - { json: "meta", js: "meta", typ: r("GetAppMetadataAgentResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataAgentResponsePayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, - ], false), - "GetAppMetadataAgentResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "GetAppMetadataAgentResponsePayload": o([ - { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, - ], false), - "GetAppMetadataBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeErrorResponsePayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, - ], false), - "GetAppMetadataBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "GetAppMetadataBridgeErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "GetAppMetadataBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataAgentRequestType") }, - ], false), - "GetAppMetadataBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSourceObject") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "GetAppMetadataBridgeRequestPayload": o([ - { json: "app", js: "app", typ: r("AppObject") }, - ], false), - "GetAppMetadataBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, - ], false), - "GetAppMetadataBridgeResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "GetAppMetadataBridgeResponsePayload": o([ - { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, - ], false), - "OpenAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("OpenAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("OpenAgentErrorResponsePayload") }, - { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, - ], false), - "OpenAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "OpenAgentErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("OpenErrorResponsePayload") }, - ], false), - "OpenAgentRequest": o([ - { json: "meta", js: "meta", typ: r("OpenAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("OpenAgentRequestPayload") }, - { json: "type", js: "type", typ: r("OpenAgentRequestType") }, - ], false), - "OpenAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("SourceObject") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "OpenAgentRequestPayload": o([ - { json: "app", js: "app", typ: r("AppToOpen") }, - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - ], false), - "AppToOpen": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "appId", js: "appId", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "OpenAgentResponse": o([ - { json: "meta", js: "meta", typ: r("OpenAgentResponseMeta") }, - { json: "payload", js: "payload", typ: r("OpenAgentResponsePayload") }, - { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, - ], false), - "OpenAgentResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "OpenAgentResponsePayload": o([ - { json: "appIdentifier", js: "appIdentifier", typ: r("AppIdentifier") }, - ], false), - "OpenBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("OpenBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("OpenBridgeErrorResponsePayload") }, - { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, - ], false), - "OpenBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "OpenBridgeErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("OpenErrorResponsePayload") }, - ], false), - "OpenBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("OpenBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("OpenBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("OpenAgentRequestType") }, - ], false), - "OpenBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "OpenBridgeRequestPayload": o([ - { json: "app", js: "app", typ: r("AppToOpen") }, - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - ], false), - "OpenBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("OpenBridgeResponseMeta") }, - { json: "payload", js: "payload", typ: r("OpenBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, - ], false), - "OpenBridgeResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "OpenBridgeResponsePayload": o([ - { json: "appIdentifier", js: "appIdentifier", typ: r("AppIdentifier") }, - ], false), - "PrivateChannelBroadcastAgentRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelBroadcastAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelBroadcastAgentRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelBroadcastAgentRequestType") }, - ], false), - "PrivateChannelBroadcastAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "MetaDestination": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "appId", js: "appId", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "PrivateChannelBroadcastAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "PrivateChannelBroadcastBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelBroadcastBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelBroadcastBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelBroadcastAgentRequestType") }, - ], false), - "PrivateChannelBroadcastBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelBroadcastBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "PrivateChannelEventListenerAddedAgentRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerAddedAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerAddedAgentRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelEventListenerAddedAgentRequestType") }, - ], false), - "PrivateChannelEventListenerAddedAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelEventListenerAddedAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, - ], false), - "PrivateChannelEventListenerAddedBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerAddedBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerAddedBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelEventListenerAddedAgentRequestType") }, - ], false), - "PrivateChannelEventListenerAddedBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelEventListenerAddedBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, - ], false), - "PrivateChannelEventListenerRemovedAgentRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerRemovedAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerRemovedAgentRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelEventListenerRemovedAgentRequestType") }, - ], false), - "PrivateChannelEventListenerRemovedAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelEventListenerRemovedAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, - ], false), - "PrivateChannelEventListenerRemovedBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerRemovedBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerRemovedBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelEventListenerRemovedAgentRequestType") }, - ], false), - "PrivateChannelEventListenerRemovedBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelEventListenerRemovedBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, - ], false), - "PrivateChannelOnAddContextListenerAgentRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelOnAddContextListenerAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerAgentRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerAgentRequestType") }, - ], false), - "PrivateChannelOnAddContextListenerAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelOnAddContextListenerAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "contextType", js: "contextType", typ: u(null, "") }, - ], false), - "PrivateChannelOnAddContextListenerBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelOnAddContextListenerBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerAgentRequestType") }, - ], false), - "PrivateChannelOnAddContextListenerBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelOnAddContextListenerBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "contextType", js: "contextType", typ: u(null, "") }, - ], false), - "PrivateChannelOnDisconnectAgentRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelOnDisconnectAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectAgentRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectAgentRequestType") }, - ], false), - "PrivateChannelOnDisconnectAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelOnDisconnectAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - ], false), - "PrivateChannelOnDisconnectBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelOnDisconnectBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectAgentRequestType") }, - ], false), - "PrivateChannelOnDisconnectBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelOnDisconnectBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - ], false), - "PrivateChannelOnUnsubscribeAgentRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelOnUnsubscribeAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeAgentRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeAgentRequestType") }, - ], false), - "PrivateChannelOnUnsubscribeAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelOnUnsubscribeAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "contextType", js: "contextType", typ: u(null, "") }, - ], false), - "PrivateChannelOnUnsubscribeBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("ERequestMetadata") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeAgentRequestType") }, - ], false), - "ERequestMetadata": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelOnUnsubscribeBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "contextType", js: "contextType", typ: u(null, "") }, - ], false), - "RaiseIntentAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentAgentErrorResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, - ], false), - "RaiseIntentAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentAgentErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "RaiseIntentAgentRequest": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentAgentRequestPayload") }, - { json: "type", js: "type", typ: r("RaiseIntentAgentRequestType") }, - ], false), - "RaiseIntentAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: r("MetaDestination") }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("SourceObject") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentAgentRequestPayload": o([ - { json: "app", js: "app", typ: r("AppDestinationIdentifier") }, - { json: "context", js: "context", typ: r("Context") }, - { json: "intent", js: "intent", typ: "" }, - ], false), - "AppDestinationIdentifier": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "appId", js: "appId", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "RaiseIntentAgentResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentAgentResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentAgentResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, - ], false), - "RaiseIntentAgentResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentAgentResponsePayload": o([ - { json: "intentResolution", js: "intentResolution", typ: r("IntentResolution") }, - ], false), - "IntentResolution": o([ - { json: "intent", js: "intent", typ: "" }, - { json: "source", js: "source", typ: r("AppIdentifier") }, - ], false), - "RaiseIntentBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentBridgeErrorResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, - ], false), - "RaiseIntentBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentBridgeErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "RaiseIntentBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("RaiseIntentAgentRequestType") }, - ], false), - "RaiseIntentBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: r("MetaDestination") }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentBridgeRequestPayload": o([ - { json: "app", js: "app", typ: r("AppDestinationIdentifier") }, - { json: "context", js: "context", typ: r("Context") }, - { json: "intent", js: "intent", typ: "" }, - ], false), - "RaiseIntentBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentBridgeResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, - ], false), - "RaiseIntentBridgeResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentBridgeResponsePayload": o([ - { json: "intentResolution", js: "intentResolution", typ: r("IntentResolution") }, - ], false), - "RaiseIntentResultAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentResultAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentResultAgentErrorResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, - ], false), - "RaiseIntentResultAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentResultAgentErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("RaiseIntentResultErrorMessage") }, - ], false), - "RaiseIntentResultAgentResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentResultAgentResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentResultAgentResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, - ], false), - "RaiseIntentResultAgentResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentResultAgentResponsePayload": o([ - { json: "intentResult", js: "intentResult", typ: r("IntentResult") }, - ], false), - "IntentResult": o([ - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, - ], false), - "Channel": o([ - { json: "displayMetadata", js: "displayMetadata", typ: u(undefined, r("DisplayMetadata")) }, - { json: "id", js: "id", typ: "" }, - { json: "type", js: "type", typ: r("Type") }, - ], false), - "DisplayMetadata": o([ - { json: "color", js: "color", typ: u(undefined, "") }, - { json: "glyph", js: "glyph", typ: u(undefined, "") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], false), - "RaiseIntentResultBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentResultBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentResultBridgeErrorResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, - ], false), - "RaiseIntentResultBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentResultBridgeErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("RaiseIntentResultErrorMessage") }, - ], false), - "RaiseIntentResultBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentResultBridgeResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentResultBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, - ], false), - "RaiseIntentResultBridgeResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentResultBridgeResponsePayload": o([ - { json: "intentResult", js: "intentResult", typ: r("IntentResult") }, - ], false), - "ResponseErrorDetail": [ - "AccessDenied", - "AgentDisconnected", - "AppNotFound", - "AppTimeout", - "CreationFailed", - "DesktopAgentNotFound", - "ErrorOnLaunch", - "IntentDeliveryFailed", - "IntentHandlerRejected", - "MalformedContext", - "MalformedMessage", - "NoAppsFound", - "NoChannelFound", - "NoResultReturned", - "NotConnectedToBridge", - "ResolverTimeout", - "ResolverUnavailable", - "ResponseToBridgeTimedOut", - "TargetAppUnavailable", - "TargetInstanceUnavailable", - "UserCancelledResolution", - ], - "ResponseMessageType": [ - "findInstancesResponse", - "findIntentResponse", - "findIntentsByContextResponse", - "getAppMetadataResponse", - "openResponse", - "raiseIntentResponse", - "raiseIntentResultResponse", - ], - "RequestMessageType": [ - "broadcastRequest", - "findInstancesRequest", - "findIntentRequest", - "findIntentsByContextRequest", - "getAppMetadataRequest", - "openRequest", - "PrivateChannel.broadcast", - "PrivateChannel.eventListenerAdded", - "PrivateChannel.eventListenerRemoved", - "PrivateChannel.onAddContextListener", - "PrivateChannel.onDisconnect", - "PrivateChannel.onUnsubscribe", - "raiseIntentRequest", - ], - "BroadcastAgentRequestType": [ - "broadcastRequest", - ], - "ConnectionStepMessageType": [ - "authenticationFailed", - "connectedAgentsUpdate", - "handshake", - "hello", - ], - "ConnectionStep2HelloType": [ - "hello", - ], - "ConnectionStep3HandshakeType": [ - "handshake", - ], - "ConnectionStep4AuthenticationFailedType": [ - "authenticationFailed", - ], - "ConnectionStep6ConnectedAgentsUpdateType": [ - "connectedAgentsUpdate", - ], - "FindInstancesErrors": [ - "AgentDisconnected", - "DesktopAgentNotFound", - "IntentDeliveryFailed", - "MalformedContext", - "MalformedMessage", - "NoAppsFound", - "NotConnectedToBridge", - "ResolverTimeout", - "ResolverUnavailable", - "ResponseToBridgeTimedOut", - "TargetAppUnavailable", - "TargetInstanceUnavailable", - "UserCancelledResolution", - ], - "FindInstancesAgentErrorResponseType": [ - "findInstancesResponse", - ], - "FindInstancesAgentRequestType": [ - "findInstancesRequest", - ], - "FindIntentAgentErrorResponseType": [ - "findIntentResponse", - ], - "FindIntentAgentRequestType": [ - "findIntentRequest", - ], - "FindIntentsByContextAgentErrorResponseType": [ - "findIntentsByContextResponse", - ], - "FindIntentsByContextAgentRequestType": [ - "findIntentsByContextRequest", - ], - "GetAppMetadataAgentErrorResponseType": [ - "getAppMetadataResponse", - ], - "GetAppMetadataAgentRequestType": [ - "getAppMetadataRequest", - ], - "OpenErrorResponsePayload": [ - "AgentDisconnected", - "AppNotFound", - "AppTimeout", - "DesktopAgentNotFound", - "ErrorOnLaunch", - "MalformedContext", - "MalformedMessage", - "NotConnectedToBridge", - "ResolverUnavailable", - "ResponseToBridgeTimedOut", - ], - "OpenAgentErrorResponseType": [ - "openResponse", - ], - "OpenAgentRequestType": [ - "openRequest", - ], - "PrivateChannelBroadcastAgentRequestType": [ - "PrivateChannel.broadcast", - ], - "PrivateChannelEventListenerTypes": [ - "onAddContextListener", - "onDisconnect", - "onUnsubscribe", - ], - "PrivateChannelEventListenerAddedAgentRequestType": [ - "PrivateChannel.eventListenerAdded", - ], - "PrivateChannelEventListenerRemovedAgentRequestType": [ - "PrivateChannel.eventListenerRemoved", - ], - "PrivateChannelOnAddContextListenerAgentRequestType": [ - "PrivateChannel.onAddContextListener", - ], - "PrivateChannelOnDisconnectAgentRequestType": [ - "PrivateChannel.onDisconnect", - ], - "PrivateChannelOnUnsubscribeAgentRequestType": [ - "PrivateChannel.onUnsubscribe", - ], - "RaiseIntentAgentErrorResponseType": [ - "raiseIntentResponse", - ], - "RaiseIntentAgentRequestType": [ - "raiseIntentRequest", - ], - "RaiseIntentResultErrorMessage": [ - "AgentDisconnected", - "IntentHandlerRejected", - "MalformedMessage", - "NoResultReturned", - "NotConnectedToBridge", - "ResponseToBridgeTimedOut", - ], - "RaiseIntentResultAgentErrorResponseType": [ - "raiseIntentResultResponse", - ], - "Type": [ - "app", - "private", - "user", - ], -}; diff --git a/packages/fdc3-context/generated/context/ContextTypes.ts b/packages/fdc3-context/generated/context/ContextTypes.ts deleted file mode 100644 index 8fccd9007..000000000 --- a/packages/fdc3-context/generated/context/ContextTypes.ts +++ /dev/null @@ -1,2901 +0,0 @@ -// To parse this data: -// -// import { Convert, Action, Chart, ChatInitSettings, ChatMessage, ChatRoom, ChatSearchCriteria, Contact, ContactList, Context, Country, Currency, Email, Instrument, InstrumentList, Interaction, Message, Nothing, Order, OrderList, Organization, Portfolio, Position, Product, TimeRange, Trade, TradeList, TransactionResult, Valuation } from "./file"; -// -// const action = Convert.toAction(json); -// const chart = Convert.toChart(json); -// const chatInitSettings = Convert.toChatInitSettings(json); -// const chatMessage = Convert.toChatMessage(json); -// const chatRoom = Convert.toChatRoom(json); -// const chatSearchCriteria = Convert.toChatSearchCriteria(json); -// const contact = Convert.toContact(json); -// const contactList = Convert.toContactList(json); -// const context = Convert.toContext(json); -// const country = Convert.toCountry(json); -// const currency = Convert.toCurrency(json); -// const email = Convert.toEmail(json); -// const instrument = Convert.toInstrument(json); -// const instrumentList = Convert.toInstrumentList(json); -// const interaction = Convert.toInteraction(json); -// const message = Convert.toMessage(json); -// const nothing = Convert.toNothing(json); -// const order = Convert.toOrder(json); -// const orderList = Convert.toOrderList(json); -// const organization = Convert.toOrganization(json); -// const portfolio = Convert.toPortfolio(json); -// const position = Convert.toPosition(json); -// const product = Convert.toProduct(json); -// const timeRange = Convert.toTimeRange(json); -// const trade = Convert.toTrade(json); -// const tradeList = Convert.toTradeList(json); -// const transactionResult = Convert.toTransactionResult(json); -// const valuation = Convert.toValuation(json); -// -// These functions will throw an error if the JSON doesn't -// match the expected interface, even if the JSON is valid. - -/** - * 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. - */ -export interface Action { - /** - * An optional target application identifier that should perform the action - */ - app?: AppIdentifier; - /** - * A context object with which the action will be performed - */ - context: ContextElement; - /** - * 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. - */ - intent?: string; - /** - * A human readable display name for the action - */ - title: string; - type: "fdc3.action"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * An optional target application identifier that should perform the action - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - */ -export interface AppIdentifier { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * A context object with which the action will be performed - * - * A context object returned by the transaction, possibly with updated data. - * - * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by - * FDC3 operations. As such, it is not really meant to be used on its own, but is imported - * by more specific type definitions (standardized or custom) to provide the structure and - * properties shared by all FDC3 context data types. - * - * The key element of FDC3 context types is their mandatory `type` property, which is used - * to identify what type of data the object represents, and what shape it has. - * - * The FDC3 context type, and all derived types, define the minimum set of fields a context - * data object of a particular type can be expected to have, but this can always be extended - * with custom fields as appropriate. - */ -export interface ContextElement { - /** - * Context data objects may include a set of equivalent key-value pairs that can be used to - * help applications identify and look up the context type they receive in their own domain. - * The idea behind this design is that applications can provide as many equivalent - * identifiers to a target application as possible, e.g. an instrument may be represented by - * an ISIN, CUSIP or Bloomberg identifier. - * - * Identifiers do not make sense for all types of data, so the `id` property is therefore - * optional, but some derived types may choose to require at least one identifier. - * Identifier values SHOULD always be of type string. - */ - id?: { [key: string]: any }; - /** - * Context data objects may include a name property that can be used for more information, - * or display purposes. Some derived types may require the name object as mandatory, - * depending on use case. - */ - name?: string; - /** - * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 - * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present - * to route shared context data appropriately. - * - * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data - * types they support in an FDC3 [App - * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery - * and routing. - * - * Standardized FDC3 context types have well-known `type` properties prefixed with the - * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and - * used by a particular organization, the convention is to prefix them with an - * organization-specific namespace, e.g. `blackrock.fund`. - * - * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more - * information about context data types. - */ - type: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * 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. - * - * 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. - */ -export interface Chart { - /** - * An array of instrument contexts whose data should be plotted. - */ - instruments: InstrumentElement[]; - /** - * 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. - */ - otherConfig?: ContextElement[]; - /** - * The time range that should be plotted - */ - range?: TimeRangeObject; - /** - * The type of chart that should be plotted - */ - style?: ChartStyle; - type: "fdc3.chart"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * financial instrument that relates to the definition of this product - * - * - * - * A financial instrument from any asset class. - */ -export interface InstrumentElement { - /** - * Any combination of instrument identifiers can be used together to resolve ambiguity, or - * for a better match. Not all applications will use the same instrument identifiers, which - * is why FDC3 allows for multiple to be specified. In general, the more identifiers an - * application can provide, the easier it will be to achieve interoperability. - * - * It is valid to include extra properties and metadata as part of the instrument payload, - * but the minimum requirement is for at least one instrument identifier to be provided. - * - * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant - * for tickers as used by an exchange. - * If the identifier you want to share is not a ticker or one of the other standardized - * fields, define a property that makes it clear what the value represents. Doing so will - * make interpretation easier for the developers of target applications. - */ - id: PurpleInstrumentIdentifiers; - /** - * The `market` map can be used to further specify the instrument and help achieve - * interoperability between disparate data sources. This is especially useful when using an - * `id` field that is not globally unique. - */ - market?: OrganizationMarket; - type: "fdc3.instrument"; - name?: string; - [property: string]: any; -} - -/** - * Any combination of instrument identifiers can be used together to resolve ambiguity, or - * for a better match. Not all applications will use the same instrument identifiers, which - * is why FDC3 allows for multiple to be specified. In general, the more identifiers an - * application can provide, the easier it will be to achieve interoperability. - * - * It is valid to include extra properties and metadata as part of the instrument payload, - * but the minimum requirement is for at least one instrument identifier to be provided. - * - * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant - * for tickers as used by an exchange. - * If the identifier you want to share is not a ticker or one of the other standardized - * fields, define a property that makes it clear what the value represents. Doing so will - * make interpretation easier for the developers of target applications. - */ -export interface PurpleInstrumentIdentifiers { - /** - * https://www.bloomberg.com/ - */ - BBG?: string; - /** - * https://www.cusip.com/ - */ - CUSIP?: string; - /** - * https://www.factset.com/ - */ - FDS_ID?: string; - /** - * https://www.openfigi.com/ - */ - FIGI?: string; - /** - * https://www.isin.org/ - */ - ISIN?: string; - /** - * https://permid.org/ - */ - PERMID?: string; - /** - * https://www.refinitiv.com/ - */ - RIC?: string; - /** - * https://www.lseg.com/sedol - */ - SEDOL?: string; - /** - * Unstandardized stock tickers - */ - ticker?: string; - [property: string]: any; -} - -/** - * The `market` map can be used to further specify the instrument and help achieve - * interoperability between disparate data sources. This is especially useful when using an - * `id` field that is not globally unique. - */ -export interface OrganizationMarket { - /** - * https://www.bloomberg.com/ - */ - BBG?: string; - /** - * https://www.iso.org/iso-3166-country-codes.html - */ - COUNTRY_ISOALPHA2?: string; - /** - * https://en.wikipedia.org/wiki/Market_Identifier_Code - */ - MIC?: string; - /** - * Human readable market name - */ - name?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * The time range that should be plotted - * - * The time range over which the interaction occurred - * - * A context representing a period of time. Any user interfaces that represent or visualize - * events or activity over time can be filtered or focused on a particular time period, - * e.g.: - * - * - A pricing chart - * - A trade blotter - * - A record of client contact/activity in a CRM - * - * Example use cases: - * - * - User may want to view pricing/trades/customer activity for a security over a particular - * time period, the time range might be specified as the context for the `ViewChart` intent - * OR it might be embedded in another context (e.g. a context representing a chart to plot). - * - User filters a visualization (e.g. a pricing chart) to show a particular period, the - * `TimeRange` is broadcast and other visualizations (e.g. a heatmap of activity by - * instrument, or industry sector etc.) receive it and filter themselves to show data over - * the same range. - * - * Notes: - * - * - A `TimeRange` may be closed (i.e. `startTime` and `endTime` are both known) or open - * (i.e. only one of `startTime` or `endTime` is known). - * - Ranges corresponding to dates (e.g. `2022-05-12` to `2022-05-19`) should be specified - * using times as this prevents issues with timezone conversions and inclusive/exclusive - * date ranges. - * - String fields representing times are encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html). - * - A timezone indicator should be specified, e.g. `"2022-05-12T15:18:03Z"` or - * `"2022-05-12T16:18:03+01:00"` - * - Times MAY be specified with millisecond precision, e.g. `"2022-05-12T15:18:03.349Z"` - */ -export interface TimeRangeObject { - /** - * The end time of the range, encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. - */ - endTime?: Date; - /** - * The start time of the range, encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. - */ - startTime?: Date; - type: "fdc3.timeRange"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * The type of chart that should be plotted - */ -export type ChartStyle = "line" | "bar" | "stacked-bar" | "mountain" | "candle" | "pie" | "scatter" | "histogram" | "heatmap" | "custom"; - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A collection of settings to start a new chat conversation - */ -export interface ChatInitSettings { - /** - * Name to apply to the chat created - */ - chatName?: string; - /** - * Contacts to add to the chat - */ - members?: ContactListObject; - /** - * An initial message to post in the chat when created. - */ - message?: MessageObject | string; - /** - * Option settings that affect the creation of the chat - */ - options?: ChatOptions; - type: "fdc3.chat.initSettings"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Contacts to add to the chat - * - * A list of contacts involved in the interaction - * - * A collection of contacts, e.g. for chatting to or calling multiple contacts. - * - * The contact list schema does not explicitly include identifiers in the `id` section, as - * there is not a common standard for such identifiers. Applications can, however, populate - * this part of the contract with custom identifiers if so desired. - */ -export interface ContactListObject { - /** - * An array of contact contexts that forms the list. - */ - contacts: ContactElement[]; - type: "fdc3.contactList"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * The contact that initiated the interaction - * - * A person contact that can be engaged with through email, calling, messaging, CMS, etc. - */ -export interface ContactElement { - /** - * Identifiers that relate to the Contact represented by this context - */ - id: PurpleContactIdentifiers; - type: "fdc3.contact"; - name?: string; - [property: string]: any; -} - -/** - * Identifiers that relate to the Contact represented by this context - */ -export interface PurpleContactIdentifiers { - /** - * The email address for the contact - */ - email?: string; - /** - * FactSet Permanent Identifier representing the contact - */ - FDS_ID?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A chat message to be sent through an instant messaging application. Can contain one or - * several text bodies (organized by mime-type, plaintext or markdown), as well as attached - * entities (either arbitrary file attachments or FDC3 actions to be embedded in the - * message). To be put inside a ChatInitSettings object. - */ -export interface MessageObject { - /** - * A map of string IDs to entities that should be attached to the message, such as an action - * to perform, a file attachment, or other FDC3 context object. - */ - entities?: { [key: string]: PurpleAction }; - /** - * A map of string mime-type to string content - */ - text?: PurpleMessageText; - type: "fdc3.message"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * 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. - * - * A File attachment encoded in the form of a data URI - */ -export interface PurpleAction { - /** - * An optional target application identifier that should perform the action - */ - app?: AppIdentifier; - /** - * A context object with which the action will be performed - */ - context?: ContextElement; - /** - * 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. - */ - intent?: string; - /** - * A human readable display name for the action - */ - title?: string; - type: EntityType; - id?: { [key: string]: any }; - name?: string; - data?: PurpleData; - [property: string]: any; -} - -export interface PurpleData { - /** - * A data URI encoding the content of the file to be attached - */ - dataUri: string; - /** - * The name of the attached file - */ - name: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ -export type EntityType = "fdc3.action" | "fdc3.entity.fileAttachment"; - -/** - * A map of string mime-type to string content - */ -export interface PurpleMessageText { - /** - * Markdown encoded content - */ - "text/markdown"?: string; - /** - * Plain text encoded content. - */ - "text/plain"?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * Option settings that affect the creation of the chat - */ -export interface ChatOptions { - /** - * if true members will be allowed to add other members to the chat - */ - allowAddUser?: boolean; - /** - * if true members will be allowed to browse past messages - */ - allowHistoryBrowsing?: boolean; - /** - * if true members will be allowed to copy/paste messages - */ - allowMessageCopy?: boolean; - /** - * if false a separate chat will be created for each member - */ - groupRecipients?: boolean; - /** - * if true the room will be visible to everyone in the chat application - */ - isPublic?: boolean; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A context representing a chat message. Typically used to send the message or to - * pre-populate a message for sending. - */ -export interface ChatMessage { - chatRoom: ChatRoomObject; - message: MessageObject; - type: "fdc3.chat.message"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Reference to the chat room which could be used to send a message to the room - */ -export interface ChatRoomObject { - /** - * Identifier(s) for the chat - currently unstandardized - */ - id: { [key: string]: any }; - /** - * Display name for the chat room - */ - name?: string; - /** - * The name of the service that hosts the chat - */ - providerName: string; - type: "fdc3.chat.room"; - /** - * Universal url to access to the room. It could be opened from a browser, a mobile app, - * etc... - */ - url?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * Reference to the chat room which could be used to send a message to the room - */ -export interface ChatRoom { - /** - * Identifier(s) for the chat - currently unstandardized - */ - id: { [key: string]: any }; - /** - * Display name for the chat room - */ - name?: string; - /** - * The name of the service that hosts the chat - */ - providerName: string; - type: "fdc3.chat.room"; - /** - * Universal url to access to the room. It could be opened from a browser, a mobile app, - * etc... - */ - url?: string; - [property: string]: any; -} - -/** - * A context type that represents a simple search criterion, based on a list of other - * context objects, that can be used to search or filter messages in a chat application. - */ -export interface ChatSearchCriteria { - /** - * An array of criteria that should match chats returned from by a search. - * - * ⚠️ Operators (and/or/not) are not defined in `fdc3.chat.searchCriteria`. It is up to the - * application that processes the FDC3 Intent to choose and apply the operators between the - * criteria. - * - * Empty search criteria can be supported to allow resetting of filters. - */ - criteria: Array; - type: "fdc3.chat.searchCriteria"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * financial instrument that relates to the definition of this product - * - * - * - * A financial instrument from any asset class. - * - * An entity that can be used when referencing private companies and other organizations - * where a specific instrument is not available or desired e.g. CRM and News workflows. - * - * It is valid to include extra properties and metadata as part of the organization payload, - * but the minimum requirement is for at least one specified identifier to be provided. - * - * The contact that initiated the interaction - * - * A person contact that can be engaged with through email, calling, messaging, CMS, etc. - */ -export interface OrganizationObject { - /** - * Any combination of instrument identifiers can be used together to resolve ambiguity, or - * for a better match. Not all applications will use the same instrument identifiers, which - * is why FDC3 allows for multiple to be specified. In general, the more identifiers an - * application can provide, the easier it will be to achieve interoperability. - * - * It is valid to include extra properties and metadata as part of the instrument payload, - * but the minimum requirement is for at least one instrument identifier to be provided. - * - * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant - * for tickers as used by an exchange. - * If the identifier you want to share is not a ticker or one of the other standardized - * fields, define a property that makes it clear what the value represents. Doing so will - * make interpretation easier for the developers of target applications. - * - * Identifiers for the organization, at least one must be provided. - * - * Identifiers that relate to the Contact represented by this context - */ - id: Identifiers; - /** - * The `market` map can be used to further specify the instrument and help achieve - * interoperability between disparate data sources. This is especially useful when using an - * `id` field that is not globally unique. - */ - market?: OrganizationMarket; - type: TentacledInteractionType; - name?: string; - [property: string]: any; -} - -/** - * Any combination of instrument identifiers can be used together to resolve ambiguity, or - * for a better match. Not all applications will use the same instrument identifiers, which - * is why FDC3 allows for multiple to be specified. In general, the more identifiers an - * application can provide, the easier it will be to achieve interoperability. - * - * It is valid to include extra properties and metadata as part of the instrument payload, - * but the minimum requirement is for at least one instrument identifier to be provided. - * - * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant - * for tickers as used by an exchange. - * If the identifier you want to share is not a ticker or one of the other standardized - * fields, define a property that makes it clear what the value represents. Doing so will - * make interpretation easier for the developers of target applications. - * - * Identifiers for the organization, at least one must be provided. - * - * Identifiers that relate to the Contact represented by this context - */ -export interface Identifiers { - /** - * https://www.bloomberg.com/ - */ - BBG?: string; - /** - * https://www.cusip.com/ - */ - CUSIP?: string; - /** - * https://www.factset.com/ - * - * FactSet Permanent Identifier representing the organization - * - * FactSet Permanent Identifier representing the contact - */ - FDS_ID?: string; - /** - * https://www.openfigi.com/ - */ - FIGI?: string; - /** - * https://www.isin.org/ - */ - ISIN?: string; - /** - * https://permid.org/ - * - * Refinitiv Permanent Identifiers, or PermID for the organization - */ - PERMID?: string; - /** - * https://www.refinitiv.com/ - */ - RIC?: string; - /** - * https://www.lseg.com/sedol - */ - SEDOL?: string; - /** - * Unstandardized stock tickers - */ - ticker?: string; - /** - * The Legal Entity Identifier (LEI) is a 20-character, alpha-numeric code based on the ISO - * 17442 standard developed by the International Organization for Standardization (ISO). It - * connects to key reference information that enables clear and unique identification of - * legal entities participating in financial transactions. - */ - LEI?: string; - /** - * The email address for the contact - */ - email?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ -export type TentacledInteractionType = "fdc3.instrument" | "fdc3.organization" | "fdc3.contact"; - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A person contact that can be engaged with through email, calling, messaging, CMS, etc. - */ -export interface Contact { - /** - * Identifiers that relate to the Contact represented by this context - */ - id: FluffyContactIdentifiers; - type: "fdc3.contact"; - name?: string; - [property: string]: any; -} - -/** - * Identifiers that relate to the Contact represented by this context - */ -export interface FluffyContactIdentifiers { - /** - * The email address for the contact - */ - email?: string; - /** - * FactSet Permanent Identifier representing the contact - */ - FDS_ID?: string; - [property: string]: any; -} - -/** - * A collection of contacts, e.g. for chatting to or calling multiple contacts. - * - * The contact list schema does not explicitly include identifiers in the `id` section, as - * there is not a common standard for such identifiers. Applications can, however, populate - * this part of the contract with custom identifiers if so desired. - */ -export interface ContactList { - /** - * An array of contact contexts that forms the list. - */ - contacts: ContactElement[]; - type: "fdc3.contactList"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by - * FDC3 operations. As such, it is not really meant to be used on its own, but is imported - * by more specific type definitions (standardized or custom) to provide the structure and - * properties shared by all FDC3 context data types. - * - * The key element of FDC3 context types is their mandatory `type` property, which is used - * to identify what type of data the object represents, and what shape it has. - * - * The FDC3 context type, and all derived types, define the minimum set of fields a context - * data object of a particular type can be expected to have, but this can always be extended - * with custom fields as appropriate. - */ -export interface Context { - /** - * Context data objects may include a set of equivalent key-value pairs that can be used to - * help applications identify and look up the context type they receive in their own domain. - * The idea behind this design is that applications can provide as many equivalent - * identifiers to a target application as possible, e.g. an instrument may be represented by - * an ISIN, CUSIP or Bloomberg identifier. - * - * Identifiers do not make sense for all types of data, so the `id` property is therefore - * optional, but some derived types may choose to require at least one identifier. - * Identifier values SHOULD always be of type string. - */ - id?: { [key: string]: any }; - /** - * Context data objects may include a name property that can be used for more information, - * or display purposes. Some derived types may require the name object as mandatory, - * depending on use case. - */ - name?: string; - /** - * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 - * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present - * to route shared context data appropriately. - * - * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data - * types they support in an FDC3 [App - * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery - * and routing. - * - * Standardized FDC3 context types have well-known `type` properties prefixed with the - * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and - * used by a particular organization, the convention is to prefix them with an - * organization-specific namespace, e.g. `blackrock.fund`. - * - * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more - * information about context data types. - */ - type: string; - [property: string]: any; -} - -/** - * A country entity. - * - * Notes: - * - * - It is valid to include extra properties and metadata as part of the country payload, - * but the minimum requirement is for at least one standardized identifier to be provided - * - * - `COUNTRY_ISOALPHA2` SHOULD be preferred. - * - * - Try to only use country identifiers as intended and specified in the [ISO - * standard](https://en.wikipedia.org/wiki/ISO_3166-1). E.g. the `COUNTRY_ISOALPHA2` - * property must be a recognized value and not a proprietary two-letter code. If the - * identifier you want to share is not a standardized and recognized one, rather define a - * property that makes it clear what value it is. This makes it easier for target - * applications. - */ -export interface Country { - id: CountryID; - type: "fdc3.country"; - name?: string; - [property: string]: any; -} - -export interface CountryID { - /** - * Two-letter ISO country code - */ - COUNTRY_ISOALPHA2?: string; - /** - * Three-letter ISO country code - */ - COUNTRY_ISOALPHA3?: string; - /** - * Two-letter ISO country code. Deprecated in FDC3 2.0 in favour of the version prefixed - * with `COUNTRY_`. - */ - ISOALPHA2?: string; - /** - * Three-letter ISO country code. Deprecated in FDC3 2.0 in favour of the version prefixed - * with `COUNTRY_`. - */ - ISOALPHA3?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A context representing an individual Currency. - */ -export interface Currency { - id: CurrencyID; - /** - * The name of the currency for display purposes - */ - name?: string; - type: "fdc3.currency"; - [property: string]: any; -} - -export interface CurrencyID { - /** - * The `CURRENCY_ISOCODE` should conform to 3 character alphabetic codes defined in [ISO - * 4217](https://www.iso.org/iso-4217-currency-codes.html) - */ - CURRENCY_ISOCODE?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A collection of information to be used to initiate an email with a Contact or ContactList. - */ -export interface Email { - /** - * One or more recipients for the email. - */ - recipients: EmailRecipients; - /** - * Subject line for the email. - */ - subject?: string; - /** - * Body content for the email. - */ - textBody?: string; - type: "fdc3.email"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * One or more recipients for the email. - * - * The contact that initiated the interaction - * - * A person contact that can be engaged with through email, calling, messaging, CMS, etc. - * - * Contacts to add to the chat - * - * A list of contacts involved in the interaction - * - * A collection of contacts, e.g. for chatting to or calling multiple contacts. - * - * The contact list schema does not explicitly include identifiers in the `id` section, as - * there is not a common standard for such identifiers. Applications can, however, populate - * this part of the contract with custom identifiers if so desired. - */ -export interface EmailRecipients { - /** - * Identifiers that relate to the Contact represented by this context - */ - id?: EmailRecipientsID; - type: EmailRecipientsType; - name?: string; - /** - * An array of contact contexts that forms the list. - */ - contacts?: ContactElement[]; - [property: string]: any; -} - -/** - * Identifiers that relate to the Contact represented by this context - */ -export interface EmailRecipientsID { - /** - * The email address for the contact - */ - email?: string; - /** - * FactSet Permanent Identifier representing the contact - */ - FDS_ID?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ -export type EmailRecipientsType = "fdc3.contact" | "fdc3.contactList"; - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A financial instrument from any asset class. - */ -export interface Instrument { - /** - * Any combination of instrument identifiers can be used together to resolve ambiguity, or - * for a better match. Not all applications will use the same instrument identifiers, which - * is why FDC3 allows for multiple to be specified. In general, the more identifiers an - * application can provide, the easier it will be to achieve interoperability. - * - * It is valid to include extra properties and metadata as part of the instrument payload, - * but the minimum requirement is for at least one instrument identifier to be provided. - * - * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant - * for tickers as used by an exchange. - * If the identifier you want to share is not a ticker or one of the other standardized - * fields, define a property that makes it clear what the value represents. Doing so will - * make interpretation easier for the developers of target applications. - */ - id: FluffyInstrumentIdentifiers; - /** - * The `market` map can be used to further specify the instrument and help achieve - * interoperability between disparate data sources. This is especially useful when using an - * `id` field that is not globally unique. - */ - market?: PurpleMarket; - type: "fdc3.instrument"; - name?: string; - [property: string]: any; -} - -/** - * Any combination of instrument identifiers can be used together to resolve ambiguity, or - * for a better match. Not all applications will use the same instrument identifiers, which - * is why FDC3 allows for multiple to be specified. In general, the more identifiers an - * application can provide, the easier it will be to achieve interoperability. - * - * It is valid to include extra properties and metadata as part of the instrument payload, - * but the minimum requirement is for at least one instrument identifier to be provided. - * - * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant - * for tickers as used by an exchange. - * If the identifier you want to share is not a ticker or one of the other standardized - * fields, define a property that makes it clear what the value represents. Doing so will - * make interpretation easier for the developers of target applications. - */ -export interface FluffyInstrumentIdentifiers { - /** - * https://www.bloomberg.com/ - */ - BBG?: string; - /** - * https://www.cusip.com/ - */ - CUSIP?: string; - /** - * https://www.factset.com/ - */ - FDS_ID?: string; - /** - * https://www.openfigi.com/ - */ - FIGI?: string; - /** - * https://www.isin.org/ - */ - ISIN?: string; - /** - * https://permid.org/ - */ - PERMID?: string; - /** - * https://www.refinitiv.com/ - */ - RIC?: string; - /** - * https://www.lseg.com/sedol - */ - SEDOL?: string; - /** - * Unstandardized stock tickers - */ - ticker?: string; - [property: string]: any; -} - -/** - * The `market` map can be used to further specify the instrument and help achieve - * interoperability between disparate data sources. This is especially useful when using an - * `id` field that is not globally unique. - */ -export interface PurpleMarket { - /** - * https://www.bloomberg.com/ - */ - BBG?: string; - /** - * https://www.iso.org/iso-3166-country-codes.html - */ - COUNTRY_ISOALPHA2?: string; - /** - * https://en.wikipedia.org/wiki/Market_Identifier_Code - */ - MIC?: string; - /** - * Human readable market name - */ - name?: string; - [property: string]: any; -} - -/** - * A collection of instruments. Use this type for use cases that require not just a single - * instrument, but multiple (e.g. to populate a watchlist). However, when holding - * information for each instrument is required, it is recommended to use the - * [Portfolio](Portfolio) type. - * - * The instrument list schema does not explicitly include identifiers in the `id` section, - * as there is not a common standard for such identifiers. Applications can, however, - * populate this part of the contract with custom identifiers if so desired. - */ -export interface InstrumentList { - /** - * An array of instrument contexts that forms the list. - */ - instruments: InstrumentElement[]; - type: "fdc3.instrumentList"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * An `Interaction` is a significant direct exchange of ideas or information between a - * number of participants, e.g. a Sell Side party and one or more Buy Side parties. An - * `Interaction` might be a call, a meeting (physical or virtual), an IM or the preparation - * of some specialist data, such as financial data for a given company or sector. - */ -export interface Interaction { - /** - * A human-readable description of the interaction - */ - description: string; - /** - * Can be used by a target application to pass an identifier back to the originating - * application after an interaction record has been created, updated or deleted. An - * interaction ID does not need to be populated by the originating application, however the - * target application could store it for future reference and SHOULD return it in a - * `TransactionResult`. - */ - id?: InteractionID; - /** - * The contact that initiated the interaction - */ - initiator?: ContactElement; - /** - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - interactionType: string; - /** - * Used to represent the application or service that the interaction was created from to aid - * in tracing the source of an interaction. - */ - origin?: string; - /** - * A list of contacts involved in the interaction - */ - participants: ContactListObject; - /** - * The time range over which the interaction occurred - */ - timeRange: TimeRangeObject; - type: "fdc3.interaction"; - name?: string; - [property: string]: any; -} - -/** - * Can be used by a target application to pass an identifier back to the originating - * application after an interaction record has been created, updated or deleted. An - * interaction ID does not need to be populated by the originating application, however the - * target application could store it for future reference and SHOULD return it in a - * `TransactionResult`. - */ -export interface InteractionID { - /** - * Interactions ID in Salesforce - */ - SALESFORCE?: string; - /** - * Interaction ID in SingleTrack - */ - SINGLETRACK?: string; - /** - * Can be used by a target application to pass a record's link back to the originating - * application. This offers the originating application a way to open the record for a user - * to view. - */ - URI?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A chat message to be sent through an instant messaging application. Can contain one or - * several text bodies (organized by mime-type, plaintext or markdown), as well as attached - * entities (either arbitrary file attachments or FDC3 actions to be embedded in the - * message). To be put inside a ChatInitSettings object. - */ -export interface Message { - /** - * A map of string IDs to entities that should be attached to the message, such as an action - * to perform, a file attachment, or other FDC3 context object. - */ - entities?: { [key: string]: FluffyAction }; - /** - * A map of string mime-type to string content - */ - text?: FluffyMessageText; - type: "fdc3.message"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * 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. - * - * A File attachment encoded in the form of a data URI - */ -export interface FluffyAction { - /** - * An optional target application identifier that should perform the action - */ - app?: AppIdentifier; - /** - * A context object with which the action will be performed - */ - context?: ContextElement; - /** - * 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. - */ - intent?: string; - /** - * A human readable display name for the action - */ - title?: string; - type: EntityType; - id?: { [key: string]: any }; - name?: string; - data?: FluffyData; - [property: string]: any; -} - -export interface FluffyData { - /** - * A data URI encoding the content of the file to be attached - */ - dataUri: string; - /** - * The name of the attached file - */ - name: string; - [property: string]: any; -} - -/** - * A map of string mime-type to string content - */ -export interface FluffyMessageText { - /** - * Markdown encoded content - */ - "text/markdown"?: string; - /** - * Plain text encoded content. - */ - "text/plain"?: string; - [property: string]: any; -} - -/** - * A type that explicitly represents a lack of context. - * - * Notes: - * - * - Intended to be used in situations where no context is desired. - * - For example: - * - Raising an intent without context (e.g. opening a blank order form, or chat interface - * without a contact selected). - * - Resetting context on a channel (e.g. when context is used to set a filter in other - * applications a null context might release the filter). - * - An explicit representation of a Null or empty context allows apps to declare support - * for a lack of context, for example in their intent metadata in an app directory. - */ -export interface Nothing { - type: "fdc3.nothing"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * @experimental context type representing an order. To be used with OMS and EMS systems. - * - * This type currently only defines a required `id` field, which should provide a reference - * to the order in one or more systems, an optional human readable `name` field to be used - * to summarize the order and an optional `details` field that may be used to provide - * additional detail about the order, including a context representing a `product`, which - * may be extended with arbitrary properties. The `details.product` field is currently typed - * as a unspecified Context type, but both `details` and `details.product` are expected to - * be standardized in future. - */ -export interface Order { - /** - * Optional additional details about the order, which may include a product element that is - * an, as yet undefined but extensible, Context - */ - details?: PurpleOrderDetails; - /** - * One or more identifiers that refer to the order in an OMS, EMS or related system. - * Specific key names for systems are expected to be standardized in future. - */ - id: { [key: string]: string }; - /** - * An optional human-readable summary of the order. - */ - name?: string; - type: "fdc3.order"; - [property: string]: any; -} - -/** - * Optional additional details about the order, which may include a product element that is - * an, as yet undefined but extensible, Context - */ -export interface PurpleOrderDetails { - product?: ProductObject; - [property: string]: any; -} - -/** - * A product that is the subject of the trade. - * - * @experimental context type representing a tradable product. To be used with OMS and EMS - * systems. - * - * This type is currently only loosely defined as an extensible context object, with an - * optional instrument field. - * - * The Product schema does not explicitly include identifiers in the id section, as there is - * not a common standard for such identifiers. Applications can, however, populate this part - * of the contract with custom identifiers if so desired. - */ -export interface ProductObject { - /** - * One or more identifiers that refer to the product. Specific key names for systems are - * expected to be standardized in future. - */ - id: { [key: string]: string }; - /** - * financial instrument that relates to the definition of this product - */ - instrument?: InstrumentElement; - /** - * A human-readable summary of the product. - */ - name?: string; - type: "fdc3.product"; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * @experimental A list of orders. Use this type for use cases that require not just a - * single order, but multiple. - * - * The OrderList schema does not explicitly include identifiers in the id section, as there - * is not a common standard for such identifiers. Applications can, however, populate this - * part of the contract with custom identifiers if so desired. - */ -export interface OrderList { - /** - * An array of order contexts that forms the list. - */ - orders: OrderElement[]; - type: "fdc3.orderList"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * @experimental context type representing an order. To be used with OMS and EMS systems. - * - * This type currently only defines a required `id` field, which should provide a reference - * to the order in one or more systems, an optional human readable `name` field to be used - * to summarize the order and an optional `details` field that may be used to provide - * additional detail about the order, including a context representing a `product`, which - * may be extended with arbitrary properties. The `details.product` field is currently typed - * as a unspecified Context type, but both `details` and `details.product` are expected to - * be standardized in future. - */ -export interface OrderElement { - /** - * Optional additional details about the order, which may include a product element that is - * an, as yet undefined but extensible, Context - */ - details?: FluffyOrderDetails; - /** - * One or more identifiers that refer to the order in an OMS, EMS or related system. - * Specific key names for systems are expected to be standardized in future. - */ - id: { [key: string]: string }; - /** - * An optional human-readable summary of the order. - */ - name?: string; - type: "fdc3.order"; - [property: string]: any; -} - -/** - * Optional additional details about the order, which may include a product element that is - * an, as yet undefined but extensible, Context - */ -export interface FluffyOrderDetails { - product?: ProductObject; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * An entity that can be used when referencing private companies and other organizations - * where a specific instrument is not available or desired e.g. CRM and News workflows. - * - * It is valid to include extra properties and metadata as part of the organization payload, - * but the minimum requirement is for at least one specified identifier to be provided. - */ -export interface Organization { - /** - * Identifiers for the organization, at least one must be provided. - */ - id: OrganizationIdentifiers; - type: "fdc3.organization"; - name?: string; - [property: string]: any; -} - -/** - * Identifiers for the organization, at least one must be provided. - */ -export interface OrganizationIdentifiers { - /** - * FactSet Permanent Identifier representing the organization - */ - FDS_ID?: string; - /** - * The Legal Entity Identifier (LEI) is a 20-character, alpha-numeric code based on the ISO - * 17442 standard developed by the International Organization for Standardization (ISO). It - * connects to key reference information that enables clear and unique identification of - * legal entities participating in financial transactions. - */ - LEI?: string; - /** - * Refinitiv Permanent Identifiers, or PermID for the organization - */ - PERMID?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A financial portfolio made up of multiple positions (holdings) in several instruments. - * Contrast this with e.g. the [InstrumentList](InstrumentList) type, which is just a list - * of instruments. - * - * This is a good example of how types can be composed and extended with extra properties to - * define more complex types. - * - * The Portfolio type consists of an array of [Position](Position) types, each of which - * refers to a single [Instrument](Instrument) and a holding amount for that instrument. - * - * The portfolio schema does not explicitly include identifiers in the `id` section, as - * there bis not a common standard for such identifiers. Applications can, however, populate - * this part of the contract with custom identifiers if so desired. - */ -export interface Portfolio { - /** - * The List of Positions which make up the Portfolio - */ - positions: PositionElement[]; - type: "fdc3.portfolio"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * A financial position made up of an instrument and a holding in that instrument. This type - * is a good example of how new context types can be composed from existing types. - * - * In this case, the instrument and the holding amount for that instrument are required - * values. - * - * The [Position](Position) type goes hand-in-hand with the [Portfolio](Portfolio) type, - * which represents multiple holdings in a combination of instruments. - * - * The position schema does not explicitly include identifiers in the `id` section, as there - * is not a common standard for such identifiers. Applications can, however, populate this - * part of the contract with custom identifiers if so desired. - */ -export interface PositionElement { - /** - * The amount of the holding, e.g. a number of shares - */ - holding: number; - instrument: InstrumentElement; - type: "fdc3.position"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A financial position made up of an instrument and a holding in that instrument. This type - * is a good example of how new context types can be composed from existing types. - * - * In this case, the instrument and the holding amount for that instrument are required - * values. - * - * The [Position](Position) type goes hand-in-hand with the [Portfolio](Portfolio) type, - * which represents multiple holdings in a combination of instruments. - * - * The position schema does not explicitly include identifiers in the `id` section, as there - * is not a common standard for such identifiers. Applications can, however, populate this - * part of the contract with custom identifiers if so desired. - */ -export interface Position { - /** - * The amount of the holding, e.g. a number of shares - */ - holding: number; - instrument: InstrumentElement; - type: "fdc3.position"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * @experimental context type representing a tradable product. To be used with OMS and EMS - * systems. - * - * This type is currently only loosely defined as an extensible context object, with an - * optional instrument field. - * - * The Product schema does not explicitly include identifiers in the id section, as there is - * not a common standard for such identifiers. Applications can, however, populate this part - * of the contract with custom identifiers if so desired. - */ -export interface Product { - /** - * One or more identifiers that refer to the product. Specific key names for systems are - * expected to be standardized in future. - */ - id: { [key: string]: string }; - /** - * financial instrument that relates to the definition of this product - */ - instrument?: InstrumentElement; - /** - * A human-readable summary of the product. - */ - name?: string; - type: "fdc3.product"; - [property: string]: any; -} - -/** - * A context representing a period of time. Any user interfaces that represent or visualize - * events or activity over time can be filtered or focused on a particular time period, - * e.g.: - * - * - A pricing chart - * - A trade blotter - * - A record of client contact/activity in a CRM - * - * Example use cases: - * - * - User may want to view pricing/trades/customer activity for a security over a particular - * time period, the time range might be specified as the context for the `ViewChart` intent - * OR it might be embedded in another context (e.g. a context representing a chart to plot). - * - User filters a visualization (e.g. a pricing chart) to show a particular period, the - * `TimeRange` is broadcast and other visualizations (e.g. a heatmap of activity by - * instrument, or industry sector etc.) receive it and filter themselves to show data over - * the same range. - * - * Notes: - * - * - A `TimeRange` may be closed (i.e. `startTime` and `endTime` are both known) or open - * (i.e. only one of `startTime` or `endTime` is known). - * - Ranges corresponding to dates (e.g. `2022-05-12` to `2022-05-19`) should be specified - * using times as this prevents issues with timezone conversions and inclusive/exclusive - * date ranges. - * - String fields representing times are encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html). - * - A timezone indicator should be specified, e.g. `"2022-05-12T15:18:03Z"` or - * `"2022-05-12T16:18:03+01:00"` - * - Times MAY be specified with millisecond precision, e.g. `"2022-05-12T15:18:03.349Z"` - */ -export interface TimeRange { - /** - * The end time of the range, encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. - */ - endTime?: Date; - /** - * The start time of the range, encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. - */ - startTime?: Date; - type: "fdc3.timeRange"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * @experimental context type representing a trade. To be used with execution systems. - * - * This type currently only defines a required `id` field, which should provide a reference - * to the trade in one or more systems, an optional human readable `name` field to be used - * to summarize the trade and a required `product` field that may be used to provide - * additional detail about the trade, which is currently typed as a unspecified Context - * type, but `product` is expected to be standardized in future. - * - * The Trade schema does not explicitly include identifiers in the id section, as there is - * not a common standard for such identifiers. Applications can, however, populate this part - * of the contract with custom identifiers if so desired. - */ -export interface Trade { - /** - * One or more identifiers that refer to the trade in an OMS, EMS or related system. - * Specific key names for systems are expected to be standardized in future. - */ - id: { [key: string]: string }; - /** - * A human-readable summary of the trade. - */ - name?: string; - /** - * A product that is the subject of the trade. - */ - product: ProductObject; - type: "fdc3.trade"; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * @experimental A list of trades. Use this type for use cases that require not just a - * single trade, but multiple. - * - * The TradeList schema does not explicitly include identifiers in the id section, as there - * is not a common standard for such identifiers. Applications can, however, populate this - * part of the contract with custom identifiers if so desired. - */ -export interface TradeList { - /** - * An array of trade contexts that forms the list. - */ - trades: TradeElement[]; - type: "fdc3.tradeList"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * @experimental context type representing a trade. To be used with execution systems. - * - * This type currently only defines a required `id` field, which should provide a reference - * to the trade in one or more systems, an optional human readable `name` field to be used - * to summarize the trade and a required `product` field that may be used to provide - * additional detail about the trade, which is currently typed as a unspecified Context - * type, but `product` is expected to be standardized in future. - * - * The Trade schema does not explicitly include identifiers in the id section, as there is - * not a common standard for such identifiers. Applications can, however, populate this part - * of the contract with custom identifiers if so desired. - */ -export interface TradeElement { - /** - * One or more identifiers that refer to the trade in an OMS, EMS or related system. - * Specific key names for systems are expected to be standardized in future. - */ - id: { [key: string]: string }; - /** - * A human-readable summary of the trade. - */ - name?: string; - /** - * A product that is the subject of the trade. - */ - product: ProductObject; - type: "fdc3.trade"; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A context type representing the result of a transaction initiated via FDC3, which SHOULD - * be returned as an `IntentResult` by intents that create, retrieve, update or delete - * content or records in another application. Its purpose is to provide a status and message - * (where needed) for the transaction and MAY wrap a returned context object. - */ -export interface TransactionResult { - /** - * A context object returned by the transaction, possibly with updated data. - */ - context?: ContextElement; - /** - * A human readable message describing the outcome of the transaction. - */ - message?: string; - /** - * The status of the transaction being reported. - */ - status: TransactionStatus; - type: "fdc3.transactionResult"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * The status of the transaction being reported. - */ -export type TransactionStatus = "Created" | "Deleted" | "Updated" | "Failed"; - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A context type representing the price and value of a holding. - */ -export interface Valuation { - /** - * The valuation currency, which should conform to 3 character alphabetic codes defined in - * [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) - */ - CURRENCY_ISOCODE: string; - /** - * The time at which this valuation expires, encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator included. - */ - expiryTime?: Date; - /** - * The price per unit the the valuation is based on. - */ - price?: number; - type: "fdc3.valuation"; - /** - * The time at which the valuation was performed, encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator included. - */ - valuationTime?: Date; - /** - * The value of the holding, expresses in the nominated currency. - */ - value: number; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -// Converts JSON strings to/from your types -// and asserts the results of JSON.parse at runtime -export class Convert { - public static toAction(json: string): Action { - return cast(JSON.parse(json), r("Action")); - } - - public static actionToJson(value: Action): string { - return JSON.stringify(uncast(value, r("Action")), null, 2); - } - - public static toChart(json: string): Chart { - return cast(JSON.parse(json), r("Chart")); - } - - public static chartToJson(value: Chart): string { - return JSON.stringify(uncast(value, r("Chart")), null, 2); - } - - public static toChatInitSettings(json: string): ChatInitSettings { - return cast(JSON.parse(json), r("ChatInitSettings")); - } - - public static chatInitSettingsToJson(value: ChatInitSettings): string { - return JSON.stringify(uncast(value, r("ChatInitSettings")), null, 2); - } - - public static toChatMessage(json: string): ChatMessage { - return cast(JSON.parse(json), r("ChatMessage")); - } - - public static chatMessageToJson(value: ChatMessage): string { - return JSON.stringify(uncast(value, r("ChatMessage")), null, 2); - } - - public static toChatRoom(json: string): ChatRoom { - return cast(JSON.parse(json), r("ChatRoom")); - } - - public static chatRoomToJson(value: ChatRoom): string { - return JSON.stringify(uncast(value, r("ChatRoom")), null, 2); - } - - public static toChatSearchCriteria(json: string): ChatSearchCriteria { - return cast(JSON.parse(json), r("ChatSearchCriteria")); - } - - public static chatSearchCriteriaToJson(value: ChatSearchCriteria): string { - return JSON.stringify(uncast(value, r("ChatSearchCriteria")), null, 2); - } - - public static toContact(json: string): Contact { - return cast(JSON.parse(json), r("Contact")); - } - - public static contactToJson(value: Contact): string { - return JSON.stringify(uncast(value, r("Contact")), null, 2); - } - - public static toContactList(json: string): ContactList { - return cast(JSON.parse(json), r("ContactList")); - } - - public static contactListToJson(value: ContactList): string { - return JSON.stringify(uncast(value, r("ContactList")), null, 2); - } - - public static toContext(json: string): Context { - return cast(JSON.parse(json), r("Context")); - } - - public static contextToJson(value: Context): string { - return JSON.stringify(uncast(value, r("Context")), null, 2); - } - - public static toCountry(json: string): Country { - return cast(JSON.parse(json), r("Country")); - } - - public static countryToJson(value: Country): string { - return JSON.stringify(uncast(value, r("Country")), null, 2); - } - - public static toCurrency(json: string): Currency { - return cast(JSON.parse(json), r("Currency")); - } - - public static currencyToJson(value: Currency): string { - return JSON.stringify(uncast(value, r("Currency")), null, 2); - } - - public static toEmail(json: string): Email { - return cast(JSON.parse(json), r("Email")); - } - - public static emailToJson(value: Email): string { - return JSON.stringify(uncast(value, r("Email")), null, 2); - } - - public static toInstrument(json: string): Instrument { - return cast(JSON.parse(json), r("Instrument")); - } - - public static instrumentToJson(value: Instrument): string { - return JSON.stringify(uncast(value, r("Instrument")), null, 2); - } - - public static toInstrumentList(json: string): InstrumentList { - return cast(JSON.parse(json), r("InstrumentList")); - } - - public static instrumentListToJson(value: InstrumentList): string { - return JSON.stringify(uncast(value, r("InstrumentList")), null, 2); - } - - public static toInteraction(json: string): Interaction { - return cast(JSON.parse(json), r("Interaction")); - } - - public static interactionToJson(value: Interaction): string { - return JSON.stringify(uncast(value, r("Interaction")), null, 2); - } - - public static toMessage(json: string): Message { - return cast(JSON.parse(json), r("Message")); - } - - public static messageToJson(value: Message): string { - return JSON.stringify(uncast(value, r("Message")), null, 2); - } - - public static toNothing(json: string): Nothing { - return cast(JSON.parse(json), r("Nothing")); - } - - public static nothingToJson(value: Nothing): string { - return JSON.stringify(uncast(value, r("Nothing")), null, 2); - } - - public static toOrder(json: string): Order { - return cast(JSON.parse(json), r("Order")); - } - - public static orderToJson(value: Order): string { - return JSON.stringify(uncast(value, r("Order")), null, 2); - } - - public static toOrderList(json: string): OrderList { - return cast(JSON.parse(json), r("OrderList")); - } - - public static orderListToJson(value: OrderList): string { - return JSON.stringify(uncast(value, r("OrderList")), null, 2); - } - - public static toOrganization(json: string): Organization { - return cast(JSON.parse(json), r("Organization")); - } - - public static organizationToJson(value: Organization): string { - return JSON.stringify(uncast(value, r("Organization")), null, 2); - } - - public static toPortfolio(json: string): Portfolio { - return cast(JSON.parse(json), r("Portfolio")); - } - - public static portfolioToJson(value: Portfolio): string { - return JSON.stringify(uncast(value, r("Portfolio")), null, 2); - } - - public static toPosition(json: string): Position { - return cast(JSON.parse(json), r("Position")); - } - - public static positionToJson(value: Position): string { - return JSON.stringify(uncast(value, r("Position")), null, 2); - } - - public static toProduct(json: string): Product { - return cast(JSON.parse(json), r("Product")); - } - - public static productToJson(value: Product): string { - return JSON.stringify(uncast(value, r("Product")), null, 2); - } - - public static toTimeRange(json: string): TimeRange { - return cast(JSON.parse(json), r("TimeRange")); - } - - public static timeRangeToJson(value: TimeRange): string { - return JSON.stringify(uncast(value, r("TimeRange")), null, 2); - } - - public static toTrade(json: string): Trade { - return cast(JSON.parse(json), r("Trade")); - } - - public static tradeToJson(value: Trade): string { - return JSON.stringify(uncast(value, r("Trade")), null, 2); - } - - public static toTradeList(json: string): TradeList { - return cast(JSON.parse(json), r("TradeList")); - } - - public static tradeListToJson(value: TradeList): string { - return JSON.stringify(uncast(value, r("TradeList")), null, 2); - } - - public static toTransactionResult(json: string): TransactionResult { - return cast(JSON.parse(json), r("TransactionResult")); - } - - public static transactionResultToJson(value: TransactionResult): string { - return JSON.stringify(uncast(value, r("TransactionResult")), null, 2); - } - - public static toValuation(json: string): Valuation { - return cast(JSON.parse(json), r("Valuation")); - } - - public static valuationToJson(value: Valuation): string { - return JSON.stringify(uncast(value, r("Valuation")), null, 2); - } -} - -function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { - const prettyTyp = prettyTypeName(typ); - const parentText = parent ? ` on ${parent}` : ''; - const keyText = key ? ` for key "${key}"` : ''; - throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); -} - -function prettyTypeName(typ: any): string { - if (Array.isArray(typ)) { - if (typ.length === 2 && typ[0] === undefined) { - return `an optional ${prettyTypeName(typ[1])}`; - } else { - return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; - } - } else if (typeof typ === "object" && typ.literal !== undefined) { - return typ.literal; - } else { - return typeof typ; - } -} - -function jsonToJSProps(typ: any): any { - if (typ.jsonToJS === undefined) { - const map: any = {}; - typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); - typ.jsonToJS = map; - } - return typ.jsonToJS; -} - -function jsToJSONProps(typ: any): any { - if (typ.jsToJSON === undefined) { - const map: any = {}; - typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); - typ.jsToJSON = map; - } - return typ.jsToJSON; -} - -function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { - function transformPrimitive(typ: string, val: any): any { - if (typeof typ === typeof val) return val; - return invalidValue(typ, val, key, parent); - } - - function transformUnion(typs: any[], val: any): any { - // val must validate against one typ in typs - const l = typs.length; - for (let i = 0; i < l; i++) { - const typ = typs[i]; - try { - return transform(val, typ, getProps); - } catch (_) {} - } - return invalidValue(typs, val, key, parent); - } - - function transformEnum(cases: string[], val: any): any { - if (cases.indexOf(val) !== -1) return val; - return invalidValue(cases.map(a => { return l(a); }), val, key, parent); - } - - function transformArray(typ: any, val: any): any { - // val must be an array with no invalid elements - if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); - return val.map(el => transform(el, typ, getProps)); - } - - function transformDate(val: any): any { - if (val === null) { - return null; - } - const d = new Date(val); - if (isNaN(d.valueOf())) { - return invalidValue(l("Date"), val, key, parent); - } - return d; - } - - function transformObject(props: { [k: string]: any }, additional: any, val: any): any { - if (val === null || typeof val !== "object" || Array.isArray(val)) { - return invalidValue(l(ref || "object"), val, key, parent); - } - const result: any = {}; - Object.getOwnPropertyNames(props).forEach(key => { - const prop = props[key]; - const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; - result[prop.key] = transform(v, prop.typ, getProps, key, ref); - }); - Object.getOwnPropertyNames(val).forEach(key => { - if (!Object.prototype.hasOwnProperty.call(props, key)) { - result[key] = transform(val[key], additional, getProps, key, ref); - } - }); - return result; - } - - if (typ === "any") return val; - if (typ === null) { - if (val === null) return val; - return invalidValue(typ, val, key, parent); - } - if (typ === false) return invalidValue(typ, val, key, parent); - let ref: any = undefined; - while (typeof typ === "object" && typ.ref !== undefined) { - ref = typ.ref; - typ = typeMap[typ.ref]; - } - if (Array.isArray(typ)) return transformEnum(typ, val); - if (typeof typ === "object") { - return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) - : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) - : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) - : invalidValue(typ, val, key, parent); - } - // Numbers can be parsed by Date but shouldn't be. - if (typ === Date && typeof val !== "number") return transformDate(val); - return transformPrimitive(typ, val); -} - -function cast(val: any, typ: any): T { - return transform(val, typ, jsonToJSProps); -} - -function uncast(val: T, typ: any): any { - return transform(val, typ, jsToJSONProps); -} - -function l(typ: any) { - return { literal: typ }; -} - -function a(typ: any) { - return { arrayItems: typ }; -} - -function u(...typs: any[]) { - return { unionMembers: typs }; -} - -function o(props: any[], additional: any) { - return { props, additional }; -} - -function m(additional: any) { - return { props: [], additional }; -} - -function r(name: string) { - return { ref: name }; -} - -const typeMap: any = { - "Action": o([ - { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, - { json: "context", js: "context", typ: r("ContextElement") }, - { json: "intent", js: "intent", typ: u(undefined, "") }, - { json: "title", js: "title", typ: "" }, - { json: "type", js: "type", typ: r("ActionType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "AppIdentifier": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "ContextElement": o([ - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: "" }, - ], "any"), - "Chart": o([ - { json: "instruments", js: "instruments", typ: a(r("InstrumentElement")) }, - { json: "otherConfig", js: "otherConfig", typ: u(undefined, a(r("ContextElement"))) }, - { json: "range", js: "range", typ: u(undefined, r("TimeRangeObject")) }, - { json: "style", js: "style", typ: u(undefined, r("ChartStyle")) }, - { json: "type", js: "type", typ: r("ChartType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "InstrumentElement": o([ - { json: "id", js: "id", typ: r("PurpleInstrumentIdentifiers") }, - { json: "market", js: "market", typ: u(undefined, r("OrganizationMarket")) }, - { json: "type", js: "type", typ: r("PurpleInteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "PurpleInstrumentIdentifiers": o([ - { json: "BBG", js: "BBG", typ: u(undefined, "") }, - { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, - { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, - { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, - { json: "RIC", js: "RIC", typ: u(undefined, "") }, - { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, - { json: "ticker", js: "ticker", typ: u(undefined, "") }, - ], "any"), - "OrganizationMarket": o([ - { json: "BBG", js: "BBG", typ: u(undefined, "") }, - { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, - { json: "MIC", js: "MIC", typ: u(undefined, "") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "TimeRangeObject": o([ - { json: "endTime", js: "endTime", typ: u(undefined, Date) }, - { json: "startTime", js: "startTime", typ: u(undefined, Date) }, - { json: "type", js: "type", typ: r("TimeRangeType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "ChatInitSettings": o([ - { json: "chatName", js: "chatName", typ: u(undefined, "") }, - { json: "members", js: "members", typ: u(undefined, r("ContactListObject")) }, - { json: "message", js: "message", typ: u(undefined, u(r("MessageObject"), "")) }, - { json: "options", js: "options", typ: u(undefined, r("ChatOptions")) }, - { json: "type", js: "type", typ: r("ChatInitSettingsType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "ContactListObject": o([ - { json: "contacts", js: "contacts", typ: a(r("ContactElement")) }, - { json: "type", js: "type", typ: r("ContactListType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "ContactElement": o([ - { json: "id", js: "id", typ: r("PurpleContactIdentifiers") }, - { json: "type", js: "type", typ: r("FluffyInteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "PurpleContactIdentifiers": o([ - { json: "email", js: "email", typ: u(undefined, "") }, - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - ], "any"), - "MessageObject": o([ - { json: "entities", js: "entities", typ: u(undefined, m(r("PurpleAction"))) }, - { json: "text", js: "text", typ: u(undefined, r("PurpleMessageText")) }, - { json: "type", js: "type", typ: r("MessageType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "PurpleAction": o([ - { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, - { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, - { json: "intent", js: "intent", typ: u(undefined, "") }, - { json: "title", js: "title", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("EntityType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "data", js: "data", typ: u(undefined, r("PurpleData")) }, - ], "any"), - "PurpleData": o([ - { json: "dataUri", js: "dataUri", typ: "" }, - { json: "name", js: "name", typ: "" }, - ], "any"), - "PurpleMessageText": o([ - { json: "text/markdown", js: "text/markdown", typ: u(undefined, "") }, - { json: "text/plain", js: "text/plain", typ: u(undefined, "") }, - ], "any"), - "ChatOptions": o([ - { json: "allowAddUser", js: "allowAddUser", typ: u(undefined, true) }, - { json: "allowHistoryBrowsing", js: "allowHistoryBrowsing", typ: u(undefined, true) }, - { json: "allowMessageCopy", js: "allowMessageCopy", typ: u(undefined, true) }, - { json: "groupRecipients", js: "groupRecipients", typ: u(undefined, true) }, - { json: "isPublic", js: "isPublic", typ: u(undefined, true) }, - ], "any"), - "ChatMessage": o([ - { json: "chatRoom", js: "chatRoom", typ: r("ChatRoomObject") }, - { json: "message", js: "message", typ: r("MessageObject") }, - { json: "type", js: "type", typ: r("ChatMessageType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "ChatRoomObject": o([ - { json: "id", js: "id", typ: m("any") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "providerName", js: "providerName", typ: "" }, - { json: "type", js: "type", typ: r("ChatRoomType") }, - { json: "url", js: "url", typ: u(undefined, "") }, - ], "any"), - "ChatRoom": o([ - { json: "id", js: "id", typ: m("any") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "providerName", js: "providerName", typ: "" }, - { json: "type", js: "type", typ: r("ChatRoomType") }, - { json: "url", js: "url", typ: u(undefined, "") }, - ], "any"), - "ChatSearchCriteria": o([ - { json: "criteria", js: "criteria", typ: a(u(r("OrganizationObject"), "")) }, - { json: "type", js: "type", typ: r("ChatSearchCriteriaType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "OrganizationObject": o([ - { json: "id", js: "id", typ: r("Identifiers") }, - { json: "market", js: "market", typ: u(undefined, r("OrganizationMarket")) }, - { json: "type", js: "type", typ: r("TentacledInteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Identifiers": o([ - { json: "BBG", js: "BBG", typ: u(undefined, "") }, - { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, - { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, - { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, - { json: "RIC", js: "RIC", typ: u(undefined, "") }, - { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, - { json: "ticker", js: "ticker", typ: u(undefined, "") }, - { json: "LEI", js: "LEI", typ: u(undefined, "") }, - { json: "email", js: "email", typ: u(undefined, "") }, - ], "any"), - "Contact": o([ - { json: "id", js: "id", typ: r("FluffyContactIdentifiers") }, - { json: "type", js: "type", typ: r("FluffyInteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "FluffyContactIdentifiers": o([ - { json: "email", js: "email", typ: u(undefined, "") }, - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - ], "any"), - "ContactList": o([ - { json: "contacts", js: "contacts", typ: a(r("ContactElement")) }, - { json: "type", js: "type", typ: r("ContactListType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Context": o([ - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: "" }, - ], "any"), - "Country": o([ - { json: "id", js: "id", typ: r("CountryID") }, - { json: "type", js: "type", typ: r("CountryType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "CountryID": o([ - { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, - { json: "COUNTRY_ISOALPHA3", js: "COUNTRY_ISOALPHA3", typ: u(undefined, "") }, - { json: "ISOALPHA2", js: "ISOALPHA2", typ: u(undefined, "") }, - { json: "ISOALPHA3", js: "ISOALPHA3", typ: u(undefined, "") }, - ], "any"), - "Currency": o([ - { json: "id", js: "id", typ: r("CurrencyID") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("CurrencyType") }, - ], "any"), - "CurrencyID": o([ - { json: "CURRENCY_ISOCODE", js: "CURRENCY_ISOCODE", typ: u(undefined, "") }, - ], "any"), - "Email": o([ - { json: "recipients", js: "recipients", typ: r("EmailRecipients") }, - { json: "subject", js: "subject", typ: u(undefined, "") }, - { json: "textBody", js: "textBody", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("EmailType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "EmailRecipients": o([ - { json: "id", js: "id", typ: u(undefined, r("EmailRecipientsID")) }, - { json: "type", js: "type", typ: r("EmailRecipientsType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "contacts", js: "contacts", typ: u(undefined, a(r("ContactElement"))) }, - ], "any"), - "EmailRecipientsID": o([ - { json: "email", js: "email", typ: u(undefined, "") }, - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - ], "any"), - "Instrument": o([ - { json: "id", js: "id", typ: r("FluffyInstrumentIdentifiers") }, - { json: "market", js: "market", typ: u(undefined, r("PurpleMarket")) }, - { json: "type", js: "type", typ: r("PurpleInteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "FluffyInstrumentIdentifiers": o([ - { json: "BBG", js: "BBG", typ: u(undefined, "") }, - { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, - { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, - { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, - { json: "RIC", js: "RIC", typ: u(undefined, "") }, - { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, - { json: "ticker", js: "ticker", typ: u(undefined, "") }, - ], "any"), - "PurpleMarket": o([ - { json: "BBG", js: "BBG", typ: u(undefined, "") }, - { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, - { json: "MIC", js: "MIC", typ: u(undefined, "") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "InstrumentList": o([ - { json: "instruments", js: "instruments", typ: a(r("InstrumentElement")) }, - { json: "type", js: "type", typ: r("InstrumentListType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Interaction": o([ - { json: "description", js: "description", typ: "" }, - { json: "id", js: "id", typ: u(undefined, r("InteractionID")) }, - { json: "initiator", js: "initiator", typ: u(undefined, r("ContactElement")) }, - { json: "interactionType", js: "interactionType", typ: "" }, - { json: "origin", js: "origin", typ: u(undefined, "") }, - { json: "participants", js: "participants", typ: r("ContactListObject") }, - { json: "timeRange", js: "timeRange", typ: r("TimeRangeObject") }, - { json: "type", js: "type", typ: r("InteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "InteractionID": o([ - { json: "SALESFORCE", js: "SALESFORCE", typ: u(undefined, "") }, - { json: "SINGLETRACK", js: "SINGLETRACK", typ: u(undefined, "") }, - { json: "URI", js: "URI", typ: u(undefined, "") }, - ], "any"), - "Message": o([ - { json: "entities", js: "entities", typ: u(undefined, m(r("FluffyAction"))) }, - { json: "text", js: "text", typ: u(undefined, r("FluffyMessageText")) }, - { json: "type", js: "type", typ: r("MessageType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "FluffyAction": o([ - { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, - { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, - { json: "intent", js: "intent", typ: u(undefined, "") }, - { json: "title", js: "title", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("EntityType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "data", js: "data", typ: u(undefined, r("FluffyData")) }, - ], "any"), - "FluffyData": o([ - { json: "dataUri", js: "dataUri", typ: "" }, - { json: "name", js: "name", typ: "" }, - ], "any"), - "FluffyMessageText": o([ - { json: "text/markdown", js: "text/markdown", typ: u(undefined, "") }, - { json: "text/plain", js: "text/plain", typ: u(undefined, "") }, - ], "any"), - "Nothing": o([ - { json: "type", js: "type", typ: r("NothingType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Order": o([ - { json: "details", js: "details", typ: u(undefined, r("PurpleOrderDetails")) }, - { json: "id", js: "id", typ: m("") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("OrderType") }, - ], "any"), - "PurpleOrderDetails": o([ - { json: "product", js: "product", typ: u(undefined, r("ProductObject")) }, - ], "any"), - "ProductObject": o([ - { json: "id", js: "id", typ: m("") }, - { json: "instrument", js: "instrument", typ: u(undefined, r("InstrumentElement")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("ProductType") }, - ], "any"), - "OrderList": o([ - { json: "orders", js: "orders", typ: a(r("OrderElement")) }, - { json: "type", js: "type", typ: r("OrderListType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "OrderElement": o([ - { json: "details", js: "details", typ: u(undefined, r("FluffyOrderDetails")) }, - { json: "id", js: "id", typ: m("") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("OrderType") }, - ], "any"), - "FluffyOrderDetails": o([ - { json: "product", js: "product", typ: u(undefined, r("ProductObject")) }, - ], "any"), - "Organization": o([ - { json: "id", js: "id", typ: r("OrganizationIdentifiers") }, - { json: "type", js: "type", typ: r("StickyInteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "OrganizationIdentifiers": o([ - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - { json: "LEI", js: "LEI", typ: u(undefined, "") }, - { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, - ], "any"), - "Portfolio": o([ - { json: "positions", js: "positions", typ: a(r("PositionElement")) }, - { json: "type", js: "type", typ: r("PortfolioType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "PositionElement": o([ - { json: "holding", js: "holding", typ: 3.14 }, - { json: "instrument", js: "instrument", typ: r("InstrumentElement") }, - { json: "type", js: "type", typ: r("PositionType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Position": o([ - { json: "holding", js: "holding", typ: 3.14 }, - { json: "instrument", js: "instrument", typ: r("InstrumentElement") }, - { json: "type", js: "type", typ: r("PositionType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Product": o([ - { json: "id", js: "id", typ: m("") }, - { json: "instrument", js: "instrument", typ: u(undefined, r("InstrumentElement")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("ProductType") }, - ], "any"), - "TimeRange": o([ - { json: "endTime", js: "endTime", typ: u(undefined, Date) }, - { json: "startTime", js: "startTime", typ: u(undefined, Date) }, - { json: "type", js: "type", typ: r("TimeRangeType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Trade": o([ - { json: "id", js: "id", typ: m("") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "product", js: "product", typ: r("ProductObject") }, - { json: "type", js: "type", typ: r("TradeType") }, - ], "any"), - "TradeList": o([ - { json: "trades", js: "trades", typ: a(r("TradeElement")) }, - { json: "type", js: "type", typ: r("TradeListType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "TradeElement": o([ - { json: "id", js: "id", typ: m("") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "product", js: "product", typ: r("ProductObject") }, - { json: "type", js: "type", typ: r("TradeType") }, - ], "any"), - "TransactionResult": o([ - { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, - { json: "message", js: "message", typ: u(undefined, "") }, - { json: "status", js: "status", typ: r("TransactionStatus") }, - { json: "type", js: "type", typ: r("TransactionResultType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Valuation": o([ - { json: "CURRENCY_ISOCODE", js: "CURRENCY_ISOCODE", typ: "" }, - { json: "expiryTime", js: "expiryTime", typ: u(undefined, Date) }, - { json: "price", js: "price", typ: u(undefined, 3.14) }, - { json: "type", js: "type", typ: r("ValuationType") }, - { json: "valuationTime", js: "valuationTime", typ: u(undefined, Date) }, - { json: "value", js: "value", typ: 3.14 }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "ActionType": [ - "fdc3.action", - ], - "PurpleInteractionType": [ - "fdc3.instrument", - ], - "TimeRangeType": [ - "fdc3.timeRange", - ], - "ChartStyle": [ - "bar", - "candle", - "custom", - "heatmap", - "histogram", - "line", - "mountain", - "pie", - "scatter", - "stacked-bar", - ], - "ChartType": [ - "fdc3.chart", - ], - "FluffyInteractionType": [ - "fdc3.contact", - ], - "ContactListType": [ - "fdc3.contactList", - ], - "EntityType": [ - "fdc3.action", - "fdc3.entity.fileAttachment", - ], - "MessageType": [ - "fdc3.message", - ], - "ChatInitSettingsType": [ - "fdc3.chat.initSettings", - ], - "ChatRoomType": [ - "fdc3.chat.room", - ], - "ChatMessageType": [ - "fdc3.chat.message", - ], - "TentacledInteractionType": [ - "fdc3.contact", - "fdc3.instrument", - "fdc3.organization", - ], - "ChatSearchCriteriaType": [ - "fdc3.chat.searchCriteria", - ], - "CountryType": [ - "fdc3.country", - ], - "CurrencyType": [ - "fdc3.currency", - ], - "EmailRecipientsType": [ - "fdc3.contact", - "fdc3.contactList", - ], - "EmailType": [ - "fdc3.email", - ], - "InstrumentListType": [ - "fdc3.instrumentList", - ], - "InteractionType": [ - "fdc3.interaction", - ], - "NothingType": [ - "fdc3.nothing", - ], - "ProductType": [ - "fdc3.product", - ], - "OrderType": [ - "fdc3.order", - ], - "OrderListType": [ - "fdc3.orderList", - ], - "StickyInteractionType": [ - "fdc3.organization", - ], - "PositionType": [ - "fdc3.position", - ], - "PortfolioType": [ - "fdc3.portfolio", - ], - "TradeType": [ - "fdc3.trade", - ], - "TradeListType": [ - "fdc3.tradeList", - ], - "TransactionStatus": [ - "Created", - "Deleted", - "Failed", - "Updated", - ], - "TransactionResultType": [ - "fdc3.transactionResult", - ], - "ValuationType": [ - "fdc3.valuation", - ], -}; diff --git a/packages/fdc3-context/package.json b/packages/fdc3-context/package.json index fc7e27f50..f7c1791eb 100644 --- a/packages/fdc3-context/package.json +++ b/packages/fdc3-context/package.json @@ -18,7 +18,7 @@ ], "scripts": { "clean": "rimraf dist && rimraf generated", - "mkdirs": "mkdirp generated/context && mkdirp generated/api && mkdirp generated/bridging", + "mkdirs": "mkdirp generated/context", "generate": "npm run mkdirs && npm run typegen && npm run lint", "build": "npm run generate && tsc --module es2022", "test": "npm run generate && tsc", diff --git a/packages/fdc3-schema/generated/api/BrowserTypes.ts b/packages/fdc3-schema/generated/api/BrowserTypes.ts deleted file mode 100644 index 70b633b13..000000000 --- a/packages/fdc3-schema/generated/api/BrowserTypes.ts +++ /dev/null @@ -1,5682 +0,0 @@ -// To parse this data: -// -// import { Convert, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake, WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentityFailedResponse, WebConnectionProtocol5ValidateAppIdentitySuccessResponse, WebConnectionProtocol6Goodbye, WebConnectionProtocolMessage, AddContextListenerRequest, AddContextListenerResponse, AddEventListenerEvent, AddEventListenerRequest, AddEventListenerResponse, AddIntentListenerRequest, AddIntentListenerResponse, AgentEventMessage, AgentResponseMessage, AppRequestMessage, BroadcastEvent, BroadcastRequest, BroadcastResponse, ChannelChangedEvent, ContextListenerUnsubscribeRequest, ContextListenerUnsubscribeResponse, CreatePrivateChannelRequest, CreatePrivateChannelResponse, EventListenerUnsubscribeRequest, EventListenerUnsubscribeResponse, FindInstancesRequest, FindInstancesResponse, FindIntentRequest, FindIntentResponse, FindIntentsByContextRequest, FindIntentsByContextResponse, GetAppMetadataRequest, GetAppMetadataResponse, GetCurrentChannelRequest, GetCurrentChannelResponse, GetCurrentContextRequest, GetCurrentContextResponse, GetInfoRequest, GetInfoResponse, GetOrCreateChannelRequest, GetOrCreateChannelResponse, GetUserChannelsRequest, GetUserChannelsResponse, IframeChannelDrag, IframeChannelResize, IframeChannelSelected, IframeChannels, IframeHandshake, IframeHello, IframeMessage, IframeResolve, IframeResolveAction, IntentEvent, IntentListenerUnsubscribeRequest, IntentListenerUnsubscribeResponse, IntentResultRequest, IntentResultResponse, JoinUserChannelRequest, JoinUserChannelResponse, LeaveCurrentChannelRequest, LeaveCurrentChannelResponse, OpenRequest, OpenResponse, PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse, PrivateChannelOnAddContextListenerEvent, PrivateChannelOnDisconnectEvent, PrivateChannelOnUnsubscribeEvent, PrivateChannelUnsubscribeEventListenerRequest, PrivateChannelUnsubscribeEventListenerResponse, PrivateChannelAddEventListenerRequest, PrivateChannelAddEventListenerResponse, RaiseIntentForContextRequest, RaiseIntentForContextResponse, RaiseIntentRequest, RaiseIntentResponse, RaiseIntentResultResponse } from "./file"; -// -// const webConnectionProtocol1Hello = Convert.toWebConnectionProtocol1Hello(json); -// const webConnectionProtocol2LoadURL = Convert.toWebConnectionProtocol2LoadURL(json); -// const webConnectionProtocol3Handshake = Convert.toWebConnectionProtocol3Handshake(json); -// const webConnectionProtocol4ValidateAppIdentity = Convert.toWebConnectionProtocol4ValidateAppIdentity(json); -// const webConnectionProtocol5ValidateAppIdentityFailedResponse = Convert.toWebConnectionProtocol5ValidateAppIdentityFailedResponse(json); -// const webConnectionProtocol5ValidateAppIdentitySuccessResponse = Convert.toWebConnectionProtocol5ValidateAppIdentitySuccessResponse(json); -// const webConnectionProtocol6Goodbye = Convert.toWebConnectionProtocol6Goodbye(json); -// const webConnectionProtocolMessage = Convert.toWebConnectionProtocolMessage(json); -// const addContextListenerRequest = Convert.toAddContextListenerRequest(json); -// const addContextListenerResponse = Convert.toAddContextListenerResponse(json); -// const addEventListenerEvent = Convert.toAddEventListenerEvent(json); -// const addEventListenerRequest = Convert.toAddEventListenerRequest(json); -// const addEventListenerResponse = Convert.toAddEventListenerResponse(json); -// const addIntentListenerRequest = Convert.toAddIntentListenerRequest(json); -// const addIntentListenerResponse = Convert.toAddIntentListenerResponse(json); -// const agentEventMessage = Convert.toAgentEventMessage(json); -// const agentResponseMessage = Convert.toAgentResponseMessage(json); -// const appRequestMessage = Convert.toAppRequestMessage(json); -// const broadcastEvent = Convert.toBroadcastEvent(json); -// const broadcastRequest = Convert.toBroadcastRequest(json); -// const broadcastResponse = Convert.toBroadcastResponse(json); -// const channelChangedEvent = Convert.toChannelChangedEvent(json); -// const contextListenerUnsubscribeRequest = Convert.toContextListenerUnsubscribeRequest(json); -// const contextListenerUnsubscribeResponse = Convert.toContextListenerUnsubscribeResponse(json); -// const createPrivateChannelRequest = Convert.toCreatePrivateChannelRequest(json); -// const createPrivateChannelResponse = Convert.toCreatePrivateChannelResponse(json); -// const eventListenerUnsubscribeRequest = Convert.toEventListenerUnsubscribeRequest(json); -// const eventListenerUnsubscribeResponse = Convert.toEventListenerUnsubscribeResponse(json); -// const findInstancesRequest = Convert.toFindInstancesRequest(json); -// const findInstancesResponse = Convert.toFindInstancesResponse(json); -// const findIntentRequest = Convert.toFindIntentRequest(json); -// const findIntentResponse = Convert.toFindIntentResponse(json); -// const findIntentsByContextRequest = Convert.toFindIntentsByContextRequest(json); -// const findIntentsByContextResponse = Convert.toFindIntentsByContextResponse(json); -// const getAppMetadataRequest = Convert.toGetAppMetadataRequest(json); -// const getAppMetadataResponse = Convert.toGetAppMetadataResponse(json); -// const getCurrentChannelRequest = Convert.toGetCurrentChannelRequest(json); -// const getCurrentChannelResponse = Convert.toGetCurrentChannelResponse(json); -// const getCurrentContextRequest = Convert.toGetCurrentContextRequest(json); -// const getCurrentContextResponse = Convert.toGetCurrentContextResponse(json); -// const getInfoRequest = Convert.toGetInfoRequest(json); -// const getInfoResponse = Convert.toGetInfoResponse(json); -// const getOrCreateChannelRequest = Convert.toGetOrCreateChannelRequest(json); -// const getOrCreateChannelResponse = Convert.toGetOrCreateChannelResponse(json); -// const getUserChannelsRequest = Convert.toGetUserChannelsRequest(json); -// const getUserChannelsResponse = Convert.toGetUserChannelsResponse(json); -// const iframeChannelDrag = Convert.toIframeChannelDrag(json); -// const iframeChannelResize = Convert.toIframeChannelResize(json); -// const iframeChannelSelected = Convert.toIframeChannelSelected(json); -// const iframeChannels = Convert.toIframeChannels(json); -// const iframeHandshake = Convert.toIframeHandshake(json); -// const iframeHello = Convert.toIframeHello(json); -// const iframeMessage = Convert.toIframeMessage(json); -// const iframeResolve = Convert.toIframeResolve(json); -// const iframeResolveAction = Convert.toIframeResolveAction(json); -// const intentEvent = Convert.toIntentEvent(json); -// const intentListenerUnsubscribeRequest = Convert.toIntentListenerUnsubscribeRequest(json); -// const intentListenerUnsubscribeResponse = Convert.toIntentListenerUnsubscribeResponse(json); -// const intentResultRequest = Convert.toIntentResultRequest(json); -// const intentResultResponse = Convert.toIntentResultResponse(json); -// const joinUserChannelRequest = Convert.toJoinUserChannelRequest(json); -// const joinUserChannelResponse = Convert.toJoinUserChannelResponse(json); -// const leaveCurrentChannelRequest = Convert.toLeaveCurrentChannelRequest(json); -// const leaveCurrentChannelResponse = Convert.toLeaveCurrentChannelResponse(json); -// const openRequest = Convert.toOpenRequest(json); -// const openResponse = Convert.toOpenResponse(json); -// const privateChannelDisconnectRequest = Convert.toPrivateChannelDisconnectRequest(json); -// const privateChannelDisconnectResponse = Convert.toPrivateChannelDisconnectResponse(json); -// const privateChannelOnAddContextListenerEvent = Convert.toPrivateChannelOnAddContextListenerEvent(json); -// const privateChannelOnDisconnectEvent = Convert.toPrivateChannelOnDisconnectEvent(json); -// const privateChannelOnUnsubscribeEvent = Convert.toPrivateChannelOnUnsubscribeEvent(json); -// const privateChannelUnsubscribeEventListenerRequest = Convert.toPrivateChannelUnsubscribeEventListenerRequest(json); -// const privateChannelUnsubscribeEventListenerResponse = Convert.toPrivateChannelUnsubscribeEventListenerResponse(json); -// const privateChannelAddEventListenerRequest = Convert.toPrivateChannelAddEventListenerRequest(json); -// const privateChannelAddEventListenerResponse = Convert.toPrivateChannelAddEventListenerResponse(json); -// const raiseIntentForContextRequest = Convert.toRaiseIntentForContextRequest(json); -// const raiseIntentForContextResponse = Convert.toRaiseIntentForContextResponse(json); -// const raiseIntentRequest = Convert.toRaiseIntentRequest(json); -// const raiseIntentResponse = Convert.toRaiseIntentResponse(json); -// const raiseIntentResultResponse = Convert.toRaiseIntentResultResponse(json); -// -// These functions will throw an error if the JSON doesn't -// match the expected interface, even if the JSON is valid. - -/** - * Hello message sent by an application to a parent window or frame when attempting to - * establish connectivity to a Desktop Agent - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol1Hello { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: WebConnectionProtocol1HelloPayload; - /** - * Identifies the type of the connection step message. - */ - type: "WCP1Hello"; -} - -/** - * Metadata for this connection step message - */ -export interface ConnectionStepMetadata { - connectionAttemptUuid: string; - timestamp: Date; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface WebConnectionProtocol1HelloPayload { - /** - * A flag that may be used to indicate that a channel selector UI is or is not required. If - * the app includes its own UI for displaying - */ - channelSelector?: boolean; - /** - * The version of FDC3 API that the app supports. - */ - fdc3Version: string; - /** - * URL to use for the identity of the application. Desktop Agents MUST validate that the - * origin of the message matches the URL, but MAY implement custom comparison logic. - */ - identityUrl: string; - /** - * A flag that may be used to indicate that an intent resolver is or is not required. Set to - * false if no intents, or only targeted intents, are raised - */ - resolver?: boolean; - [property: string]: any; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Response from a Desktop Agent to an application requesting access to it indicating that - * it should load a specified URL into a hidden iframe in order to establish connectivity to - * a Desktop Agent - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol2LoadURL { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: WebConnectionProtocol2LoadURLPayload; - /** - * Identifies the type of the connection step message. - */ - type: "WCP2LoadUrl"; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface WebConnectionProtocol2LoadURLPayload { - /** - * A URL which can be used to establish communication with the Desktop Agent, via loading - * the URL into an iframe and restarting the Web Connection protocol with the iframe as the - * target - */ - iframeUrl: string; - [property: string]: any; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Handshake message sent by the Desktop Agent to the app (with a MessagePort appended) that - * should be used for subsequent communication steps. - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol3Handshake { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: WebConnectionProtocol3HandshakePayload; - /** - * Identifies the type of the connection step message. - */ - type: "WCP3Handshake"; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface WebConnectionProtocol3HandshakePayload { - /** - * Indicates whether a channel selector UI is required and the URL to use to do so. Set to - * `true` to use the default or `false` to disable the channel selector (as the Desktop - * Agent will handle another way) - */ - channelSelector: boolean | string; - /** - * The version of FDC3 API that the Desktop Agent will provide support for. - */ - fdc3Version: string; - /** - * Indicates whether an intent resolver UI is required and the URL to use to do so. Set to - * `true` to use the default or `false` to disable the intent resolver (as the Desktop Agent - * will handle another way) - */ - resolver: boolean | string; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Identity Validation request from an app attempting to connect to a Desktop Agent. - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol4ValidateAppIdentity { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: WebConnectionProtocol4ValidateAppIdentityPayload; - /** - * Identifies the type of the connection step message. - */ - type: "WCP4ValidateAppIdentity"; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface WebConnectionProtocol4ValidateAppIdentityPayload { - /** - * URL to use for the identity of the application. Desktop Agents MUST validate that the - * origin of the message matches the URL, but MAY implement custom comparison logic. - */ - identityUrl: string; - /** - * If an application has previously connected to the desktop agent, it may specify its prior - * instance id and associated instance UUID to request the same same instance Id be assigned. - */ - instanceId?: string; - /** - * Instance UUID associated with the requested instanceId. - */ - instanceUuid?: string; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Message sent by the Desktop Agent to an app if their identity validation fails. - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol5ValidateAppIdentityFailedResponse { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload; - /** - * Identifies the type of the connection step message. - */ - type: "WCP5ValidateAppIdentityFailedResponse"; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload { - message?: string; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Message sent by the Desktop Agent to an app after successful identity validation - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol5ValidateAppIdentitySuccessResponse { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload; - /** - * Identifies the type of the connection step message. - */ - type: "WCP5ValidateAppIdentityResponse"; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload { - /** - * The appId that the app's identity was validated against - */ - appId: string; - /** - * Implementation metadata for the Desktop Agent, which includes an appMetadata element - * containing a copy of the app's own metadata - */ - implementationMetadata: ImplementationMetadata; - /** - * The instance Id granted to the application by the Desktop Agent. - */ - instanceId: string; - /** - * Instance UUID associated with the instanceId granted, which may be used to retrieve the - * same instance Id if the app is reloaded or navigates. - */ - instanceUuid: string; -} - -/** - * Implementation metadata for the Desktop Agent, which includes an appMetadata element - * containing a copy of the app's own metadata - * - * Includes Metadata for the current application. - * - * Metadata relating to the FDC3 Desktop Agent implementation and its provider. - */ -export interface ImplementationMetadata { - /** - * The calling application instance's own metadata, according to the Desktop Agent (MUST - * include at least the `appId` and `instanceId`). - */ - appMetadata: AppMetadata; - /** - * The version number of the FDC3 specification that the implementation provides. - * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. - */ - fdc3Version: string; - /** - * Metadata indicating whether the Desktop Agent implements optional features of - * the Desktop Agent API. - */ - optionalFeatures: OptionalFeatures; - /** - * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, - * OpenFin etc.). - */ - provider: string; - /** - * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). - */ - providerVersion?: string; -} - -/** - * The calling application instance's own metadata, according to the Desktop Agent (MUST - * include at least the `appId` and `instanceId`). - * - * Extends an `AppIdentifier`, describing an application or instance of an application, with - * additional descriptive metadata that is usually provided by an FDC3 App Directory that - * the desktop agent connects to. - * - * The additional information from an app directory can aid in rendering UI elements, such - * as a launcher menu or resolver UI. This includes a title, description, tooltip and icon - * and screenshot URLs. - * - * Note that as `AppMetadata` instances are also `AppIdentifiers` they may be passed to the - * `app` argument of `fdc3.open`, `fdc3.raiseIntent` etc. - */ -export interface AppMetadata { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * A longer, multi-paragraph description for the application that could include markup - */ - description?: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent?: string; - /** - * A list of icon URLs for the application that can be used to render UI elements - */ - icons?: Icon[]; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - /** - * An optional set of, implementation specific, metadata fields that can be used to - * disambiguate instances, such as a window title or screen position. Must only be set if - * `instanceId` is set. - */ - instanceMetadata?: { [key: string]: any }; - /** - * The 'friendly' app name. - * This field was used with the `open` and `raiseIntent` calls in FDC3 <2.0, which now - * require an `AppIdentifier` wth `appId` set. - * Note that for display purposes the `title` field should be used, if set, in preference to - * this field. - */ - name?: string; - /** - * The type of output returned for any intent specified during resolution. May express a - * particular context type (e.g. "fdc3.instrument"), channel (e.g. "channel") or a channel - * that will receive a specified type (e.g. "channel"). - */ - resultType?: null | string; - /** - * Images representing the app in common usage scenarios that can be used to render UI - * elements - */ - screenshots?: Image[]; - /** - * A more user-friendly application title that can be used to render UI elements - */ - title?: string; - /** - * A tooltip for the application that can be used to render UI elements - */ - tooltip?: string; - /** - * The Version of the application. - */ - version?: string; -} - -/** - * SPDX-License-Identifier: Apache-2.0 - * Copyright FINOS FDC3 contributors - see NOTICE file - */ -export interface Icon { - /** - * The icon dimension, formatted as `x`. - */ - size?: string; - /** - * The icon url - */ - src: string; - /** - * Icon media type. If not present the Desktop Agent may use the src file extension. - */ - type?: string; -} - -/** - * SPDX-License-Identifier: Apache-2.0 - * Copyright FINOS FDC3 contributors - see NOTICE file - */ -export interface Image { - /** - * Caption for the image. - */ - label?: string; - /** - * The image dimension, formatted as `x`. - */ - size?: string; - /** - * The image url. - */ - src: string; - /** - * Image media type. If not present the Desktop Agent may use the src file extension. - */ - type?: string; -} - -/** - * Metadata indicating whether the Desktop Agent implements optional features of - * the Desktop Agent API. - */ -export interface OptionalFeatures { - /** - * Used to indicate whether the experimental Desktop Agent Bridging - * feature is implemented by the Desktop Agent. - */ - DesktopAgentBridging: boolean; - /** - * Used to indicate whether the exposure of 'originating app metadata' for - * context and intent messages is supported by the Desktop Agent. - */ - OriginatingAppMetadata: boolean; - /** - * Used to indicate whether the optional `fdc3.joinUserChannel`, - * `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by - * the Desktop Agent. - */ - UserChannelMembershipAPIs: boolean; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Goodbye message to be sent to the Desktop Agent when disconnecting (e.g. when closing the - * window or navigating). Desktop Agents should close the MessagePort after receiving this - * message, but retain instance details in case the application reconnects (e.g. after a - * navigation event). - * - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocol6Goodbye { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the connection step message. - */ - type: "WCP6Goodbye"; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * A message used during the connection flow for an application to a Desktop Agent in a - * browser window. Used for messages sent in either direction. - */ -export interface WebConnectionProtocolMessage { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the connection step message. - */ - type: ConnectionStepMessageType; -} - -/** - * Identifies the type of the connection step message. - */ -export type ConnectionStepMessageType = "WCP1Hello" | "WCP2LoadUrl" | "WCP3Handshake" | "WCP4ValidateAppIdentity" | "WCP5ValidateAppIdentityFailedResponse" | "WCP5ValidateAppIdentityResponse" | "WCP6Goodbye"; - -/** - * A request to add a context listener to a specified Channel OR to the current user - * channel. Where the listener is added to the current user channel (channelId == null), and - * this app has already been added to a user channel, client code should make a subsequent - * request to get the current context of that channel for this listener and then call its - * handler with it. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface AddContextListenerRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: AddContextListenerRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "addContextListenerRequest"; -} - -/** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ -export interface AddContextListenerRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that a request or response was received - * from. Please note that this may be set by an app or Desktop Agent proxy for debugging - * purposes but a Desktop Agent should make its own determination of the source of a message - * to avoid spoofing. - */ - source?: AppIdentifier; - timestamp: Date; -} - -/** - * Field that represents the source application that a request or response was received - * from. Please note that this may be set by an app or Desktop Agent proxy for debugging - * purposes but a Desktop Agent should make its own determination of the source of a message - * to avoid spoofing. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that the request being responded to was - * received from, for debugging purposes. - * - * Details of the application instance that broadcast the context - * - * The App resolution option chosen - * - * Details of the application instance that raised the intent - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface AppIdentifier { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface AddContextListenerRequestPayload { - /** - * The id of the channel to add the listener to or `null` indicating that it should listen - * to the current user channel (at the time of broadcast). - */ - channelId: null | string; - /** - * The type of context to listen for OR `null` indicating that it should listen to all - * context types. - */ - contextType: null | string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a addContextListener request. Where the listener was added to the current - * user channel (channelId == null), and this app has already been added to a user channel, - * client code should make a subsequent request to get the current context of that channel - * for this listener and then call its handler with it. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface AddContextListenerResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: AddContextListenerResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "addContextListenerResponse"; -} - -/** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ -export interface AddContextListenerResponseMeta { - requestUuid: string; - responseUuid: string; - /** - * Field that represents the source application that the request being responded to was - * received from, for debugging purposes. - */ - source?: AppIdentifier; - timestamp: Date; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface AddContextListenerResponsePayload { - error?: PurpleError; - listenerUUID?: string; -} - -/** - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type PurpleError = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * An event message from the Desktop Agent to an app for a specified event type. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface AddEventListenerEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: AddEventListenerEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "addEventListenerEvent"; -} - -/** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ -export interface AddEventListenerEventMeta { - eventUuid: string; - timestamp: Date; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface AddEventListenerEventPayload { - event: FDC3Event; -} - -/** - * An event object received via the FDC3 API's addEventListener function. Will always - * include both type and details, which describe type of the event and any additional - * details respectively. - */ -export interface FDC3Event { - /** - * Additional details of the event, such as the `currentChannelId` for a CHANNEL_CHANGED - * event - */ - details: { [key: string]: any }; - type: "USER_CHANNEL_CHANGED"; -} - -/** - * The type of a (non-context and non-intent) event that may be received via the FDC3 API's - * addEventListener function. - * - * The type of the event to be listened to. - */ - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to add an event listener for a specified event type to the DesktopAgent. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface AddEventListenerRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: AddEventListenerRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "addEventListenerRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface AddEventListenerRequestPayload { - /** - * The type of the event to be listened to. - */ - type: "USER_CHANNEL_CHANGED"; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to an addEventListener request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface AddEventListenerResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: AddEventListenerResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "addEventListenerResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface AddEventListenerResponsePayload { - error?: ResponsePayloadError; - listenerUUID?: string; -} - -/** - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type ResponsePayloadError = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to add an Intent listener for a specified intent type. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface AddIntentListenerRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: AddIntentListenerRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "addIntentListenerRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface AddIntentListenerRequestPayload { - /** - * The name of the intent to listen for. - */ - intent: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a addIntentListener request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface AddIntentListenerResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: AddIntentListenerResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "addIntentListenerResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface AddIntentListenerResponsePayload { - error?: FluffyError; - listenerUUID?: string; - [property: string]: any; -} - -/** - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type FluffyError = "MalformedContext" | "DesktopAgentNotFound" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface AgentEventMessage { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AgentEventMessageMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: EventMessageType; -} - -/** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ -export interface AgentEventMessageMeta { - eventUuid: string; - timestamp: Date; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ -export type EventMessageType = "intentEvent" | "broadcastEvent" | "channelChangedEvent" | "privateChannelOnAddContextListenerEvent" | "privateChannelOnDisconnectEvent" | "privateChannelOnUnsubscribeEvent" | "addEventListenerEvent"; - -/** - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface AgentResponseMessage { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AgentResponseMessageMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: AgentResponseMessageResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: ResponseMessageType; -} - -/** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ -export interface AgentResponseMessageMeta { - requestUuid: string; - responseUuid: string; - /** - * Field that represents the source application that the request being responded to was - * received from, for debugging purposes. - */ - source?: AppIdentifier; - timestamp: Date; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface AgentResponseMessageResponsePayload { - error?: ResponsePayloadError; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ -export type ResponseMessageType = "addContextListenerResponse" | "addEventListenerResponse" | "addIntentListenerResponse" | "broadcastResponse" | "contextListenerUnsubscribeResponse" | "createPrivateChannelResponse" | "eventListenerUnsubscribeResponse" | "findInstancesResponse" | "findIntentResponse" | "findIntentsByContextResponse" | "getAppMetadataResponse" | "getCurrentChannelResponse" | "getCurrentContextResponse" | "getInfoResponse" | "getOrCreateChannelResponse" | "getUserChannelsResponse" | "intentListenerUnsubscribeResponse" | "intentResultResponse" | "joinUserChannelResponse" | "leaveCurrentChannelResponse" | "openResponse" | "privateChannelAddEventListenerResponse" | "privateChannelDisconnectResponse" | "privateChannelUnsubscribeEventListenerResponse" | "raiseIntentForContextResponse" | "raiseIntentResponse" | "raiseIntentResultResponse"; - -/** - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface AppRequestMessage { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AppRequestMessageMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: RequestMessageType; -} - -/** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ -export interface AppRequestMessageMeta { - requestUuid: string; - /** - * Field that represents the source application that a request or response was received - * from. Please note that this may be set by an app or Desktop Agent proxy for debugging - * purposes but a Desktop Agent should make its own determination of the source of a message - * to avoid spoofing. - */ - source?: AppIdentifier; - timestamp: Date; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ -export type RequestMessageType = "addContextListenerRequest" | "addEventListenerRequest" | "addIntentListenerRequest" | "broadcastRequest" | "contextListenerUnsubscribeRequest" | "createPrivateChannelRequest" | "eventListenerUnsubscribeRequest" | "findInstancesRequest" | "findIntentRequest" | "findIntentsByContextRequest" | "getAppMetadataRequest" | "getCurrentChannelRequest" | "getCurrentContextRequest" | "getInfoRequest" | "getOrCreateChannelRequest" | "getUserChannelsRequest" | "intentListenerUnsubscribeRequest" | "intentResultRequest" | "joinUserChannelRequest" | "leaveCurrentChannelRequest" | "openRequest" | "privateChannelAddEventListenerRequest" | "privateChannelDisconnectRequest" | "privateChannelUnsubscribeEventListenerRequest" | "raiseIntentForContextRequest" | "raiseIntentRequest"; - -/** - * An event message from the Desktop Agent to an app indicating that context has been - * broadcast on a channel it is listening to, or specifically to this app instance if it was - * launched via `fdc3.open` and context was passed. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface BroadcastEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: BroadcastEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "broadcastEvent"; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface BroadcastEventPayload { - /** - * The Id of the channel that the broadcast was sent on. May be `null` if the context is - * being broadcast due to a call `fdc3.open` that passed context. - */ - channelId: null | string; - /** - * The context object that was broadcast. - */ - context: Context; - /** - * Details of the application instance that broadcast the context - */ - originatingApp?: AppIdentifier; -} - -/** - * The context object that was broadcast. - * - * The context object that is to be broadcast. - * - * The context object passed with the raised intent. - * - * If a Context object is passed in, this object will be provided to the opened application - * via a contextListener. The Context argument is functionally equivalent to opening the - * target app with no context and broadcasting the context directly to it. - * - * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by - * FDC3 operations. As such, it is not really meant to be used on its own, but is imported - * by more specific type definitions (standardized or custom) to provide the structure and - * properties shared by all FDC3 context data types. - * - * The key element of FDC3 context types is their mandatory `type` property, which is used - * to identify what type of data the object represents, and what shape it has. - * - * The FDC3 context type, and all derived types, define the minimum set of fields a context - * data object of a particular type can be expected to have, but this can always be extended - * with custom fields as appropriate. - */ -export interface Context { - /** - * Context data objects may include a set of equivalent key-value pairs that can be used to - * help applications identify and look up the context type they receive in their own domain. - * The idea behind this design is that applications can provide as many equivalent - * identifiers to a target application as possible, e.g. an instrument may be represented by - * an ISIN, CUSIP or Bloomberg identifier. - * - * Identifiers do not make sense for all types of data, so the `id` property is therefore - * optional, but some derived types may choose to require at least one identifier. - * Identifier values SHOULD always be of type string. - */ - id?: { [key: string]: any }; - /** - * Context data objects may include a name property that can be used for more information, - * or display purposes. Some derived types may require the name object as mandatory, - * depending on use case. - */ - name?: string; - /** - * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 - * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present - * to route shared context data appropriately. - * - * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data - * types they support in an FDC3 [App - * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery - * and routing. - * - * Standardized FDC3 context types have well-known `type` properties prefixed with the - * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and - * used by a particular organization, the convention is to prefix them with an - * organization-specific namespace, e.g. `blackrock.fund`. - * - * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more - * information about context data types. - */ - type: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to broadcast context on a channel. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface BroadcastRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: BroadcastRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "broadcastRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface BroadcastRequestPayload { - /** - * The Id of the Channel that the broadcast was sent on - */ - channelId: string; - /** - * The context object that is to be broadcast. - */ - context: Context; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a request to broadcast context on a channel. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface BroadcastResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: BroadcastResponseResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "broadcastResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface BroadcastResponseResponsePayload { - error?: ResponsePayloadError; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * An event message from the Desktop Agent to an app indicating that its current user - * channel has changed. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface ChannelChangedEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: ChannelChangedEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "channelChangedEvent"; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface ChannelChangedEventPayload { - /** - * The Id of the channel that the app was added to or `null` if it was removed from a - * channel. - */ - newChannelId: null | string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to unsubscribe a context listener. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface ContextListenerUnsubscribeRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: ContextListenerUnsubscribeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "contextListenerUnsubscribeRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface ContextListenerUnsubscribeRequestPayload { - listenerUUID: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a contextListenerUnsubscribe request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface ContextListenerUnsubscribeResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: BroadcastResponseResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "contextListenerUnsubscribeResponse"; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request to return a Channel with an auto-generated identity that is intended for private - * communication between applications. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface CreatePrivateChannelRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: CreatePrivateChannelRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "createPrivateChannelRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface CreatePrivateChannelRequestPayload { -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a createPrivateChannel request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface CreatePrivateChannelResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: CreatePrivateChannelResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "createPrivateChannelResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface CreatePrivateChannelResponsePayload { - error?: PurpleError; - privateChannel?: Channel; -} - -/** - * Represents a context channel that applications can use to send and receive - * context data. - * - * Please note that There are differences in behavior when you interact with a - * User channel via the `DesktopAgent` interface and the `Channel` interface. - * Specifically, when 'joining' a User channel or adding a context listener - * when already joined to a channel via the `DesktopAgent` interface, existing - * context (matching the type of the context listener) on the channel is - * received by the context listener immediately. Whereas, when a context - * listener is added via the Channel interface, context is not received - * automatically, but may be retrieved manually via the `getCurrentContext()` - * function. - */ -export interface Channel { - /** - * Channels may be visualized and selectable by users. DisplayMetadata may be used to - * provide hints on how to see them. - * For App channels, displayMetadata would typically not be present. - */ - displayMetadata?: DisplayMetadata; - /** - * Constant that uniquely identifies this channel. - */ - id: string; - /** - * Uniquely defines each channel type. - * Can be "user", "app" or "private". - */ - type: Type; -} - -/** - * Channels may be visualized and selectable by users. DisplayMetadata may be used to - * provide hints on how to see them. - * For App channels, displayMetadata would typically not be present. - * - * A system channel will be global enough to have a presence across many apps. This gives us - * some hints - * to render them in a standard way. It is assumed it may have other properties too, but if - * it has these, - * this is their meaning. - */ -export interface DisplayMetadata { - /** - * The color that should be associated within this channel when displaying this channel in a - * UI, e.g: `0xFF0000`. - */ - color?: string; - /** - * A URL of an image that can be used to display this channel - */ - glyph?: string; - /** - * A user-readable name for this channel, e.g: `"Red"` - */ - name?: string; -} - -/** - * Uniquely defines each channel type. - * Can be "user", "app" or "private". - */ -export type Type = "app" | "private" | "user"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to unsubscribe an event listener. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface EventListenerUnsubscribeRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: EventListenerUnsubscribeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "eventListenerUnsubscribeRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface EventListenerUnsubscribeRequestPayload { - listenerUUID: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to an eventListenerUnsubscribe request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface EventListenerUnsubscribeResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: BroadcastResponseResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "eventListenerUnsubscribeResponse"; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request for details of instances of a particular app. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface FindInstancesRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindInstancesRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findInstancesRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindInstancesRequestPayload { - app: AppIdentifier; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a findInstances request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface FindInstancesResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: FindInstancesResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findInstancesResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - * - * The message payload contains a flag indicating whether the API call was successful, plus - * any return values for the FDC3 API function called, or indicating that the request - * resulted in an error and including a standardized error message. - */ -export interface FindInstancesResponsePayload { - error?: FindInstancesErrors; - appIdentifiers?: AppMetadata[]; -} - -/** - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - * - * Unique identifier for a for an attempt to connect to a Desktop Agent - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - * - * Unique identifier for a `listener` object returned by a Desktop Agent to an app in - * response to addContextListener, addIntentListener or one of the PrivateChannel event - * listeners and used to identify it in messages (e.g. when unsubscribing). - * - * Should be set if the raiseIntent request returned an error. - */ -export type FindInstancesErrors = "MalformedContext" | "DesktopAgentNotFound" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request for details of apps available to resolve a particular intent and context pair. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface FindIntentRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindIntentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findIntentRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindIntentRequestPayload { - context?: Context; - intent: string; - resultType?: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a findIntent request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface FindIntentResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: FindIntentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface FindIntentResponsePayload { - error?: FindInstancesErrors; - appIntent?: AppIntent; -} - -/** - * An interface that relates an intent to apps - * - * Used if a raiseIntent request requires additional resolution (e.g. by showing an intent - * resolver) before it can be handled. - */ -export interface AppIntent { - /** - * Details of applications that can resolve the intent. - */ - apps: AppMetadata[]; - /** - * Details of the intent whose relationship to resolving applications is being described. - */ - intent: IntentMetadata; -} - -/** - * Details of the intent whose relationship to resolving applications is being described. - * - * Intent descriptor - */ -export interface IntentMetadata { - /** - * Display name for the intent. - */ - displayName?: string; - /** - * The unique name of the intent that can be invoked by the raiseIntent call - */ - name: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request for details of intents and apps available to resolve them for a particular - * context. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface FindIntentsByContextRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindIntentsByContextRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findIntentsByContextRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindIntentsByContextRequestPayload { - context: Context; - resultType?: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a findIntentsByContext request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface FindIntentsByContextResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: FindIntentsByContextResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentsByContextResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface FindIntentsByContextResponsePayload { - error?: FindInstancesErrors; - appIntents?: AppIntent[]; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request for metadata about an app. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface GetAppMetadataRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetAppMetadataRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getAppMetadataRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetAppMetadataRequestPayload { - app: AppIdentifier; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a getAppMetadata request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface GetAppMetadataResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: GetAppMetadataResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getAppMetadataResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface GetAppMetadataResponsePayload { - error?: FindInstancesErrors; - appMetadata?: AppMetadata; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to return the Channel object for the current User channel membership. Returns - * `null` if the app is not joined to a channel. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface GetCurrentChannelRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetCurrentChannelRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getCurrentChannelRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetCurrentChannelRequestPayload { -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a getCurrentChannel request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface GetCurrentChannelResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: GetCurrentChannelResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getCurrentChannelResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface GetCurrentChannelResponsePayload { - error?: ResponsePayloadError; - channel?: Channel | null; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to return the current context (either of a specified type or most recent - * broadcast) of a specified Channel. Returns `null` if no context (of the requested type if - * one was specified) is available in the channel. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface GetCurrentContextRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetCurrentContextRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getCurrentContextRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetCurrentContextRequestPayload { - /** - * The id of the channel to return the current context of - */ - channelId: string; - /** - * The type of context to return for OR `null` indicating that the most recently broadcast - * context on the channel should be returned. - */ - contextType: null | string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a getCurrentContext request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface GetCurrentContextResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: GetCurrentContextResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getCurrentContextResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface GetCurrentContextResponsePayload { - error?: PurpleError; - /** - * The most recently broadcast context object (of the specified type, if one was specified), - * or `null` if none was available in the channel - */ - context?: null | Context; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request to retrieve information about the FDC3 Desktop Agent implementation and the - * metadata of the calling application according to the desktop agent. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface GetInfoRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetInfoRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getInfoRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetInfoRequestPayload { -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a getInfo request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface GetInfoResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: GetInfoResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getInfoResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface GetInfoResponsePayload { - error?: ResponsePayloadError; - implementationMetadata?: ImplementationMetadata; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request to return a Channel with an auto-generated identity that is intended for private - * communication between applications. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface GetOrCreateChannelRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetOrCreateChannelRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getOrCreateChannelRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetOrCreateChannelRequestPayload { - /** - * The id of the channel to return - */ - channelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a getOrCreateChannel request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface GetOrCreateChannelResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: GetOrCreateChannelResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getOrCreateChannelResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface GetOrCreateChannelResponsePayload { - error?: PurpleError; - channel?: Channel; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request to retrieve a list of the User Channels available for the app to join. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface GetUserChannelsRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetUserChannelsRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getUserChannelsRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetUserChannelsRequestPayload { -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a getUserChannels request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface GetUserChannelsResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: GetUserChannelsResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getUserChannelsResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface GetUserChannelsResponsePayload { - error?: PurpleError; - userChannels?: Channel[]; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Message from the channel selector UI to the DA proxy when the user drags the selector to - * a new location. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeChannelDrag { - /** - * The message payload - */ - payload: IframeChannelDragPayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeChannelDrag"; -} - -/** - * The message payload - */ -export interface IframeChannelDragPayload { - /** - * The offset to move the frame by - */ - mouse: MouseClass; -} - -/** - * The offset to move the frame by - */ -export interface MouseClass { - offsetX: number; - offsetY: number; -} - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * Message from the channel selector UI to the DA proxy when the user hits a toggle button - * that opens or closes the selector or otherwise resizes it. Includes the size that it - * should change to and the corner (if any) at which the change should be made. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeChannelResize { - /** - * The message payload - */ - payload: IframeChannelResizePayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeChannelResize"; -} - -/** - * The message payload - */ -export interface IframeChannelResizePayload { - /** - * The updated dimensions of the UI - */ - dimensions: DimensionsClass; - /** - * When resizing anchor at the indicated location, - * e.g. - * - for top-left and a larger size: the bottom right corner should move down and out. - * - for top and smaller size: both the bottom corners should move in and up. - */ - resizeAnchor: Resizing; -} - -/** - * The updated dimensions of the UI - */ -export interface DimensionsClass { - height: number; - width: number; -} - -/** - * When resizing anchor at the indicated location, - * e.g. - * - for top-left and a larger size: the bottom right corner should move down and out. - * - for top and smaller size: both the bottom corners should move in and up. - */ -export type Resizing = "top-left" | "top" | "top-right" | "right" | "bottom-right" | "bottom" | "bottom-left" | "left" | "center"; - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * Message from the channel selector UI to the DA proxy sent when the channel selection - * changes. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeChannelSelected { - /** - * The message payload - */ - payload: IframeChannelSelectedPayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeChannelSelected"; -} - -/** - * The message payload - */ -export interface IframeChannelSelectedPayload { - /** - * The id of the channel that should be currently selected, or `null` if none should be - * selected - */ - selected: null | string; -} - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * Setup message sent by the DA proxy code in getAgent() to a channel selector UI in an - * iframe with the channel definitions and current channel selection. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeChannels { - /** - * The message payload - */ - payload: IframeChannelsPayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeChannels"; -} - -/** - * The message payload - */ -export interface IframeChannelsPayload { - /** - * If the channel selector was previously displayed in this window its location may be - * restored by setting the location coordinates - */ - location?: Location; - /** - * The id of the channel that should be currently selected, or `null` if none should be - * selected - */ - selected: null | string; - /** - * User Channel definitions - */ - userChannels: Channel[]; -} - -/** - * If the channel selector was previously displayed in this window its location may be - * restored by setting the location coordinates - */ -export interface Location { - x: number; - y: number; -} - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * Handshake message sent back by an iframe to the DA proxy code indicating that it is setup - * and ready to communicate over the MessagePort. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeHandshake { - /** - * The message payload - */ - payload: IframeHandshakePayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeHandshake"; -} - -/** - * The message payload - */ -export interface IframeHandshakePayload { - /** - * Details about the UI implementation in the iframe, such as vendor and version, for - * logging purposes. - */ - implementationDetails: string; -} - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * Hello message sent by the DA proxy code in getAgent() to an iframe, that it has injected - * into the page, with a MessagePort appended that should be used for subsequent - * communication steps. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeHello { - /** - * The message payload - */ - payload: IframeHelloPayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeHello"; -} - -/** - * The message payload - */ -export interface IframeHelloPayload { - /** - * The version of FDC3 API that the Desktop Agent proxy is providing support for. - */ - fdc3Version: string; -} - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeMessage { - /** - * The message payload - */ - payload?: { [key: string]: any }; - /** - * Identifies the type of the message to or from the iframe. - */ - type: IframeMessageType; -} - -/** - * Identifies the type of the message to or from the iframe. - */ -export type IframeMessageType = "iframeHello" | "iframeHandshake" | "iframeResolve" | "iframeResolveAction" | "iframeChannels" | "iframeChannelSelected" | "iframeChannelResize" | "iframeChannelDrag"; - -/** - * Setup message sent by the DA proxy code in getAgent() to an intent resolver UI in an - * iframe with the resolver data to setup the UI. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeResolve { - /** - * The message payload - */ - payload: IframeResolvePayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeResolve"; -} - -/** - * The message payload - */ -export interface IframeResolvePayload { - /** - * An array of AppIntent objects defining the resolution options. - */ - appIntents: AppIntent[]; - context: Context; -} - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * Message from an intent resolver UI in an iframe to DA proxy code in getAgent() reporting - * a user action. - * - * A message used to communicate with iframes injected by `getAgent()` for displaying UI - * elements such as the intent resolver or channel selector. Used for messages sent in - * either direction. - */ -export interface IframeResolveAction { - /** - * The message payload - */ - payload: IframeResolveActionPayload; - /** - * Identifies the type of the message to or from the iframe. - */ - type: "iframeResolveAction"; -} - -/** - * The message payload - */ -export interface IframeResolveActionPayload { - action: Action; - /** - * The App resolution option chosen - */ - appIdentifier?: AppIdentifier; - /** - * The intent resolved - */ - intent?: string; -} - -export type Action = "hover" | "click" | "cancel"; - -/** - * Identifies the type of the message to or from the iframe. - */ - -/** - * An event message from the Desktop Agent to an app indicating that it has been selected to - * resolve a raised intent and context. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface IntentEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: IntentEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "intentEvent"; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface IntentEventPayload { - /** - * The context object passed with the raised intent. - */ - context: Context; - /** - * The intent that was raised. - */ - intent: string; - /** - * Details of the application instance that raised the intent - */ - originatingApp?: AppIdentifier; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to unsubscribe a context listener. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface IntentListenerUnsubscribeRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: IntentListenerUnsubscribeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "intentListenerUnsubscribeRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface IntentListenerUnsubscribeRequestPayload { - listenerUUID: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a intentListenerUnsubscribe request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface IntentListenerUnsubscribeResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: BroadcastResponseResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "intentListenerUnsubscribeResponse"; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to deliver a result for an intent (which may include a `void` result that just - * indicates that the handler has run, returning no result). - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface IntentResultRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: IntentResultRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "intentResultRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface IntentResultRequestPayload { - intentResult: PurpleIntentResult; -} - -export interface PurpleIntentResult { - context?: Context; - channel?: Channel; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a request to deliver an intent result. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface IntentResultResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: BroadcastResponseResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "intentResultResponse"; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request to join the app to the specified User channel. On successfully joining a channel, - * client code should make subsequent requests to get the current context of that channel - * for all registered context listeners and then call their handlers with it. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface JoinUserChannelRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: JoinUserChannelRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "joinUserChannelRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface JoinUserChannelRequestPayload { - /** - * The id of the channel to join - */ - channelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a joinUserChannel request. On receipt of this response, client code should - * make subsequent requests to get the current context of that channel for all registered - * context listeners and then call their handlers with it. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface JoinUserChannelResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: JoinUserChannelResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "joinUserChannelResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface JoinUserChannelResponsePayload { - error?: PurpleError; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request to remove the app from any User channel membership. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface LeaveCurrentChannelRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: LeaveCurrentChannelRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "leaveCurrentChannelRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface LeaveCurrentChannelRequestPayload { -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a leaveCurrentChannel request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface LeaveCurrentChannelResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: LeaveCurrentChannelResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "leaveCurrentChannelResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface LeaveCurrentChannelResponsePayload { - error?: PurpleError; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to open an application. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface OpenRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: OpenRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "openRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface OpenRequestPayload { - app: AppIdentifier; - /** - * If a Context object is passed in, this object will be provided to the opened application - * via a contextListener. The Context argument is functionally equivalent to opening the - * target app with no context and broadcasting the context directly to it. - */ - context?: Context; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a open request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface OpenResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: OpenResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "openResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface OpenResponsePayload { - error?: OpenErrorResponsePayload; - appIdentifier?: AppIdentifier; -} - -/** - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type OpenErrorResponsePayload = "MalformedContext" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * Request that indicates that a participant will no longer interact with a specified - * `PrivateChannel`. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface PrivateChannelDisconnectRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelDisconnectRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "privateChannelDisconnectRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelDisconnectRequestPayload { - /** - * The Id of the Channel that should be disconnected from - */ - channelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a privateChannelDisconnect request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface PrivateChannelDisconnectResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: PrivateChannelDisconnectResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "privateChannelDisconnectResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface PrivateChannelDisconnectResponsePayload { - error?: PurpleError; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * An event message from the Desktop Agent to an app indicating that another app has added a - * context listener to a specific PrivateChannel. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface PrivateChannelOnAddContextListenerEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: PrivateChannelOnAddContextListenerEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "privateChannelOnAddContextListenerEvent"; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface PrivateChannelOnAddContextListenerEventPayload { - /** - * The type of the context listener added to the channel by another app, or null if it will - * listen to all types. - */ - contextType: null | string; - /** - * The Id of the PrivateChannel that the listener was added to. - */ - privateChannelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * An event message from the Desktop Agent to an app indicating that another app has - * disconnected from a specific PrivateChannel and will no longer interact with it. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface PrivateChannelOnDisconnectEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: PrivateChannelOnDisconnectEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "privateChannelOnDisconnectEvent"; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface PrivateChannelOnDisconnectEventPayload { - /** - * The Id of the PrivateChannel that the app has disconnected from. - */ - privateChannelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * An event message from the Desktop Agent to an app indicating that another app has - * unsubscribed a context listener from a specific PrivateChannel. - * - * A message from a Desktop Agent to an FDC3-enabled app representing an event. - */ -export interface PrivateChannelOnUnsubscribeEvent { - /** - * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. - */ - meta: AddEventListenerEventMeta; - /** - * The message payload contains details of the event that the app is being notified about. - */ - payload: PrivateChannelOnUnsubscribeEventPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "privateChannelOnUnsubscribeEvent"; -} - -/** - * The message payload contains details of the event that the app is being notified about. - */ -export interface PrivateChannelOnUnsubscribeEventPayload { - /** - * The type of the context listener unsubscribed from the channel by another app, or null if - * it was listening to all types. - */ - contextType: null | string; - /** - * The Id of the PrivateChannel that the listener was unsubscribed from. - */ - privateChannelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to unsubscribe a context listener. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface PrivateChannelUnsubscribeEventListenerRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelUnsubscribeEventListenerRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "privateChannelUnsubscribeEventListenerRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelUnsubscribeEventListenerRequestPayload { - listenerUUID: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a privateChannelUnsubscribeEventListener request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface PrivateChannelUnsubscribeEventListenerResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: BroadcastResponseResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "privateChannelUnsubscribeEventListenerResponse"; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to add an event listener to a specific PrivateChannel. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface PrivateChannelAddEventListenerRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: TPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "privateChannelAddEventListenerRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface TPayload { - /** - * The type of PrivateChannel event that the listener should be applied to. - */ - listenerType: PrivateChannelEventListenerTypes; - /** - * The Id of the PrivateChannel that the listener should be added to. - */ - privateChannelId: string; -} - -/** - * The type of PrivateChannel event that the listener should be applied to. - * - * Event listener type names for Private Channel events - */ -export type PrivateChannelEventListenerTypes = "onAddContextListener" | "onUnsubscribe" | "onDisconnect"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a privateChannelAddEventListener request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface PrivateChannelAddEventListenerResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: PrivateChannelAddEventListenerResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "privateChannelAddEventListenerResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface PrivateChannelAddEventListenerResponsePayload { - error?: PurpleError; - listenerUUID?: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to raise an unspecified intent for a specified context. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface RaiseIntentForContextRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: RaiseIntentForContextRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "raiseIntentForContextRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface RaiseIntentForContextRequestPayload { - app?: AppIdentifier; - context: Context; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a raiseIntentForContext request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface RaiseIntentForContextResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - * - * There are 3 possible responses to a raiseIntentForContext request, each of which sets a - * single property in the payload: Success (`intentResolution`), Needs further resolution - * (`appIntents`) or Error (`error`). - */ - payload: RaiseIntentForContextResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentForContextResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - * - * There are 3 possible responses to a raiseIntentForContext request, each of which sets a - * single property in the payload: Success (`intentResolution`), Needs further resolution - * (`appIntents`) or Error (`error`). - * - * Response to a raiseIntentForContext request that needs additional resolution (i.e. show - * an intent resolver UI) - * - * Used if a raiseIntent request resulted in an error - */ -export interface RaiseIntentForContextResponsePayload { - /** - * Should be set if the raiseIntent request returned an error. - */ - error?: FindInstancesErrors; - /** - * Used if the raiseIntent request was successfully resolved - */ - intentResolution?: IntentResolution; - /** - * Used if a raiseIntentForContext request requires additional resolution (e.g. by showing - * an intent resolver) before it can be handled. - */ - appIntents?: AppIntent[]; -} - -/** - * Used if the raiseIntent request was successfully resolved - * - * IntentResolution provides a standard format for data returned upon resolving an intent. - * - * ```javascript - * //resolve a "Chain" type intent - * let resolution = await agent.raiseIntent("intentName", context); - * - * //resolve a "Client-Service" type intent with a data response or a Channel - * let resolution = await agent.raiseIntent("intentName", context); - * try { - * const result = await resolution.getResult(); - * if (result && result.broadcast) { - * console.log(`${resolution.source} returned a channel with id ${result.id}`); - * } else if (result){ - * console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`); - * } else { - * console.error(`${resolution.source} didn't return data` - * } - * } catch(error) { - * console.error(`${resolution.source} returned an error: ${error}`); - * } - * - * // Use metadata about the resolving app instance to target a further intent - * await agent.raiseIntent("intentName", context, resolution.source); - * ``` - */ -export interface IntentResolution { - /** - * The intent that was raised. May be used to determine which intent the user - * chose in response to `fdc3.raiseIntentForContext()`. - */ - intent: string; - /** - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ - source: AppIdentifier; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A request to raise an intent for a context. - * - * A request message from an FDC3-enabled app to a Desktop Agent. - */ -export interface RaiseIntentRequest { - /** - * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. - */ - meta: AddContextListenerRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: RaiseIntentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "raiseIntentRequest"; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface RaiseIntentRequestPayload { - app?: AppIdentifier; - context: Context; - intent: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - -/** - * A response to a raiseIntent request. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface RaiseIntentResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - * - * There are 3 possible responses to a raiseIntent request, each of which sets a single - * property in the payload: Success (`intentResolution`), Needs further resolution - * (`appIntent`) or Error (`error`). - */ - payload: RaiseIntentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - * - * There are 3 possible responses to a raiseIntent request, each of which sets a single - * property in the payload: Success (`intentResolution`), Needs further resolution - * (`appIntent`) or Error (`error`). - * - * Response to a raiseIntent request that needs additional resolution (i.e. show an intent - * resolver UI). - * - * Used if a raiseIntent request resulted in an error - */ -export interface RaiseIntentResponsePayload { - /** - * Should be set if the raiseIntent request returned an error. - */ - error?: FindInstancesErrors; - /** - * Used if the raiseIntent request was successfully resolved - */ - intentResolution?: IntentResolution; - /** - * Used if a raiseIntent request requires additional resolution (e.g. by showing an intent - * resolver) before it can be handled. - */ - appIntent?: AppIntent; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -/** - * A secondary response to a request to raise an intent used to deliver the intent result. - * - * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the - * payload contains an `error` property, the request was unsuccessful. - */ -export interface RaiseIntentResultResponse { - /** - * Metadata for messages sent by a Desktop Agent to an App in response to an API call - */ - meta: AddContextListenerResponseMeta; - /** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ - payload: RaiseIntentResultResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResultResponse"; -} - -/** - * A payload for a response to an API call that will contain any return values or an `error` - * property containing a standardized error message indicating that the request was - * unsuccessful. - */ -export interface RaiseIntentResultResponsePayload { - error?: ResponsePayloadError; - intentResult?: FluffyIntentResult; -} - -export interface FluffyIntentResult { - context?: Context; - channel?: Channel; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - -// Converts JSON strings to/from your types -// and asserts the results of JSON.parse at runtime -export class Convert { - public static toWebConnectionProtocol1Hello(json: string): WebConnectionProtocol1Hello { - return cast(JSON.parse(json), r("WebConnectionProtocol1Hello")); - } - - public static webConnectionProtocol1HelloToJson(value: WebConnectionProtocol1Hello): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol1Hello")), null, 2); - } - - public static toWebConnectionProtocol2LoadURL(json: string): WebConnectionProtocol2LoadURL { - return cast(JSON.parse(json), r("WebConnectionProtocol2LoadURL")); - } - - public static webConnectionProtocol2LoadURLToJson(value: WebConnectionProtocol2LoadURL): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol2LoadURL")), null, 2); - } - - public static toWebConnectionProtocol3Handshake(json: string): WebConnectionProtocol3Handshake { - return cast(JSON.parse(json), r("WebConnectionProtocol3Handshake")); - } - - public static webConnectionProtocol3HandshakeToJson(value: WebConnectionProtocol3Handshake): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol3Handshake")), null, 2); - } - - public static toWebConnectionProtocol4ValidateAppIdentity(json: string): WebConnectionProtocol4ValidateAppIdentity { - return cast(JSON.parse(json), r("WebConnectionProtocol4ValidateAppIdentity")); - } - - public static webConnectionProtocol4ValidateAppIdentityToJson(value: WebConnectionProtocol4ValidateAppIdentity): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol4ValidateAppIdentity")), null, 2); - } - - public static toWebConnectionProtocol5ValidateAppIdentityFailedResponse(json: string): WebConnectionProtocol5ValidateAppIdentityFailedResponse { - return cast(JSON.parse(json), r("WebConnectionProtocol5ValidateAppIdentityFailedResponse")); - } - - public static webConnectionProtocol5ValidateAppIdentityFailedResponseToJson(value: WebConnectionProtocol5ValidateAppIdentityFailedResponse): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol5ValidateAppIdentityFailedResponse")), null, 2); - } - - public static toWebConnectionProtocol5ValidateAppIdentitySuccessResponse(json: string): WebConnectionProtocol5ValidateAppIdentitySuccessResponse { - return cast(JSON.parse(json), r("WebConnectionProtocol5ValidateAppIdentitySuccessResponse")); - } - - public static webConnectionProtocol5ValidateAppIdentitySuccessResponseToJson(value: WebConnectionProtocol5ValidateAppIdentitySuccessResponse): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol5ValidateAppIdentitySuccessResponse")), null, 2); - } - - public static toWebConnectionProtocol6Goodbye(json: string): WebConnectionProtocol6Goodbye { - return cast(JSON.parse(json), r("WebConnectionProtocol6Goodbye")); - } - - public static webConnectionProtocol6GoodbyeToJson(value: WebConnectionProtocol6Goodbye): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocol6Goodbye")), null, 2); - } - - public static toWebConnectionProtocolMessage(json: string): WebConnectionProtocolMessage { - return cast(JSON.parse(json), r("WebConnectionProtocolMessage")); - } - - public static webConnectionProtocolMessageToJson(value: WebConnectionProtocolMessage): string { - return JSON.stringify(uncast(value, r("WebConnectionProtocolMessage")), null, 2); - } - - public static toAddContextListenerRequest(json: string): AddContextListenerRequest { - return cast(JSON.parse(json), r("AddContextListenerRequest")); - } - - public static addContextListenerRequestToJson(value: AddContextListenerRequest): string { - return JSON.stringify(uncast(value, r("AddContextListenerRequest")), null, 2); - } - - public static toAddContextListenerResponse(json: string): AddContextListenerResponse { - return cast(JSON.parse(json), r("AddContextListenerResponse")); - } - - public static addContextListenerResponseToJson(value: AddContextListenerResponse): string { - return JSON.stringify(uncast(value, r("AddContextListenerResponse")), null, 2); - } - - public static toAddEventListenerEvent(json: string): AddEventListenerEvent { - return cast(JSON.parse(json), r("AddEventListenerEvent")); - } - - public static addEventListenerEventToJson(value: AddEventListenerEvent): string { - return JSON.stringify(uncast(value, r("AddEventListenerEvent")), null, 2); - } - - public static toAddEventListenerRequest(json: string): AddEventListenerRequest { - return cast(JSON.parse(json), r("AddEventListenerRequest")); - } - - public static addEventListenerRequestToJson(value: AddEventListenerRequest): string { - return JSON.stringify(uncast(value, r("AddEventListenerRequest")), null, 2); - } - - public static toAddEventListenerResponse(json: string): AddEventListenerResponse { - return cast(JSON.parse(json), r("AddEventListenerResponse")); - } - - public static addEventListenerResponseToJson(value: AddEventListenerResponse): string { - return JSON.stringify(uncast(value, r("AddEventListenerResponse")), null, 2); - } - - public static toAddIntentListenerRequest(json: string): AddIntentListenerRequest { - return cast(JSON.parse(json), r("AddIntentListenerRequest")); - } - - public static addIntentListenerRequestToJson(value: AddIntentListenerRequest): string { - return JSON.stringify(uncast(value, r("AddIntentListenerRequest")), null, 2); - } - - public static toAddIntentListenerResponse(json: string): AddIntentListenerResponse { - return cast(JSON.parse(json), r("AddIntentListenerResponse")); - } - - public static addIntentListenerResponseToJson(value: AddIntentListenerResponse): string { - return JSON.stringify(uncast(value, r("AddIntentListenerResponse")), null, 2); - } - - public static toAgentEventMessage(json: string): AgentEventMessage { - return cast(JSON.parse(json), r("AgentEventMessage")); - } - - public static agentEventMessageToJson(value: AgentEventMessage): string { - return JSON.stringify(uncast(value, r("AgentEventMessage")), null, 2); - } - - public static toAgentResponseMessage(json: string): AgentResponseMessage { - return cast(JSON.parse(json), r("AgentResponseMessage")); - } - - public static agentResponseMessageToJson(value: AgentResponseMessage): string { - return JSON.stringify(uncast(value, r("AgentResponseMessage")), null, 2); - } - - public static toAppRequestMessage(json: string): AppRequestMessage { - return cast(JSON.parse(json), r("AppRequestMessage")); - } - - public static appRequestMessageToJson(value: AppRequestMessage): string { - return JSON.stringify(uncast(value, r("AppRequestMessage")), null, 2); - } - - public static toBroadcastEvent(json: string): BroadcastEvent { - return cast(JSON.parse(json), r("BroadcastEvent")); - } - - public static broadcastEventToJson(value: BroadcastEvent): string { - return JSON.stringify(uncast(value, r("BroadcastEvent")), null, 2); - } - - public static toBroadcastRequest(json: string): BroadcastRequest { - return cast(JSON.parse(json), r("BroadcastRequest")); - } - - public static broadcastRequestToJson(value: BroadcastRequest): string { - return JSON.stringify(uncast(value, r("BroadcastRequest")), null, 2); - } - - public static toBroadcastResponse(json: string): BroadcastResponse { - return cast(JSON.parse(json), r("BroadcastResponse")); - } - - public static broadcastResponseToJson(value: BroadcastResponse): string { - return JSON.stringify(uncast(value, r("BroadcastResponse")), null, 2); - } - - public static toChannelChangedEvent(json: string): ChannelChangedEvent { - return cast(JSON.parse(json), r("ChannelChangedEvent")); - } - - public static channelChangedEventToJson(value: ChannelChangedEvent): string { - return JSON.stringify(uncast(value, r("ChannelChangedEvent")), null, 2); - } - - public static toContextListenerUnsubscribeRequest(json: string): ContextListenerUnsubscribeRequest { - return cast(JSON.parse(json), r("ContextListenerUnsubscribeRequest")); - } - - public static contextListenerUnsubscribeRequestToJson(value: ContextListenerUnsubscribeRequest): string { - return JSON.stringify(uncast(value, r("ContextListenerUnsubscribeRequest")), null, 2); - } - - public static toContextListenerUnsubscribeResponse(json: string): ContextListenerUnsubscribeResponse { - return cast(JSON.parse(json), r("ContextListenerUnsubscribeResponse")); - } - - public static contextListenerUnsubscribeResponseToJson(value: ContextListenerUnsubscribeResponse): string { - return JSON.stringify(uncast(value, r("ContextListenerUnsubscribeResponse")), null, 2); - } - - public static toCreatePrivateChannelRequest(json: string): CreatePrivateChannelRequest { - return cast(JSON.parse(json), r("CreatePrivateChannelRequest")); - } - - public static createPrivateChannelRequestToJson(value: CreatePrivateChannelRequest): string { - return JSON.stringify(uncast(value, r("CreatePrivateChannelRequest")), null, 2); - } - - public static toCreatePrivateChannelResponse(json: string): CreatePrivateChannelResponse { - return cast(JSON.parse(json), r("CreatePrivateChannelResponse")); - } - - public static createPrivateChannelResponseToJson(value: CreatePrivateChannelResponse): string { - return JSON.stringify(uncast(value, r("CreatePrivateChannelResponse")), null, 2); - } - - public static toEventListenerUnsubscribeRequest(json: string): EventListenerUnsubscribeRequest { - return cast(JSON.parse(json), r("EventListenerUnsubscribeRequest")); - } - - public static eventListenerUnsubscribeRequestToJson(value: EventListenerUnsubscribeRequest): string { - return JSON.stringify(uncast(value, r("EventListenerUnsubscribeRequest")), null, 2); - } - - public static toEventListenerUnsubscribeResponse(json: string): EventListenerUnsubscribeResponse { - return cast(JSON.parse(json), r("EventListenerUnsubscribeResponse")); - } - - public static eventListenerUnsubscribeResponseToJson(value: EventListenerUnsubscribeResponse): string { - return JSON.stringify(uncast(value, r("EventListenerUnsubscribeResponse")), null, 2); - } - - public static toFindInstancesRequest(json: string): FindInstancesRequest { - return cast(JSON.parse(json), r("FindInstancesRequest")); - } - - public static findInstancesRequestToJson(value: FindInstancesRequest): string { - return JSON.stringify(uncast(value, r("FindInstancesRequest")), null, 2); - } - - public static toFindInstancesResponse(json: string): FindInstancesResponse { - return cast(JSON.parse(json), r("FindInstancesResponse")); - } - - public static findInstancesResponseToJson(value: FindInstancesResponse): string { - return JSON.stringify(uncast(value, r("FindInstancesResponse")), null, 2); - } - - public static toFindIntentRequest(json: string): FindIntentRequest { - return cast(JSON.parse(json), r("FindIntentRequest")); - } - - public static findIntentRequestToJson(value: FindIntentRequest): string { - return JSON.stringify(uncast(value, r("FindIntentRequest")), null, 2); - } - - public static toFindIntentResponse(json: string): FindIntentResponse { - return cast(JSON.parse(json), r("FindIntentResponse")); - } - - public static findIntentResponseToJson(value: FindIntentResponse): string { - return JSON.stringify(uncast(value, r("FindIntentResponse")), null, 2); - } - - public static toFindIntentsByContextRequest(json: string): FindIntentsByContextRequest { - return cast(JSON.parse(json), r("FindIntentsByContextRequest")); - } - - public static findIntentsByContextRequestToJson(value: FindIntentsByContextRequest): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextRequest")), null, 2); - } - - public static toFindIntentsByContextResponse(json: string): FindIntentsByContextResponse { - return cast(JSON.parse(json), r("FindIntentsByContextResponse")); - } - - public static findIntentsByContextResponseToJson(value: FindIntentsByContextResponse): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextResponse")), null, 2); - } - - public static toGetAppMetadataRequest(json: string): GetAppMetadataRequest { - return cast(JSON.parse(json), r("GetAppMetadataRequest")); - } - - public static getAppMetadataRequestToJson(value: GetAppMetadataRequest): string { - return JSON.stringify(uncast(value, r("GetAppMetadataRequest")), null, 2); - } - - public static toGetAppMetadataResponse(json: string): GetAppMetadataResponse { - return cast(JSON.parse(json), r("GetAppMetadataResponse")); - } - - public static getAppMetadataResponseToJson(value: GetAppMetadataResponse): string { - return JSON.stringify(uncast(value, r("GetAppMetadataResponse")), null, 2); - } - - public static toGetCurrentChannelRequest(json: string): GetCurrentChannelRequest { - return cast(JSON.parse(json), r("GetCurrentChannelRequest")); - } - - public static getCurrentChannelRequestToJson(value: GetCurrentChannelRequest): string { - return JSON.stringify(uncast(value, r("GetCurrentChannelRequest")), null, 2); - } - - public static toGetCurrentChannelResponse(json: string): GetCurrentChannelResponse { - return cast(JSON.parse(json), r("GetCurrentChannelResponse")); - } - - public static getCurrentChannelResponseToJson(value: GetCurrentChannelResponse): string { - return JSON.stringify(uncast(value, r("GetCurrentChannelResponse")), null, 2); - } - - public static toGetCurrentContextRequest(json: string): GetCurrentContextRequest { - return cast(JSON.parse(json), r("GetCurrentContextRequest")); - } - - public static getCurrentContextRequestToJson(value: GetCurrentContextRequest): string { - return JSON.stringify(uncast(value, r("GetCurrentContextRequest")), null, 2); - } - - public static toGetCurrentContextResponse(json: string): GetCurrentContextResponse { - return cast(JSON.parse(json), r("GetCurrentContextResponse")); - } - - public static getCurrentContextResponseToJson(value: GetCurrentContextResponse): string { - return JSON.stringify(uncast(value, r("GetCurrentContextResponse")), null, 2); - } - - public static toGetInfoRequest(json: string): GetInfoRequest { - return cast(JSON.parse(json), r("GetInfoRequest")); - } - - public static getInfoRequestToJson(value: GetInfoRequest): string { - return JSON.stringify(uncast(value, r("GetInfoRequest")), null, 2); - } - - public static toGetInfoResponse(json: string): GetInfoResponse { - return cast(JSON.parse(json), r("GetInfoResponse")); - } - - public static getInfoResponseToJson(value: GetInfoResponse): string { - return JSON.stringify(uncast(value, r("GetInfoResponse")), null, 2); - } - - public static toGetOrCreateChannelRequest(json: string): GetOrCreateChannelRequest { - return cast(JSON.parse(json), r("GetOrCreateChannelRequest")); - } - - public static getOrCreateChannelRequestToJson(value: GetOrCreateChannelRequest): string { - return JSON.stringify(uncast(value, r("GetOrCreateChannelRequest")), null, 2); - } - - public static toGetOrCreateChannelResponse(json: string): GetOrCreateChannelResponse { - return cast(JSON.parse(json), r("GetOrCreateChannelResponse")); - } - - public static getOrCreateChannelResponseToJson(value: GetOrCreateChannelResponse): string { - return JSON.stringify(uncast(value, r("GetOrCreateChannelResponse")), null, 2); - } - - public static toGetUserChannelsRequest(json: string): GetUserChannelsRequest { - return cast(JSON.parse(json), r("GetUserChannelsRequest")); - } - - public static getUserChannelsRequestToJson(value: GetUserChannelsRequest): string { - return JSON.stringify(uncast(value, r("GetUserChannelsRequest")), null, 2); - } - - public static toGetUserChannelsResponse(json: string): GetUserChannelsResponse { - return cast(JSON.parse(json), r("GetUserChannelsResponse")); - } - - public static getUserChannelsResponseToJson(value: GetUserChannelsResponse): string { - return JSON.stringify(uncast(value, r("GetUserChannelsResponse")), null, 2); - } - - public static toIframeChannelDrag(json: string): IframeChannelDrag { - return cast(JSON.parse(json), r("IframeChannelDrag")); - } - - public static iframeChannelDragToJson(value: IframeChannelDrag): string { - return JSON.stringify(uncast(value, r("IframeChannelDrag")), null, 2); - } - - public static toIframeChannelResize(json: string): IframeChannelResize { - return cast(JSON.parse(json), r("IframeChannelResize")); - } - - public static iframeChannelResizeToJson(value: IframeChannelResize): string { - return JSON.stringify(uncast(value, r("IframeChannelResize")), null, 2); - } - - public static toIframeChannelSelected(json: string): IframeChannelSelected { - return cast(JSON.parse(json), r("IframeChannelSelected")); - } - - public static iframeChannelSelectedToJson(value: IframeChannelSelected): string { - return JSON.stringify(uncast(value, r("IframeChannelSelected")), null, 2); - } - - public static toIframeChannels(json: string): IframeChannels { - return cast(JSON.parse(json), r("IframeChannels")); - } - - public static iframeChannelsToJson(value: IframeChannels): string { - return JSON.stringify(uncast(value, r("IframeChannels")), null, 2); - } - - public static toIframeHandshake(json: string): IframeHandshake { - return cast(JSON.parse(json), r("IframeHandshake")); - } - - public static iframeHandshakeToJson(value: IframeHandshake): string { - return JSON.stringify(uncast(value, r("IframeHandshake")), null, 2); - } - - public static toIframeHello(json: string): IframeHello { - return cast(JSON.parse(json), r("IframeHello")); - } - - public static iframeHelloToJson(value: IframeHello): string { - return JSON.stringify(uncast(value, r("IframeHello")), null, 2); - } - - public static toIframeMessage(json: string): IframeMessage { - return cast(JSON.parse(json), r("IframeMessage")); - } - - public static iframeMessageToJson(value: IframeMessage): string { - return JSON.stringify(uncast(value, r("IframeMessage")), null, 2); - } - - public static toIframeResolve(json: string): IframeResolve { - return cast(JSON.parse(json), r("IframeResolve")); - } - - public static iframeResolveToJson(value: IframeResolve): string { - return JSON.stringify(uncast(value, r("IframeResolve")), null, 2); - } - - public static toIframeResolveAction(json: string): IframeResolveAction { - return cast(JSON.parse(json), r("IframeResolveAction")); - } - - public static iframeResolveActionToJson(value: IframeResolveAction): string { - return JSON.stringify(uncast(value, r("IframeResolveAction")), null, 2); - } - - public static toIntentEvent(json: string): IntentEvent { - return cast(JSON.parse(json), r("IntentEvent")); - } - - public static intentEventToJson(value: IntentEvent): string { - return JSON.stringify(uncast(value, r("IntentEvent")), null, 2); - } - - public static toIntentListenerUnsubscribeRequest(json: string): IntentListenerUnsubscribeRequest { - return cast(JSON.parse(json), r("IntentListenerUnsubscribeRequest")); - } - - public static intentListenerUnsubscribeRequestToJson(value: IntentListenerUnsubscribeRequest): string { - return JSON.stringify(uncast(value, r("IntentListenerUnsubscribeRequest")), null, 2); - } - - public static toIntentListenerUnsubscribeResponse(json: string): IntentListenerUnsubscribeResponse { - return cast(JSON.parse(json), r("IntentListenerUnsubscribeResponse")); - } - - public static intentListenerUnsubscribeResponseToJson(value: IntentListenerUnsubscribeResponse): string { - return JSON.stringify(uncast(value, r("IntentListenerUnsubscribeResponse")), null, 2); - } - - public static toIntentResultRequest(json: string): IntentResultRequest { - return cast(JSON.parse(json), r("IntentResultRequest")); - } - - public static intentResultRequestToJson(value: IntentResultRequest): string { - return JSON.stringify(uncast(value, r("IntentResultRequest")), null, 2); - } - - public static toIntentResultResponse(json: string): IntentResultResponse { - return cast(JSON.parse(json), r("IntentResultResponse")); - } - - public static intentResultResponseToJson(value: IntentResultResponse): string { - return JSON.stringify(uncast(value, r("IntentResultResponse")), null, 2); - } - - public static toJoinUserChannelRequest(json: string): JoinUserChannelRequest { - return cast(JSON.parse(json), r("JoinUserChannelRequest")); - } - - public static joinUserChannelRequestToJson(value: JoinUserChannelRequest): string { - return JSON.stringify(uncast(value, r("JoinUserChannelRequest")), null, 2); - } - - public static toJoinUserChannelResponse(json: string): JoinUserChannelResponse { - return cast(JSON.parse(json), r("JoinUserChannelResponse")); - } - - public static joinUserChannelResponseToJson(value: JoinUserChannelResponse): string { - return JSON.stringify(uncast(value, r("JoinUserChannelResponse")), null, 2); - } - - public static toLeaveCurrentChannelRequest(json: string): LeaveCurrentChannelRequest { - return cast(JSON.parse(json), r("LeaveCurrentChannelRequest")); - } - - public static leaveCurrentChannelRequestToJson(value: LeaveCurrentChannelRequest): string { - return JSON.stringify(uncast(value, r("LeaveCurrentChannelRequest")), null, 2); - } - - public static toLeaveCurrentChannelResponse(json: string): LeaveCurrentChannelResponse { - return cast(JSON.parse(json), r("LeaveCurrentChannelResponse")); - } - - public static leaveCurrentChannelResponseToJson(value: LeaveCurrentChannelResponse): string { - return JSON.stringify(uncast(value, r("LeaveCurrentChannelResponse")), null, 2); - } - - public static toOpenRequest(json: string): OpenRequest { - return cast(JSON.parse(json), r("OpenRequest")); - } - - public static openRequestToJson(value: OpenRequest): string { - return JSON.stringify(uncast(value, r("OpenRequest")), null, 2); - } - - public static toOpenResponse(json: string): OpenResponse { - return cast(JSON.parse(json), r("OpenResponse")); - } - - public static openResponseToJson(value: OpenResponse): string { - return JSON.stringify(uncast(value, r("OpenResponse")), null, 2); - } - - public static toPrivateChannelDisconnectRequest(json: string): PrivateChannelDisconnectRequest { - return cast(JSON.parse(json), r("PrivateChannelDisconnectRequest")); - } - - public static privateChannelDisconnectRequestToJson(value: PrivateChannelDisconnectRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelDisconnectRequest")), null, 2); - } - - public static toPrivateChannelDisconnectResponse(json: string): PrivateChannelDisconnectResponse { - return cast(JSON.parse(json), r("PrivateChannelDisconnectResponse")); - } - - public static privateChannelDisconnectResponseToJson(value: PrivateChannelDisconnectResponse): string { - return JSON.stringify(uncast(value, r("PrivateChannelDisconnectResponse")), null, 2); - } - - public static toPrivateChannelOnAddContextListenerEvent(json: string): PrivateChannelOnAddContextListenerEvent { - return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerEvent")); - } - - public static privateChannelOnAddContextListenerEventToJson(value: PrivateChannelOnAddContextListenerEvent): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerEvent")), null, 2); - } - - public static toPrivateChannelOnDisconnectEvent(json: string): PrivateChannelOnDisconnectEvent { - return cast(JSON.parse(json), r("PrivateChannelOnDisconnectEvent")); - } - - public static privateChannelOnDisconnectEventToJson(value: PrivateChannelOnDisconnectEvent): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectEvent")), null, 2); - } - - public static toPrivateChannelOnUnsubscribeEvent(json: string): PrivateChannelOnUnsubscribeEvent { - return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeEvent")); - } - - public static privateChannelOnUnsubscribeEventToJson(value: PrivateChannelOnUnsubscribeEvent): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeEvent")), null, 2); - } - - public static toPrivateChannelUnsubscribeEventListenerRequest(json: string): PrivateChannelUnsubscribeEventListenerRequest { - return cast(JSON.parse(json), r("PrivateChannelUnsubscribeEventListenerRequest")); - } - - public static privateChannelUnsubscribeEventListenerRequestToJson(value: PrivateChannelUnsubscribeEventListenerRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelUnsubscribeEventListenerRequest")), null, 2); - } - - public static toPrivateChannelUnsubscribeEventListenerResponse(json: string): PrivateChannelUnsubscribeEventListenerResponse { - return cast(JSON.parse(json), r("PrivateChannelUnsubscribeEventListenerResponse")); - } - - public static privateChannelUnsubscribeEventListenerResponseToJson(value: PrivateChannelUnsubscribeEventListenerResponse): string { - return JSON.stringify(uncast(value, r("PrivateChannelUnsubscribeEventListenerResponse")), null, 2); - } - - public static toPrivateChannelAddEventListenerRequest(json: string): PrivateChannelAddEventListenerRequest { - return cast(JSON.parse(json), r("PrivateChannelAddEventListenerRequest")); - } - - public static privateChannelAddEventListenerRequestToJson(value: PrivateChannelAddEventListenerRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelAddEventListenerRequest")), null, 2); - } - - public static toPrivateChannelAddEventListenerResponse(json: string): PrivateChannelAddEventListenerResponse { - return cast(JSON.parse(json), r("PrivateChannelAddEventListenerResponse")); - } - - public static privateChannelAddEventListenerResponseToJson(value: PrivateChannelAddEventListenerResponse): string { - return JSON.stringify(uncast(value, r("PrivateChannelAddEventListenerResponse")), null, 2); - } - - public static toRaiseIntentForContextRequest(json: string): RaiseIntentForContextRequest { - return cast(JSON.parse(json), r("RaiseIntentForContextRequest")); - } - - public static raiseIntentForContextRequestToJson(value: RaiseIntentForContextRequest): string { - return JSON.stringify(uncast(value, r("RaiseIntentForContextRequest")), null, 2); - } - - public static toRaiseIntentForContextResponse(json: string): RaiseIntentForContextResponse { - return cast(JSON.parse(json), r("RaiseIntentForContextResponse")); - } - - public static raiseIntentForContextResponseToJson(value: RaiseIntentForContextResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentForContextResponse")), null, 2); - } - - public static toRaiseIntentRequest(json: string): RaiseIntentRequest { - return cast(JSON.parse(json), r("RaiseIntentRequest")); - } - - public static raiseIntentRequestToJson(value: RaiseIntentRequest): string { - return JSON.stringify(uncast(value, r("RaiseIntentRequest")), null, 2); - } - - public static toRaiseIntentResponse(json: string): RaiseIntentResponse { - return cast(JSON.parse(json), r("RaiseIntentResponse")); - } - - public static raiseIntentResponseToJson(value: RaiseIntentResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentResponse")), null, 2); - } - - public static toRaiseIntentResultResponse(json: string): RaiseIntentResultResponse { - return cast(JSON.parse(json), r("RaiseIntentResultResponse")); - } - - public static raiseIntentResultResponseToJson(value: RaiseIntentResultResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentResultResponse")), null, 2); - } -} - -function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { - const prettyTyp = prettyTypeName(typ); - const parentText = parent ? ` on ${parent}` : ''; - const keyText = key ? ` for key "${key}"` : ''; - throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); -} - -function prettyTypeName(typ: any): string { - if (Array.isArray(typ)) { - if (typ.length === 2 && typ[0] === undefined) { - return `an optional ${prettyTypeName(typ[1])}`; - } else { - return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; - } - } else if (typeof typ === "object" && typ.literal !== undefined) { - return typ.literal; - } else { - return typeof typ; - } -} - -function jsonToJSProps(typ: any): any { - if (typ.jsonToJS === undefined) { - const map: any = {}; - typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); - typ.jsonToJS = map; - } - return typ.jsonToJS; -} - -function jsToJSONProps(typ: any): any { - if (typ.jsToJSON === undefined) { - const map: any = {}; - typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); - typ.jsToJSON = map; - } - return typ.jsToJSON; -} - -function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { - function transformPrimitive(typ: string, val: any): any { - if (typeof typ === typeof val) return val; - return invalidValue(typ, val, key, parent); - } - - function transformUnion(typs: any[], val: any): any { - // val must validate against one typ in typs - const l = typs.length; - for (let i = 0; i < l; i++) { - const typ = typs[i]; - try { - return transform(val, typ, getProps); - } catch (_) {} - } - return invalidValue(typs, val, key, parent); - } - - function transformEnum(cases: string[], val: any): any { - if (cases.indexOf(val) !== -1) return val; - return invalidValue(cases.map(a => { return l(a); }), val, key, parent); - } - - function transformArray(typ: any, val: any): any { - // val must be an array with no invalid elements - if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); - return val.map(el => transform(el, typ, getProps)); - } - - function transformDate(val: any): any { - if (val === null) { - return null; - } - const d = new Date(val); - if (isNaN(d.valueOf())) { - return invalidValue(l("Date"), val, key, parent); - } - return d; - } - - function transformObject(props: { [k: string]: any }, additional: any, val: any): any { - if (val === null || typeof val !== "object" || Array.isArray(val)) { - return invalidValue(l(ref || "object"), val, key, parent); - } - const result: any = {}; - Object.getOwnPropertyNames(props).forEach(key => { - const prop = props[key]; - const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; - result[prop.key] = transform(v, prop.typ, getProps, key, ref); - }); - Object.getOwnPropertyNames(val).forEach(key => { - if (!Object.prototype.hasOwnProperty.call(props, key)) { - result[key] = transform(val[key], additional, getProps, key, ref); - } - }); - return result; - } - - if (typ === "any") return val; - if (typ === null) { - if (val === null) return val; - return invalidValue(typ, val, key, parent); - } - if (typ === false) return invalidValue(typ, val, key, parent); - let ref: any = undefined; - while (typeof typ === "object" && typ.ref !== undefined) { - ref = typ.ref; - typ = typeMap[typ.ref]; - } - if (Array.isArray(typ)) return transformEnum(typ, val); - if (typeof typ === "object") { - return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) - : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) - : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) - : invalidValue(typ, val, key, parent); - } - // Numbers can be parsed by Date but shouldn't be. - if (typ === Date && typeof val !== "number") return transformDate(val); - return transformPrimitive(typ, val); -} - -function cast(val: any, typ: any): T { - return transform(val, typ, jsonToJSProps); -} - -function uncast(val: T, typ: any): any { - return transform(val, typ, jsToJSONProps); -} - -function l(typ: any) { - return { literal: typ }; -} - -function a(typ: any) { - return { arrayItems: typ }; -} - -function u(...typs: any[]) { - return { unionMembers: typs }; -} - -function o(props: any[], additional: any) { - return { props, additional }; -} - -function m(additional: any) { - return { props: [], additional }; -} - -function r(name: string) { - return { ref: name }; -} - -const typeMap: any = { - "WebConnectionProtocol1Hello": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: r("WebConnectionProtocol1HelloPayload") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol1HelloType") }, - ], false), - "ConnectionStepMetadata": o([ - { json: "connectionAttemptUuid", js: "connectionAttemptUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "WebConnectionProtocol1HelloPayload": o([ - { json: "channelSelector", js: "channelSelector", typ: u(undefined, true) }, - { json: "fdc3Version", js: "fdc3Version", typ: "" }, - { json: "identityUrl", js: "identityUrl", typ: "" }, - { json: "resolver", js: "resolver", typ: u(undefined, true) }, - ], "any"), - "WebConnectionProtocol2LoadURL": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: r("WebConnectionProtocol2LoadURLPayload") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol2LoadURLType") }, - ], false), - "WebConnectionProtocol2LoadURLPayload": o([ - { json: "iframeUrl", js: "iframeUrl", typ: "" }, - ], "any"), - "WebConnectionProtocol3Handshake": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: r("WebConnectionProtocol3HandshakePayload") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol3HandshakeType") }, - ], false), - "WebConnectionProtocol3HandshakePayload": o([ - { json: "channelSelector", js: "channelSelector", typ: u(true, "") }, - { json: "fdc3Version", js: "fdc3Version", typ: "" }, - { json: "resolver", js: "resolver", typ: u(true, "") }, - ], false), - "WebConnectionProtocol4ValidateAppIdentity": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: r("WebConnectionProtocol4ValidateAppIdentityPayload") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol4ValidateAppIdentityType") }, - ], false), - "WebConnectionProtocol4ValidateAppIdentityPayload": o([ - { json: "identityUrl", js: "identityUrl", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - { json: "instanceUuid", js: "instanceUuid", typ: u(undefined, "") }, - ], false), - "WebConnectionProtocol5ValidateAppIdentityFailedResponse": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: r("WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol5ValidateAppIdentityFailedResponseType") }, - ], false), - "WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload": o([ - { json: "message", js: "message", typ: u(undefined, "") }, - ], false), - "WebConnectionProtocol5ValidateAppIdentitySuccessResponse": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: r("WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol5ValidateAppIdentitySuccessResponseType") }, - ], false), - "WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "implementationMetadata", js: "implementationMetadata", typ: r("ImplementationMetadata") }, - { json: "instanceId", js: "instanceId", typ: "" }, - { json: "instanceUuid", js: "instanceUuid", typ: "" }, - ], false), - "ImplementationMetadata": o([ - { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, - { json: "fdc3Version", js: "fdc3Version", typ: "" }, - { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, - { json: "provider", js: "provider", typ: "" }, - { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, - ], false), - "AppMetadata": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "description", js: "description", typ: u(undefined, "") }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "icons", js: "icons", typ: u(undefined, a(r("Icon"))) }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - { json: "instanceMetadata", js: "instanceMetadata", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "resultType", js: "resultType", typ: u(undefined, u(null, "")) }, - { json: "screenshots", js: "screenshots", typ: u(undefined, a(r("Image"))) }, - { json: "title", js: "title", typ: u(undefined, "") }, - { json: "tooltip", js: "tooltip", typ: u(undefined, "") }, - { json: "version", js: "version", typ: u(undefined, "") }, - ], false), - "Icon": o([ - { json: "size", js: "size", typ: u(undefined, "") }, - { json: "src", js: "src", typ: "" }, - { json: "type", js: "type", typ: u(undefined, "") }, - ], false), - "Image": o([ - { json: "label", js: "label", typ: u(undefined, "") }, - { json: "size", js: "size", typ: u(undefined, "") }, - { json: "src", js: "src", typ: "" }, - { json: "type", js: "type", typ: u(undefined, "") }, - ], false), - "OptionalFeatures": o([ - { json: "DesktopAgentBridging", js: "DesktopAgentBridging", typ: true }, - { json: "OriginatingAppMetadata", js: "OriginatingAppMetadata", typ: true }, - { json: "UserChannelMembershipAPIs", js: "UserChannelMembershipAPIs", typ: true }, - ], false), - "WebConnectionProtocol6Goodbye": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("WebConnectionProtocol6GoodbyeType") }, - ], false), - "WebConnectionProtocolMessage": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("ConnectionStepMessageType") }, - ], false), - "AddContextListenerRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("AddContextListenerRequestPayload") }, - { json: "type", js: "type", typ: r("AddContextListenerRequestType") }, - ], false), - "AddContextListenerRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "AppIdentifier": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "AddContextListenerRequestPayload": o([ - { json: "channelId", js: "channelId", typ: u(null, "") }, - { json: "contextType", js: "contextType", typ: u(null, "") }, - ], false), - "AddContextListenerResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("AddContextListenerResponsePayload") }, - { json: "type", js: "type", typ: r("AddContextListenerResponseType") }, - ], false), - "AddContextListenerResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "AddContextListenerResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, - ], false), - "AddEventListenerEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("AddEventListenerEventPayload") }, - { json: "type", js: "type", typ: r("AddEventListenerEventType") }, - ], false), - "AddEventListenerEventMeta": o([ - { json: "eventUuid", js: "eventUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "AddEventListenerEventPayload": o([ - { json: "event", js: "event", typ: r("FDC3Event") }, - ], false), - "FDC3Event": o([ - { json: "details", js: "details", typ: m("any") }, - { json: "type", js: "type", typ: r("FDC3EventType") }, - ], false), - "AddEventListenerRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("AddEventListenerRequestPayload") }, - { json: "type", js: "type", typ: r("AddEventListenerRequestType") }, - ], false), - "AddEventListenerRequestPayload": o([ - { json: "type", js: "type", typ: r("FDC3EventType") }, - ], false), - "AddEventListenerResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("AddEventListenerResponsePayload") }, - { json: "type", js: "type", typ: r("AddEventListenerResponseType") }, - ], false), - "AddEventListenerResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, - { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, - ], false), - "AddIntentListenerRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("AddIntentListenerRequestPayload") }, - { json: "type", js: "type", typ: r("AddIntentListenerRequestType") }, - ], false), - "AddIntentListenerRequestPayload": o([ - { json: "intent", js: "intent", typ: "" }, - ], false), - "AddIntentListenerResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("AddIntentListenerResponsePayload") }, - { json: "type", js: "type", typ: r("AddIntentListenerResponseType") }, - ], false), - "AddIntentListenerResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FluffyError")) }, - { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, - ], "any"), - "AgentEventMessage": o([ - { json: "meta", js: "meta", typ: r("AgentEventMessageMeta") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("EventMessageType") }, - ], false), - "AgentEventMessageMeta": o([ - { json: "eventUuid", js: "eventUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "AgentResponseMessage": o([ - { json: "meta", js: "meta", typ: r("AgentResponseMessageMeta") }, - { json: "payload", js: "payload", typ: r("AgentResponseMessageResponsePayload") }, - { json: "type", js: "type", typ: r("ResponseMessageType") }, - ], false), - "AgentResponseMessageMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "AgentResponseMessageResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, - ], "any"), - "AppRequestMessage": o([ - { json: "meta", js: "meta", typ: r("AppRequestMessageMeta") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("RequestMessageType") }, - ], false), - "AppRequestMessageMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "BroadcastEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastEventPayload") }, - { json: "type", js: "type", typ: r("BroadcastEventType") }, - ], false), - "BroadcastEventPayload": o([ - { json: "channelId", js: "channelId", typ: u(null, "") }, - { json: "context", js: "context", typ: r("Context") }, - { json: "originatingApp", js: "originatingApp", typ: u(undefined, r("AppIdentifier")) }, - ], false), - "Context": o([ - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: "" }, - ], "any"), - "BroadcastRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastRequestPayload") }, - { json: "type", js: "type", typ: r("BroadcastRequestType") }, - ], false), - "BroadcastRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "BroadcastResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, - { json: "type", js: "type", typ: r("BroadcastResponseType") }, - ], false), - "BroadcastResponseResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, - ], "any"), - "ChannelChangedEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("ChannelChangedEventPayload") }, - { json: "type", js: "type", typ: r("ChannelChangedEventType") }, - ], false), - "ChannelChangedEventPayload": o([ - { json: "newChannelId", js: "newChannelId", typ: u(null, "") }, - ], false), - "ContextListenerUnsubscribeRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("ContextListenerUnsubscribeRequestPayload") }, - { json: "type", js: "type", typ: r("ContextListenerUnsubscribeRequestType") }, - ], false), - "ContextListenerUnsubscribeRequestPayload": o([ - { json: "listenerUUID", js: "listenerUUID", typ: "" }, - ], false), - "ContextListenerUnsubscribeResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, - { json: "type", js: "type", typ: r("ContextListenerUnsubscribeResponseType") }, - ], false), - "CreatePrivateChannelRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("CreatePrivateChannelRequestPayload") }, - { json: "type", js: "type", typ: r("CreatePrivateChannelRequestType") }, - ], false), - "CreatePrivateChannelRequestPayload": o([ - ], false), - "CreatePrivateChannelResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("CreatePrivateChannelResponsePayload") }, - { json: "type", js: "type", typ: r("CreatePrivateChannelResponseType") }, - ], false), - "CreatePrivateChannelResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - { json: "privateChannel", js: "privateChannel", typ: u(undefined, r("Channel")) }, - ], false), - "Channel": o([ - { json: "displayMetadata", js: "displayMetadata", typ: u(undefined, r("DisplayMetadata")) }, - { json: "id", js: "id", typ: "" }, - { json: "type", js: "type", typ: r("Type") }, - ], false), - "DisplayMetadata": o([ - { json: "color", js: "color", typ: u(undefined, "") }, - { json: "glyph", js: "glyph", typ: u(undefined, "") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], false), - "EventListenerUnsubscribeRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("EventListenerUnsubscribeRequestPayload") }, - { json: "type", js: "type", typ: r("EventListenerUnsubscribeRequestType") }, - ], false), - "EventListenerUnsubscribeRequestPayload": o([ - { json: "listenerUUID", js: "listenerUUID", typ: "" }, - ], false), - "EventListenerUnsubscribeResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, - { json: "type", js: "type", typ: r("EventListenerUnsubscribeResponseType") }, - ], false), - "FindInstancesRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindInstancesRequestPayload") }, - { json: "type", js: "type", typ: r("FindInstancesRequestType") }, - ], false), - "FindInstancesRequestPayload": o([ - { json: "app", js: "app", typ: r("AppIdentifier") }, - ], false), - "FindInstancesResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindInstancesResponsePayload") }, - { json: "type", js: "type", typ: r("FindInstancesResponseType") }, - ], false), - "FindInstancesResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, - { json: "appIdentifiers", js: "appIdentifiers", typ: u(undefined, a(r("AppMetadata"))) }, - ], false), - "FindIntentRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentRequestPayload") }, - { json: "type", js: "type", typ: r("FindIntentRequestType") }, - ], false), - "FindIntentRequestPayload": o([ - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - { json: "intent", js: "intent", typ: "" }, - { json: "resultType", js: "resultType", typ: u(undefined, "") }, - ], false), - "FindIntentResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentResponseType") }, - ], false), - "FindIntentResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, - { json: "appIntent", js: "appIntent", typ: u(undefined, r("AppIntent")) }, - ], false), - "AppIntent": o([ - { json: "apps", js: "apps", typ: a(r("AppMetadata")) }, - { json: "intent", js: "intent", typ: r("IntentMetadata") }, - ], false), - "IntentMetadata": o([ - { json: "displayName", js: "displayName", typ: u(undefined, "") }, - { json: "name", js: "name", typ: "" }, - ], false), - "FindIntentsByContextRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextRequestPayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextRequestType") }, - ], false), - "FindIntentsByContextRequestPayload": o([ - { json: "context", js: "context", typ: r("Context") }, - { json: "resultType", js: "resultType", typ: u(undefined, "") }, - ], false), - "FindIntentsByContextResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextResponseType") }, - ], false), - "FindIntentsByContextResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, - { json: "appIntents", js: "appIntents", typ: u(undefined, a(r("AppIntent"))) }, - ], false), - "GetAppMetadataRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataRequestPayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataRequestType") }, - ], false), - "GetAppMetadataRequestPayload": o([ - { json: "app", js: "app", typ: r("AppIdentifier") }, - ], false), - "GetAppMetadataResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataResponsePayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataResponseType") }, - ], false), - "GetAppMetadataResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, - { json: "appMetadata", js: "appMetadata", typ: u(undefined, r("AppMetadata")) }, - ], false), - "GetCurrentChannelRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetCurrentChannelRequestPayload") }, - { json: "type", js: "type", typ: r("GetCurrentChannelRequestType") }, - ], false), - "GetCurrentChannelRequestPayload": o([ - ], false), - "GetCurrentChannelResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetCurrentChannelResponsePayload") }, - { json: "type", js: "type", typ: r("GetCurrentChannelResponseType") }, - ], false), - "GetCurrentChannelResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, - { json: "channel", js: "channel", typ: u(undefined, u(r("Channel"), null)) }, - ], false), - "GetCurrentContextRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetCurrentContextRequestPayload") }, - { json: "type", js: "type", typ: r("GetCurrentContextRequestType") }, - ], false), - "GetCurrentContextRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "contextType", js: "contextType", typ: u(null, "") }, - ], false), - "GetCurrentContextResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetCurrentContextResponsePayload") }, - { json: "type", js: "type", typ: r("GetCurrentContextResponseType") }, - ], false), - "GetCurrentContextResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - { json: "context", js: "context", typ: u(undefined, u(null, r("Context"))) }, - ], false), - "GetInfoRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetInfoRequestPayload") }, - { json: "type", js: "type", typ: r("GetInfoRequestType") }, - ], false), - "GetInfoRequestPayload": o([ - ], false), - "GetInfoResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetInfoResponsePayload") }, - { json: "type", js: "type", typ: r("GetInfoResponseType") }, - ], false), - "GetInfoResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, - { json: "implementationMetadata", js: "implementationMetadata", typ: u(undefined, r("ImplementationMetadata")) }, - ], false), - "GetOrCreateChannelRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetOrCreateChannelRequestPayload") }, - { json: "type", js: "type", typ: r("GetOrCreateChannelRequestType") }, - ], false), - "GetOrCreateChannelRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - ], false), - "GetOrCreateChannelResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetOrCreateChannelResponsePayload") }, - { json: "type", js: "type", typ: r("GetOrCreateChannelResponseType") }, - ], false), - "GetOrCreateChannelResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, - ], false), - "GetUserChannelsRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetUserChannelsRequestPayload") }, - { json: "type", js: "type", typ: r("GetUserChannelsRequestType") }, - ], false), - "GetUserChannelsRequestPayload": o([ - ], false), - "GetUserChannelsResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetUserChannelsResponsePayload") }, - { json: "type", js: "type", typ: r("GetUserChannelsResponseType") }, - ], false), - "GetUserChannelsResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - { json: "userChannels", js: "userChannels", typ: u(undefined, a(r("Channel"))) }, - ], false), - "IframeChannelDrag": o([ - { json: "payload", js: "payload", typ: r("IframeChannelDragPayload") }, - { json: "type", js: "type", typ: r("IframeChannelDragType") }, - ], false), - "IframeChannelDragPayload": o([ - { json: "mouse", js: "mouse", typ: r("MouseClass") }, - ], false), - "MouseClass": o([ - { json: "offsetX", js: "offsetX", typ: 0 }, - { json: "offsetY", js: "offsetY", typ: 0 }, - ], false), - "IframeChannelResize": o([ - { json: "payload", js: "payload", typ: r("IframeChannelResizePayload") }, - { json: "type", js: "type", typ: r("IframeChannelResizeType") }, - ], false), - "IframeChannelResizePayload": o([ - { json: "dimensions", js: "dimensions", typ: r("DimensionsClass") }, - { json: "resizeAnchor", js: "resizeAnchor", typ: r("Resizing") }, - ], false), - "DimensionsClass": o([ - { json: "height", js: "height", typ: 0 }, - { json: "width", js: "width", typ: 0 }, - ], false), - "IframeChannelSelected": o([ - { json: "payload", js: "payload", typ: r("IframeChannelSelectedPayload") }, - { json: "type", js: "type", typ: r("IframeChannelSelectedType") }, - ], false), - "IframeChannelSelectedPayload": o([ - { json: "selected", js: "selected", typ: u(null, "") }, - ], false), - "IframeChannels": o([ - { json: "payload", js: "payload", typ: r("IframeChannelsPayload") }, - { json: "type", js: "type", typ: r("IframeChannelsType") }, - ], false), - "IframeChannelsPayload": o([ - { json: "location", js: "location", typ: u(undefined, r("Location")) }, - { json: "selected", js: "selected", typ: u(null, "") }, - { json: "userChannels", js: "userChannels", typ: a(r("Channel")) }, - ], false), - "Location": o([ - { json: "x", js: "x", typ: 0 }, - { json: "y", js: "y", typ: 0 }, - ], false), - "IframeHandshake": o([ - { json: "payload", js: "payload", typ: r("IframeHandshakePayload") }, - { json: "type", js: "type", typ: r("IframeHandshakeType") }, - ], false), - "IframeHandshakePayload": o([ - { json: "implementationDetails", js: "implementationDetails", typ: "" }, - ], false), - "IframeHello": o([ - { json: "payload", js: "payload", typ: r("IframeHelloPayload") }, - { json: "type", js: "type", typ: r("IframeHelloType") }, - ], false), - "IframeHelloPayload": o([ - { json: "fdc3Version", js: "fdc3Version", typ: "" }, - ], false), - "IframeMessage": o([ - { json: "payload", js: "payload", typ: u(undefined, m("any")) }, - { json: "type", js: "type", typ: r("IframeMessageType") }, - ], false), - "IframeResolve": o([ - { json: "payload", js: "payload", typ: r("IframeResolvePayload") }, - { json: "type", js: "type", typ: r("IframeResolveType") }, - ], false), - "IframeResolvePayload": o([ - { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "IframeResolveAction": o([ - { json: "payload", js: "payload", typ: r("IframeResolveActionPayload") }, - { json: "type", js: "type", typ: r("IframeResolveActionType") }, - ], false), - "IframeResolveActionPayload": o([ - { json: "action", js: "action", typ: r("Action") }, - { json: "appIdentifier", js: "appIdentifier", typ: u(undefined, r("AppIdentifier")) }, - { json: "intent", js: "intent", typ: u(undefined, "") }, - ], false), - "IntentEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("IntentEventPayload") }, - { json: "type", js: "type", typ: r("IntentEventType") }, - ], false), - "IntentEventPayload": o([ - { json: "context", js: "context", typ: r("Context") }, - { json: "intent", js: "intent", typ: "" }, - { json: "originatingApp", js: "originatingApp", typ: u(undefined, r("AppIdentifier")) }, - ], false), - "IntentListenerUnsubscribeRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("IntentListenerUnsubscribeRequestPayload") }, - { json: "type", js: "type", typ: r("IntentListenerUnsubscribeRequestType") }, - ], false), - "IntentListenerUnsubscribeRequestPayload": o([ - { json: "listenerUUID", js: "listenerUUID", typ: "" }, - ], false), - "IntentListenerUnsubscribeResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, - { json: "type", js: "type", typ: r("IntentListenerUnsubscribeResponseType") }, - ], false), - "IntentResultRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("IntentResultRequestPayload") }, - { json: "type", js: "type", typ: r("IntentResultRequestType") }, - ], false), - "IntentResultRequestPayload": o([ - { json: "intentResult", js: "intentResult", typ: r("PurpleIntentResult") }, - ], false), - "PurpleIntentResult": o([ - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, - ], false), - "IntentResultResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, - { json: "type", js: "type", typ: r("IntentResultResponseType") }, - ], false), - "JoinUserChannelRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("JoinUserChannelRequestPayload") }, - { json: "type", js: "type", typ: r("JoinUserChannelRequestType") }, - ], false), - "JoinUserChannelRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - ], false), - "JoinUserChannelResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("JoinUserChannelResponsePayload") }, - { json: "type", js: "type", typ: r("JoinUserChannelResponseType") }, - ], false), - "JoinUserChannelResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - ], false), - "LeaveCurrentChannelRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("LeaveCurrentChannelRequestPayload") }, - { json: "type", js: "type", typ: r("LeaveCurrentChannelRequestType") }, - ], false), - "LeaveCurrentChannelRequestPayload": o([ - ], false), - "LeaveCurrentChannelResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("LeaveCurrentChannelResponsePayload") }, - { json: "type", js: "type", typ: r("LeaveCurrentChannelResponseType") }, - ], false), - "LeaveCurrentChannelResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - ], false), - "OpenRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("OpenRequestPayload") }, - { json: "type", js: "type", typ: r("OpenRequestType") }, - ], false), - "OpenRequestPayload": o([ - { json: "app", js: "app", typ: r("AppIdentifier") }, - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - ], false), - "OpenResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("OpenResponsePayload") }, - { json: "type", js: "type", typ: r("OpenResponseType") }, - ], false), - "OpenResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("OpenErrorResponsePayload")) }, - { json: "appIdentifier", js: "appIdentifier", typ: u(undefined, r("AppIdentifier")) }, - ], false), - "PrivateChannelDisconnectRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelDisconnectRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelDisconnectRequestType") }, - ], false), - "PrivateChannelDisconnectRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - ], false), - "PrivateChannelDisconnectResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelDisconnectResponsePayload") }, - { json: "type", js: "type", typ: r("PrivateChannelDisconnectResponseType") }, - ], false), - "PrivateChannelDisconnectResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - ], false), - "PrivateChannelOnAddContextListenerEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerEventPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerEventType") }, - ], false), - "PrivateChannelOnAddContextListenerEventPayload": o([ - { json: "contextType", js: "contextType", typ: u(null, "") }, - { json: "privateChannelId", js: "privateChannelId", typ: "" }, - ], false), - "PrivateChannelOnDisconnectEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectEventPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectEventType") }, - ], false), - "PrivateChannelOnDisconnectEventPayload": o([ - { json: "privateChannelId", js: "privateChannelId", typ: "" }, - ], false), - "PrivateChannelOnUnsubscribeEvent": o([ - { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeEventPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeEventType") }, - ], false), - "PrivateChannelOnUnsubscribeEventPayload": o([ - { json: "contextType", js: "contextType", typ: u(null, "") }, - { json: "privateChannelId", js: "privateChannelId", typ: "" }, - ], false), - "PrivateChannelUnsubscribeEventListenerRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelUnsubscribeEventListenerRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelUnsubscribeEventListenerRequestType") }, - ], false), - "PrivateChannelUnsubscribeEventListenerRequestPayload": o([ - { json: "listenerUUID", js: "listenerUUID", typ: "" }, - ], false), - "PrivateChannelUnsubscribeEventListenerResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, - { json: "type", js: "type", typ: r("PrivateChannelUnsubscribeEventListenerResponseType") }, - ], false), - "PrivateChannelAddEventListenerRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("TPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelAddEventListenerRequestType") }, - ], false), - "TPayload": o([ - { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, - { json: "privateChannelId", js: "privateChannelId", typ: "" }, - ], false), - "PrivateChannelAddEventListenerResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelAddEventListenerResponsePayload") }, - { json: "type", js: "type", typ: r("PrivateChannelAddEventListenerResponseType") }, - ], false), - "PrivateChannelAddEventListenerResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, - { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, - ], "any"), - "RaiseIntentForContextRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentForContextRequestPayload") }, - { json: "type", js: "type", typ: r("RaiseIntentForContextRequestType") }, - ], false), - "RaiseIntentForContextRequestPayload": o([ - { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "RaiseIntentForContextResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentForContextResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentForContextResponseType") }, - ], false), - "RaiseIntentForContextResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, - { json: "intentResolution", js: "intentResolution", typ: u(undefined, r("IntentResolution")) }, - { json: "appIntents", js: "appIntents", typ: u(undefined, a(r("AppIntent"))) }, - ], false), - "IntentResolution": o([ - { json: "intent", js: "intent", typ: "" }, - { json: "source", js: "source", typ: r("AppIdentifier") }, - ], false), - "RaiseIntentRequest": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentRequestPayload") }, - { json: "type", js: "type", typ: r("RaiseIntentRequestType") }, - ], false), - "RaiseIntentRequestPayload": o([ - { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, - { json: "context", js: "context", typ: r("Context") }, - { json: "intent", js: "intent", typ: "" }, - ], false), - "RaiseIntentResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentResponseType") }, - ], false), - "RaiseIntentResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, - { json: "intentResolution", js: "intentResolution", typ: u(undefined, r("IntentResolution")) }, - { json: "appIntent", js: "appIntent", typ: u(undefined, r("AppIntent")) }, - ], false), - "RaiseIntentResultResponse": o([ - { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentResultResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentResultResponseType") }, - ], false), - "RaiseIntentResultResponsePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, - { json: "intentResult", js: "intentResult", typ: u(undefined, r("FluffyIntentResult")) }, - ], false), - "FluffyIntentResult": o([ - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, - ], false), - "WebConnectionProtocol1HelloType": [ - "WCP1Hello", - ], - "WebConnectionProtocol2LoadURLType": [ - "WCP2LoadUrl", - ], - "WebConnectionProtocol3HandshakeType": [ - "WCP3Handshake", - ], - "WebConnectionProtocol4ValidateAppIdentityType": [ - "WCP4ValidateAppIdentity", - ], - "WebConnectionProtocol5ValidateAppIdentityFailedResponseType": [ - "WCP5ValidateAppIdentityFailedResponse", - ], - "WebConnectionProtocol5ValidateAppIdentitySuccessResponseType": [ - "WCP5ValidateAppIdentityResponse", - ], - "WebConnectionProtocol6GoodbyeType": [ - "WCP6Goodbye", - ], - "ConnectionStepMessageType": [ - "WCP1Hello", - "WCP2LoadUrl", - "WCP3Handshake", - "WCP4ValidateAppIdentity", - "WCP5ValidateAppIdentityFailedResponse", - "WCP5ValidateAppIdentityResponse", - "WCP6Goodbye", - ], - "AddContextListenerRequestType": [ - "addContextListenerRequest", - ], - "PurpleError": [ - "AccessDenied", - "CreationFailed", - "MalformedContext", - "NoChannelFound", - ], - "AddContextListenerResponseType": [ - "addContextListenerResponse", - ], - "FDC3EventType": [ - "USER_CHANNEL_CHANGED", - ], - "AddEventListenerEventType": [ - "addEventListenerEvent", - ], - "AddEventListenerRequestType": [ - "addEventListenerRequest", - ], - "ResponsePayloadError": [ - "AccessDenied", - "AgentDisconnected", - "AppNotFound", - "AppTimeout", - "CreationFailed", - "DesktopAgentNotFound", - "ErrorOnLaunch", - "IntentDeliveryFailed", - "IntentHandlerRejected", - "MalformedContext", - "MalformedMessage", - "NoAppsFound", - "NoChannelFound", - "NoResultReturned", - "NotConnectedToBridge", - "ResolverTimeout", - "ResolverUnavailable", - "ResponseToBridgeTimedOut", - "TargetAppUnavailable", - "TargetInstanceUnavailable", - "UserCancelledResolution", - ], - "AddEventListenerResponseType": [ - "addEventListenerResponse", - ], - "AddIntentListenerRequestType": [ - "addIntentListenerRequest", - ], - "FluffyError": [ - "DesktopAgentNotFound", - "IntentDeliveryFailed", - "MalformedContext", - "NoAppsFound", - "ResolverTimeout", - "ResolverUnavailable", - "TargetAppUnavailable", - "TargetInstanceUnavailable", - "UserCancelledResolution", - ], - "AddIntentListenerResponseType": [ - "addIntentListenerResponse", - ], - "EventMessageType": [ - "addEventListenerEvent", - "broadcastEvent", - "channelChangedEvent", - "intentEvent", - "privateChannelOnAddContextListenerEvent", - "privateChannelOnDisconnectEvent", - "privateChannelOnUnsubscribeEvent", - ], - "ResponseMessageType": [ - "addContextListenerResponse", - "addEventListenerResponse", - "addIntentListenerResponse", - "broadcastResponse", - "contextListenerUnsubscribeResponse", - "createPrivateChannelResponse", - "eventListenerUnsubscribeResponse", - "findInstancesResponse", - "findIntentResponse", - "findIntentsByContextResponse", - "getAppMetadataResponse", - "getCurrentChannelResponse", - "getCurrentContextResponse", - "getInfoResponse", - "getOrCreateChannelResponse", - "getUserChannelsResponse", - "intentListenerUnsubscribeResponse", - "intentResultResponse", - "joinUserChannelResponse", - "leaveCurrentChannelResponse", - "openResponse", - "privateChannelAddEventListenerResponse", - "privateChannelDisconnectResponse", - "privateChannelUnsubscribeEventListenerResponse", - "raiseIntentForContextResponse", - "raiseIntentResponse", - "raiseIntentResultResponse", - ], - "RequestMessageType": [ - "addContextListenerRequest", - "addEventListenerRequest", - "addIntentListenerRequest", - "broadcastRequest", - "contextListenerUnsubscribeRequest", - "createPrivateChannelRequest", - "eventListenerUnsubscribeRequest", - "findInstancesRequest", - "findIntentRequest", - "findIntentsByContextRequest", - "getAppMetadataRequest", - "getCurrentChannelRequest", - "getCurrentContextRequest", - "getInfoRequest", - "getOrCreateChannelRequest", - "getUserChannelsRequest", - "intentListenerUnsubscribeRequest", - "intentResultRequest", - "joinUserChannelRequest", - "leaveCurrentChannelRequest", - "openRequest", - "privateChannelAddEventListenerRequest", - "privateChannelDisconnectRequest", - "privateChannelUnsubscribeEventListenerRequest", - "raiseIntentForContextRequest", - "raiseIntentRequest", - ], - "BroadcastEventType": [ - "broadcastEvent", - ], - "BroadcastRequestType": [ - "broadcastRequest", - ], - "BroadcastResponseType": [ - "broadcastResponse", - ], - "ChannelChangedEventType": [ - "channelChangedEvent", - ], - "ContextListenerUnsubscribeRequestType": [ - "contextListenerUnsubscribeRequest", - ], - "ContextListenerUnsubscribeResponseType": [ - "contextListenerUnsubscribeResponse", - ], - "CreatePrivateChannelRequestType": [ - "createPrivateChannelRequest", - ], - "Type": [ - "app", - "private", - "user", - ], - "CreatePrivateChannelResponseType": [ - "createPrivateChannelResponse", - ], - "EventListenerUnsubscribeRequestType": [ - "eventListenerUnsubscribeRequest", - ], - "EventListenerUnsubscribeResponseType": [ - "eventListenerUnsubscribeResponse", - ], - "FindInstancesRequestType": [ - "findInstancesRequest", - ], - "FindInstancesErrors": [ - "AgentDisconnected", - "DesktopAgentNotFound", - "IntentDeliveryFailed", - "MalformedContext", - "MalformedMessage", - "NoAppsFound", - "NotConnectedToBridge", - "ResolverTimeout", - "ResolverUnavailable", - "ResponseToBridgeTimedOut", - "TargetAppUnavailable", - "TargetInstanceUnavailable", - "UserCancelledResolution", - ], - "FindInstancesResponseType": [ - "findInstancesResponse", - ], - "FindIntentRequestType": [ - "findIntentRequest", - ], - "FindIntentResponseType": [ - "findIntentResponse", - ], - "FindIntentsByContextRequestType": [ - "findIntentsByContextRequest", - ], - "FindIntentsByContextResponseType": [ - "findIntentsByContextResponse", - ], - "GetAppMetadataRequestType": [ - "getAppMetadataRequest", - ], - "GetAppMetadataResponseType": [ - "getAppMetadataResponse", - ], - "GetCurrentChannelRequestType": [ - "getCurrentChannelRequest", - ], - "GetCurrentChannelResponseType": [ - "getCurrentChannelResponse", - ], - "GetCurrentContextRequestType": [ - "getCurrentContextRequest", - ], - "GetCurrentContextResponseType": [ - "getCurrentContextResponse", - ], - "GetInfoRequestType": [ - "getInfoRequest", - ], - "GetInfoResponseType": [ - "getInfoResponse", - ], - "GetOrCreateChannelRequestType": [ - "getOrCreateChannelRequest", - ], - "GetOrCreateChannelResponseType": [ - "getOrCreateChannelResponse", - ], - "GetUserChannelsRequestType": [ - "getUserChannelsRequest", - ], - "GetUserChannelsResponseType": [ - "getUserChannelsResponse", - ], - "IframeChannelDragType": [ - "iframeChannelDrag", - ], - "Resizing": [ - "bottom", - "bottom-left", - "bottom-right", - "center", - "left", - "right", - "top", - "top-left", - "top-right", - ], - "IframeChannelResizeType": [ - "iframeChannelResize", - ], - "IframeChannelSelectedType": [ - "iframeChannelSelected", - ], - "IframeChannelsType": [ - "iframeChannels", - ], - "IframeHandshakeType": [ - "iframeHandshake", - ], - "IframeHelloType": [ - "iframeHello", - ], - "IframeMessageType": [ - "iframeChannelDrag", - "iframeChannelResize", - "iframeChannelSelected", - "iframeChannels", - "iframeHandshake", - "iframeHello", - "iframeResolve", - "iframeResolveAction", - ], - "IframeResolveType": [ - "iframeResolve", - ], - "Action": [ - "cancel", - "click", - "hover", - ], - "IframeResolveActionType": [ - "iframeResolveAction", - ], - "IntentEventType": [ - "intentEvent", - ], - "IntentListenerUnsubscribeRequestType": [ - "intentListenerUnsubscribeRequest", - ], - "IntentListenerUnsubscribeResponseType": [ - "intentListenerUnsubscribeResponse", - ], - "IntentResultRequestType": [ - "intentResultRequest", - ], - "IntentResultResponseType": [ - "intentResultResponse", - ], - "JoinUserChannelRequestType": [ - "joinUserChannelRequest", - ], - "JoinUserChannelResponseType": [ - "joinUserChannelResponse", - ], - "LeaveCurrentChannelRequestType": [ - "leaveCurrentChannelRequest", - ], - "LeaveCurrentChannelResponseType": [ - "leaveCurrentChannelResponse", - ], - "OpenRequestType": [ - "openRequest", - ], - "OpenErrorResponsePayload": [ - "AgentDisconnected", - "AppNotFound", - "AppTimeout", - "DesktopAgentNotFound", - "ErrorOnLaunch", - "MalformedContext", - "MalformedMessage", - "NotConnectedToBridge", - "ResolverUnavailable", - "ResponseToBridgeTimedOut", - ], - "OpenResponseType": [ - "openResponse", - ], - "PrivateChannelDisconnectRequestType": [ - "privateChannelDisconnectRequest", - ], - "PrivateChannelDisconnectResponseType": [ - "privateChannelDisconnectResponse", - ], - "PrivateChannelOnAddContextListenerEventType": [ - "privateChannelOnAddContextListenerEvent", - ], - "PrivateChannelOnDisconnectEventType": [ - "privateChannelOnDisconnectEvent", - ], - "PrivateChannelOnUnsubscribeEventType": [ - "privateChannelOnUnsubscribeEvent", - ], - "PrivateChannelUnsubscribeEventListenerRequestType": [ - "privateChannelUnsubscribeEventListenerRequest", - ], - "PrivateChannelUnsubscribeEventListenerResponseType": [ - "privateChannelUnsubscribeEventListenerResponse", - ], - "PrivateChannelEventListenerTypes": [ - "onAddContextListener", - "onDisconnect", - "onUnsubscribe", - ], - "PrivateChannelAddEventListenerRequestType": [ - "privateChannelAddEventListenerRequest", - ], - "PrivateChannelAddEventListenerResponseType": [ - "privateChannelAddEventListenerResponse", - ], - "RaiseIntentForContextRequestType": [ - "raiseIntentForContextRequest", - ], - "RaiseIntentForContextResponseType": [ - "raiseIntentForContextResponse", - ], - "RaiseIntentRequestType": [ - "raiseIntentRequest", - ], - "RaiseIntentResponseType": [ - "raiseIntentResponse", - ], - "RaiseIntentResultResponseType": [ - "raiseIntentResultResponse", - ], -}; diff --git a/packages/fdc3-schema/generated/bridging/BridgingTypes.ts b/packages/fdc3-schema/generated/bridging/BridgingTypes.ts deleted file mode 100644 index ec0a3b481..000000000 --- a/packages/fdc3-schema/generated/bridging/BridgingTypes.ts +++ /dev/null @@ -1,6058 +0,0 @@ -// To parse this data: -// -// import { Convert, AgentErrorResponseMessage, AgentRequestMessage, AgentResponseMessage, BridgeErrorResponseMessage, BridgeRequestMessage, BridgeResponseMessage, BroadcastAgentRequest, BroadcastBridgeRequest, ConnectionStepMessage, ConnectionStep2Hello, ConnectionStep3Handshake, ConnectionStep4AuthenticationFailed, ConnectionStep6ConnectedAgentsUpdate, FindInstancesAgentErrorResponse, FindInstancesAgentRequest, FindInstancesAgentResponse, FindInstancesBridgeErrorResponse, FindInstancesBridgeRequest, FindInstancesBridgeResponse, FindIntentAgentErrorResponse, FindIntentAgentRequest, FindIntentAgentResponse, FindIntentBridgeErrorResponse, FindIntentBridgeRequest, FindIntentBridgeResponse, FindIntentsByContextAgentErrorResponse, FindIntentsByContextAgentRequest, FindIntentsByContextAgentResponse, FindIntentsByContextBridgeErrorResponse, FindIntentsByContextBridgeRequest, FindIntentsByContextBridgeResponse, GetAppMetadataAgentErrorResponse, GetAppMetadataAgentRequest, GetAppMetadataAgentResponse, GetAppMetadataBridgeErrorResponse, GetAppMetadataBridgeRequest, GetAppMetadataBridgeResponse, OpenAgentErrorResponse, OpenAgentRequest, OpenAgentResponse, OpenBridgeErrorResponse, OpenBridgeRequest, OpenBridgeResponse, PrivateChannelBroadcastAgentRequest, PrivateChannelBroadcastBridgeRequest, PrivateChannelEventListenerAddedAgentRequest, PrivateChannelEventListenerAddedBridgeRequest, PrivateChannelEventListenerRemovedAgentRequest, PrivateChannelEventListenerRemovedBridgeRequest, PrivateChannelOnAddContextListenerAgentRequest, PrivateChannelOnAddContextListenerBridgeRequest, PrivateChannelOnDisconnectAgentRequest, PrivateChannelOnDisconnectBridgeRequest, PrivateChannelOnUnsubscribeAgentRequest, PrivateChannelOnUnsubscribeBridgeRequest, RaiseIntentAgentErrorResponse, RaiseIntentAgentRequest, RaiseIntentAgentResponse, RaiseIntentBridgeErrorResponse, RaiseIntentBridgeRequest, RaiseIntentBridgeResponse, RaiseIntentResultAgentErrorResponse, RaiseIntentResultAgentResponse, RaiseIntentResultBridgeErrorResponse, RaiseIntentResultBridgeResponse } from "./file"; -// -// const agentErrorResponseMessage = Convert.toAgentErrorResponseMessage(json); -// const agentRequestMessage = Convert.toAgentRequestMessage(json); -// const agentResponseMessage = Convert.toAgentResponseMessage(json); -// const bridgeErrorResponseMessage = Convert.toBridgeErrorResponseMessage(json); -// const bridgeRequestMessage = Convert.toBridgeRequestMessage(json); -// const bridgeResponseMessage = Convert.toBridgeResponseMessage(json); -// const broadcastAgentRequest = Convert.toBroadcastAgentRequest(json); -// const broadcastBridgeRequest = Convert.toBroadcastBridgeRequest(json); -// const bridgeCommonDefinitions = Convert.toBridgeCommonDefinitions(json); -// const connectionStepMessage = Convert.toConnectionStepMessage(json); -// const connectionStep2Hello = Convert.toConnectionStep2Hello(json); -// const connectionStep3Handshake = Convert.toConnectionStep3Handshake(json); -// const connectionStep4AuthenticationFailed = Convert.toConnectionStep4AuthenticationFailed(json); -// const connectionStep6ConnectedAgentsUpdate = Convert.toConnectionStep6ConnectedAgentsUpdate(json); -// const findInstancesAgentErrorResponse = Convert.toFindInstancesAgentErrorResponse(json); -// const findInstancesAgentRequest = Convert.toFindInstancesAgentRequest(json); -// const findInstancesAgentResponse = Convert.toFindInstancesAgentResponse(json); -// const findInstancesBridgeErrorResponse = Convert.toFindInstancesBridgeErrorResponse(json); -// const findInstancesBridgeRequest = Convert.toFindInstancesBridgeRequest(json); -// const findInstancesBridgeResponse = Convert.toFindInstancesBridgeResponse(json); -// const findIntentAgentErrorResponse = Convert.toFindIntentAgentErrorResponse(json); -// const findIntentAgentRequest = Convert.toFindIntentAgentRequest(json); -// const findIntentAgentResponse = Convert.toFindIntentAgentResponse(json); -// const findIntentBridgeErrorResponse = Convert.toFindIntentBridgeErrorResponse(json); -// const findIntentBridgeRequest = Convert.toFindIntentBridgeRequest(json); -// const findIntentBridgeResponse = Convert.toFindIntentBridgeResponse(json); -// const findIntentsByContextAgentErrorResponse = Convert.toFindIntentsByContextAgentErrorResponse(json); -// const findIntentsByContextAgentRequest = Convert.toFindIntentsByContextAgentRequest(json); -// const findIntentsByContextAgentResponse = Convert.toFindIntentsByContextAgentResponse(json); -// const findIntentsByContextBridgeErrorResponse = Convert.toFindIntentsByContextBridgeErrorResponse(json); -// const findIntentsByContextBridgeRequest = Convert.toFindIntentsByContextBridgeRequest(json); -// const findIntentsByContextBridgeResponse = Convert.toFindIntentsByContextBridgeResponse(json); -// const getAppMetadataAgentErrorResponse = Convert.toGetAppMetadataAgentErrorResponse(json); -// const getAppMetadataAgentRequest = Convert.toGetAppMetadataAgentRequest(json); -// const getAppMetadataAgentResponse = Convert.toGetAppMetadataAgentResponse(json); -// const getAppMetadataBridgeErrorResponse = Convert.toGetAppMetadataBridgeErrorResponse(json); -// const getAppMetadataBridgeRequest = Convert.toGetAppMetadataBridgeRequest(json); -// const getAppMetadataBridgeResponse = Convert.toGetAppMetadataBridgeResponse(json); -// const openAgentErrorResponse = Convert.toOpenAgentErrorResponse(json); -// const openAgentRequest = Convert.toOpenAgentRequest(json); -// const openAgentResponse = Convert.toOpenAgentResponse(json); -// const openBridgeErrorResponse = Convert.toOpenBridgeErrorResponse(json); -// const openBridgeRequest = Convert.toOpenBridgeRequest(json); -// const openBridgeResponse = Convert.toOpenBridgeResponse(json); -// const privateChannelBroadcastAgentRequest = Convert.toPrivateChannelBroadcastAgentRequest(json); -// const privateChannelBroadcastBridgeRequest = Convert.toPrivateChannelBroadcastBridgeRequest(json); -// const privateChannelEventListenerAddedAgentRequest = Convert.toPrivateChannelEventListenerAddedAgentRequest(json); -// const privateChannelEventListenerAddedBridgeRequest = Convert.toPrivateChannelEventListenerAddedBridgeRequest(json); -// const privateChannelEventListenerRemovedAgentRequest = Convert.toPrivateChannelEventListenerRemovedAgentRequest(json); -// const privateChannelEventListenerRemovedBridgeRequest = Convert.toPrivateChannelEventListenerRemovedBridgeRequest(json); -// const privateChannelOnAddContextListenerAgentRequest = Convert.toPrivateChannelOnAddContextListenerAgentRequest(json); -// const privateChannelOnAddContextListenerBridgeRequest = Convert.toPrivateChannelOnAddContextListenerBridgeRequest(json); -// const privateChannelOnDisconnectAgentRequest = Convert.toPrivateChannelOnDisconnectAgentRequest(json); -// const privateChannelOnDisconnectBridgeRequest = Convert.toPrivateChannelOnDisconnectBridgeRequest(json); -// const privateChannelOnUnsubscribeAgentRequest = Convert.toPrivateChannelOnUnsubscribeAgentRequest(json); -// const privateChannelOnUnsubscribeBridgeRequest = Convert.toPrivateChannelOnUnsubscribeBridgeRequest(json); -// const raiseIntentAgentErrorResponse = Convert.toRaiseIntentAgentErrorResponse(json); -// const raiseIntentAgentRequest = Convert.toRaiseIntentAgentRequest(json); -// const raiseIntentAgentResponse = Convert.toRaiseIntentAgentResponse(json); -// const raiseIntentBridgeErrorResponse = Convert.toRaiseIntentBridgeErrorResponse(json); -// const raiseIntentBridgeRequest = Convert.toRaiseIntentBridgeRequest(json); -// const raiseIntentBridgeResponse = Convert.toRaiseIntentBridgeResponse(json); -// const raiseIntentResultAgentErrorResponse = Convert.toRaiseIntentResultAgentErrorResponse(json); -// const raiseIntentResultAgentResponse = Convert.toRaiseIntentResultAgentResponse(json); -// const raiseIntentResultBridgeErrorResponse = Convert.toRaiseIntentResultBridgeErrorResponse(json); -// const raiseIntentResultBridgeResponse = Convert.toRaiseIntentResultBridgeResponse(json); -// -// These functions will throw an error if the JSON doesn't -// match the expected interface, even if the JSON is valid. - -/** - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface AgentErrorResponseMessage { - meta: AgentResponseMetadata; - /** - * Error message payload containing an standardized error string. - */ - payload: ErrorResponseMessagePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: ResponseMessageType; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface AgentResponseMetadata { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface ErrorResponseMessagePayload { - error: ResponseErrorDetail; - [property: string]: any; -} - -/** - * Array of error message strings for responses that were not returned to the bridge before - * the timeout or because an error occurred. Should be the same length as the `errorSources` - * array and ordered the same. May be omitted if all sources responded without errors. - * - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type ResponseErrorDetail = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ -export type ResponseMessageType = "findInstancesResponse" | "findIntentResponse" | "findIntentsByContextResponse" | "getAppMetadataResponse" | "openResponse" | "raiseIntentResponse" | "raiseIntentResultResponse"; - -/** - * A request message from a Desktop Agent to the Bridge. - */ -export interface AgentRequestMessage { - meta: AgentRequestMetadata; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: RequestMessageType; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface AgentRequestMetadata { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: BridgeParticipantIdentifier; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceIdentifier; - timestamp: Date; -} - -/** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - * - * Represents identifiers that MUST include the Desktop Agent name and MAY identify a - * specific app or instance. - * - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface BridgeParticipantIdentifier { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - * - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent: string; - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - * - * Field that represents the source application that a request or response was received - * from, or the source Desktop Agent if it issued the request or response itself. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - */ -export interface SourceIdentifier { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId?: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - * - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - */ - desktopAgent?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ -export type RequestMessageType = "broadcastRequest" | "findInstancesRequest" | "findIntentRequest" | "findIntentsByContextRequest" | "getAppMetadataRequest" | "openRequest" | "PrivateChannel.broadcast" | "PrivateChannel.eventListenerAdded" | "PrivateChannel.eventListenerRemoved" | "PrivateChannel.onAddContextListener" | "PrivateChannel.onDisconnect" | "PrivateChannel.onUnsubscribe" | "raiseIntentRequest"; - -/** - * A response message from a Desktop Agent to the Bridge. - */ -export interface AgentResponseMessage { - meta: AgentResponseMetadata; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: ResponseMessageType; -} - -/** - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface BridgeErrorResponseMessage { - meta: BridgeErrorResponseMessageMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: ResponseErrorMessagePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: string; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface BridgeErrorResponseMessageMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - */ -export interface DesktopAgentIdentifier { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - */ - desktopAgent: string; - [property: string]: any; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface ResponseErrorMessagePayload { - error?: ResponseErrorDetail; - [property: string]: any; -} - -/** - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface BridgeRequestMessage { - meta: BridgeRequestMetadata; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: string; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface BridgeRequestMetadata { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: BridgeParticipantIdentifier; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: BridgeParticipantIdentifier; - timestamp: Date; -} - -/** - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface BridgeResponseMessage { - meta: BridgeResponseMessageMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: string; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface BridgeResponseMessageMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * A request to broadcast context on a channel. - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface BroadcastAgentRequest { - meta: BroadcastAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: BroadcastAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "broadcastRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface BroadcastAgentRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source: SourceObject; - timestamp: Date; -} - -/** - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - * - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - * - * Field that represents the source application that a request or response was received - * from, or the source Desktop Agent if it issued the request or response itself. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - */ -export interface SourceObject { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - * - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - */ - desktopAgent?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface BroadcastAgentRequestPayload { - /** - * The Id of the Channel that the broadcast was sent on - */ - channelId: string; - /** - * The context object that is to be broadcast. - */ - context: Context; -} - -/** - * The context object that is to be broadcast. - * - * The context object that was the payload of a broadcast message. - * - * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by - * FDC3 operations. As such, it is not really meant to be used on its own, but is imported - * by more specific type definitions (standardized or custom) to provide the structure and - * properties shared by all FDC3 context data types. - * - * The key element of FDC3 context types is their mandatory `type` property, which is used - * to identify what type of data the object represents, and what shape it has. - * - * The FDC3 context type, and all derived types, define the minimum set of fields a context - * data object of a particular type can be expected to have, but this can always be extended - * with custom fields as appropriate. - */ -export interface Context { - /** - * Context data objects may include a set of equivalent key-value pairs that can be used to - * help applications identify and look up the context type they receive in their own domain. - * The idea behind this design is that applications can provide as many equivalent - * identifiers to a target application as possible, e.g. an instrument may be represented by - * an ISIN, CUSIP or Bloomberg identifier. - * - * Identifiers do not make sense for all types of data, so the `id` property is therefore - * optional, but some derived types may choose to require at least one identifier. - * Identifier values SHOULD always be of type string. - */ - id?: { [key: string]: any }; - /** - * Context data objects may include a name property that can be used for more information, - * or display purposes. Some derived types may require the name object as mandatory, - * depending on use case. - */ - name?: string; - /** - * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 - * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present - * to route shared context data appropriately. - * - * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data - * types they support in an FDC3 [App - * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery - * and routing. - * - * Standardized FDC3 context types have well-known `type` properties prefixed with the - * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and - * used by a particular organization, the convention is to prefix them with an - * organization-specific namespace, e.g. `blackrock.fund`. - * - * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more - * information about context data types. - */ - type: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to broadcast context on a channel. - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface BroadcastBridgeRequest { - meta: BroadcastBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: BroadcastBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "broadcastRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface BroadcastBridgeRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - * - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - * - * Represents identifiers that MUST include the Desktop Agent name and MAY identify a - * specific app or instance. - * - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - */ -export interface MetaSource { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - * - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - */ - desktopAgent: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface BroadcastBridgeRequestPayload { - /** - * The Id of the Channel that the broadcast was sent on - */ - channelId: string; - /** - * The context object that is to be broadcast. - */ - context: Context; -} - -/** - * A message used during the connection flow for a Desktop Agent to the Bridge. Used for - * messages sent in either direction. - */ -export interface ConnectionStepMessage { - meta: ConnectionStepMetadata; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: { [key: string]: any }; - /** - * Identifies the type of the connection step message. - */ - type: ConnectionStepMessageType; -} - -/** - * Metadata for this connection step message. - */ -export interface ConnectionStepMetadata { - requestUuid?: string; - responseUuid?: string; - timestamp: Date; -} - -/** - * Identifies the type of the connection step message. - */ -export type ConnectionStepMessageType = "hello" | "handshake" | "authenticationFailed" | "connectedAgentsUpdate"; - -/** - * Hello message sent by the Bridge to anyone connecting to the Bridge (enables - * identification as a bridge and confirmation of whether authentication is required) - * - * A message used during the connection flow for a Desktop Agent to the Bridge. Used for - * messages sent in either direction. - */ -export interface ConnectionStep2Hello { - meta: ConnectionStep2HelloMeta; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: ConnectionStep2HelloPayload; - /** - * Identifies the type of the connection step message. - */ - type: "hello"; -} - -/** - * Metadata for this connection step message. - */ -export interface ConnectionStep2HelloMeta { - timestamp: Date; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface ConnectionStep2HelloPayload { - /** - * A flag indicating whether the Desktop Agent Bridge requires authentication or not. - */ - authRequired: boolean; - /** - * An optional Desktop Agent Bridge JWT authentication token if the Desktop Agent want to - * authenticate a bridge. - */ - authToken?: string; - /** - * The version of the Bridge - */ - desktopAgentBridgeVersion: string; - /** - * The FDC3 versions supported by the Bridge - */ - supportedFDC3Versions: string[]; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Handshake message sent by the Desktop Agent to the Bridge (including requested name, - * channel state and authentication data) - * - * A message used during the connection flow for a Desktop Agent to the Bridge. Used for - * messages sent in either direction. - */ -export interface ConnectionStep3Handshake { - meta: ConnectionStep3HandshakeMeta; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: ConnectionStep3HandshakePayload; - /** - * Identifies the type of the connection step message. - */ - type: "handshake"; -} - -/** - * Metadata for this connection step message. - */ -export interface ConnectionStep3HandshakeMeta { - requestUuid: string; - timestamp: Date; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface ConnectionStep3HandshakePayload { - authToken?: string; - /** - * 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]: Context[] }; - /** - * Desktop Agent ImplementationMetadata trying to connect to the bridge. - */ - implementationMetadata: ConnectingAgentImplementationMetadata; - /** - * The requested Desktop Agent name - */ - requestedName: string; -} - -/** - * Desktop Agent ImplementationMetadata trying to connect to the bridge. - * - * Metadata relating to the FDC3 Desktop Agent implementation and its provider. - */ -export interface ConnectingAgentImplementationMetadata { - /** - * The version number of the FDC3 specification that the implementation provides. - * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. - */ - fdc3Version: string; - /** - * Metadata indicating whether the Desktop Agent implements optional features of - * the Desktop Agent API. - */ - optionalFeatures: OptionalFeatures; - /** - * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, - * OpenFin etc.). - */ - provider: string; - /** - * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). - */ - providerVersion?: string; -} - -/** - * Metadata indicating whether the Desktop Agent implements optional features of - * the Desktop Agent API. - */ -export interface OptionalFeatures { - /** - * Used to indicate whether the experimental Desktop Agent Bridging - * feature is implemented by the Desktop Agent. - */ - DesktopAgentBridging: boolean; - /** - * Used to indicate whether the exposure of 'originating app metadata' for - * context and intent messages is supported by the Desktop Agent. - */ - OriginatingAppMetadata: boolean; - /** - * Used to indicate whether the optional `fdc3.joinUserChannel`, - * `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by - * the Desktop Agent. - */ - UserChannelMembershipAPIs: boolean; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Message sent by Bridge to Desktop Agent if their authentication fails. - * - * A message used during the connection flow for a Desktop Agent to the Bridge. Used for - * messages sent in either direction. - */ -export interface ConnectionStep4AuthenticationFailed { - meta: ConnectionStep4AuthenticationFailedMeta; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: ConnectionStep4AuthenticationFailedPayload; - /** - * Identifies the type of the connection step message. - */ - type: "authenticationFailed"; -} - -/** - * Metadata for this connection step message. - */ -export interface ConnectionStep4AuthenticationFailedMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface ConnectionStep4AuthenticationFailedPayload { - message?: string; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * Message sent by Bridge to all Desktop Agent when an agent joins or leaves the bridge, - * includes the details of all agents, the change made and the expected channel state for - * all agents. - * - * A message used during the connection flow for a Desktop Agent to the Bridge. Used for - * messages sent in either direction. - */ -export interface ConnectionStep6ConnectedAgentsUpdate { - meta: ConnectionStep6ConnectedAgentsUpdateMeta; - /** - * The message payload, containing data pertaining to this connection step. - */ - payload: ConnectionStep6ConnectedAgentsUpdatePayload; - /** - * Identifies the type of the connection step message. - */ - type: "connectedAgentsUpdate"; -} - -/** - * Metadata for this connection step message. - */ -export interface ConnectionStep6ConnectedAgentsUpdateMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload, containing data pertaining to this connection step. - */ -export interface ConnectionStep6ConnectedAgentsUpdatePayload { - /** - * Should be set when an agent first connects to the bridge and provide its assigned name. - */ - addAgent?: string; - /** - * Desktop Agent Bridge implementation metadata of all connected agents. - */ - allAgents: DesktopAgentImplementationMetadata[]; - /** - * The updated state of channels that should be adopted by the agents. Should only be set - * when an agent is connecting to the bridge. - */ - channelsState?: { [key: string]: Context[] }; - /** - * Should be set when an agent disconnects from the bridge and provide the name that no - * longer is assigned. - */ - removeAgent?: string; -} - -/** - * Includes the name assigned to the Desktop Agent by the Bridge. - * - * Metadata relating to the FDC3 Desktop Agent implementation and its provider. - */ -export interface DesktopAgentImplementationMetadata { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a particular Desktop - * Agent. - */ - desktopAgent: string; - /** - * The version number of the FDC3 specification that the implementation provides. - * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. - */ - fdc3Version: string; - /** - * Metadata indicating whether the Desktop Agent implements optional features of - * the Desktop Agent API. - */ - optionalFeatures: OptionalFeatures; - /** - * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, - * OpenFin etc.). - */ - provider: string; - /** - * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). - */ - providerVersion?: string; -} - -/** - * Identifies the type of the connection step message. - */ - -/** - * A response to a findInstances request that contains an error. - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface FindInstancesAgentErrorResponse { - meta: FindInstancesAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: PayloadClass; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findInstancesResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface FindInstancesAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface PayloadClass { - error: FindInstancesErrors; -} - -/** - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - * - * Should be set if the raiseIntent request returned an error. - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - * - * Array of error message strings for responses that were not returned to the bridge before - * the timeout or because an error occurred. Should be the same length as the `errorSources` - * array and ordered the same. May be omitted if all sources responded without errors. - * - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - */ -export type FindInstancesErrors = "DesktopAgentNotFound" | "IntentDeliveryFailed" | "MalformedContext" | "NoAppsFound" | "ResolverTimeout" | "ResolverUnavailable" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request for details of instances of a particular app - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface FindInstancesAgentRequest { - meta: FindInstancesAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindInstancesAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findInstancesRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface FindInstancesAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: DestinationObject; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceIdentifier; - timestamp: Date; -} - -/** - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - * - * Represents identifiers that MUST include the Desktop Agent name and MAY identify a - * specific app or instance. - * - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - * - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface DestinationObject { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - * - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent: string; - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindInstancesAgentRequestPayload { - app: AppIdentifier; -} - -/** - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface AppIdentifier { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A response to a findInstances request. - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface FindInstancesAgentResponse { - meta: AgentResponseMetadata; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: FindInstancesAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findInstancesResponse"; -} - -/** - * The message payload contains a flag indicating whether the API call was successful, plus - * any return values for the FDC3 API function called, or indicating that the request - * resulted in an error and including a standardized error message. - * - * The message payload typically contains return values for FDC3 API functions. - */ -export interface FindInstancesAgentResponsePayload { - appIdentifiers: AppMetadata[]; -} - -/** - * Extends an `AppIdentifier`, describing an application or instance of an application, with - * additional descriptive metadata that is usually provided by an FDC3 App Directory that - * the desktop agent connects to. - * - * The additional information from an app directory can aid in rendering UI elements, such - * as a launcher menu or resolver UI. This includes a title, description, tooltip and icon - * and screenshot URLs. - * - * Note that as `AppMetadata` instances are also `AppIdentifiers` they may be passed to the - * `app` argument of `fdc3.open`, `fdc3.raiseIntent` etc. - */ -export interface AppMetadata { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * A longer, multi-paragraph description for the application that could include markup - */ - description?: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent?: string; - /** - * A list of icon URLs for the application that can be used to render UI elements - */ - icons?: Icon[]; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - /** - * An optional set of, implementation specific, metadata fields that can be used to - * disambiguate instances, such as a window title or screen position. Must only be set if - * `instanceId` is set. - */ - instanceMetadata?: { [key: string]: any }; - /** - * The 'friendly' app name. - * This field was used with the `open` and `raiseIntent` calls in FDC3 <2.0, which now - * require an `AppIdentifier` wth `appId` set. - * Note that for display purposes the `title` field should be used, if set, in preference to - * this field. - */ - name?: string; - /** - * The type of output returned for any intent specified during resolution. May express a - * particular context type (e.g. "fdc3.instrument"), channel (e.g. "channel") or a channel - * that will receive a specified type (e.g. "channel"). - */ - resultType?: null | string; - /** - * Images representing the app in common usage scenarios that can be used to render UI - * elements - */ - screenshots?: Image[]; - /** - * A more user-friendly application title that can be used to render UI elements - */ - title?: string; - /** - * A tooltip for the application that can be used to render UI elements - */ - tooltip?: string; - /** - * The Version of the application. - */ - version?: string; -} - -/** - * SPDX-License-Identifier: Apache-2.0 - * Copyright FINOS FDC3 contributors - see NOTICE file - */ -export interface Icon { - /** - * The icon dimension, formatted as `x`. - */ - size?: string; - /** - * The icon url - */ - src: string; - /** - * Icon media type. If not present the Desktop Agent may use the src file extension. - */ - type?: string; -} - -/** - * SPDX-License-Identifier: Apache-2.0 - * Copyright FINOS FDC3 contributors - see NOTICE file - */ -export interface Image { - /** - * Caption for the image. - */ - label?: string; - /** - * The image dimension, formatted as `x`. - */ - size?: string; - /** - * The image url. - */ - src: string; - /** - * Image media type. If not present the Desktop Agent may use the src file extension. - */ - type?: string; -} - -/** - * A response to a findInstances request that contains an error. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface FindInstancesBridgeErrorResponse { - meta: FindInstancesBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: MessagePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findInstancesResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface FindInstancesBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface MessagePayload { - error: FindInstancesErrors; -} - -/** - * A request for details of instances of a particular app - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface FindInstancesBridgeRequest { - meta: FindInstancesBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindInstancesBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findInstancesRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface FindInstancesBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: DestinationObject; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSourceObject; - timestamp: Date; -} - -/** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - * - * Field that represents the source application that a request or response was received - * from, or the source Desktop Agent if it issued the request or response itself. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - * - * Represents identifiers that MUST include the Desktop Agent name and MAY identify a - * specific app or instance. - * - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - * - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - */ -export interface MetaSourceObject { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId?: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - * - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - */ - desktopAgent: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindInstancesBridgeRequestPayload { - app: AppIdentifier; -} - -/** - * A response to a findInstances request. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface FindInstancesBridgeResponse { - meta: BridgeResponseMessageMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: FindInstancesBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findInstancesResponse"; -} - -/** - * The message payload contains a flag indicating whether the API call was successful, plus - * any return values for the FDC3 API function called, or indicating that the request - * resulted in an error and including a standardized error message. - * - * The message payload typically contains return values for FDC3 API functions. - */ -export interface FindInstancesBridgeResponsePayload { - appIdentifiers: AppMetadata[]; -} - -/** - * A response to a findIntent request that contains an error. - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface FindIntentAgentErrorResponse { - meta: FindIntentAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: FindIntentAgentErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface FindIntentAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface FindIntentAgentErrorResponsePayload { - error: FindInstancesErrors; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request for details of apps available to resolve a particular intent and context pair. - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface FindIntentAgentRequest { - meta: FindIntentAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindIntentAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findIntentRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface FindIntentAgentRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceIdentifier; - timestamp: Date; - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: BridgeParticipantIdentifier; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindIntentAgentRequestPayload { - context?: Context; - intent: string; - resultType?: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A response to a findIntent request. - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface FindIntentAgentResponse { - meta: FindIntentAgentResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: FindIntentAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface FindIntentAgentResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface FindIntentAgentResponsePayload { - appIntent: AppIntent; -} - -/** - * An interface that relates an intent to apps - */ -export interface AppIntent { - /** - * Details of applications that can resolve the intent. - */ - apps: AppMetadata[]; - /** - * Details of the intent whose relationship to resolving applications is being described. - */ - intent: IntentMetadata; -} - -/** - * Details of the intent whose relationship to resolving applications is being described. - * - * Intent descriptor - */ -export interface IntentMetadata { - /** - * Display name for the intent. - */ - displayName?: string; - /** - * The unique name of the intent that can be invoked by the raiseIntent call - */ - name: string; -} - -/** - * A response to a findIntent request that contains an error. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface FindIntentBridgeErrorResponse { - meta: FindIntentBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: FindIntentBridgeErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface FindIntentBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface FindIntentBridgeErrorResponsePayload { - error: FindInstancesErrors; -} - -/** - * A request for details of apps available to resolve a particular intent and context pair. - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface FindIntentBridgeRequest { - meta: FindIntentBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindIntentBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findIntentRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface FindIntentBridgeRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: BridgeParticipantIdentifier; - timestamp: Date; - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: BridgeParticipantIdentifier; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindIntentBridgeRequestPayload { - context?: Context; - intent: string; - resultType?: string; -} - -/** - * A response to a findIntent request. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface FindIntentBridgeResponse { - meta: FindIntentBridgeResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: FindIntentBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface FindIntentBridgeResponseMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface FindIntentBridgeResponsePayload { - appIntent: AppIntent; -} - -/** - * A response to a findIntentsByContext request that contains an error. - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface FindIntentsByContextAgentErrorResponse { - meta: FindIntentsByContextAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: FindIntentsByContextAgentErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentsByContextResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface FindIntentsByContextAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface FindIntentsByContextAgentErrorResponsePayload { - error: FindInstancesErrors; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request for details of intents and apps available to resolve them for a particular - * context. - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface FindIntentsByContextAgentRequest { - meta: FindIntentsByContextAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindIntentsByContextAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findIntentsByContextRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface FindIntentsByContextAgentRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: BridgeParticipantIdentifier; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindIntentsByContextAgentRequestPayload { - context: Context; - resultType?: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A response to a findIntentsByContext request. - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface FindIntentsByContextAgentResponse { - meta: FindIntentsByContextAgentResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: FindIntentsByContextAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentsByContextResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface FindIntentsByContextAgentResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface FindIntentsByContextAgentResponsePayload { - appIntents: AppIntent[]; -} - -/** - * A response to a findIntentsByContext request that contains an error. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface FindIntentsByContextBridgeErrorResponse { - meta: FindIntentsByContextBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: FindIntentsByContextBridgeErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentsByContextResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface FindIntentsByContextBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface FindIntentsByContextBridgeErrorResponsePayload { - error: FindInstancesErrors; -} - -/** - * A request for details of intents and apps available to resolve them for a particular - * context. - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface FindIntentsByContextBridgeRequest { - meta: FindIntentsByContextBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: FindIntentsByContextBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "findIntentsByContextRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface FindIntentsByContextBridgeRequestMeta { - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: BridgeParticipantIdentifier; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface FindIntentsByContextBridgeRequestPayload { - context: Context; - resultType?: string; -} - -/** - * A response to a findIntentsByContext request. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface FindIntentsByContextBridgeResponse { - meta: FindIntentsByContextBridgeResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: FindIntentsByContextBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "findIntentsByContextResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface FindIntentsByContextBridgeResponseMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface FindIntentsByContextBridgeResponsePayload { - appIntents: AppIntent[]; -} - -/** - * A response to a getAppMetadata request that contains an error. - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface GetAppMetadataAgentErrorResponse { - meta: GetAppMetadataAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: GetAppMetadataAgentErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getAppMetadataResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface GetAppMetadataAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface GetAppMetadataAgentErrorResponsePayload { - error: FindInstancesErrors; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request for metadata about an app - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface GetAppMetadataAgentRequest { - meta: GetAppMetadataAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetAppMetadataAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getAppMetadataRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface GetAppMetadataAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: DestinationObject; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceIdentifier; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetAppMetadataAgentRequestPayload { - app: AppObject; -} - -/** - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface AppObject { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - * - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent: string; - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A response to a getAppMetadata request. - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface GetAppMetadataAgentResponse { - meta: GetAppMetadataAgentResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: GetAppMetadataAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getAppMetadataResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface GetAppMetadataAgentResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface GetAppMetadataAgentResponsePayload { - appMetadata: AppMetadata; -} - -/** - * A response to a getAppMetadata request that contains an error. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface GetAppMetadataBridgeErrorResponse { - meta: GetAppMetadataBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: GetAppMetadataBridgeErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getAppMetadataResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface GetAppMetadataBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface GetAppMetadataBridgeErrorResponsePayload { - error: FindInstancesErrors; -} - -/** - * A request for metadata about an app - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface GetAppMetadataBridgeRequest { - meta: GetAppMetadataBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: GetAppMetadataBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "getAppMetadataRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface GetAppMetadataBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: DestinationObject; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface GetAppMetadataBridgeRequestPayload { - app: AppObject; -} - -/** - * A response to a getAppMetadata request. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface GetAppMetadataBridgeResponse { - meta: GetAppMetadataBridgeResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: GetAppMetadataBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "getAppMetadataResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface GetAppMetadataBridgeResponseMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface GetAppMetadataBridgeResponsePayload { - appMetadata: AppMetadata; -} - -/** - * A response to an open request that contains an error - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface OpenAgentErrorResponse { - meta: OpenAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: OpenAgentErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "openResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface OpenAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface OpenAgentErrorResponsePayload { - error: OpenErrorResponsePayload; -} - -/** - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Array of error message strings for responses that were not returned to the bridge before - * the timeout or because an error occurred. Should be the same length as the `errorSources` - * array and ordered the same. May be omitted if all sources responded without errors. - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type OpenErrorResponsePayload = "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "MalformedContext" | "ResolverUnavailable" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to open an application - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface OpenAgentRequest { - meta: OpenAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: OpenAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "openRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface OpenAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: DestinationObject; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface OpenAgentRequestPayload { - /** - * The application to open on the specified Desktop Agent - */ - app: AppToOpen; - context?: Context; -} - -/** - * The application to open on the specified Desktop Agent - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface AppToOpen { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - * - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent: string; - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A response to an open request - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface OpenAgentResponse { - meta: OpenAgentResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: OpenAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "openResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface OpenAgentResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface OpenAgentResponsePayload { - appIdentifier: AppIdentifier; -} - -/** - * A response to an open request that contains an error - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface OpenBridgeErrorResponse { - meta: OpenBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: OpenBridgeErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "openResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface OpenBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface OpenBridgeErrorResponsePayload { - error: OpenErrorResponsePayload; -} - -/** - * A request to open an application - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface OpenBridgeRequest { - meta: OpenBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: OpenBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "openRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface OpenBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: DestinationObject; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface OpenBridgeRequestPayload { - /** - * The application to open on the specified Desktop Agent - */ - app: AppToOpen; - context?: Context; -} - -/** - * A response to an open request - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface OpenBridgeResponse { - meta: OpenBridgeResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: OpenBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "openResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface OpenBridgeResponseMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface OpenBridgeResponsePayload { - appIdentifier: AppIdentifier; -} - -/** - * A request to broadcast on a PrivateChannel. - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface PrivateChannelBroadcastAgentRequest { - meta: PrivateChannelBroadcastAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelBroadcastAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.broadcast"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface PrivateChannelBroadcastAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; -} - -/** - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - * - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - * - * Represents identifiers that MUST include the Desktop Agent name and MAY identify a - * specific app or instance. - * - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ -export interface MetaDestination { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - * - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent: string; - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelBroadcastAgentRequestPayload { - /** - * The Id of the PrivateChannel that the broadcast was sent on - */ - channelId: string; - /** - * The context object that was the payload of a broadcast message. - */ - context: Context; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to broadcast on a PrivateChannel. - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface PrivateChannelBroadcastBridgeRequest { - meta: PrivateChannelBroadcastBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelBroadcastBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.broadcast"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface PrivateChannelBroadcastBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelBroadcastBridgeRequestPayload { - /** - * The Id of the PrivateChannel that the broadcast was sent on - */ - channelId: string; - /** - * The context object that was the payload of a broadcast message. - */ - context: Context; -} - -/** - * A request to forward on an EventListenerAdded event, relating to a PrivateChannel - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface PrivateChannelEventListenerAddedAgentRequest { - meta: PrivateChannelEventListenerAddedAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelEventListenerAddedAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.eventListenerAdded"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface PrivateChannelEventListenerAddedAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelEventListenerAddedAgentRequestPayload { - /** - * The id of the PrivateChannel that the event listener was added to. - */ - channelId: string; - listenerType: PrivateChannelEventListenerTypes; -} - -/** - * Event listener type names for Private Channel events - */ -export type PrivateChannelEventListenerTypes = "onAddContextListener" | "onUnsubscribe" | "onDisconnect"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to forward on an EventListenerAdded event, relating to a PrivateChannel - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface PrivateChannelEventListenerAddedBridgeRequest { - meta: PrivateChannelEventListenerAddedBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelEventListenerAddedBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.eventListenerAdded"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface PrivateChannelEventListenerAddedBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelEventListenerAddedBridgeRequestPayload { - /** - * The id of the PrivateChannel that the event listener was added to. - */ - channelId: string; - listenerType: PrivateChannelEventListenerTypes; -} - -/** - * A request to forward on an EventListenerRemoved event, relating to a PrivateChannel - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface PrivateChannelEventListenerRemovedAgentRequest { - meta: PrivateChannelEventListenerRemovedAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelEventListenerRemovedAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.eventListenerRemoved"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface PrivateChannelEventListenerRemovedAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelEventListenerRemovedAgentRequestPayload { - /** - * The id of the PrivateChannel that the event listener was removed from. - */ - channelId: string; - listenerType: PrivateChannelEventListenerTypes; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to forward on an EventListenerRemoved event, relating to a PrivateChannel - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface PrivateChannelEventListenerRemovedBridgeRequest { - meta: PrivateChannelEventListenerRemovedBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelEventListenerRemovedBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.eventListenerRemoved"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface PrivateChannelEventListenerRemovedBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelEventListenerRemovedBridgeRequestPayload { - /** - * The id of the PrivateChannel that the event listener was removed from. - */ - channelId: string; - listenerType: PrivateChannelEventListenerTypes; -} - -/** - * A request to forward on an AddContextListener event, relating to a PrivateChannel - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface PrivateChannelOnAddContextListenerAgentRequest { - meta: PrivateChannelOnAddContextListenerAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelOnAddContextListenerAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.onAddContextListener"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface PrivateChannelOnAddContextListenerAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelOnAddContextListenerAgentRequestPayload { - /** - * The id of the PrivateChannel that the context listener was added to. - */ - channelId: string; - /** - * The type of the context listener added. Should be null for an untyped listener. - */ - contextType: null | string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to forward on an AddContextListener event, relating to a PrivateChannel - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface PrivateChannelOnAddContextListenerBridgeRequest { - meta: PrivateChannelOnAddContextListenerBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelOnAddContextListenerBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.onAddContextListener"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface PrivateChannelOnAddContextListenerBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelOnAddContextListenerBridgeRequestPayload { - /** - * The id of the PrivateChannel that the context listener was added to. - */ - channelId: string; - /** - * The type of the context listener added. Should be null for an untyped listener. - */ - contextType: null | string; -} - -/** - * A request to forward on a Disconnect event, relating to a PrivateChannel - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface PrivateChannelOnDisconnectAgentRequest { - meta: PrivateChannelOnDisconnectAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelOnDisconnectAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.onDisconnect"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface PrivateChannelOnDisconnectAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelOnDisconnectAgentRequestPayload { - /** - * The id of the PrivateChannel that the agent discconnected from. - */ - channelId: string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to forward on a Disconnect event, relating to a PrivateChannel - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface PrivateChannelOnDisconnectBridgeRequest { - meta: PrivateChannelOnDisconnectBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelOnDisconnectBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.onDisconnect"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface PrivateChannelOnDisconnectBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelOnDisconnectBridgeRequestPayload { - /** - * The id of the PrivateChannel that the agent discconnected from. - */ - channelId: string; -} - -/** - * A request to forward on an Unsubscribe event, relating to a PrivateChannel - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface PrivateChannelOnUnsubscribeAgentRequest { - meta: PrivateChannelOnUnsubscribeAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelOnUnsubscribeAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.onUnsubscribe"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface PrivateChannelOnUnsubscribeAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source?: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelOnUnsubscribeAgentRequestPayload { - /** - * The id of the PrivateChannel that the context listener was unsubscribed from. - */ - channelId: string; - /** - * The type of the context listener that was unsubscribed. Should be null for an untyped - * listener. - */ - contextType: null | string; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to forward on an Unsubscribe event, relating to a PrivateChannel - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface PrivateChannelOnUnsubscribeBridgeRequest { - meta: ERequestMetadata; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: PrivateChannelOnUnsubscribeBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "PrivateChannel.onUnsubscribe"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface ERequestMetadata { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination?: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface PrivateChannelOnUnsubscribeBridgeRequestPayload { - /** - * The id of the PrivateChannel that the context listener was unsubscribed from. - */ - channelId: string; - /** - * The type of the context listener that was unsubscribed. Should be null for an untyped - * listener. - */ - contextType: null | string; -} - -/** - * A response to a request to raise an intent that contains an error. - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface RaiseIntentAgentErrorResponse { - meta: RaiseIntentAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: RaiseIntentAgentErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface RaiseIntentAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Used if a raiseIntent request resulted in an error - * - * Error message payload containing an standardized error string. - */ -export interface RaiseIntentAgentErrorResponsePayload { - /** - * Should be set if the raiseIntent request returned an error. - */ - error: FindInstancesErrors; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A request to raise an intent. - * - * A request message from a Desktop Agent to the Bridge. - */ -export interface RaiseIntentAgentRequest { - meta: RaiseIntentAgentRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: RaiseIntentAgentRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "raiseIntentRequest"; -} - -/** - * Metadata for a request message sent by Desktop Agents to the Bridge. - */ -export interface RaiseIntentAgentRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. - */ - source: SourceObject; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface RaiseIntentAgentRequestPayload { - app: AppDestinationIdentifier; - context: Context; - intent: string; -} - -/** - * Field that represents a destination App on a remote Desktop Agent that a request is to be - * sent to. - * - * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios - * where a request needs to be directed to a Desktop Agent rather than a specific app, or a - * response message is returned by the Desktop Agent (or more specifically its resolver) - * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no - * app details are available or are appropriate. - * - * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge - * before the timeout or because an error occurred. May be omitted if all sources responded - * without errors. MUST include the `desktopAgent` field when returned by the bridge. - * - * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. - * Will contain a single value for individual responses and multiple values for responses - * that were collated by the bridge. May be omitted if all sources errored. MUST include the - * `desktopAgent` field when returned by the bridge. - * - * Field that represents a destination Desktop Agent that a request is to be sent to. - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - * - * Field that represents the source application that a request or response was received - * from. - * - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ -export interface AppDestinationIdentifier { - /** - * Used in Desktop Agent Bridging to attribute or target a message to a - * particular Desktop Agent. - * - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent: string; - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A response to a request to raise an intent. - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface RaiseIntentAgentResponse { - meta: RaiseIntentAgentResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: RaiseIntentAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface RaiseIntentAgentResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface RaiseIntentAgentResponsePayload { - /** - * Used if the raiseIntent request was successfully resolved - */ - intentResolution: IntentResolution; -} - -/** - * Used if the raiseIntent request was successfully resolved - * - * IntentResolution provides a standard format for data returned upon resolving an intent. - * - * ```javascript - * //resolve a "Chain" type intent - * let resolution = await agent.raiseIntent("intentName", context); - * - * //resolve a "Client-Service" type intent with a data response or a Channel - * let resolution = await agent.raiseIntent("intentName", context); - * try { - * const result = await resolution.getResult(); - * if (result && result.broadcast) { - * console.log(`${resolution.source} returned a channel with id ${result.id}`); - * } else if (result){ - * console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`); - * } else { - * console.error(`${resolution.source} didn't return data` - * } - * } catch(error) { - * console.error(`${resolution.source} returned an error: ${error}`); - * } - * - * // Use metadata about the resolving app instance to target a further intent - * await agent.raiseIntent("intentName", context, resolution.source); - * ``` - */ -export interface IntentResolution { - /** - * The intent that was raised. May be used to determine which intent the user - * chose in response to `fdc3.raiseIntentForContext()`. - */ - intent: string; - /** - * Identifier for the app instance that was selected (or started) to resolve the intent. - * `source.instanceId` MUST be set, indicating the specific app instance that - * received the intent. - */ - source: AppIdentifier; -} - -/** - * A response to a request to raise an intent that contains an error. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface RaiseIntentBridgeErrorResponse { - meta: RaiseIntentBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: RaiseIntentBridgeErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface RaiseIntentBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Used if a raiseIntent request resulted in an error - * - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface RaiseIntentBridgeErrorResponsePayload { - /** - * Should be set if the raiseIntent request returned an error. - */ - error: FindInstancesErrors; -} - -/** - * A request to raise an intent. - * - * A request message forwarded from the Bridge onto a Desktop Agent connected to it. - */ -export interface RaiseIntentBridgeRequest { - meta: RaiseIntentBridgeRequestMeta; - /** - * The message payload typically contains the arguments to FDC3 API functions. - */ - payload: RaiseIntentBridgeRequestPayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Request' appended. - */ - type: "raiseIntentRequest"; -} - -/** - * Metadata required in a request message forwarded on by the Bridge - */ -export interface RaiseIntentBridgeRequestMeta { - /** - * Optional field that represents the destination that the request should be routed to. Must - * be set by the Desktop Agent for API calls that include a target app parameter and must - * include the name of the Desktop Agent hosting the target application. - */ - destination: MetaDestination; - requestUuid: string; - /** - * Field that represents the source application that the request was received from, or the - * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST - * be set by the bridge. - */ - source: MetaSource; - timestamp: Date; -} - -/** - * The message payload typically contains the arguments to FDC3 API functions. - */ -export interface RaiseIntentBridgeRequestPayload { - app: AppDestinationIdentifier; - context: Context; - intent: string; -} - -/** - * A response to a request to raise an intent. - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface RaiseIntentBridgeResponse { - meta: RaiseIntentBridgeResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: RaiseIntentBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface RaiseIntentBridgeResponseMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface RaiseIntentBridgeResponsePayload { - /** - * Used if the raiseIntent request was successfully resolved - */ - intentResolution: IntentResolution; -} - -/** - * A secondary response to a request to raise an intent used to deliver the intent result, - * which contains an error - * - * A response message from a Desktop Agent to the Bridge containing an error, to be used in - * preference to the standard response when an error needs to be returned. - */ -export interface RaiseIntentResultAgentErrorResponse { - meta: RaiseIntentResultAgentErrorResponseMeta; - /** - * Error message payload containing an standardized error string. - */ - payload: RaiseIntentResultAgentErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResultResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface RaiseIntentResultAgentErrorResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * Error message payload containing an standardized error string. - */ -export interface RaiseIntentResultAgentErrorResponsePayload { - error: RaiseIntentResultErrorMessage; -} - -/** - * Array of error message strings for responses that were not returned to the bridge before - * the timeout or because an error occurred. Should be the same length as the `errorSources` - * array and ordered the same. May be omitted if all sources responded without errors. - * - * Constants representing the errors that can be encountered when calling the `open` method - * on the DesktopAgent object (`fdc3`). - * - * Constants representing the errors that can be encountered when calling the `findIntent`, - * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the - * DesktopAgent (`fdc3`). - */ -export type RaiseIntentResultErrorMessage = "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; - -/** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - * - * Unique identifier for a request or event message. Required in all message types - * - * Unique identifier for a response to a specific message and must always be accompanied by - * a RequestUuid. - */ - -/** - * A secondary response to a request to raise an intent used to deliver the intent result - * - * A response message from a Desktop Agent to the Bridge. - */ -export interface RaiseIntentResultAgentResponse { - meta: RaiseIntentResultAgentResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: RaiseIntentResultAgentResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResultResponse"; -} - -/** - * Metadata for a response messages sent by a Desktop Agent to the Bridge - */ -export interface RaiseIntentResultAgentResponseMeta { - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface RaiseIntentResultAgentResponsePayload { - intentResult: IntentResult; -} - -export interface IntentResult { - context?: Context; - channel?: Channel; -} - -/** - * Represents a context channel that applications can use to send and receive - * context data. - * - * Please note that There are differences in behavior when you interact with a - * User channel via the `DesktopAgent` interface and the `Channel` interface. - * Specifically, when 'joining' a User channel or adding a context listener - * when already joined to a channel via the `DesktopAgent` interface, existing - * context (matching the type of the context listener) on the channel is - * received by the context listener immediately. Whereas, when a context - * listener is added via the Channel interface, context is not received - * automatically, but may be retrieved manually via the `getCurrentContext()` - * function. - */ -export interface Channel { - /** - * Channels may be visualized and selectable by users. DisplayMetadata may be used to - * provide hints on how to see them. - * For App channels, displayMetadata would typically not be present. - */ - displayMetadata?: DisplayMetadata; - /** - * Constant that uniquely identifies this channel. - */ - id: string; - /** - * Uniquely defines each channel type. - * Can be "user", "app" or "private". - */ - type: Type; -} - -/** - * Channels may be visualized and selectable by users. DisplayMetadata may be used to - * provide hints on how to see them. - * For App channels, displayMetadata would typically not be present. - * - * A system channel will be global enough to have a presence across many apps. This gives us - * some hints - * to render them in a standard way. It is assumed it may have other properties too, but if - * it has these, - * this is their meaning. - */ -export interface DisplayMetadata { - /** - * The color that should be associated within this channel when displaying this channel in a - * UI, e.g: `0xFF0000`. - */ - color?: string; - /** - * A URL of an image that can be used to display this channel - */ - glyph?: string; - /** - * A user-readable name for this channel, e.g: `"Red"` - */ - name?: string; -} - -/** - * Uniquely defines each channel type. - * Can be "user", "app" or "private". - */ -export type Type = "app" | "private" | "user"; - -/** - * A secondary response to a request to raise an intent used to deliver the intent result, - * which contains an error - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request, used where all connected agents returned errors. - */ -export interface RaiseIntentResultBridgeErrorResponse { - meta: RaiseIntentResultBridgeErrorResponseMeta; - /** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ - payload: RaiseIntentResultBridgeErrorResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResultResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface RaiseIntentResultBridgeErrorResponseMeta { - errorDetails: ResponseErrorDetail[]; - errorSources: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - timestamp: Date; -} - -/** - * The error message payload contains details of an error return to the app or agent that - * raised the original request. - */ -export interface RaiseIntentResultBridgeErrorResponsePayload { - error: RaiseIntentResultErrorMessage; -} - -/** - * A secondary response to a request to raise an intent used to deliver the intent result - * - * A response message from the Bridge back to the original Desktop Agent that raised the - * request. - */ -export interface RaiseIntentResultBridgeResponse { - meta: RaiseIntentResultBridgeResponseMeta; - /** - * The message payload typically contains return values for FDC3 API functions. - */ - payload: RaiseIntentResultBridgeResponsePayload; - /** - * Identifies the type of the message and it is typically set to the FDC3 function name that - * the message relates to, e.g. 'findIntent', with 'Response' appended. - */ - type: "raiseIntentResultResponse"; -} - -/** - * Metadata required in a response message collated and/or forwarded on by the Bridge - */ -export interface RaiseIntentResultBridgeResponseMeta { - errorDetails?: ResponseErrorDetail[]; - errorSources?: DesktopAgentIdentifier[]; - requestUuid: string; - responseUuid: string; - sources?: DesktopAgentIdentifier[]; - timestamp: Date; -} - -/** - * The message payload typically contains return values for FDC3 API functions. - */ -export interface RaiseIntentResultBridgeResponsePayload { - intentResult: IntentResult; -} - -// Converts JSON strings to/from your types -// and asserts the results of JSON.parse at runtime -export class Convert { - public static toAgentErrorResponseMessage(json: string): AgentErrorResponseMessage { - return cast(JSON.parse(json), r("AgentErrorResponseMessage")); - } - - public static agentErrorResponseMessageToJson(value: AgentErrorResponseMessage): string { - return JSON.stringify(uncast(value, r("AgentErrorResponseMessage")), null, 2); - } - - public static toAgentRequestMessage(json: string): AgentRequestMessage { - return cast(JSON.parse(json), r("AgentRequestMessage")); - } - - public static agentRequestMessageToJson(value: AgentRequestMessage): string { - return JSON.stringify(uncast(value, r("AgentRequestMessage")), null, 2); - } - - public static toAgentResponseMessage(json: string): AgentResponseMessage { - return cast(JSON.parse(json), r("AgentResponseMessage")); - } - - public static agentResponseMessageToJson(value: AgentResponseMessage): string { - return JSON.stringify(uncast(value, r("AgentResponseMessage")), null, 2); - } - - public static toBridgeErrorResponseMessage(json: string): BridgeErrorResponseMessage { - return cast(JSON.parse(json), r("BridgeErrorResponseMessage")); - } - - public static bridgeErrorResponseMessageToJson(value: BridgeErrorResponseMessage): string { - return JSON.stringify(uncast(value, r("BridgeErrorResponseMessage")), null, 2); - } - - public static toBridgeRequestMessage(json: string): BridgeRequestMessage { - return cast(JSON.parse(json), r("BridgeRequestMessage")); - } - - public static bridgeRequestMessageToJson(value: BridgeRequestMessage): string { - return JSON.stringify(uncast(value, r("BridgeRequestMessage")), null, 2); - } - - public static toBridgeResponseMessage(json: string): BridgeResponseMessage { - return cast(JSON.parse(json), r("BridgeResponseMessage")); - } - - public static bridgeResponseMessageToJson(value: BridgeResponseMessage): string { - return JSON.stringify(uncast(value, r("BridgeResponseMessage")), null, 2); - } - - public static toBroadcastAgentRequest(json: string): BroadcastAgentRequest { - return cast(JSON.parse(json), r("BroadcastAgentRequest")); - } - - public static broadcastAgentRequestToJson(value: BroadcastAgentRequest): string { - return JSON.stringify(uncast(value, r("BroadcastAgentRequest")), null, 2); - } - - public static toBroadcastBridgeRequest(json: string): BroadcastBridgeRequest { - return cast(JSON.parse(json), r("BroadcastBridgeRequest")); - } - - public static broadcastBridgeRequestToJson(value: BroadcastBridgeRequest): string { - return JSON.stringify(uncast(value, r("BroadcastBridgeRequest")), null, 2); - } - - public static toBridgeCommonDefinitions(json: string): { [key: string]: any } { - return cast(JSON.parse(json), m("any")); - } - - public static bridgeCommonDefinitionsToJson(value: { [key: string]: any }): string { - return JSON.stringify(uncast(value, m("any")), null, 2); - } - - public static toConnectionStepMessage(json: string): ConnectionStepMessage { - return cast(JSON.parse(json), r("ConnectionStepMessage")); - } - - public static connectionStepMessageToJson(value: ConnectionStepMessage): string { - return JSON.stringify(uncast(value, r("ConnectionStepMessage")), null, 2); - } - - public static toConnectionStep2Hello(json: string): ConnectionStep2Hello { - return cast(JSON.parse(json), r("ConnectionStep2Hello")); - } - - public static connectionStep2HelloToJson(value: ConnectionStep2Hello): string { - return JSON.stringify(uncast(value, r("ConnectionStep2Hello")), null, 2); - } - - public static toConnectionStep3Handshake(json: string): ConnectionStep3Handshake { - return cast(JSON.parse(json), r("ConnectionStep3Handshake")); - } - - public static connectionStep3HandshakeToJson(value: ConnectionStep3Handshake): string { - return JSON.stringify(uncast(value, r("ConnectionStep3Handshake")), null, 2); - } - - public static toConnectionStep4AuthenticationFailed(json: string): ConnectionStep4AuthenticationFailed { - return cast(JSON.parse(json), r("ConnectionStep4AuthenticationFailed")); - } - - public static connectionStep4AuthenticationFailedToJson(value: ConnectionStep4AuthenticationFailed): string { - return JSON.stringify(uncast(value, r("ConnectionStep4AuthenticationFailed")), null, 2); - } - - public static toConnectionStep6ConnectedAgentsUpdate(json: string): ConnectionStep6ConnectedAgentsUpdate { - return cast(JSON.parse(json), r("ConnectionStep6ConnectedAgentsUpdate")); - } - - public static connectionStep6ConnectedAgentsUpdateToJson(value: ConnectionStep6ConnectedAgentsUpdate): string { - return JSON.stringify(uncast(value, r("ConnectionStep6ConnectedAgentsUpdate")), null, 2); - } - - public static toFindInstancesAgentErrorResponse(json: string): FindInstancesAgentErrorResponse { - return cast(JSON.parse(json), r("FindInstancesAgentErrorResponse")); - } - - public static findInstancesAgentErrorResponseToJson(value: FindInstancesAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("FindInstancesAgentErrorResponse")), null, 2); - } - - public static toFindInstancesAgentRequest(json: string): FindInstancesAgentRequest { - return cast(JSON.parse(json), r("FindInstancesAgentRequest")); - } - - public static findInstancesAgentRequestToJson(value: FindInstancesAgentRequest): string { - return JSON.stringify(uncast(value, r("FindInstancesAgentRequest")), null, 2); - } - - public static toFindInstancesAgentResponse(json: string): FindInstancesAgentResponse { - return cast(JSON.parse(json), r("FindInstancesAgentResponse")); - } - - public static findInstancesAgentResponseToJson(value: FindInstancesAgentResponse): string { - return JSON.stringify(uncast(value, r("FindInstancesAgentResponse")), null, 2); - } - - public static toFindInstancesBridgeErrorResponse(json: string): FindInstancesBridgeErrorResponse { - return cast(JSON.parse(json), r("FindInstancesBridgeErrorResponse")); - } - - public static findInstancesBridgeErrorResponseToJson(value: FindInstancesBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("FindInstancesBridgeErrorResponse")), null, 2); - } - - public static toFindInstancesBridgeRequest(json: string): FindInstancesBridgeRequest { - return cast(JSON.parse(json), r("FindInstancesBridgeRequest")); - } - - public static findInstancesBridgeRequestToJson(value: FindInstancesBridgeRequest): string { - return JSON.stringify(uncast(value, r("FindInstancesBridgeRequest")), null, 2); - } - - public static toFindInstancesBridgeResponse(json: string): FindInstancesBridgeResponse { - return cast(JSON.parse(json), r("FindInstancesBridgeResponse")); - } - - public static findInstancesBridgeResponseToJson(value: FindInstancesBridgeResponse): string { - return JSON.stringify(uncast(value, r("FindInstancesBridgeResponse")), null, 2); - } - - public static toFindIntentAgentErrorResponse(json: string): FindIntentAgentErrorResponse { - return cast(JSON.parse(json), r("FindIntentAgentErrorResponse")); - } - - public static findIntentAgentErrorResponseToJson(value: FindIntentAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("FindIntentAgentErrorResponse")), null, 2); - } - - public static toFindIntentAgentRequest(json: string): FindIntentAgentRequest { - return cast(JSON.parse(json), r("FindIntentAgentRequest")); - } - - public static findIntentAgentRequestToJson(value: FindIntentAgentRequest): string { - return JSON.stringify(uncast(value, r("FindIntentAgentRequest")), null, 2); - } - - public static toFindIntentAgentResponse(json: string): FindIntentAgentResponse { - return cast(JSON.parse(json), r("FindIntentAgentResponse")); - } - - public static findIntentAgentResponseToJson(value: FindIntentAgentResponse): string { - return JSON.stringify(uncast(value, r("FindIntentAgentResponse")), null, 2); - } - - public static toFindIntentBridgeErrorResponse(json: string): FindIntentBridgeErrorResponse { - return cast(JSON.parse(json), r("FindIntentBridgeErrorResponse")); - } - - public static findIntentBridgeErrorResponseToJson(value: FindIntentBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("FindIntentBridgeErrorResponse")), null, 2); - } - - public static toFindIntentBridgeRequest(json: string): FindIntentBridgeRequest { - return cast(JSON.parse(json), r("FindIntentBridgeRequest")); - } - - public static findIntentBridgeRequestToJson(value: FindIntentBridgeRequest): string { - return JSON.stringify(uncast(value, r("FindIntentBridgeRequest")), null, 2); - } - - public static toFindIntentBridgeResponse(json: string): FindIntentBridgeResponse { - return cast(JSON.parse(json), r("FindIntentBridgeResponse")); - } - - public static findIntentBridgeResponseToJson(value: FindIntentBridgeResponse): string { - return JSON.stringify(uncast(value, r("FindIntentBridgeResponse")), null, 2); - } - - public static toFindIntentsByContextAgentErrorResponse(json: string): FindIntentsByContextAgentErrorResponse { - return cast(JSON.parse(json), r("FindIntentsByContextAgentErrorResponse")); - } - - public static findIntentsByContextAgentErrorResponseToJson(value: FindIntentsByContextAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextAgentErrorResponse")), null, 2); - } - - public static toFindIntentsByContextAgentRequest(json: string): FindIntentsByContextAgentRequest { - return cast(JSON.parse(json), r("FindIntentsByContextAgentRequest")); - } - - public static findIntentsByContextAgentRequestToJson(value: FindIntentsByContextAgentRequest): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextAgentRequest")), null, 2); - } - - public static toFindIntentsByContextAgentResponse(json: string): FindIntentsByContextAgentResponse { - return cast(JSON.parse(json), r("FindIntentsByContextAgentResponse")); - } - - public static findIntentsByContextAgentResponseToJson(value: FindIntentsByContextAgentResponse): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextAgentResponse")), null, 2); - } - - public static toFindIntentsByContextBridgeErrorResponse(json: string): FindIntentsByContextBridgeErrorResponse { - return cast(JSON.parse(json), r("FindIntentsByContextBridgeErrorResponse")); - } - - public static findIntentsByContextBridgeErrorResponseToJson(value: FindIntentsByContextBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeErrorResponse")), null, 2); - } - - public static toFindIntentsByContextBridgeRequest(json: string): FindIntentsByContextBridgeRequest { - return cast(JSON.parse(json), r("FindIntentsByContextBridgeRequest")); - } - - public static findIntentsByContextBridgeRequestToJson(value: FindIntentsByContextBridgeRequest): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeRequest")), null, 2); - } - - public static toFindIntentsByContextBridgeResponse(json: string): FindIntentsByContextBridgeResponse { - return cast(JSON.parse(json), r("FindIntentsByContextBridgeResponse")); - } - - public static findIntentsByContextBridgeResponseToJson(value: FindIntentsByContextBridgeResponse): string { - return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeResponse")), null, 2); - } - - public static toGetAppMetadataAgentErrorResponse(json: string): GetAppMetadataAgentErrorResponse { - return cast(JSON.parse(json), r("GetAppMetadataAgentErrorResponse")); - } - - public static getAppMetadataAgentErrorResponseToJson(value: GetAppMetadataAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("GetAppMetadataAgentErrorResponse")), null, 2); - } - - public static toGetAppMetadataAgentRequest(json: string): GetAppMetadataAgentRequest { - return cast(JSON.parse(json), r("GetAppMetadataAgentRequest")); - } - - public static getAppMetadataAgentRequestToJson(value: GetAppMetadataAgentRequest): string { - return JSON.stringify(uncast(value, r("GetAppMetadataAgentRequest")), null, 2); - } - - public static toGetAppMetadataAgentResponse(json: string): GetAppMetadataAgentResponse { - return cast(JSON.parse(json), r("GetAppMetadataAgentResponse")); - } - - public static getAppMetadataAgentResponseToJson(value: GetAppMetadataAgentResponse): string { - return JSON.stringify(uncast(value, r("GetAppMetadataAgentResponse")), null, 2); - } - - public static toGetAppMetadataBridgeErrorResponse(json: string): GetAppMetadataBridgeErrorResponse { - return cast(JSON.parse(json), r("GetAppMetadataBridgeErrorResponse")); - } - - public static getAppMetadataBridgeErrorResponseToJson(value: GetAppMetadataBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("GetAppMetadataBridgeErrorResponse")), null, 2); - } - - public static toGetAppMetadataBridgeRequest(json: string): GetAppMetadataBridgeRequest { - return cast(JSON.parse(json), r("GetAppMetadataBridgeRequest")); - } - - public static getAppMetadataBridgeRequestToJson(value: GetAppMetadataBridgeRequest): string { - return JSON.stringify(uncast(value, r("GetAppMetadataBridgeRequest")), null, 2); - } - - public static toGetAppMetadataBridgeResponse(json: string): GetAppMetadataBridgeResponse { - return cast(JSON.parse(json), r("GetAppMetadataBridgeResponse")); - } - - public static getAppMetadataBridgeResponseToJson(value: GetAppMetadataBridgeResponse): string { - return JSON.stringify(uncast(value, r("GetAppMetadataBridgeResponse")), null, 2); - } - - public static toOpenAgentErrorResponse(json: string): OpenAgentErrorResponse { - return cast(JSON.parse(json), r("OpenAgentErrorResponse")); - } - - public static openAgentErrorResponseToJson(value: OpenAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("OpenAgentErrorResponse")), null, 2); - } - - public static toOpenAgentRequest(json: string): OpenAgentRequest { - return cast(JSON.parse(json), r("OpenAgentRequest")); - } - - public static openAgentRequestToJson(value: OpenAgentRequest): string { - return JSON.stringify(uncast(value, r("OpenAgentRequest")), null, 2); - } - - public static toOpenAgentResponse(json: string): OpenAgentResponse { - return cast(JSON.parse(json), r("OpenAgentResponse")); - } - - public static openAgentResponseToJson(value: OpenAgentResponse): string { - return JSON.stringify(uncast(value, r("OpenAgentResponse")), null, 2); - } - - public static toOpenBridgeErrorResponse(json: string): OpenBridgeErrorResponse { - return cast(JSON.parse(json), r("OpenBridgeErrorResponse")); - } - - public static openBridgeErrorResponseToJson(value: OpenBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("OpenBridgeErrorResponse")), null, 2); - } - - public static toOpenBridgeRequest(json: string): OpenBridgeRequest { - return cast(JSON.parse(json), r("OpenBridgeRequest")); - } - - public static openBridgeRequestToJson(value: OpenBridgeRequest): string { - return JSON.stringify(uncast(value, r("OpenBridgeRequest")), null, 2); - } - - public static toOpenBridgeResponse(json: string): OpenBridgeResponse { - return cast(JSON.parse(json), r("OpenBridgeResponse")); - } - - public static openBridgeResponseToJson(value: OpenBridgeResponse): string { - return JSON.stringify(uncast(value, r("OpenBridgeResponse")), null, 2); - } - - public static toPrivateChannelBroadcastAgentRequest(json: string): PrivateChannelBroadcastAgentRequest { - return cast(JSON.parse(json), r("PrivateChannelBroadcastAgentRequest")); - } - - public static privateChannelBroadcastAgentRequestToJson(value: PrivateChannelBroadcastAgentRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelBroadcastAgentRequest")), null, 2); - } - - public static toPrivateChannelBroadcastBridgeRequest(json: string): PrivateChannelBroadcastBridgeRequest { - return cast(JSON.parse(json), r("PrivateChannelBroadcastBridgeRequest")); - } - - public static privateChannelBroadcastBridgeRequestToJson(value: PrivateChannelBroadcastBridgeRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelBroadcastBridgeRequest")), null, 2); - } - - public static toPrivateChannelEventListenerAddedAgentRequest(json: string): PrivateChannelEventListenerAddedAgentRequest { - return cast(JSON.parse(json), r("PrivateChannelEventListenerAddedAgentRequest")); - } - - public static privateChannelEventListenerAddedAgentRequestToJson(value: PrivateChannelEventListenerAddedAgentRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelEventListenerAddedAgentRequest")), null, 2); - } - - public static toPrivateChannelEventListenerAddedBridgeRequest(json: string): PrivateChannelEventListenerAddedBridgeRequest { - return cast(JSON.parse(json), r("PrivateChannelEventListenerAddedBridgeRequest")); - } - - public static privateChannelEventListenerAddedBridgeRequestToJson(value: PrivateChannelEventListenerAddedBridgeRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelEventListenerAddedBridgeRequest")), null, 2); - } - - public static toPrivateChannelEventListenerRemovedAgentRequest(json: string): PrivateChannelEventListenerRemovedAgentRequest { - return cast(JSON.parse(json), r("PrivateChannelEventListenerRemovedAgentRequest")); - } - - public static privateChannelEventListenerRemovedAgentRequestToJson(value: PrivateChannelEventListenerRemovedAgentRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelEventListenerRemovedAgentRequest")), null, 2); - } - - public static toPrivateChannelEventListenerRemovedBridgeRequest(json: string): PrivateChannelEventListenerRemovedBridgeRequest { - return cast(JSON.parse(json), r("PrivateChannelEventListenerRemovedBridgeRequest")); - } - - public static privateChannelEventListenerRemovedBridgeRequestToJson(value: PrivateChannelEventListenerRemovedBridgeRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelEventListenerRemovedBridgeRequest")), null, 2); - } - - public static toPrivateChannelOnAddContextListenerAgentRequest(json: string): PrivateChannelOnAddContextListenerAgentRequest { - return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerAgentRequest")); - } - - public static privateChannelOnAddContextListenerAgentRequestToJson(value: PrivateChannelOnAddContextListenerAgentRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerAgentRequest")), null, 2); - } - - public static toPrivateChannelOnAddContextListenerBridgeRequest(json: string): PrivateChannelOnAddContextListenerBridgeRequest { - return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerBridgeRequest")); - } - - public static privateChannelOnAddContextListenerBridgeRequestToJson(value: PrivateChannelOnAddContextListenerBridgeRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerBridgeRequest")), null, 2); - } - - public static toPrivateChannelOnDisconnectAgentRequest(json: string): PrivateChannelOnDisconnectAgentRequest { - return cast(JSON.parse(json), r("PrivateChannelOnDisconnectAgentRequest")); - } - - public static privateChannelOnDisconnectAgentRequestToJson(value: PrivateChannelOnDisconnectAgentRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectAgentRequest")), null, 2); - } - - public static toPrivateChannelOnDisconnectBridgeRequest(json: string): PrivateChannelOnDisconnectBridgeRequest { - return cast(JSON.parse(json), r("PrivateChannelOnDisconnectBridgeRequest")); - } - - public static privateChannelOnDisconnectBridgeRequestToJson(value: PrivateChannelOnDisconnectBridgeRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectBridgeRequest")), null, 2); - } - - public static toPrivateChannelOnUnsubscribeAgentRequest(json: string): PrivateChannelOnUnsubscribeAgentRequest { - return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeAgentRequest")); - } - - public static privateChannelOnUnsubscribeAgentRequestToJson(value: PrivateChannelOnUnsubscribeAgentRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeAgentRequest")), null, 2); - } - - public static toPrivateChannelOnUnsubscribeBridgeRequest(json: string): PrivateChannelOnUnsubscribeBridgeRequest { - return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeBridgeRequest")); - } - - public static privateChannelOnUnsubscribeBridgeRequestToJson(value: PrivateChannelOnUnsubscribeBridgeRequest): string { - return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeBridgeRequest")), null, 2); - } - - public static toRaiseIntentAgentErrorResponse(json: string): RaiseIntentAgentErrorResponse { - return cast(JSON.parse(json), r("RaiseIntentAgentErrorResponse")); - } - - public static raiseIntentAgentErrorResponseToJson(value: RaiseIntentAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentAgentErrorResponse")), null, 2); - } - - public static toRaiseIntentAgentRequest(json: string): RaiseIntentAgentRequest { - return cast(JSON.parse(json), r("RaiseIntentAgentRequest")); - } - - public static raiseIntentAgentRequestToJson(value: RaiseIntentAgentRequest): string { - return JSON.stringify(uncast(value, r("RaiseIntentAgentRequest")), null, 2); - } - - public static toRaiseIntentAgentResponse(json: string): RaiseIntentAgentResponse { - return cast(JSON.parse(json), r("RaiseIntentAgentResponse")); - } - - public static raiseIntentAgentResponseToJson(value: RaiseIntentAgentResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentAgentResponse")), null, 2); - } - - public static toRaiseIntentBridgeErrorResponse(json: string): RaiseIntentBridgeErrorResponse { - return cast(JSON.parse(json), r("RaiseIntentBridgeErrorResponse")); - } - - public static raiseIntentBridgeErrorResponseToJson(value: RaiseIntentBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentBridgeErrorResponse")), null, 2); - } - - public static toRaiseIntentBridgeRequest(json: string): RaiseIntentBridgeRequest { - return cast(JSON.parse(json), r("RaiseIntentBridgeRequest")); - } - - public static raiseIntentBridgeRequestToJson(value: RaiseIntentBridgeRequest): string { - return JSON.stringify(uncast(value, r("RaiseIntentBridgeRequest")), null, 2); - } - - public static toRaiseIntentBridgeResponse(json: string): RaiseIntentBridgeResponse { - return cast(JSON.parse(json), r("RaiseIntentBridgeResponse")); - } - - public static raiseIntentBridgeResponseToJson(value: RaiseIntentBridgeResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentBridgeResponse")), null, 2); - } - - public static toRaiseIntentResultAgentErrorResponse(json: string): RaiseIntentResultAgentErrorResponse { - return cast(JSON.parse(json), r("RaiseIntentResultAgentErrorResponse")); - } - - public static raiseIntentResultAgentErrorResponseToJson(value: RaiseIntentResultAgentErrorResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentResultAgentErrorResponse")), null, 2); - } - - public static toRaiseIntentResultAgentResponse(json: string): RaiseIntentResultAgentResponse { - return cast(JSON.parse(json), r("RaiseIntentResultAgentResponse")); - } - - public static raiseIntentResultAgentResponseToJson(value: RaiseIntentResultAgentResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentResultAgentResponse")), null, 2); - } - - public static toRaiseIntentResultBridgeErrorResponse(json: string): RaiseIntentResultBridgeErrorResponse { - return cast(JSON.parse(json), r("RaiseIntentResultBridgeErrorResponse")); - } - - public static raiseIntentResultBridgeErrorResponseToJson(value: RaiseIntentResultBridgeErrorResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentResultBridgeErrorResponse")), null, 2); - } - - public static toRaiseIntentResultBridgeResponse(json: string): RaiseIntentResultBridgeResponse { - return cast(JSON.parse(json), r("RaiseIntentResultBridgeResponse")); - } - - public static raiseIntentResultBridgeResponseToJson(value: RaiseIntentResultBridgeResponse): string { - return JSON.stringify(uncast(value, r("RaiseIntentResultBridgeResponse")), null, 2); - } -} - -function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { - const prettyTyp = prettyTypeName(typ); - const parentText = parent ? ` on ${parent}` : ''; - const keyText = key ? ` for key "${key}"` : ''; - throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); -} - -function prettyTypeName(typ: any): string { - if (Array.isArray(typ)) { - if (typ.length === 2 && typ[0] === undefined) { - return `an optional ${prettyTypeName(typ[1])}`; - } else { - return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; - } - } else if (typeof typ === "object" && typ.literal !== undefined) { - return typ.literal; - } else { - return typeof typ; - } -} - -function jsonToJSProps(typ: any): any { - if (typ.jsonToJS === undefined) { - const map: any = {}; - typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); - typ.jsonToJS = map; - } - return typ.jsonToJS; -} - -function jsToJSONProps(typ: any): any { - if (typ.jsToJSON === undefined) { - const map: any = {}; - typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); - typ.jsToJSON = map; - } - return typ.jsToJSON; -} - -function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { - function transformPrimitive(typ: string, val: any): any { - if (typeof typ === typeof val) return val; - return invalidValue(typ, val, key, parent); - } - - function transformUnion(typs: any[], val: any): any { - // val must validate against one typ in typs - const l = typs.length; - for (let i = 0; i < l; i++) { - const typ = typs[i]; - try { - return transform(val, typ, getProps); - } catch (_) {} - } - return invalidValue(typs, val, key, parent); - } - - function transformEnum(cases: string[], val: any): any { - if (cases.indexOf(val) !== -1) return val; - return invalidValue(cases.map(a => { return l(a); }), val, key, parent); - } - - function transformArray(typ: any, val: any): any { - // val must be an array with no invalid elements - if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); - return val.map(el => transform(el, typ, getProps)); - } - - function transformDate(val: any): any { - if (val === null) { - return null; - } - const d = new Date(val); - if (isNaN(d.valueOf())) { - return invalidValue(l("Date"), val, key, parent); - } - return d; - } - - function transformObject(props: { [k: string]: any }, additional: any, val: any): any { - if (val === null || typeof val !== "object" || Array.isArray(val)) { - return invalidValue(l(ref || "object"), val, key, parent); - } - const result: any = {}; - Object.getOwnPropertyNames(props).forEach(key => { - const prop = props[key]; - const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; - result[prop.key] = transform(v, prop.typ, getProps, key, ref); - }); - Object.getOwnPropertyNames(val).forEach(key => { - if (!Object.prototype.hasOwnProperty.call(props, key)) { - result[key] = transform(val[key], additional, getProps, key, ref); - } - }); - return result; - } - - if (typ === "any") return val; - if (typ === null) { - if (val === null) return val; - return invalidValue(typ, val, key, parent); - } - if (typ === false) return invalidValue(typ, val, key, parent); - let ref: any = undefined; - while (typeof typ === "object" && typ.ref !== undefined) { - ref = typ.ref; - typ = typeMap[typ.ref]; - } - if (Array.isArray(typ)) return transformEnum(typ, val); - if (typeof typ === "object") { - return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) - : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) - : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) - : invalidValue(typ, val, key, parent); - } - // Numbers can be parsed by Date but shouldn't be. - if (typ === Date && typeof val !== "number") return transformDate(val); - return transformPrimitive(typ, val); -} - -function cast(val: any, typ: any): T { - return transform(val, typ, jsonToJSProps); -} - -function uncast(val: T, typ: any): any { - return transform(val, typ, jsToJSONProps); -} - -function l(typ: any) { - return { literal: typ }; -} - -function a(typ: any) { - return { arrayItems: typ }; -} - -function u(...typs: any[]) { - return { unionMembers: typs }; -} - -function o(props: any[], additional: any) { - return { props, additional }; -} - -function m(additional: any) { - return { props: [], additional }; -} - -function r(name: string) { - return { ref: name }; -} - -const typeMap: any = { - "AgentErrorResponseMessage": o([ - { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, - { json: "payload", js: "payload", typ: r("ErrorResponseMessagePayload") }, - { json: "type", js: "type", typ: r("ResponseMessageType") }, - ], false), - "AgentResponseMetadata": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "ErrorResponseMessagePayload": o([ - { json: "error", js: "error", typ: r("ResponseErrorDetail") }, - ], "any"), - "AgentRequestMessage": o([ - { json: "meta", js: "meta", typ: r("AgentRequestMetadata") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("RequestMessageType") }, - ], false), - "AgentRequestMetadata": o([ - { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "BridgeParticipantIdentifier": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "appId", js: "appId", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "SourceIdentifier": o([ - { json: "appId", js: "appId", typ: u(undefined, "") }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "AgentResponseMessage": o([ - { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("ResponseMessageType") }, - ], false), - "BridgeErrorResponseMessage": o([ - { json: "meta", js: "meta", typ: r("BridgeErrorResponseMessageMeta") }, - { json: "payload", js: "payload", typ: r("ResponseErrorMessagePayload") }, - { json: "type", js: "type", typ: "" }, - ], false), - "BridgeErrorResponseMessageMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "DesktopAgentIdentifier": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - ], "any"), - "ResponseErrorMessagePayload": o([ - { json: "error", js: "error", typ: u(undefined, r("ResponseErrorDetail")) }, - ], "any"), - "BridgeRequestMessage": o([ - { json: "meta", js: "meta", typ: r("BridgeRequestMetadata") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: "" }, - ], false), - "BridgeRequestMetadata": o([ - { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("BridgeParticipantIdentifier") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "BridgeResponseMessage": o([ - { json: "meta", js: "meta", typ: r("BridgeResponseMessageMeta") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: "" }, - ], false), - "BridgeResponseMessageMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "BroadcastAgentRequest": o([ - { json: "meta", js: "meta", typ: r("BroadcastAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastAgentRequestPayload") }, - { json: "type", js: "type", typ: r("BroadcastAgentRequestType") }, - ], false), - "BroadcastAgentRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("SourceObject") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "SourceObject": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "BroadcastAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "Context": o([ - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: "" }, - ], "any"), - "BroadcastBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("BroadcastBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("BroadcastBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("BroadcastAgentRequestType") }, - ], false), - "BroadcastBridgeRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "MetaSource": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "BroadcastBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "ConnectionStepMessage": o([ - { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, - { json: "payload", js: "payload", typ: m("any") }, - { json: "type", js: "type", typ: r("ConnectionStepMessageType") }, - ], false), - "ConnectionStepMetadata": o([ - { json: "requestUuid", js: "requestUuid", typ: u(undefined, "") }, - { json: "responseUuid", js: "responseUuid", typ: u(undefined, "") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "ConnectionStep2Hello": o([ - { json: "meta", js: "meta", typ: r("ConnectionStep2HelloMeta") }, - { json: "payload", js: "payload", typ: r("ConnectionStep2HelloPayload") }, - { json: "type", js: "type", typ: r("ConnectionStep2HelloType") }, - ], false), - "ConnectionStep2HelloMeta": o([ - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "ConnectionStep2HelloPayload": o([ - { json: "authRequired", js: "authRequired", typ: true }, - { json: "authToken", js: "authToken", typ: u(undefined, "") }, - { json: "desktopAgentBridgeVersion", js: "desktopAgentBridgeVersion", typ: "" }, - { json: "supportedFDC3Versions", js: "supportedFDC3Versions", typ: a("") }, - ], false), - "ConnectionStep3Handshake": o([ - { json: "meta", js: "meta", typ: r("ConnectionStep3HandshakeMeta") }, - { json: "payload", js: "payload", typ: r("ConnectionStep3HandshakePayload") }, - { json: "type", js: "type", typ: r("ConnectionStep3HandshakeType") }, - ], false), - "ConnectionStep3HandshakeMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "ConnectionStep3HandshakePayload": o([ - { json: "authToken", js: "authToken", typ: u(undefined, "") }, - { json: "channelsState", js: "channelsState", typ: m(a(r("Context"))) }, - { json: "implementationMetadata", js: "implementationMetadata", typ: r("ConnectingAgentImplementationMetadata") }, - { json: "requestedName", js: "requestedName", typ: "" }, - ], false), - "ConnectingAgentImplementationMetadata": o([ - { json: "fdc3Version", js: "fdc3Version", typ: "" }, - { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, - { json: "provider", js: "provider", typ: "" }, - { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, - ], false), - "OptionalFeatures": o([ - { json: "DesktopAgentBridging", js: "DesktopAgentBridging", typ: true }, - { json: "OriginatingAppMetadata", js: "OriginatingAppMetadata", typ: true }, - { json: "UserChannelMembershipAPIs", js: "UserChannelMembershipAPIs", typ: true }, - ], false), - "ConnectionStep4AuthenticationFailed": o([ - { json: "meta", js: "meta", typ: r("ConnectionStep4AuthenticationFailedMeta") }, - { json: "payload", js: "payload", typ: r("ConnectionStep4AuthenticationFailedPayload") }, - { json: "type", js: "type", typ: r("ConnectionStep4AuthenticationFailedType") }, - ], false), - "ConnectionStep4AuthenticationFailedMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "ConnectionStep4AuthenticationFailedPayload": o([ - { json: "message", js: "message", typ: u(undefined, "") }, - ], false), - "ConnectionStep6ConnectedAgentsUpdate": o([ - { json: "meta", js: "meta", typ: r("ConnectionStep6ConnectedAgentsUpdateMeta") }, - { json: "payload", js: "payload", typ: r("ConnectionStep6ConnectedAgentsUpdatePayload") }, - { json: "type", js: "type", typ: r("ConnectionStep6ConnectedAgentsUpdateType") }, - ], false), - "ConnectionStep6ConnectedAgentsUpdateMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "ConnectionStep6ConnectedAgentsUpdatePayload": o([ - { json: "addAgent", js: "addAgent", typ: u(undefined, "") }, - { json: "allAgents", js: "allAgents", typ: a(r("DesktopAgentImplementationMetadata")) }, - { json: "channelsState", js: "channelsState", typ: u(undefined, m(a(r("Context")))) }, - { json: "removeAgent", js: "removeAgent", typ: u(undefined, "") }, - ], false), - "DesktopAgentImplementationMetadata": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "fdc3Version", js: "fdc3Version", typ: "" }, - { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, - { json: "provider", js: "provider", typ: "" }, - { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, - ], false), - "FindInstancesAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("FindInstancesAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("PayloadClass") }, - { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, - ], false), - "FindInstancesAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PayloadClass": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "FindInstancesAgentRequest": o([ - { json: "meta", js: "meta", typ: r("FindInstancesAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindInstancesAgentRequestPayload") }, - { json: "type", js: "type", typ: r("FindInstancesAgentRequestType") }, - ], false), - "FindInstancesAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "DestinationObject": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "appId", js: "appId", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "FindInstancesAgentRequestPayload": o([ - { json: "app", js: "app", typ: r("AppIdentifier") }, - ], false), - "AppIdentifier": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "FindInstancesAgentResponse": o([ - { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, - { json: "payload", js: "payload", typ: r("FindInstancesAgentResponsePayload") }, - { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, - ], false), - "FindInstancesAgentResponsePayload": o([ - { json: "appIdentifiers", js: "appIdentifiers", typ: a(r("AppMetadata")) }, - ], false), - "AppMetadata": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "description", js: "description", typ: u(undefined, "") }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "icons", js: "icons", typ: u(undefined, a(r("Icon"))) }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - { json: "instanceMetadata", js: "instanceMetadata", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "resultType", js: "resultType", typ: u(undefined, u(null, "")) }, - { json: "screenshots", js: "screenshots", typ: u(undefined, a(r("Image"))) }, - { json: "title", js: "title", typ: u(undefined, "") }, - { json: "tooltip", js: "tooltip", typ: u(undefined, "") }, - { json: "version", js: "version", typ: u(undefined, "") }, - ], false), - "Icon": o([ - { json: "size", js: "size", typ: u(undefined, "") }, - { json: "src", js: "src", typ: "" }, - { json: "type", js: "type", typ: u(undefined, "") }, - ], false), - "Image": o([ - { json: "label", js: "label", typ: u(undefined, "") }, - { json: "size", js: "size", typ: u(undefined, "") }, - { json: "src", js: "src", typ: "" }, - { json: "type", js: "type", typ: u(undefined, "") }, - ], false), - "FindInstancesBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("FindInstancesBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("MessagePayload") }, - { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, - ], false), - "FindInstancesBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "MessagePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "FindInstancesBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("FindInstancesBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindInstancesBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("FindInstancesAgentRequestType") }, - ], false), - "FindInstancesBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSourceObject") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "MetaSourceObject": o([ - { json: "appId", js: "appId", typ: u(undefined, "") }, - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "FindInstancesBridgeRequestPayload": o([ - { json: "app", js: "app", typ: r("AppIdentifier") }, - ], false), - "FindInstancesBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("BridgeResponseMessageMeta") }, - { json: "payload", js: "payload", typ: r("FindInstancesBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, - ], false), - "FindInstancesBridgeResponsePayload": o([ - { json: "appIdentifiers", js: "appIdentifiers", typ: a(r("AppMetadata")) }, - ], false), - "FindIntentAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentAgentErrorResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, - ], false), - "FindIntentAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentAgentErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "FindIntentAgentRequest": o([ - { json: "meta", js: "meta", typ: r("FindIntentAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentAgentRequestPayload") }, - { json: "type", js: "type", typ: r("FindIntentAgentRequestType") }, - ], false), - "FindIntentAgentRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, - ], false), - "FindIntentAgentRequestPayload": o([ - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - { json: "intent", js: "intent", typ: "" }, - { json: "resultType", js: "resultType", typ: u(undefined, "") }, - ], false), - "FindIntentAgentResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentAgentResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentAgentResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, - ], false), - "FindIntentAgentResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentAgentResponsePayload": o([ - { json: "appIntent", js: "appIntent", typ: r("AppIntent") }, - ], false), - "AppIntent": o([ - { json: "apps", js: "apps", typ: a(r("AppMetadata")) }, - { json: "intent", js: "intent", typ: r("IntentMetadata") }, - ], false), - "IntentMetadata": o([ - { json: "displayName", js: "displayName", typ: u(undefined, "") }, - { json: "name", js: "name", typ: "" }, - ], false), - "FindIntentBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentBridgeErrorResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, - ], false), - "FindIntentBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentBridgeErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "FindIntentBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("FindIntentBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("FindIntentAgentRequestType") }, - ], false), - "FindIntentBridgeRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("BridgeParticipantIdentifier") }, - { json: "timestamp", js: "timestamp", typ: Date }, - { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, - ], false), - "FindIntentBridgeRequestPayload": o([ - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - { json: "intent", js: "intent", typ: "" }, - { json: "resultType", js: "resultType", typ: u(undefined, "") }, - ], false), - "FindIntentBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentBridgeResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, - ], false), - "FindIntentBridgeResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentBridgeResponsePayload": o([ - { json: "appIntent", js: "appIntent", typ: r("AppIntent") }, - ], false), - "FindIntentsByContextAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentErrorResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, - ], false), - "FindIntentsByContextAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentsByContextAgentErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "FindIntentsByContextAgentRequest": o([ - { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentRequestPayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextAgentRequestType") }, - ], false), - "FindIntentsByContextAgentRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, - ], false), - "FindIntentsByContextAgentRequestPayload": o([ - { json: "context", js: "context", typ: r("Context") }, - { json: "resultType", js: "resultType", typ: u(undefined, "") }, - ], false), - "FindIntentsByContextAgentResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, - ], false), - "FindIntentsByContextAgentResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentsByContextAgentResponsePayload": o([ - { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, - ], false), - "FindIntentsByContextBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeErrorResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, - ], false), - "FindIntentsByContextBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentsByContextBridgeErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "FindIntentsByContextBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextAgentRequestType") }, - ], false), - "FindIntentsByContextBridgeRequestMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, - ], false), - "FindIntentsByContextBridgeRequestPayload": o([ - { json: "context", js: "context", typ: r("Context") }, - { json: "resultType", js: "resultType", typ: u(undefined, "") }, - ], false), - "FindIntentsByContextBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeResponseMeta") }, - { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, - ], false), - "FindIntentsByContextBridgeResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "FindIntentsByContextBridgeResponsePayload": o([ - { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, - ], false), - "GetAppMetadataAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("GetAppMetadataAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataAgentErrorResponsePayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, - ], false), - "GetAppMetadataAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "GetAppMetadataAgentErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "GetAppMetadataAgentRequest": o([ - { json: "meta", js: "meta", typ: r("GetAppMetadataAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataAgentRequestPayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataAgentRequestType") }, - ], false), - "GetAppMetadataAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "GetAppMetadataAgentRequestPayload": o([ - { json: "app", js: "app", typ: r("AppObject") }, - ], false), - "AppObject": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "appId", js: "appId", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "GetAppMetadataAgentResponse": o([ - { json: "meta", js: "meta", typ: r("GetAppMetadataAgentResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataAgentResponsePayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, - ], false), - "GetAppMetadataAgentResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "GetAppMetadataAgentResponsePayload": o([ - { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, - ], false), - "GetAppMetadataBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeErrorResponsePayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, - ], false), - "GetAppMetadataBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "GetAppMetadataBridgeErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "GetAppMetadataBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataAgentRequestType") }, - ], false), - "GetAppMetadataBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSourceObject") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "GetAppMetadataBridgeRequestPayload": o([ - { json: "app", js: "app", typ: r("AppObject") }, - ], false), - "GetAppMetadataBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeResponseMeta") }, - { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, - ], false), - "GetAppMetadataBridgeResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "GetAppMetadataBridgeResponsePayload": o([ - { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, - ], false), - "OpenAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("OpenAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("OpenAgentErrorResponsePayload") }, - { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, - ], false), - "OpenAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "OpenAgentErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("OpenErrorResponsePayload") }, - ], false), - "OpenAgentRequest": o([ - { json: "meta", js: "meta", typ: r("OpenAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("OpenAgentRequestPayload") }, - { json: "type", js: "type", typ: r("OpenAgentRequestType") }, - ], false), - "OpenAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("SourceObject") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "OpenAgentRequestPayload": o([ - { json: "app", js: "app", typ: r("AppToOpen") }, - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - ], false), - "AppToOpen": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "appId", js: "appId", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "OpenAgentResponse": o([ - { json: "meta", js: "meta", typ: r("OpenAgentResponseMeta") }, - { json: "payload", js: "payload", typ: r("OpenAgentResponsePayload") }, - { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, - ], false), - "OpenAgentResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "OpenAgentResponsePayload": o([ - { json: "appIdentifier", js: "appIdentifier", typ: r("AppIdentifier") }, - ], false), - "OpenBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("OpenBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("OpenBridgeErrorResponsePayload") }, - { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, - ], false), - "OpenBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "OpenBridgeErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("OpenErrorResponsePayload") }, - ], false), - "OpenBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("OpenBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("OpenBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("OpenAgentRequestType") }, - ], false), - "OpenBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "OpenBridgeRequestPayload": o([ - { json: "app", js: "app", typ: r("AppToOpen") }, - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - ], false), - "OpenBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("OpenBridgeResponseMeta") }, - { json: "payload", js: "payload", typ: r("OpenBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, - ], false), - "OpenBridgeResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "OpenBridgeResponsePayload": o([ - { json: "appIdentifier", js: "appIdentifier", typ: r("AppIdentifier") }, - ], false), - "PrivateChannelBroadcastAgentRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelBroadcastAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelBroadcastAgentRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelBroadcastAgentRequestType") }, - ], false), - "PrivateChannelBroadcastAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "MetaDestination": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "appId", js: "appId", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "PrivateChannelBroadcastAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "PrivateChannelBroadcastBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelBroadcastBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelBroadcastBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelBroadcastAgentRequestType") }, - ], false), - "PrivateChannelBroadcastBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelBroadcastBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "context", js: "context", typ: r("Context") }, - ], false), - "PrivateChannelEventListenerAddedAgentRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerAddedAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerAddedAgentRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelEventListenerAddedAgentRequestType") }, - ], false), - "PrivateChannelEventListenerAddedAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelEventListenerAddedAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, - ], false), - "PrivateChannelEventListenerAddedBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerAddedBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerAddedBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelEventListenerAddedAgentRequestType") }, - ], false), - "PrivateChannelEventListenerAddedBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelEventListenerAddedBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, - ], false), - "PrivateChannelEventListenerRemovedAgentRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerRemovedAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerRemovedAgentRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelEventListenerRemovedAgentRequestType") }, - ], false), - "PrivateChannelEventListenerRemovedAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelEventListenerRemovedAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, - ], false), - "PrivateChannelEventListenerRemovedBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerRemovedBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerRemovedBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelEventListenerRemovedAgentRequestType") }, - ], false), - "PrivateChannelEventListenerRemovedBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelEventListenerRemovedBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, - ], false), - "PrivateChannelOnAddContextListenerAgentRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelOnAddContextListenerAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerAgentRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerAgentRequestType") }, - ], false), - "PrivateChannelOnAddContextListenerAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelOnAddContextListenerAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "contextType", js: "contextType", typ: u(null, "") }, - ], false), - "PrivateChannelOnAddContextListenerBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelOnAddContextListenerBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerAgentRequestType") }, - ], false), - "PrivateChannelOnAddContextListenerBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelOnAddContextListenerBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "contextType", js: "contextType", typ: u(null, "") }, - ], false), - "PrivateChannelOnDisconnectAgentRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelOnDisconnectAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectAgentRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectAgentRequestType") }, - ], false), - "PrivateChannelOnDisconnectAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelOnDisconnectAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - ], false), - "PrivateChannelOnDisconnectBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelOnDisconnectBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectAgentRequestType") }, - ], false), - "PrivateChannelOnDisconnectBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelOnDisconnectBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - ], false), - "PrivateChannelOnUnsubscribeAgentRequest": o([ - { json: "meta", js: "meta", typ: r("PrivateChannelOnUnsubscribeAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeAgentRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeAgentRequestType") }, - ], false), - "PrivateChannelOnUnsubscribeAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelOnUnsubscribeAgentRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "contextType", js: "contextType", typ: u(null, "") }, - ], false), - "PrivateChannelOnUnsubscribeBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("ERequestMetadata") }, - { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeAgentRequestType") }, - ], false), - "ERequestMetadata": o([ - { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "PrivateChannelOnUnsubscribeBridgeRequestPayload": o([ - { json: "channelId", js: "channelId", typ: "" }, - { json: "contextType", js: "contextType", typ: u(null, "") }, - ], false), - "RaiseIntentAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentAgentErrorResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, - ], false), - "RaiseIntentAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentAgentErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "RaiseIntentAgentRequest": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentAgentRequestMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentAgentRequestPayload") }, - { json: "type", js: "type", typ: r("RaiseIntentAgentRequestType") }, - ], false), - "RaiseIntentAgentRequestMeta": o([ - { json: "destination", js: "destination", typ: r("MetaDestination") }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("SourceObject") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentAgentRequestPayload": o([ - { json: "app", js: "app", typ: r("AppDestinationIdentifier") }, - { json: "context", js: "context", typ: r("Context") }, - { json: "intent", js: "intent", typ: "" }, - ], false), - "AppDestinationIdentifier": o([ - { json: "desktopAgent", js: "desktopAgent", typ: "" }, - { json: "appId", js: "appId", typ: "" }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "RaiseIntentAgentResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentAgentResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentAgentResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, - ], false), - "RaiseIntentAgentResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentAgentResponsePayload": o([ - { json: "intentResolution", js: "intentResolution", typ: r("IntentResolution") }, - ], false), - "IntentResolution": o([ - { json: "intent", js: "intent", typ: "" }, - { json: "source", js: "source", typ: r("AppIdentifier") }, - ], false), - "RaiseIntentBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentBridgeErrorResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, - ], false), - "RaiseIntentBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentBridgeErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("FindInstancesErrors") }, - ], false), - "RaiseIntentBridgeRequest": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentBridgeRequestMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentBridgeRequestPayload") }, - { json: "type", js: "type", typ: r("RaiseIntentAgentRequestType") }, - ], false), - "RaiseIntentBridgeRequestMeta": o([ - { json: "destination", js: "destination", typ: r("MetaDestination") }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "source", js: "source", typ: r("MetaSource") }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentBridgeRequestPayload": o([ - { json: "app", js: "app", typ: r("AppDestinationIdentifier") }, - { json: "context", js: "context", typ: r("Context") }, - { json: "intent", js: "intent", typ: "" }, - ], false), - "RaiseIntentBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentBridgeResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, - ], false), - "RaiseIntentBridgeResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentBridgeResponsePayload": o([ - { json: "intentResolution", js: "intentResolution", typ: r("IntentResolution") }, - ], false), - "RaiseIntentResultAgentErrorResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentResultAgentErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentResultAgentErrorResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, - ], false), - "RaiseIntentResultAgentErrorResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentResultAgentErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("RaiseIntentResultErrorMessage") }, - ], false), - "RaiseIntentResultAgentResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentResultAgentResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentResultAgentResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, - ], false), - "RaiseIntentResultAgentResponseMeta": o([ - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentResultAgentResponsePayload": o([ - { json: "intentResult", js: "intentResult", typ: r("IntentResult") }, - ], false), - "IntentResult": o([ - { json: "context", js: "context", typ: u(undefined, r("Context")) }, - { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, - ], false), - "Channel": o([ - { json: "displayMetadata", js: "displayMetadata", typ: u(undefined, r("DisplayMetadata")) }, - { json: "id", js: "id", typ: "" }, - { json: "type", js: "type", typ: r("Type") }, - ], false), - "DisplayMetadata": o([ - { json: "color", js: "color", typ: u(undefined, "") }, - { json: "glyph", js: "glyph", typ: u(undefined, "") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], false), - "RaiseIntentResultBridgeErrorResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentResultBridgeErrorResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentResultBridgeErrorResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, - ], false), - "RaiseIntentResultBridgeErrorResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, - { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentResultBridgeErrorResponsePayload": o([ - { json: "error", js: "error", typ: r("RaiseIntentResultErrorMessage") }, - ], false), - "RaiseIntentResultBridgeResponse": o([ - { json: "meta", js: "meta", typ: r("RaiseIntentResultBridgeResponseMeta") }, - { json: "payload", js: "payload", typ: r("RaiseIntentResultBridgeResponsePayload") }, - { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, - ], false), - "RaiseIntentResultBridgeResponseMeta": o([ - { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, - { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "requestUuid", js: "requestUuid", typ: "" }, - { json: "responseUuid", js: "responseUuid", typ: "" }, - { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, - { json: "timestamp", js: "timestamp", typ: Date }, - ], false), - "RaiseIntentResultBridgeResponsePayload": o([ - { json: "intentResult", js: "intentResult", typ: r("IntentResult") }, - ], false), - "ResponseErrorDetail": [ - "AccessDenied", - "AgentDisconnected", - "AppNotFound", - "AppTimeout", - "CreationFailed", - "DesktopAgentNotFound", - "ErrorOnLaunch", - "IntentDeliveryFailed", - "IntentHandlerRejected", - "MalformedContext", - "MalformedMessage", - "NoAppsFound", - "NoChannelFound", - "NoResultReturned", - "NotConnectedToBridge", - "ResolverTimeout", - "ResolverUnavailable", - "ResponseToBridgeTimedOut", - "TargetAppUnavailable", - "TargetInstanceUnavailable", - "UserCancelledResolution", - ], - "ResponseMessageType": [ - "findInstancesResponse", - "findIntentResponse", - "findIntentsByContextResponse", - "getAppMetadataResponse", - "openResponse", - "raiseIntentResponse", - "raiseIntentResultResponse", - ], - "RequestMessageType": [ - "broadcastRequest", - "findInstancesRequest", - "findIntentRequest", - "findIntentsByContextRequest", - "getAppMetadataRequest", - "openRequest", - "PrivateChannel.broadcast", - "PrivateChannel.eventListenerAdded", - "PrivateChannel.eventListenerRemoved", - "PrivateChannel.onAddContextListener", - "PrivateChannel.onDisconnect", - "PrivateChannel.onUnsubscribe", - "raiseIntentRequest", - ], - "BroadcastAgentRequestType": [ - "broadcastRequest", - ], - "ConnectionStepMessageType": [ - "authenticationFailed", - "connectedAgentsUpdate", - "handshake", - "hello", - ], - "ConnectionStep2HelloType": [ - "hello", - ], - "ConnectionStep3HandshakeType": [ - "handshake", - ], - "ConnectionStep4AuthenticationFailedType": [ - "authenticationFailed", - ], - "ConnectionStep6ConnectedAgentsUpdateType": [ - "connectedAgentsUpdate", - ], - "FindInstancesErrors": [ - "AgentDisconnected", - "DesktopAgentNotFound", - "IntentDeliveryFailed", - "MalformedContext", - "MalformedMessage", - "NoAppsFound", - "NotConnectedToBridge", - "ResolverTimeout", - "ResolverUnavailable", - "ResponseToBridgeTimedOut", - "TargetAppUnavailable", - "TargetInstanceUnavailable", - "UserCancelledResolution", - ], - "FindInstancesAgentErrorResponseType": [ - "findInstancesResponse", - ], - "FindInstancesAgentRequestType": [ - "findInstancesRequest", - ], - "FindIntentAgentErrorResponseType": [ - "findIntentResponse", - ], - "FindIntentAgentRequestType": [ - "findIntentRequest", - ], - "FindIntentsByContextAgentErrorResponseType": [ - "findIntentsByContextResponse", - ], - "FindIntentsByContextAgentRequestType": [ - "findIntentsByContextRequest", - ], - "GetAppMetadataAgentErrorResponseType": [ - "getAppMetadataResponse", - ], - "GetAppMetadataAgentRequestType": [ - "getAppMetadataRequest", - ], - "OpenErrorResponsePayload": [ - "AgentDisconnected", - "AppNotFound", - "AppTimeout", - "DesktopAgentNotFound", - "ErrorOnLaunch", - "MalformedContext", - "MalformedMessage", - "NotConnectedToBridge", - "ResolverUnavailable", - "ResponseToBridgeTimedOut", - ], - "OpenAgentErrorResponseType": [ - "openResponse", - ], - "OpenAgentRequestType": [ - "openRequest", - ], - "PrivateChannelBroadcastAgentRequestType": [ - "PrivateChannel.broadcast", - ], - "PrivateChannelEventListenerTypes": [ - "onAddContextListener", - "onDisconnect", - "onUnsubscribe", - ], - "PrivateChannelEventListenerAddedAgentRequestType": [ - "PrivateChannel.eventListenerAdded", - ], - "PrivateChannelEventListenerRemovedAgentRequestType": [ - "PrivateChannel.eventListenerRemoved", - ], - "PrivateChannelOnAddContextListenerAgentRequestType": [ - "PrivateChannel.onAddContextListener", - ], - "PrivateChannelOnDisconnectAgentRequestType": [ - "PrivateChannel.onDisconnect", - ], - "PrivateChannelOnUnsubscribeAgentRequestType": [ - "PrivateChannel.onUnsubscribe", - ], - "RaiseIntentAgentErrorResponseType": [ - "raiseIntentResponse", - ], - "RaiseIntentAgentRequestType": [ - "raiseIntentRequest", - ], - "RaiseIntentResultErrorMessage": [ - "AgentDisconnected", - "IntentHandlerRejected", - "MalformedMessage", - "NoResultReturned", - "NotConnectedToBridge", - "ResponseToBridgeTimedOut", - ], - "RaiseIntentResultAgentErrorResponseType": [ - "raiseIntentResultResponse", - ], - "Type": [ - "app", - "private", - "user", - ], -}; diff --git a/packages/fdc3-schema/generated/context/ContextTypes.ts b/packages/fdc3-schema/generated/context/ContextTypes.ts deleted file mode 100644 index 8fccd9007..000000000 --- a/packages/fdc3-schema/generated/context/ContextTypes.ts +++ /dev/null @@ -1,2901 +0,0 @@ -// To parse this data: -// -// import { Convert, Action, Chart, ChatInitSettings, ChatMessage, ChatRoom, ChatSearchCriteria, Contact, ContactList, Context, Country, Currency, Email, Instrument, InstrumentList, Interaction, Message, Nothing, Order, OrderList, Organization, Portfolio, Position, Product, TimeRange, Trade, TradeList, TransactionResult, Valuation } from "./file"; -// -// const action = Convert.toAction(json); -// const chart = Convert.toChart(json); -// const chatInitSettings = Convert.toChatInitSettings(json); -// const chatMessage = Convert.toChatMessage(json); -// const chatRoom = Convert.toChatRoom(json); -// const chatSearchCriteria = Convert.toChatSearchCriteria(json); -// const contact = Convert.toContact(json); -// const contactList = Convert.toContactList(json); -// const context = Convert.toContext(json); -// const country = Convert.toCountry(json); -// const currency = Convert.toCurrency(json); -// const email = Convert.toEmail(json); -// const instrument = Convert.toInstrument(json); -// const instrumentList = Convert.toInstrumentList(json); -// const interaction = Convert.toInteraction(json); -// const message = Convert.toMessage(json); -// const nothing = Convert.toNothing(json); -// const order = Convert.toOrder(json); -// const orderList = Convert.toOrderList(json); -// const organization = Convert.toOrganization(json); -// const portfolio = Convert.toPortfolio(json); -// const position = Convert.toPosition(json); -// const product = Convert.toProduct(json); -// const timeRange = Convert.toTimeRange(json); -// const trade = Convert.toTrade(json); -// const tradeList = Convert.toTradeList(json); -// const transactionResult = Convert.toTransactionResult(json); -// const valuation = Convert.toValuation(json); -// -// These functions will throw an error if the JSON doesn't -// match the expected interface, even if the JSON is valid. - -/** - * 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. - */ -export interface Action { - /** - * An optional target application identifier that should perform the action - */ - app?: AppIdentifier; - /** - * A context object with which the action will be performed - */ - context: ContextElement; - /** - * 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. - */ - intent?: string; - /** - * A human readable display name for the action - */ - title: string; - type: "fdc3.action"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * An optional target application identifier that should perform the action - * - * Identifies an application, or instance of an application, and is used to target FDC3 API - * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application - * instances. - * - * Will always include at least an `appId` field, which uniquely identifies a specific app. - * - * If the `instanceId` field is set then the `AppMetadata` object represents a specific - * instance of the application that may be addressed using that Id. - */ -export interface AppIdentifier { - /** - * The unique application identifier located within a specific application directory - * instance. An example of an appId might be 'app@sub.root' - */ - appId: string; - /** - * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to - * identify the Desktop Agent to target. - */ - desktopAgent?: string; - /** - * An optional instance identifier, indicating that this object represents a specific - * instance of the application described. - */ - instanceId?: string; - [property: string]: any; -} - -/** - * A context object with which the action will be performed - * - * A context object returned by the transaction, possibly with updated data. - * - * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by - * FDC3 operations. As such, it is not really meant to be used on its own, but is imported - * by more specific type definitions (standardized or custom) to provide the structure and - * properties shared by all FDC3 context data types. - * - * The key element of FDC3 context types is their mandatory `type` property, which is used - * to identify what type of data the object represents, and what shape it has. - * - * The FDC3 context type, and all derived types, define the minimum set of fields a context - * data object of a particular type can be expected to have, but this can always be extended - * with custom fields as appropriate. - */ -export interface ContextElement { - /** - * Context data objects may include a set of equivalent key-value pairs that can be used to - * help applications identify and look up the context type they receive in their own domain. - * The idea behind this design is that applications can provide as many equivalent - * identifiers to a target application as possible, e.g. an instrument may be represented by - * an ISIN, CUSIP or Bloomberg identifier. - * - * Identifiers do not make sense for all types of data, so the `id` property is therefore - * optional, but some derived types may choose to require at least one identifier. - * Identifier values SHOULD always be of type string. - */ - id?: { [key: string]: any }; - /** - * Context data objects may include a name property that can be used for more information, - * or display purposes. Some derived types may require the name object as mandatory, - * depending on use case. - */ - name?: string; - /** - * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 - * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present - * to route shared context data appropriately. - * - * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data - * types they support in an FDC3 [App - * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery - * and routing. - * - * Standardized FDC3 context types have well-known `type` properties prefixed with the - * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and - * used by a particular organization, the convention is to prefix them with an - * organization-specific namespace, e.g. `blackrock.fund`. - * - * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more - * information about context data types. - */ - type: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * 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. - * - * 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. - */ -export interface Chart { - /** - * An array of instrument contexts whose data should be plotted. - */ - instruments: InstrumentElement[]; - /** - * 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. - */ - otherConfig?: ContextElement[]; - /** - * The time range that should be plotted - */ - range?: TimeRangeObject; - /** - * The type of chart that should be plotted - */ - style?: ChartStyle; - type: "fdc3.chart"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * financial instrument that relates to the definition of this product - * - * - * - * A financial instrument from any asset class. - */ -export interface InstrumentElement { - /** - * Any combination of instrument identifiers can be used together to resolve ambiguity, or - * for a better match. Not all applications will use the same instrument identifiers, which - * is why FDC3 allows for multiple to be specified. In general, the more identifiers an - * application can provide, the easier it will be to achieve interoperability. - * - * It is valid to include extra properties and metadata as part of the instrument payload, - * but the minimum requirement is for at least one instrument identifier to be provided. - * - * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant - * for tickers as used by an exchange. - * If the identifier you want to share is not a ticker or one of the other standardized - * fields, define a property that makes it clear what the value represents. Doing so will - * make interpretation easier for the developers of target applications. - */ - id: PurpleInstrumentIdentifiers; - /** - * The `market` map can be used to further specify the instrument and help achieve - * interoperability between disparate data sources. This is especially useful when using an - * `id` field that is not globally unique. - */ - market?: OrganizationMarket; - type: "fdc3.instrument"; - name?: string; - [property: string]: any; -} - -/** - * Any combination of instrument identifiers can be used together to resolve ambiguity, or - * for a better match. Not all applications will use the same instrument identifiers, which - * is why FDC3 allows for multiple to be specified. In general, the more identifiers an - * application can provide, the easier it will be to achieve interoperability. - * - * It is valid to include extra properties and metadata as part of the instrument payload, - * but the minimum requirement is for at least one instrument identifier to be provided. - * - * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant - * for tickers as used by an exchange. - * If the identifier you want to share is not a ticker or one of the other standardized - * fields, define a property that makes it clear what the value represents. Doing so will - * make interpretation easier for the developers of target applications. - */ -export interface PurpleInstrumentIdentifiers { - /** - * https://www.bloomberg.com/ - */ - BBG?: string; - /** - * https://www.cusip.com/ - */ - CUSIP?: string; - /** - * https://www.factset.com/ - */ - FDS_ID?: string; - /** - * https://www.openfigi.com/ - */ - FIGI?: string; - /** - * https://www.isin.org/ - */ - ISIN?: string; - /** - * https://permid.org/ - */ - PERMID?: string; - /** - * https://www.refinitiv.com/ - */ - RIC?: string; - /** - * https://www.lseg.com/sedol - */ - SEDOL?: string; - /** - * Unstandardized stock tickers - */ - ticker?: string; - [property: string]: any; -} - -/** - * The `market` map can be used to further specify the instrument and help achieve - * interoperability between disparate data sources. This is especially useful when using an - * `id` field that is not globally unique. - */ -export interface OrganizationMarket { - /** - * https://www.bloomberg.com/ - */ - BBG?: string; - /** - * https://www.iso.org/iso-3166-country-codes.html - */ - COUNTRY_ISOALPHA2?: string; - /** - * https://en.wikipedia.org/wiki/Market_Identifier_Code - */ - MIC?: string; - /** - * Human readable market name - */ - name?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * The time range that should be plotted - * - * The time range over which the interaction occurred - * - * A context representing a period of time. Any user interfaces that represent or visualize - * events or activity over time can be filtered or focused on a particular time period, - * e.g.: - * - * - A pricing chart - * - A trade blotter - * - A record of client contact/activity in a CRM - * - * Example use cases: - * - * - User may want to view pricing/trades/customer activity for a security over a particular - * time period, the time range might be specified as the context for the `ViewChart` intent - * OR it might be embedded in another context (e.g. a context representing a chart to plot). - * - User filters a visualization (e.g. a pricing chart) to show a particular period, the - * `TimeRange` is broadcast and other visualizations (e.g. a heatmap of activity by - * instrument, or industry sector etc.) receive it and filter themselves to show data over - * the same range. - * - * Notes: - * - * - A `TimeRange` may be closed (i.e. `startTime` and `endTime` are both known) or open - * (i.e. only one of `startTime` or `endTime` is known). - * - Ranges corresponding to dates (e.g. `2022-05-12` to `2022-05-19`) should be specified - * using times as this prevents issues with timezone conversions and inclusive/exclusive - * date ranges. - * - String fields representing times are encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html). - * - A timezone indicator should be specified, e.g. `"2022-05-12T15:18:03Z"` or - * `"2022-05-12T16:18:03+01:00"` - * - Times MAY be specified with millisecond precision, e.g. `"2022-05-12T15:18:03.349Z"` - */ -export interface TimeRangeObject { - /** - * The end time of the range, encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. - */ - endTime?: Date; - /** - * The start time of the range, encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. - */ - startTime?: Date; - type: "fdc3.timeRange"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * The type of chart that should be plotted - */ -export type ChartStyle = "line" | "bar" | "stacked-bar" | "mountain" | "candle" | "pie" | "scatter" | "histogram" | "heatmap" | "custom"; - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A collection of settings to start a new chat conversation - */ -export interface ChatInitSettings { - /** - * Name to apply to the chat created - */ - chatName?: string; - /** - * Contacts to add to the chat - */ - members?: ContactListObject; - /** - * An initial message to post in the chat when created. - */ - message?: MessageObject | string; - /** - * Option settings that affect the creation of the chat - */ - options?: ChatOptions; - type: "fdc3.chat.initSettings"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Contacts to add to the chat - * - * A list of contacts involved in the interaction - * - * A collection of contacts, e.g. for chatting to or calling multiple contacts. - * - * The contact list schema does not explicitly include identifiers in the `id` section, as - * there is not a common standard for such identifiers. Applications can, however, populate - * this part of the contract with custom identifiers if so desired. - */ -export interface ContactListObject { - /** - * An array of contact contexts that forms the list. - */ - contacts: ContactElement[]; - type: "fdc3.contactList"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * The contact that initiated the interaction - * - * A person contact that can be engaged with through email, calling, messaging, CMS, etc. - */ -export interface ContactElement { - /** - * Identifiers that relate to the Contact represented by this context - */ - id: PurpleContactIdentifiers; - type: "fdc3.contact"; - name?: string; - [property: string]: any; -} - -/** - * Identifiers that relate to the Contact represented by this context - */ -export interface PurpleContactIdentifiers { - /** - * The email address for the contact - */ - email?: string; - /** - * FactSet Permanent Identifier representing the contact - */ - FDS_ID?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A chat message to be sent through an instant messaging application. Can contain one or - * several text bodies (organized by mime-type, plaintext or markdown), as well as attached - * entities (either arbitrary file attachments or FDC3 actions to be embedded in the - * message). To be put inside a ChatInitSettings object. - */ -export interface MessageObject { - /** - * A map of string IDs to entities that should be attached to the message, such as an action - * to perform, a file attachment, or other FDC3 context object. - */ - entities?: { [key: string]: PurpleAction }; - /** - * A map of string mime-type to string content - */ - text?: PurpleMessageText; - type: "fdc3.message"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * 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. - * - * A File attachment encoded in the form of a data URI - */ -export interface PurpleAction { - /** - * An optional target application identifier that should perform the action - */ - app?: AppIdentifier; - /** - * A context object with which the action will be performed - */ - context?: ContextElement; - /** - * 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. - */ - intent?: string; - /** - * A human readable display name for the action - */ - title?: string; - type: EntityType; - id?: { [key: string]: any }; - name?: string; - data?: PurpleData; - [property: string]: any; -} - -export interface PurpleData { - /** - * A data URI encoding the content of the file to be attached - */ - dataUri: string; - /** - * The name of the attached file - */ - name: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ -export type EntityType = "fdc3.action" | "fdc3.entity.fileAttachment"; - -/** - * A map of string mime-type to string content - */ -export interface PurpleMessageText { - /** - * Markdown encoded content - */ - "text/markdown"?: string; - /** - * Plain text encoded content. - */ - "text/plain"?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * Option settings that affect the creation of the chat - */ -export interface ChatOptions { - /** - * if true members will be allowed to add other members to the chat - */ - allowAddUser?: boolean; - /** - * if true members will be allowed to browse past messages - */ - allowHistoryBrowsing?: boolean; - /** - * if true members will be allowed to copy/paste messages - */ - allowMessageCopy?: boolean; - /** - * if false a separate chat will be created for each member - */ - groupRecipients?: boolean; - /** - * if true the room will be visible to everyone in the chat application - */ - isPublic?: boolean; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A context representing a chat message. Typically used to send the message or to - * pre-populate a message for sending. - */ -export interface ChatMessage { - chatRoom: ChatRoomObject; - message: MessageObject; - type: "fdc3.chat.message"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Reference to the chat room which could be used to send a message to the room - */ -export interface ChatRoomObject { - /** - * Identifier(s) for the chat - currently unstandardized - */ - id: { [key: string]: any }; - /** - * Display name for the chat room - */ - name?: string; - /** - * The name of the service that hosts the chat - */ - providerName: string; - type: "fdc3.chat.room"; - /** - * Universal url to access to the room. It could be opened from a browser, a mobile app, - * etc... - */ - url?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * Reference to the chat room which could be used to send a message to the room - */ -export interface ChatRoom { - /** - * Identifier(s) for the chat - currently unstandardized - */ - id: { [key: string]: any }; - /** - * Display name for the chat room - */ - name?: string; - /** - * The name of the service that hosts the chat - */ - providerName: string; - type: "fdc3.chat.room"; - /** - * Universal url to access to the room. It could be opened from a browser, a mobile app, - * etc... - */ - url?: string; - [property: string]: any; -} - -/** - * A context type that represents a simple search criterion, based on a list of other - * context objects, that can be used to search or filter messages in a chat application. - */ -export interface ChatSearchCriteria { - /** - * An array of criteria that should match chats returned from by a search. - * - * ⚠️ Operators (and/or/not) are not defined in `fdc3.chat.searchCriteria`. It is up to the - * application that processes the FDC3 Intent to choose and apply the operators between the - * criteria. - * - * Empty search criteria can be supported to allow resetting of filters. - */ - criteria: Array; - type: "fdc3.chat.searchCriteria"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * financial instrument that relates to the definition of this product - * - * - * - * A financial instrument from any asset class. - * - * An entity that can be used when referencing private companies and other organizations - * where a specific instrument is not available or desired e.g. CRM and News workflows. - * - * It is valid to include extra properties and metadata as part of the organization payload, - * but the minimum requirement is for at least one specified identifier to be provided. - * - * The contact that initiated the interaction - * - * A person contact that can be engaged with through email, calling, messaging, CMS, etc. - */ -export interface OrganizationObject { - /** - * Any combination of instrument identifiers can be used together to resolve ambiguity, or - * for a better match. Not all applications will use the same instrument identifiers, which - * is why FDC3 allows for multiple to be specified. In general, the more identifiers an - * application can provide, the easier it will be to achieve interoperability. - * - * It is valid to include extra properties and metadata as part of the instrument payload, - * but the minimum requirement is for at least one instrument identifier to be provided. - * - * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant - * for tickers as used by an exchange. - * If the identifier you want to share is not a ticker or one of the other standardized - * fields, define a property that makes it clear what the value represents. Doing so will - * make interpretation easier for the developers of target applications. - * - * Identifiers for the organization, at least one must be provided. - * - * Identifiers that relate to the Contact represented by this context - */ - id: Identifiers; - /** - * The `market` map can be used to further specify the instrument and help achieve - * interoperability between disparate data sources. This is especially useful when using an - * `id` field that is not globally unique. - */ - market?: OrganizationMarket; - type: TentacledInteractionType; - name?: string; - [property: string]: any; -} - -/** - * Any combination of instrument identifiers can be used together to resolve ambiguity, or - * for a better match. Not all applications will use the same instrument identifiers, which - * is why FDC3 allows for multiple to be specified. In general, the more identifiers an - * application can provide, the easier it will be to achieve interoperability. - * - * It is valid to include extra properties and metadata as part of the instrument payload, - * but the minimum requirement is for at least one instrument identifier to be provided. - * - * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant - * for tickers as used by an exchange. - * If the identifier you want to share is not a ticker or one of the other standardized - * fields, define a property that makes it clear what the value represents. Doing so will - * make interpretation easier for the developers of target applications. - * - * Identifiers for the organization, at least one must be provided. - * - * Identifiers that relate to the Contact represented by this context - */ -export interface Identifiers { - /** - * https://www.bloomberg.com/ - */ - BBG?: string; - /** - * https://www.cusip.com/ - */ - CUSIP?: string; - /** - * https://www.factset.com/ - * - * FactSet Permanent Identifier representing the organization - * - * FactSet Permanent Identifier representing the contact - */ - FDS_ID?: string; - /** - * https://www.openfigi.com/ - */ - FIGI?: string; - /** - * https://www.isin.org/ - */ - ISIN?: string; - /** - * https://permid.org/ - * - * Refinitiv Permanent Identifiers, or PermID for the organization - */ - PERMID?: string; - /** - * https://www.refinitiv.com/ - */ - RIC?: string; - /** - * https://www.lseg.com/sedol - */ - SEDOL?: string; - /** - * Unstandardized stock tickers - */ - ticker?: string; - /** - * The Legal Entity Identifier (LEI) is a 20-character, alpha-numeric code based on the ISO - * 17442 standard developed by the International Organization for Standardization (ISO). It - * connects to key reference information that enables clear and unique identification of - * legal entities participating in financial transactions. - */ - LEI?: string; - /** - * The email address for the contact - */ - email?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ -export type TentacledInteractionType = "fdc3.instrument" | "fdc3.organization" | "fdc3.contact"; - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A person contact that can be engaged with through email, calling, messaging, CMS, etc. - */ -export interface Contact { - /** - * Identifiers that relate to the Contact represented by this context - */ - id: FluffyContactIdentifiers; - type: "fdc3.contact"; - name?: string; - [property: string]: any; -} - -/** - * Identifiers that relate to the Contact represented by this context - */ -export interface FluffyContactIdentifiers { - /** - * The email address for the contact - */ - email?: string; - /** - * FactSet Permanent Identifier representing the contact - */ - FDS_ID?: string; - [property: string]: any; -} - -/** - * A collection of contacts, e.g. for chatting to or calling multiple contacts. - * - * The contact list schema does not explicitly include identifiers in the `id` section, as - * there is not a common standard for such identifiers. Applications can, however, populate - * this part of the contract with custom identifiers if so desired. - */ -export interface ContactList { - /** - * An array of contact contexts that forms the list. - */ - contacts: ContactElement[]; - type: "fdc3.contactList"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by - * FDC3 operations. As such, it is not really meant to be used on its own, but is imported - * by more specific type definitions (standardized or custom) to provide the structure and - * properties shared by all FDC3 context data types. - * - * The key element of FDC3 context types is their mandatory `type` property, which is used - * to identify what type of data the object represents, and what shape it has. - * - * The FDC3 context type, and all derived types, define the minimum set of fields a context - * data object of a particular type can be expected to have, but this can always be extended - * with custom fields as appropriate. - */ -export interface Context { - /** - * Context data objects may include a set of equivalent key-value pairs that can be used to - * help applications identify and look up the context type they receive in their own domain. - * The idea behind this design is that applications can provide as many equivalent - * identifiers to a target application as possible, e.g. an instrument may be represented by - * an ISIN, CUSIP or Bloomberg identifier. - * - * Identifiers do not make sense for all types of data, so the `id` property is therefore - * optional, but some derived types may choose to require at least one identifier. - * Identifier values SHOULD always be of type string. - */ - id?: { [key: string]: any }; - /** - * Context data objects may include a name property that can be used for more information, - * or display purposes. Some derived types may require the name object as mandatory, - * depending on use case. - */ - name?: string; - /** - * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 - * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present - * to route shared context data appropriately. - * - * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data - * types they support in an FDC3 [App - * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery - * and routing. - * - * Standardized FDC3 context types have well-known `type` properties prefixed with the - * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and - * used by a particular organization, the convention is to prefix them with an - * organization-specific namespace, e.g. `blackrock.fund`. - * - * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more - * information about context data types. - */ - type: string; - [property: string]: any; -} - -/** - * A country entity. - * - * Notes: - * - * - It is valid to include extra properties and metadata as part of the country payload, - * but the minimum requirement is for at least one standardized identifier to be provided - * - * - `COUNTRY_ISOALPHA2` SHOULD be preferred. - * - * - Try to only use country identifiers as intended and specified in the [ISO - * standard](https://en.wikipedia.org/wiki/ISO_3166-1). E.g. the `COUNTRY_ISOALPHA2` - * property must be a recognized value and not a proprietary two-letter code. If the - * identifier you want to share is not a standardized and recognized one, rather define a - * property that makes it clear what value it is. This makes it easier for target - * applications. - */ -export interface Country { - id: CountryID; - type: "fdc3.country"; - name?: string; - [property: string]: any; -} - -export interface CountryID { - /** - * Two-letter ISO country code - */ - COUNTRY_ISOALPHA2?: string; - /** - * Three-letter ISO country code - */ - COUNTRY_ISOALPHA3?: string; - /** - * Two-letter ISO country code. Deprecated in FDC3 2.0 in favour of the version prefixed - * with `COUNTRY_`. - */ - ISOALPHA2?: string; - /** - * Three-letter ISO country code. Deprecated in FDC3 2.0 in favour of the version prefixed - * with `COUNTRY_`. - */ - ISOALPHA3?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A context representing an individual Currency. - */ -export interface Currency { - id: CurrencyID; - /** - * The name of the currency for display purposes - */ - name?: string; - type: "fdc3.currency"; - [property: string]: any; -} - -export interface CurrencyID { - /** - * The `CURRENCY_ISOCODE` should conform to 3 character alphabetic codes defined in [ISO - * 4217](https://www.iso.org/iso-4217-currency-codes.html) - */ - CURRENCY_ISOCODE?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A collection of information to be used to initiate an email with a Contact or ContactList. - */ -export interface Email { - /** - * One or more recipients for the email. - */ - recipients: EmailRecipients; - /** - * Subject line for the email. - */ - subject?: string; - /** - * Body content for the email. - */ - textBody?: string; - type: "fdc3.email"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * One or more recipients for the email. - * - * The contact that initiated the interaction - * - * A person contact that can be engaged with through email, calling, messaging, CMS, etc. - * - * Contacts to add to the chat - * - * A list of contacts involved in the interaction - * - * A collection of contacts, e.g. for chatting to or calling multiple contacts. - * - * The contact list schema does not explicitly include identifiers in the `id` section, as - * there is not a common standard for such identifiers. Applications can, however, populate - * this part of the contract with custom identifiers if so desired. - */ -export interface EmailRecipients { - /** - * Identifiers that relate to the Contact represented by this context - */ - id?: EmailRecipientsID; - type: EmailRecipientsType; - name?: string; - /** - * An array of contact contexts that forms the list. - */ - contacts?: ContactElement[]; - [property: string]: any; -} - -/** - * Identifiers that relate to the Contact represented by this context - */ -export interface EmailRecipientsID { - /** - * The email address for the contact - */ - email?: string; - /** - * FactSet Permanent Identifier representing the contact - */ - FDS_ID?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ -export type EmailRecipientsType = "fdc3.contact" | "fdc3.contactList"; - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A financial instrument from any asset class. - */ -export interface Instrument { - /** - * Any combination of instrument identifiers can be used together to resolve ambiguity, or - * for a better match. Not all applications will use the same instrument identifiers, which - * is why FDC3 allows for multiple to be specified. In general, the more identifiers an - * application can provide, the easier it will be to achieve interoperability. - * - * It is valid to include extra properties and metadata as part of the instrument payload, - * but the minimum requirement is for at least one instrument identifier to be provided. - * - * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant - * for tickers as used by an exchange. - * If the identifier you want to share is not a ticker or one of the other standardized - * fields, define a property that makes it clear what the value represents. Doing so will - * make interpretation easier for the developers of target applications. - */ - id: FluffyInstrumentIdentifiers; - /** - * The `market` map can be used to further specify the instrument and help achieve - * interoperability between disparate data sources. This is especially useful when using an - * `id` field that is not globally unique. - */ - market?: PurpleMarket; - type: "fdc3.instrument"; - name?: string; - [property: string]: any; -} - -/** - * Any combination of instrument identifiers can be used together to resolve ambiguity, or - * for a better match. Not all applications will use the same instrument identifiers, which - * is why FDC3 allows for multiple to be specified. In general, the more identifiers an - * application can provide, the easier it will be to achieve interoperability. - * - * It is valid to include extra properties and metadata as part of the instrument payload, - * but the minimum requirement is for at least one instrument identifier to be provided. - * - * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant - * for tickers as used by an exchange. - * If the identifier you want to share is not a ticker or one of the other standardized - * fields, define a property that makes it clear what the value represents. Doing so will - * make interpretation easier for the developers of target applications. - */ -export interface FluffyInstrumentIdentifiers { - /** - * https://www.bloomberg.com/ - */ - BBG?: string; - /** - * https://www.cusip.com/ - */ - CUSIP?: string; - /** - * https://www.factset.com/ - */ - FDS_ID?: string; - /** - * https://www.openfigi.com/ - */ - FIGI?: string; - /** - * https://www.isin.org/ - */ - ISIN?: string; - /** - * https://permid.org/ - */ - PERMID?: string; - /** - * https://www.refinitiv.com/ - */ - RIC?: string; - /** - * https://www.lseg.com/sedol - */ - SEDOL?: string; - /** - * Unstandardized stock tickers - */ - ticker?: string; - [property: string]: any; -} - -/** - * The `market` map can be used to further specify the instrument and help achieve - * interoperability between disparate data sources. This is especially useful when using an - * `id` field that is not globally unique. - */ -export interface PurpleMarket { - /** - * https://www.bloomberg.com/ - */ - BBG?: string; - /** - * https://www.iso.org/iso-3166-country-codes.html - */ - COUNTRY_ISOALPHA2?: string; - /** - * https://en.wikipedia.org/wiki/Market_Identifier_Code - */ - MIC?: string; - /** - * Human readable market name - */ - name?: string; - [property: string]: any; -} - -/** - * A collection of instruments. Use this type for use cases that require not just a single - * instrument, but multiple (e.g. to populate a watchlist). However, when holding - * information for each instrument is required, it is recommended to use the - * [Portfolio](Portfolio) type. - * - * The instrument list schema does not explicitly include identifiers in the `id` section, - * as there is not a common standard for such identifiers. Applications can, however, - * populate this part of the contract with custom identifiers if so desired. - */ -export interface InstrumentList { - /** - * An array of instrument contexts that forms the list. - */ - instruments: InstrumentElement[]; - type: "fdc3.instrumentList"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * An `Interaction` is a significant direct exchange of ideas or information between a - * number of participants, e.g. a Sell Side party and one or more Buy Side parties. An - * `Interaction` might be a call, a meeting (physical or virtual), an IM or the preparation - * of some specialist data, such as financial data for a given company or sector. - */ -export interface Interaction { - /** - * A human-readable description of the interaction - */ - description: string; - /** - * Can be used by a target application to pass an identifier back to the originating - * application after an interaction record has been created, updated or deleted. An - * interaction ID does not need to be populated by the originating application, however the - * target application could store it for future reference and SHOULD return it in a - * `TransactionResult`. - */ - id?: InteractionID; - /** - * The contact that initiated the interaction - */ - initiator?: ContactElement; - /** - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - interactionType: string; - /** - * Used to represent the application or service that the interaction was created from to aid - * in tracing the source of an interaction. - */ - origin?: string; - /** - * A list of contacts involved in the interaction - */ - participants: ContactListObject; - /** - * The time range over which the interaction occurred - */ - timeRange: TimeRangeObject; - type: "fdc3.interaction"; - name?: string; - [property: string]: any; -} - -/** - * Can be used by a target application to pass an identifier back to the originating - * application after an interaction record has been created, updated or deleted. An - * interaction ID does not need to be populated by the originating application, however the - * target application could store it for future reference and SHOULD return it in a - * `TransactionResult`. - */ -export interface InteractionID { - /** - * Interactions ID in Salesforce - */ - SALESFORCE?: string; - /** - * Interaction ID in SingleTrack - */ - SINGLETRACK?: string; - /** - * Can be used by a target application to pass a record's link back to the originating - * application. This offers the originating application a way to open the record for a user - * to view. - */ - URI?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A chat message to be sent through an instant messaging application. Can contain one or - * several text bodies (organized by mime-type, plaintext or markdown), as well as attached - * entities (either arbitrary file attachments or FDC3 actions to be embedded in the - * message). To be put inside a ChatInitSettings object. - */ -export interface Message { - /** - * A map of string IDs to entities that should be attached to the message, such as an action - * to perform, a file attachment, or other FDC3 context object. - */ - entities?: { [key: string]: FluffyAction }; - /** - * A map of string mime-type to string content - */ - text?: FluffyMessageText; - type: "fdc3.message"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * 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. - * - * A File attachment encoded in the form of a data URI - */ -export interface FluffyAction { - /** - * An optional target application identifier that should perform the action - */ - app?: AppIdentifier; - /** - * A context object with which the action will be performed - */ - context?: ContextElement; - /** - * 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. - */ - intent?: string; - /** - * A human readable display name for the action - */ - title?: string; - type: EntityType; - id?: { [key: string]: any }; - name?: string; - data?: FluffyData; - [property: string]: any; -} - -export interface FluffyData { - /** - * A data URI encoding the content of the file to be attached - */ - dataUri: string; - /** - * The name of the attached file - */ - name: string; - [property: string]: any; -} - -/** - * A map of string mime-type to string content - */ -export interface FluffyMessageText { - /** - * Markdown encoded content - */ - "text/markdown"?: string; - /** - * Plain text encoded content. - */ - "text/plain"?: string; - [property: string]: any; -} - -/** - * A type that explicitly represents a lack of context. - * - * Notes: - * - * - Intended to be used in situations where no context is desired. - * - For example: - * - Raising an intent without context (e.g. opening a blank order form, or chat interface - * without a contact selected). - * - Resetting context on a channel (e.g. when context is used to set a filter in other - * applications a null context might release the filter). - * - An explicit representation of a Null or empty context allows apps to declare support - * for a lack of context, for example in their intent metadata in an app directory. - */ -export interface Nothing { - type: "fdc3.nothing"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * @experimental context type representing an order. To be used with OMS and EMS systems. - * - * This type currently only defines a required `id` field, which should provide a reference - * to the order in one or more systems, an optional human readable `name` field to be used - * to summarize the order and an optional `details` field that may be used to provide - * additional detail about the order, including a context representing a `product`, which - * may be extended with arbitrary properties. The `details.product` field is currently typed - * as a unspecified Context type, but both `details` and `details.product` are expected to - * be standardized in future. - */ -export interface Order { - /** - * Optional additional details about the order, which may include a product element that is - * an, as yet undefined but extensible, Context - */ - details?: PurpleOrderDetails; - /** - * One or more identifiers that refer to the order in an OMS, EMS or related system. - * Specific key names for systems are expected to be standardized in future. - */ - id: { [key: string]: string }; - /** - * An optional human-readable summary of the order. - */ - name?: string; - type: "fdc3.order"; - [property: string]: any; -} - -/** - * Optional additional details about the order, which may include a product element that is - * an, as yet undefined but extensible, Context - */ -export interface PurpleOrderDetails { - product?: ProductObject; - [property: string]: any; -} - -/** - * A product that is the subject of the trade. - * - * @experimental context type representing a tradable product. To be used with OMS and EMS - * systems. - * - * This type is currently only loosely defined as an extensible context object, with an - * optional instrument field. - * - * The Product schema does not explicitly include identifiers in the id section, as there is - * not a common standard for such identifiers. Applications can, however, populate this part - * of the contract with custom identifiers if so desired. - */ -export interface ProductObject { - /** - * One or more identifiers that refer to the product. Specific key names for systems are - * expected to be standardized in future. - */ - id: { [key: string]: string }; - /** - * financial instrument that relates to the definition of this product - */ - instrument?: InstrumentElement; - /** - * A human-readable summary of the product. - */ - name?: string; - type: "fdc3.product"; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * @experimental A list of orders. Use this type for use cases that require not just a - * single order, but multiple. - * - * The OrderList schema does not explicitly include identifiers in the id section, as there - * is not a common standard for such identifiers. Applications can, however, populate this - * part of the contract with custom identifiers if so desired. - */ -export interface OrderList { - /** - * An array of order contexts that forms the list. - */ - orders: OrderElement[]; - type: "fdc3.orderList"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * @experimental context type representing an order. To be used with OMS and EMS systems. - * - * This type currently only defines a required `id` field, which should provide a reference - * to the order in one or more systems, an optional human readable `name` field to be used - * to summarize the order and an optional `details` field that may be used to provide - * additional detail about the order, including a context representing a `product`, which - * may be extended with arbitrary properties. The `details.product` field is currently typed - * as a unspecified Context type, but both `details` and `details.product` are expected to - * be standardized in future. - */ -export interface OrderElement { - /** - * Optional additional details about the order, which may include a product element that is - * an, as yet undefined but extensible, Context - */ - details?: FluffyOrderDetails; - /** - * One or more identifiers that refer to the order in an OMS, EMS or related system. - * Specific key names for systems are expected to be standardized in future. - */ - id: { [key: string]: string }; - /** - * An optional human-readable summary of the order. - */ - name?: string; - type: "fdc3.order"; - [property: string]: any; -} - -/** - * Optional additional details about the order, which may include a product element that is - * an, as yet undefined but extensible, Context - */ -export interface FluffyOrderDetails { - product?: ProductObject; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * An entity that can be used when referencing private companies and other organizations - * where a specific instrument is not available or desired e.g. CRM and News workflows. - * - * It is valid to include extra properties and metadata as part of the organization payload, - * but the minimum requirement is for at least one specified identifier to be provided. - */ -export interface Organization { - /** - * Identifiers for the organization, at least one must be provided. - */ - id: OrganizationIdentifiers; - type: "fdc3.organization"; - name?: string; - [property: string]: any; -} - -/** - * Identifiers for the organization, at least one must be provided. - */ -export interface OrganizationIdentifiers { - /** - * FactSet Permanent Identifier representing the organization - */ - FDS_ID?: string; - /** - * The Legal Entity Identifier (LEI) is a 20-character, alpha-numeric code based on the ISO - * 17442 standard developed by the International Organization for Standardization (ISO). It - * connects to key reference information that enables clear and unique identification of - * legal entities participating in financial transactions. - */ - LEI?: string; - /** - * Refinitiv Permanent Identifiers, or PermID for the organization - */ - PERMID?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A financial portfolio made up of multiple positions (holdings) in several instruments. - * Contrast this with e.g. the [InstrumentList](InstrumentList) type, which is just a list - * of instruments. - * - * This is a good example of how types can be composed and extended with extra properties to - * define more complex types. - * - * The Portfolio type consists of an array of [Position](Position) types, each of which - * refers to a single [Instrument](Instrument) and a holding amount for that instrument. - * - * The portfolio schema does not explicitly include identifiers in the `id` section, as - * there bis not a common standard for such identifiers. Applications can, however, populate - * this part of the contract with custom identifiers if so desired. - */ -export interface Portfolio { - /** - * The List of Positions which make up the Portfolio - */ - positions: PositionElement[]; - type: "fdc3.portfolio"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * A financial position made up of an instrument and a holding in that instrument. This type - * is a good example of how new context types can be composed from existing types. - * - * In this case, the instrument and the holding amount for that instrument are required - * values. - * - * The [Position](Position) type goes hand-in-hand with the [Portfolio](Portfolio) type, - * which represents multiple holdings in a combination of instruments. - * - * The position schema does not explicitly include identifiers in the `id` section, as there - * is not a common standard for such identifiers. Applications can, however, populate this - * part of the contract with custom identifiers if so desired. - */ -export interface PositionElement { - /** - * The amount of the holding, e.g. a number of shares - */ - holding: number; - instrument: InstrumentElement; - type: "fdc3.position"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A financial position made up of an instrument and a holding in that instrument. This type - * is a good example of how new context types can be composed from existing types. - * - * In this case, the instrument and the holding amount for that instrument are required - * values. - * - * The [Position](Position) type goes hand-in-hand with the [Portfolio](Portfolio) type, - * which represents multiple holdings in a combination of instruments. - * - * The position schema does not explicitly include identifiers in the `id` section, as there - * is not a common standard for such identifiers. Applications can, however, populate this - * part of the contract with custom identifiers if so desired. - */ -export interface Position { - /** - * The amount of the holding, e.g. a number of shares - */ - holding: number; - instrument: InstrumentElement; - type: "fdc3.position"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * @experimental context type representing a tradable product. To be used with OMS and EMS - * systems. - * - * This type is currently only loosely defined as an extensible context object, with an - * optional instrument field. - * - * The Product schema does not explicitly include identifiers in the id section, as there is - * not a common standard for such identifiers. Applications can, however, populate this part - * of the contract with custom identifiers if so desired. - */ -export interface Product { - /** - * One or more identifiers that refer to the product. Specific key names for systems are - * expected to be standardized in future. - */ - id: { [key: string]: string }; - /** - * financial instrument that relates to the definition of this product - */ - instrument?: InstrumentElement; - /** - * A human-readable summary of the product. - */ - name?: string; - type: "fdc3.product"; - [property: string]: any; -} - -/** - * A context representing a period of time. Any user interfaces that represent or visualize - * events or activity over time can be filtered or focused on a particular time period, - * e.g.: - * - * - A pricing chart - * - A trade blotter - * - A record of client contact/activity in a CRM - * - * Example use cases: - * - * - User may want to view pricing/trades/customer activity for a security over a particular - * time period, the time range might be specified as the context for the `ViewChart` intent - * OR it might be embedded in another context (e.g. a context representing a chart to plot). - * - User filters a visualization (e.g. a pricing chart) to show a particular period, the - * `TimeRange` is broadcast and other visualizations (e.g. a heatmap of activity by - * instrument, or industry sector etc.) receive it and filter themselves to show data over - * the same range. - * - * Notes: - * - * - A `TimeRange` may be closed (i.e. `startTime` and `endTime` are both known) or open - * (i.e. only one of `startTime` or `endTime` is known). - * - Ranges corresponding to dates (e.g. `2022-05-12` to `2022-05-19`) should be specified - * using times as this prevents issues with timezone conversions and inclusive/exclusive - * date ranges. - * - String fields representing times are encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html). - * - A timezone indicator should be specified, e.g. `"2022-05-12T15:18:03Z"` or - * `"2022-05-12T16:18:03+01:00"` - * - Times MAY be specified with millisecond precision, e.g. `"2022-05-12T15:18:03.349Z"` - */ -export interface TimeRange { - /** - * The end time of the range, encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. - */ - endTime?: Date; - /** - * The start time of the range, encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. - */ - startTime?: Date; - type: "fdc3.timeRange"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * @experimental context type representing a trade. To be used with execution systems. - * - * This type currently only defines a required `id` field, which should provide a reference - * to the trade in one or more systems, an optional human readable `name` field to be used - * to summarize the trade and a required `product` field that may be used to provide - * additional detail about the trade, which is currently typed as a unspecified Context - * type, but `product` is expected to be standardized in future. - * - * The Trade schema does not explicitly include identifiers in the id section, as there is - * not a common standard for such identifiers. Applications can, however, populate this part - * of the contract with custom identifiers if so desired. - */ -export interface Trade { - /** - * One or more identifiers that refer to the trade in an OMS, EMS or related system. - * Specific key names for systems are expected to be standardized in future. - */ - id: { [key: string]: string }; - /** - * A human-readable summary of the trade. - */ - name?: string; - /** - * A product that is the subject of the trade. - */ - product: ProductObject; - type: "fdc3.trade"; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * @experimental A list of trades. Use this type for use cases that require not just a - * single trade, but multiple. - * - * The TradeList schema does not explicitly include identifiers in the id section, as there - * is not a common standard for such identifiers. Applications can, however, populate this - * part of the contract with custom identifiers if so desired. - */ -export interface TradeList { - /** - * An array of trade contexts that forms the list. - */ - trades: TradeElement[]; - type: "fdc3.tradeList"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * @experimental context type representing a trade. To be used with execution systems. - * - * This type currently only defines a required `id` field, which should provide a reference - * to the trade in one or more systems, an optional human readable `name` field to be used - * to summarize the trade and a required `product` field that may be used to provide - * additional detail about the trade, which is currently typed as a unspecified Context - * type, but `product` is expected to be standardized in future. - * - * The Trade schema does not explicitly include identifiers in the id section, as there is - * not a common standard for such identifiers. Applications can, however, populate this part - * of the contract with custom identifiers if so desired. - */ -export interface TradeElement { - /** - * One or more identifiers that refer to the trade in an OMS, EMS or related system. - * Specific key names for systems are expected to be standardized in future. - */ - id: { [key: string]: string }; - /** - * A human-readable summary of the trade. - */ - name?: string; - /** - * A product that is the subject of the trade. - */ - product: ProductObject; - type: "fdc3.trade"; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A context type representing the result of a transaction initiated via FDC3, which SHOULD - * be returned as an `IntentResult` by intents that create, retrieve, update or delete - * content or records in another application. Its purpose is to provide a status and message - * (where needed) for the transaction and MAY wrap a returned context object. - */ -export interface TransactionResult { - /** - * A context object returned by the transaction, possibly with updated data. - */ - context?: ContextElement; - /** - * A human readable message describing the outcome of the transaction. - */ - message?: string; - /** - * The status of the transaction being reported. - */ - status: TransactionStatus; - type: "fdc3.transactionResult"; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * The status of the transaction being reported. - */ -export type TransactionStatus = "Created" | "Deleted" | "Updated" | "Failed"; - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -/** - * A context type representing the price and value of a holding. - */ -export interface Valuation { - /** - * The valuation currency, which should conform to 3 character alphabetic codes defined in - * [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) - */ - CURRENCY_ISOCODE: string; - /** - * The time at which this valuation expires, encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator included. - */ - expiryTime?: Date; - /** - * The price per unit the the valuation is based on. - */ - price?: number; - type: "fdc3.valuation"; - /** - * The time at which the valuation was performed, encoded according to [ISO - * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator included. - */ - valuationTime?: Date; - /** - * The value of the holding, expresses in the nominated currency. - */ - value: number; - id?: { [key: string]: any }; - name?: string; - [property: string]: any; -} - -/** - * Free text to be used for a keyword search - * - * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or - * `'Meeting'` although other string values are permitted. - */ - -// Converts JSON strings to/from your types -// and asserts the results of JSON.parse at runtime -export class Convert { - public static toAction(json: string): Action { - return cast(JSON.parse(json), r("Action")); - } - - public static actionToJson(value: Action): string { - return JSON.stringify(uncast(value, r("Action")), null, 2); - } - - public static toChart(json: string): Chart { - return cast(JSON.parse(json), r("Chart")); - } - - public static chartToJson(value: Chart): string { - return JSON.stringify(uncast(value, r("Chart")), null, 2); - } - - public static toChatInitSettings(json: string): ChatInitSettings { - return cast(JSON.parse(json), r("ChatInitSettings")); - } - - public static chatInitSettingsToJson(value: ChatInitSettings): string { - return JSON.stringify(uncast(value, r("ChatInitSettings")), null, 2); - } - - public static toChatMessage(json: string): ChatMessage { - return cast(JSON.parse(json), r("ChatMessage")); - } - - public static chatMessageToJson(value: ChatMessage): string { - return JSON.stringify(uncast(value, r("ChatMessage")), null, 2); - } - - public static toChatRoom(json: string): ChatRoom { - return cast(JSON.parse(json), r("ChatRoom")); - } - - public static chatRoomToJson(value: ChatRoom): string { - return JSON.stringify(uncast(value, r("ChatRoom")), null, 2); - } - - public static toChatSearchCriteria(json: string): ChatSearchCriteria { - return cast(JSON.parse(json), r("ChatSearchCriteria")); - } - - public static chatSearchCriteriaToJson(value: ChatSearchCriteria): string { - return JSON.stringify(uncast(value, r("ChatSearchCriteria")), null, 2); - } - - public static toContact(json: string): Contact { - return cast(JSON.parse(json), r("Contact")); - } - - public static contactToJson(value: Contact): string { - return JSON.stringify(uncast(value, r("Contact")), null, 2); - } - - public static toContactList(json: string): ContactList { - return cast(JSON.parse(json), r("ContactList")); - } - - public static contactListToJson(value: ContactList): string { - return JSON.stringify(uncast(value, r("ContactList")), null, 2); - } - - public static toContext(json: string): Context { - return cast(JSON.parse(json), r("Context")); - } - - public static contextToJson(value: Context): string { - return JSON.stringify(uncast(value, r("Context")), null, 2); - } - - public static toCountry(json: string): Country { - return cast(JSON.parse(json), r("Country")); - } - - public static countryToJson(value: Country): string { - return JSON.stringify(uncast(value, r("Country")), null, 2); - } - - public static toCurrency(json: string): Currency { - return cast(JSON.parse(json), r("Currency")); - } - - public static currencyToJson(value: Currency): string { - return JSON.stringify(uncast(value, r("Currency")), null, 2); - } - - public static toEmail(json: string): Email { - return cast(JSON.parse(json), r("Email")); - } - - public static emailToJson(value: Email): string { - return JSON.stringify(uncast(value, r("Email")), null, 2); - } - - public static toInstrument(json: string): Instrument { - return cast(JSON.parse(json), r("Instrument")); - } - - public static instrumentToJson(value: Instrument): string { - return JSON.stringify(uncast(value, r("Instrument")), null, 2); - } - - public static toInstrumentList(json: string): InstrumentList { - return cast(JSON.parse(json), r("InstrumentList")); - } - - public static instrumentListToJson(value: InstrumentList): string { - return JSON.stringify(uncast(value, r("InstrumentList")), null, 2); - } - - public static toInteraction(json: string): Interaction { - return cast(JSON.parse(json), r("Interaction")); - } - - public static interactionToJson(value: Interaction): string { - return JSON.stringify(uncast(value, r("Interaction")), null, 2); - } - - public static toMessage(json: string): Message { - return cast(JSON.parse(json), r("Message")); - } - - public static messageToJson(value: Message): string { - return JSON.stringify(uncast(value, r("Message")), null, 2); - } - - public static toNothing(json: string): Nothing { - return cast(JSON.parse(json), r("Nothing")); - } - - public static nothingToJson(value: Nothing): string { - return JSON.stringify(uncast(value, r("Nothing")), null, 2); - } - - public static toOrder(json: string): Order { - return cast(JSON.parse(json), r("Order")); - } - - public static orderToJson(value: Order): string { - return JSON.stringify(uncast(value, r("Order")), null, 2); - } - - public static toOrderList(json: string): OrderList { - return cast(JSON.parse(json), r("OrderList")); - } - - public static orderListToJson(value: OrderList): string { - return JSON.stringify(uncast(value, r("OrderList")), null, 2); - } - - public static toOrganization(json: string): Organization { - return cast(JSON.parse(json), r("Organization")); - } - - public static organizationToJson(value: Organization): string { - return JSON.stringify(uncast(value, r("Organization")), null, 2); - } - - public static toPortfolio(json: string): Portfolio { - return cast(JSON.parse(json), r("Portfolio")); - } - - public static portfolioToJson(value: Portfolio): string { - return JSON.stringify(uncast(value, r("Portfolio")), null, 2); - } - - public static toPosition(json: string): Position { - return cast(JSON.parse(json), r("Position")); - } - - public static positionToJson(value: Position): string { - return JSON.stringify(uncast(value, r("Position")), null, 2); - } - - public static toProduct(json: string): Product { - return cast(JSON.parse(json), r("Product")); - } - - public static productToJson(value: Product): string { - return JSON.stringify(uncast(value, r("Product")), null, 2); - } - - public static toTimeRange(json: string): TimeRange { - return cast(JSON.parse(json), r("TimeRange")); - } - - public static timeRangeToJson(value: TimeRange): string { - return JSON.stringify(uncast(value, r("TimeRange")), null, 2); - } - - public static toTrade(json: string): Trade { - return cast(JSON.parse(json), r("Trade")); - } - - public static tradeToJson(value: Trade): string { - return JSON.stringify(uncast(value, r("Trade")), null, 2); - } - - public static toTradeList(json: string): TradeList { - return cast(JSON.parse(json), r("TradeList")); - } - - public static tradeListToJson(value: TradeList): string { - return JSON.stringify(uncast(value, r("TradeList")), null, 2); - } - - public static toTransactionResult(json: string): TransactionResult { - return cast(JSON.parse(json), r("TransactionResult")); - } - - public static transactionResultToJson(value: TransactionResult): string { - return JSON.stringify(uncast(value, r("TransactionResult")), null, 2); - } - - public static toValuation(json: string): Valuation { - return cast(JSON.parse(json), r("Valuation")); - } - - public static valuationToJson(value: Valuation): string { - return JSON.stringify(uncast(value, r("Valuation")), null, 2); - } -} - -function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { - const prettyTyp = prettyTypeName(typ); - const parentText = parent ? ` on ${parent}` : ''; - const keyText = key ? ` for key "${key}"` : ''; - throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); -} - -function prettyTypeName(typ: any): string { - if (Array.isArray(typ)) { - if (typ.length === 2 && typ[0] === undefined) { - return `an optional ${prettyTypeName(typ[1])}`; - } else { - return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; - } - } else if (typeof typ === "object" && typ.literal !== undefined) { - return typ.literal; - } else { - return typeof typ; - } -} - -function jsonToJSProps(typ: any): any { - if (typ.jsonToJS === undefined) { - const map: any = {}; - typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); - typ.jsonToJS = map; - } - return typ.jsonToJS; -} - -function jsToJSONProps(typ: any): any { - if (typ.jsToJSON === undefined) { - const map: any = {}; - typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); - typ.jsToJSON = map; - } - return typ.jsToJSON; -} - -function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { - function transformPrimitive(typ: string, val: any): any { - if (typeof typ === typeof val) return val; - return invalidValue(typ, val, key, parent); - } - - function transformUnion(typs: any[], val: any): any { - // val must validate against one typ in typs - const l = typs.length; - for (let i = 0; i < l; i++) { - const typ = typs[i]; - try { - return transform(val, typ, getProps); - } catch (_) {} - } - return invalidValue(typs, val, key, parent); - } - - function transformEnum(cases: string[], val: any): any { - if (cases.indexOf(val) !== -1) return val; - return invalidValue(cases.map(a => { return l(a); }), val, key, parent); - } - - function transformArray(typ: any, val: any): any { - // val must be an array with no invalid elements - if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); - return val.map(el => transform(el, typ, getProps)); - } - - function transformDate(val: any): any { - if (val === null) { - return null; - } - const d = new Date(val); - if (isNaN(d.valueOf())) { - return invalidValue(l("Date"), val, key, parent); - } - return d; - } - - function transformObject(props: { [k: string]: any }, additional: any, val: any): any { - if (val === null || typeof val !== "object" || Array.isArray(val)) { - return invalidValue(l(ref || "object"), val, key, parent); - } - const result: any = {}; - Object.getOwnPropertyNames(props).forEach(key => { - const prop = props[key]; - const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; - result[prop.key] = transform(v, prop.typ, getProps, key, ref); - }); - Object.getOwnPropertyNames(val).forEach(key => { - if (!Object.prototype.hasOwnProperty.call(props, key)) { - result[key] = transform(val[key], additional, getProps, key, ref); - } - }); - return result; - } - - if (typ === "any") return val; - if (typ === null) { - if (val === null) return val; - return invalidValue(typ, val, key, parent); - } - if (typ === false) return invalidValue(typ, val, key, parent); - let ref: any = undefined; - while (typeof typ === "object" && typ.ref !== undefined) { - ref = typ.ref; - typ = typeMap[typ.ref]; - } - if (Array.isArray(typ)) return transformEnum(typ, val); - if (typeof typ === "object") { - return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) - : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) - : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) - : invalidValue(typ, val, key, parent); - } - // Numbers can be parsed by Date but shouldn't be. - if (typ === Date && typeof val !== "number") return transformDate(val); - return transformPrimitive(typ, val); -} - -function cast(val: any, typ: any): T { - return transform(val, typ, jsonToJSProps); -} - -function uncast(val: T, typ: any): any { - return transform(val, typ, jsToJSONProps); -} - -function l(typ: any) { - return { literal: typ }; -} - -function a(typ: any) { - return { arrayItems: typ }; -} - -function u(...typs: any[]) { - return { unionMembers: typs }; -} - -function o(props: any[], additional: any) { - return { props, additional }; -} - -function m(additional: any) { - return { props: [], additional }; -} - -function r(name: string) { - return { ref: name }; -} - -const typeMap: any = { - "Action": o([ - { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, - { json: "context", js: "context", typ: r("ContextElement") }, - { json: "intent", js: "intent", typ: u(undefined, "") }, - { json: "title", js: "title", typ: "" }, - { json: "type", js: "type", typ: r("ActionType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "AppIdentifier": o([ - { json: "appId", js: "appId", typ: "" }, - { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, - { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, - ], "any"), - "ContextElement": o([ - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: "" }, - ], "any"), - "Chart": o([ - { json: "instruments", js: "instruments", typ: a(r("InstrumentElement")) }, - { json: "otherConfig", js: "otherConfig", typ: u(undefined, a(r("ContextElement"))) }, - { json: "range", js: "range", typ: u(undefined, r("TimeRangeObject")) }, - { json: "style", js: "style", typ: u(undefined, r("ChartStyle")) }, - { json: "type", js: "type", typ: r("ChartType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "InstrumentElement": o([ - { json: "id", js: "id", typ: r("PurpleInstrumentIdentifiers") }, - { json: "market", js: "market", typ: u(undefined, r("OrganizationMarket")) }, - { json: "type", js: "type", typ: r("PurpleInteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "PurpleInstrumentIdentifiers": o([ - { json: "BBG", js: "BBG", typ: u(undefined, "") }, - { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, - { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, - { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, - { json: "RIC", js: "RIC", typ: u(undefined, "") }, - { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, - { json: "ticker", js: "ticker", typ: u(undefined, "") }, - ], "any"), - "OrganizationMarket": o([ - { json: "BBG", js: "BBG", typ: u(undefined, "") }, - { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, - { json: "MIC", js: "MIC", typ: u(undefined, "") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "TimeRangeObject": o([ - { json: "endTime", js: "endTime", typ: u(undefined, Date) }, - { json: "startTime", js: "startTime", typ: u(undefined, Date) }, - { json: "type", js: "type", typ: r("TimeRangeType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "ChatInitSettings": o([ - { json: "chatName", js: "chatName", typ: u(undefined, "") }, - { json: "members", js: "members", typ: u(undefined, r("ContactListObject")) }, - { json: "message", js: "message", typ: u(undefined, u(r("MessageObject"), "")) }, - { json: "options", js: "options", typ: u(undefined, r("ChatOptions")) }, - { json: "type", js: "type", typ: r("ChatInitSettingsType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "ContactListObject": o([ - { json: "contacts", js: "contacts", typ: a(r("ContactElement")) }, - { json: "type", js: "type", typ: r("ContactListType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "ContactElement": o([ - { json: "id", js: "id", typ: r("PurpleContactIdentifiers") }, - { json: "type", js: "type", typ: r("FluffyInteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "PurpleContactIdentifiers": o([ - { json: "email", js: "email", typ: u(undefined, "") }, - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - ], "any"), - "MessageObject": o([ - { json: "entities", js: "entities", typ: u(undefined, m(r("PurpleAction"))) }, - { json: "text", js: "text", typ: u(undefined, r("PurpleMessageText")) }, - { json: "type", js: "type", typ: r("MessageType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "PurpleAction": o([ - { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, - { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, - { json: "intent", js: "intent", typ: u(undefined, "") }, - { json: "title", js: "title", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("EntityType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "data", js: "data", typ: u(undefined, r("PurpleData")) }, - ], "any"), - "PurpleData": o([ - { json: "dataUri", js: "dataUri", typ: "" }, - { json: "name", js: "name", typ: "" }, - ], "any"), - "PurpleMessageText": o([ - { json: "text/markdown", js: "text/markdown", typ: u(undefined, "") }, - { json: "text/plain", js: "text/plain", typ: u(undefined, "") }, - ], "any"), - "ChatOptions": o([ - { json: "allowAddUser", js: "allowAddUser", typ: u(undefined, true) }, - { json: "allowHistoryBrowsing", js: "allowHistoryBrowsing", typ: u(undefined, true) }, - { json: "allowMessageCopy", js: "allowMessageCopy", typ: u(undefined, true) }, - { json: "groupRecipients", js: "groupRecipients", typ: u(undefined, true) }, - { json: "isPublic", js: "isPublic", typ: u(undefined, true) }, - ], "any"), - "ChatMessage": o([ - { json: "chatRoom", js: "chatRoom", typ: r("ChatRoomObject") }, - { json: "message", js: "message", typ: r("MessageObject") }, - { json: "type", js: "type", typ: r("ChatMessageType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "ChatRoomObject": o([ - { json: "id", js: "id", typ: m("any") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "providerName", js: "providerName", typ: "" }, - { json: "type", js: "type", typ: r("ChatRoomType") }, - { json: "url", js: "url", typ: u(undefined, "") }, - ], "any"), - "ChatRoom": o([ - { json: "id", js: "id", typ: m("any") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "providerName", js: "providerName", typ: "" }, - { json: "type", js: "type", typ: r("ChatRoomType") }, - { json: "url", js: "url", typ: u(undefined, "") }, - ], "any"), - "ChatSearchCriteria": o([ - { json: "criteria", js: "criteria", typ: a(u(r("OrganizationObject"), "")) }, - { json: "type", js: "type", typ: r("ChatSearchCriteriaType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "OrganizationObject": o([ - { json: "id", js: "id", typ: r("Identifiers") }, - { json: "market", js: "market", typ: u(undefined, r("OrganizationMarket")) }, - { json: "type", js: "type", typ: r("TentacledInteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Identifiers": o([ - { json: "BBG", js: "BBG", typ: u(undefined, "") }, - { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, - { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, - { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, - { json: "RIC", js: "RIC", typ: u(undefined, "") }, - { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, - { json: "ticker", js: "ticker", typ: u(undefined, "") }, - { json: "LEI", js: "LEI", typ: u(undefined, "") }, - { json: "email", js: "email", typ: u(undefined, "") }, - ], "any"), - "Contact": o([ - { json: "id", js: "id", typ: r("FluffyContactIdentifiers") }, - { json: "type", js: "type", typ: r("FluffyInteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "FluffyContactIdentifiers": o([ - { json: "email", js: "email", typ: u(undefined, "") }, - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - ], "any"), - "ContactList": o([ - { json: "contacts", js: "contacts", typ: a(r("ContactElement")) }, - { json: "type", js: "type", typ: r("ContactListType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Context": o([ - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: "" }, - ], "any"), - "Country": o([ - { json: "id", js: "id", typ: r("CountryID") }, - { json: "type", js: "type", typ: r("CountryType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "CountryID": o([ - { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, - { json: "COUNTRY_ISOALPHA3", js: "COUNTRY_ISOALPHA3", typ: u(undefined, "") }, - { json: "ISOALPHA2", js: "ISOALPHA2", typ: u(undefined, "") }, - { json: "ISOALPHA3", js: "ISOALPHA3", typ: u(undefined, "") }, - ], "any"), - "Currency": o([ - { json: "id", js: "id", typ: r("CurrencyID") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("CurrencyType") }, - ], "any"), - "CurrencyID": o([ - { json: "CURRENCY_ISOCODE", js: "CURRENCY_ISOCODE", typ: u(undefined, "") }, - ], "any"), - "Email": o([ - { json: "recipients", js: "recipients", typ: r("EmailRecipients") }, - { json: "subject", js: "subject", typ: u(undefined, "") }, - { json: "textBody", js: "textBody", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("EmailType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "EmailRecipients": o([ - { json: "id", js: "id", typ: u(undefined, r("EmailRecipientsID")) }, - { json: "type", js: "type", typ: r("EmailRecipientsType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "contacts", js: "contacts", typ: u(undefined, a(r("ContactElement"))) }, - ], "any"), - "EmailRecipientsID": o([ - { json: "email", js: "email", typ: u(undefined, "") }, - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - ], "any"), - "Instrument": o([ - { json: "id", js: "id", typ: r("FluffyInstrumentIdentifiers") }, - { json: "market", js: "market", typ: u(undefined, r("PurpleMarket")) }, - { json: "type", js: "type", typ: r("PurpleInteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "FluffyInstrumentIdentifiers": o([ - { json: "BBG", js: "BBG", typ: u(undefined, "") }, - { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, - { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, - { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, - { json: "RIC", js: "RIC", typ: u(undefined, "") }, - { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, - { json: "ticker", js: "ticker", typ: u(undefined, "") }, - ], "any"), - "PurpleMarket": o([ - { json: "BBG", js: "BBG", typ: u(undefined, "") }, - { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, - { json: "MIC", js: "MIC", typ: u(undefined, "") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "InstrumentList": o([ - { json: "instruments", js: "instruments", typ: a(r("InstrumentElement")) }, - { json: "type", js: "type", typ: r("InstrumentListType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Interaction": o([ - { json: "description", js: "description", typ: "" }, - { json: "id", js: "id", typ: u(undefined, r("InteractionID")) }, - { json: "initiator", js: "initiator", typ: u(undefined, r("ContactElement")) }, - { json: "interactionType", js: "interactionType", typ: "" }, - { json: "origin", js: "origin", typ: u(undefined, "") }, - { json: "participants", js: "participants", typ: r("ContactListObject") }, - { json: "timeRange", js: "timeRange", typ: r("TimeRangeObject") }, - { json: "type", js: "type", typ: r("InteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "InteractionID": o([ - { json: "SALESFORCE", js: "SALESFORCE", typ: u(undefined, "") }, - { json: "SINGLETRACK", js: "SINGLETRACK", typ: u(undefined, "") }, - { json: "URI", js: "URI", typ: u(undefined, "") }, - ], "any"), - "Message": o([ - { json: "entities", js: "entities", typ: u(undefined, m(r("FluffyAction"))) }, - { json: "text", js: "text", typ: u(undefined, r("FluffyMessageText")) }, - { json: "type", js: "type", typ: r("MessageType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "FluffyAction": o([ - { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, - { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, - { json: "intent", js: "intent", typ: u(undefined, "") }, - { json: "title", js: "title", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("EntityType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "data", js: "data", typ: u(undefined, r("FluffyData")) }, - ], "any"), - "FluffyData": o([ - { json: "dataUri", js: "dataUri", typ: "" }, - { json: "name", js: "name", typ: "" }, - ], "any"), - "FluffyMessageText": o([ - { json: "text/markdown", js: "text/markdown", typ: u(undefined, "") }, - { json: "text/plain", js: "text/plain", typ: u(undefined, "") }, - ], "any"), - "Nothing": o([ - { json: "type", js: "type", typ: r("NothingType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Order": o([ - { json: "details", js: "details", typ: u(undefined, r("PurpleOrderDetails")) }, - { json: "id", js: "id", typ: m("") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("OrderType") }, - ], "any"), - "PurpleOrderDetails": o([ - { json: "product", js: "product", typ: u(undefined, r("ProductObject")) }, - ], "any"), - "ProductObject": o([ - { json: "id", js: "id", typ: m("") }, - { json: "instrument", js: "instrument", typ: u(undefined, r("InstrumentElement")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("ProductType") }, - ], "any"), - "OrderList": o([ - { json: "orders", js: "orders", typ: a(r("OrderElement")) }, - { json: "type", js: "type", typ: r("OrderListType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "OrderElement": o([ - { json: "details", js: "details", typ: u(undefined, r("FluffyOrderDetails")) }, - { json: "id", js: "id", typ: m("") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("OrderType") }, - ], "any"), - "FluffyOrderDetails": o([ - { json: "product", js: "product", typ: u(undefined, r("ProductObject")) }, - ], "any"), - "Organization": o([ - { json: "id", js: "id", typ: r("OrganizationIdentifiers") }, - { json: "type", js: "type", typ: r("StickyInteractionType") }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "OrganizationIdentifiers": o([ - { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, - { json: "LEI", js: "LEI", typ: u(undefined, "") }, - { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, - ], "any"), - "Portfolio": o([ - { json: "positions", js: "positions", typ: a(r("PositionElement")) }, - { json: "type", js: "type", typ: r("PortfolioType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "PositionElement": o([ - { json: "holding", js: "holding", typ: 3.14 }, - { json: "instrument", js: "instrument", typ: r("InstrumentElement") }, - { json: "type", js: "type", typ: r("PositionType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Position": o([ - { json: "holding", js: "holding", typ: 3.14 }, - { json: "instrument", js: "instrument", typ: r("InstrumentElement") }, - { json: "type", js: "type", typ: r("PositionType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Product": o([ - { json: "id", js: "id", typ: m("") }, - { json: "instrument", js: "instrument", typ: u(undefined, r("InstrumentElement")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "type", js: "type", typ: r("ProductType") }, - ], "any"), - "TimeRange": o([ - { json: "endTime", js: "endTime", typ: u(undefined, Date) }, - { json: "startTime", js: "startTime", typ: u(undefined, Date) }, - { json: "type", js: "type", typ: r("TimeRangeType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Trade": o([ - { json: "id", js: "id", typ: m("") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "product", js: "product", typ: r("ProductObject") }, - { json: "type", js: "type", typ: r("TradeType") }, - ], "any"), - "TradeList": o([ - { json: "trades", js: "trades", typ: a(r("TradeElement")) }, - { json: "type", js: "type", typ: r("TradeListType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "TradeElement": o([ - { json: "id", js: "id", typ: m("") }, - { json: "name", js: "name", typ: u(undefined, "") }, - { json: "product", js: "product", typ: r("ProductObject") }, - { json: "type", js: "type", typ: r("TradeType") }, - ], "any"), - "TransactionResult": o([ - { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, - { json: "message", js: "message", typ: u(undefined, "") }, - { json: "status", js: "status", typ: r("TransactionStatus") }, - { json: "type", js: "type", typ: r("TransactionResultType") }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "Valuation": o([ - { json: "CURRENCY_ISOCODE", js: "CURRENCY_ISOCODE", typ: "" }, - { json: "expiryTime", js: "expiryTime", typ: u(undefined, Date) }, - { json: "price", js: "price", typ: u(undefined, 3.14) }, - { json: "type", js: "type", typ: r("ValuationType") }, - { json: "valuationTime", js: "valuationTime", typ: u(undefined, Date) }, - { json: "value", js: "value", typ: 3.14 }, - { json: "id", js: "id", typ: u(undefined, m("any")) }, - { json: "name", js: "name", typ: u(undefined, "") }, - ], "any"), - "ActionType": [ - "fdc3.action", - ], - "PurpleInteractionType": [ - "fdc3.instrument", - ], - "TimeRangeType": [ - "fdc3.timeRange", - ], - "ChartStyle": [ - "bar", - "candle", - "custom", - "heatmap", - "histogram", - "line", - "mountain", - "pie", - "scatter", - "stacked-bar", - ], - "ChartType": [ - "fdc3.chart", - ], - "FluffyInteractionType": [ - "fdc3.contact", - ], - "ContactListType": [ - "fdc3.contactList", - ], - "EntityType": [ - "fdc3.action", - "fdc3.entity.fileAttachment", - ], - "MessageType": [ - "fdc3.message", - ], - "ChatInitSettingsType": [ - "fdc3.chat.initSettings", - ], - "ChatRoomType": [ - "fdc3.chat.room", - ], - "ChatMessageType": [ - "fdc3.chat.message", - ], - "TentacledInteractionType": [ - "fdc3.contact", - "fdc3.instrument", - "fdc3.organization", - ], - "ChatSearchCriteriaType": [ - "fdc3.chat.searchCriteria", - ], - "CountryType": [ - "fdc3.country", - ], - "CurrencyType": [ - "fdc3.currency", - ], - "EmailRecipientsType": [ - "fdc3.contact", - "fdc3.contactList", - ], - "EmailType": [ - "fdc3.email", - ], - "InstrumentListType": [ - "fdc3.instrumentList", - ], - "InteractionType": [ - "fdc3.interaction", - ], - "NothingType": [ - "fdc3.nothing", - ], - "ProductType": [ - "fdc3.product", - ], - "OrderType": [ - "fdc3.order", - ], - "OrderListType": [ - "fdc3.orderList", - ], - "StickyInteractionType": [ - "fdc3.organization", - ], - "PositionType": [ - "fdc3.position", - ], - "PortfolioType": [ - "fdc3.portfolio", - ], - "TradeType": [ - "fdc3.trade", - ], - "TradeListType": [ - "fdc3.tradeList", - ], - "TransactionStatus": [ - "Created", - "Deleted", - "Failed", - "Updated", - ], - "TransactionResultType": [ - "fdc3.transactionResult", - ], - "ValuationType": [ - "fdc3.valuation", - ], -}; diff --git a/packages/fdc3-schema/package.json b/packages/fdc3-schema/package.json index 8ca94fe84..9d17e5322 100644 --- a/packages/fdc3-schema/package.json +++ b/packages/fdc3-schema/package.json @@ -18,7 +18,7 @@ ], "scripts": { "clean": "rimraf dist && rimraf generated", - "mkdirs": "mkdirp generated/context && mkdirp generated/api && mkdirp generated/bridging", + "mkdirs": "mkdirp generated/api && mkdirp generated/bridging", "generate": "npm run mkdirs && npm run typegen-browser && npm run typegen-bridging && npm run lint", "build": "npm run generate && tsc --module es2022", "test": "npm run generate && tsc", From dcfd5a69733c9f542f70dc06906681c4116e9433 Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 16:01:26 +0100 Subject: [PATCH 14/16] Added missing import --- package-lock.json | 6 +- .../generated/context/ContextTypes.ts | 2901 +++++++++++++++++ packages/fdc3-get-agent/package.json | 2 + 3 files changed, 2907 insertions(+), 2 deletions(-) create mode 100644 packages/fdc3-context/generated/context/ContextTypes.ts diff --git a/package-lock.json b/package-lock.json index 905e75f88..717ba4522 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,8 @@ "toolbox/fdc3-for-web/da-server", "packages/fdc3-get-agent", "toolbox/fdc3-for-web/demo", - "toolbox/fdc3-workbench" + "toolbox/fdc3-workbench", + "package/fdc3" ], "dependencies": { "syncpack": "^12.4.0" @@ -16096,6 +16097,8 @@ "version": "2.2.0-beta.6", "dependencies": { "@kite9/da-proxy": "2.2.0-beta.6", + "@kite9/fdc3-context": "2.2.0-beta.6", + "@kite9/fdc3-schema": "2.2.0-beta.6", "@kite9/fdc3-standard": "2.2.0-beta.6", "@types/uuid": "^10.0.0", "uuid": "^9.0.1" @@ -16259,7 +16262,6 @@ "@fontsource/roboto": "^4.4.5", "@fontsource/source-code-pro": "^4.5.0", "@kite9/fdc3": "2.2.0-beta.6", - "@kite9/fdc3-get-agent": "2.2.0-beta.6", "@material-ui/core": "^4.11.4", "@material-ui/icons": "^4.11.2", "@material-ui/lab": "^4.0.0-alpha.59", diff --git a/packages/fdc3-context/generated/context/ContextTypes.ts b/packages/fdc3-context/generated/context/ContextTypes.ts new file mode 100644 index 000000000..8fccd9007 --- /dev/null +++ b/packages/fdc3-context/generated/context/ContextTypes.ts @@ -0,0 +1,2901 @@ +// To parse this data: +// +// import { Convert, Action, Chart, ChatInitSettings, ChatMessage, ChatRoom, ChatSearchCriteria, Contact, ContactList, Context, Country, Currency, Email, Instrument, InstrumentList, Interaction, Message, Nothing, Order, OrderList, Organization, Portfolio, Position, Product, TimeRange, Trade, TradeList, TransactionResult, Valuation } from "./file"; +// +// const action = Convert.toAction(json); +// const chart = Convert.toChart(json); +// const chatInitSettings = Convert.toChatInitSettings(json); +// const chatMessage = Convert.toChatMessage(json); +// const chatRoom = Convert.toChatRoom(json); +// const chatSearchCriteria = Convert.toChatSearchCriteria(json); +// const contact = Convert.toContact(json); +// const contactList = Convert.toContactList(json); +// const context = Convert.toContext(json); +// const country = Convert.toCountry(json); +// const currency = Convert.toCurrency(json); +// const email = Convert.toEmail(json); +// const instrument = Convert.toInstrument(json); +// const instrumentList = Convert.toInstrumentList(json); +// const interaction = Convert.toInteraction(json); +// const message = Convert.toMessage(json); +// const nothing = Convert.toNothing(json); +// const order = Convert.toOrder(json); +// const orderList = Convert.toOrderList(json); +// const organization = Convert.toOrganization(json); +// const portfolio = Convert.toPortfolio(json); +// const position = Convert.toPosition(json); +// const product = Convert.toProduct(json); +// const timeRange = Convert.toTimeRange(json); +// const trade = Convert.toTrade(json); +// const tradeList = Convert.toTradeList(json); +// const transactionResult = Convert.toTransactionResult(json); +// const valuation = Convert.toValuation(json); +// +// These functions will throw an error if the JSON doesn't +// match the expected interface, even if the JSON is valid. + +/** + * 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. + */ +export interface Action { + /** + * An optional target application identifier that should perform the action + */ + app?: AppIdentifier; + /** + * A context object with which the action will be performed + */ + context: ContextElement; + /** + * 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. + */ + intent?: string; + /** + * A human readable display name for the action + */ + title: string; + type: "fdc3.action"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * An optional target application identifier that should perform the action + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + */ +export interface AppIdentifier { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * A context object with which the action will be performed + * + * A context object returned by the transaction, possibly with updated data. + * + * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by + * FDC3 operations. As such, it is not really meant to be used on its own, but is imported + * by more specific type definitions (standardized or custom) to provide the structure and + * properties shared by all FDC3 context data types. + * + * The key element of FDC3 context types is their mandatory `type` property, which is used + * to identify what type of data the object represents, and what shape it has. + * + * The FDC3 context type, and all derived types, define the minimum set of fields a context + * data object of a particular type can be expected to have, but this can always be extended + * with custom fields as appropriate. + */ +export interface ContextElement { + /** + * Context data objects may include a set of equivalent key-value pairs that can be used to + * help applications identify and look up the context type they receive in their own domain. + * The idea behind this design is that applications can provide as many equivalent + * identifiers to a target application as possible, e.g. an instrument may be represented by + * an ISIN, CUSIP or Bloomberg identifier. + * + * Identifiers do not make sense for all types of data, so the `id` property is therefore + * optional, but some derived types may choose to require at least one identifier. + * Identifier values SHOULD always be of type string. + */ + id?: { [key: string]: any }; + /** + * Context data objects may include a name property that can be used for more information, + * or display purposes. Some derived types may require the name object as mandatory, + * depending on use case. + */ + name?: string; + /** + * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 + * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present + * to route shared context data appropriately. + * + * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data + * types they support in an FDC3 [App + * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery + * and routing. + * + * Standardized FDC3 context types have well-known `type` properties prefixed with the + * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and + * used by a particular organization, the convention is to prefix them with an + * organization-specific namespace, e.g. `blackrock.fund`. + * + * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more + * information about context data types. + */ + type: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * 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. + * + * 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. + */ +export interface Chart { + /** + * An array of instrument contexts whose data should be plotted. + */ + instruments: InstrumentElement[]; + /** + * 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. + */ + otherConfig?: ContextElement[]; + /** + * The time range that should be plotted + */ + range?: TimeRangeObject; + /** + * The type of chart that should be plotted + */ + style?: ChartStyle; + type: "fdc3.chart"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * financial instrument that relates to the definition of this product + * + * + * + * A financial instrument from any asset class. + */ +export interface InstrumentElement { + /** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + */ + id: PurpleInstrumentIdentifiers; + /** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ + market?: OrganizationMarket; + type: "fdc3.instrument"; + name?: string; + [property: string]: any; +} + +/** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + */ +export interface PurpleInstrumentIdentifiers { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.cusip.com/ + */ + CUSIP?: string; + /** + * https://www.factset.com/ + */ + FDS_ID?: string; + /** + * https://www.openfigi.com/ + */ + FIGI?: string; + /** + * https://www.isin.org/ + */ + ISIN?: string; + /** + * https://permid.org/ + */ + PERMID?: string; + /** + * https://www.refinitiv.com/ + */ + RIC?: string; + /** + * https://www.lseg.com/sedol + */ + SEDOL?: string; + /** + * Unstandardized stock tickers + */ + ticker?: string; + [property: string]: any; +} + +/** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ +export interface OrganizationMarket { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.iso.org/iso-3166-country-codes.html + */ + COUNTRY_ISOALPHA2?: string; + /** + * https://en.wikipedia.org/wiki/Market_Identifier_Code + */ + MIC?: string; + /** + * Human readable market name + */ + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * The time range that should be plotted + * + * The time range over which the interaction occurred + * + * A context representing a period of time. Any user interfaces that represent or visualize + * events or activity over time can be filtered or focused on a particular time period, + * e.g.: + * + * - A pricing chart + * - A trade blotter + * - A record of client contact/activity in a CRM + * + * Example use cases: + * + * - User may want to view pricing/trades/customer activity for a security over a particular + * time period, the time range might be specified as the context for the `ViewChart` intent + * OR it might be embedded in another context (e.g. a context representing a chart to plot). + * - User filters a visualization (e.g. a pricing chart) to show a particular period, the + * `TimeRange` is broadcast and other visualizations (e.g. a heatmap of activity by + * instrument, or industry sector etc.) receive it and filter themselves to show data over + * the same range. + * + * Notes: + * + * - A `TimeRange` may be closed (i.e. `startTime` and `endTime` are both known) or open + * (i.e. only one of `startTime` or `endTime` is known). + * - Ranges corresponding to dates (e.g. `2022-05-12` to `2022-05-19`) should be specified + * using times as this prevents issues with timezone conversions and inclusive/exclusive + * date ranges. + * - String fields representing times are encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html). + * - A timezone indicator should be specified, e.g. `"2022-05-12T15:18:03Z"` or + * `"2022-05-12T16:18:03+01:00"` + * - Times MAY be specified with millisecond precision, e.g. `"2022-05-12T15:18:03.349Z"` + */ +export interface TimeRangeObject { + /** + * The end time of the range, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. + */ + endTime?: Date; + /** + * The start time of the range, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. + */ + startTime?: Date; + type: "fdc3.timeRange"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * The type of chart that should be plotted + */ +export type ChartStyle = "line" | "bar" | "stacked-bar" | "mountain" | "candle" | "pie" | "scatter" | "histogram" | "heatmap" | "custom"; + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A collection of settings to start a new chat conversation + */ +export interface ChatInitSettings { + /** + * Name to apply to the chat created + */ + chatName?: string; + /** + * Contacts to add to the chat + */ + members?: ContactListObject; + /** + * An initial message to post in the chat when created. + */ + message?: MessageObject | string; + /** + * Option settings that affect the creation of the chat + */ + options?: ChatOptions; + type: "fdc3.chat.initSettings"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Contacts to add to the chat + * + * A list of contacts involved in the interaction + * + * A collection of contacts, e.g. for chatting to or calling multiple contacts. + * + * The contact list schema does not explicitly include identifiers in the `id` section, as + * there is not a common standard for such identifiers. Applications can, however, populate + * this part of the contract with custom identifiers if so desired. + */ +export interface ContactListObject { + /** + * An array of contact contexts that forms the list. + */ + contacts: ContactElement[]; + type: "fdc3.contactList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * The contact that initiated the interaction + * + * A person contact that can be engaged with through email, calling, messaging, CMS, etc. + */ +export interface ContactElement { + /** + * Identifiers that relate to the Contact represented by this context + */ + id: PurpleContactIdentifiers; + type: "fdc3.contact"; + name?: string; + [property: string]: any; +} + +/** + * Identifiers that relate to the Contact represented by this context + */ +export interface PurpleContactIdentifiers { + /** + * The email address for the contact + */ + email?: string; + /** + * FactSet Permanent Identifier representing the contact + */ + FDS_ID?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A chat message to be sent through an instant messaging application. Can contain one or + * several text bodies (organized by mime-type, plaintext or markdown), as well as attached + * entities (either arbitrary file attachments or FDC3 actions to be embedded in the + * message). To be put inside a ChatInitSettings object. + */ +export interface MessageObject { + /** + * A map of string IDs to entities that should be attached to the message, such as an action + * to perform, a file attachment, or other FDC3 context object. + */ + entities?: { [key: string]: PurpleAction }; + /** + * A map of string mime-type to string content + */ + text?: PurpleMessageText; + type: "fdc3.message"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * 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. + * + * A File attachment encoded in the form of a data URI + */ +export interface PurpleAction { + /** + * An optional target application identifier that should perform the action + */ + app?: AppIdentifier; + /** + * A context object with which the action will be performed + */ + context?: ContextElement; + /** + * 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. + */ + intent?: string; + /** + * A human readable display name for the action + */ + title?: string; + type: EntityType; + id?: { [key: string]: any }; + name?: string; + data?: PurpleData; + [property: string]: any; +} + +export interface PurpleData { + /** + * A data URI encoding the content of the file to be attached + */ + dataUri: string; + /** + * The name of the attached file + */ + name: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ +export type EntityType = "fdc3.action" | "fdc3.entity.fileAttachment"; + +/** + * A map of string mime-type to string content + */ +export interface PurpleMessageText { + /** + * Markdown encoded content + */ + "text/markdown"?: string; + /** + * Plain text encoded content. + */ + "text/plain"?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Option settings that affect the creation of the chat + */ +export interface ChatOptions { + /** + * if true members will be allowed to add other members to the chat + */ + allowAddUser?: boolean; + /** + * if true members will be allowed to browse past messages + */ + allowHistoryBrowsing?: boolean; + /** + * if true members will be allowed to copy/paste messages + */ + allowMessageCopy?: boolean; + /** + * if false a separate chat will be created for each member + */ + groupRecipients?: boolean; + /** + * if true the room will be visible to everyone in the chat application + */ + isPublic?: boolean; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A context representing a chat message. Typically used to send the message or to + * pre-populate a message for sending. + */ +export interface ChatMessage { + chatRoom: ChatRoomObject; + message: MessageObject; + type: "fdc3.chat.message"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Reference to the chat room which could be used to send a message to the room + */ +export interface ChatRoomObject { + /** + * Identifier(s) for the chat - currently unstandardized + */ + id: { [key: string]: any }; + /** + * Display name for the chat room + */ + name?: string; + /** + * The name of the service that hosts the chat + */ + providerName: string; + type: "fdc3.chat.room"; + /** + * Universal url to access to the room. It could be opened from a browser, a mobile app, + * etc... + */ + url?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Reference to the chat room which could be used to send a message to the room + */ +export interface ChatRoom { + /** + * Identifier(s) for the chat - currently unstandardized + */ + id: { [key: string]: any }; + /** + * Display name for the chat room + */ + name?: string; + /** + * The name of the service that hosts the chat + */ + providerName: string; + type: "fdc3.chat.room"; + /** + * Universal url to access to the room. It could be opened from a browser, a mobile app, + * etc... + */ + url?: string; + [property: string]: any; +} + +/** + * A context type that represents a simple search criterion, based on a list of other + * context objects, that can be used to search or filter messages in a chat application. + */ +export interface ChatSearchCriteria { + /** + * An array of criteria that should match chats returned from by a search. + * + * ⚠️ Operators (and/or/not) are not defined in `fdc3.chat.searchCriteria`. It is up to the + * application that processes the FDC3 Intent to choose and apply the operators between the + * criteria. + * + * Empty search criteria can be supported to allow resetting of filters. + */ + criteria: Array; + type: "fdc3.chat.searchCriteria"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * financial instrument that relates to the definition of this product + * + * + * + * A financial instrument from any asset class. + * + * An entity that can be used when referencing private companies and other organizations + * where a specific instrument is not available or desired e.g. CRM and News workflows. + * + * It is valid to include extra properties and metadata as part of the organization payload, + * but the minimum requirement is for at least one specified identifier to be provided. + * + * The contact that initiated the interaction + * + * A person contact that can be engaged with through email, calling, messaging, CMS, etc. + */ +export interface OrganizationObject { + /** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + * + * Identifiers for the organization, at least one must be provided. + * + * Identifiers that relate to the Contact represented by this context + */ + id: Identifiers; + /** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ + market?: OrganizationMarket; + type: TentacledInteractionType; + name?: string; + [property: string]: any; +} + +/** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + * + * Identifiers for the organization, at least one must be provided. + * + * Identifiers that relate to the Contact represented by this context + */ +export interface Identifiers { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.cusip.com/ + */ + CUSIP?: string; + /** + * https://www.factset.com/ + * + * FactSet Permanent Identifier representing the organization + * + * FactSet Permanent Identifier representing the contact + */ + FDS_ID?: string; + /** + * https://www.openfigi.com/ + */ + FIGI?: string; + /** + * https://www.isin.org/ + */ + ISIN?: string; + /** + * https://permid.org/ + * + * Refinitiv Permanent Identifiers, or PermID for the organization + */ + PERMID?: string; + /** + * https://www.refinitiv.com/ + */ + RIC?: string; + /** + * https://www.lseg.com/sedol + */ + SEDOL?: string; + /** + * Unstandardized stock tickers + */ + ticker?: string; + /** + * The Legal Entity Identifier (LEI) is a 20-character, alpha-numeric code based on the ISO + * 17442 standard developed by the International Organization for Standardization (ISO). It + * connects to key reference information that enables clear and unique identification of + * legal entities participating in financial transactions. + */ + LEI?: string; + /** + * The email address for the contact + */ + email?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ +export type TentacledInteractionType = "fdc3.instrument" | "fdc3.organization" | "fdc3.contact"; + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A person contact that can be engaged with through email, calling, messaging, CMS, etc. + */ +export interface Contact { + /** + * Identifiers that relate to the Contact represented by this context + */ + id: FluffyContactIdentifiers; + type: "fdc3.contact"; + name?: string; + [property: string]: any; +} + +/** + * Identifiers that relate to the Contact represented by this context + */ +export interface FluffyContactIdentifiers { + /** + * The email address for the contact + */ + email?: string; + /** + * FactSet Permanent Identifier representing the contact + */ + FDS_ID?: string; + [property: string]: any; +} + +/** + * A collection of contacts, e.g. for chatting to or calling multiple contacts. + * + * The contact list schema does not explicitly include identifiers in the `id` section, as + * there is not a common standard for such identifiers. Applications can, however, populate + * this part of the contract with custom identifiers if so desired. + */ +export interface ContactList { + /** + * An array of contact contexts that forms the list. + */ + contacts: ContactElement[]; + type: "fdc3.contactList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by + * FDC3 operations. As such, it is not really meant to be used on its own, but is imported + * by more specific type definitions (standardized or custom) to provide the structure and + * properties shared by all FDC3 context data types. + * + * The key element of FDC3 context types is their mandatory `type` property, which is used + * to identify what type of data the object represents, and what shape it has. + * + * The FDC3 context type, and all derived types, define the minimum set of fields a context + * data object of a particular type can be expected to have, but this can always be extended + * with custom fields as appropriate. + */ +export interface Context { + /** + * Context data objects may include a set of equivalent key-value pairs that can be used to + * help applications identify and look up the context type they receive in their own domain. + * The idea behind this design is that applications can provide as many equivalent + * identifiers to a target application as possible, e.g. an instrument may be represented by + * an ISIN, CUSIP or Bloomberg identifier. + * + * Identifiers do not make sense for all types of data, so the `id` property is therefore + * optional, but some derived types may choose to require at least one identifier. + * Identifier values SHOULD always be of type string. + */ + id?: { [key: string]: any }; + /** + * Context data objects may include a name property that can be used for more information, + * or display purposes. Some derived types may require the name object as mandatory, + * depending on use case. + */ + name?: string; + /** + * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 + * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present + * to route shared context data appropriately. + * + * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data + * types they support in an FDC3 [App + * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery + * and routing. + * + * Standardized FDC3 context types have well-known `type` properties prefixed with the + * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and + * used by a particular organization, the convention is to prefix them with an + * organization-specific namespace, e.g. `blackrock.fund`. + * + * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more + * information about context data types. + */ + type: string; + [property: string]: any; +} + +/** + * A country entity. + * + * Notes: + * + * - It is valid to include extra properties and metadata as part of the country payload, + * but the minimum requirement is for at least one standardized identifier to be provided + * + * - `COUNTRY_ISOALPHA2` SHOULD be preferred. + * + * - Try to only use country identifiers as intended and specified in the [ISO + * standard](https://en.wikipedia.org/wiki/ISO_3166-1). E.g. the `COUNTRY_ISOALPHA2` + * property must be a recognized value and not a proprietary two-letter code. If the + * identifier you want to share is not a standardized and recognized one, rather define a + * property that makes it clear what value it is. This makes it easier for target + * applications. + */ +export interface Country { + id: CountryID; + type: "fdc3.country"; + name?: string; + [property: string]: any; +} + +export interface CountryID { + /** + * Two-letter ISO country code + */ + COUNTRY_ISOALPHA2?: string; + /** + * Three-letter ISO country code + */ + COUNTRY_ISOALPHA3?: string; + /** + * Two-letter ISO country code. Deprecated in FDC3 2.0 in favour of the version prefixed + * with `COUNTRY_`. + */ + ISOALPHA2?: string; + /** + * Three-letter ISO country code. Deprecated in FDC3 2.0 in favour of the version prefixed + * with `COUNTRY_`. + */ + ISOALPHA3?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A context representing an individual Currency. + */ +export interface Currency { + id: CurrencyID; + /** + * The name of the currency for display purposes + */ + name?: string; + type: "fdc3.currency"; + [property: string]: any; +} + +export interface CurrencyID { + /** + * The `CURRENCY_ISOCODE` should conform to 3 character alphabetic codes defined in [ISO + * 4217](https://www.iso.org/iso-4217-currency-codes.html) + */ + CURRENCY_ISOCODE?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A collection of information to be used to initiate an email with a Contact or ContactList. + */ +export interface Email { + /** + * One or more recipients for the email. + */ + recipients: EmailRecipients; + /** + * Subject line for the email. + */ + subject?: string; + /** + * Body content for the email. + */ + textBody?: string; + type: "fdc3.email"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * One or more recipients for the email. + * + * The contact that initiated the interaction + * + * A person contact that can be engaged with through email, calling, messaging, CMS, etc. + * + * Contacts to add to the chat + * + * A list of contacts involved in the interaction + * + * A collection of contacts, e.g. for chatting to or calling multiple contacts. + * + * The contact list schema does not explicitly include identifiers in the `id` section, as + * there is not a common standard for such identifiers. Applications can, however, populate + * this part of the contract with custom identifiers if so desired. + */ +export interface EmailRecipients { + /** + * Identifiers that relate to the Contact represented by this context + */ + id?: EmailRecipientsID; + type: EmailRecipientsType; + name?: string; + /** + * An array of contact contexts that forms the list. + */ + contacts?: ContactElement[]; + [property: string]: any; +} + +/** + * Identifiers that relate to the Contact represented by this context + */ +export interface EmailRecipientsID { + /** + * The email address for the contact + */ + email?: string; + /** + * FactSet Permanent Identifier representing the contact + */ + FDS_ID?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ +export type EmailRecipientsType = "fdc3.contact" | "fdc3.contactList"; + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A financial instrument from any asset class. + */ +export interface Instrument { + /** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + */ + id: FluffyInstrumentIdentifiers; + /** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ + market?: PurpleMarket; + type: "fdc3.instrument"; + name?: string; + [property: string]: any; +} + +/** + * Any combination of instrument identifiers can be used together to resolve ambiguity, or + * for a better match. Not all applications will use the same instrument identifiers, which + * is why FDC3 allows for multiple to be specified. In general, the more identifiers an + * application can provide, the easier it will be to achieve interoperability. + * + * It is valid to include extra properties and metadata as part of the instrument payload, + * but the minimum requirement is for at least one instrument identifier to be provided. + * + * Try to only use instrument identifiers as intended. E.g. the `ticker` property is meant + * for tickers as used by an exchange. + * If the identifier you want to share is not a ticker or one of the other standardized + * fields, define a property that makes it clear what the value represents. Doing so will + * make interpretation easier for the developers of target applications. + */ +export interface FluffyInstrumentIdentifiers { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.cusip.com/ + */ + CUSIP?: string; + /** + * https://www.factset.com/ + */ + FDS_ID?: string; + /** + * https://www.openfigi.com/ + */ + FIGI?: string; + /** + * https://www.isin.org/ + */ + ISIN?: string; + /** + * https://permid.org/ + */ + PERMID?: string; + /** + * https://www.refinitiv.com/ + */ + RIC?: string; + /** + * https://www.lseg.com/sedol + */ + SEDOL?: string; + /** + * Unstandardized stock tickers + */ + ticker?: string; + [property: string]: any; +} + +/** + * The `market` map can be used to further specify the instrument and help achieve + * interoperability between disparate data sources. This is especially useful when using an + * `id` field that is not globally unique. + */ +export interface PurpleMarket { + /** + * https://www.bloomberg.com/ + */ + BBG?: string; + /** + * https://www.iso.org/iso-3166-country-codes.html + */ + COUNTRY_ISOALPHA2?: string; + /** + * https://en.wikipedia.org/wiki/Market_Identifier_Code + */ + MIC?: string; + /** + * Human readable market name + */ + name?: string; + [property: string]: any; +} + +/** + * A collection of instruments. Use this type for use cases that require not just a single + * instrument, but multiple (e.g. to populate a watchlist). However, when holding + * information for each instrument is required, it is recommended to use the + * [Portfolio](Portfolio) type. + * + * The instrument list schema does not explicitly include identifiers in the `id` section, + * as there is not a common standard for such identifiers. Applications can, however, + * populate this part of the contract with custom identifiers if so desired. + */ +export interface InstrumentList { + /** + * An array of instrument contexts that forms the list. + */ + instruments: InstrumentElement[]; + type: "fdc3.instrumentList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * An `Interaction` is a significant direct exchange of ideas or information between a + * number of participants, e.g. a Sell Side party and one or more Buy Side parties. An + * `Interaction` might be a call, a meeting (physical or virtual), an IM or the preparation + * of some specialist data, such as financial data for a given company or sector. + */ +export interface Interaction { + /** + * A human-readable description of the interaction + */ + description: string; + /** + * Can be used by a target application to pass an identifier back to the originating + * application after an interaction record has been created, updated or deleted. An + * interaction ID does not need to be populated by the originating application, however the + * target application could store it for future reference and SHOULD return it in a + * `TransactionResult`. + */ + id?: InteractionID; + /** + * The contact that initiated the interaction + */ + initiator?: ContactElement; + /** + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + interactionType: string; + /** + * Used to represent the application or service that the interaction was created from to aid + * in tracing the source of an interaction. + */ + origin?: string; + /** + * A list of contacts involved in the interaction + */ + participants: ContactListObject; + /** + * The time range over which the interaction occurred + */ + timeRange: TimeRangeObject; + type: "fdc3.interaction"; + name?: string; + [property: string]: any; +} + +/** + * Can be used by a target application to pass an identifier back to the originating + * application after an interaction record has been created, updated or deleted. An + * interaction ID does not need to be populated by the originating application, however the + * target application could store it for future reference and SHOULD return it in a + * `TransactionResult`. + */ +export interface InteractionID { + /** + * Interactions ID in Salesforce + */ + SALESFORCE?: string; + /** + * Interaction ID in SingleTrack + */ + SINGLETRACK?: string; + /** + * Can be used by a target application to pass a record's link back to the originating + * application. This offers the originating application a way to open the record for a user + * to view. + */ + URI?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A chat message to be sent through an instant messaging application. Can contain one or + * several text bodies (organized by mime-type, plaintext or markdown), as well as attached + * entities (either arbitrary file attachments or FDC3 actions to be embedded in the + * message). To be put inside a ChatInitSettings object. + */ +export interface Message { + /** + * A map of string IDs to entities that should be attached to the message, such as an action + * to perform, a file attachment, or other FDC3 context object. + */ + entities?: { [key: string]: FluffyAction }; + /** + * A map of string mime-type to string content + */ + text?: FluffyMessageText; + type: "fdc3.message"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * 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. + * + * A File attachment encoded in the form of a data URI + */ +export interface FluffyAction { + /** + * An optional target application identifier that should perform the action + */ + app?: AppIdentifier; + /** + * A context object with which the action will be performed + */ + context?: ContextElement; + /** + * 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. + */ + intent?: string; + /** + * A human readable display name for the action + */ + title?: string; + type: EntityType; + id?: { [key: string]: any }; + name?: string; + data?: FluffyData; + [property: string]: any; +} + +export interface FluffyData { + /** + * A data URI encoding the content of the file to be attached + */ + dataUri: string; + /** + * The name of the attached file + */ + name: string; + [property: string]: any; +} + +/** + * A map of string mime-type to string content + */ +export interface FluffyMessageText { + /** + * Markdown encoded content + */ + "text/markdown"?: string; + /** + * Plain text encoded content. + */ + "text/plain"?: string; + [property: string]: any; +} + +/** + * A type that explicitly represents a lack of context. + * + * Notes: + * + * - Intended to be used in situations where no context is desired. + * - For example: + * - Raising an intent without context (e.g. opening a blank order form, or chat interface + * without a contact selected). + * - Resetting context on a channel (e.g. when context is used to set a filter in other + * applications a null context might release the filter). + * - An explicit representation of a Null or empty context allows apps to declare support + * for a lack of context, for example in their intent metadata in an app directory. + */ +export interface Nothing { + type: "fdc3.nothing"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * @experimental context type representing an order. To be used with OMS and EMS systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the order in one or more systems, an optional human readable `name` field to be used + * to summarize the order and an optional `details` field that may be used to provide + * additional detail about the order, including a context representing a `product`, which + * may be extended with arbitrary properties. The `details.product` field is currently typed + * as a unspecified Context type, but both `details` and `details.product` are expected to + * be standardized in future. + */ +export interface Order { + /** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ + details?: PurpleOrderDetails; + /** + * One or more identifiers that refer to the order in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * An optional human-readable summary of the order. + */ + name?: string; + type: "fdc3.order"; + [property: string]: any; +} + +/** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ +export interface PurpleOrderDetails { + product?: ProductObject; + [property: string]: any; +} + +/** + * A product that is the subject of the trade. + * + * @experimental context type representing a tradable product. To be used with OMS and EMS + * systems. + * + * This type is currently only loosely defined as an extensible context object, with an + * optional instrument field. + * + * The Product schema does not explicitly include identifiers in the id section, as there is + * not a common standard for such identifiers. Applications can, however, populate this part + * of the contract with custom identifiers if so desired. + */ +export interface ProductObject { + /** + * One or more identifiers that refer to the product. Specific key names for systems are + * expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * financial instrument that relates to the definition of this product + */ + instrument?: InstrumentElement; + /** + * A human-readable summary of the product. + */ + name?: string; + type: "fdc3.product"; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * @experimental A list of orders. Use this type for use cases that require not just a + * single order, but multiple. + * + * The OrderList schema does not explicitly include identifiers in the id section, as there + * is not a common standard for such identifiers. Applications can, however, populate this + * part of the contract with custom identifiers if so desired. + */ +export interface OrderList { + /** + * An array of order contexts that forms the list. + */ + orders: OrderElement[]; + type: "fdc3.orderList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing an order. To be used with OMS and EMS systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the order in one or more systems, an optional human readable `name` field to be used + * to summarize the order and an optional `details` field that may be used to provide + * additional detail about the order, including a context representing a `product`, which + * may be extended with arbitrary properties. The `details.product` field is currently typed + * as a unspecified Context type, but both `details` and `details.product` are expected to + * be standardized in future. + */ +export interface OrderElement { + /** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ + details?: FluffyOrderDetails; + /** + * One or more identifiers that refer to the order in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * An optional human-readable summary of the order. + */ + name?: string; + type: "fdc3.order"; + [property: string]: any; +} + +/** + * Optional additional details about the order, which may include a product element that is + * an, as yet undefined but extensible, Context + */ +export interface FluffyOrderDetails { + product?: ProductObject; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * An entity that can be used when referencing private companies and other organizations + * where a specific instrument is not available or desired e.g. CRM and News workflows. + * + * It is valid to include extra properties and metadata as part of the organization payload, + * but the minimum requirement is for at least one specified identifier to be provided. + */ +export interface Organization { + /** + * Identifiers for the organization, at least one must be provided. + */ + id: OrganizationIdentifiers; + type: "fdc3.organization"; + name?: string; + [property: string]: any; +} + +/** + * Identifiers for the organization, at least one must be provided. + */ +export interface OrganizationIdentifiers { + /** + * FactSet Permanent Identifier representing the organization + */ + FDS_ID?: string; + /** + * The Legal Entity Identifier (LEI) is a 20-character, alpha-numeric code based on the ISO + * 17442 standard developed by the International Organization for Standardization (ISO). It + * connects to key reference information that enables clear and unique identification of + * legal entities participating in financial transactions. + */ + LEI?: string; + /** + * Refinitiv Permanent Identifiers, or PermID for the organization + */ + PERMID?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A financial portfolio made up of multiple positions (holdings) in several instruments. + * Contrast this with e.g. the [InstrumentList](InstrumentList) type, which is just a list + * of instruments. + * + * This is a good example of how types can be composed and extended with extra properties to + * define more complex types. + * + * The Portfolio type consists of an array of [Position](Position) types, each of which + * refers to a single [Instrument](Instrument) and a holding amount for that instrument. + * + * The portfolio schema does not explicitly include identifiers in the `id` section, as + * there bis not a common standard for such identifiers. Applications can, however, populate + * this part of the contract with custom identifiers if so desired. + */ +export interface Portfolio { + /** + * The List of Positions which make up the Portfolio + */ + positions: PositionElement[]; + type: "fdc3.portfolio"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * A financial position made up of an instrument and a holding in that instrument. This type + * is a good example of how new context types can be composed from existing types. + * + * In this case, the instrument and the holding amount for that instrument are required + * values. + * + * The [Position](Position) type goes hand-in-hand with the [Portfolio](Portfolio) type, + * which represents multiple holdings in a combination of instruments. + * + * The position schema does not explicitly include identifiers in the `id` section, as there + * is not a common standard for such identifiers. Applications can, however, populate this + * part of the contract with custom identifiers if so desired. + */ +export interface PositionElement { + /** + * The amount of the holding, e.g. a number of shares + */ + holding: number; + instrument: InstrumentElement; + type: "fdc3.position"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A financial position made up of an instrument and a holding in that instrument. This type + * is a good example of how new context types can be composed from existing types. + * + * In this case, the instrument and the holding amount for that instrument are required + * values. + * + * The [Position](Position) type goes hand-in-hand with the [Portfolio](Portfolio) type, + * which represents multiple holdings in a combination of instruments. + * + * The position schema does not explicitly include identifiers in the `id` section, as there + * is not a common standard for such identifiers. Applications can, however, populate this + * part of the contract with custom identifiers if so desired. + */ +export interface Position { + /** + * The amount of the holding, e.g. a number of shares + */ + holding: number; + instrument: InstrumentElement; + type: "fdc3.position"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing a tradable product. To be used with OMS and EMS + * systems. + * + * This type is currently only loosely defined as an extensible context object, with an + * optional instrument field. + * + * The Product schema does not explicitly include identifiers in the id section, as there is + * not a common standard for such identifiers. Applications can, however, populate this part + * of the contract with custom identifiers if so desired. + */ +export interface Product { + /** + * One or more identifiers that refer to the product. Specific key names for systems are + * expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * financial instrument that relates to the definition of this product + */ + instrument?: InstrumentElement; + /** + * A human-readable summary of the product. + */ + name?: string; + type: "fdc3.product"; + [property: string]: any; +} + +/** + * A context representing a period of time. Any user interfaces that represent or visualize + * events or activity over time can be filtered or focused on a particular time period, + * e.g.: + * + * - A pricing chart + * - A trade blotter + * - A record of client contact/activity in a CRM + * + * Example use cases: + * + * - User may want to view pricing/trades/customer activity for a security over a particular + * time period, the time range might be specified as the context for the `ViewChart` intent + * OR it might be embedded in another context (e.g. a context representing a chart to plot). + * - User filters a visualization (e.g. a pricing chart) to show a particular period, the + * `TimeRange` is broadcast and other visualizations (e.g. a heatmap of activity by + * instrument, or industry sector etc.) receive it and filter themselves to show data over + * the same range. + * + * Notes: + * + * - A `TimeRange` may be closed (i.e. `startTime` and `endTime` are both known) or open + * (i.e. only one of `startTime` or `endTime` is known). + * - Ranges corresponding to dates (e.g. `2022-05-12` to `2022-05-19`) should be specified + * using times as this prevents issues with timezone conversions and inclusive/exclusive + * date ranges. + * - String fields representing times are encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html). + * - A timezone indicator should be specified, e.g. `"2022-05-12T15:18:03Z"` or + * `"2022-05-12T16:18:03+01:00"` + * - Times MAY be specified with millisecond precision, e.g. `"2022-05-12T15:18:03.349Z"` + */ +export interface TimeRange { + /** + * The end time of the range, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. + */ + endTime?: Date; + /** + * The start time of the range, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator. + */ + startTime?: Date; + type: "fdc3.timeRange"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing a trade. To be used with execution systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the trade in one or more systems, an optional human readable `name` field to be used + * to summarize the trade and a required `product` field that may be used to provide + * additional detail about the trade, which is currently typed as a unspecified Context + * type, but `product` is expected to be standardized in future. + * + * The Trade schema does not explicitly include identifiers in the id section, as there is + * not a common standard for such identifiers. Applications can, however, populate this part + * of the contract with custom identifiers if so desired. + */ +export interface Trade { + /** + * One or more identifiers that refer to the trade in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * A human-readable summary of the trade. + */ + name?: string; + /** + * A product that is the subject of the trade. + */ + product: ProductObject; + type: "fdc3.trade"; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * @experimental A list of trades. Use this type for use cases that require not just a + * single trade, but multiple. + * + * The TradeList schema does not explicitly include identifiers in the id section, as there + * is not a common standard for such identifiers. Applications can, however, populate this + * part of the contract with custom identifiers if so desired. + */ +export interface TradeList { + /** + * An array of trade contexts that forms the list. + */ + trades: TradeElement[]; + type: "fdc3.tradeList"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * @experimental context type representing a trade. To be used with execution systems. + * + * This type currently only defines a required `id` field, which should provide a reference + * to the trade in one or more systems, an optional human readable `name` field to be used + * to summarize the trade and a required `product` field that may be used to provide + * additional detail about the trade, which is currently typed as a unspecified Context + * type, but `product` is expected to be standardized in future. + * + * The Trade schema does not explicitly include identifiers in the id section, as there is + * not a common standard for such identifiers. Applications can, however, populate this part + * of the contract with custom identifiers if so desired. + */ +export interface TradeElement { + /** + * One or more identifiers that refer to the trade in an OMS, EMS or related system. + * Specific key names for systems are expected to be standardized in future. + */ + id: { [key: string]: string }; + /** + * A human-readable summary of the trade. + */ + name?: string; + /** + * A product that is the subject of the trade. + */ + product: ProductObject; + type: "fdc3.trade"; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A context type representing the result of a transaction initiated via FDC3, which SHOULD + * be returned as an `IntentResult` by intents that create, retrieve, update or delete + * content or records in another application. Its purpose is to provide a status and message + * (where needed) for the transaction and MAY wrap a returned context object. + */ +export interface TransactionResult { + /** + * A context object returned by the transaction, possibly with updated data. + */ + context?: ContextElement; + /** + * A human readable message describing the outcome of the transaction. + */ + message?: string; + /** + * The status of the transaction being reported. + */ + status: TransactionStatus; + type: "fdc3.transactionResult"; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * The status of the transaction being reported. + */ +export type TransactionStatus = "Created" | "Deleted" | "Updated" | "Failed"; + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +/** + * A context type representing the price and value of a holding. + */ +export interface Valuation { + /** + * The valuation currency, which should conform to 3 character alphabetic codes defined in + * [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) + */ + CURRENCY_ISOCODE: string; + /** + * The time at which this valuation expires, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator included. + */ + expiryTime?: Date; + /** + * The price per unit the the valuation is based on. + */ + price?: number; + type: "fdc3.valuation"; + /** + * The time at which the valuation was performed, encoded according to [ISO + * 8601-1:2019](https://www.iso.org/standard/70907.html) with a timezone indicator included. + */ + valuationTime?: Date; + /** + * The value of the holding, expresses in the nominated currency. + */ + value: number; + id?: { [key: string]: any }; + name?: string; + [property: string]: any; +} + +/** + * Free text to be used for a keyword search + * + * `interactionType` SHOULD be one of `'Instant Message'`, `'Email'`, `'Call'`, or + * `'Meeting'` although other string values are permitted. + */ + +// Converts JSON strings to/from your types +// and asserts the results of JSON.parse at runtime +export class Convert { + public static toAction(json: string): Action { + return cast(JSON.parse(json), r("Action")); + } + + public static actionToJson(value: Action): string { + return JSON.stringify(uncast(value, r("Action")), null, 2); + } + + public static toChart(json: string): Chart { + return cast(JSON.parse(json), r("Chart")); + } + + public static chartToJson(value: Chart): string { + return JSON.stringify(uncast(value, r("Chart")), null, 2); + } + + public static toChatInitSettings(json: string): ChatInitSettings { + return cast(JSON.parse(json), r("ChatInitSettings")); + } + + public static chatInitSettingsToJson(value: ChatInitSettings): string { + return JSON.stringify(uncast(value, r("ChatInitSettings")), null, 2); + } + + public static toChatMessage(json: string): ChatMessage { + return cast(JSON.parse(json), r("ChatMessage")); + } + + public static chatMessageToJson(value: ChatMessage): string { + return JSON.stringify(uncast(value, r("ChatMessage")), null, 2); + } + + public static toChatRoom(json: string): ChatRoom { + return cast(JSON.parse(json), r("ChatRoom")); + } + + public static chatRoomToJson(value: ChatRoom): string { + return JSON.stringify(uncast(value, r("ChatRoom")), null, 2); + } + + public static toChatSearchCriteria(json: string): ChatSearchCriteria { + return cast(JSON.parse(json), r("ChatSearchCriteria")); + } + + public static chatSearchCriteriaToJson(value: ChatSearchCriteria): string { + return JSON.stringify(uncast(value, r("ChatSearchCriteria")), null, 2); + } + + public static toContact(json: string): Contact { + return cast(JSON.parse(json), r("Contact")); + } + + public static contactToJson(value: Contact): string { + return JSON.stringify(uncast(value, r("Contact")), null, 2); + } + + public static toContactList(json: string): ContactList { + return cast(JSON.parse(json), r("ContactList")); + } + + public static contactListToJson(value: ContactList): string { + return JSON.stringify(uncast(value, r("ContactList")), null, 2); + } + + public static toContext(json: string): Context { + return cast(JSON.parse(json), r("Context")); + } + + public static contextToJson(value: Context): string { + return JSON.stringify(uncast(value, r("Context")), null, 2); + } + + public static toCountry(json: string): Country { + return cast(JSON.parse(json), r("Country")); + } + + public static countryToJson(value: Country): string { + return JSON.stringify(uncast(value, r("Country")), null, 2); + } + + public static toCurrency(json: string): Currency { + return cast(JSON.parse(json), r("Currency")); + } + + public static currencyToJson(value: Currency): string { + return JSON.stringify(uncast(value, r("Currency")), null, 2); + } + + public static toEmail(json: string): Email { + return cast(JSON.parse(json), r("Email")); + } + + public static emailToJson(value: Email): string { + return JSON.stringify(uncast(value, r("Email")), null, 2); + } + + public static toInstrument(json: string): Instrument { + return cast(JSON.parse(json), r("Instrument")); + } + + public static instrumentToJson(value: Instrument): string { + return JSON.stringify(uncast(value, r("Instrument")), null, 2); + } + + public static toInstrumentList(json: string): InstrumentList { + return cast(JSON.parse(json), r("InstrumentList")); + } + + public static instrumentListToJson(value: InstrumentList): string { + return JSON.stringify(uncast(value, r("InstrumentList")), null, 2); + } + + public static toInteraction(json: string): Interaction { + return cast(JSON.parse(json), r("Interaction")); + } + + public static interactionToJson(value: Interaction): string { + return JSON.stringify(uncast(value, r("Interaction")), null, 2); + } + + public static toMessage(json: string): Message { + return cast(JSON.parse(json), r("Message")); + } + + public static messageToJson(value: Message): string { + return JSON.stringify(uncast(value, r("Message")), null, 2); + } + + public static toNothing(json: string): Nothing { + return cast(JSON.parse(json), r("Nothing")); + } + + public static nothingToJson(value: Nothing): string { + return JSON.stringify(uncast(value, r("Nothing")), null, 2); + } + + public static toOrder(json: string): Order { + return cast(JSON.parse(json), r("Order")); + } + + public static orderToJson(value: Order): string { + return JSON.stringify(uncast(value, r("Order")), null, 2); + } + + public static toOrderList(json: string): OrderList { + return cast(JSON.parse(json), r("OrderList")); + } + + public static orderListToJson(value: OrderList): string { + return JSON.stringify(uncast(value, r("OrderList")), null, 2); + } + + public static toOrganization(json: string): Organization { + return cast(JSON.parse(json), r("Organization")); + } + + public static organizationToJson(value: Organization): string { + return JSON.stringify(uncast(value, r("Organization")), null, 2); + } + + public static toPortfolio(json: string): Portfolio { + return cast(JSON.parse(json), r("Portfolio")); + } + + public static portfolioToJson(value: Portfolio): string { + return JSON.stringify(uncast(value, r("Portfolio")), null, 2); + } + + public static toPosition(json: string): Position { + return cast(JSON.parse(json), r("Position")); + } + + public static positionToJson(value: Position): string { + return JSON.stringify(uncast(value, r("Position")), null, 2); + } + + public static toProduct(json: string): Product { + return cast(JSON.parse(json), r("Product")); + } + + public static productToJson(value: Product): string { + return JSON.stringify(uncast(value, r("Product")), null, 2); + } + + public static toTimeRange(json: string): TimeRange { + return cast(JSON.parse(json), r("TimeRange")); + } + + public static timeRangeToJson(value: TimeRange): string { + return JSON.stringify(uncast(value, r("TimeRange")), null, 2); + } + + public static toTrade(json: string): Trade { + return cast(JSON.parse(json), r("Trade")); + } + + public static tradeToJson(value: Trade): string { + return JSON.stringify(uncast(value, r("Trade")), null, 2); + } + + public static toTradeList(json: string): TradeList { + return cast(JSON.parse(json), r("TradeList")); + } + + public static tradeListToJson(value: TradeList): string { + return JSON.stringify(uncast(value, r("TradeList")), null, 2); + } + + public static toTransactionResult(json: string): TransactionResult { + return cast(JSON.parse(json), r("TransactionResult")); + } + + public static transactionResultToJson(value: TransactionResult): string { + return JSON.stringify(uncast(value, r("TransactionResult")), null, 2); + } + + public static toValuation(json: string): Valuation { + return cast(JSON.parse(json), r("Valuation")); + } + + public static valuationToJson(value: Valuation): string { + return JSON.stringify(uncast(value, r("Valuation")), null, 2); + } +} + +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { + const prettyTyp = prettyTypeName(typ); + const parentText = parent ? ` on ${parent}` : ''; + const keyText = key ? ` for key "${key}"` : ''; + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); +} + +function prettyTypeName(typ: any): string { + if (Array.isArray(typ)) { + if (typ.length === 2 && typ[0] === undefined) { + return `an optional ${prettyTypeName(typ[1])}`; + } else { + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; + } + } else if (typeof typ === "object" && typ.literal !== undefined) { + return typ.literal; + } else { + return typeof typ; + } +} + +function jsonToJSProps(typ: any): any { + if (typ.jsonToJS === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); + typ.jsonToJS = map; + } + return typ.jsonToJS; +} + +function jsToJSONProps(typ: any): any { + if (typ.jsToJSON === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); + typ.jsToJSON = map; + } + return typ.jsToJSON; +} + +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { + function transformPrimitive(typ: string, val: any): any { + if (typeof typ === typeof val) return val; + return invalidValue(typ, val, key, parent); + } + + function transformUnion(typs: any[], val: any): any { + // val must validate against one typ in typs + const l = typs.length; + for (let i = 0; i < l; i++) { + const typ = typs[i]; + try { + return transform(val, typ, getProps); + } catch (_) {} + } + return invalidValue(typs, val, key, parent); + } + + function transformEnum(cases: string[], val: any): any { + if (cases.indexOf(val) !== -1) return val; + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); + } + + function transformArray(typ: any, val: any): any { + // val must be an array with no invalid elements + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); + return val.map(el => transform(el, typ, getProps)); + } + + function transformDate(val: any): any { + if (val === null) { + return null; + } + const d = new Date(val); + if (isNaN(d.valueOf())) { + return invalidValue(l("Date"), val, key, parent); + } + return d; + } + + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { + if (val === null || typeof val !== "object" || Array.isArray(val)) { + return invalidValue(l(ref || "object"), val, key, parent); + } + const result: any = {}; + Object.getOwnPropertyNames(props).forEach(key => { + const prop = props[key]; + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; + result[prop.key] = transform(v, prop.typ, getProps, key, ref); + }); + Object.getOwnPropertyNames(val).forEach(key => { + if (!Object.prototype.hasOwnProperty.call(props, key)) { + result[key] = transform(val[key], additional, getProps, key, ref); + } + }); + return result; + } + + if (typ === "any") return val; + if (typ === null) { + if (val === null) return val; + return invalidValue(typ, val, key, parent); + } + if (typ === false) return invalidValue(typ, val, key, parent); + let ref: any = undefined; + while (typeof typ === "object" && typ.ref !== undefined) { + ref = typ.ref; + typ = typeMap[typ.ref]; + } + if (Array.isArray(typ)) return transformEnum(typ, val); + if (typeof typ === "object") { + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) + : invalidValue(typ, val, key, parent); + } + // Numbers can be parsed by Date but shouldn't be. + if (typ === Date && typeof val !== "number") return transformDate(val); + return transformPrimitive(typ, val); +} + +function cast(val: any, typ: any): T { + return transform(val, typ, jsonToJSProps); +} + +function uncast(val: T, typ: any): any { + return transform(val, typ, jsToJSONProps); +} + +function l(typ: any) { + return { literal: typ }; +} + +function a(typ: any) { + return { arrayItems: typ }; +} + +function u(...typs: any[]) { + return { unionMembers: typs }; +} + +function o(props: any[], additional: any) { + return { props, additional }; +} + +function m(additional: any) { + return { props: [], additional }; +} + +function r(name: string) { + return { ref: name }; +} + +const typeMap: any = { + "Action": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: r("ContextElement") }, + { json: "intent", js: "intent", typ: u(undefined, "") }, + { json: "title", js: "title", typ: "" }, + { json: "type", js: "type", typ: r("ActionType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "AppIdentifier": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "ContextElement": o([ + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: "" }, + ], "any"), + "Chart": o([ + { json: "instruments", js: "instruments", typ: a(r("InstrumentElement")) }, + { json: "otherConfig", js: "otherConfig", typ: u(undefined, a(r("ContextElement"))) }, + { json: "range", js: "range", typ: u(undefined, r("TimeRangeObject")) }, + { json: "style", js: "style", typ: u(undefined, r("ChartStyle")) }, + { json: "type", js: "type", typ: r("ChartType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "InstrumentElement": o([ + { json: "id", js: "id", typ: r("PurpleInstrumentIdentifiers") }, + { json: "market", js: "market", typ: u(undefined, r("OrganizationMarket")) }, + { json: "type", js: "type", typ: r("PurpleInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "PurpleInstrumentIdentifiers": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, + { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, + { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, + { json: "RIC", js: "RIC", typ: u(undefined, "") }, + { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, + { json: "ticker", js: "ticker", typ: u(undefined, "") }, + ], "any"), + "OrganizationMarket": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, + { json: "MIC", js: "MIC", typ: u(undefined, "") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "TimeRangeObject": o([ + { json: "endTime", js: "endTime", typ: u(undefined, Date) }, + { json: "startTime", js: "startTime", typ: u(undefined, Date) }, + { json: "type", js: "type", typ: r("TimeRangeType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ChatInitSettings": o([ + { json: "chatName", js: "chatName", typ: u(undefined, "") }, + { json: "members", js: "members", typ: u(undefined, r("ContactListObject")) }, + { json: "message", js: "message", typ: u(undefined, u(r("MessageObject"), "")) }, + { json: "options", js: "options", typ: u(undefined, r("ChatOptions")) }, + { json: "type", js: "type", typ: r("ChatInitSettingsType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ContactListObject": o([ + { json: "contacts", js: "contacts", typ: a(r("ContactElement")) }, + { json: "type", js: "type", typ: r("ContactListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ContactElement": o([ + { json: "id", js: "id", typ: r("PurpleContactIdentifiers") }, + { json: "type", js: "type", typ: r("FluffyInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "PurpleContactIdentifiers": o([ + { json: "email", js: "email", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + ], "any"), + "MessageObject": o([ + { json: "entities", js: "entities", typ: u(undefined, m(r("PurpleAction"))) }, + { json: "text", js: "text", typ: u(undefined, r("PurpleMessageText")) }, + { json: "type", js: "type", typ: r("MessageType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "PurpleAction": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, + { json: "intent", js: "intent", typ: u(undefined, "") }, + { json: "title", js: "title", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("EntityType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "data", js: "data", typ: u(undefined, r("PurpleData")) }, + ], "any"), + "PurpleData": o([ + { json: "dataUri", js: "dataUri", typ: "" }, + { json: "name", js: "name", typ: "" }, + ], "any"), + "PurpleMessageText": o([ + { json: "text/markdown", js: "text/markdown", typ: u(undefined, "") }, + { json: "text/plain", js: "text/plain", typ: u(undefined, "") }, + ], "any"), + "ChatOptions": o([ + { json: "allowAddUser", js: "allowAddUser", typ: u(undefined, true) }, + { json: "allowHistoryBrowsing", js: "allowHistoryBrowsing", typ: u(undefined, true) }, + { json: "allowMessageCopy", js: "allowMessageCopy", typ: u(undefined, true) }, + { json: "groupRecipients", js: "groupRecipients", typ: u(undefined, true) }, + { json: "isPublic", js: "isPublic", typ: u(undefined, true) }, + ], "any"), + "ChatMessage": o([ + { json: "chatRoom", js: "chatRoom", typ: r("ChatRoomObject") }, + { json: "message", js: "message", typ: r("MessageObject") }, + { json: "type", js: "type", typ: r("ChatMessageType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ChatRoomObject": o([ + { json: "id", js: "id", typ: m("any") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "providerName", js: "providerName", typ: "" }, + { json: "type", js: "type", typ: r("ChatRoomType") }, + { json: "url", js: "url", typ: u(undefined, "") }, + ], "any"), + "ChatRoom": o([ + { json: "id", js: "id", typ: m("any") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "providerName", js: "providerName", typ: "" }, + { json: "type", js: "type", typ: r("ChatRoomType") }, + { json: "url", js: "url", typ: u(undefined, "") }, + ], "any"), + "ChatSearchCriteria": o([ + { json: "criteria", js: "criteria", typ: a(u(r("OrganizationObject"), "")) }, + { json: "type", js: "type", typ: r("ChatSearchCriteriaType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "OrganizationObject": o([ + { json: "id", js: "id", typ: r("Identifiers") }, + { json: "market", js: "market", typ: u(undefined, r("OrganizationMarket")) }, + { json: "type", js: "type", typ: r("TentacledInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Identifiers": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, + { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, + { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, + { json: "RIC", js: "RIC", typ: u(undefined, "") }, + { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, + { json: "ticker", js: "ticker", typ: u(undefined, "") }, + { json: "LEI", js: "LEI", typ: u(undefined, "") }, + { json: "email", js: "email", typ: u(undefined, "") }, + ], "any"), + "Contact": o([ + { json: "id", js: "id", typ: r("FluffyContactIdentifiers") }, + { json: "type", js: "type", typ: r("FluffyInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "FluffyContactIdentifiers": o([ + { json: "email", js: "email", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + ], "any"), + "ContactList": o([ + { json: "contacts", js: "contacts", typ: a(r("ContactElement")) }, + { json: "type", js: "type", typ: r("ContactListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Context": o([ + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: "" }, + ], "any"), + "Country": o([ + { json: "id", js: "id", typ: r("CountryID") }, + { json: "type", js: "type", typ: r("CountryType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "CountryID": o([ + { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, + { json: "COUNTRY_ISOALPHA3", js: "COUNTRY_ISOALPHA3", typ: u(undefined, "") }, + { json: "ISOALPHA2", js: "ISOALPHA2", typ: u(undefined, "") }, + { json: "ISOALPHA3", js: "ISOALPHA3", typ: u(undefined, "") }, + ], "any"), + "Currency": o([ + { json: "id", js: "id", typ: r("CurrencyID") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("CurrencyType") }, + ], "any"), + "CurrencyID": o([ + { json: "CURRENCY_ISOCODE", js: "CURRENCY_ISOCODE", typ: u(undefined, "") }, + ], "any"), + "Email": o([ + { json: "recipients", js: "recipients", typ: r("EmailRecipients") }, + { json: "subject", js: "subject", typ: u(undefined, "") }, + { json: "textBody", js: "textBody", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("EmailType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "EmailRecipients": o([ + { json: "id", js: "id", typ: u(undefined, r("EmailRecipientsID")) }, + { json: "type", js: "type", typ: r("EmailRecipientsType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "contacts", js: "contacts", typ: u(undefined, a(r("ContactElement"))) }, + ], "any"), + "EmailRecipientsID": o([ + { json: "email", js: "email", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + ], "any"), + "Instrument": o([ + { json: "id", js: "id", typ: r("FluffyInstrumentIdentifiers") }, + { json: "market", js: "market", typ: u(undefined, r("PurpleMarket")) }, + { json: "type", js: "type", typ: r("PurpleInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "FluffyInstrumentIdentifiers": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "CUSIP", js: "CUSIP", typ: u(undefined, "") }, + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + { json: "FIGI", js: "FIGI", typ: u(undefined, "") }, + { json: "ISIN", js: "ISIN", typ: u(undefined, "") }, + { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, + { json: "RIC", js: "RIC", typ: u(undefined, "") }, + { json: "SEDOL", js: "SEDOL", typ: u(undefined, "") }, + { json: "ticker", js: "ticker", typ: u(undefined, "") }, + ], "any"), + "PurpleMarket": o([ + { json: "BBG", js: "BBG", typ: u(undefined, "") }, + { json: "COUNTRY_ISOALPHA2", js: "COUNTRY_ISOALPHA2", typ: u(undefined, "") }, + { json: "MIC", js: "MIC", typ: u(undefined, "") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "InstrumentList": o([ + { json: "instruments", js: "instruments", typ: a(r("InstrumentElement")) }, + { json: "type", js: "type", typ: r("InstrumentListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Interaction": o([ + { json: "description", js: "description", typ: "" }, + { json: "id", js: "id", typ: u(undefined, r("InteractionID")) }, + { json: "initiator", js: "initiator", typ: u(undefined, r("ContactElement")) }, + { json: "interactionType", js: "interactionType", typ: "" }, + { json: "origin", js: "origin", typ: u(undefined, "") }, + { json: "participants", js: "participants", typ: r("ContactListObject") }, + { json: "timeRange", js: "timeRange", typ: r("TimeRangeObject") }, + { json: "type", js: "type", typ: r("InteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "InteractionID": o([ + { json: "SALESFORCE", js: "SALESFORCE", typ: u(undefined, "") }, + { json: "SINGLETRACK", js: "SINGLETRACK", typ: u(undefined, "") }, + { json: "URI", js: "URI", typ: u(undefined, "") }, + ], "any"), + "Message": o([ + { json: "entities", js: "entities", typ: u(undefined, m(r("FluffyAction"))) }, + { json: "text", js: "text", typ: u(undefined, r("FluffyMessageText")) }, + { json: "type", js: "type", typ: r("MessageType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "FluffyAction": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, + { json: "intent", js: "intent", typ: u(undefined, "") }, + { json: "title", js: "title", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("EntityType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "data", js: "data", typ: u(undefined, r("FluffyData")) }, + ], "any"), + "FluffyData": o([ + { json: "dataUri", js: "dataUri", typ: "" }, + { json: "name", js: "name", typ: "" }, + ], "any"), + "FluffyMessageText": o([ + { json: "text/markdown", js: "text/markdown", typ: u(undefined, "") }, + { json: "text/plain", js: "text/plain", typ: u(undefined, "") }, + ], "any"), + "Nothing": o([ + { json: "type", js: "type", typ: r("NothingType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Order": o([ + { json: "details", js: "details", typ: u(undefined, r("PurpleOrderDetails")) }, + { json: "id", js: "id", typ: m("") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("OrderType") }, + ], "any"), + "PurpleOrderDetails": o([ + { json: "product", js: "product", typ: u(undefined, r("ProductObject")) }, + ], "any"), + "ProductObject": o([ + { json: "id", js: "id", typ: m("") }, + { json: "instrument", js: "instrument", typ: u(undefined, r("InstrumentElement")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("ProductType") }, + ], "any"), + "OrderList": o([ + { json: "orders", js: "orders", typ: a(r("OrderElement")) }, + { json: "type", js: "type", typ: r("OrderListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "OrderElement": o([ + { json: "details", js: "details", typ: u(undefined, r("FluffyOrderDetails")) }, + { json: "id", js: "id", typ: m("") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("OrderType") }, + ], "any"), + "FluffyOrderDetails": o([ + { json: "product", js: "product", typ: u(undefined, r("ProductObject")) }, + ], "any"), + "Organization": o([ + { json: "id", js: "id", typ: r("OrganizationIdentifiers") }, + { json: "type", js: "type", typ: r("StickyInteractionType") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "OrganizationIdentifiers": o([ + { json: "FDS_ID", js: "FDS_ID", typ: u(undefined, "") }, + { json: "LEI", js: "LEI", typ: u(undefined, "") }, + { json: "PERMID", js: "PERMID", typ: u(undefined, "") }, + ], "any"), + "Portfolio": o([ + { json: "positions", js: "positions", typ: a(r("PositionElement")) }, + { json: "type", js: "type", typ: r("PortfolioType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "PositionElement": o([ + { json: "holding", js: "holding", typ: 3.14 }, + { json: "instrument", js: "instrument", typ: r("InstrumentElement") }, + { json: "type", js: "type", typ: r("PositionType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Position": o([ + { json: "holding", js: "holding", typ: 3.14 }, + { json: "instrument", js: "instrument", typ: r("InstrumentElement") }, + { json: "type", js: "type", typ: r("PositionType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Product": o([ + { json: "id", js: "id", typ: m("") }, + { json: "instrument", js: "instrument", typ: u(undefined, r("InstrumentElement")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: r("ProductType") }, + ], "any"), + "TimeRange": o([ + { json: "endTime", js: "endTime", typ: u(undefined, Date) }, + { json: "startTime", js: "startTime", typ: u(undefined, Date) }, + { json: "type", js: "type", typ: r("TimeRangeType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Trade": o([ + { json: "id", js: "id", typ: m("") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "product", js: "product", typ: r("ProductObject") }, + { json: "type", js: "type", typ: r("TradeType") }, + ], "any"), + "TradeList": o([ + { json: "trades", js: "trades", typ: a(r("TradeElement")) }, + { json: "type", js: "type", typ: r("TradeListType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "TradeElement": o([ + { json: "id", js: "id", typ: m("") }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "product", js: "product", typ: r("ProductObject") }, + { json: "type", js: "type", typ: r("TradeType") }, + ], "any"), + "TransactionResult": o([ + { json: "context", js: "context", typ: u(undefined, r("ContextElement")) }, + { json: "message", js: "message", typ: u(undefined, "") }, + { json: "status", js: "status", typ: r("TransactionStatus") }, + { json: "type", js: "type", typ: r("TransactionResultType") }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "Valuation": o([ + { json: "CURRENCY_ISOCODE", js: "CURRENCY_ISOCODE", typ: "" }, + { json: "expiryTime", js: "expiryTime", typ: u(undefined, Date) }, + { json: "price", js: "price", typ: u(undefined, 3.14) }, + { json: "type", js: "type", typ: r("ValuationType") }, + { json: "valuationTime", js: "valuationTime", typ: u(undefined, Date) }, + { json: "value", js: "value", typ: 3.14 }, + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], "any"), + "ActionType": [ + "fdc3.action", + ], + "PurpleInteractionType": [ + "fdc3.instrument", + ], + "TimeRangeType": [ + "fdc3.timeRange", + ], + "ChartStyle": [ + "bar", + "candle", + "custom", + "heatmap", + "histogram", + "line", + "mountain", + "pie", + "scatter", + "stacked-bar", + ], + "ChartType": [ + "fdc3.chart", + ], + "FluffyInteractionType": [ + "fdc3.contact", + ], + "ContactListType": [ + "fdc3.contactList", + ], + "EntityType": [ + "fdc3.action", + "fdc3.entity.fileAttachment", + ], + "MessageType": [ + "fdc3.message", + ], + "ChatInitSettingsType": [ + "fdc3.chat.initSettings", + ], + "ChatRoomType": [ + "fdc3.chat.room", + ], + "ChatMessageType": [ + "fdc3.chat.message", + ], + "TentacledInteractionType": [ + "fdc3.contact", + "fdc3.instrument", + "fdc3.organization", + ], + "ChatSearchCriteriaType": [ + "fdc3.chat.searchCriteria", + ], + "CountryType": [ + "fdc3.country", + ], + "CurrencyType": [ + "fdc3.currency", + ], + "EmailRecipientsType": [ + "fdc3.contact", + "fdc3.contactList", + ], + "EmailType": [ + "fdc3.email", + ], + "InstrumentListType": [ + "fdc3.instrumentList", + ], + "InteractionType": [ + "fdc3.interaction", + ], + "NothingType": [ + "fdc3.nothing", + ], + "ProductType": [ + "fdc3.product", + ], + "OrderType": [ + "fdc3.order", + ], + "OrderListType": [ + "fdc3.orderList", + ], + "StickyInteractionType": [ + "fdc3.organization", + ], + "PositionType": [ + "fdc3.position", + ], + "PortfolioType": [ + "fdc3.portfolio", + ], + "TradeType": [ + "fdc3.trade", + ], + "TradeListType": [ + "fdc3.tradeList", + ], + "TransactionStatus": [ + "Created", + "Deleted", + "Failed", + "Updated", + ], + "TransactionResultType": [ + "fdc3.transactionResult", + ], + "ValuationType": [ + "fdc3.valuation", + ], +}; diff --git a/packages/fdc3-get-agent/package.json b/packages/fdc3-get-agent/package.json index 4d82239ad..35acc0da2 100644 --- a/packages/fdc3-get-agent/package.json +++ b/packages/fdc3-get-agent/package.json @@ -14,6 +14,8 @@ "dependencies": { "@kite9/fdc3-standard": "2.2.0-beta.6", "@kite9/da-proxy": "2.2.0-beta.6", + "@kite9/fdc3-schema": "2.2.0-beta.6", + "@kite9/fdc3-context": "2.2.0-beta.6", "@types/uuid": "^10.0.0", "uuid": "^9.0.1" }, From ca766dcf22b9111189ff9a292f1e5dc5b13f3c88 Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 16:21:08 +0100 Subject: [PATCH 15/16] Renamed da-proxy --- package-lock.json | 14 +- package.json | 2 +- .../cucumber.yml | 0 .../package.json | 2 +- .../src/BasicDesktopAgent.ts | 0 .../src/Messaging.ts | 0 .../src/apps/AppSupport.ts | 0 .../src/apps/DefaultAppSupport.ts | 0 .../src/channels/ChannelSupport.ts | 0 .../src/channels/DefaultChannel.ts | 0 .../src/channels/DefaultChannelSupport.ts | 0 .../src/channels/DefaultPrivateChannel.ts | 0 .../src/handshake/DefaultHandshakeSupport.ts | 0 .../src/handshake/HandshakeSupport.ts | 0 .../src/index.ts | 0 .../src/intents/DefaultIntentResolution.ts | 0 .../src/intents/DefaultIntentSupport.ts | 0 .../src/intents/IntentSupport.ts | 0 .../src/listeners/AbstractListener.ts | 0 .../src/listeners/DefaultContextListener.ts | 0 .../src/listeners/DefaultIntentListener.ts | 0 .../src/listeners/FollowingContextListener.ts | 0 .../listeners/PrivateChannelEventListener.ts | 0 .../src/listeners/RegisterableListener.ts | 2 +- .../src/messaging/AbstractMessaging.ts | 0 .../test/features/app-channels.feature | 0 .../test/features/app-metadata.feature | 0 .../test/features/broadcast.feature | 0 .../test/features/find-intents.feature | 0 .../test/features/intent-listener.feature | 0 .../test/features/intent-results.feature | 0 .../test/features/open.feature | 0 .../test/features/private-channels.feature | 0 .../test/features/raise-intents.feature | 0 .../test/features/user-channel-sync.feature | 0 .../test/features/user-channels.feature | 0 .../test/step-definitions/channels.steps.ts | 0 .../test/step-definitions/generic.steps.ts | 0 .../test/step-definitions/intents.steps.ts | 0 .../test/support/TestMessaging.ts | 0 .../test/support/responses/ChannelState.ts | 0 .../support/responses/CreatePrivateChannel.ts | 0 .../responses/DisconnectPrivateChannel.ts | 0 .../test/support/responses/FindInstances.ts | 0 .../test/support/responses/FindIntent.ts | 0 .../support/responses/FindIntentByContext.ts | 0 .../test/support/responses/GetAppMetadata.ts | 0 .../support/responses/GetOrCreateChannel.ts | 0 .../test/support/responses/GetUserChannels.ts | 0 .../test/support/responses/Handshake.ts | 0 .../test/support/responses/IntentResult.ts | 0 .../test/support/responses/Open.ts | 0 .../test/support/responses/RaiseIntent.ts | 0 .../responses/RaiseIntentForContext.ts | 0 .../support/responses/RegisterListeners.ts | 0 .../support/responses/UnsubscribeListeners.ts | 0 .../test/support/responses/support.ts | 0 .../test/world/index.ts | 0 .../tsconfig.json | 6 + packages/fdc3-get-agent/package.json | 2 +- .../fdc3-get-agent/src/apps/NoopAppSupport.ts | 4 +- .../src/messaging/AbstractWebMessaging.ts | 2 +- .../src/messaging/MessagePortMessaging.ts | 2 +- .../src/messaging/message-port.ts | 2 +- packages/fdc3-get-agent/tsconfig.json | 8 +- .../fdc3-schema/generated/api/BrowserTypes.ts | 5682 ++++++++++++++++ .../generated/bridging/BridgingTypes.ts | 6058 +++++++++++++++++ packages/fdc3-schema/package.json | 4 +- toolbox/fdc3-for-web/da-server/tsconfig.json | 8 +- toolbox/fdc3-workbench/package-lock.json | 6 +- 70 files changed, 11781 insertions(+), 23 deletions(-) rename packages/{da-proxy => fdc3-agent-proxy}/cucumber.yml (100%) rename packages/{da-proxy => fdc3-agent-proxy}/package.json (97%) rename packages/{da-proxy => fdc3-agent-proxy}/src/BasicDesktopAgent.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/Messaging.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/apps/AppSupport.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/apps/DefaultAppSupport.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/channels/ChannelSupport.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/channels/DefaultChannel.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/channels/DefaultChannelSupport.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/channels/DefaultPrivateChannel.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/handshake/DefaultHandshakeSupport.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/handshake/HandshakeSupport.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/index.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/intents/DefaultIntentResolution.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/intents/DefaultIntentSupport.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/intents/IntentSupport.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/listeners/AbstractListener.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/listeners/DefaultContextListener.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/listeners/DefaultIntentListener.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/listeners/FollowingContextListener.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/listeners/PrivateChannelEventListener.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/src/listeners/RegisterableListener.ts (83%) rename packages/{da-proxy => fdc3-agent-proxy}/src/messaging/AbstractMessaging.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/features/app-channels.feature (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/features/app-metadata.feature (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/features/broadcast.feature (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/features/find-intents.feature (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/features/intent-listener.feature (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/features/intent-results.feature (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/features/open.feature (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/features/private-channels.feature (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/features/raise-intents.feature (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/features/user-channel-sync.feature (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/features/user-channels.feature (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/step-definitions/channels.steps.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/step-definitions/generic.steps.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/step-definitions/intents.steps.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/TestMessaging.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/ChannelState.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/CreatePrivateChannel.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/DisconnectPrivateChannel.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/FindInstances.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/FindIntent.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/FindIntentByContext.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/GetAppMetadata.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/GetOrCreateChannel.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/GetUserChannels.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/Handshake.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/IntentResult.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/Open.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/RaiseIntent.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/RaiseIntentForContext.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/RegisterListeners.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/UnsubscribeListeners.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/support/responses/support.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/test/world/index.ts (100%) rename packages/{da-proxy => fdc3-agent-proxy}/tsconfig.json (80%) create mode 100644 packages/fdc3-schema/generated/api/BrowserTypes.ts create mode 100644 packages/fdc3-schema/generated/bridging/BridgingTypes.ts diff --git a/package-lock.json b/package-lock.json index 717ba4522..8dd831ab8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "packages/fdc3-context", "packages/fdc3-standard", "packages/testing", - "packages/da-proxy", + "packages/fdc3-agent-proxy", "toolbox/fdc3-for-web/da-server", "packages/fdc3-get-agent", "toolbox/fdc3-for-web/demo", @@ -3394,10 +3394,6 @@ "jsep": "^0.4.0||^1.0.0" } }, - "node_modules/@kite9/da-proxy": { - "resolved": "packages/da-proxy", - "link": true - }, "node_modules/@kite9/da-server": { "resolved": "toolbox/fdc3-for-web/da-server", "link": true @@ -3414,6 +3410,10 @@ "@rollup/rollup-linux-x64-gnu": "4.14.1" } }, + "node_modules/@kite9/fdc3-agent-proxy": { + "resolved": "packages/fdc3-agent-proxy", + "link": true + }, "node_modules/@kite9/fdc3-common": { "version": "2.2.0-beta.6", "integrity": "sha512-JQa8WVXWIpHQRMt9CFsxqjfrw2Rq4tVUT8R6r2cJAg1y1Ns+zmpclo/bGi3DVqFyd5PfOEbbiAER/1ll0PXb3A==", @@ -16042,7 +16042,7 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "packages/da-proxy": { + "packages/fdc3-agent-proxy": { "version": "2.2.0-beta.6", "dependencies": { "@kite9/fdc3-standard": "2.2.0-beta.6" @@ -16096,7 +16096,7 @@ "packages/fdc3-get-agent": { "version": "2.2.0-beta.6", "dependencies": { - "@kite9/da-proxy": "2.2.0-beta.6", + "@kite9/fdc3-agent-proxy": "2.2.0-beta.6", "@kite9/fdc3-context": "2.2.0-beta.6", "@kite9/fdc3-schema": "2.2.0-beta.6", "@kite9/fdc3-standard": "2.2.0-beta.6", diff --git a/package.json b/package.json index f2a17b4c3..77af4cbd9 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "packages/fdc3-context", "packages/fdc3-standard", "packages/testing", - "packages/da-proxy", + "packages/fdc3-agent-proxy", "toolbox/fdc3-for-web/da-server", "packages/fdc3-get-agent", "toolbox/fdc3-for-web/demo", diff --git a/packages/da-proxy/cucumber.yml b/packages/fdc3-agent-proxy/cucumber.yml similarity index 100% rename from packages/da-proxy/cucumber.yml rename to packages/fdc3-agent-proxy/cucumber.yml diff --git a/packages/da-proxy/package.json b/packages/fdc3-agent-proxy/package.json similarity index 97% rename from packages/da-proxy/package.json rename to packages/fdc3-agent-proxy/package.json index d77fa7b25..e8e58b84a 100644 --- a/packages/da-proxy/package.json +++ b/packages/fdc3-agent-proxy/package.json @@ -1,5 +1,5 @@ { - "name": "@kite9/da-proxy", + "name": "@kite9/fdc3-agent-proxy", "version": "2.2.0-beta.6", "files": [ "dist" diff --git a/packages/da-proxy/src/BasicDesktopAgent.ts b/packages/fdc3-agent-proxy/src/BasicDesktopAgent.ts similarity index 100% rename from packages/da-proxy/src/BasicDesktopAgent.ts rename to packages/fdc3-agent-proxy/src/BasicDesktopAgent.ts diff --git a/packages/da-proxy/src/Messaging.ts b/packages/fdc3-agent-proxy/src/Messaging.ts similarity index 100% rename from packages/da-proxy/src/Messaging.ts rename to packages/fdc3-agent-proxy/src/Messaging.ts diff --git a/packages/da-proxy/src/apps/AppSupport.ts b/packages/fdc3-agent-proxy/src/apps/AppSupport.ts similarity index 100% rename from packages/da-proxy/src/apps/AppSupport.ts rename to packages/fdc3-agent-proxy/src/apps/AppSupport.ts diff --git a/packages/da-proxy/src/apps/DefaultAppSupport.ts b/packages/fdc3-agent-proxy/src/apps/DefaultAppSupport.ts similarity index 100% rename from packages/da-proxy/src/apps/DefaultAppSupport.ts rename to packages/fdc3-agent-proxy/src/apps/DefaultAppSupport.ts diff --git a/packages/da-proxy/src/channels/ChannelSupport.ts b/packages/fdc3-agent-proxy/src/channels/ChannelSupport.ts similarity index 100% rename from packages/da-proxy/src/channels/ChannelSupport.ts rename to packages/fdc3-agent-proxy/src/channels/ChannelSupport.ts diff --git a/packages/da-proxy/src/channels/DefaultChannel.ts b/packages/fdc3-agent-proxy/src/channels/DefaultChannel.ts similarity index 100% rename from packages/da-proxy/src/channels/DefaultChannel.ts rename to packages/fdc3-agent-proxy/src/channels/DefaultChannel.ts diff --git a/packages/da-proxy/src/channels/DefaultChannelSupport.ts b/packages/fdc3-agent-proxy/src/channels/DefaultChannelSupport.ts similarity index 100% rename from packages/da-proxy/src/channels/DefaultChannelSupport.ts rename to packages/fdc3-agent-proxy/src/channels/DefaultChannelSupport.ts diff --git a/packages/da-proxy/src/channels/DefaultPrivateChannel.ts b/packages/fdc3-agent-proxy/src/channels/DefaultPrivateChannel.ts similarity index 100% rename from packages/da-proxy/src/channels/DefaultPrivateChannel.ts rename to packages/fdc3-agent-proxy/src/channels/DefaultPrivateChannel.ts diff --git a/packages/da-proxy/src/handshake/DefaultHandshakeSupport.ts b/packages/fdc3-agent-proxy/src/handshake/DefaultHandshakeSupport.ts similarity index 100% rename from packages/da-proxy/src/handshake/DefaultHandshakeSupport.ts rename to packages/fdc3-agent-proxy/src/handshake/DefaultHandshakeSupport.ts diff --git a/packages/da-proxy/src/handshake/HandshakeSupport.ts b/packages/fdc3-agent-proxy/src/handshake/HandshakeSupport.ts similarity index 100% rename from packages/da-proxy/src/handshake/HandshakeSupport.ts rename to packages/fdc3-agent-proxy/src/handshake/HandshakeSupport.ts diff --git a/packages/da-proxy/src/index.ts b/packages/fdc3-agent-proxy/src/index.ts similarity index 100% rename from packages/da-proxy/src/index.ts rename to packages/fdc3-agent-proxy/src/index.ts diff --git a/packages/da-proxy/src/intents/DefaultIntentResolution.ts b/packages/fdc3-agent-proxy/src/intents/DefaultIntentResolution.ts similarity index 100% rename from packages/da-proxy/src/intents/DefaultIntentResolution.ts rename to packages/fdc3-agent-proxy/src/intents/DefaultIntentResolution.ts diff --git a/packages/da-proxy/src/intents/DefaultIntentSupport.ts b/packages/fdc3-agent-proxy/src/intents/DefaultIntentSupport.ts similarity index 100% rename from packages/da-proxy/src/intents/DefaultIntentSupport.ts rename to packages/fdc3-agent-proxy/src/intents/DefaultIntentSupport.ts diff --git a/packages/da-proxy/src/intents/IntentSupport.ts b/packages/fdc3-agent-proxy/src/intents/IntentSupport.ts similarity index 100% rename from packages/da-proxy/src/intents/IntentSupport.ts rename to packages/fdc3-agent-proxy/src/intents/IntentSupport.ts diff --git a/packages/da-proxy/src/listeners/AbstractListener.ts b/packages/fdc3-agent-proxy/src/listeners/AbstractListener.ts similarity index 100% rename from packages/da-proxy/src/listeners/AbstractListener.ts rename to packages/fdc3-agent-proxy/src/listeners/AbstractListener.ts diff --git a/packages/da-proxy/src/listeners/DefaultContextListener.ts b/packages/fdc3-agent-proxy/src/listeners/DefaultContextListener.ts similarity index 100% rename from packages/da-proxy/src/listeners/DefaultContextListener.ts rename to packages/fdc3-agent-proxy/src/listeners/DefaultContextListener.ts diff --git a/packages/da-proxy/src/listeners/DefaultIntentListener.ts b/packages/fdc3-agent-proxy/src/listeners/DefaultIntentListener.ts similarity index 100% rename from packages/da-proxy/src/listeners/DefaultIntentListener.ts rename to packages/fdc3-agent-proxy/src/listeners/DefaultIntentListener.ts diff --git a/packages/da-proxy/src/listeners/FollowingContextListener.ts b/packages/fdc3-agent-proxy/src/listeners/FollowingContextListener.ts similarity index 100% rename from packages/da-proxy/src/listeners/FollowingContextListener.ts rename to packages/fdc3-agent-proxy/src/listeners/FollowingContextListener.ts diff --git a/packages/da-proxy/src/listeners/PrivateChannelEventListener.ts b/packages/fdc3-agent-proxy/src/listeners/PrivateChannelEventListener.ts similarity index 100% rename from packages/da-proxy/src/listeners/PrivateChannelEventListener.ts rename to packages/fdc3-agent-proxy/src/listeners/PrivateChannelEventListener.ts diff --git a/packages/da-proxy/src/listeners/RegisterableListener.ts b/packages/fdc3-agent-proxy/src/listeners/RegisterableListener.ts similarity index 83% rename from packages/da-proxy/src/listeners/RegisterableListener.ts rename to packages/fdc3-agent-proxy/src/listeners/RegisterableListener.ts index c3e425915..3dff8cfcd 100644 --- a/packages/da-proxy/src/listeners/RegisterableListener.ts +++ b/packages/fdc3-agent-proxy/src/listeners/RegisterableListener.ts @@ -2,7 +2,7 @@ import { Listener } from "@kite9/fdc3-standard"; /** * Extends the basic concept of FDC3 listeners to include lifecycle methods. - * All da-proxy listners implement this interface and should be initialised + * All fdc3-agent-proxy listners implement this interface and should be initialised * with the register() method before use. */ export interface RegisterableListener extends Listener { diff --git a/packages/da-proxy/src/messaging/AbstractMessaging.ts b/packages/fdc3-agent-proxy/src/messaging/AbstractMessaging.ts similarity index 100% rename from packages/da-proxy/src/messaging/AbstractMessaging.ts rename to packages/fdc3-agent-proxy/src/messaging/AbstractMessaging.ts diff --git a/packages/da-proxy/test/features/app-channels.feature b/packages/fdc3-agent-proxy/test/features/app-channels.feature similarity index 100% rename from packages/da-proxy/test/features/app-channels.feature rename to packages/fdc3-agent-proxy/test/features/app-channels.feature diff --git a/packages/da-proxy/test/features/app-metadata.feature b/packages/fdc3-agent-proxy/test/features/app-metadata.feature similarity index 100% rename from packages/da-proxy/test/features/app-metadata.feature rename to packages/fdc3-agent-proxy/test/features/app-metadata.feature diff --git a/packages/da-proxy/test/features/broadcast.feature b/packages/fdc3-agent-proxy/test/features/broadcast.feature similarity index 100% rename from packages/da-proxy/test/features/broadcast.feature rename to packages/fdc3-agent-proxy/test/features/broadcast.feature diff --git a/packages/da-proxy/test/features/find-intents.feature b/packages/fdc3-agent-proxy/test/features/find-intents.feature similarity index 100% rename from packages/da-proxy/test/features/find-intents.feature rename to packages/fdc3-agent-proxy/test/features/find-intents.feature diff --git a/packages/da-proxy/test/features/intent-listener.feature b/packages/fdc3-agent-proxy/test/features/intent-listener.feature similarity index 100% rename from packages/da-proxy/test/features/intent-listener.feature rename to packages/fdc3-agent-proxy/test/features/intent-listener.feature diff --git a/packages/da-proxy/test/features/intent-results.feature b/packages/fdc3-agent-proxy/test/features/intent-results.feature similarity index 100% rename from packages/da-proxy/test/features/intent-results.feature rename to packages/fdc3-agent-proxy/test/features/intent-results.feature diff --git a/packages/da-proxy/test/features/open.feature b/packages/fdc3-agent-proxy/test/features/open.feature similarity index 100% rename from packages/da-proxy/test/features/open.feature rename to packages/fdc3-agent-proxy/test/features/open.feature diff --git a/packages/da-proxy/test/features/private-channels.feature b/packages/fdc3-agent-proxy/test/features/private-channels.feature similarity index 100% rename from packages/da-proxy/test/features/private-channels.feature rename to packages/fdc3-agent-proxy/test/features/private-channels.feature diff --git a/packages/da-proxy/test/features/raise-intents.feature b/packages/fdc3-agent-proxy/test/features/raise-intents.feature similarity index 100% rename from packages/da-proxy/test/features/raise-intents.feature rename to packages/fdc3-agent-proxy/test/features/raise-intents.feature diff --git a/packages/da-proxy/test/features/user-channel-sync.feature b/packages/fdc3-agent-proxy/test/features/user-channel-sync.feature similarity index 100% rename from packages/da-proxy/test/features/user-channel-sync.feature rename to packages/fdc3-agent-proxy/test/features/user-channel-sync.feature diff --git a/packages/da-proxy/test/features/user-channels.feature b/packages/fdc3-agent-proxy/test/features/user-channels.feature similarity index 100% rename from packages/da-proxy/test/features/user-channels.feature rename to packages/fdc3-agent-proxy/test/features/user-channels.feature diff --git a/packages/da-proxy/test/step-definitions/channels.steps.ts b/packages/fdc3-agent-proxy/test/step-definitions/channels.steps.ts similarity index 100% rename from packages/da-proxy/test/step-definitions/channels.steps.ts rename to packages/fdc3-agent-proxy/test/step-definitions/channels.steps.ts diff --git a/packages/da-proxy/test/step-definitions/generic.steps.ts b/packages/fdc3-agent-proxy/test/step-definitions/generic.steps.ts similarity index 100% rename from packages/da-proxy/test/step-definitions/generic.steps.ts rename to packages/fdc3-agent-proxy/test/step-definitions/generic.steps.ts diff --git a/packages/da-proxy/test/step-definitions/intents.steps.ts b/packages/fdc3-agent-proxy/test/step-definitions/intents.steps.ts similarity index 100% rename from packages/da-proxy/test/step-definitions/intents.steps.ts rename to packages/fdc3-agent-proxy/test/step-definitions/intents.steps.ts diff --git a/packages/da-proxy/test/support/TestMessaging.ts b/packages/fdc3-agent-proxy/test/support/TestMessaging.ts similarity index 100% rename from packages/da-proxy/test/support/TestMessaging.ts rename to packages/fdc3-agent-proxy/test/support/TestMessaging.ts diff --git a/packages/da-proxy/test/support/responses/ChannelState.ts b/packages/fdc3-agent-proxy/test/support/responses/ChannelState.ts similarity index 100% rename from packages/da-proxy/test/support/responses/ChannelState.ts rename to packages/fdc3-agent-proxy/test/support/responses/ChannelState.ts diff --git a/packages/da-proxy/test/support/responses/CreatePrivateChannel.ts b/packages/fdc3-agent-proxy/test/support/responses/CreatePrivateChannel.ts similarity index 100% rename from packages/da-proxy/test/support/responses/CreatePrivateChannel.ts rename to packages/fdc3-agent-proxy/test/support/responses/CreatePrivateChannel.ts diff --git a/packages/da-proxy/test/support/responses/DisconnectPrivateChannel.ts b/packages/fdc3-agent-proxy/test/support/responses/DisconnectPrivateChannel.ts similarity index 100% rename from packages/da-proxy/test/support/responses/DisconnectPrivateChannel.ts rename to packages/fdc3-agent-proxy/test/support/responses/DisconnectPrivateChannel.ts diff --git a/packages/da-proxy/test/support/responses/FindInstances.ts b/packages/fdc3-agent-proxy/test/support/responses/FindInstances.ts similarity index 100% rename from packages/da-proxy/test/support/responses/FindInstances.ts rename to packages/fdc3-agent-proxy/test/support/responses/FindInstances.ts diff --git a/packages/da-proxy/test/support/responses/FindIntent.ts b/packages/fdc3-agent-proxy/test/support/responses/FindIntent.ts similarity index 100% rename from packages/da-proxy/test/support/responses/FindIntent.ts rename to packages/fdc3-agent-proxy/test/support/responses/FindIntent.ts diff --git a/packages/da-proxy/test/support/responses/FindIntentByContext.ts b/packages/fdc3-agent-proxy/test/support/responses/FindIntentByContext.ts similarity index 100% rename from packages/da-proxy/test/support/responses/FindIntentByContext.ts rename to packages/fdc3-agent-proxy/test/support/responses/FindIntentByContext.ts diff --git a/packages/da-proxy/test/support/responses/GetAppMetadata.ts b/packages/fdc3-agent-proxy/test/support/responses/GetAppMetadata.ts similarity index 100% rename from packages/da-proxy/test/support/responses/GetAppMetadata.ts rename to packages/fdc3-agent-proxy/test/support/responses/GetAppMetadata.ts diff --git a/packages/da-proxy/test/support/responses/GetOrCreateChannel.ts b/packages/fdc3-agent-proxy/test/support/responses/GetOrCreateChannel.ts similarity index 100% rename from packages/da-proxy/test/support/responses/GetOrCreateChannel.ts rename to packages/fdc3-agent-proxy/test/support/responses/GetOrCreateChannel.ts diff --git a/packages/da-proxy/test/support/responses/GetUserChannels.ts b/packages/fdc3-agent-proxy/test/support/responses/GetUserChannels.ts similarity index 100% rename from packages/da-proxy/test/support/responses/GetUserChannels.ts rename to packages/fdc3-agent-proxy/test/support/responses/GetUserChannels.ts diff --git a/packages/da-proxy/test/support/responses/Handshake.ts b/packages/fdc3-agent-proxy/test/support/responses/Handshake.ts similarity index 100% rename from packages/da-proxy/test/support/responses/Handshake.ts rename to packages/fdc3-agent-proxy/test/support/responses/Handshake.ts diff --git a/packages/da-proxy/test/support/responses/IntentResult.ts b/packages/fdc3-agent-proxy/test/support/responses/IntentResult.ts similarity index 100% rename from packages/da-proxy/test/support/responses/IntentResult.ts rename to packages/fdc3-agent-proxy/test/support/responses/IntentResult.ts diff --git a/packages/da-proxy/test/support/responses/Open.ts b/packages/fdc3-agent-proxy/test/support/responses/Open.ts similarity index 100% rename from packages/da-proxy/test/support/responses/Open.ts rename to packages/fdc3-agent-proxy/test/support/responses/Open.ts diff --git a/packages/da-proxy/test/support/responses/RaiseIntent.ts b/packages/fdc3-agent-proxy/test/support/responses/RaiseIntent.ts similarity index 100% rename from packages/da-proxy/test/support/responses/RaiseIntent.ts rename to packages/fdc3-agent-proxy/test/support/responses/RaiseIntent.ts diff --git a/packages/da-proxy/test/support/responses/RaiseIntentForContext.ts b/packages/fdc3-agent-proxy/test/support/responses/RaiseIntentForContext.ts similarity index 100% rename from packages/da-proxy/test/support/responses/RaiseIntentForContext.ts rename to packages/fdc3-agent-proxy/test/support/responses/RaiseIntentForContext.ts diff --git a/packages/da-proxy/test/support/responses/RegisterListeners.ts b/packages/fdc3-agent-proxy/test/support/responses/RegisterListeners.ts similarity index 100% rename from packages/da-proxy/test/support/responses/RegisterListeners.ts rename to packages/fdc3-agent-proxy/test/support/responses/RegisterListeners.ts diff --git a/packages/da-proxy/test/support/responses/UnsubscribeListeners.ts b/packages/fdc3-agent-proxy/test/support/responses/UnsubscribeListeners.ts similarity index 100% rename from packages/da-proxy/test/support/responses/UnsubscribeListeners.ts rename to packages/fdc3-agent-proxy/test/support/responses/UnsubscribeListeners.ts diff --git a/packages/da-proxy/test/support/responses/support.ts b/packages/fdc3-agent-proxy/test/support/responses/support.ts similarity index 100% rename from packages/da-proxy/test/support/responses/support.ts rename to packages/fdc3-agent-proxy/test/support/responses/support.ts diff --git a/packages/da-proxy/test/world/index.ts b/packages/fdc3-agent-proxy/test/world/index.ts similarity index 100% rename from packages/da-proxy/test/world/index.ts rename to packages/fdc3-agent-proxy/test/world/index.ts diff --git a/packages/da-proxy/tsconfig.json b/packages/fdc3-agent-proxy/tsconfig.json similarity index 80% rename from packages/da-proxy/tsconfig.json rename to packages/fdc3-agent-proxy/tsconfig.json index 54d31b7af..fb0c43bc4 100644 --- a/packages/da-proxy/tsconfig.json +++ b/packages/fdc3-agent-proxy/tsconfig.json @@ -18,6 +18,12 @@ { "path": "../fdc3-standard" }, + { + "path": "../fdc3-schema" + }, + { + "path": "../fdc3-context" + }, { "path": "../testing" }, diff --git a/packages/fdc3-get-agent/package.json b/packages/fdc3-get-agent/package.json index 35acc0da2..c807019ec 100644 --- a/packages/fdc3-get-agent/package.json +++ b/packages/fdc3-get-agent/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@kite9/fdc3-standard": "2.2.0-beta.6", - "@kite9/da-proxy": "2.2.0-beta.6", + "@kite9/fdc3-agent-proxy": "2.2.0-beta.6", "@kite9/fdc3-schema": "2.2.0-beta.6", "@kite9/fdc3-context": "2.2.0-beta.6", "@types/uuid": "^10.0.0", diff --git a/packages/fdc3-get-agent/src/apps/NoopAppSupport.ts b/packages/fdc3-get-agent/src/apps/NoopAppSupport.ts index 76088de8b..30251b556 100644 --- a/packages/fdc3-get-agent/src/apps/NoopAppSupport.ts +++ b/packages/fdc3-get-agent/src/apps/NoopAppSupport.ts @@ -1,6 +1,6 @@ import { AppIdentifier, AppMetadata } from "@kite9/fdc3-standard"; -import { Messaging } from "@kite9/da-proxy"; -import { DefaultAppSupport } from "@kite9/da-proxy"; +import { Messaging } from "@kite9/fdc3-agent-proxy"; +import { DefaultAppSupport } from "@kite9/fdc3-agent-proxy"; export class NoopAppSupport extends DefaultAppSupport { diff --git a/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts b/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts index 13ba8163b..861f73f55 100644 --- a/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts +++ b/packages/fdc3-get-agent/src/messaging/AbstractWebMessaging.ts @@ -1,5 +1,5 @@ import { DesktopAgentDetails, WebDesktopAgentType, GetAgentParams, } from "@kite9/fdc3-standard"; -import { RegisterableListener, AbstractMessaging } from "@kite9/da-proxy"; +import { RegisterableListener, AbstractMessaging } from "@kite9/fdc3-agent-proxy"; import { BrowserTypes } from "@kite9/fdc3-schema"; type WebConnectionProtocol5ValidateAppIdentitySuccessResponse = BrowserTypes.WebConnectionProtocol5ValidateAppIdentitySuccessResponse diff --git a/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts b/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts index ea38775c8..323dc8955 100644 --- a/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts +++ b/packages/fdc3-get-agent/src/messaging/MessagePortMessaging.ts @@ -1,5 +1,5 @@ import { AbstractWebMessaging } from './AbstractWebMessaging' -import { RegisterableListener } from "@kite9/da-proxy" +import { RegisterableListener } from "@kite9/fdc3-agent-proxy" import { GetAgentParams } from "@kite9/fdc3-standard" import { v4 as uuidv4 } from "uuid" import { BrowserTypes } from "@kite9/fdc3-schema"; diff --git a/packages/fdc3-get-agent/src/messaging/message-port.ts b/packages/fdc3-get-agent/src/messaging/message-port.ts index 991e41a6b..bf9de52bf 100644 --- a/packages/fdc3-get-agent/src/messaging/message-port.ts +++ b/packages/fdc3-get-agent/src/messaging/message-port.ts @@ -1,5 +1,5 @@ import { DesktopAgent } from "@kite9/fdc3-standard"; -import { BasicDesktopAgent, DefaultChannelSupport, DefaultAppSupport, DefaultIntentSupport, DefaultHandshakeSupport, ChannelSupport } from "@kite9/da-proxy"; +import { BasicDesktopAgent, DefaultChannelSupport, DefaultAppSupport, DefaultIntentSupport, DefaultHandshakeSupport, ChannelSupport } from "@kite9/fdc3-agent-proxy"; import { ConnectionDetails, MessagePortMessaging } from "./MessagePortMessaging"; import { DefaultDesktopAgentIntentResolver } from "../ui/DefaultDesktopAgentIntentResolver"; import { DefaultDesktopAgentChannelSelector } from "../ui/DefaultDesktopAgentChannelSelector"; diff --git a/packages/fdc3-get-agent/tsconfig.json b/packages/fdc3-get-agent/tsconfig.json index 5db9c91a5..756ac9895 100644 --- a/packages/fdc3-get-agent/tsconfig.json +++ b/packages/fdc3-get-agent/tsconfig.json @@ -12,7 +12,7 @@ ], "references": [ { - "path": "../da-proxy" + "path": "../fdc3-agent-proxy" }, { "path": "../fdc3-standard" @@ -20,6 +20,12 @@ { "path": "../testing" }, + { + "path": "../fdc3-schema" + }, + { + "path": "../fdc3-context" + }, { "path": "../../toolbox/fdc3-for-web/da-server" } diff --git a/packages/fdc3-schema/generated/api/BrowserTypes.ts b/packages/fdc3-schema/generated/api/BrowserTypes.ts new file mode 100644 index 000000000..70b633b13 --- /dev/null +++ b/packages/fdc3-schema/generated/api/BrowserTypes.ts @@ -0,0 +1,5682 @@ +// To parse this data: +// +// import { Convert, WebConnectionProtocol1Hello, WebConnectionProtocol2LoadURL, WebConnectionProtocol3Handshake, WebConnectionProtocol4ValidateAppIdentity, WebConnectionProtocol5ValidateAppIdentityFailedResponse, WebConnectionProtocol5ValidateAppIdentitySuccessResponse, WebConnectionProtocol6Goodbye, WebConnectionProtocolMessage, AddContextListenerRequest, AddContextListenerResponse, AddEventListenerEvent, AddEventListenerRequest, AddEventListenerResponse, AddIntentListenerRequest, AddIntentListenerResponse, AgentEventMessage, AgentResponseMessage, AppRequestMessage, BroadcastEvent, BroadcastRequest, BroadcastResponse, ChannelChangedEvent, ContextListenerUnsubscribeRequest, ContextListenerUnsubscribeResponse, CreatePrivateChannelRequest, CreatePrivateChannelResponse, EventListenerUnsubscribeRequest, EventListenerUnsubscribeResponse, FindInstancesRequest, FindInstancesResponse, FindIntentRequest, FindIntentResponse, FindIntentsByContextRequest, FindIntentsByContextResponse, GetAppMetadataRequest, GetAppMetadataResponse, GetCurrentChannelRequest, GetCurrentChannelResponse, GetCurrentContextRequest, GetCurrentContextResponse, GetInfoRequest, GetInfoResponse, GetOrCreateChannelRequest, GetOrCreateChannelResponse, GetUserChannelsRequest, GetUserChannelsResponse, IframeChannelDrag, IframeChannelResize, IframeChannelSelected, IframeChannels, IframeHandshake, IframeHello, IframeMessage, IframeResolve, IframeResolveAction, IntentEvent, IntentListenerUnsubscribeRequest, IntentListenerUnsubscribeResponse, IntentResultRequest, IntentResultResponse, JoinUserChannelRequest, JoinUserChannelResponse, LeaveCurrentChannelRequest, LeaveCurrentChannelResponse, OpenRequest, OpenResponse, PrivateChannelDisconnectRequest, PrivateChannelDisconnectResponse, PrivateChannelOnAddContextListenerEvent, PrivateChannelOnDisconnectEvent, PrivateChannelOnUnsubscribeEvent, PrivateChannelUnsubscribeEventListenerRequest, PrivateChannelUnsubscribeEventListenerResponse, PrivateChannelAddEventListenerRequest, PrivateChannelAddEventListenerResponse, RaiseIntentForContextRequest, RaiseIntentForContextResponse, RaiseIntentRequest, RaiseIntentResponse, RaiseIntentResultResponse } from "./file"; +// +// const webConnectionProtocol1Hello = Convert.toWebConnectionProtocol1Hello(json); +// const webConnectionProtocol2LoadURL = Convert.toWebConnectionProtocol2LoadURL(json); +// const webConnectionProtocol3Handshake = Convert.toWebConnectionProtocol3Handshake(json); +// const webConnectionProtocol4ValidateAppIdentity = Convert.toWebConnectionProtocol4ValidateAppIdentity(json); +// const webConnectionProtocol5ValidateAppIdentityFailedResponse = Convert.toWebConnectionProtocol5ValidateAppIdentityFailedResponse(json); +// const webConnectionProtocol5ValidateAppIdentitySuccessResponse = Convert.toWebConnectionProtocol5ValidateAppIdentitySuccessResponse(json); +// const webConnectionProtocol6Goodbye = Convert.toWebConnectionProtocol6Goodbye(json); +// const webConnectionProtocolMessage = Convert.toWebConnectionProtocolMessage(json); +// const addContextListenerRequest = Convert.toAddContextListenerRequest(json); +// const addContextListenerResponse = Convert.toAddContextListenerResponse(json); +// const addEventListenerEvent = Convert.toAddEventListenerEvent(json); +// const addEventListenerRequest = Convert.toAddEventListenerRequest(json); +// const addEventListenerResponse = Convert.toAddEventListenerResponse(json); +// const addIntentListenerRequest = Convert.toAddIntentListenerRequest(json); +// const addIntentListenerResponse = Convert.toAddIntentListenerResponse(json); +// const agentEventMessage = Convert.toAgentEventMessage(json); +// const agentResponseMessage = Convert.toAgentResponseMessage(json); +// const appRequestMessage = Convert.toAppRequestMessage(json); +// const broadcastEvent = Convert.toBroadcastEvent(json); +// const broadcastRequest = Convert.toBroadcastRequest(json); +// const broadcastResponse = Convert.toBroadcastResponse(json); +// const channelChangedEvent = Convert.toChannelChangedEvent(json); +// const contextListenerUnsubscribeRequest = Convert.toContextListenerUnsubscribeRequest(json); +// const contextListenerUnsubscribeResponse = Convert.toContextListenerUnsubscribeResponse(json); +// const createPrivateChannelRequest = Convert.toCreatePrivateChannelRequest(json); +// const createPrivateChannelResponse = Convert.toCreatePrivateChannelResponse(json); +// const eventListenerUnsubscribeRequest = Convert.toEventListenerUnsubscribeRequest(json); +// const eventListenerUnsubscribeResponse = Convert.toEventListenerUnsubscribeResponse(json); +// const findInstancesRequest = Convert.toFindInstancesRequest(json); +// const findInstancesResponse = Convert.toFindInstancesResponse(json); +// const findIntentRequest = Convert.toFindIntentRequest(json); +// const findIntentResponse = Convert.toFindIntentResponse(json); +// const findIntentsByContextRequest = Convert.toFindIntentsByContextRequest(json); +// const findIntentsByContextResponse = Convert.toFindIntentsByContextResponse(json); +// const getAppMetadataRequest = Convert.toGetAppMetadataRequest(json); +// const getAppMetadataResponse = Convert.toGetAppMetadataResponse(json); +// const getCurrentChannelRequest = Convert.toGetCurrentChannelRequest(json); +// const getCurrentChannelResponse = Convert.toGetCurrentChannelResponse(json); +// const getCurrentContextRequest = Convert.toGetCurrentContextRequest(json); +// const getCurrentContextResponse = Convert.toGetCurrentContextResponse(json); +// const getInfoRequest = Convert.toGetInfoRequest(json); +// const getInfoResponse = Convert.toGetInfoResponse(json); +// const getOrCreateChannelRequest = Convert.toGetOrCreateChannelRequest(json); +// const getOrCreateChannelResponse = Convert.toGetOrCreateChannelResponse(json); +// const getUserChannelsRequest = Convert.toGetUserChannelsRequest(json); +// const getUserChannelsResponse = Convert.toGetUserChannelsResponse(json); +// const iframeChannelDrag = Convert.toIframeChannelDrag(json); +// const iframeChannelResize = Convert.toIframeChannelResize(json); +// const iframeChannelSelected = Convert.toIframeChannelSelected(json); +// const iframeChannels = Convert.toIframeChannels(json); +// const iframeHandshake = Convert.toIframeHandshake(json); +// const iframeHello = Convert.toIframeHello(json); +// const iframeMessage = Convert.toIframeMessage(json); +// const iframeResolve = Convert.toIframeResolve(json); +// const iframeResolveAction = Convert.toIframeResolveAction(json); +// const intentEvent = Convert.toIntentEvent(json); +// const intentListenerUnsubscribeRequest = Convert.toIntentListenerUnsubscribeRequest(json); +// const intentListenerUnsubscribeResponse = Convert.toIntentListenerUnsubscribeResponse(json); +// const intentResultRequest = Convert.toIntentResultRequest(json); +// const intentResultResponse = Convert.toIntentResultResponse(json); +// const joinUserChannelRequest = Convert.toJoinUserChannelRequest(json); +// const joinUserChannelResponse = Convert.toJoinUserChannelResponse(json); +// const leaveCurrentChannelRequest = Convert.toLeaveCurrentChannelRequest(json); +// const leaveCurrentChannelResponse = Convert.toLeaveCurrentChannelResponse(json); +// const openRequest = Convert.toOpenRequest(json); +// const openResponse = Convert.toOpenResponse(json); +// const privateChannelDisconnectRequest = Convert.toPrivateChannelDisconnectRequest(json); +// const privateChannelDisconnectResponse = Convert.toPrivateChannelDisconnectResponse(json); +// const privateChannelOnAddContextListenerEvent = Convert.toPrivateChannelOnAddContextListenerEvent(json); +// const privateChannelOnDisconnectEvent = Convert.toPrivateChannelOnDisconnectEvent(json); +// const privateChannelOnUnsubscribeEvent = Convert.toPrivateChannelOnUnsubscribeEvent(json); +// const privateChannelUnsubscribeEventListenerRequest = Convert.toPrivateChannelUnsubscribeEventListenerRequest(json); +// const privateChannelUnsubscribeEventListenerResponse = Convert.toPrivateChannelUnsubscribeEventListenerResponse(json); +// const privateChannelAddEventListenerRequest = Convert.toPrivateChannelAddEventListenerRequest(json); +// const privateChannelAddEventListenerResponse = Convert.toPrivateChannelAddEventListenerResponse(json); +// const raiseIntentForContextRequest = Convert.toRaiseIntentForContextRequest(json); +// const raiseIntentForContextResponse = Convert.toRaiseIntentForContextResponse(json); +// const raiseIntentRequest = Convert.toRaiseIntentRequest(json); +// const raiseIntentResponse = Convert.toRaiseIntentResponse(json); +// const raiseIntentResultResponse = Convert.toRaiseIntentResultResponse(json); +// +// These functions will throw an error if the JSON doesn't +// match the expected interface, even if the JSON is valid. + +/** + * Hello message sent by an application to a parent window or frame when attempting to + * establish connectivity to a Desktop Agent + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol1Hello { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol1HelloPayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP1Hello"; +} + +/** + * Metadata for this connection step message + */ +export interface ConnectionStepMetadata { + connectionAttemptUuid: string; + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol1HelloPayload { + /** + * A flag that may be used to indicate that a channel selector UI is or is not required. If + * the app includes its own UI for displaying + */ + channelSelector?: boolean; + /** + * The version of FDC3 API that the app supports. + */ + fdc3Version: string; + /** + * URL to use for the identity of the application. Desktop Agents MUST validate that the + * origin of the message matches the URL, but MAY implement custom comparison logic. + */ + identityUrl: string; + /** + * A flag that may be used to indicate that an intent resolver is or is not required. Set to + * false if no intents, or only targeted intents, are raised + */ + resolver?: boolean; + [property: string]: any; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Response from a Desktop Agent to an application requesting access to it indicating that + * it should load a specified URL into a hidden iframe in order to establish connectivity to + * a Desktop Agent + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol2LoadURL { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol2LoadURLPayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP2LoadUrl"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol2LoadURLPayload { + /** + * A URL which can be used to establish communication with the Desktop Agent, via loading + * the URL into an iframe and restarting the Web Connection protocol with the iframe as the + * target + */ + iframeUrl: string; + [property: string]: any; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Handshake message sent by the Desktop Agent to the app (with a MessagePort appended) that + * should be used for subsequent communication steps. + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol3Handshake { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol3HandshakePayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP3Handshake"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol3HandshakePayload { + /** + * Indicates whether a channel selector UI is required and the URL to use to do so. Set to + * `true` to use the default or `false` to disable the channel selector (as the Desktop + * Agent will handle another way) + */ + channelSelector: boolean | string; + /** + * The version of FDC3 API that the Desktop Agent will provide support for. + */ + fdc3Version: string; + /** + * Indicates whether an intent resolver UI is required and the URL to use to do so. Set to + * `true` to use the default or `false` to disable the intent resolver (as the Desktop Agent + * will handle another way) + */ + resolver: boolean | string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Identity Validation request from an app attempting to connect to a Desktop Agent. + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol4ValidateAppIdentity { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol4ValidateAppIdentityPayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP4ValidateAppIdentity"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol4ValidateAppIdentityPayload { + /** + * URL to use for the identity of the application. Desktop Agents MUST validate that the + * origin of the message matches the URL, but MAY implement custom comparison logic. + */ + identityUrl: string; + /** + * If an application has previously connected to the desktop agent, it may specify its prior + * instance id and associated instance UUID to request the same same instance Id be assigned. + */ + instanceId?: string; + /** + * Instance UUID associated with the requested instanceId. + */ + instanceUuid?: string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Message sent by the Desktop Agent to an app if their identity validation fails. + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol5ValidateAppIdentityFailedResponse { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP5ValidateAppIdentityFailedResponse"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload { + message?: string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Message sent by the Desktop Agent to an app after successful identity validation + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol5ValidateAppIdentitySuccessResponse { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload; + /** + * Identifies the type of the connection step message. + */ + type: "WCP5ValidateAppIdentityResponse"; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload { + /** + * The appId that the app's identity was validated against + */ + appId: string; + /** + * Implementation metadata for the Desktop Agent, which includes an appMetadata element + * containing a copy of the app's own metadata + */ + implementationMetadata: ImplementationMetadata; + /** + * The instance Id granted to the application by the Desktop Agent. + */ + instanceId: string; + /** + * Instance UUID associated with the instanceId granted, which may be used to retrieve the + * same instance Id if the app is reloaded or navigates. + */ + instanceUuid: string; +} + +/** + * Implementation metadata for the Desktop Agent, which includes an appMetadata element + * containing a copy of the app's own metadata + * + * Includes Metadata for the current application. + * + * Metadata relating to the FDC3 Desktop Agent implementation and its provider. + */ +export interface ImplementationMetadata { + /** + * The calling application instance's own metadata, according to the Desktop Agent (MUST + * include at least the `appId` and `instanceId`). + */ + appMetadata: AppMetadata; + /** + * The version number of the FDC3 specification that the implementation provides. + * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. + */ + fdc3Version: string; + /** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ + optionalFeatures: OptionalFeatures; + /** + * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, + * OpenFin etc.). + */ + provider: string; + /** + * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). + */ + providerVersion?: string; +} + +/** + * The calling application instance's own metadata, according to the Desktop Agent (MUST + * include at least the `appId` and `instanceId`). + * + * Extends an `AppIdentifier`, describing an application or instance of an application, with + * additional descriptive metadata that is usually provided by an FDC3 App Directory that + * the desktop agent connects to. + * + * The additional information from an app directory can aid in rendering UI elements, such + * as a launcher menu or resolver UI. This includes a title, description, tooltip and icon + * and screenshot URLs. + * + * Note that as `AppMetadata` instances are also `AppIdentifiers` they may be passed to the + * `app` argument of `fdc3.open`, `fdc3.raiseIntent` etc. + */ +export interface AppMetadata { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * A longer, multi-paragraph description for the application that could include markup + */ + description?: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * A list of icon URLs for the application that can be used to render UI elements + */ + icons?: Icon[]; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + /** + * An optional set of, implementation specific, metadata fields that can be used to + * disambiguate instances, such as a window title or screen position. Must only be set if + * `instanceId` is set. + */ + instanceMetadata?: { [key: string]: any }; + /** + * The 'friendly' app name. + * This field was used with the `open` and `raiseIntent` calls in FDC3 <2.0, which now + * require an `AppIdentifier` wth `appId` set. + * Note that for display purposes the `title` field should be used, if set, in preference to + * this field. + */ + name?: string; + /** + * The type of output returned for any intent specified during resolution. May express a + * particular context type (e.g. "fdc3.instrument"), channel (e.g. "channel") or a channel + * that will receive a specified type (e.g. "channel"). + */ + resultType?: null | string; + /** + * Images representing the app in common usage scenarios that can be used to render UI + * elements + */ + screenshots?: Image[]; + /** + * A more user-friendly application title that can be used to render UI elements + */ + title?: string; + /** + * A tooltip for the application that can be used to render UI elements + */ + tooltip?: string; + /** + * The Version of the application. + */ + version?: string; +} + +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ +export interface Icon { + /** + * The icon dimension, formatted as `x`. + */ + size?: string; + /** + * The icon url + */ + src: string; + /** + * Icon media type. If not present the Desktop Agent may use the src file extension. + */ + type?: string; +} + +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ +export interface Image { + /** + * Caption for the image. + */ + label?: string; + /** + * The image dimension, formatted as `x`. + */ + size?: string; + /** + * The image url. + */ + src: string; + /** + * Image media type. If not present the Desktop Agent may use the src file extension. + */ + type?: string; +} + +/** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ +export interface OptionalFeatures { + /** + * Used to indicate whether the experimental Desktop Agent Bridging + * feature is implemented by the Desktop Agent. + */ + DesktopAgentBridging: boolean; + /** + * Used to indicate whether the exposure of 'originating app metadata' for + * context and intent messages is supported by the Desktop Agent. + */ + OriginatingAppMetadata: boolean; + /** + * Used to indicate whether the optional `fdc3.joinUserChannel`, + * `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by + * the Desktop Agent. + */ + UserChannelMembershipAPIs: boolean; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Goodbye message to be sent to the Desktop Agent when disconnecting (e.g. when closing the + * window or navigating). Desktop Agents should close the MessagePort after receiving this + * message, but retain instance details in case the application reconnects (e.g. after a + * navigation event). + * + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocol6Goodbye { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the connection step message. + */ + type: "WCP6Goodbye"; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * A message used during the connection flow for an application to a Desktop Agent in a + * browser window. Used for messages sent in either direction. + */ +export interface WebConnectionProtocolMessage { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the connection step message. + */ + type: ConnectionStepMessageType; +} + +/** + * Identifies the type of the connection step message. + */ +export type ConnectionStepMessageType = "WCP1Hello" | "WCP2LoadUrl" | "WCP3Handshake" | "WCP4ValidateAppIdentity" | "WCP5ValidateAppIdentityFailedResponse" | "WCP5ValidateAppIdentityResponse" | "WCP6Goodbye"; + +/** + * A request to add a context listener to a specified Channel OR to the current user + * channel. Where the listener is added to the current user channel (channelId == null), and + * this app has already been added to a user channel, client code should make a subsequent + * request to get the current context of that channel for this listener and then call its + * handler with it. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface AddContextListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: AddContextListenerRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "addContextListenerRequest"; +} + +/** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ +export interface AddContextListenerRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that a request or response was received + * from. Please note that this may be set by an app or Desktop Agent proxy for debugging + * purposes but a Desktop Agent should make its own determination of the source of a message + * to avoid spoofing. + */ + source?: AppIdentifier; + timestamp: Date; +} + +/** + * Field that represents the source application that a request or response was received + * from. Please note that this may be set by an app or Desktop Agent proxy for debugging + * purposes but a Desktop Agent should make its own determination of the source of a message + * to avoid spoofing. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that the request being responded to was + * received from, for debugging purposes. + * + * Details of the application instance that broadcast the context + * + * The App resolution option chosen + * + * Details of the application instance that raised the intent + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppIdentifier { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface AddContextListenerRequestPayload { + /** + * The id of the channel to add the listener to or `null` indicating that it should listen + * to the current user channel (at the time of broadcast). + */ + channelId: null | string; + /** + * The type of context to listen for OR `null` indicating that it should listen to all + * context types. + */ + contextType: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a addContextListener request. Where the listener was added to the current + * user channel (channelId == null), and this app has already been added to a user channel, + * client code should make a subsequent request to get the current context of that channel + * for this listener and then call its handler with it. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface AddContextListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: AddContextListenerResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "addContextListenerResponse"; +} + +/** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ +export interface AddContextListenerResponseMeta { + requestUuid: string; + responseUuid: string; + /** + * Field that represents the source application that the request being responded to was + * received from, for debugging purposes. + */ + source?: AppIdentifier; + timestamp: Date; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface AddContextListenerResponsePayload { + error?: PurpleError; + listenerUUID?: string; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type PurpleError = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app for a specified event type. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface AddEventListenerEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: AddEventListenerEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "addEventListenerEvent"; +} + +/** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ +export interface AddEventListenerEventMeta { + eventUuid: string; + timestamp: Date; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface AddEventListenerEventPayload { + event: FDC3Event; +} + +/** + * An event object received via the FDC3 API's addEventListener function. Will always + * include both type and details, which describe type of the event and any additional + * details respectively. + */ +export interface FDC3Event { + /** + * Additional details of the event, such as the `currentChannelId` for a CHANNEL_CHANGED + * event + */ + details: { [key: string]: any }; + type: "USER_CHANNEL_CHANGED"; +} + +/** + * The type of a (non-context and non-intent) event that may be received via the FDC3 API's + * addEventListener function. + * + * The type of the event to be listened to. + */ + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to add an event listener for a specified event type to the DesktopAgent. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface AddEventListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: AddEventListenerRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "addEventListenerRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface AddEventListenerRequestPayload { + /** + * The type of the event to be listened to. + */ + type: "USER_CHANNEL_CHANGED"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to an addEventListener request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface AddEventListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: AddEventListenerResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "addEventListenerResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface AddEventListenerResponsePayload { + error?: ResponsePayloadError; + listenerUUID?: string; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type ResponsePayloadError = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to add an Intent listener for a specified intent type. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface AddIntentListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: AddIntentListenerRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "addIntentListenerRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface AddIntentListenerRequestPayload { + /** + * The name of the intent to listen for. + */ + intent: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a addIntentListener request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface AddIntentListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: AddIntentListenerResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "addIntentListenerResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface AddIntentListenerResponsePayload { + error?: FluffyError; + listenerUUID?: string; + [property: string]: any; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type FluffyError = "MalformedContext" | "DesktopAgentNotFound" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface AgentEventMessage { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AgentEventMessageMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: EventMessageType; +} + +/** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ +export interface AgentEventMessageMeta { + eventUuid: string; + timestamp: Date; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ +export type EventMessageType = "intentEvent" | "broadcastEvent" | "channelChangedEvent" | "privateChannelOnAddContextListenerEvent" | "privateChannelOnDisconnectEvent" | "privateChannelOnUnsubscribeEvent" | "addEventListenerEvent"; + +/** + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface AgentResponseMessage { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AgentResponseMessageMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: AgentResponseMessageResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: ResponseMessageType; +} + +/** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ +export interface AgentResponseMessageMeta { + requestUuid: string; + responseUuid: string; + /** + * Field that represents the source application that the request being responded to was + * received from, for debugging purposes. + */ + source?: AppIdentifier; + timestamp: Date; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface AgentResponseMessageResponsePayload { + error?: ResponsePayloadError; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ +export type ResponseMessageType = "addContextListenerResponse" | "addEventListenerResponse" | "addIntentListenerResponse" | "broadcastResponse" | "contextListenerUnsubscribeResponse" | "createPrivateChannelResponse" | "eventListenerUnsubscribeResponse" | "findInstancesResponse" | "findIntentResponse" | "findIntentsByContextResponse" | "getAppMetadataResponse" | "getCurrentChannelResponse" | "getCurrentContextResponse" | "getInfoResponse" | "getOrCreateChannelResponse" | "getUserChannelsResponse" | "intentListenerUnsubscribeResponse" | "intentResultResponse" | "joinUserChannelResponse" | "leaveCurrentChannelResponse" | "openResponse" | "privateChannelAddEventListenerResponse" | "privateChannelDisconnectResponse" | "privateChannelUnsubscribeEventListenerResponse" | "raiseIntentForContextResponse" | "raiseIntentResponse" | "raiseIntentResultResponse"; + +/** + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface AppRequestMessage { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AppRequestMessageMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: RequestMessageType; +} + +/** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ +export interface AppRequestMessageMeta { + requestUuid: string; + /** + * Field that represents the source application that a request or response was received + * from. Please note that this may be set by an app or Desktop Agent proxy for debugging + * purposes but a Desktop Agent should make its own determination of the source of a message + * to avoid spoofing. + */ + source?: AppIdentifier; + timestamp: Date; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ +export type RequestMessageType = "addContextListenerRequest" | "addEventListenerRequest" | "addIntentListenerRequest" | "broadcastRequest" | "contextListenerUnsubscribeRequest" | "createPrivateChannelRequest" | "eventListenerUnsubscribeRequest" | "findInstancesRequest" | "findIntentRequest" | "findIntentsByContextRequest" | "getAppMetadataRequest" | "getCurrentChannelRequest" | "getCurrentContextRequest" | "getInfoRequest" | "getOrCreateChannelRequest" | "getUserChannelsRequest" | "intentListenerUnsubscribeRequest" | "intentResultRequest" | "joinUserChannelRequest" | "leaveCurrentChannelRequest" | "openRequest" | "privateChannelAddEventListenerRequest" | "privateChannelDisconnectRequest" | "privateChannelUnsubscribeEventListenerRequest" | "raiseIntentForContextRequest" | "raiseIntentRequest"; + +/** + * An event message from the Desktop Agent to an app indicating that context has been + * broadcast on a channel it is listening to, or specifically to this app instance if it was + * launched via `fdc3.open` and context was passed. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface BroadcastEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: BroadcastEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "broadcastEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface BroadcastEventPayload { + /** + * The Id of the channel that the broadcast was sent on. May be `null` if the context is + * being broadcast due to a call `fdc3.open` that passed context. + */ + channelId: null | string; + /** + * The context object that was broadcast. + */ + context: Context; + /** + * Details of the application instance that broadcast the context + */ + originatingApp?: AppIdentifier; +} + +/** + * The context object that was broadcast. + * + * The context object that is to be broadcast. + * + * The context object passed with the raised intent. + * + * If a Context object is passed in, this object will be provided to the opened application + * via a contextListener. The Context argument is functionally equivalent to opening the + * target app with no context and broadcasting the context directly to it. + * + * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by + * FDC3 operations. As such, it is not really meant to be used on its own, but is imported + * by more specific type definitions (standardized or custom) to provide the structure and + * properties shared by all FDC3 context data types. + * + * The key element of FDC3 context types is their mandatory `type` property, which is used + * to identify what type of data the object represents, and what shape it has. + * + * The FDC3 context type, and all derived types, define the minimum set of fields a context + * data object of a particular type can be expected to have, but this can always be extended + * with custom fields as appropriate. + */ +export interface Context { + /** + * Context data objects may include a set of equivalent key-value pairs that can be used to + * help applications identify and look up the context type they receive in their own domain. + * The idea behind this design is that applications can provide as many equivalent + * identifiers to a target application as possible, e.g. an instrument may be represented by + * an ISIN, CUSIP or Bloomberg identifier. + * + * Identifiers do not make sense for all types of data, so the `id` property is therefore + * optional, but some derived types may choose to require at least one identifier. + * Identifier values SHOULD always be of type string. + */ + id?: { [key: string]: any }; + /** + * Context data objects may include a name property that can be used for more information, + * or display purposes. Some derived types may require the name object as mandatory, + * depending on use case. + */ + name?: string; + /** + * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 + * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present + * to route shared context data appropriately. + * + * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data + * types they support in an FDC3 [App + * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery + * and routing. + * + * Standardized FDC3 context types have well-known `type` properties prefixed with the + * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and + * used by a particular organization, the convention is to prefix them with an + * organization-specific namespace, e.g. `blackrock.fund`. + * + * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more + * information about context data types. + */ + type: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to broadcast context on a channel. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface BroadcastRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: BroadcastRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "broadcastRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface BroadcastRequestPayload { + /** + * The Id of the Channel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that is to be broadcast. + */ + context: Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a request to broadcast context on a channel. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface BroadcastResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "broadcastResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface BroadcastResponseResponsePayload { + error?: ResponsePayloadError; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app indicating that its current user + * channel has changed. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface ChannelChangedEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: ChannelChangedEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "channelChangedEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface ChannelChangedEventPayload { + /** + * The Id of the channel that the app was added to or `null` if it was removed from a + * channel. + */ + newChannelId: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to unsubscribe a context listener. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface ContextListenerUnsubscribeRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: ContextListenerUnsubscribeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "contextListenerUnsubscribeRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface ContextListenerUnsubscribeRequestPayload { + listenerUUID: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a contextListenerUnsubscribe request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface ContextListenerUnsubscribeResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "contextListenerUnsubscribeResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to return a Channel with an auto-generated identity that is intended for private + * communication between applications. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface CreatePrivateChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: CreatePrivateChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "createPrivateChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface CreatePrivateChannelRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a createPrivateChannel request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface CreatePrivateChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: CreatePrivateChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "createPrivateChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface CreatePrivateChannelResponsePayload { + error?: PurpleError; + privateChannel?: Channel; +} + +/** + * Represents a context channel that applications can use to send and receive + * context data. + * + * Please note that There are differences in behavior when you interact with a + * User channel via the `DesktopAgent` interface and the `Channel` interface. + * Specifically, when 'joining' a User channel or adding a context listener + * when already joined to a channel via the `DesktopAgent` interface, existing + * context (matching the type of the context listener) on the channel is + * received by the context listener immediately. Whereas, when a context + * listener is added via the Channel interface, context is not received + * automatically, but may be retrieved manually via the `getCurrentContext()` + * function. + */ +export interface Channel { + /** + * Channels may be visualized and selectable by users. DisplayMetadata may be used to + * provide hints on how to see them. + * For App channels, displayMetadata would typically not be present. + */ + displayMetadata?: DisplayMetadata; + /** + * Constant that uniquely identifies this channel. + */ + id: string; + /** + * Uniquely defines each channel type. + * Can be "user", "app" or "private". + */ + type: Type; +} + +/** + * Channels may be visualized and selectable by users. DisplayMetadata may be used to + * provide hints on how to see them. + * For App channels, displayMetadata would typically not be present. + * + * A system channel will be global enough to have a presence across many apps. This gives us + * some hints + * to render them in a standard way. It is assumed it may have other properties too, but if + * it has these, + * this is their meaning. + */ +export interface DisplayMetadata { + /** + * The color that should be associated within this channel when displaying this channel in a + * UI, e.g: `0xFF0000`. + */ + color?: string; + /** + * A URL of an image that can be used to display this channel + */ + glyph?: string; + /** + * A user-readable name for this channel, e.g: `"Red"` + */ + name?: string; +} + +/** + * Uniquely defines each channel type. + * Can be "user", "app" or "private". + */ +export type Type = "app" | "private" | "user"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to unsubscribe an event listener. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface EventListenerUnsubscribeRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: EventListenerUnsubscribeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "eventListenerUnsubscribeRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface EventListenerUnsubscribeRequestPayload { + listenerUUID: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to an eventListenerUnsubscribe request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface EventListenerUnsubscribeResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "eventListenerUnsubscribeResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request for details of instances of a particular app. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface FindInstancesRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindInstancesRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findInstancesRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindInstancesRequestPayload { + app: AppIdentifier; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a findInstances request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface FindInstancesResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: FindInstancesResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * The message payload contains a flag indicating whether the API call was successful, plus + * any return values for the FDC3 API function called, or indicating that the request + * resulted in an error and including a standardized error message. + */ +export interface FindInstancesResponsePayload { + error?: FindInstancesErrors; + appIdentifiers?: AppMetadata[]; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + * + * Unique identifier for a for an attempt to connect to a Desktop Agent + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + * + * Unique identifier for a `listener` object returned by a Desktop Agent to an app in + * response to addContextListener, addIntentListener or one of the PrivateChannel event + * listeners and used to identify it in messages (e.g. when unsubscribing). + * + * Should be set if the raiseIntent request returned an error. + */ +export type FindInstancesErrors = "MalformedContext" | "DesktopAgentNotFound" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request for details of apps available to resolve a particular intent and context pair. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface FindIntentRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentRequestPayload { + context?: Context; + intent: string; + resultType?: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a findIntent request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface FindIntentResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: FindIntentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface FindIntentResponsePayload { + error?: FindInstancesErrors; + appIntent?: AppIntent; +} + +/** + * An interface that relates an intent to apps + * + * Used if a raiseIntent request requires additional resolution (e.g. by showing an intent + * resolver) before it can be handled. + */ +export interface AppIntent { + /** + * Details of applications that can resolve the intent. + */ + apps: AppMetadata[]; + /** + * Details of the intent whose relationship to resolving applications is being described. + */ + intent: IntentMetadata; +} + +/** + * Details of the intent whose relationship to resolving applications is being described. + * + * Intent descriptor + */ +export interface IntentMetadata { + /** + * Display name for the intent. + */ + displayName?: string; + /** + * The unique name of the intent that can be invoked by the raiseIntent call + */ + name: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request for details of intents and apps available to resolve them for a particular + * context. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface FindIntentsByContextRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentsByContextRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentsByContextRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentsByContextRequestPayload { + context: Context; + resultType?: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a findIntentsByContext request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface FindIntentsByContextResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: FindIntentsByContextResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface FindIntentsByContextResponsePayload { + error?: FindInstancesErrors; + appIntents?: AppIntent[]; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request for metadata about an app. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetAppMetadataRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetAppMetadataRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getAppMetadataRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetAppMetadataRequestPayload { + app: AppIdentifier; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getAppMetadata request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetAppMetadataResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetAppMetadataResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetAppMetadataResponsePayload { + error?: FindInstancesErrors; + appMetadata?: AppMetadata; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to return the Channel object for the current User channel membership. Returns + * `null` if the app is not joined to a channel. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetCurrentChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetCurrentChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getCurrentChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetCurrentChannelRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getCurrentChannel request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetCurrentChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetCurrentChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getCurrentChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetCurrentChannelResponsePayload { + error?: ResponsePayloadError; + channel?: Channel | null; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to return the current context (either of a specified type or most recent + * broadcast) of a specified Channel. Returns `null` if no context (of the requested type if + * one was specified) is available in the channel. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetCurrentContextRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetCurrentContextRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getCurrentContextRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetCurrentContextRequestPayload { + /** + * The id of the channel to return the current context of + */ + channelId: string; + /** + * The type of context to return for OR `null` indicating that the most recently broadcast + * context on the channel should be returned. + */ + contextType: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getCurrentContext request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetCurrentContextResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetCurrentContextResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getCurrentContextResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetCurrentContextResponsePayload { + error?: PurpleError; + /** + * The most recently broadcast context object (of the specified type, if one was specified), + * or `null` if none was available in the channel + */ + context?: null | Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to retrieve information about the FDC3 Desktop Agent implementation and the + * metadata of the calling application according to the desktop agent. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetInfoRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetInfoRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getInfoRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetInfoRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getInfo request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetInfoResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetInfoResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getInfoResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetInfoResponsePayload { + error?: ResponsePayloadError; + implementationMetadata?: ImplementationMetadata; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to return a Channel with an auto-generated identity that is intended for private + * communication between applications. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetOrCreateChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetOrCreateChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getOrCreateChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetOrCreateChannelRequestPayload { + /** + * The id of the channel to return + */ + channelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getOrCreateChannel request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetOrCreateChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetOrCreateChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getOrCreateChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetOrCreateChannelResponsePayload { + error?: PurpleError; + channel?: Channel; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to retrieve a list of the User Channels available for the app to join. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface GetUserChannelsRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetUserChannelsRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getUserChannelsRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetUserChannelsRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a getUserChannels request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface GetUserChannelsResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: GetUserChannelsResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getUserChannelsResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface GetUserChannelsResponsePayload { + error?: PurpleError; + userChannels?: Channel[]; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Message from the channel selector UI to the DA proxy when the user drags the selector to + * a new location. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeChannelDrag { + /** + * The message payload + */ + payload: IframeChannelDragPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeChannelDrag"; +} + +/** + * The message payload + */ +export interface IframeChannelDragPayload { + /** + * The offset to move the frame by + */ + mouse: MouseClass; +} + +/** + * The offset to move the frame by + */ +export interface MouseClass { + offsetX: number; + offsetY: number; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Message from the channel selector UI to the DA proxy when the user hits a toggle button + * that opens or closes the selector or otherwise resizes it. Includes the size that it + * should change to and the corner (if any) at which the change should be made. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeChannelResize { + /** + * The message payload + */ + payload: IframeChannelResizePayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeChannelResize"; +} + +/** + * The message payload + */ +export interface IframeChannelResizePayload { + /** + * The updated dimensions of the UI + */ + dimensions: DimensionsClass; + /** + * When resizing anchor at the indicated location, + * e.g. + * - for top-left and a larger size: the bottom right corner should move down and out. + * - for top and smaller size: both the bottom corners should move in and up. + */ + resizeAnchor: Resizing; +} + +/** + * The updated dimensions of the UI + */ +export interface DimensionsClass { + height: number; + width: number; +} + +/** + * When resizing anchor at the indicated location, + * e.g. + * - for top-left and a larger size: the bottom right corner should move down and out. + * - for top and smaller size: both the bottom corners should move in and up. + */ +export type Resizing = "top-left" | "top" | "top-right" | "right" | "bottom-right" | "bottom" | "bottom-left" | "left" | "center"; + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Message from the channel selector UI to the DA proxy sent when the channel selection + * changes. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeChannelSelected { + /** + * The message payload + */ + payload: IframeChannelSelectedPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeChannelSelected"; +} + +/** + * The message payload + */ +export interface IframeChannelSelectedPayload { + /** + * The id of the channel that should be currently selected, or `null` if none should be + * selected + */ + selected: null | string; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Setup message sent by the DA proxy code in getAgent() to a channel selector UI in an + * iframe with the channel definitions and current channel selection. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeChannels { + /** + * The message payload + */ + payload: IframeChannelsPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeChannels"; +} + +/** + * The message payload + */ +export interface IframeChannelsPayload { + /** + * If the channel selector was previously displayed in this window its location may be + * restored by setting the location coordinates + */ + location?: Location; + /** + * The id of the channel that should be currently selected, or `null` if none should be + * selected + */ + selected: null | string; + /** + * User Channel definitions + */ + userChannels: Channel[]; +} + +/** + * If the channel selector was previously displayed in this window its location may be + * restored by setting the location coordinates + */ +export interface Location { + x: number; + y: number; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Handshake message sent back by an iframe to the DA proxy code indicating that it is setup + * and ready to communicate over the MessagePort. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeHandshake { + /** + * The message payload + */ + payload: IframeHandshakePayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeHandshake"; +} + +/** + * The message payload + */ +export interface IframeHandshakePayload { + /** + * Details about the UI implementation in the iframe, such as vendor and version, for + * logging purposes. + */ + implementationDetails: string; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Hello message sent by the DA proxy code in getAgent() to an iframe, that it has injected + * into the page, with a MessagePort appended that should be used for subsequent + * communication steps. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeHello { + /** + * The message payload + */ + payload: IframeHelloPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeHello"; +} + +/** + * The message payload + */ +export interface IframeHelloPayload { + /** + * The version of FDC3 API that the Desktop Agent proxy is providing support for. + */ + fdc3Version: string; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeMessage { + /** + * The message payload + */ + payload?: { [key: string]: any }; + /** + * Identifies the type of the message to or from the iframe. + */ + type: IframeMessageType; +} + +/** + * Identifies the type of the message to or from the iframe. + */ +export type IframeMessageType = "iframeHello" | "iframeHandshake" | "iframeResolve" | "iframeResolveAction" | "iframeChannels" | "iframeChannelSelected" | "iframeChannelResize" | "iframeChannelDrag"; + +/** + * Setup message sent by the DA proxy code in getAgent() to an intent resolver UI in an + * iframe with the resolver data to setup the UI. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeResolve { + /** + * The message payload + */ + payload: IframeResolvePayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeResolve"; +} + +/** + * The message payload + */ +export interface IframeResolvePayload { + /** + * An array of AppIntent objects defining the resolution options. + */ + appIntents: AppIntent[]; + context: Context; +} + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * Message from an intent resolver UI in an iframe to DA proxy code in getAgent() reporting + * a user action. + * + * A message used to communicate with iframes injected by `getAgent()` for displaying UI + * elements such as the intent resolver or channel selector. Used for messages sent in + * either direction. + */ +export interface IframeResolveAction { + /** + * The message payload + */ + payload: IframeResolveActionPayload; + /** + * Identifies the type of the message to or from the iframe. + */ + type: "iframeResolveAction"; +} + +/** + * The message payload + */ +export interface IframeResolveActionPayload { + action: Action; + /** + * The App resolution option chosen + */ + appIdentifier?: AppIdentifier; + /** + * The intent resolved + */ + intent?: string; +} + +export type Action = "hover" | "click" | "cancel"; + +/** + * Identifies the type of the message to or from the iframe. + */ + +/** + * An event message from the Desktop Agent to an app indicating that it has been selected to + * resolve a raised intent and context. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface IntentEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: IntentEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "intentEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface IntentEventPayload { + /** + * The context object passed with the raised intent. + */ + context: Context; + /** + * The intent that was raised. + */ + intent: string; + /** + * Details of the application instance that raised the intent + */ + originatingApp?: AppIdentifier; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to unsubscribe a context listener. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface IntentListenerUnsubscribeRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: IntentListenerUnsubscribeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "intentListenerUnsubscribeRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface IntentListenerUnsubscribeRequestPayload { + listenerUUID: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a intentListenerUnsubscribe request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface IntentListenerUnsubscribeResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "intentListenerUnsubscribeResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to deliver a result for an intent (which may include a `void` result that just + * indicates that the handler has run, returning no result). + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface IntentResultRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: IntentResultRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "intentResultRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface IntentResultRequestPayload { + intentResult: PurpleIntentResult; +} + +export interface PurpleIntentResult { + context?: Context; + channel?: Channel; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a request to deliver an intent result. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface IntentResultResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "intentResultResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to join the app to the specified User channel. On successfully joining a channel, + * client code should make subsequent requests to get the current context of that channel + * for all registered context listeners and then call their handlers with it. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface JoinUserChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: JoinUserChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "joinUserChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface JoinUserChannelRequestPayload { + /** + * The id of the channel to join + */ + channelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a joinUserChannel request. On receipt of this response, client code should + * make subsequent requests to get the current context of that channel for all registered + * context listeners and then call their handlers with it. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface JoinUserChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: JoinUserChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "joinUserChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface JoinUserChannelResponsePayload { + error?: PurpleError; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request to remove the app from any User channel membership. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface LeaveCurrentChannelRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: LeaveCurrentChannelRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "leaveCurrentChannelRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface LeaveCurrentChannelRequestPayload { +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a leaveCurrentChannel request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface LeaveCurrentChannelResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: LeaveCurrentChannelResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "leaveCurrentChannelResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface LeaveCurrentChannelResponsePayload { + error?: PurpleError; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to open an application. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface OpenRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: OpenRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "openRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface OpenRequestPayload { + app: AppIdentifier; + /** + * If a Context object is passed in, this object will be provided to the opened application + * via a contextListener. The Context argument is functionally equivalent to opening the + * target app with no context and broadcasting the context directly to it. + */ + context?: Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a open request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface OpenResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: OpenResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface OpenResponsePayload { + error?: OpenErrorResponsePayload; + appIdentifier?: AppIdentifier; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type OpenErrorResponsePayload = "MalformedContext" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * Request that indicates that a participant will no longer interact with a specified + * `PrivateChannel`. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface PrivateChannelDisconnectRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelDisconnectRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "privateChannelDisconnectRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelDisconnectRequestPayload { + /** + * The Id of the Channel that should be disconnected from + */ + channelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a privateChannelDisconnect request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface PrivateChannelDisconnectResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: PrivateChannelDisconnectResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelDisconnectResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface PrivateChannelDisconnectResponsePayload { + error?: PurpleError; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app indicating that another app has added a + * context listener to a specific PrivateChannel. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface PrivateChannelOnAddContextListenerEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: PrivateChannelOnAddContextListenerEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelOnAddContextListenerEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface PrivateChannelOnAddContextListenerEventPayload { + /** + * The type of the context listener added to the channel by another app, or null if it will + * listen to all types. + */ + contextType: null | string; + /** + * The Id of the PrivateChannel that the listener was added to. + */ + privateChannelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app indicating that another app has + * disconnected from a specific PrivateChannel and will no longer interact with it. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface PrivateChannelOnDisconnectEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: PrivateChannelOnDisconnectEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelOnDisconnectEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface PrivateChannelOnDisconnectEventPayload { + /** + * The Id of the PrivateChannel that the app has disconnected from. + */ + privateChannelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * An event message from the Desktop Agent to an app indicating that another app has + * unsubscribed a context listener from a specific PrivateChannel. + * + * A message from a Desktop Agent to an FDC3-enabled app representing an event. + */ +export interface PrivateChannelOnUnsubscribeEvent { + /** + * Metadata for messages sent by a Desktop Agent to an App notifying it of an event. + */ + meta: AddEventListenerEventMeta; + /** + * The message payload contains details of the event that the app is being notified about. + */ + payload: PrivateChannelOnUnsubscribeEventPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelOnUnsubscribeEvent"; +} + +/** + * The message payload contains details of the event that the app is being notified about. + */ +export interface PrivateChannelOnUnsubscribeEventPayload { + /** + * The type of the context listener unsubscribed from the channel by another app, or null if + * it was listening to all types. + */ + contextType: null | string; + /** + * The Id of the PrivateChannel that the listener was unsubscribed from. + */ + privateChannelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to unsubscribe a context listener. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface PrivateChannelUnsubscribeEventListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelUnsubscribeEventListenerRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "privateChannelUnsubscribeEventListenerRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelUnsubscribeEventListenerRequestPayload { + listenerUUID: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a privateChannelUnsubscribeEventListener request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface PrivateChannelUnsubscribeEventListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: BroadcastResponseResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelUnsubscribeEventListenerResponse"; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to add an event listener to a specific PrivateChannel. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface PrivateChannelAddEventListenerRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: TPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "privateChannelAddEventListenerRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface TPayload { + /** + * The type of PrivateChannel event that the listener should be applied to. + */ + listenerType: PrivateChannelEventListenerTypes; + /** + * The Id of the PrivateChannel that the listener should be added to. + */ + privateChannelId: string; +} + +/** + * The type of PrivateChannel event that the listener should be applied to. + * + * Event listener type names for Private Channel events + */ +export type PrivateChannelEventListenerTypes = "onAddContextListener" | "onUnsubscribe" | "onDisconnect"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a privateChannelAddEventListener request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface PrivateChannelAddEventListenerResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: PrivateChannelAddEventListenerResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "privateChannelAddEventListenerResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface PrivateChannelAddEventListenerResponsePayload { + error?: PurpleError; + listenerUUID?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to raise an unspecified intent for a specified context. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface RaiseIntentForContextRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: RaiseIntentForContextRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "raiseIntentForContextRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface RaiseIntentForContextRequestPayload { + app?: AppIdentifier; + context: Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a raiseIntentForContext request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface RaiseIntentForContextResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * There are 3 possible responses to a raiseIntentForContext request, each of which sets a + * single property in the payload: Success (`intentResolution`), Needs further resolution + * (`appIntents`) or Error (`error`). + */ + payload: RaiseIntentForContextResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentForContextResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * There are 3 possible responses to a raiseIntentForContext request, each of which sets a + * single property in the payload: Success (`intentResolution`), Needs further resolution + * (`appIntents`) or Error (`error`). + * + * Response to a raiseIntentForContext request that needs additional resolution (i.e. show + * an intent resolver UI) + * + * Used if a raiseIntent request resulted in an error + */ +export interface RaiseIntentForContextResponsePayload { + /** + * Should be set if the raiseIntent request returned an error. + */ + error?: FindInstancesErrors; + /** + * Used if the raiseIntent request was successfully resolved + */ + intentResolution?: IntentResolution; + /** + * Used if a raiseIntentForContext request requires additional resolution (e.g. by showing + * an intent resolver) before it can be handled. + */ + appIntents?: AppIntent[]; +} + +/** + * Used if the raiseIntent request was successfully resolved + * + * IntentResolution provides a standard format for data returned upon resolving an intent. + * + * ```javascript + * //resolve a "Chain" type intent + * let resolution = await agent.raiseIntent("intentName", context); + * + * //resolve a "Client-Service" type intent with a data response or a Channel + * let resolution = await agent.raiseIntent("intentName", context); + * try { + * const result = await resolution.getResult(); + * if (result && result.broadcast) { + * console.log(`${resolution.source} returned a channel with id ${result.id}`); + * } else if (result){ + * console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`); + * } else { + * console.error(`${resolution.source} didn't return data` + * } + * } catch(error) { + * console.error(`${resolution.source} returned an error: ${error}`); + * } + * + * // Use metadata about the resolving app instance to target a further intent + * await agent.raiseIntent("intentName", context, resolution.source); + * ``` + */ +export interface IntentResolution { + /** + * The intent that was raised. May be used to determine which intent the user + * chose in response to `fdc3.raiseIntentForContext()`. + */ + intent: string; + /** + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ + source: AppIdentifier; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A request to raise an intent for a context. + * + * A request message from an FDC3-enabled app to a Desktop Agent. + */ +export interface RaiseIntentRequest { + /** + * Metadata for a request message sent by an FDC3-enabled app to a Desktop Agent. + */ + meta: AddContextListenerRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: RaiseIntentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "raiseIntentRequest"; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface RaiseIntentRequestPayload { + app?: AppIdentifier; + context: Context; + intent: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + +/** + * A response to a raiseIntent request. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface RaiseIntentResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * There are 3 possible responses to a raiseIntent request, each of which sets a single + * property in the payload: Success (`intentResolution`), Needs further resolution + * (`appIntent`) or Error (`error`). + */ + payload: RaiseIntentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + * + * There are 3 possible responses to a raiseIntent request, each of which sets a single + * property in the payload: Success (`intentResolution`), Needs further resolution + * (`appIntent`) or Error (`error`). + * + * Response to a raiseIntent request that needs additional resolution (i.e. show an intent + * resolver UI). + * + * Used if a raiseIntent request resulted in an error + */ +export interface RaiseIntentResponsePayload { + /** + * Should be set if the raiseIntent request returned an error. + */ + error?: FindInstancesErrors; + /** + * Used if the raiseIntent request was successfully resolved + */ + intentResolution?: IntentResolution; + /** + * Used if a raiseIntent request requires additional resolution (e.g. by showing an intent + * resolver) before it can be handled. + */ + appIntent?: AppIntent; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +/** + * A secondary response to a request to raise an intent used to deliver the intent result. + * + * A message from a Desktop Agent to an FDC3-enabled app responding to an API call. If the + * payload contains an `error` property, the request was unsuccessful. + */ +export interface RaiseIntentResultResponse { + /** + * Metadata for messages sent by a Desktop Agent to an App in response to an API call + */ + meta: AddContextListenerResponseMeta; + /** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ + payload: RaiseIntentResultResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * A payload for a response to an API call that will contain any return values or an `error` + * property containing a standardized error message indicating that the request was + * unsuccessful. + */ +export interface RaiseIntentResultResponsePayload { + error?: ResponsePayloadError; + intentResult?: FluffyIntentResult; +} + +export interface FluffyIntentResult { + context?: Context; + channel?: Channel; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + +// Converts JSON strings to/from your types +// and asserts the results of JSON.parse at runtime +export class Convert { + public static toWebConnectionProtocol1Hello(json: string): WebConnectionProtocol1Hello { + return cast(JSON.parse(json), r("WebConnectionProtocol1Hello")); + } + + public static webConnectionProtocol1HelloToJson(value: WebConnectionProtocol1Hello): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol1Hello")), null, 2); + } + + public static toWebConnectionProtocol2LoadURL(json: string): WebConnectionProtocol2LoadURL { + return cast(JSON.parse(json), r("WebConnectionProtocol2LoadURL")); + } + + public static webConnectionProtocol2LoadURLToJson(value: WebConnectionProtocol2LoadURL): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol2LoadURL")), null, 2); + } + + public static toWebConnectionProtocol3Handshake(json: string): WebConnectionProtocol3Handshake { + return cast(JSON.parse(json), r("WebConnectionProtocol3Handshake")); + } + + public static webConnectionProtocol3HandshakeToJson(value: WebConnectionProtocol3Handshake): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol3Handshake")), null, 2); + } + + public static toWebConnectionProtocol4ValidateAppIdentity(json: string): WebConnectionProtocol4ValidateAppIdentity { + return cast(JSON.parse(json), r("WebConnectionProtocol4ValidateAppIdentity")); + } + + public static webConnectionProtocol4ValidateAppIdentityToJson(value: WebConnectionProtocol4ValidateAppIdentity): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol4ValidateAppIdentity")), null, 2); + } + + public static toWebConnectionProtocol5ValidateAppIdentityFailedResponse(json: string): WebConnectionProtocol5ValidateAppIdentityFailedResponse { + return cast(JSON.parse(json), r("WebConnectionProtocol5ValidateAppIdentityFailedResponse")); + } + + public static webConnectionProtocol5ValidateAppIdentityFailedResponseToJson(value: WebConnectionProtocol5ValidateAppIdentityFailedResponse): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol5ValidateAppIdentityFailedResponse")), null, 2); + } + + public static toWebConnectionProtocol5ValidateAppIdentitySuccessResponse(json: string): WebConnectionProtocol5ValidateAppIdentitySuccessResponse { + return cast(JSON.parse(json), r("WebConnectionProtocol5ValidateAppIdentitySuccessResponse")); + } + + public static webConnectionProtocol5ValidateAppIdentitySuccessResponseToJson(value: WebConnectionProtocol5ValidateAppIdentitySuccessResponse): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol5ValidateAppIdentitySuccessResponse")), null, 2); + } + + public static toWebConnectionProtocol6Goodbye(json: string): WebConnectionProtocol6Goodbye { + return cast(JSON.parse(json), r("WebConnectionProtocol6Goodbye")); + } + + public static webConnectionProtocol6GoodbyeToJson(value: WebConnectionProtocol6Goodbye): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocol6Goodbye")), null, 2); + } + + public static toWebConnectionProtocolMessage(json: string): WebConnectionProtocolMessage { + return cast(JSON.parse(json), r("WebConnectionProtocolMessage")); + } + + public static webConnectionProtocolMessageToJson(value: WebConnectionProtocolMessage): string { + return JSON.stringify(uncast(value, r("WebConnectionProtocolMessage")), null, 2); + } + + public static toAddContextListenerRequest(json: string): AddContextListenerRequest { + return cast(JSON.parse(json), r("AddContextListenerRequest")); + } + + public static addContextListenerRequestToJson(value: AddContextListenerRequest): string { + return JSON.stringify(uncast(value, r("AddContextListenerRequest")), null, 2); + } + + public static toAddContextListenerResponse(json: string): AddContextListenerResponse { + return cast(JSON.parse(json), r("AddContextListenerResponse")); + } + + public static addContextListenerResponseToJson(value: AddContextListenerResponse): string { + return JSON.stringify(uncast(value, r("AddContextListenerResponse")), null, 2); + } + + public static toAddEventListenerEvent(json: string): AddEventListenerEvent { + return cast(JSON.parse(json), r("AddEventListenerEvent")); + } + + public static addEventListenerEventToJson(value: AddEventListenerEvent): string { + return JSON.stringify(uncast(value, r("AddEventListenerEvent")), null, 2); + } + + public static toAddEventListenerRequest(json: string): AddEventListenerRequest { + return cast(JSON.parse(json), r("AddEventListenerRequest")); + } + + public static addEventListenerRequestToJson(value: AddEventListenerRequest): string { + return JSON.stringify(uncast(value, r("AddEventListenerRequest")), null, 2); + } + + public static toAddEventListenerResponse(json: string): AddEventListenerResponse { + return cast(JSON.parse(json), r("AddEventListenerResponse")); + } + + public static addEventListenerResponseToJson(value: AddEventListenerResponse): string { + return JSON.stringify(uncast(value, r("AddEventListenerResponse")), null, 2); + } + + public static toAddIntentListenerRequest(json: string): AddIntentListenerRequest { + return cast(JSON.parse(json), r("AddIntentListenerRequest")); + } + + public static addIntentListenerRequestToJson(value: AddIntentListenerRequest): string { + return JSON.stringify(uncast(value, r("AddIntentListenerRequest")), null, 2); + } + + public static toAddIntentListenerResponse(json: string): AddIntentListenerResponse { + return cast(JSON.parse(json), r("AddIntentListenerResponse")); + } + + public static addIntentListenerResponseToJson(value: AddIntentListenerResponse): string { + return JSON.stringify(uncast(value, r("AddIntentListenerResponse")), null, 2); + } + + public static toAgentEventMessage(json: string): AgentEventMessage { + return cast(JSON.parse(json), r("AgentEventMessage")); + } + + public static agentEventMessageToJson(value: AgentEventMessage): string { + return JSON.stringify(uncast(value, r("AgentEventMessage")), null, 2); + } + + public static toAgentResponseMessage(json: string): AgentResponseMessage { + return cast(JSON.parse(json), r("AgentResponseMessage")); + } + + public static agentResponseMessageToJson(value: AgentResponseMessage): string { + return JSON.stringify(uncast(value, r("AgentResponseMessage")), null, 2); + } + + public static toAppRequestMessage(json: string): AppRequestMessage { + return cast(JSON.parse(json), r("AppRequestMessage")); + } + + public static appRequestMessageToJson(value: AppRequestMessage): string { + return JSON.stringify(uncast(value, r("AppRequestMessage")), null, 2); + } + + public static toBroadcastEvent(json: string): BroadcastEvent { + return cast(JSON.parse(json), r("BroadcastEvent")); + } + + public static broadcastEventToJson(value: BroadcastEvent): string { + return JSON.stringify(uncast(value, r("BroadcastEvent")), null, 2); + } + + public static toBroadcastRequest(json: string): BroadcastRequest { + return cast(JSON.parse(json), r("BroadcastRequest")); + } + + public static broadcastRequestToJson(value: BroadcastRequest): string { + return JSON.stringify(uncast(value, r("BroadcastRequest")), null, 2); + } + + public static toBroadcastResponse(json: string): BroadcastResponse { + return cast(JSON.parse(json), r("BroadcastResponse")); + } + + public static broadcastResponseToJson(value: BroadcastResponse): string { + return JSON.stringify(uncast(value, r("BroadcastResponse")), null, 2); + } + + public static toChannelChangedEvent(json: string): ChannelChangedEvent { + return cast(JSON.parse(json), r("ChannelChangedEvent")); + } + + public static channelChangedEventToJson(value: ChannelChangedEvent): string { + return JSON.stringify(uncast(value, r("ChannelChangedEvent")), null, 2); + } + + public static toContextListenerUnsubscribeRequest(json: string): ContextListenerUnsubscribeRequest { + return cast(JSON.parse(json), r("ContextListenerUnsubscribeRequest")); + } + + public static contextListenerUnsubscribeRequestToJson(value: ContextListenerUnsubscribeRequest): string { + return JSON.stringify(uncast(value, r("ContextListenerUnsubscribeRequest")), null, 2); + } + + public static toContextListenerUnsubscribeResponse(json: string): ContextListenerUnsubscribeResponse { + return cast(JSON.parse(json), r("ContextListenerUnsubscribeResponse")); + } + + public static contextListenerUnsubscribeResponseToJson(value: ContextListenerUnsubscribeResponse): string { + return JSON.stringify(uncast(value, r("ContextListenerUnsubscribeResponse")), null, 2); + } + + public static toCreatePrivateChannelRequest(json: string): CreatePrivateChannelRequest { + return cast(JSON.parse(json), r("CreatePrivateChannelRequest")); + } + + public static createPrivateChannelRequestToJson(value: CreatePrivateChannelRequest): string { + return JSON.stringify(uncast(value, r("CreatePrivateChannelRequest")), null, 2); + } + + public static toCreatePrivateChannelResponse(json: string): CreatePrivateChannelResponse { + return cast(JSON.parse(json), r("CreatePrivateChannelResponse")); + } + + public static createPrivateChannelResponseToJson(value: CreatePrivateChannelResponse): string { + return JSON.stringify(uncast(value, r("CreatePrivateChannelResponse")), null, 2); + } + + public static toEventListenerUnsubscribeRequest(json: string): EventListenerUnsubscribeRequest { + return cast(JSON.parse(json), r("EventListenerUnsubscribeRequest")); + } + + public static eventListenerUnsubscribeRequestToJson(value: EventListenerUnsubscribeRequest): string { + return JSON.stringify(uncast(value, r("EventListenerUnsubscribeRequest")), null, 2); + } + + public static toEventListenerUnsubscribeResponse(json: string): EventListenerUnsubscribeResponse { + return cast(JSON.parse(json), r("EventListenerUnsubscribeResponse")); + } + + public static eventListenerUnsubscribeResponseToJson(value: EventListenerUnsubscribeResponse): string { + return JSON.stringify(uncast(value, r("EventListenerUnsubscribeResponse")), null, 2); + } + + public static toFindInstancesRequest(json: string): FindInstancesRequest { + return cast(JSON.parse(json), r("FindInstancesRequest")); + } + + public static findInstancesRequestToJson(value: FindInstancesRequest): string { + return JSON.stringify(uncast(value, r("FindInstancesRequest")), null, 2); + } + + public static toFindInstancesResponse(json: string): FindInstancesResponse { + return cast(JSON.parse(json), r("FindInstancesResponse")); + } + + public static findInstancesResponseToJson(value: FindInstancesResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesResponse")), null, 2); + } + + public static toFindIntentRequest(json: string): FindIntentRequest { + return cast(JSON.parse(json), r("FindIntentRequest")); + } + + public static findIntentRequestToJson(value: FindIntentRequest): string { + return JSON.stringify(uncast(value, r("FindIntentRequest")), null, 2); + } + + public static toFindIntentResponse(json: string): FindIntentResponse { + return cast(JSON.parse(json), r("FindIntentResponse")); + } + + public static findIntentResponseToJson(value: FindIntentResponse): string { + return JSON.stringify(uncast(value, r("FindIntentResponse")), null, 2); + } + + public static toFindIntentsByContextRequest(json: string): FindIntentsByContextRequest { + return cast(JSON.parse(json), r("FindIntentsByContextRequest")); + } + + public static findIntentsByContextRequestToJson(value: FindIntentsByContextRequest): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextRequest")), null, 2); + } + + public static toFindIntentsByContextResponse(json: string): FindIntentsByContextResponse { + return cast(JSON.parse(json), r("FindIntentsByContextResponse")); + } + + public static findIntentsByContextResponseToJson(value: FindIntentsByContextResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextResponse")), null, 2); + } + + public static toGetAppMetadataRequest(json: string): GetAppMetadataRequest { + return cast(JSON.parse(json), r("GetAppMetadataRequest")); + } + + public static getAppMetadataRequestToJson(value: GetAppMetadataRequest): string { + return JSON.stringify(uncast(value, r("GetAppMetadataRequest")), null, 2); + } + + public static toGetAppMetadataResponse(json: string): GetAppMetadataResponse { + return cast(JSON.parse(json), r("GetAppMetadataResponse")); + } + + public static getAppMetadataResponseToJson(value: GetAppMetadataResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataResponse")), null, 2); + } + + public static toGetCurrentChannelRequest(json: string): GetCurrentChannelRequest { + return cast(JSON.parse(json), r("GetCurrentChannelRequest")); + } + + public static getCurrentChannelRequestToJson(value: GetCurrentChannelRequest): string { + return JSON.stringify(uncast(value, r("GetCurrentChannelRequest")), null, 2); + } + + public static toGetCurrentChannelResponse(json: string): GetCurrentChannelResponse { + return cast(JSON.parse(json), r("GetCurrentChannelResponse")); + } + + public static getCurrentChannelResponseToJson(value: GetCurrentChannelResponse): string { + return JSON.stringify(uncast(value, r("GetCurrentChannelResponse")), null, 2); + } + + public static toGetCurrentContextRequest(json: string): GetCurrentContextRequest { + return cast(JSON.parse(json), r("GetCurrentContextRequest")); + } + + public static getCurrentContextRequestToJson(value: GetCurrentContextRequest): string { + return JSON.stringify(uncast(value, r("GetCurrentContextRequest")), null, 2); + } + + public static toGetCurrentContextResponse(json: string): GetCurrentContextResponse { + return cast(JSON.parse(json), r("GetCurrentContextResponse")); + } + + public static getCurrentContextResponseToJson(value: GetCurrentContextResponse): string { + return JSON.stringify(uncast(value, r("GetCurrentContextResponse")), null, 2); + } + + public static toGetInfoRequest(json: string): GetInfoRequest { + return cast(JSON.parse(json), r("GetInfoRequest")); + } + + public static getInfoRequestToJson(value: GetInfoRequest): string { + return JSON.stringify(uncast(value, r("GetInfoRequest")), null, 2); + } + + public static toGetInfoResponse(json: string): GetInfoResponse { + return cast(JSON.parse(json), r("GetInfoResponse")); + } + + public static getInfoResponseToJson(value: GetInfoResponse): string { + return JSON.stringify(uncast(value, r("GetInfoResponse")), null, 2); + } + + public static toGetOrCreateChannelRequest(json: string): GetOrCreateChannelRequest { + return cast(JSON.parse(json), r("GetOrCreateChannelRequest")); + } + + public static getOrCreateChannelRequestToJson(value: GetOrCreateChannelRequest): string { + return JSON.stringify(uncast(value, r("GetOrCreateChannelRequest")), null, 2); + } + + public static toGetOrCreateChannelResponse(json: string): GetOrCreateChannelResponse { + return cast(JSON.parse(json), r("GetOrCreateChannelResponse")); + } + + public static getOrCreateChannelResponseToJson(value: GetOrCreateChannelResponse): string { + return JSON.stringify(uncast(value, r("GetOrCreateChannelResponse")), null, 2); + } + + public static toGetUserChannelsRequest(json: string): GetUserChannelsRequest { + return cast(JSON.parse(json), r("GetUserChannelsRequest")); + } + + public static getUserChannelsRequestToJson(value: GetUserChannelsRequest): string { + return JSON.stringify(uncast(value, r("GetUserChannelsRequest")), null, 2); + } + + public static toGetUserChannelsResponse(json: string): GetUserChannelsResponse { + return cast(JSON.parse(json), r("GetUserChannelsResponse")); + } + + public static getUserChannelsResponseToJson(value: GetUserChannelsResponse): string { + return JSON.stringify(uncast(value, r("GetUserChannelsResponse")), null, 2); + } + + public static toIframeChannelDrag(json: string): IframeChannelDrag { + return cast(JSON.parse(json), r("IframeChannelDrag")); + } + + public static iframeChannelDragToJson(value: IframeChannelDrag): string { + return JSON.stringify(uncast(value, r("IframeChannelDrag")), null, 2); + } + + public static toIframeChannelResize(json: string): IframeChannelResize { + return cast(JSON.parse(json), r("IframeChannelResize")); + } + + public static iframeChannelResizeToJson(value: IframeChannelResize): string { + return JSON.stringify(uncast(value, r("IframeChannelResize")), null, 2); + } + + public static toIframeChannelSelected(json: string): IframeChannelSelected { + return cast(JSON.parse(json), r("IframeChannelSelected")); + } + + public static iframeChannelSelectedToJson(value: IframeChannelSelected): string { + return JSON.stringify(uncast(value, r("IframeChannelSelected")), null, 2); + } + + public static toIframeChannels(json: string): IframeChannels { + return cast(JSON.parse(json), r("IframeChannels")); + } + + public static iframeChannelsToJson(value: IframeChannels): string { + return JSON.stringify(uncast(value, r("IframeChannels")), null, 2); + } + + public static toIframeHandshake(json: string): IframeHandshake { + return cast(JSON.parse(json), r("IframeHandshake")); + } + + public static iframeHandshakeToJson(value: IframeHandshake): string { + return JSON.stringify(uncast(value, r("IframeHandshake")), null, 2); + } + + public static toIframeHello(json: string): IframeHello { + return cast(JSON.parse(json), r("IframeHello")); + } + + public static iframeHelloToJson(value: IframeHello): string { + return JSON.stringify(uncast(value, r("IframeHello")), null, 2); + } + + public static toIframeMessage(json: string): IframeMessage { + return cast(JSON.parse(json), r("IframeMessage")); + } + + public static iframeMessageToJson(value: IframeMessage): string { + return JSON.stringify(uncast(value, r("IframeMessage")), null, 2); + } + + public static toIframeResolve(json: string): IframeResolve { + return cast(JSON.parse(json), r("IframeResolve")); + } + + public static iframeResolveToJson(value: IframeResolve): string { + return JSON.stringify(uncast(value, r("IframeResolve")), null, 2); + } + + public static toIframeResolveAction(json: string): IframeResolveAction { + return cast(JSON.parse(json), r("IframeResolveAction")); + } + + public static iframeResolveActionToJson(value: IframeResolveAction): string { + return JSON.stringify(uncast(value, r("IframeResolveAction")), null, 2); + } + + public static toIntentEvent(json: string): IntentEvent { + return cast(JSON.parse(json), r("IntentEvent")); + } + + public static intentEventToJson(value: IntentEvent): string { + return JSON.stringify(uncast(value, r("IntentEvent")), null, 2); + } + + public static toIntentListenerUnsubscribeRequest(json: string): IntentListenerUnsubscribeRequest { + return cast(JSON.parse(json), r("IntentListenerUnsubscribeRequest")); + } + + public static intentListenerUnsubscribeRequestToJson(value: IntentListenerUnsubscribeRequest): string { + return JSON.stringify(uncast(value, r("IntentListenerUnsubscribeRequest")), null, 2); + } + + public static toIntentListenerUnsubscribeResponse(json: string): IntentListenerUnsubscribeResponse { + return cast(JSON.parse(json), r("IntentListenerUnsubscribeResponse")); + } + + public static intentListenerUnsubscribeResponseToJson(value: IntentListenerUnsubscribeResponse): string { + return JSON.stringify(uncast(value, r("IntentListenerUnsubscribeResponse")), null, 2); + } + + public static toIntentResultRequest(json: string): IntentResultRequest { + return cast(JSON.parse(json), r("IntentResultRequest")); + } + + public static intentResultRequestToJson(value: IntentResultRequest): string { + return JSON.stringify(uncast(value, r("IntentResultRequest")), null, 2); + } + + public static toIntentResultResponse(json: string): IntentResultResponse { + return cast(JSON.parse(json), r("IntentResultResponse")); + } + + public static intentResultResponseToJson(value: IntentResultResponse): string { + return JSON.stringify(uncast(value, r("IntentResultResponse")), null, 2); + } + + public static toJoinUserChannelRequest(json: string): JoinUserChannelRequest { + return cast(JSON.parse(json), r("JoinUserChannelRequest")); + } + + public static joinUserChannelRequestToJson(value: JoinUserChannelRequest): string { + return JSON.stringify(uncast(value, r("JoinUserChannelRequest")), null, 2); + } + + public static toJoinUserChannelResponse(json: string): JoinUserChannelResponse { + return cast(JSON.parse(json), r("JoinUserChannelResponse")); + } + + public static joinUserChannelResponseToJson(value: JoinUserChannelResponse): string { + return JSON.stringify(uncast(value, r("JoinUserChannelResponse")), null, 2); + } + + public static toLeaveCurrentChannelRequest(json: string): LeaveCurrentChannelRequest { + return cast(JSON.parse(json), r("LeaveCurrentChannelRequest")); + } + + public static leaveCurrentChannelRequestToJson(value: LeaveCurrentChannelRequest): string { + return JSON.stringify(uncast(value, r("LeaveCurrentChannelRequest")), null, 2); + } + + public static toLeaveCurrentChannelResponse(json: string): LeaveCurrentChannelResponse { + return cast(JSON.parse(json), r("LeaveCurrentChannelResponse")); + } + + public static leaveCurrentChannelResponseToJson(value: LeaveCurrentChannelResponse): string { + return JSON.stringify(uncast(value, r("LeaveCurrentChannelResponse")), null, 2); + } + + public static toOpenRequest(json: string): OpenRequest { + return cast(JSON.parse(json), r("OpenRequest")); + } + + public static openRequestToJson(value: OpenRequest): string { + return JSON.stringify(uncast(value, r("OpenRequest")), null, 2); + } + + public static toOpenResponse(json: string): OpenResponse { + return cast(JSON.parse(json), r("OpenResponse")); + } + + public static openResponseToJson(value: OpenResponse): string { + return JSON.stringify(uncast(value, r("OpenResponse")), null, 2); + } + + public static toPrivateChannelDisconnectRequest(json: string): PrivateChannelDisconnectRequest { + return cast(JSON.parse(json), r("PrivateChannelDisconnectRequest")); + } + + public static privateChannelDisconnectRequestToJson(value: PrivateChannelDisconnectRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelDisconnectRequest")), null, 2); + } + + public static toPrivateChannelDisconnectResponse(json: string): PrivateChannelDisconnectResponse { + return cast(JSON.parse(json), r("PrivateChannelDisconnectResponse")); + } + + public static privateChannelDisconnectResponseToJson(value: PrivateChannelDisconnectResponse): string { + return JSON.stringify(uncast(value, r("PrivateChannelDisconnectResponse")), null, 2); + } + + public static toPrivateChannelOnAddContextListenerEvent(json: string): PrivateChannelOnAddContextListenerEvent { + return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerEvent")); + } + + public static privateChannelOnAddContextListenerEventToJson(value: PrivateChannelOnAddContextListenerEvent): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerEvent")), null, 2); + } + + public static toPrivateChannelOnDisconnectEvent(json: string): PrivateChannelOnDisconnectEvent { + return cast(JSON.parse(json), r("PrivateChannelOnDisconnectEvent")); + } + + public static privateChannelOnDisconnectEventToJson(value: PrivateChannelOnDisconnectEvent): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectEvent")), null, 2); + } + + public static toPrivateChannelOnUnsubscribeEvent(json: string): PrivateChannelOnUnsubscribeEvent { + return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeEvent")); + } + + public static privateChannelOnUnsubscribeEventToJson(value: PrivateChannelOnUnsubscribeEvent): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeEvent")), null, 2); + } + + public static toPrivateChannelUnsubscribeEventListenerRequest(json: string): PrivateChannelUnsubscribeEventListenerRequest { + return cast(JSON.parse(json), r("PrivateChannelUnsubscribeEventListenerRequest")); + } + + public static privateChannelUnsubscribeEventListenerRequestToJson(value: PrivateChannelUnsubscribeEventListenerRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelUnsubscribeEventListenerRequest")), null, 2); + } + + public static toPrivateChannelUnsubscribeEventListenerResponse(json: string): PrivateChannelUnsubscribeEventListenerResponse { + return cast(JSON.parse(json), r("PrivateChannelUnsubscribeEventListenerResponse")); + } + + public static privateChannelUnsubscribeEventListenerResponseToJson(value: PrivateChannelUnsubscribeEventListenerResponse): string { + return JSON.stringify(uncast(value, r("PrivateChannelUnsubscribeEventListenerResponse")), null, 2); + } + + public static toPrivateChannelAddEventListenerRequest(json: string): PrivateChannelAddEventListenerRequest { + return cast(JSON.parse(json), r("PrivateChannelAddEventListenerRequest")); + } + + public static privateChannelAddEventListenerRequestToJson(value: PrivateChannelAddEventListenerRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelAddEventListenerRequest")), null, 2); + } + + public static toPrivateChannelAddEventListenerResponse(json: string): PrivateChannelAddEventListenerResponse { + return cast(JSON.parse(json), r("PrivateChannelAddEventListenerResponse")); + } + + public static privateChannelAddEventListenerResponseToJson(value: PrivateChannelAddEventListenerResponse): string { + return JSON.stringify(uncast(value, r("PrivateChannelAddEventListenerResponse")), null, 2); + } + + public static toRaiseIntentForContextRequest(json: string): RaiseIntentForContextRequest { + return cast(JSON.parse(json), r("RaiseIntentForContextRequest")); + } + + public static raiseIntentForContextRequestToJson(value: RaiseIntentForContextRequest): string { + return JSON.stringify(uncast(value, r("RaiseIntentForContextRequest")), null, 2); + } + + public static toRaiseIntentForContextResponse(json: string): RaiseIntentForContextResponse { + return cast(JSON.parse(json), r("RaiseIntentForContextResponse")); + } + + public static raiseIntentForContextResponseToJson(value: RaiseIntentForContextResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentForContextResponse")), null, 2); + } + + public static toRaiseIntentRequest(json: string): RaiseIntentRequest { + return cast(JSON.parse(json), r("RaiseIntentRequest")); + } + + public static raiseIntentRequestToJson(value: RaiseIntentRequest): string { + return JSON.stringify(uncast(value, r("RaiseIntentRequest")), null, 2); + } + + public static toRaiseIntentResponse(json: string): RaiseIntentResponse { + return cast(JSON.parse(json), r("RaiseIntentResponse")); + } + + public static raiseIntentResponseToJson(value: RaiseIntentResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResponse")), null, 2); + } + + public static toRaiseIntentResultResponse(json: string): RaiseIntentResultResponse { + return cast(JSON.parse(json), r("RaiseIntentResultResponse")); + } + + public static raiseIntentResultResponseToJson(value: RaiseIntentResultResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultResponse")), null, 2); + } +} + +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { + const prettyTyp = prettyTypeName(typ); + const parentText = parent ? ` on ${parent}` : ''; + const keyText = key ? ` for key "${key}"` : ''; + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); +} + +function prettyTypeName(typ: any): string { + if (Array.isArray(typ)) { + if (typ.length === 2 && typ[0] === undefined) { + return `an optional ${prettyTypeName(typ[1])}`; + } else { + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; + } + } else if (typeof typ === "object" && typ.literal !== undefined) { + return typ.literal; + } else { + return typeof typ; + } +} + +function jsonToJSProps(typ: any): any { + if (typ.jsonToJS === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); + typ.jsonToJS = map; + } + return typ.jsonToJS; +} + +function jsToJSONProps(typ: any): any { + if (typ.jsToJSON === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); + typ.jsToJSON = map; + } + return typ.jsToJSON; +} + +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { + function transformPrimitive(typ: string, val: any): any { + if (typeof typ === typeof val) return val; + return invalidValue(typ, val, key, parent); + } + + function transformUnion(typs: any[], val: any): any { + // val must validate against one typ in typs + const l = typs.length; + for (let i = 0; i < l; i++) { + const typ = typs[i]; + try { + return transform(val, typ, getProps); + } catch (_) {} + } + return invalidValue(typs, val, key, parent); + } + + function transformEnum(cases: string[], val: any): any { + if (cases.indexOf(val) !== -1) return val; + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); + } + + function transformArray(typ: any, val: any): any { + // val must be an array with no invalid elements + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); + return val.map(el => transform(el, typ, getProps)); + } + + function transformDate(val: any): any { + if (val === null) { + return null; + } + const d = new Date(val); + if (isNaN(d.valueOf())) { + return invalidValue(l("Date"), val, key, parent); + } + return d; + } + + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { + if (val === null || typeof val !== "object" || Array.isArray(val)) { + return invalidValue(l(ref || "object"), val, key, parent); + } + const result: any = {}; + Object.getOwnPropertyNames(props).forEach(key => { + const prop = props[key]; + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; + result[prop.key] = transform(v, prop.typ, getProps, key, ref); + }); + Object.getOwnPropertyNames(val).forEach(key => { + if (!Object.prototype.hasOwnProperty.call(props, key)) { + result[key] = transform(val[key], additional, getProps, key, ref); + } + }); + return result; + } + + if (typ === "any") return val; + if (typ === null) { + if (val === null) return val; + return invalidValue(typ, val, key, parent); + } + if (typ === false) return invalidValue(typ, val, key, parent); + let ref: any = undefined; + while (typeof typ === "object" && typ.ref !== undefined) { + ref = typ.ref; + typ = typeMap[typ.ref]; + } + if (Array.isArray(typ)) return transformEnum(typ, val); + if (typeof typ === "object") { + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) + : invalidValue(typ, val, key, parent); + } + // Numbers can be parsed by Date but shouldn't be. + if (typ === Date && typeof val !== "number") return transformDate(val); + return transformPrimitive(typ, val); +} + +function cast(val: any, typ: any): T { + return transform(val, typ, jsonToJSProps); +} + +function uncast(val: T, typ: any): any { + return transform(val, typ, jsToJSONProps); +} + +function l(typ: any) { + return { literal: typ }; +} + +function a(typ: any) { + return { arrayItems: typ }; +} + +function u(...typs: any[]) { + return { unionMembers: typs }; +} + +function o(props: any[], additional: any) { + return { props, additional }; +} + +function m(additional: any) { + return { props: [], additional }; +} + +function r(name: string) { + return { ref: name }; +} + +const typeMap: any = { + "WebConnectionProtocol1Hello": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol1HelloPayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol1HelloType") }, + ], false), + "ConnectionStepMetadata": o([ + { json: "connectionAttemptUuid", js: "connectionAttemptUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "WebConnectionProtocol1HelloPayload": o([ + { json: "channelSelector", js: "channelSelector", typ: u(undefined, true) }, + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "identityUrl", js: "identityUrl", typ: "" }, + { json: "resolver", js: "resolver", typ: u(undefined, true) }, + ], "any"), + "WebConnectionProtocol2LoadURL": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol2LoadURLPayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol2LoadURLType") }, + ], false), + "WebConnectionProtocol2LoadURLPayload": o([ + { json: "iframeUrl", js: "iframeUrl", typ: "" }, + ], "any"), + "WebConnectionProtocol3Handshake": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol3HandshakePayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol3HandshakeType") }, + ], false), + "WebConnectionProtocol3HandshakePayload": o([ + { json: "channelSelector", js: "channelSelector", typ: u(true, "") }, + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "resolver", js: "resolver", typ: u(true, "") }, + ], false), + "WebConnectionProtocol4ValidateAppIdentity": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol4ValidateAppIdentityPayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol4ValidateAppIdentityType") }, + ], false), + "WebConnectionProtocol4ValidateAppIdentityPayload": o([ + { json: "identityUrl", js: "identityUrl", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + { json: "instanceUuid", js: "instanceUuid", typ: u(undefined, "") }, + ], false), + "WebConnectionProtocol5ValidateAppIdentityFailedResponse": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol5ValidateAppIdentityFailedResponseType") }, + ], false), + "WebConnectionProtocol5ValidateAppIdentityFailedResponsePayload": o([ + { json: "message", js: "message", typ: u(undefined, "") }, + ], false), + "WebConnectionProtocol5ValidateAppIdentitySuccessResponse": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: r("WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol5ValidateAppIdentitySuccessResponseType") }, + ], false), + "WebConnectionProtocol5ValidateAppIdentitySuccessResponsePayload": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "implementationMetadata", js: "implementationMetadata", typ: r("ImplementationMetadata") }, + { json: "instanceId", js: "instanceId", typ: "" }, + { json: "instanceUuid", js: "instanceUuid", typ: "" }, + ], false), + "ImplementationMetadata": o([ + { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, + { json: "provider", js: "provider", typ: "" }, + { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, + ], false), + "AppMetadata": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "description", js: "description", typ: u(undefined, "") }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "icons", js: "icons", typ: u(undefined, a(r("Icon"))) }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + { json: "instanceMetadata", js: "instanceMetadata", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "resultType", js: "resultType", typ: u(undefined, u(null, "")) }, + { json: "screenshots", js: "screenshots", typ: u(undefined, a(r("Image"))) }, + { json: "title", js: "title", typ: u(undefined, "") }, + { json: "tooltip", js: "tooltip", typ: u(undefined, "") }, + { json: "version", js: "version", typ: u(undefined, "") }, + ], false), + "Icon": o([ + { json: "size", js: "size", typ: u(undefined, "") }, + { json: "src", js: "src", typ: "" }, + { json: "type", js: "type", typ: u(undefined, "") }, + ], false), + "Image": o([ + { json: "label", js: "label", typ: u(undefined, "") }, + { json: "size", js: "size", typ: u(undefined, "") }, + { json: "src", js: "src", typ: "" }, + { json: "type", js: "type", typ: u(undefined, "") }, + ], false), + "OptionalFeatures": o([ + { json: "DesktopAgentBridging", js: "DesktopAgentBridging", typ: true }, + { json: "OriginatingAppMetadata", js: "OriginatingAppMetadata", typ: true }, + { json: "UserChannelMembershipAPIs", js: "UserChannelMembershipAPIs", typ: true }, + ], false), + "WebConnectionProtocol6Goodbye": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("WebConnectionProtocol6GoodbyeType") }, + ], false), + "WebConnectionProtocolMessage": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("ConnectionStepMessageType") }, + ], false), + "AddContextListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("AddContextListenerRequestPayload") }, + { json: "type", js: "type", typ: r("AddContextListenerRequestType") }, + ], false), + "AddContextListenerRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AppIdentifier": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "AddContextListenerRequestPayload": o([ + { json: "channelId", js: "channelId", typ: u(null, "") }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "AddContextListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("AddContextListenerResponsePayload") }, + { json: "type", js: "type", typ: r("AddContextListenerResponseType") }, + ], false), + "AddContextListenerResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AddContextListenerResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, + ], false), + "AddEventListenerEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("AddEventListenerEventPayload") }, + { json: "type", js: "type", typ: r("AddEventListenerEventType") }, + ], false), + "AddEventListenerEventMeta": o([ + { json: "eventUuid", js: "eventUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AddEventListenerEventPayload": o([ + { json: "event", js: "event", typ: r("FDC3Event") }, + ], false), + "FDC3Event": o([ + { json: "details", js: "details", typ: m("any") }, + { json: "type", js: "type", typ: r("FDC3EventType") }, + ], false), + "AddEventListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("AddEventListenerRequestPayload") }, + { json: "type", js: "type", typ: r("AddEventListenerRequestType") }, + ], false), + "AddEventListenerRequestPayload": o([ + { json: "type", js: "type", typ: r("FDC3EventType") }, + ], false), + "AddEventListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("AddEventListenerResponsePayload") }, + { json: "type", js: "type", typ: r("AddEventListenerResponseType") }, + ], false), + "AddEventListenerResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, + ], false), + "AddIntentListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("AddIntentListenerRequestPayload") }, + { json: "type", js: "type", typ: r("AddIntentListenerRequestType") }, + ], false), + "AddIntentListenerRequestPayload": o([ + { json: "intent", js: "intent", typ: "" }, + ], false), + "AddIntentListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("AddIntentListenerResponsePayload") }, + { json: "type", js: "type", typ: r("AddIntentListenerResponseType") }, + ], false), + "AddIntentListenerResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FluffyError")) }, + { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, + ], "any"), + "AgentEventMessage": o([ + { json: "meta", js: "meta", typ: r("AgentEventMessageMeta") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("EventMessageType") }, + ], false), + "AgentEventMessageMeta": o([ + { json: "eventUuid", js: "eventUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AgentResponseMessage": o([ + { json: "meta", js: "meta", typ: r("AgentResponseMessageMeta") }, + { json: "payload", js: "payload", typ: r("AgentResponseMessageResponsePayload") }, + { json: "type", js: "type", typ: r("ResponseMessageType") }, + ], false), + "AgentResponseMessageMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "AgentResponseMessageResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + ], "any"), + "AppRequestMessage": o([ + { json: "meta", js: "meta", typ: r("AppRequestMessageMeta") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("RequestMessageType") }, + ], false), + "AppRequestMessageMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("AppIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "BroadcastEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastEventPayload") }, + { json: "type", js: "type", typ: r("BroadcastEventType") }, + ], false), + "BroadcastEventPayload": o([ + { json: "channelId", js: "channelId", typ: u(null, "") }, + { json: "context", js: "context", typ: r("Context") }, + { json: "originatingApp", js: "originatingApp", typ: u(undefined, r("AppIdentifier")) }, + ], false), + "Context": o([ + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: "" }, + ], "any"), + "BroadcastRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastRequestPayload") }, + { json: "type", js: "type", typ: r("BroadcastRequestType") }, + ], false), + "BroadcastRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "BroadcastResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("BroadcastResponseType") }, + ], false), + "BroadcastResponseResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + ], "any"), + "ChannelChangedEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("ChannelChangedEventPayload") }, + { json: "type", js: "type", typ: r("ChannelChangedEventType") }, + ], false), + "ChannelChangedEventPayload": o([ + { json: "newChannelId", js: "newChannelId", typ: u(null, "") }, + ], false), + "ContextListenerUnsubscribeRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("ContextListenerUnsubscribeRequestPayload") }, + { json: "type", js: "type", typ: r("ContextListenerUnsubscribeRequestType") }, + ], false), + "ContextListenerUnsubscribeRequestPayload": o([ + { json: "listenerUUID", js: "listenerUUID", typ: "" }, + ], false), + "ContextListenerUnsubscribeResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("ContextListenerUnsubscribeResponseType") }, + ], false), + "CreatePrivateChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("CreatePrivateChannelRequestPayload") }, + { json: "type", js: "type", typ: r("CreatePrivateChannelRequestType") }, + ], false), + "CreatePrivateChannelRequestPayload": o([ + ], false), + "CreatePrivateChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("CreatePrivateChannelResponsePayload") }, + { json: "type", js: "type", typ: r("CreatePrivateChannelResponseType") }, + ], false), + "CreatePrivateChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "privateChannel", js: "privateChannel", typ: u(undefined, r("Channel")) }, + ], false), + "Channel": o([ + { json: "displayMetadata", js: "displayMetadata", typ: u(undefined, r("DisplayMetadata")) }, + { json: "id", js: "id", typ: "" }, + { json: "type", js: "type", typ: r("Type") }, + ], false), + "DisplayMetadata": o([ + { json: "color", js: "color", typ: u(undefined, "") }, + { json: "glyph", js: "glyph", typ: u(undefined, "") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], false), + "EventListenerUnsubscribeRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("EventListenerUnsubscribeRequestPayload") }, + { json: "type", js: "type", typ: r("EventListenerUnsubscribeRequestType") }, + ], false), + "EventListenerUnsubscribeRequestPayload": o([ + { json: "listenerUUID", js: "listenerUUID", typ: "" }, + ], false), + "EventListenerUnsubscribeResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("EventListenerUnsubscribeResponseType") }, + ], false), + "FindInstancesRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesRequestPayload") }, + { json: "type", js: "type", typ: r("FindInstancesRequestType") }, + ], false), + "FindInstancesRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + ], false), + "FindInstancesResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesResponsePayload") }, + { json: "type", js: "type", typ: r("FindInstancesResponseType") }, + ], false), + "FindInstancesResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "appIdentifiers", js: "appIdentifiers", typ: u(undefined, a(r("AppMetadata"))) }, + ], false), + "FindIntentRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentRequestType") }, + ], false), + "FindIntentRequestPayload": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "intent", js: "intent", typ: "" }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentResponseType") }, + ], false), + "FindIntentResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "appIntent", js: "appIntent", typ: u(undefined, r("AppIntent")) }, + ], false), + "AppIntent": o([ + { json: "apps", js: "apps", typ: a(r("AppMetadata")) }, + { json: "intent", js: "intent", typ: r("IntentMetadata") }, + ], false), + "IntentMetadata": o([ + { json: "displayName", js: "displayName", typ: u(undefined, "") }, + { json: "name", js: "name", typ: "" }, + ], false), + "FindIntentsByContextRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextRequestType") }, + ], false), + "FindIntentsByContextRequestPayload": o([ + { json: "context", js: "context", typ: r("Context") }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentsByContextResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextResponseType") }, + ], false), + "FindIntentsByContextResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "appIntents", js: "appIntents", typ: u(undefined, a(r("AppIntent"))) }, + ], false), + "GetAppMetadataRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataRequestPayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataRequestType") }, + ], false), + "GetAppMetadataRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + ], false), + "GetAppMetadataResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataResponseType") }, + ], false), + "GetAppMetadataResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "appMetadata", js: "appMetadata", typ: u(undefined, r("AppMetadata")) }, + ], false), + "GetCurrentChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetCurrentChannelRequestPayload") }, + { json: "type", js: "type", typ: r("GetCurrentChannelRequestType") }, + ], false), + "GetCurrentChannelRequestPayload": o([ + ], false), + "GetCurrentChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetCurrentChannelResponsePayload") }, + { json: "type", js: "type", typ: r("GetCurrentChannelResponseType") }, + ], false), + "GetCurrentChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + { json: "channel", js: "channel", typ: u(undefined, u(r("Channel"), null)) }, + ], false), + "GetCurrentContextRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetCurrentContextRequestPayload") }, + { json: "type", js: "type", typ: r("GetCurrentContextRequestType") }, + ], false), + "GetCurrentContextRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "GetCurrentContextResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetCurrentContextResponsePayload") }, + { json: "type", js: "type", typ: r("GetCurrentContextResponseType") }, + ], false), + "GetCurrentContextResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "context", js: "context", typ: u(undefined, u(null, r("Context"))) }, + ], false), + "GetInfoRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetInfoRequestPayload") }, + { json: "type", js: "type", typ: r("GetInfoRequestType") }, + ], false), + "GetInfoRequestPayload": o([ + ], false), + "GetInfoResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetInfoResponsePayload") }, + { json: "type", js: "type", typ: r("GetInfoResponseType") }, + ], false), + "GetInfoResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + { json: "implementationMetadata", js: "implementationMetadata", typ: u(undefined, r("ImplementationMetadata")) }, + ], false), + "GetOrCreateChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetOrCreateChannelRequestPayload") }, + { json: "type", js: "type", typ: r("GetOrCreateChannelRequestType") }, + ], false), + "GetOrCreateChannelRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "GetOrCreateChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetOrCreateChannelResponsePayload") }, + { json: "type", js: "type", typ: r("GetOrCreateChannelResponseType") }, + ], false), + "GetOrCreateChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, + ], false), + "GetUserChannelsRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetUserChannelsRequestPayload") }, + { json: "type", js: "type", typ: r("GetUserChannelsRequestType") }, + ], false), + "GetUserChannelsRequestPayload": o([ + ], false), + "GetUserChannelsResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetUserChannelsResponsePayload") }, + { json: "type", js: "type", typ: r("GetUserChannelsResponseType") }, + ], false), + "GetUserChannelsResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "userChannels", js: "userChannels", typ: u(undefined, a(r("Channel"))) }, + ], false), + "IframeChannelDrag": o([ + { json: "payload", js: "payload", typ: r("IframeChannelDragPayload") }, + { json: "type", js: "type", typ: r("IframeChannelDragType") }, + ], false), + "IframeChannelDragPayload": o([ + { json: "mouse", js: "mouse", typ: r("MouseClass") }, + ], false), + "MouseClass": o([ + { json: "offsetX", js: "offsetX", typ: 0 }, + { json: "offsetY", js: "offsetY", typ: 0 }, + ], false), + "IframeChannelResize": o([ + { json: "payload", js: "payload", typ: r("IframeChannelResizePayload") }, + { json: "type", js: "type", typ: r("IframeChannelResizeType") }, + ], false), + "IframeChannelResizePayload": o([ + { json: "dimensions", js: "dimensions", typ: r("DimensionsClass") }, + { json: "resizeAnchor", js: "resizeAnchor", typ: r("Resizing") }, + ], false), + "DimensionsClass": o([ + { json: "height", js: "height", typ: 0 }, + { json: "width", js: "width", typ: 0 }, + ], false), + "IframeChannelSelected": o([ + { json: "payload", js: "payload", typ: r("IframeChannelSelectedPayload") }, + { json: "type", js: "type", typ: r("IframeChannelSelectedType") }, + ], false), + "IframeChannelSelectedPayload": o([ + { json: "selected", js: "selected", typ: u(null, "") }, + ], false), + "IframeChannels": o([ + { json: "payload", js: "payload", typ: r("IframeChannelsPayload") }, + { json: "type", js: "type", typ: r("IframeChannelsType") }, + ], false), + "IframeChannelsPayload": o([ + { json: "location", js: "location", typ: u(undefined, r("Location")) }, + { json: "selected", js: "selected", typ: u(null, "") }, + { json: "userChannels", js: "userChannels", typ: a(r("Channel")) }, + ], false), + "Location": o([ + { json: "x", js: "x", typ: 0 }, + { json: "y", js: "y", typ: 0 }, + ], false), + "IframeHandshake": o([ + { json: "payload", js: "payload", typ: r("IframeHandshakePayload") }, + { json: "type", js: "type", typ: r("IframeHandshakeType") }, + ], false), + "IframeHandshakePayload": o([ + { json: "implementationDetails", js: "implementationDetails", typ: "" }, + ], false), + "IframeHello": o([ + { json: "payload", js: "payload", typ: r("IframeHelloPayload") }, + { json: "type", js: "type", typ: r("IframeHelloType") }, + ], false), + "IframeHelloPayload": o([ + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + ], false), + "IframeMessage": o([ + { json: "payload", js: "payload", typ: u(undefined, m("any")) }, + { json: "type", js: "type", typ: r("IframeMessageType") }, + ], false), + "IframeResolve": o([ + { json: "payload", js: "payload", typ: r("IframeResolvePayload") }, + { json: "type", js: "type", typ: r("IframeResolveType") }, + ], false), + "IframeResolvePayload": o([ + { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "IframeResolveAction": o([ + { json: "payload", js: "payload", typ: r("IframeResolveActionPayload") }, + { json: "type", js: "type", typ: r("IframeResolveActionType") }, + ], false), + "IframeResolveActionPayload": o([ + { json: "action", js: "action", typ: r("Action") }, + { json: "appIdentifier", js: "appIdentifier", typ: u(undefined, r("AppIdentifier")) }, + { json: "intent", js: "intent", typ: u(undefined, "") }, + ], false), + "IntentEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("IntentEventPayload") }, + { json: "type", js: "type", typ: r("IntentEventType") }, + ], false), + "IntentEventPayload": o([ + { json: "context", js: "context", typ: r("Context") }, + { json: "intent", js: "intent", typ: "" }, + { json: "originatingApp", js: "originatingApp", typ: u(undefined, r("AppIdentifier")) }, + ], false), + "IntentListenerUnsubscribeRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("IntentListenerUnsubscribeRequestPayload") }, + { json: "type", js: "type", typ: r("IntentListenerUnsubscribeRequestType") }, + ], false), + "IntentListenerUnsubscribeRequestPayload": o([ + { json: "listenerUUID", js: "listenerUUID", typ: "" }, + ], false), + "IntentListenerUnsubscribeResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("IntentListenerUnsubscribeResponseType") }, + ], false), + "IntentResultRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("IntentResultRequestPayload") }, + { json: "type", js: "type", typ: r("IntentResultRequestType") }, + ], false), + "IntentResultRequestPayload": o([ + { json: "intentResult", js: "intentResult", typ: r("PurpleIntentResult") }, + ], false), + "PurpleIntentResult": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, + ], false), + "IntentResultResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("IntentResultResponseType") }, + ], false), + "JoinUserChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("JoinUserChannelRequestPayload") }, + { json: "type", js: "type", typ: r("JoinUserChannelRequestType") }, + ], false), + "JoinUserChannelRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "JoinUserChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("JoinUserChannelResponsePayload") }, + { json: "type", js: "type", typ: r("JoinUserChannelResponseType") }, + ], false), + "JoinUserChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + ], false), + "LeaveCurrentChannelRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("LeaveCurrentChannelRequestPayload") }, + { json: "type", js: "type", typ: r("LeaveCurrentChannelRequestType") }, + ], false), + "LeaveCurrentChannelRequestPayload": o([ + ], false), + "LeaveCurrentChannelResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("LeaveCurrentChannelResponsePayload") }, + { json: "type", js: "type", typ: r("LeaveCurrentChannelResponseType") }, + ], false), + "LeaveCurrentChannelResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + ], false), + "OpenRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("OpenRequestPayload") }, + { json: "type", js: "type", typ: r("OpenRequestType") }, + ], false), + "OpenRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + ], false), + "OpenResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenResponsePayload") }, + { json: "type", js: "type", typ: r("OpenResponseType") }, + ], false), + "OpenResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("OpenErrorResponsePayload")) }, + { json: "appIdentifier", js: "appIdentifier", typ: u(undefined, r("AppIdentifier")) }, + ], false), + "PrivateChannelDisconnectRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelDisconnectRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelDisconnectRequestType") }, + ], false), + "PrivateChannelDisconnectRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "PrivateChannelDisconnectResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelDisconnectResponsePayload") }, + { json: "type", js: "type", typ: r("PrivateChannelDisconnectResponseType") }, + ], false), + "PrivateChannelDisconnectResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + ], false), + "PrivateChannelOnAddContextListenerEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerEventPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerEventType") }, + ], false), + "PrivateChannelOnAddContextListenerEventPayload": o([ + { json: "contextType", js: "contextType", typ: u(null, "") }, + { json: "privateChannelId", js: "privateChannelId", typ: "" }, + ], false), + "PrivateChannelOnDisconnectEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectEventPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectEventType") }, + ], false), + "PrivateChannelOnDisconnectEventPayload": o([ + { json: "privateChannelId", js: "privateChannelId", typ: "" }, + ], false), + "PrivateChannelOnUnsubscribeEvent": o([ + { json: "meta", js: "meta", typ: r("AddEventListenerEventMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeEventPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeEventType") }, + ], false), + "PrivateChannelOnUnsubscribeEventPayload": o([ + { json: "contextType", js: "contextType", typ: u(null, "") }, + { json: "privateChannelId", js: "privateChannelId", typ: "" }, + ], false), + "PrivateChannelUnsubscribeEventListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelUnsubscribeEventListenerRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelUnsubscribeEventListenerRequestType") }, + ], false), + "PrivateChannelUnsubscribeEventListenerRequestPayload": o([ + { json: "listenerUUID", js: "listenerUUID", typ: "" }, + ], false), + "PrivateChannelUnsubscribeEventListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastResponseResponsePayload") }, + { json: "type", js: "type", typ: r("PrivateChannelUnsubscribeEventListenerResponseType") }, + ], false), + "PrivateChannelAddEventListenerRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("TPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelAddEventListenerRequestType") }, + ], false), + "TPayload": o([ + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + { json: "privateChannelId", js: "privateChannelId", typ: "" }, + ], false), + "PrivateChannelAddEventListenerResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelAddEventListenerResponsePayload") }, + { json: "type", js: "type", typ: r("PrivateChannelAddEventListenerResponseType") }, + ], false), + "PrivateChannelAddEventListenerResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("PurpleError")) }, + { json: "listenerUUID", js: "listenerUUID", typ: u(undefined, "") }, + ], "any"), + "RaiseIntentForContextRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentForContextRequestPayload") }, + { json: "type", js: "type", typ: r("RaiseIntentForContextRequestType") }, + ], false), + "RaiseIntentForContextRequestPayload": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "RaiseIntentForContextResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentForContextResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentForContextResponseType") }, + ], false), + "RaiseIntentForContextResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "intentResolution", js: "intentResolution", typ: u(undefined, r("IntentResolution")) }, + { json: "appIntents", js: "appIntents", typ: u(undefined, a(r("AppIntent"))) }, + ], false), + "IntentResolution": o([ + { json: "intent", js: "intent", typ: "" }, + { json: "source", js: "source", typ: r("AppIdentifier") }, + ], false), + "RaiseIntentRequest": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerRequestMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentRequestPayload") }, + { json: "type", js: "type", typ: r("RaiseIntentRequestType") }, + ], false), + "RaiseIntentRequestPayload": o([ + { json: "app", js: "app", typ: u(undefined, r("AppIdentifier")) }, + { json: "context", js: "context", typ: r("Context") }, + { json: "intent", js: "intent", typ: "" }, + ], false), + "RaiseIntentResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResponseType") }, + ], false), + "RaiseIntentResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("FindInstancesErrors")) }, + { json: "intentResolution", js: "intentResolution", typ: u(undefined, r("IntentResolution")) }, + { json: "appIntent", js: "appIntent", typ: u(undefined, r("AppIntent")) }, + ], false), + "RaiseIntentResultResponse": o([ + { json: "meta", js: "meta", typ: r("AddContextListenerResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultResponseType") }, + ], false), + "RaiseIntentResultResponsePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponsePayloadError")) }, + { json: "intentResult", js: "intentResult", typ: u(undefined, r("FluffyIntentResult")) }, + ], false), + "FluffyIntentResult": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, + ], false), + "WebConnectionProtocol1HelloType": [ + "WCP1Hello", + ], + "WebConnectionProtocol2LoadURLType": [ + "WCP2LoadUrl", + ], + "WebConnectionProtocol3HandshakeType": [ + "WCP3Handshake", + ], + "WebConnectionProtocol4ValidateAppIdentityType": [ + "WCP4ValidateAppIdentity", + ], + "WebConnectionProtocol5ValidateAppIdentityFailedResponseType": [ + "WCP5ValidateAppIdentityFailedResponse", + ], + "WebConnectionProtocol5ValidateAppIdentitySuccessResponseType": [ + "WCP5ValidateAppIdentityResponse", + ], + "WebConnectionProtocol6GoodbyeType": [ + "WCP6Goodbye", + ], + "ConnectionStepMessageType": [ + "WCP1Hello", + "WCP2LoadUrl", + "WCP3Handshake", + "WCP4ValidateAppIdentity", + "WCP5ValidateAppIdentityFailedResponse", + "WCP5ValidateAppIdentityResponse", + "WCP6Goodbye", + ], + "AddContextListenerRequestType": [ + "addContextListenerRequest", + ], + "PurpleError": [ + "AccessDenied", + "CreationFailed", + "MalformedContext", + "NoChannelFound", + ], + "AddContextListenerResponseType": [ + "addContextListenerResponse", + ], + "FDC3EventType": [ + "USER_CHANNEL_CHANGED", + ], + "AddEventListenerEventType": [ + "addEventListenerEvent", + ], + "AddEventListenerRequestType": [ + "addEventListenerRequest", + ], + "ResponsePayloadError": [ + "AccessDenied", + "AgentDisconnected", + "AppNotFound", + "AppTimeout", + "CreationFailed", + "DesktopAgentNotFound", + "ErrorOnLaunch", + "IntentDeliveryFailed", + "IntentHandlerRejected", + "MalformedContext", + "MalformedMessage", + "NoAppsFound", + "NoChannelFound", + "NoResultReturned", + "NotConnectedToBridge", + "ResolverTimeout", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "AddEventListenerResponseType": [ + "addEventListenerResponse", + ], + "AddIntentListenerRequestType": [ + "addIntentListenerRequest", + ], + "FluffyError": [ + "DesktopAgentNotFound", + "IntentDeliveryFailed", + "MalformedContext", + "NoAppsFound", + "ResolverTimeout", + "ResolverUnavailable", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "AddIntentListenerResponseType": [ + "addIntentListenerResponse", + ], + "EventMessageType": [ + "addEventListenerEvent", + "broadcastEvent", + "channelChangedEvent", + "intentEvent", + "privateChannelOnAddContextListenerEvent", + "privateChannelOnDisconnectEvent", + "privateChannelOnUnsubscribeEvent", + ], + "ResponseMessageType": [ + "addContextListenerResponse", + "addEventListenerResponse", + "addIntentListenerResponse", + "broadcastResponse", + "contextListenerUnsubscribeResponse", + "createPrivateChannelResponse", + "eventListenerUnsubscribeResponse", + "findInstancesResponse", + "findIntentResponse", + "findIntentsByContextResponse", + "getAppMetadataResponse", + "getCurrentChannelResponse", + "getCurrentContextResponse", + "getInfoResponse", + "getOrCreateChannelResponse", + "getUserChannelsResponse", + "intentListenerUnsubscribeResponse", + "intentResultResponse", + "joinUserChannelResponse", + "leaveCurrentChannelResponse", + "openResponse", + "privateChannelAddEventListenerResponse", + "privateChannelDisconnectResponse", + "privateChannelUnsubscribeEventListenerResponse", + "raiseIntentForContextResponse", + "raiseIntentResponse", + "raiseIntentResultResponse", + ], + "RequestMessageType": [ + "addContextListenerRequest", + "addEventListenerRequest", + "addIntentListenerRequest", + "broadcastRequest", + "contextListenerUnsubscribeRequest", + "createPrivateChannelRequest", + "eventListenerUnsubscribeRequest", + "findInstancesRequest", + "findIntentRequest", + "findIntentsByContextRequest", + "getAppMetadataRequest", + "getCurrentChannelRequest", + "getCurrentContextRequest", + "getInfoRequest", + "getOrCreateChannelRequest", + "getUserChannelsRequest", + "intentListenerUnsubscribeRequest", + "intentResultRequest", + "joinUserChannelRequest", + "leaveCurrentChannelRequest", + "openRequest", + "privateChannelAddEventListenerRequest", + "privateChannelDisconnectRequest", + "privateChannelUnsubscribeEventListenerRequest", + "raiseIntentForContextRequest", + "raiseIntentRequest", + ], + "BroadcastEventType": [ + "broadcastEvent", + ], + "BroadcastRequestType": [ + "broadcastRequest", + ], + "BroadcastResponseType": [ + "broadcastResponse", + ], + "ChannelChangedEventType": [ + "channelChangedEvent", + ], + "ContextListenerUnsubscribeRequestType": [ + "contextListenerUnsubscribeRequest", + ], + "ContextListenerUnsubscribeResponseType": [ + "contextListenerUnsubscribeResponse", + ], + "CreatePrivateChannelRequestType": [ + "createPrivateChannelRequest", + ], + "Type": [ + "app", + "private", + "user", + ], + "CreatePrivateChannelResponseType": [ + "createPrivateChannelResponse", + ], + "EventListenerUnsubscribeRequestType": [ + "eventListenerUnsubscribeRequest", + ], + "EventListenerUnsubscribeResponseType": [ + "eventListenerUnsubscribeResponse", + ], + "FindInstancesRequestType": [ + "findInstancesRequest", + ], + "FindInstancesErrors": [ + "AgentDisconnected", + "DesktopAgentNotFound", + "IntentDeliveryFailed", + "MalformedContext", + "MalformedMessage", + "NoAppsFound", + "NotConnectedToBridge", + "ResolverTimeout", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "FindInstancesResponseType": [ + "findInstancesResponse", + ], + "FindIntentRequestType": [ + "findIntentRequest", + ], + "FindIntentResponseType": [ + "findIntentResponse", + ], + "FindIntentsByContextRequestType": [ + "findIntentsByContextRequest", + ], + "FindIntentsByContextResponseType": [ + "findIntentsByContextResponse", + ], + "GetAppMetadataRequestType": [ + "getAppMetadataRequest", + ], + "GetAppMetadataResponseType": [ + "getAppMetadataResponse", + ], + "GetCurrentChannelRequestType": [ + "getCurrentChannelRequest", + ], + "GetCurrentChannelResponseType": [ + "getCurrentChannelResponse", + ], + "GetCurrentContextRequestType": [ + "getCurrentContextRequest", + ], + "GetCurrentContextResponseType": [ + "getCurrentContextResponse", + ], + "GetInfoRequestType": [ + "getInfoRequest", + ], + "GetInfoResponseType": [ + "getInfoResponse", + ], + "GetOrCreateChannelRequestType": [ + "getOrCreateChannelRequest", + ], + "GetOrCreateChannelResponseType": [ + "getOrCreateChannelResponse", + ], + "GetUserChannelsRequestType": [ + "getUserChannelsRequest", + ], + "GetUserChannelsResponseType": [ + "getUserChannelsResponse", + ], + "IframeChannelDragType": [ + "iframeChannelDrag", + ], + "Resizing": [ + "bottom", + "bottom-left", + "bottom-right", + "center", + "left", + "right", + "top", + "top-left", + "top-right", + ], + "IframeChannelResizeType": [ + "iframeChannelResize", + ], + "IframeChannelSelectedType": [ + "iframeChannelSelected", + ], + "IframeChannelsType": [ + "iframeChannels", + ], + "IframeHandshakeType": [ + "iframeHandshake", + ], + "IframeHelloType": [ + "iframeHello", + ], + "IframeMessageType": [ + "iframeChannelDrag", + "iframeChannelResize", + "iframeChannelSelected", + "iframeChannels", + "iframeHandshake", + "iframeHello", + "iframeResolve", + "iframeResolveAction", + ], + "IframeResolveType": [ + "iframeResolve", + ], + "Action": [ + "cancel", + "click", + "hover", + ], + "IframeResolveActionType": [ + "iframeResolveAction", + ], + "IntentEventType": [ + "intentEvent", + ], + "IntentListenerUnsubscribeRequestType": [ + "intentListenerUnsubscribeRequest", + ], + "IntentListenerUnsubscribeResponseType": [ + "intentListenerUnsubscribeResponse", + ], + "IntentResultRequestType": [ + "intentResultRequest", + ], + "IntentResultResponseType": [ + "intentResultResponse", + ], + "JoinUserChannelRequestType": [ + "joinUserChannelRequest", + ], + "JoinUserChannelResponseType": [ + "joinUserChannelResponse", + ], + "LeaveCurrentChannelRequestType": [ + "leaveCurrentChannelRequest", + ], + "LeaveCurrentChannelResponseType": [ + "leaveCurrentChannelResponse", + ], + "OpenRequestType": [ + "openRequest", + ], + "OpenErrorResponsePayload": [ + "AgentDisconnected", + "AppNotFound", + "AppTimeout", + "DesktopAgentNotFound", + "ErrorOnLaunch", + "MalformedContext", + "MalformedMessage", + "NotConnectedToBridge", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + ], + "OpenResponseType": [ + "openResponse", + ], + "PrivateChannelDisconnectRequestType": [ + "privateChannelDisconnectRequest", + ], + "PrivateChannelDisconnectResponseType": [ + "privateChannelDisconnectResponse", + ], + "PrivateChannelOnAddContextListenerEventType": [ + "privateChannelOnAddContextListenerEvent", + ], + "PrivateChannelOnDisconnectEventType": [ + "privateChannelOnDisconnectEvent", + ], + "PrivateChannelOnUnsubscribeEventType": [ + "privateChannelOnUnsubscribeEvent", + ], + "PrivateChannelUnsubscribeEventListenerRequestType": [ + "privateChannelUnsubscribeEventListenerRequest", + ], + "PrivateChannelUnsubscribeEventListenerResponseType": [ + "privateChannelUnsubscribeEventListenerResponse", + ], + "PrivateChannelEventListenerTypes": [ + "onAddContextListener", + "onDisconnect", + "onUnsubscribe", + ], + "PrivateChannelAddEventListenerRequestType": [ + "privateChannelAddEventListenerRequest", + ], + "PrivateChannelAddEventListenerResponseType": [ + "privateChannelAddEventListenerResponse", + ], + "RaiseIntentForContextRequestType": [ + "raiseIntentForContextRequest", + ], + "RaiseIntentForContextResponseType": [ + "raiseIntentForContextResponse", + ], + "RaiseIntentRequestType": [ + "raiseIntentRequest", + ], + "RaiseIntentResponseType": [ + "raiseIntentResponse", + ], + "RaiseIntentResultResponseType": [ + "raiseIntentResultResponse", + ], +}; diff --git a/packages/fdc3-schema/generated/bridging/BridgingTypes.ts b/packages/fdc3-schema/generated/bridging/BridgingTypes.ts new file mode 100644 index 000000000..ec0a3b481 --- /dev/null +++ b/packages/fdc3-schema/generated/bridging/BridgingTypes.ts @@ -0,0 +1,6058 @@ +// To parse this data: +// +// import { Convert, AgentErrorResponseMessage, AgentRequestMessage, AgentResponseMessage, BridgeErrorResponseMessage, BridgeRequestMessage, BridgeResponseMessage, BroadcastAgentRequest, BroadcastBridgeRequest, ConnectionStepMessage, ConnectionStep2Hello, ConnectionStep3Handshake, ConnectionStep4AuthenticationFailed, ConnectionStep6ConnectedAgentsUpdate, FindInstancesAgentErrorResponse, FindInstancesAgentRequest, FindInstancesAgentResponse, FindInstancesBridgeErrorResponse, FindInstancesBridgeRequest, FindInstancesBridgeResponse, FindIntentAgentErrorResponse, FindIntentAgentRequest, FindIntentAgentResponse, FindIntentBridgeErrorResponse, FindIntentBridgeRequest, FindIntentBridgeResponse, FindIntentsByContextAgentErrorResponse, FindIntentsByContextAgentRequest, FindIntentsByContextAgentResponse, FindIntentsByContextBridgeErrorResponse, FindIntentsByContextBridgeRequest, FindIntentsByContextBridgeResponse, GetAppMetadataAgentErrorResponse, GetAppMetadataAgentRequest, GetAppMetadataAgentResponse, GetAppMetadataBridgeErrorResponse, GetAppMetadataBridgeRequest, GetAppMetadataBridgeResponse, OpenAgentErrorResponse, OpenAgentRequest, OpenAgentResponse, OpenBridgeErrorResponse, OpenBridgeRequest, OpenBridgeResponse, PrivateChannelBroadcastAgentRequest, PrivateChannelBroadcastBridgeRequest, PrivateChannelEventListenerAddedAgentRequest, PrivateChannelEventListenerAddedBridgeRequest, PrivateChannelEventListenerRemovedAgentRequest, PrivateChannelEventListenerRemovedBridgeRequest, PrivateChannelOnAddContextListenerAgentRequest, PrivateChannelOnAddContextListenerBridgeRequest, PrivateChannelOnDisconnectAgentRequest, PrivateChannelOnDisconnectBridgeRequest, PrivateChannelOnUnsubscribeAgentRequest, PrivateChannelOnUnsubscribeBridgeRequest, RaiseIntentAgentErrorResponse, RaiseIntentAgentRequest, RaiseIntentAgentResponse, RaiseIntentBridgeErrorResponse, RaiseIntentBridgeRequest, RaiseIntentBridgeResponse, RaiseIntentResultAgentErrorResponse, RaiseIntentResultAgentResponse, RaiseIntentResultBridgeErrorResponse, RaiseIntentResultBridgeResponse } from "./file"; +// +// const agentErrorResponseMessage = Convert.toAgentErrorResponseMessage(json); +// const agentRequestMessage = Convert.toAgentRequestMessage(json); +// const agentResponseMessage = Convert.toAgentResponseMessage(json); +// const bridgeErrorResponseMessage = Convert.toBridgeErrorResponseMessage(json); +// const bridgeRequestMessage = Convert.toBridgeRequestMessage(json); +// const bridgeResponseMessage = Convert.toBridgeResponseMessage(json); +// const broadcastAgentRequest = Convert.toBroadcastAgentRequest(json); +// const broadcastBridgeRequest = Convert.toBroadcastBridgeRequest(json); +// const bridgeCommonDefinitions = Convert.toBridgeCommonDefinitions(json); +// const connectionStepMessage = Convert.toConnectionStepMessage(json); +// const connectionStep2Hello = Convert.toConnectionStep2Hello(json); +// const connectionStep3Handshake = Convert.toConnectionStep3Handshake(json); +// const connectionStep4AuthenticationFailed = Convert.toConnectionStep4AuthenticationFailed(json); +// const connectionStep6ConnectedAgentsUpdate = Convert.toConnectionStep6ConnectedAgentsUpdate(json); +// const findInstancesAgentErrorResponse = Convert.toFindInstancesAgentErrorResponse(json); +// const findInstancesAgentRequest = Convert.toFindInstancesAgentRequest(json); +// const findInstancesAgentResponse = Convert.toFindInstancesAgentResponse(json); +// const findInstancesBridgeErrorResponse = Convert.toFindInstancesBridgeErrorResponse(json); +// const findInstancesBridgeRequest = Convert.toFindInstancesBridgeRequest(json); +// const findInstancesBridgeResponse = Convert.toFindInstancesBridgeResponse(json); +// const findIntentAgentErrorResponse = Convert.toFindIntentAgentErrorResponse(json); +// const findIntentAgentRequest = Convert.toFindIntentAgentRequest(json); +// const findIntentAgentResponse = Convert.toFindIntentAgentResponse(json); +// const findIntentBridgeErrorResponse = Convert.toFindIntentBridgeErrorResponse(json); +// const findIntentBridgeRequest = Convert.toFindIntentBridgeRequest(json); +// const findIntentBridgeResponse = Convert.toFindIntentBridgeResponse(json); +// const findIntentsByContextAgentErrorResponse = Convert.toFindIntentsByContextAgentErrorResponse(json); +// const findIntentsByContextAgentRequest = Convert.toFindIntentsByContextAgentRequest(json); +// const findIntentsByContextAgentResponse = Convert.toFindIntentsByContextAgentResponse(json); +// const findIntentsByContextBridgeErrorResponse = Convert.toFindIntentsByContextBridgeErrorResponse(json); +// const findIntentsByContextBridgeRequest = Convert.toFindIntentsByContextBridgeRequest(json); +// const findIntentsByContextBridgeResponse = Convert.toFindIntentsByContextBridgeResponse(json); +// const getAppMetadataAgentErrorResponse = Convert.toGetAppMetadataAgentErrorResponse(json); +// const getAppMetadataAgentRequest = Convert.toGetAppMetadataAgentRequest(json); +// const getAppMetadataAgentResponse = Convert.toGetAppMetadataAgentResponse(json); +// const getAppMetadataBridgeErrorResponse = Convert.toGetAppMetadataBridgeErrorResponse(json); +// const getAppMetadataBridgeRequest = Convert.toGetAppMetadataBridgeRequest(json); +// const getAppMetadataBridgeResponse = Convert.toGetAppMetadataBridgeResponse(json); +// const openAgentErrorResponse = Convert.toOpenAgentErrorResponse(json); +// const openAgentRequest = Convert.toOpenAgentRequest(json); +// const openAgentResponse = Convert.toOpenAgentResponse(json); +// const openBridgeErrorResponse = Convert.toOpenBridgeErrorResponse(json); +// const openBridgeRequest = Convert.toOpenBridgeRequest(json); +// const openBridgeResponse = Convert.toOpenBridgeResponse(json); +// const privateChannelBroadcastAgentRequest = Convert.toPrivateChannelBroadcastAgentRequest(json); +// const privateChannelBroadcastBridgeRequest = Convert.toPrivateChannelBroadcastBridgeRequest(json); +// const privateChannelEventListenerAddedAgentRequest = Convert.toPrivateChannelEventListenerAddedAgentRequest(json); +// const privateChannelEventListenerAddedBridgeRequest = Convert.toPrivateChannelEventListenerAddedBridgeRequest(json); +// const privateChannelEventListenerRemovedAgentRequest = Convert.toPrivateChannelEventListenerRemovedAgentRequest(json); +// const privateChannelEventListenerRemovedBridgeRequest = Convert.toPrivateChannelEventListenerRemovedBridgeRequest(json); +// const privateChannelOnAddContextListenerAgentRequest = Convert.toPrivateChannelOnAddContextListenerAgentRequest(json); +// const privateChannelOnAddContextListenerBridgeRequest = Convert.toPrivateChannelOnAddContextListenerBridgeRequest(json); +// const privateChannelOnDisconnectAgentRequest = Convert.toPrivateChannelOnDisconnectAgentRequest(json); +// const privateChannelOnDisconnectBridgeRequest = Convert.toPrivateChannelOnDisconnectBridgeRequest(json); +// const privateChannelOnUnsubscribeAgentRequest = Convert.toPrivateChannelOnUnsubscribeAgentRequest(json); +// const privateChannelOnUnsubscribeBridgeRequest = Convert.toPrivateChannelOnUnsubscribeBridgeRequest(json); +// const raiseIntentAgentErrorResponse = Convert.toRaiseIntentAgentErrorResponse(json); +// const raiseIntentAgentRequest = Convert.toRaiseIntentAgentRequest(json); +// const raiseIntentAgentResponse = Convert.toRaiseIntentAgentResponse(json); +// const raiseIntentBridgeErrorResponse = Convert.toRaiseIntentBridgeErrorResponse(json); +// const raiseIntentBridgeRequest = Convert.toRaiseIntentBridgeRequest(json); +// const raiseIntentBridgeResponse = Convert.toRaiseIntentBridgeResponse(json); +// const raiseIntentResultAgentErrorResponse = Convert.toRaiseIntentResultAgentErrorResponse(json); +// const raiseIntentResultAgentResponse = Convert.toRaiseIntentResultAgentResponse(json); +// const raiseIntentResultBridgeErrorResponse = Convert.toRaiseIntentResultBridgeErrorResponse(json); +// const raiseIntentResultBridgeResponse = Convert.toRaiseIntentResultBridgeResponse(json); +// +// These functions will throw an error if the JSON doesn't +// match the expected interface, even if the JSON is valid. + +/** + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface AgentErrorResponseMessage { + meta: AgentResponseMetadata; + /** + * Error message payload containing an standardized error string. + */ + payload: ErrorResponseMessagePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: ResponseMessageType; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface AgentResponseMetadata { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface ErrorResponseMessagePayload { + error: ResponseErrorDetail; + [property: string]: any; +} + +/** + * Array of error message strings for responses that were not returned to the bridge before + * the timeout or because an error occurred. Should be the same length as the `errorSources` + * array and ordered the same. May be omitted if all sources responded without errors. + * + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type ResponseErrorDetail = "AccessDenied" | "CreationFailed" | "MalformedContext" | "NoChannelFound" | "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "ResolverUnavailable" | "IntentDeliveryFailed" | "NoAppsFound" | "ResolverTimeout" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ +export type ResponseMessageType = "findInstancesResponse" | "findIntentResponse" | "findIntentsByContextResponse" | "getAppMetadataResponse" | "openResponse" | "raiseIntentResponse" | "raiseIntentResultResponse"; + +/** + * A request message from a Desktop Agent to the Bridge. + */ +export interface AgentRequestMessage { + meta: AgentRequestMetadata; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: RequestMessageType; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface AgentRequestMetadata { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceIdentifier; + timestamp: Date; +} + +/** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface BridgeParticipantIdentifier { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + * + * Field that represents the source application that a request or response was received + * from, or the source Desktop Agent if it issued the request or response itself. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + */ +export interface SourceIdentifier { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId?: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + * + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ +export type RequestMessageType = "broadcastRequest" | "findInstancesRequest" | "findIntentRequest" | "findIntentsByContextRequest" | "getAppMetadataRequest" | "openRequest" | "PrivateChannel.broadcast" | "PrivateChannel.eventListenerAdded" | "PrivateChannel.eventListenerRemoved" | "PrivateChannel.onAddContextListener" | "PrivateChannel.onDisconnect" | "PrivateChannel.onUnsubscribe" | "raiseIntentRequest"; + +/** + * A response message from a Desktop Agent to the Bridge. + */ +export interface AgentResponseMessage { + meta: AgentResponseMetadata; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: ResponseMessageType; +} + +/** + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface BridgeErrorResponseMessage { + meta: BridgeErrorResponseMessageMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: ResponseErrorMessagePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: string; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface BridgeErrorResponseMessageMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + */ +export interface DesktopAgentIdentifier { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent: string; + [property: string]: any; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface ResponseErrorMessagePayload { + error?: ResponseErrorDetail; + [property: string]: any; +} + +/** + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface BridgeRequestMessage { + meta: BridgeRequestMetadata; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: string; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface BridgeRequestMetadata { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: BridgeParticipantIdentifier; + timestamp: Date; +} + +/** + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface BridgeResponseMessage { + meta: BridgeResponseMessageMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: string; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface BridgeResponseMessageMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * A request to broadcast context on a channel. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface BroadcastAgentRequest { + meta: BroadcastAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: BroadcastAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "broadcastRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface BroadcastAgentRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source: SourceObject; + timestamp: Date; +} + +/** + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + * + * Field that represents the source application that a request or response was received + * from, or the source Desktop Agent if it issued the request or response itself. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + */ +export interface SourceObject { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + * + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface BroadcastAgentRequestPayload { + /** + * The Id of the Channel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that is to be broadcast. + */ + context: Context; +} + +/** + * The context object that is to be broadcast. + * + * The context object that was the payload of a broadcast message. + * + * The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by + * FDC3 operations. As such, it is not really meant to be used on its own, but is imported + * by more specific type definitions (standardized or custom) to provide the structure and + * properties shared by all FDC3 context data types. + * + * The key element of FDC3 context types is their mandatory `type` property, which is used + * to identify what type of data the object represents, and what shape it has. + * + * The FDC3 context type, and all derived types, define the minimum set of fields a context + * data object of a particular type can be expected to have, but this can always be extended + * with custom fields as appropriate. + */ +export interface Context { + /** + * Context data objects may include a set of equivalent key-value pairs that can be used to + * help applications identify and look up the context type they receive in their own domain. + * The idea behind this design is that applications can provide as many equivalent + * identifiers to a target application as possible, e.g. an instrument may be represented by + * an ISIN, CUSIP or Bloomberg identifier. + * + * Identifiers do not make sense for all types of data, so the `id` property is therefore + * optional, but some derived types may choose to require at least one identifier. + * Identifier values SHOULD always be of type string. + */ + id?: { [key: string]: any }; + /** + * Context data objects may include a name property that can be used for more information, + * or display purposes. Some derived types may require the name object as mandatory, + * depending on use case. + */ + name?: string; + /** + * The type property is the only _required_ part of the FDC3 context data schema. The FDC3 + * [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present + * to route shared context data appropriately. + * + * FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data + * types they support in an FDC3 [App + * Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery + * and routing. + * + * Standardized FDC3 context types have well-known `type` properties prefixed with the + * `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and + * used by a particular organization, the convention is to prefix them with an + * organization-specific namespace, e.g. `blackrock.fund`. + * + * See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more + * information about context data types. + */ + type: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to broadcast context on a channel. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface BroadcastBridgeRequest { + meta: BroadcastBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: BroadcastBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "broadcastRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface BroadcastBridgeRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + */ +export interface MetaSource { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + * + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface BroadcastBridgeRequestPayload { + /** + * The Id of the Channel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that is to be broadcast. + */ + context: Context; +} + +/** + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStepMessage { + meta: ConnectionStepMetadata; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: { [key: string]: any }; + /** + * Identifies the type of the connection step message. + */ + type: ConnectionStepMessageType; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStepMetadata { + requestUuid?: string; + responseUuid?: string; + timestamp: Date; +} + +/** + * Identifies the type of the connection step message. + */ +export type ConnectionStepMessageType = "hello" | "handshake" | "authenticationFailed" | "connectedAgentsUpdate"; + +/** + * Hello message sent by the Bridge to anyone connecting to the Bridge (enables + * identification as a bridge and confirmation of whether authentication is required) + * + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStep2Hello { + meta: ConnectionStep2HelloMeta; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: ConnectionStep2HelloPayload; + /** + * Identifies the type of the connection step message. + */ + type: "hello"; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStep2HelloMeta { + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface ConnectionStep2HelloPayload { + /** + * A flag indicating whether the Desktop Agent Bridge requires authentication or not. + */ + authRequired: boolean; + /** + * An optional Desktop Agent Bridge JWT authentication token if the Desktop Agent want to + * authenticate a bridge. + */ + authToken?: string; + /** + * The version of the Bridge + */ + desktopAgentBridgeVersion: string; + /** + * The FDC3 versions supported by the Bridge + */ + supportedFDC3Versions: string[]; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Handshake message sent by the Desktop Agent to the Bridge (including requested name, + * channel state and authentication data) + * + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStep3Handshake { + meta: ConnectionStep3HandshakeMeta; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: ConnectionStep3HandshakePayload; + /** + * Identifies the type of the connection step message. + */ + type: "handshake"; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStep3HandshakeMeta { + requestUuid: string; + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface ConnectionStep3HandshakePayload { + authToken?: string; + /** + * 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]: Context[] }; + /** + * Desktop Agent ImplementationMetadata trying to connect to the bridge. + */ + implementationMetadata: ConnectingAgentImplementationMetadata; + /** + * The requested Desktop Agent name + */ + requestedName: string; +} + +/** + * Desktop Agent ImplementationMetadata trying to connect to the bridge. + * + * Metadata relating to the FDC3 Desktop Agent implementation and its provider. + */ +export interface ConnectingAgentImplementationMetadata { + /** + * The version number of the FDC3 specification that the implementation provides. + * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. + */ + fdc3Version: string; + /** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ + optionalFeatures: OptionalFeatures; + /** + * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, + * OpenFin etc.). + */ + provider: string; + /** + * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). + */ + providerVersion?: string; +} + +/** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ +export interface OptionalFeatures { + /** + * Used to indicate whether the experimental Desktop Agent Bridging + * feature is implemented by the Desktop Agent. + */ + DesktopAgentBridging: boolean; + /** + * Used to indicate whether the exposure of 'originating app metadata' for + * context and intent messages is supported by the Desktop Agent. + */ + OriginatingAppMetadata: boolean; + /** + * Used to indicate whether the optional `fdc3.joinUserChannel`, + * `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by + * the Desktop Agent. + */ + UserChannelMembershipAPIs: boolean; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Message sent by Bridge to Desktop Agent if their authentication fails. + * + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStep4AuthenticationFailed { + meta: ConnectionStep4AuthenticationFailedMeta; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: ConnectionStep4AuthenticationFailedPayload; + /** + * Identifies the type of the connection step message. + */ + type: "authenticationFailed"; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStep4AuthenticationFailedMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface ConnectionStep4AuthenticationFailedPayload { + message?: string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * Message sent by Bridge to all Desktop Agent when an agent joins or leaves the bridge, + * includes the details of all agents, the change made and the expected channel state for + * all agents. + * + * A message used during the connection flow for a Desktop Agent to the Bridge. Used for + * messages sent in either direction. + */ +export interface ConnectionStep6ConnectedAgentsUpdate { + meta: ConnectionStep6ConnectedAgentsUpdateMeta; + /** + * The message payload, containing data pertaining to this connection step. + */ + payload: ConnectionStep6ConnectedAgentsUpdatePayload; + /** + * Identifies the type of the connection step message. + */ + type: "connectedAgentsUpdate"; +} + +/** + * Metadata for this connection step message. + */ +export interface ConnectionStep6ConnectedAgentsUpdateMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload, containing data pertaining to this connection step. + */ +export interface ConnectionStep6ConnectedAgentsUpdatePayload { + /** + * Should be set when an agent first connects to the bridge and provide its assigned name. + */ + addAgent?: string; + /** + * Desktop Agent Bridge implementation metadata of all connected agents. + */ + allAgents: DesktopAgentImplementationMetadata[]; + /** + * The updated state of channels that should be adopted by the agents. Should only be set + * when an agent is connecting to the bridge. + */ + channelsState?: { [key: string]: Context[] }; + /** + * Should be set when an agent disconnects from the bridge and provide the name that no + * longer is assigned. + */ + removeAgent?: string; +} + +/** + * Includes the name assigned to the Desktop Agent by the Bridge. + * + * Metadata relating to the FDC3 Desktop Agent implementation and its provider. + */ +export interface DesktopAgentImplementationMetadata { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a particular Desktop + * Agent. + */ + desktopAgent: string; + /** + * The version number of the FDC3 specification that the implementation provides. + * The string must be a numeric semver version, e.g. 1.2 or 1.2.1. + */ + fdc3Version: string; + /** + * Metadata indicating whether the Desktop Agent implements optional features of + * the Desktop Agent API. + */ + optionalFeatures: OptionalFeatures; + /** + * The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42, + * OpenFin etc.). + */ + provider: string; + /** + * The version of the provider of the Desktop Agent implementation (e.g. 5.3.0). + */ + providerVersion?: string; +} + +/** + * Identifies the type of the connection step message. + */ + +/** + * A response to a findInstances request that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface FindInstancesAgentErrorResponse { + meta: FindInstancesAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: PayloadClass; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindInstancesAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface PayloadClass { + error: FindInstancesErrors; +} + +/** + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + * + * Should be set if the raiseIntent request returned an error. + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + * + * Array of error message strings for responses that were not returned to the bridge before + * the timeout or because an error occurred. Should be the same length as the `errorSources` + * array and ordered the same. May be omitted if all sources responded without errors. + * + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + */ +export type FindInstancesErrors = "DesktopAgentNotFound" | "IntentDeliveryFailed" | "MalformedContext" | "NoAppsFound" | "ResolverTimeout" | "ResolverUnavailable" | "TargetAppUnavailable" | "TargetInstanceUnavailable" | "UserCancelledResolution" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request for details of instances of a particular app + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface FindInstancesAgentRequest { + meta: FindInstancesAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindInstancesAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findInstancesRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface FindInstancesAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceIdentifier; + timestamp: Date; +} + +/** + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + * + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface DestinationObject { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindInstancesAgentRequestPayload { + app: AppIdentifier; +} + +/** + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppIdentifier { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a findInstances request. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface FindInstancesAgentResponse { + meta: AgentResponseMetadata; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindInstancesAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * The message payload contains a flag indicating whether the API call was successful, plus + * any return values for the FDC3 API function called, or indicating that the request + * resulted in an error and including a standardized error message. + * + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindInstancesAgentResponsePayload { + appIdentifiers: AppMetadata[]; +} + +/** + * Extends an `AppIdentifier`, describing an application or instance of an application, with + * additional descriptive metadata that is usually provided by an FDC3 App Directory that + * the desktop agent connects to. + * + * The additional information from an app directory can aid in rendering UI elements, such + * as a launcher menu or resolver UI. This includes a title, description, tooltip and icon + * and screenshot URLs. + * + * Note that as `AppMetadata` instances are also `AppIdentifiers` they may be passed to the + * `app` argument of `fdc3.open`, `fdc3.raiseIntent` etc. + */ +export interface AppMetadata { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * A longer, multi-paragraph description for the application that could include markup + */ + description?: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent?: string; + /** + * A list of icon URLs for the application that can be used to render UI elements + */ + icons?: Icon[]; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + /** + * An optional set of, implementation specific, metadata fields that can be used to + * disambiguate instances, such as a window title or screen position. Must only be set if + * `instanceId` is set. + */ + instanceMetadata?: { [key: string]: any }; + /** + * The 'friendly' app name. + * This field was used with the `open` and `raiseIntent` calls in FDC3 <2.0, which now + * require an `AppIdentifier` wth `appId` set. + * Note that for display purposes the `title` field should be used, if set, in preference to + * this field. + */ + name?: string; + /** + * The type of output returned for any intent specified during resolution. May express a + * particular context type (e.g. "fdc3.instrument"), channel (e.g. "channel") or a channel + * that will receive a specified type (e.g. "channel"). + */ + resultType?: null | string; + /** + * Images representing the app in common usage scenarios that can be used to render UI + * elements + */ + screenshots?: Image[]; + /** + * A more user-friendly application title that can be used to render UI elements + */ + title?: string; + /** + * A tooltip for the application that can be used to render UI elements + */ + tooltip?: string; + /** + * The Version of the application. + */ + version?: string; +} + +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ +export interface Icon { + /** + * The icon dimension, formatted as `x`. + */ + size?: string; + /** + * The icon url + */ + src: string; + /** + * Icon media type. If not present the Desktop Agent may use the src file extension. + */ + type?: string; +} + +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright FINOS FDC3 contributors - see NOTICE file + */ +export interface Image { + /** + * Caption for the image. + */ + label?: string; + /** + * The image dimension, formatted as `x`. + */ + size?: string; + /** + * The image url. + */ + src: string; + /** + * Image media type. If not present the Desktop Agent may use the src file extension. + */ + type?: string; +} + +/** + * A response to a findInstances request that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface FindInstancesBridgeErrorResponse { + meta: FindInstancesBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: MessagePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindInstancesBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface MessagePayload { + error: FindInstancesErrors; +} + +/** + * A request for details of instances of a particular app + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface FindInstancesBridgeRequest { + meta: FindInstancesBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindInstancesBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findInstancesRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface FindInstancesBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSourceObject; + timestamp: Date; +} + +/** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + * + * Field that represents the source application that a request or response was received + * from, or the source Desktop Agent if it issued the request or response itself. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + * + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + */ +export interface MetaSourceObject { + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId?: string; + /** + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + * + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + */ + desktopAgent: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindInstancesBridgeRequestPayload { + app: AppIdentifier; +} + +/** + * A response to a findInstances request. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface FindInstancesBridgeResponse { + meta: BridgeResponseMessageMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindInstancesBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findInstancesResponse"; +} + +/** + * The message payload contains a flag indicating whether the API call was successful, plus + * any return values for the FDC3 API function called, or indicating that the request + * resulted in an error and including a standardized error message. + * + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindInstancesBridgeResponsePayload { + appIdentifiers: AppMetadata[]; +} + +/** + * A response to a findIntent request that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface FindIntentAgentErrorResponse { + meta: FindIntentAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: FindIntentAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindIntentAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface FindIntentAgentErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request for details of apps available to resolve a particular intent and context pair. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface FindIntentAgentRequest { + meta: FindIntentAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface FindIntentAgentRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceIdentifier; + timestamp: Date; + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentAgentRequestPayload { + context?: Context; + intent: string; + resultType?: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a findIntent request. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface FindIntentAgentResponse { + meta: FindIntentAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindIntentAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindIntentAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindIntentAgentResponsePayload { + appIntent: AppIntent; +} + +/** + * An interface that relates an intent to apps + */ +export interface AppIntent { + /** + * Details of applications that can resolve the intent. + */ + apps: AppMetadata[]; + /** + * Details of the intent whose relationship to resolving applications is being described. + */ + intent: IntentMetadata; +} + +/** + * Details of the intent whose relationship to resolving applications is being described. + * + * Intent descriptor + */ +export interface IntentMetadata { + /** + * Display name for the intent. + */ + displayName?: string; + /** + * The unique name of the intent that can be invoked by the raiseIntent call + */ + name: string; +} + +/** + * A response to a findIntent request that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface FindIntentBridgeErrorResponse { + meta: FindIntentBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: FindIntentBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindIntentBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface FindIntentBridgeErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * A request for details of apps available to resolve a particular intent and context pair. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface FindIntentBridgeRequest { + meta: FindIntentBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface FindIntentBridgeRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: BridgeParticipantIdentifier; + timestamp: Date; + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentBridgeRequestPayload { + context?: Context; + intent: string; + resultType?: string; +} + +/** + * A response to a findIntent request. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface FindIntentBridgeResponse { + meta: FindIntentBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindIntentBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindIntentBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindIntentBridgeResponsePayload { + appIntent: AppIntent; +} + +/** + * A response to a findIntentsByContext request that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface FindIntentsByContextAgentErrorResponse { + meta: FindIntentsByContextAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: FindIntentsByContextAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindIntentsByContextAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface FindIntentsByContextAgentErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request for details of intents and apps available to resolve them for a particular + * context. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface FindIntentsByContextAgentRequest { + meta: FindIntentsByContextAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentsByContextAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentsByContextRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface FindIntentsByContextAgentRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentsByContextAgentRequestPayload { + context: Context; + resultType?: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a findIntentsByContext request. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface FindIntentsByContextAgentResponse { + meta: FindIntentsByContextAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindIntentsByContextAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface FindIntentsByContextAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindIntentsByContextAgentResponsePayload { + appIntents: AppIntent[]; +} + +/** + * A response to a findIntentsByContext request that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface FindIntentsByContextBridgeErrorResponse { + meta: FindIntentsByContextBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: FindIntentsByContextBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindIntentsByContextBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface FindIntentsByContextBridgeErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * A request for details of intents and apps available to resolve them for a particular + * context. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface FindIntentsByContextBridgeRequest { + meta: FindIntentsByContextBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: FindIntentsByContextBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "findIntentsByContextRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface FindIntentsByContextBridgeRequestMeta { + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: BridgeParticipantIdentifier; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface FindIntentsByContextBridgeRequestPayload { + context: Context; + resultType?: string; +} + +/** + * A response to a findIntentsByContext request. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface FindIntentsByContextBridgeResponse { + meta: FindIntentsByContextBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: FindIntentsByContextBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "findIntentsByContextResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface FindIntentsByContextBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface FindIntentsByContextBridgeResponsePayload { + appIntents: AppIntent[]; +} + +/** + * A response to a getAppMetadata request that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface GetAppMetadataAgentErrorResponse { + meta: GetAppMetadataAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: GetAppMetadataAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface GetAppMetadataAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface GetAppMetadataAgentErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request for metadata about an app + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface GetAppMetadataAgentRequest { + meta: GetAppMetadataAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetAppMetadataAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getAppMetadataRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface GetAppMetadataAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceIdentifier; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetAppMetadataAgentRequestPayload { + app: AppObject; +} + +/** + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppObject { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a getAppMetadata request. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface GetAppMetadataAgentResponse { + meta: GetAppMetadataAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: GetAppMetadataAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface GetAppMetadataAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface GetAppMetadataAgentResponsePayload { + appMetadata: AppMetadata; +} + +/** + * A response to a getAppMetadata request that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface GetAppMetadataBridgeErrorResponse { + meta: GetAppMetadataBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: GetAppMetadataBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface GetAppMetadataBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface GetAppMetadataBridgeErrorResponsePayload { + error: FindInstancesErrors; +} + +/** + * A request for metadata about an app + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface GetAppMetadataBridgeRequest { + meta: GetAppMetadataBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: GetAppMetadataBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "getAppMetadataRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface GetAppMetadataBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface GetAppMetadataBridgeRequestPayload { + app: AppObject; +} + +/** + * A response to a getAppMetadata request. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface GetAppMetadataBridgeResponse { + meta: GetAppMetadataBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: GetAppMetadataBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "getAppMetadataResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface GetAppMetadataBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface GetAppMetadataBridgeResponsePayload { + appMetadata: AppMetadata; +} + +/** + * A response to an open request that contains an error + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface OpenAgentErrorResponse { + meta: OpenAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: OpenAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface OpenAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface OpenAgentErrorResponsePayload { + error: OpenErrorResponsePayload; +} + +/** + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Array of error message strings for responses that were not returned to the bridge before + * the timeout or because an error occurred. Should be the same length as the `errorSources` + * array and ordered the same. May be omitted if all sources responded without errors. + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type OpenErrorResponsePayload = "AppNotFound" | "AppTimeout" | "DesktopAgentNotFound" | "ErrorOnLaunch" | "MalformedContext" | "ResolverUnavailable" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to open an application + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface OpenAgentRequest { + meta: OpenAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: OpenAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "openRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface OpenAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface OpenAgentRequestPayload { + /** + * The application to open on the specified Desktop Agent + */ + app: AppToOpen; + context?: Context; +} + +/** + * The application to open on the specified Desktop Agent + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppToOpen { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to an open request + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface OpenAgentResponse { + meta: OpenAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: OpenAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface OpenAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface OpenAgentResponsePayload { + appIdentifier: AppIdentifier; +} + +/** + * A response to an open request that contains an error + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface OpenBridgeErrorResponse { + meta: OpenBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: OpenBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface OpenBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface OpenBridgeErrorResponsePayload { + error: OpenErrorResponsePayload; +} + +/** + * A request to open an application + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface OpenBridgeRequest { + meta: OpenBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: OpenBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "openRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface OpenBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: DestinationObject; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface OpenBridgeRequestPayload { + /** + * The application to open on the specified Desktop Agent + */ + app: AppToOpen; + context?: Context; +} + +/** + * A response to an open request + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface OpenBridgeResponse { + meta: OpenBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: OpenBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "openResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface OpenBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface OpenBridgeResponsePayload { + appIdentifier: AppIdentifier; +} + +/** + * A request to broadcast on a PrivateChannel. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelBroadcastAgentRequest { + meta: PrivateChannelBroadcastAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelBroadcastAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.broadcast"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelBroadcastAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + * + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + * + * Represents identifiers that MUST include the Desktop Agent name and MAY identify a + * specific app or instance. + * + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ +export interface MetaDestination { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelBroadcastAgentRequestPayload { + /** + * The Id of the PrivateChannel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that was the payload of a broadcast message. + */ + context: Context; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to broadcast on a PrivateChannel. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelBroadcastBridgeRequest { + meta: PrivateChannelBroadcastBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelBroadcastBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.broadcast"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelBroadcastBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelBroadcastBridgeRequestPayload { + /** + * The Id of the PrivateChannel that the broadcast was sent on + */ + channelId: string; + /** + * The context object that was the payload of a broadcast message. + */ + context: Context; +} + +/** + * A request to forward on an EventListenerAdded event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelEventListenerAddedAgentRequest { + meta: PrivateChannelEventListenerAddedAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelEventListenerAddedAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.eventListenerAdded"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelEventListenerAddedAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelEventListenerAddedAgentRequestPayload { + /** + * The id of the PrivateChannel that the event listener was added to. + */ + channelId: string; + listenerType: PrivateChannelEventListenerTypes; +} + +/** + * Event listener type names for Private Channel events + */ +export type PrivateChannelEventListenerTypes = "onAddContextListener" | "onUnsubscribe" | "onDisconnect"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on an EventListenerAdded event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelEventListenerAddedBridgeRequest { + meta: PrivateChannelEventListenerAddedBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelEventListenerAddedBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.eventListenerAdded"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelEventListenerAddedBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelEventListenerAddedBridgeRequestPayload { + /** + * The id of the PrivateChannel that the event listener was added to. + */ + channelId: string; + listenerType: PrivateChannelEventListenerTypes; +} + +/** + * A request to forward on an EventListenerRemoved event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelEventListenerRemovedAgentRequest { + meta: PrivateChannelEventListenerRemovedAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelEventListenerRemovedAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.eventListenerRemoved"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelEventListenerRemovedAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelEventListenerRemovedAgentRequestPayload { + /** + * The id of the PrivateChannel that the event listener was removed from. + */ + channelId: string; + listenerType: PrivateChannelEventListenerTypes; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on an EventListenerRemoved event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelEventListenerRemovedBridgeRequest { + meta: PrivateChannelEventListenerRemovedBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelEventListenerRemovedBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.eventListenerRemoved"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelEventListenerRemovedBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelEventListenerRemovedBridgeRequestPayload { + /** + * The id of the PrivateChannel that the event listener was removed from. + */ + channelId: string; + listenerType: PrivateChannelEventListenerTypes; +} + +/** + * A request to forward on an AddContextListener event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelOnAddContextListenerAgentRequest { + meta: PrivateChannelOnAddContextListenerAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnAddContextListenerAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onAddContextListener"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelOnAddContextListenerAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnAddContextListenerAgentRequestPayload { + /** + * The id of the PrivateChannel that the context listener was added to. + */ + channelId: string; + /** + * The type of the context listener added. Should be null for an untyped listener. + */ + contextType: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on an AddContextListener event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelOnAddContextListenerBridgeRequest { + meta: PrivateChannelOnAddContextListenerBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnAddContextListenerBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onAddContextListener"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelOnAddContextListenerBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnAddContextListenerBridgeRequestPayload { + /** + * The id of the PrivateChannel that the context listener was added to. + */ + channelId: string; + /** + * The type of the context listener added. Should be null for an untyped listener. + */ + contextType: null | string; +} + +/** + * A request to forward on a Disconnect event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelOnDisconnectAgentRequest { + meta: PrivateChannelOnDisconnectAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnDisconnectAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onDisconnect"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelOnDisconnectAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnDisconnectAgentRequestPayload { + /** + * The id of the PrivateChannel that the agent discconnected from. + */ + channelId: string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on a Disconnect event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelOnDisconnectBridgeRequest { + meta: PrivateChannelOnDisconnectBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnDisconnectBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onDisconnect"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface PrivateChannelOnDisconnectBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnDisconnectBridgeRequestPayload { + /** + * The id of the PrivateChannel that the agent discconnected from. + */ + channelId: string; +} + +/** + * A request to forward on an Unsubscribe event, relating to a PrivateChannel + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface PrivateChannelOnUnsubscribeAgentRequest { + meta: PrivateChannelOnUnsubscribeAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnUnsubscribeAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onUnsubscribe"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface PrivateChannelOnUnsubscribeAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source?: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnUnsubscribeAgentRequestPayload { + /** + * The id of the PrivateChannel that the context listener was unsubscribed from. + */ + channelId: string; + /** + * The type of the context listener that was unsubscribed. Should be null for an untyped + * listener. + */ + contextType: null | string; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to forward on an Unsubscribe event, relating to a PrivateChannel + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface PrivateChannelOnUnsubscribeBridgeRequest { + meta: ERequestMetadata; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: PrivateChannelOnUnsubscribeBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "PrivateChannel.onUnsubscribe"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface ERequestMetadata { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination?: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface PrivateChannelOnUnsubscribeBridgeRequestPayload { + /** + * The id of the PrivateChannel that the context listener was unsubscribed from. + */ + channelId: string; + /** + * The type of the context listener that was unsubscribed. Should be null for an untyped + * listener. + */ + contextType: null | string; +} + +/** + * A response to a request to raise an intent that contains an error. + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface RaiseIntentAgentErrorResponse { + meta: RaiseIntentAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: RaiseIntentAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface RaiseIntentAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Used if a raiseIntent request resulted in an error + * + * Error message payload containing an standardized error string. + */ +export interface RaiseIntentAgentErrorResponsePayload { + /** + * Should be set if the raiseIntent request returned an error. + */ + error: FindInstancesErrors; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A request to raise an intent. + * + * A request message from a Desktop Agent to the Bridge. + */ +export interface RaiseIntentAgentRequest { + meta: RaiseIntentAgentRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: RaiseIntentAgentRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "raiseIntentRequest"; +} + +/** + * Metadata for a request message sent by Desktop Agents to the Bridge. + */ +export interface RaiseIntentAgentRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. + */ + source: SourceObject; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface RaiseIntentAgentRequestPayload { + app: AppDestinationIdentifier; + context: Context; + intent: string; +} + +/** + * Field that represents a destination App on a remote Desktop Agent that a request is to be + * sent to. + * + * Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios + * where a request needs to be directed to a Desktop Agent rather than a specific app, or a + * response message is returned by the Desktop Agent (or more specifically its resolver) + * rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no + * app details are available or are appropriate. + * + * Array of DesktopAgentIdentifiers for responses that were not returned to the bridge + * before the timeout or because an error occurred. May be omitted if all sources responded + * without errors. MUST include the `desktopAgent` field when returned by the bridge. + * + * Array of DesktopAgentIdentifiers for the sources that generated responses to the request. + * Will contain a single value for individual responses and multiple values for responses + * that were collated by the bridge. May be omitted if all sources errored. MUST include the + * `desktopAgent` field when returned by the bridge. + * + * Field that represents a destination Desktop Agent that a request is to be sent to. + * + * Identifies an application, or instance of an application, and is used to target FDC3 API + * calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application + * instances. + * + * Will always include at least an `appId` field, which uniquely identifies a specific app. + * + * If the `instanceId` field is set then the `AppMetadata` object represents a specific + * instance of the application that may be addressed using that Id. + * + * Field that represents the source application that a request or response was received + * from. + * + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ +export interface AppDestinationIdentifier { + /** + * Used in Desktop Agent Bridging to attribute or target a message to a + * particular Desktop Agent. + * + * The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to + * identify the Desktop Agent to target. + */ + desktopAgent: string; + /** + * The unique application identifier located within a specific application directory + * instance. An example of an appId might be 'app@sub.root' + */ + appId: string; + /** + * An optional instance identifier, indicating that this object represents a specific + * instance of the application described. + */ + instanceId?: string; + [property: string]: any; +} + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A response to a request to raise an intent. + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface RaiseIntentAgentResponse { + meta: RaiseIntentAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: RaiseIntentAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface RaiseIntentAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface RaiseIntentAgentResponsePayload { + /** + * Used if the raiseIntent request was successfully resolved + */ + intentResolution: IntentResolution; +} + +/** + * Used if the raiseIntent request was successfully resolved + * + * IntentResolution provides a standard format for data returned upon resolving an intent. + * + * ```javascript + * //resolve a "Chain" type intent + * let resolution = await agent.raiseIntent("intentName", context); + * + * //resolve a "Client-Service" type intent with a data response or a Channel + * let resolution = await agent.raiseIntent("intentName", context); + * try { + * const result = await resolution.getResult(); + * if (result && result.broadcast) { + * console.log(`${resolution.source} returned a channel with id ${result.id}`); + * } else if (result){ + * console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`); + * } else { + * console.error(`${resolution.source} didn't return data` + * } + * } catch(error) { + * console.error(`${resolution.source} returned an error: ${error}`); + * } + * + * // Use metadata about the resolving app instance to target a further intent + * await agent.raiseIntent("intentName", context, resolution.source); + * ``` + */ +export interface IntentResolution { + /** + * The intent that was raised. May be used to determine which intent the user + * chose in response to `fdc3.raiseIntentForContext()`. + */ + intent: string; + /** + * Identifier for the app instance that was selected (or started) to resolve the intent. + * `source.instanceId` MUST be set, indicating the specific app instance that + * received the intent. + */ + source: AppIdentifier; +} + +/** + * A response to a request to raise an intent that contains an error. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface RaiseIntentBridgeErrorResponse { + meta: RaiseIntentBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: RaiseIntentBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface RaiseIntentBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Used if a raiseIntent request resulted in an error + * + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface RaiseIntentBridgeErrorResponsePayload { + /** + * Should be set if the raiseIntent request returned an error. + */ + error: FindInstancesErrors; +} + +/** + * A request to raise an intent. + * + * A request message forwarded from the Bridge onto a Desktop Agent connected to it. + */ +export interface RaiseIntentBridgeRequest { + meta: RaiseIntentBridgeRequestMeta; + /** + * The message payload typically contains the arguments to FDC3 API functions. + */ + payload: RaiseIntentBridgeRequestPayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Request' appended. + */ + type: "raiseIntentRequest"; +} + +/** + * Metadata required in a request message forwarded on by the Bridge + */ +export interface RaiseIntentBridgeRequestMeta { + /** + * Optional field that represents the destination that the request should be routed to. Must + * be set by the Desktop Agent for API calls that include a target app parameter and must + * include the name of the Desktop Agent hosting the target application. + */ + destination: MetaDestination; + requestUuid: string; + /** + * Field that represents the source application that the request was received from, or the + * source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST + * be set by the bridge. + */ + source: MetaSource; + timestamp: Date; +} + +/** + * The message payload typically contains the arguments to FDC3 API functions. + */ +export interface RaiseIntentBridgeRequestPayload { + app: AppDestinationIdentifier; + context: Context; + intent: string; +} + +/** + * A response to a request to raise an intent. + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface RaiseIntentBridgeResponse { + meta: RaiseIntentBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: RaiseIntentBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface RaiseIntentBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface RaiseIntentBridgeResponsePayload { + /** + * Used if the raiseIntent request was successfully resolved + */ + intentResolution: IntentResolution; +} + +/** + * A secondary response to a request to raise an intent used to deliver the intent result, + * which contains an error + * + * A response message from a Desktop Agent to the Bridge containing an error, to be used in + * preference to the standard response when an error needs to be returned. + */ +export interface RaiseIntentResultAgentErrorResponse { + meta: RaiseIntentResultAgentErrorResponseMeta; + /** + * Error message payload containing an standardized error string. + */ + payload: RaiseIntentResultAgentErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface RaiseIntentResultAgentErrorResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * Error message payload containing an standardized error string. + */ +export interface RaiseIntentResultAgentErrorResponsePayload { + error: RaiseIntentResultErrorMessage; +} + +/** + * Array of error message strings for responses that were not returned to the bridge before + * the timeout or because an error occurred. Should be the same length as the `errorSources` + * array and ordered the same. May be omitted if all sources responded without errors. + * + * Constants representing the errors that can be encountered when calling the `open` method + * on the DesktopAgent object (`fdc3`). + * + * Constants representing the errors that can be encountered when calling the `findIntent`, + * `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the + * DesktopAgent (`fdc3`). + */ +export type RaiseIntentResultErrorMessage = "IntentHandlerRejected" | "NoResultReturned" | "AgentDisconnected" | "NotConnectedToBridge" | "ResponseToBridgeTimedOut" | "MalformedMessage"; + +/** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + * + * Unique identifier for a request or event message. Required in all message types + * + * Unique identifier for a response to a specific message and must always be accompanied by + * a RequestUuid. + */ + +/** + * A secondary response to a request to raise an intent used to deliver the intent result + * + * A response message from a Desktop Agent to the Bridge. + */ +export interface RaiseIntentResultAgentResponse { + meta: RaiseIntentResultAgentResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: RaiseIntentResultAgentResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * Metadata for a response messages sent by a Desktop Agent to the Bridge + */ +export interface RaiseIntentResultAgentResponseMeta { + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface RaiseIntentResultAgentResponsePayload { + intentResult: IntentResult; +} + +export interface IntentResult { + context?: Context; + channel?: Channel; +} + +/** + * Represents a context channel that applications can use to send and receive + * context data. + * + * Please note that There are differences in behavior when you interact with a + * User channel via the `DesktopAgent` interface and the `Channel` interface. + * Specifically, when 'joining' a User channel or adding a context listener + * when already joined to a channel via the `DesktopAgent` interface, existing + * context (matching the type of the context listener) on the channel is + * received by the context listener immediately. Whereas, when a context + * listener is added via the Channel interface, context is not received + * automatically, but may be retrieved manually via the `getCurrentContext()` + * function. + */ +export interface Channel { + /** + * Channels may be visualized and selectable by users. DisplayMetadata may be used to + * provide hints on how to see them. + * For App channels, displayMetadata would typically not be present. + */ + displayMetadata?: DisplayMetadata; + /** + * Constant that uniquely identifies this channel. + */ + id: string; + /** + * Uniquely defines each channel type. + * Can be "user", "app" or "private". + */ + type: Type; +} + +/** + * Channels may be visualized and selectable by users. DisplayMetadata may be used to + * provide hints on how to see them. + * For App channels, displayMetadata would typically not be present. + * + * A system channel will be global enough to have a presence across many apps. This gives us + * some hints + * to render them in a standard way. It is assumed it may have other properties too, but if + * it has these, + * this is their meaning. + */ +export interface DisplayMetadata { + /** + * The color that should be associated within this channel when displaying this channel in a + * UI, e.g: `0xFF0000`. + */ + color?: string; + /** + * A URL of an image that can be used to display this channel + */ + glyph?: string; + /** + * A user-readable name for this channel, e.g: `"Red"` + */ + name?: string; +} + +/** + * Uniquely defines each channel type. + * Can be "user", "app" or "private". + */ +export type Type = "app" | "private" | "user"; + +/** + * A secondary response to a request to raise an intent used to deliver the intent result, + * which contains an error + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request, used where all connected agents returned errors. + */ +export interface RaiseIntentResultBridgeErrorResponse { + meta: RaiseIntentResultBridgeErrorResponseMeta; + /** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ + payload: RaiseIntentResultBridgeErrorResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface RaiseIntentResultBridgeErrorResponseMeta { + errorDetails: ResponseErrorDetail[]; + errorSources: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + timestamp: Date; +} + +/** + * The error message payload contains details of an error return to the app or agent that + * raised the original request. + */ +export interface RaiseIntentResultBridgeErrorResponsePayload { + error: RaiseIntentResultErrorMessage; +} + +/** + * A secondary response to a request to raise an intent used to deliver the intent result + * + * A response message from the Bridge back to the original Desktop Agent that raised the + * request. + */ +export interface RaiseIntentResultBridgeResponse { + meta: RaiseIntentResultBridgeResponseMeta; + /** + * The message payload typically contains return values for FDC3 API functions. + */ + payload: RaiseIntentResultBridgeResponsePayload; + /** + * Identifies the type of the message and it is typically set to the FDC3 function name that + * the message relates to, e.g. 'findIntent', with 'Response' appended. + */ + type: "raiseIntentResultResponse"; +} + +/** + * Metadata required in a response message collated and/or forwarded on by the Bridge + */ +export interface RaiseIntentResultBridgeResponseMeta { + errorDetails?: ResponseErrorDetail[]; + errorSources?: DesktopAgentIdentifier[]; + requestUuid: string; + responseUuid: string; + sources?: DesktopAgentIdentifier[]; + timestamp: Date; +} + +/** + * The message payload typically contains return values for FDC3 API functions. + */ +export interface RaiseIntentResultBridgeResponsePayload { + intentResult: IntentResult; +} + +// Converts JSON strings to/from your types +// and asserts the results of JSON.parse at runtime +export class Convert { + public static toAgentErrorResponseMessage(json: string): AgentErrorResponseMessage { + return cast(JSON.parse(json), r("AgentErrorResponseMessage")); + } + + public static agentErrorResponseMessageToJson(value: AgentErrorResponseMessage): string { + return JSON.stringify(uncast(value, r("AgentErrorResponseMessage")), null, 2); + } + + public static toAgentRequestMessage(json: string): AgentRequestMessage { + return cast(JSON.parse(json), r("AgentRequestMessage")); + } + + public static agentRequestMessageToJson(value: AgentRequestMessage): string { + return JSON.stringify(uncast(value, r("AgentRequestMessage")), null, 2); + } + + public static toAgentResponseMessage(json: string): AgentResponseMessage { + return cast(JSON.parse(json), r("AgentResponseMessage")); + } + + public static agentResponseMessageToJson(value: AgentResponseMessage): string { + return JSON.stringify(uncast(value, r("AgentResponseMessage")), null, 2); + } + + public static toBridgeErrorResponseMessage(json: string): BridgeErrorResponseMessage { + return cast(JSON.parse(json), r("BridgeErrorResponseMessage")); + } + + public static bridgeErrorResponseMessageToJson(value: BridgeErrorResponseMessage): string { + return JSON.stringify(uncast(value, r("BridgeErrorResponseMessage")), null, 2); + } + + public static toBridgeRequestMessage(json: string): BridgeRequestMessage { + return cast(JSON.parse(json), r("BridgeRequestMessage")); + } + + public static bridgeRequestMessageToJson(value: BridgeRequestMessage): string { + return JSON.stringify(uncast(value, r("BridgeRequestMessage")), null, 2); + } + + public static toBridgeResponseMessage(json: string): BridgeResponseMessage { + return cast(JSON.parse(json), r("BridgeResponseMessage")); + } + + public static bridgeResponseMessageToJson(value: BridgeResponseMessage): string { + return JSON.stringify(uncast(value, r("BridgeResponseMessage")), null, 2); + } + + public static toBroadcastAgentRequest(json: string): BroadcastAgentRequest { + return cast(JSON.parse(json), r("BroadcastAgentRequest")); + } + + public static broadcastAgentRequestToJson(value: BroadcastAgentRequest): string { + return JSON.stringify(uncast(value, r("BroadcastAgentRequest")), null, 2); + } + + public static toBroadcastBridgeRequest(json: string): BroadcastBridgeRequest { + return cast(JSON.parse(json), r("BroadcastBridgeRequest")); + } + + public static broadcastBridgeRequestToJson(value: BroadcastBridgeRequest): string { + return JSON.stringify(uncast(value, r("BroadcastBridgeRequest")), null, 2); + } + + public static toBridgeCommonDefinitions(json: string): { [key: string]: any } { + return cast(JSON.parse(json), m("any")); + } + + public static bridgeCommonDefinitionsToJson(value: { [key: string]: any }): string { + return JSON.stringify(uncast(value, m("any")), null, 2); + } + + public static toConnectionStepMessage(json: string): ConnectionStepMessage { + return cast(JSON.parse(json), r("ConnectionStepMessage")); + } + + public static connectionStepMessageToJson(value: ConnectionStepMessage): string { + return JSON.stringify(uncast(value, r("ConnectionStepMessage")), null, 2); + } + + public static toConnectionStep2Hello(json: string): ConnectionStep2Hello { + return cast(JSON.parse(json), r("ConnectionStep2Hello")); + } + + public static connectionStep2HelloToJson(value: ConnectionStep2Hello): string { + return JSON.stringify(uncast(value, r("ConnectionStep2Hello")), null, 2); + } + + public static toConnectionStep3Handshake(json: string): ConnectionStep3Handshake { + return cast(JSON.parse(json), r("ConnectionStep3Handshake")); + } + + public static connectionStep3HandshakeToJson(value: ConnectionStep3Handshake): string { + return JSON.stringify(uncast(value, r("ConnectionStep3Handshake")), null, 2); + } + + public static toConnectionStep4AuthenticationFailed(json: string): ConnectionStep4AuthenticationFailed { + return cast(JSON.parse(json), r("ConnectionStep4AuthenticationFailed")); + } + + public static connectionStep4AuthenticationFailedToJson(value: ConnectionStep4AuthenticationFailed): string { + return JSON.stringify(uncast(value, r("ConnectionStep4AuthenticationFailed")), null, 2); + } + + public static toConnectionStep6ConnectedAgentsUpdate(json: string): ConnectionStep6ConnectedAgentsUpdate { + return cast(JSON.parse(json), r("ConnectionStep6ConnectedAgentsUpdate")); + } + + public static connectionStep6ConnectedAgentsUpdateToJson(value: ConnectionStep6ConnectedAgentsUpdate): string { + return JSON.stringify(uncast(value, r("ConnectionStep6ConnectedAgentsUpdate")), null, 2); + } + + public static toFindInstancesAgentErrorResponse(json: string): FindInstancesAgentErrorResponse { + return cast(JSON.parse(json), r("FindInstancesAgentErrorResponse")); + } + + public static findInstancesAgentErrorResponseToJson(value: FindInstancesAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesAgentErrorResponse")), null, 2); + } + + public static toFindInstancesAgentRequest(json: string): FindInstancesAgentRequest { + return cast(JSON.parse(json), r("FindInstancesAgentRequest")); + } + + public static findInstancesAgentRequestToJson(value: FindInstancesAgentRequest): string { + return JSON.stringify(uncast(value, r("FindInstancesAgentRequest")), null, 2); + } + + public static toFindInstancesAgentResponse(json: string): FindInstancesAgentResponse { + return cast(JSON.parse(json), r("FindInstancesAgentResponse")); + } + + public static findInstancesAgentResponseToJson(value: FindInstancesAgentResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesAgentResponse")), null, 2); + } + + public static toFindInstancesBridgeErrorResponse(json: string): FindInstancesBridgeErrorResponse { + return cast(JSON.parse(json), r("FindInstancesBridgeErrorResponse")); + } + + public static findInstancesBridgeErrorResponseToJson(value: FindInstancesBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesBridgeErrorResponse")), null, 2); + } + + public static toFindInstancesBridgeRequest(json: string): FindInstancesBridgeRequest { + return cast(JSON.parse(json), r("FindInstancesBridgeRequest")); + } + + public static findInstancesBridgeRequestToJson(value: FindInstancesBridgeRequest): string { + return JSON.stringify(uncast(value, r("FindInstancesBridgeRequest")), null, 2); + } + + public static toFindInstancesBridgeResponse(json: string): FindInstancesBridgeResponse { + return cast(JSON.parse(json), r("FindInstancesBridgeResponse")); + } + + public static findInstancesBridgeResponseToJson(value: FindInstancesBridgeResponse): string { + return JSON.stringify(uncast(value, r("FindInstancesBridgeResponse")), null, 2); + } + + public static toFindIntentAgentErrorResponse(json: string): FindIntentAgentErrorResponse { + return cast(JSON.parse(json), r("FindIntentAgentErrorResponse")); + } + + public static findIntentAgentErrorResponseToJson(value: FindIntentAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("FindIntentAgentErrorResponse")), null, 2); + } + + public static toFindIntentAgentRequest(json: string): FindIntentAgentRequest { + return cast(JSON.parse(json), r("FindIntentAgentRequest")); + } + + public static findIntentAgentRequestToJson(value: FindIntentAgentRequest): string { + return JSON.stringify(uncast(value, r("FindIntentAgentRequest")), null, 2); + } + + public static toFindIntentAgentResponse(json: string): FindIntentAgentResponse { + return cast(JSON.parse(json), r("FindIntentAgentResponse")); + } + + public static findIntentAgentResponseToJson(value: FindIntentAgentResponse): string { + return JSON.stringify(uncast(value, r("FindIntentAgentResponse")), null, 2); + } + + public static toFindIntentBridgeErrorResponse(json: string): FindIntentBridgeErrorResponse { + return cast(JSON.parse(json), r("FindIntentBridgeErrorResponse")); + } + + public static findIntentBridgeErrorResponseToJson(value: FindIntentBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("FindIntentBridgeErrorResponse")), null, 2); + } + + public static toFindIntentBridgeRequest(json: string): FindIntentBridgeRequest { + return cast(JSON.parse(json), r("FindIntentBridgeRequest")); + } + + public static findIntentBridgeRequestToJson(value: FindIntentBridgeRequest): string { + return JSON.stringify(uncast(value, r("FindIntentBridgeRequest")), null, 2); + } + + public static toFindIntentBridgeResponse(json: string): FindIntentBridgeResponse { + return cast(JSON.parse(json), r("FindIntentBridgeResponse")); + } + + public static findIntentBridgeResponseToJson(value: FindIntentBridgeResponse): string { + return JSON.stringify(uncast(value, r("FindIntentBridgeResponse")), null, 2); + } + + public static toFindIntentsByContextAgentErrorResponse(json: string): FindIntentsByContextAgentErrorResponse { + return cast(JSON.parse(json), r("FindIntentsByContextAgentErrorResponse")); + } + + public static findIntentsByContextAgentErrorResponseToJson(value: FindIntentsByContextAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextAgentErrorResponse")), null, 2); + } + + public static toFindIntentsByContextAgentRequest(json: string): FindIntentsByContextAgentRequest { + return cast(JSON.parse(json), r("FindIntentsByContextAgentRequest")); + } + + public static findIntentsByContextAgentRequestToJson(value: FindIntentsByContextAgentRequest): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextAgentRequest")), null, 2); + } + + public static toFindIntentsByContextAgentResponse(json: string): FindIntentsByContextAgentResponse { + return cast(JSON.parse(json), r("FindIntentsByContextAgentResponse")); + } + + public static findIntentsByContextAgentResponseToJson(value: FindIntentsByContextAgentResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextAgentResponse")), null, 2); + } + + public static toFindIntentsByContextBridgeErrorResponse(json: string): FindIntentsByContextBridgeErrorResponse { + return cast(JSON.parse(json), r("FindIntentsByContextBridgeErrorResponse")); + } + + public static findIntentsByContextBridgeErrorResponseToJson(value: FindIntentsByContextBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeErrorResponse")), null, 2); + } + + public static toFindIntentsByContextBridgeRequest(json: string): FindIntentsByContextBridgeRequest { + return cast(JSON.parse(json), r("FindIntentsByContextBridgeRequest")); + } + + public static findIntentsByContextBridgeRequestToJson(value: FindIntentsByContextBridgeRequest): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeRequest")), null, 2); + } + + public static toFindIntentsByContextBridgeResponse(json: string): FindIntentsByContextBridgeResponse { + return cast(JSON.parse(json), r("FindIntentsByContextBridgeResponse")); + } + + public static findIntentsByContextBridgeResponseToJson(value: FindIntentsByContextBridgeResponse): string { + return JSON.stringify(uncast(value, r("FindIntentsByContextBridgeResponse")), null, 2); + } + + public static toGetAppMetadataAgentErrorResponse(json: string): GetAppMetadataAgentErrorResponse { + return cast(JSON.parse(json), r("GetAppMetadataAgentErrorResponse")); + } + + public static getAppMetadataAgentErrorResponseToJson(value: GetAppMetadataAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataAgentErrorResponse")), null, 2); + } + + public static toGetAppMetadataAgentRequest(json: string): GetAppMetadataAgentRequest { + return cast(JSON.parse(json), r("GetAppMetadataAgentRequest")); + } + + public static getAppMetadataAgentRequestToJson(value: GetAppMetadataAgentRequest): string { + return JSON.stringify(uncast(value, r("GetAppMetadataAgentRequest")), null, 2); + } + + public static toGetAppMetadataAgentResponse(json: string): GetAppMetadataAgentResponse { + return cast(JSON.parse(json), r("GetAppMetadataAgentResponse")); + } + + public static getAppMetadataAgentResponseToJson(value: GetAppMetadataAgentResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataAgentResponse")), null, 2); + } + + public static toGetAppMetadataBridgeErrorResponse(json: string): GetAppMetadataBridgeErrorResponse { + return cast(JSON.parse(json), r("GetAppMetadataBridgeErrorResponse")); + } + + public static getAppMetadataBridgeErrorResponseToJson(value: GetAppMetadataBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataBridgeErrorResponse")), null, 2); + } + + public static toGetAppMetadataBridgeRequest(json: string): GetAppMetadataBridgeRequest { + return cast(JSON.parse(json), r("GetAppMetadataBridgeRequest")); + } + + public static getAppMetadataBridgeRequestToJson(value: GetAppMetadataBridgeRequest): string { + return JSON.stringify(uncast(value, r("GetAppMetadataBridgeRequest")), null, 2); + } + + public static toGetAppMetadataBridgeResponse(json: string): GetAppMetadataBridgeResponse { + return cast(JSON.parse(json), r("GetAppMetadataBridgeResponse")); + } + + public static getAppMetadataBridgeResponseToJson(value: GetAppMetadataBridgeResponse): string { + return JSON.stringify(uncast(value, r("GetAppMetadataBridgeResponse")), null, 2); + } + + public static toOpenAgentErrorResponse(json: string): OpenAgentErrorResponse { + return cast(JSON.parse(json), r("OpenAgentErrorResponse")); + } + + public static openAgentErrorResponseToJson(value: OpenAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("OpenAgentErrorResponse")), null, 2); + } + + public static toOpenAgentRequest(json: string): OpenAgentRequest { + return cast(JSON.parse(json), r("OpenAgentRequest")); + } + + public static openAgentRequestToJson(value: OpenAgentRequest): string { + return JSON.stringify(uncast(value, r("OpenAgentRequest")), null, 2); + } + + public static toOpenAgentResponse(json: string): OpenAgentResponse { + return cast(JSON.parse(json), r("OpenAgentResponse")); + } + + public static openAgentResponseToJson(value: OpenAgentResponse): string { + return JSON.stringify(uncast(value, r("OpenAgentResponse")), null, 2); + } + + public static toOpenBridgeErrorResponse(json: string): OpenBridgeErrorResponse { + return cast(JSON.parse(json), r("OpenBridgeErrorResponse")); + } + + public static openBridgeErrorResponseToJson(value: OpenBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("OpenBridgeErrorResponse")), null, 2); + } + + public static toOpenBridgeRequest(json: string): OpenBridgeRequest { + return cast(JSON.parse(json), r("OpenBridgeRequest")); + } + + public static openBridgeRequestToJson(value: OpenBridgeRequest): string { + return JSON.stringify(uncast(value, r("OpenBridgeRequest")), null, 2); + } + + public static toOpenBridgeResponse(json: string): OpenBridgeResponse { + return cast(JSON.parse(json), r("OpenBridgeResponse")); + } + + public static openBridgeResponseToJson(value: OpenBridgeResponse): string { + return JSON.stringify(uncast(value, r("OpenBridgeResponse")), null, 2); + } + + public static toPrivateChannelBroadcastAgentRequest(json: string): PrivateChannelBroadcastAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelBroadcastAgentRequest")); + } + + public static privateChannelBroadcastAgentRequestToJson(value: PrivateChannelBroadcastAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelBroadcastAgentRequest")), null, 2); + } + + public static toPrivateChannelBroadcastBridgeRequest(json: string): PrivateChannelBroadcastBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelBroadcastBridgeRequest")); + } + + public static privateChannelBroadcastBridgeRequestToJson(value: PrivateChannelBroadcastBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelBroadcastBridgeRequest")), null, 2); + } + + public static toPrivateChannelEventListenerAddedAgentRequest(json: string): PrivateChannelEventListenerAddedAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelEventListenerAddedAgentRequest")); + } + + public static privateChannelEventListenerAddedAgentRequestToJson(value: PrivateChannelEventListenerAddedAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelEventListenerAddedAgentRequest")), null, 2); + } + + public static toPrivateChannelEventListenerAddedBridgeRequest(json: string): PrivateChannelEventListenerAddedBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelEventListenerAddedBridgeRequest")); + } + + public static privateChannelEventListenerAddedBridgeRequestToJson(value: PrivateChannelEventListenerAddedBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelEventListenerAddedBridgeRequest")), null, 2); + } + + public static toPrivateChannelEventListenerRemovedAgentRequest(json: string): PrivateChannelEventListenerRemovedAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelEventListenerRemovedAgentRequest")); + } + + public static privateChannelEventListenerRemovedAgentRequestToJson(value: PrivateChannelEventListenerRemovedAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelEventListenerRemovedAgentRequest")), null, 2); + } + + public static toPrivateChannelEventListenerRemovedBridgeRequest(json: string): PrivateChannelEventListenerRemovedBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelEventListenerRemovedBridgeRequest")); + } + + public static privateChannelEventListenerRemovedBridgeRequestToJson(value: PrivateChannelEventListenerRemovedBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelEventListenerRemovedBridgeRequest")), null, 2); + } + + public static toPrivateChannelOnAddContextListenerAgentRequest(json: string): PrivateChannelOnAddContextListenerAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerAgentRequest")); + } + + public static privateChannelOnAddContextListenerAgentRequestToJson(value: PrivateChannelOnAddContextListenerAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerAgentRequest")), null, 2); + } + + public static toPrivateChannelOnAddContextListenerBridgeRequest(json: string): PrivateChannelOnAddContextListenerBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelOnAddContextListenerBridgeRequest")); + } + + public static privateChannelOnAddContextListenerBridgeRequestToJson(value: PrivateChannelOnAddContextListenerBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnAddContextListenerBridgeRequest")), null, 2); + } + + public static toPrivateChannelOnDisconnectAgentRequest(json: string): PrivateChannelOnDisconnectAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelOnDisconnectAgentRequest")); + } + + public static privateChannelOnDisconnectAgentRequestToJson(value: PrivateChannelOnDisconnectAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectAgentRequest")), null, 2); + } + + public static toPrivateChannelOnDisconnectBridgeRequest(json: string): PrivateChannelOnDisconnectBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelOnDisconnectBridgeRequest")); + } + + public static privateChannelOnDisconnectBridgeRequestToJson(value: PrivateChannelOnDisconnectBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnDisconnectBridgeRequest")), null, 2); + } + + public static toPrivateChannelOnUnsubscribeAgentRequest(json: string): PrivateChannelOnUnsubscribeAgentRequest { + return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeAgentRequest")); + } + + public static privateChannelOnUnsubscribeAgentRequestToJson(value: PrivateChannelOnUnsubscribeAgentRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeAgentRequest")), null, 2); + } + + public static toPrivateChannelOnUnsubscribeBridgeRequest(json: string): PrivateChannelOnUnsubscribeBridgeRequest { + return cast(JSON.parse(json), r("PrivateChannelOnUnsubscribeBridgeRequest")); + } + + public static privateChannelOnUnsubscribeBridgeRequestToJson(value: PrivateChannelOnUnsubscribeBridgeRequest): string { + return JSON.stringify(uncast(value, r("PrivateChannelOnUnsubscribeBridgeRequest")), null, 2); + } + + public static toRaiseIntentAgentErrorResponse(json: string): RaiseIntentAgentErrorResponse { + return cast(JSON.parse(json), r("RaiseIntentAgentErrorResponse")); + } + + public static raiseIntentAgentErrorResponseToJson(value: RaiseIntentAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentAgentErrorResponse")), null, 2); + } + + public static toRaiseIntentAgentRequest(json: string): RaiseIntentAgentRequest { + return cast(JSON.parse(json), r("RaiseIntentAgentRequest")); + } + + public static raiseIntentAgentRequestToJson(value: RaiseIntentAgentRequest): string { + return JSON.stringify(uncast(value, r("RaiseIntentAgentRequest")), null, 2); + } + + public static toRaiseIntentAgentResponse(json: string): RaiseIntentAgentResponse { + return cast(JSON.parse(json), r("RaiseIntentAgentResponse")); + } + + public static raiseIntentAgentResponseToJson(value: RaiseIntentAgentResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentAgentResponse")), null, 2); + } + + public static toRaiseIntentBridgeErrorResponse(json: string): RaiseIntentBridgeErrorResponse { + return cast(JSON.parse(json), r("RaiseIntentBridgeErrorResponse")); + } + + public static raiseIntentBridgeErrorResponseToJson(value: RaiseIntentBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentBridgeErrorResponse")), null, 2); + } + + public static toRaiseIntentBridgeRequest(json: string): RaiseIntentBridgeRequest { + return cast(JSON.parse(json), r("RaiseIntentBridgeRequest")); + } + + public static raiseIntentBridgeRequestToJson(value: RaiseIntentBridgeRequest): string { + return JSON.stringify(uncast(value, r("RaiseIntentBridgeRequest")), null, 2); + } + + public static toRaiseIntentBridgeResponse(json: string): RaiseIntentBridgeResponse { + return cast(JSON.parse(json), r("RaiseIntentBridgeResponse")); + } + + public static raiseIntentBridgeResponseToJson(value: RaiseIntentBridgeResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentBridgeResponse")), null, 2); + } + + public static toRaiseIntentResultAgentErrorResponse(json: string): RaiseIntentResultAgentErrorResponse { + return cast(JSON.parse(json), r("RaiseIntentResultAgentErrorResponse")); + } + + public static raiseIntentResultAgentErrorResponseToJson(value: RaiseIntentResultAgentErrorResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultAgentErrorResponse")), null, 2); + } + + public static toRaiseIntentResultAgentResponse(json: string): RaiseIntentResultAgentResponse { + return cast(JSON.parse(json), r("RaiseIntentResultAgentResponse")); + } + + public static raiseIntentResultAgentResponseToJson(value: RaiseIntentResultAgentResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultAgentResponse")), null, 2); + } + + public static toRaiseIntentResultBridgeErrorResponse(json: string): RaiseIntentResultBridgeErrorResponse { + return cast(JSON.parse(json), r("RaiseIntentResultBridgeErrorResponse")); + } + + public static raiseIntentResultBridgeErrorResponseToJson(value: RaiseIntentResultBridgeErrorResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultBridgeErrorResponse")), null, 2); + } + + public static toRaiseIntentResultBridgeResponse(json: string): RaiseIntentResultBridgeResponse { + return cast(JSON.parse(json), r("RaiseIntentResultBridgeResponse")); + } + + public static raiseIntentResultBridgeResponseToJson(value: RaiseIntentResultBridgeResponse): string { + return JSON.stringify(uncast(value, r("RaiseIntentResultBridgeResponse")), null, 2); + } +} + +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { + const prettyTyp = prettyTypeName(typ); + const parentText = parent ? ` on ${parent}` : ''; + const keyText = key ? ` for key "${key}"` : ''; + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); +} + +function prettyTypeName(typ: any): string { + if (Array.isArray(typ)) { + if (typ.length === 2 && typ[0] === undefined) { + return `an optional ${prettyTypeName(typ[1])}`; + } else { + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; + } + } else if (typeof typ === "object" && typ.literal !== undefined) { + return typ.literal; + } else { + return typeof typ; + } +} + +function jsonToJSProps(typ: any): any { + if (typ.jsonToJS === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); + typ.jsonToJS = map; + } + return typ.jsonToJS; +} + +function jsToJSONProps(typ: any): any { + if (typ.jsToJSON === undefined) { + const map: any = {}; + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); + typ.jsToJSON = map; + } + return typ.jsToJSON; +} + +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { + function transformPrimitive(typ: string, val: any): any { + if (typeof typ === typeof val) return val; + return invalidValue(typ, val, key, parent); + } + + function transformUnion(typs: any[], val: any): any { + // val must validate against one typ in typs + const l = typs.length; + for (let i = 0; i < l; i++) { + const typ = typs[i]; + try { + return transform(val, typ, getProps); + } catch (_) {} + } + return invalidValue(typs, val, key, parent); + } + + function transformEnum(cases: string[], val: any): any { + if (cases.indexOf(val) !== -1) return val; + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); + } + + function transformArray(typ: any, val: any): any { + // val must be an array with no invalid elements + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); + return val.map(el => transform(el, typ, getProps)); + } + + function transformDate(val: any): any { + if (val === null) { + return null; + } + const d = new Date(val); + if (isNaN(d.valueOf())) { + return invalidValue(l("Date"), val, key, parent); + } + return d; + } + + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { + if (val === null || typeof val !== "object" || Array.isArray(val)) { + return invalidValue(l(ref || "object"), val, key, parent); + } + const result: any = {}; + Object.getOwnPropertyNames(props).forEach(key => { + const prop = props[key]; + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; + result[prop.key] = transform(v, prop.typ, getProps, key, ref); + }); + Object.getOwnPropertyNames(val).forEach(key => { + if (!Object.prototype.hasOwnProperty.call(props, key)) { + result[key] = transform(val[key], additional, getProps, key, ref); + } + }); + return result; + } + + if (typ === "any") return val; + if (typ === null) { + if (val === null) return val; + return invalidValue(typ, val, key, parent); + } + if (typ === false) return invalidValue(typ, val, key, parent); + let ref: any = undefined; + while (typeof typ === "object" && typ.ref !== undefined) { + ref = typ.ref; + typ = typeMap[typ.ref]; + } + if (Array.isArray(typ)) return transformEnum(typ, val); + if (typeof typ === "object") { + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) + : invalidValue(typ, val, key, parent); + } + // Numbers can be parsed by Date but shouldn't be. + if (typ === Date && typeof val !== "number") return transformDate(val); + return transformPrimitive(typ, val); +} + +function cast(val: any, typ: any): T { + return transform(val, typ, jsonToJSProps); +} + +function uncast(val: T, typ: any): any { + return transform(val, typ, jsToJSONProps); +} + +function l(typ: any) { + return { literal: typ }; +} + +function a(typ: any) { + return { arrayItems: typ }; +} + +function u(...typs: any[]) { + return { unionMembers: typs }; +} + +function o(props: any[], additional: any) { + return { props, additional }; +} + +function m(additional: any) { + return { props: [], additional }; +} + +function r(name: string) { + return { ref: name }; +} + +const typeMap: any = { + "AgentErrorResponseMessage": o([ + { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, + { json: "payload", js: "payload", typ: r("ErrorResponseMessagePayload") }, + { json: "type", js: "type", typ: r("ResponseMessageType") }, + ], false), + "AgentResponseMetadata": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ErrorResponseMessagePayload": o([ + { json: "error", js: "error", typ: r("ResponseErrorDetail") }, + ], "any"), + "AgentRequestMessage": o([ + { json: "meta", js: "meta", typ: r("AgentRequestMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("RequestMessageType") }, + ], false), + "AgentRequestMetadata": o([ + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "BridgeParticipantIdentifier": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "SourceIdentifier": o([ + { json: "appId", js: "appId", typ: u(undefined, "") }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "AgentResponseMessage": o([ + { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("ResponseMessageType") }, + ], false), + "BridgeErrorResponseMessage": o([ + { json: "meta", js: "meta", typ: r("BridgeErrorResponseMessageMeta") }, + { json: "payload", js: "payload", typ: r("ResponseErrorMessagePayload") }, + { json: "type", js: "type", typ: "" }, + ], false), + "BridgeErrorResponseMessageMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "DesktopAgentIdentifier": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + ], "any"), + "ResponseErrorMessagePayload": o([ + { json: "error", js: "error", typ: u(undefined, r("ResponseErrorDetail")) }, + ], "any"), + "BridgeRequestMessage": o([ + { json: "meta", js: "meta", typ: r("BridgeRequestMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: "" }, + ], false), + "BridgeRequestMetadata": o([ + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("BridgeParticipantIdentifier") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "BridgeResponseMessage": o([ + { json: "meta", js: "meta", typ: r("BridgeResponseMessageMeta") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: "" }, + ], false), + "BridgeResponseMessageMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "BroadcastAgentRequest": o([ + { json: "meta", js: "meta", typ: r("BroadcastAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastAgentRequestPayload") }, + { json: "type", js: "type", typ: r("BroadcastAgentRequestType") }, + ], false), + "BroadcastAgentRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("SourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "SourceObject": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "BroadcastAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "Context": o([ + { json: "id", js: "id", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "type", js: "type", typ: "" }, + ], "any"), + "BroadcastBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("BroadcastBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("BroadcastBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("BroadcastAgentRequestType") }, + ], false), + "BroadcastBridgeRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "MetaSource": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "BroadcastBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "ConnectionStepMessage": o([ + { json: "meta", js: "meta", typ: r("ConnectionStepMetadata") }, + { json: "payload", js: "payload", typ: m("any") }, + { json: "type", js: "type", typ: r("ConnectionStepMessageType") }, + ], false), + "ConnectionStepMetadata": o([ + { json: "requestUuid", js: "requestUuid", typ: u(undefined, "") }, + { json: "responseUuid", js: "responseUuid", typ: u(undefined, "") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep2Hello": o([ + { json: "meta", js: "meta", typ: r("ConnectionStep2HelloMeta") }, + { json: "payload", js: "payload", typ: r("ConnectionStep2HelloPayload") }, + { json: "type", js: "type", typ: r("ConnectionStep2HelloType") }, + ], false), + "ConnectionStep2HelloMeta": o([ + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep2HelloPayload": o([ + { json: "authRequired", js: "authRequired", typ: true }, + { json: "authToken", js: "authToken", typ: u(undefined, "") }, + { json: "desktopAgentBridgeVersion", js: "desktopAgentBridgeVersion", typ: "" }, + { json: "supportedFDC3Versions", js: "supportedFDC3Versions", typ: a("") }, + ], false), + "ConnectionStep3Handshake": o([ + { json: "meta", js: "meta", typ: r("ConnectionStep3HandshakeMeta") }, + { json: "payload", js: "payload", typ: r("ConnectionStep3HandshakePayload") }, + { json: "type", js: "type", typ: r("ConnectionStep3HandshakeType") }, + ], false), + "ConnectionStep3HandshakeMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep3HandshakePayload": o([ + { json: "authToken", js: "authToken", typ: u(undefined, "") }, + { json: "channelsState", js: "channelsState", typ: m(a(r("Context"))) }, + { json: "implementationMetadata", js: "implementationMetadata", typ: r("ConnectingAgentImplementationMetadata") }, + { json: "requestedName", js: "requestedName", typ: "" }, + ], false), + "ConnectingAgentImplementationMetadata": o([ + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, + { json: "provider", js: "provider", typ: "" }, + { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, + ], false), + "OptionalFeatures": o([ + { json: "DesktopAgentBridging", js: "DesktopAgentBridging", typ: true }, + { json: "OriginatingAppMetadata", js: "OriginatingAppMetadata", typ: true }, + { json: "UserChannelMembershipAPIs", js: "UserChannelMembershipAPIs", typ: true }, + ], false), + "ConnectionStep4AuthenticationFailed": o([ + { json: "meta", js: "meta", typ: r("ConnectionStep4AuthenticationFailedMeta") }, + { json: "payload", js: "payload", typ: r("ConnectionStep4AuthenticationFailedPayload") }, + { json: "type", js: "type", typ: r("ConnectionStep4AuthenticationFailedType") }, + ], false), + "ConnectionStep4AuthenticationFailedMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep4AuthenticationFailedPayload": o([ + { json: "message", js: "message", typ: u(undefined, "") }, + ], false), + "ConnectionStep6ConnectedAgentsUpdate": o([ + { json: "meta", js: "meta", typ: r("ConnectionStep6ConnectedAgentsUpdateMeta") }, + { json: "payload", js: "payload", typ: r("ConnectionStep6ConnectedAgentsUpdatePayload") }, + { json: "type", js: "type", typ: r("ConnectionStep6ConnectedAgentsUpdateType") }, + ], false), + "ConnectionStep6ConnectedAgentsUpdateMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "ConnectionStep6ConnectedAgentsUpdatePayload": o([ + { json: "addAgent", js: "addAgent", typ: u(undefined, "") }, + { json: "allAgents", js: "allAgents", typ: a(r("DesktopAgentImplementationMetadata")) }, + { json: "channelsState", js: "channelsState", typ: u(undefined, m(a(r("Context")))) }, + { json: "removeAgent", js: "removeAgent", typ: u(undefined, "") }, + ], false), + "DesktopAgentImplementationMetadata": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "fdc3Version", js: "fdc3Version", typ: "" }, + { json: "optionalFeatures", js: "optionalFeatures", typ: r("OptionalFeatures") }, + { json: "provider", js: "provider", typ: "" }, + { json: "providerVersion", js: "providerVersion", typ: u(undefined, "") }, + ], false), + "FindInstancesAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindInstancesAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("PayloadClass") }, + { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, + ], false), + "FindInstancesAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PayloadClass": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindInstancesAgentRequest": o([ + { json: "meta", js: "meta", typ: r("FindInstancesAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesAgentRequestPayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentRequestType") }, + ], false), + "FindInstancesAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "DestinationObject": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "FindInstancesAgentRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + ], false), + "AppIdentifier": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "FindInstancesAgentResponse": o([ + { json: "meta", js: "meta", typ: r("AgentResponseMetadata") }, + { json: "payload", js: "payload", typ: r("FindInstancesAgentResponsePayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, + ], false), + "FindInstancesAgentResponsePayload": o([ + { json: "appIdentifiers", js: "appIdentifiers", typ: a(r("AppMetadata")) }, + ], false), + "AppMetadata": o([ + { json: "appId", js: "appId", typ: "" }, + { json: "description", js: "description", typ: u(undefined, "") }, + { json: "desktopAgent", js: "desktopAgent", typ: u(undefined, "") }, + { json: "icons", js: "icons", typ: u(undefined, a(r("Icon"))) }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + { json: "instanceMetadata", js: "instanceMetadata", typ: u(undefined, m("any")) }, + { json: "name", js: "name", typ: u(undefined, "") }, + { json: "resultType", js: "resultType", typ: u(undefined, u(null, "")) }, + { json: "screenshots", js: "screenshots", typ: u(undefined, a(r("Image"))) }, + { json: "title", js: "title", typ: u(undefined, "") }, + { json: "tooltip", js: "tooltip", typ: u(undefined, "") }, + { json: "version", js: "version", typ: u(undefined, "") }, + ], false), + "Icon": o([ + { json: "size", js: "size", typ: u(undefined, "") }, + { json: "src", js: "src", typ: "" }, + { json: "type", js: "type", typ: u(undefined, "") }, + ], false), + "Image": o([ + { json: "label", js: "label", typ: u(undefined, "") }, + { json: "size", js: "size", typ: u(undefined, "") }, + { json: "src", js: "src", typ: "" }, + { json: "type", js: "type", typ: u(undefined, "") }, + ], false), + "FindInstancesBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindInstancesBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("MessagePayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, + ], false), + "FindInstancesBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "MessagePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindInstancesBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("FindInstancesBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentRequestType") }, + ], false), + "FindInstancesBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "MetaSourceObject": o([ + { json: "appId", js: "appId", typ: u(undefined, "") }, + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "FindInstancesBridgeRequestPayload": o([ + { json: "app", js: "app", typ: r("AppIdentifier") }, + ], false), + "FindInstancesBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("BridgeResponseMessageMeta") }, + { json: "payload", js: "payload", typ: r("FindInstancesBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("FindInstancesAgentErrorResponseType") }, + ], false), + "FindInstancesBridgeResponsePayload": o([ + { json: "appIdentifiers", js: "appIdentifiers", typ: a(r("AppMetadata")) }, + ], false), + "FindIntentAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, + ], false), + "FindIntentAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindIntentAgentRequest": o([ + { json: "meta", js: "meta", typ: r("FindIntentAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentAgentRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentRequestType") }, + ], false), + "FindIntentAgentRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + ], false), + "FindIntentAgentRequestPayload": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "intent", js: "intent", typ: "" }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentAgentResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentAgentResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, + ], false), + "FindIntentAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentAgentResponsePayload": o([ + { json: "appIntent", js: "appIntent", typ: r("AppIntent") }, + ], false), + "AppIntent": o([ + { json: "apps", js: "apps", typ: a(r("AppMetadata")) }, + { json: "intent", js: "intent", typ: r("IntentMetadata") }, + ], false), + "IntentMetadata": o([ + { json: "displayName", js: "displayName", typ: u(undefined, "") }, + { json: "name", js: "name", typ: "" }, + ], false), + "FindIntentBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, + ], false), + "FindIntentBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindIntentBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("FindIntentBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentRequestType") }, + ], false), + "FindIntentBridgeRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("BridgeParticipantIdentifier") }, + { json: "timestamp", js: "timestamp", typ: Date }, + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + ], false), + "FindIntentBridgeRequestPayload": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "intent", js: "intent", typ: "" }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentAgentErrorResponseType") }, + ], false), + "FindIntentBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentBridgeResponsePayload": o([ + { json: "appIntent", js: "appIntent", typ: r("AppIntent") }, + ], false), + "FindIntentsByContextAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, + ], false), + "FindIntentsByContextAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentsByContextAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindIntentsByContextAgentRequest": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentRequestType") }, + ], false), + "FindIntentsByContextAgentRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + ], false), + "FindIntentsByContextAgentRequestPayload": o([ + { json: "context", js: "context", typ: r("Context") }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentsByContextAgentResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextAgentResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, + ], false), + "FindIntentsByContextAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentsByContextAgentResponsePayload": o([ + { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, + ], false), + "FindIntentsByContextBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, + ], false), + "FindIntentsByContextBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentsByContextBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "FindIntentsByContextBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentRequestType") }, + ], false), + "FindIntentsByContextBridgeRequestMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + { json: "destination", js: "destination", typ: u(undefined, r("BridgeParticipantIdentifier")) }, + ], false), + "FindIntentsByContextBridgeRequestPayload": o([ + { json: "context", js: "context", typ: r("Context") }, + { json: "resultType", js: "resultType", typ: u(undefined, "") }, + ], false), + "FindIntentsByContextBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("FindIntentsByContextBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("FindIntentsByContextBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("FindIntentsByContextAgentErrorResponseType") }, + ], false), + "FindIntentsByContextBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "FindIntentsByContextBridgeResponsePayload": o([ + { json: "appIntents", js: "appIntents", typ: a(r("AppIntent")) }, + ], false), + "GetAppMetadataAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, + ], false), + "GetAppMetadataAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "GetAppMetadataAgentRequest": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataAgentRequestPayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentRequestType") }, + ], false), + "GetAppMetadataAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceIdentifier")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataAgentRequestPayload": o([ + { json: "app", js: "app", typ: r("AppObject") }, + ], false), + "AppObject": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "GetAppMetadataAgentResponse": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataAgentResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, + ], false), + "GetAppMetadataAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataAgentResponsePayload": o([ + { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, + ], false), + "GetAppMetadataBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, + ], false), + "GetAppMetadataBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "GetAppMetadataBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentRequestType") }, + ], false), + "GetAppMetadataBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataBridgeRequestPayload": o([ + { json: "app", js: "app", typ: r("AppObject") }, + ], false), + "GetAppMetadataBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("GetAppMetadataBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("GetAppMetadataBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("GetAppMetadataAgentErrorResponseType") }, + ], false), + "GetAppMetadataBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "GetAppMetadataBridgeResponsePayload": o([ + { json: "appMetadata", js: "appMetadata", typ: r("AppMetadata") }, + ], false), + "OpenAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("OpenAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, + ], false), + "OpenAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("OpenErrorResponsePayload") }, + ], false), + "OpenAgentRequest": o([ + { json: "meta", js: "meta", typ: r("OpenAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("OpenAgentRequestPayload") }, + { json: "type", js: "type", typ: r("OpenAgentRequestType") }, + ], false), + "OpenAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("SourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenAgentRequestPayload": o([ + { json: "app", js: "app", typ: r("AppToOpen") }, + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + ], false), + "AppToOpen": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "OpenAgentResponse": o([ + { json: "meta", js: "meta", typ: r("OpenAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenAgentResponsePayload") }, + { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, + ], false), + "OpenAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenAgentResponsePayload": o([ + { json: "appIdentifier", js: "appIdentifier", typ: r("AppIdentifier") }, + ], false), + "OpenBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("OpenBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, + ], false), + "OpenBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("OpenErrorResponsePayload") }, + ], false), + "OpenBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("OpenBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("OpenBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("OpenAgentRequestType") }, + ], false), + "OpenBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("DestinationObject")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenBridgeRequestPayload": o([ + { json: "app", js: "app", typ: r("AppToOpen") }, + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + ], false), + "OpenBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("OpenBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("OpenBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("OpenAgentErrorResponseType") }, + ], false), + "OpenBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "OpenBridgeResponsePayload": o([ + { json: "appIdentifier", js: "appIdentifier", typ: r("AppIdentifier") }, + ], false), + "PrivateChannelBroadcastAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelBroadcastAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelBroadcastAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelBroadcastAgentRequestType") }, + ], false), + "PrivateChannelBroadcastAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "MetaDestination": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "PrivateChannelBroadcastAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "PrivateChannelBroadcastBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelBroadcastBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelBroadcastBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelBroadcastAgentRequestType") }, + ], false), + "PrivateChannelBroadcastBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelBroadcastBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "context", js: "context", typ: r("Context") }, + ], false), + "PrivateChannelEventListenerAddedAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerAddedAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerAddedAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelEventListenerAddedAgentRequestType") }, + ], false), + "PrivateChannelEventListenerAddedAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelEventListenerAddedAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + ], false), + "PrivateChannelEventListenerAddedBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerAddedBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerAddedBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelEventListenerAddedAgentRequestType") }, + ], false), + "PrivateChannelEventListenerAddedBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelEventListenerAddedBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + ], false), + "PrivateChannelEventListenerRemovedAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerRemovedAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerRemovedAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelEventListenerRemovedAgentRequestType") }, + ], false), + "PrivateChannelEventListenerRemovedAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelEventListenerRemovedAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + ], false), + "PrivateChannelEventListenerRemovedBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelEventListenerRemovedBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelEventListenerRemovedBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelEventListenerRemovedAgentRequestType") }, + ], false), + "PrivateChannelEventListenerRemovedBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelEventListenerRemovedBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "listenerType", js: "listenerType", typ: r("PrivateChannelEventListenerTypes") }, + ], false), + "PrivateChannelOnAddContextListenerAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnAddContextListenerAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerAgentRequestType") }, + ], false), + "PrivateChannelOnAddContextListenerAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnAddContextListenerAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "PrivateChannelOnAddContextListenerBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnAddContextListenerBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnAddContextListenerBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnAddContextListenerAgentRequestType") }, + ], false), + "PrivateChannelOnAddContextListenerBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnAddContextListenerBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "PrivateChannelOnDisconnectAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnDisconnectAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectAgentRequestType") }, + ], false), + "PrivateChannelOnDisconnectAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnDisconnectAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "PrivateChannelOnDisconnectBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnDisconnectBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnDisconnectBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnDisconnectAgentRequestType") }, + ], false), + "PrivateChannelOnDisconnectBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnDisconnectBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + ], false), + "PrivateChannelOnUnsubscribeAgentRequest": o([ + { json: "meta", js: "meta", typ: r("PrivateChannelOnUnsubscribeAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeAgentRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeAgentRequestType") }, + ], false), + "PrivateChannelOnUnsubscribeAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: u(undefined, r("SourceObject")) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnUnsubscribeAgentRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "PrivateChannelOnUnsubscribeBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("ERequestMetadata") }, + { json: "payload", js: "payload", typ: r("PrivateChannelOnUnsubscribeBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("PrivateChannelOnUnsubscribeAgentRequestType") }, + ], false), + "ERequestMetadata": o([ + { json: "destination", js: "destination", typ: u(undefined, r("MetaDestination")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "PrivateChannelOnUnsubscribeBridgeRequestPayload": o([ + { json: "channelId", js: "channelId", typ: "" }, + { json: "contextType", js: "contextType", typ: u(null, "") }, + ], false), + "RaiseIntentAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, + ], false), + "RaiseIntentAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "RaiseIntentAgentRequest": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentAgentRequestMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentAgentRequestPayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentRequestType") }, + ], false), + "RaiseIntentAgentRequestMeta": o([ + { json: "destination", js: "destination", typ: r("MetaDestination") }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("SourceObject") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentAgentRequestPayload": o([ + { json: "app", js: "app", typ: r("AppDestinationIdentifier") }, + { json: "context", js: "context", typ: r("Context") }, + { json: "intent", js: "intent", typ: "" }, + ], false), + "AppDestinationIdentifier": o([ + { json: "desktopAgent", js: "desktopAgent", typ: "" }, + { json: "appId", js: "appId", typ: "" }, + { json: "instanceId", js: "instanceId", typ: u(undefined, "") }, + ], "any"), + "RaiseIntentAgentResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentAgentResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, + ], false), + "RaiseIntentAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentAgentResponsePayload": o([ + { json: "intentResolution", js: "intentResolution", typ: r("IntentResolution") }, + ], false), + "IntentResolution": o([ + { json: "intent", js: "intent", typ: "" }, + { json: "source", js: "source", typ: r("AppIdentifier") }, + ], false), + "RaiseIntentBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, + ], false), + "RaiseIntentBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("FindInstancesErrors") }, + ], false), + "RaiseIntentBridgeRequest": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentBridgeRequestMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentBridgeRequestPayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentRequestType") }, + ], false), + "RaiseIntentBridgeRequestMeta": o([ + { json: "destination", js: "destination", typ: r("MetaDestination") }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "source", js: "source", typ: r("MetaSource") }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentBridgeRequestPayload": o([ + { json: "app", js: "app", typ: r("AppDestinationIdentifier") }, + { json: "context", js: "context", typ: r("Context") }, + { json: "intent", js: "intent", typ: "" }, + ], false), + "RaiseIntentBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentAgentErrorResponseType") }, + ], false), + "RaiseIntentBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentBridgeResponsePayload": o([ + { json: "intentResolution", js: "intentResolution", typ: r("IntentResolution") }, + ], false), + "RaiseIntentResultAgentErrorResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentResultAgentErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultAgentErrorResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, + ], false), + "RaiseIntentResultAgentErrorResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentResultAgentErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("RaiseIntentResultErrorMessage") }, + ], false), + "RaiseIntentResultAgentResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentResultAgentResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultAgentResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, + ], false), + "RaiseIntentResultAgentResponseMeta": o([ + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentResultAgentResponsePayload": o([ + { json: "intentResult", js: "intentResult", typ: r("IntentResult") }, + ], false), + "IntentResult": o([ + { json: "context", js: "context", typ: u(undefined, r("Context")) }, + { json: "channel", js: "channel", typ: u(undefined, r("Channel")) }, + ], false), + "Channel": o([ + { json: "displayMetadata", js: "displayMetadata", typ: u(undefined, r("DisplayMetadata")) }, + { json: "id", js: "id", typ: "" }, + { json: "type", js: "type", typ: r("Type") }, + ], false), + "DisplayMetadata": o([ + { json: "color", js: "color", typ: u(undefined, "") }, + { json: "glyph", js: "glyph", typ: u(undefined, "") }, + { json: "name", js: "name", typ: u(undefined, "") }, + ], false), + "RaiseIntentResultBridgeErrorResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentResultBridgeErrorResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultBridgeErrorResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, + ], false), + "RaiseIntentResultBridgeErrorResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: a(r("ResponseErrorDetail")) }, + { json: "errorSources", js: "errorSources", typ: a(r("DesktopAgentIdentifier")) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentResultBridgeErrorResponsePayload": o([ + { json: "error", js: "error", typ: r("RaiseIntentResultErrorMessage") }, + ], false), + "RaiseIntentResultBridgeResponse": o([ + { json: "meta", js: "meta", typ: r("RaiseIntentResultBridgeResponseMeta") }, + { json: "payload", js: "payload", typ: r("RaiseIntentResultBridgeResponsePayload") }, + { json: "type", js: "type", typ: r("RaiseIntentResultAgentErrorResponseType") }, + ], false), + "RaiseIntentResultBridgeResponseMeta": o([ + { json: "errorDetails", js: "errorDetails", typ: u(undefined, a(r("ResponseErrorDetail"))) }, + { json: "errorSources", js: "errorSources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "requestUuid", js: "requestUuid", typ: "" }, + { json: "responseUuid", js: "responseUuid", typ: "" }, + { json: "sources", js: "sources", typ: u(undefined, a(r("DesktopAgentIdentifier"))) }, + { json: "timestamp", js: "timestamp", typ: Date }, + ], false), + "RaiseIntentResultBridgeResponsePayload": o([ + { json: "intentResult", js: "intentResult", typ: r("IntentResult") }, + ], false), + "ResponseErrorDetail": [ + "AccessDenied", + "AgentDisconnected", + "AppNotFound", + "AppTimeout", + "CreationFailed", + "DesktopAgentNotFound", + "ErrorOnLaunch", + "IntentDeliveryFailed", + "IntentHandlerRejected", + "MalformedContext", + "MalformedMessage", + "NoAppsFound", + "NoChannelFound", + "NoResultReturned", + "NotConnectedToBridge", + "ResolverTimeout", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "ResponseMessageType": [ + "findInstancesResponse", + "findIntentResponse", + "findIntentsByContextResponse", + "getAppMetadataResponse", + "openResponse", + "raiseIntentResponse", + "raiseIntentResultResponse", + ], + "RequestMessageType": [ + "broadcastRequest", + "findInstancesRequest", + "findIntentRequest", + "findIntentsByContextRequest", + "getAppMetadataRequest", + "openRequest", + "PrivateChannel.broadcast", + "PrivateChannel.eventListenerAdded", + "PrivateChannel.eventListenerRemoved", + "PrivateChannel.onAddContextListener", + "PrivateChannel.onDisconnect", + "PrivateChannel.onUnsubscribe", + "raiseIntentRequest", + ], + "BroadcastAgentRequestType": [ + "broadcastRequest", + ], + "ConnectionStepMessageType": [ + "authenticationFailed", + "connectedAgentsUpdate", + "handshake", + "hello", + ], + "ConnectionStep2HelloType": [ + "hello", + ], + "ConnectionStep3HandshakeType": [ + "handshake", + ], + "ConnectionStep4AuthenticationFailedType": [ + "authenticationFailed", + ], + "ConnectionStep6ConnectedAgentsUpdateType": [ + "connectedAgentsUpdate", + ], + "FindInstancesErrors": [ + "AgentDisconnected", + "DesktopAgentNotFound", + "IntentDeliveryFailed", + "MalformedContext", + "MalformedMessage", + "NoAppsFound", + "NotConnectedToBridge", + "ResolverTimeout", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + "TargetAppUnavailable", + "TargetInstanceUnavailable", + "UserCancelledResolution", + ], + "FindInstancesAgentErrorResponseType": [ + "findInstancesResponse", + ], + "FindInstancesAgentRequestType": [ + "findInstancesRequest", + ], + "FindIntentAgentErrorResponseType": [ + "findIntentResponse", + ], + "FindIntentAgentRequestType": [ + "findIntentRequest", + ], + "FindIntentsByContextAgentErrorResponseType": [ + "findIntentsByContextResponse", + ], + "FindIntentsByContextAgentRequestType": [ + "findIntentsByContextRequest", + ], + "GetAppMetadataAgentErrorResponseType": [ + "getAppMetadataResponse", + ], + "GetAppMetadataAgentRequestType": [ + "getAppMetadataRequest", + ], + "OpenErrorResponsePayload": [ + "AgentDisconnected", + "AppNotFound", + "AppTimeout", + "DesktopAgentNotFound", + "ErrorOnLaunch", + "MalformedContext", + "MalformedMessage", + "NotConnectedToBridge", + "ResolverUnavailable", + "ResponseToBridgeTimedOut", + ], + "OpenAgentErrorResponseType": [ + "openResponse", + ], + "OpenAgentRequestType": [ + "openRequest", + ], + "PrivateChannelBroadcastAgentRequestType": [ + "PrivateChannel.broadcast", + ], + "PrivateChannelEventListenerTypes": [ + "onAddContextListener", + "onDisconnect", + "onUnsubscribe", + ], + "PrivateChannelEventListenerAddedAgentRequestType": [ + "PrivateChannel.eventListenerAdded", + ], + "PrivateChannelEventListenerRemovedAgentRequestType": [ + "PrivateChannel.eventListenerRemoved", + ], + "PrivateChannelOnAddContextListenerAgentRequestType": [ + "PrivateChannel.onAddContextListener", + ], + "PrivateChannelOnDisconnectAgentRequestType": [ + "PrivateChannel.onDisconnect", + ], + "PrivateChannelOnUnsubscribeAgentRequestType": [ + "PrivateChannel.onUnsubscribe", + ], + "RaiseIntentAgentErrorResponseType": [ + "raiseIntentResponse", + ], + "RaiseIntentAgentRequestType": [ + "raiseIntentRequest", + ], + "RaiseIntentResultErrorMessage": [ + "AgentDisconnected", + "IntentHandlerRejected", + "MalformedMessage", + "NoResultReturned", + "NotConnectedToBridge", + "ResponseToBridgeTimedOut", + ], + "RaiseIntentResultAgentErrorResponseType": [ + "raiseIntentResultResponse", + ], + "Type": [ + "app", + "private", + "user", + ], +}; diff --git a/packages/fdc3-schema/package.json b/packages/fdc3-schema/package.json index 9d17e5322..f9dd8f18c 100644 --- a/packages/fdc3-schema/package.json +++ b/packages/fdc3-schema/package.json @@ -23,8 +23,8 @@ "build": "npm run generate && tsc --module es2022", "test": "npm run generate && tsc", "lint": "eslint generated/ --ext .ts --fix", - "typegen-browser": "cd schemas && node ../s2tQuicktypeUtil.js api/api.schema.json api/common.schema.json context/context.schema.json api ../generated/api/BrowserTypes.ts", - "typegen-bridging": "cd schemas && node ../s2tQuicktypeUtil.js api/api.schema.json api/common.schema.json api/broadcastRequest.schema.json api/findInstancesRequest.schema.json api/findInstancesResponse.schema.json api/findIntentRequest.schema.json api/findIntentResponse.schema.json api/findIntentsByContextRequest.schema.json api/findIntentsByContextResponse.schema.json api/getAppMetadataRequest.schema.json api/getAppMetadataResponse.schema.json api/openRequest.schema.json api/openResponse.schema.json api/raiseIntentRequest.schema.json api/raiseIntentResponse.schema.json api/raiseIntentResultResponse.schema.json context/context.schema.json bridging ../generated/bridging/BridgingTypes.ts" + "typegen-browser": "cd schemas && node ../s2tQuicktypeUtil.js api/api.schema.json api/common.schema.json ../../fdc3-context/schemas/context/context.schema.json api ../generated/api/BrowserTypes.ts", + "typegen-bridging": "cd schemas && node ../s2tQuicktypeUtil.js api/api.schema.json api/common.schema.json api/broadcastRequest.schema.json api/findInstancesRequest.schema.json api/findInstancesResponse.schema.json api/findIntentRequest.schema.json api/findIntentResponse.schema.json api/findIntentsByContextRequest.schema.json api/findIntentsByContextResponse.schema.json api/getAppMetadataRequest.schema.json api/getAppMetadataResponse.schema.json api/openRequest.schema.json api/openResponse.schema.json api/raiseIntentRequest.schema.json api/raiseIntentResponse.schema.json api/raiseIntentResultResponse.schema.json ../../fdc3-context/schemas/context/context.schema.json bridging ../generated/bridging/BridgingTypes.ts" }, "devDependencies": { "@types/jest": "29.5.12", diff --git a/toolbox/fdc3-for-web/da-server/tsconfig.json b/toolbox/fdc3-for-web/da-server/tsconfig.json index 9d572e985..48425b660 100644 --- a/toolbox/fdc3-for-web/da-server/tsconfig.json +++ b/toolbox/fdc3-for-web/da-server/tsconfig.json @@ -22,6 +22,12 @@ }, { "path": "../../../packages/testing" - } + }, + { + "path": "../../../packages/fdc3-schema" + }, + { + "path": "../../../packages/fdc3-context" + }, ] } \ No newline at end of file diff --git a/toolbox/fdc3-workbench/package-lock.json b/toolbox/fdc3-workbench/package-lock.json index d469ddfa5..c190c6857 100644 --- a/toolbox/fdc3-workbench/package-lock.json +++ b/toolbox/fdc3-workbench/package-lock.json @@ -968,7 +968,7 @@ "dev": true, "dependencies": { "@finos/fdc3": "^2.1.0-beta.6", - "@kite9/da-proxy": "0.0.41", + "@kite9/fdc3-agent-proxy": "0.0.41", "@kite9/fdc3-common": "0.0.41", "@types/uuid": "^10.0.0", "uuid": "^9.0.1" @@ -980,9 +980,9 @@ "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", "dev": true }, - "node_modules/@kite9/da-proxy": { + "node_modules/@kite9/fdc3-agent-proxy": { "version": "0.0.41", - "resolved": "https://registry.npmjs.org/@kite9/da-proxy/-/da-proxy-0.0.41.tgz", + "resolved": "https://registry.npmjs.org/@kite9/fdc3-agent-proxy/-/fdc3-agent-proxy-0.0.41.tgz", "integrity": "sha512-Hwwg6TOIsXB5h8DmhR9PaNsQjBrZufdQ9E2R1oCX9XzPQmixd54NQPerO35sojqfmC1r2rb1FaP7LpGtOf1xoA==", "dev": true, "dependencies": { From 08c618f5d1d7670e6e74a438a64bb5da0fc67f1b Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Wed, 11 Sep 2024 16:26:54 +0100 Subject: [PATCH 16/16] Renamed da-server --- .gitignore | 2 +- package-lock.json | 62 +++++++++---------- package.json | 2 +- packages/fdc3-get-agent/package.json | 2 +- .../test/support/MockFDC3Server.ts | 2 +- .../test/support/TestServerContext.ts | 2 +- .../support/responses/AutomaticResponses.ts | 2 +- .../test/support/responses/CurrentChannel.ts | 2 +- .../test/support/responses/FindIntent.ts | 2 +- .../test/support/responses/Handshake.ts | 2 +- .../test/support/responses/RaiseIntent.ts | 2 +- .../test/support/responses/UserChannels.ts | 2 +- packages/fdc3-get-agent/tsconfig.json | 2 +- toolbox/fdc3-for-web/demo/package.json | 2 +- .../demo/src/client/da/DemoServerContext.ts | 2 +- .../src/client/da/FDC3_2_1_JSONDirectory.ts | 4 +- .../demo/src/client/da/dummy-desktop-agent.ts | 4 +- .../fdc3-for-web/demo/src/client/da/util.ts | 2 +- toolbox/fdc3-for-web/demo/tsconfig.json | 2 +- .../{da-server => fdc3-web-impl}/cucumber.yml | 0 .../{da-server => fdc3-web-impl}/package.json | 2 +- .../src/BasicFDC3Server.ts | 0 .../src/FDC3Server.ts | 0 .../src/ServerContext.ts | 0 .../src/directory/BasicDirectory.ts | 0 .../src/directory/DirectoryInterface.ts | 0 .../src/handlers/BroadcastHandler.ts | 0 .../src/handlers/IntentHandler.ts | 0 .../src/handlers/OpenHandler.ts | 0 .../src/handlers/support.ts | 0 .../{da-server => fdc3-web-impl}/src/index.ts | 0 .../test/features/apps.feature | 0 .../test/features/broadcast.feature | 0 .../test/features/find-intent.feature | 0 .../test/features/intent-result.feature | 0 .../test/features/private-channel.feature | 0 .../raise-intent-with-context.feature | 0 .../test/features/raise-intent.feature | 0 .../test/features/user-channels.feature | 0 .../step-definitions/app-channel.steps.ts | 0 .../test/step-definitions/broadcast.steps.ts | 0 .../test/step-definitions/generic.steps.ts | 0 .../test/step-definitions/intents.steps.ts | 0 .../test/step-definitions/messaging.steps.ts | 0 .../step-definitions/private-channel.steps.ts | 0 .../test/step-definitions/start-app.steps.ts | 0 .../step-definitions/user-channel.steps.ts | 0 .../test/support/TestServerContext.ts | 0 .../test/world/index.ts | 0 .../tsconfig.json | 0 50 files changed, 52 insertions(+), 52 deletions(-) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/cucumber.yml (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/package.json (97%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/src/BasicFDC3Server.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/src/FDC3Server.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/src/ServerContext.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/src/directory/BasicDirectory.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/src/directory/DirectoryInterface.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/src/handlers/BroadcastHandler.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/src/handlers/IntentHandler.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/src/handlers/OpenHandler.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/src/handlers/support.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/src/index.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/features/apps.feature (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/features/broadcast.feature (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/features/find-intent.feature (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/features/intent-result.feature (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/features/private-channel.feature (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/features/raise-intent-with-context.feature (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/features/raise-intent.feature (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/features/user-channels.feature (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/step-definitions/app-channel.steps.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/step-definitions/broadcast.steps.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/step-definitions/generic.steps.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/step-definitions/intents.steps.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/step-definitions/messaging.steps.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/step-definitions/private-channel.steps.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/step-definitions/start-app.steps.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/step-definitions/user-channel.steps.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/support/TestServerContext.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/test/world/index.ts (100%) rename toolbox/fdc3-for-web/{da-server => fdc3-web-impl}/tsconfig.json (100%) diff --git a/.gitignore b/.gitignore index e07de5c2a..cc96a2887 100644 --- a/.gitignore +++ b/.gitignore @@ -20,5 +20,5 @@ website/.docusaurus/** *.iml website/.yarn .nyc_output -toolbox/fdc3-for-web/da-server/generated/ +toolbox/fdc3-for-web/fdc3-web-impl/generated/ cucumber-report.html \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8dd831ab8..3345c9800 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "packages/fdc3-standard", "packages/testing", "packages/fdc3-agent-proxy", - "toolbox/fdc3-for-web/da-server", + "toolbox/fdc3-for-web/fdc3-web-impl", "packages/fdc3-get-agent", "toolbox/fdc3-for-web/demo", "toolbox/fdc3-workbench", @@ -3394,10 +3394,6 @@ "jsep": "^0.4.0||^1.0.0" } }, - "node_modules/@kite9/da-server": { - "resolved": "toolbox/fdc3-for-web/da-server", - "link": true - }, "node_modules/@kite9/demo": { "resolved": "toolbox/fdc3-for-web/demo", "link": true @@ -3438,6 +3434,10 @@ "resolved": "packages/fdc3-standard", "link": true }, + "node_modules/@kite9/fdc3-web-impl": { + "resolved": "toolbox/fdc3-for-web/fdc3-web-impl", + "link": true + }, "node_modules/@kite9/testing": { "resolved": "packages/testing", "link": true @@ -16105,7 +16105,7 @@ }, "devDependencies": { "@cucumber/cucumber": "10.3.1", - "@kite9/da-server": "2.2.0-beta.6", + "@kite9/fdc3-web-impl": "2.2.0-beta.6", "@kite9/testing": "2.2.0-beta.6", "@types/node": "^20.14.11", "@types/wtfnode": "^0.7.3", @@ -16194,7 +16194,31 @@ "uuid": "^9.0.1" } }, - "toolbox/fdc3-for-web/da-server": { + "toolbox/fdc3-for-web/demo": { + "version": "2.2.0-beta.6", + "dependencies": { + "@kite9/fdc3-get-agent": "2.2.0-beta.6", + "@kite9/fdc3-standard": "2.2.0-beta.6", + "@kite9/fdc3-web-impl": "2.2.0-beta.6", + "@types/uuid": "^10.0.0", + "@types/ws": "^8.5.10", + "express": "^4.18.3", + "socket.io": "^4.7.5", + "socket.io-client": "^4.7.5", + "tsx": "^4.7.1", + "typescript": "^5.3.2", + "uuid": "^9.0.1", + "vite-express": "^0.15.0" + }, + "devDependencies": { + "@types/express": "^4.17.15", + "@types/node": "^20.14.11", + "nodemon": "^3.0.1", + "rimraf": "^6.0.1", + "vite": "^5.2.0" + } + }, + "toolbox/fdc3-for-web/fdc3-web-impl": { "version": "2.2.0-beta.6", "dependencies": { "@kite9/fdc3-standard": "2.2.0-beta.6", @@ -16230,30 +16254,6 @@ "uuid": "^9.0.1" } }, - "toolbox/fdc3-for-web/demo": { - "version": "2.2.0-beta.6", - "dependencies": { - "@kite9/da-server": "2.2.0-beta.6", - "@kite9/fdc3-get-agent": "2.2.0-beta.6", - "@kite9/fdc3-standard": "2.2.0-beta.6", - "@types/uuid": "^10.0.0", - "@types/ws": "^8.5.10", - "express": "^4.18.3", - "socket.io": "^4.7.5", - "socket.io-client": "^4.7.5", - "tsx": "^4.7.1", - "typescript": "^5.3.2", - "uuid": "^9.0.1", - "vite-express": "^0.15.0" - }, - "devDependencies": { - "@types/express": "^4.17.15", - "@types/node": "^20.14.11", - "nodemon": "^3.0.1", - "rimraf": "^6.0.1", - "vite": "^5.2.0" - } - }, "toolbox/fdc3-workbench": { "version": "2.2.0-beta.6", "license": "Apache-2.0", diff --git a/package.json b/package.json index 77af4cbd9..5d7d0b32c 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "packages/fdc3-standard", "packages/testing", "packages/fdc3-agent-proxy", - "toolbox/fdc3-for-web/da-server", + "toolbox/fdc3-for-web/fdc3-web-impl", "packages/fdc3-get-agent", "toolbox/fdc3-for-web/demo", "toolbox/fdc3-workbench", diff --git a/packages/fdc3-get-agent/package.json b/packages/fdc3-get-agent/package.json index c807019ec..da4629e05 100644 --- a/packages/fdc3-get-agent/package.json +++ b/packages/fdc3-get-agent/package.json @@ -21,7 +21,7 @@ }, "devDependencies": { "@cucumber/cucumber": "10.3.1", - "@kite9/da-server": "2.2.0-beta.6", + "@kite9/fdc3-web-impl": "2.2.0-beta.6", "@kite9/testing": "2.2.0-beta.6", "@types/node": "^20.14.11", "@types/wtfnode": "^0.7.3", diff --git a/packages/fdc3-get-agent/test/support/MockFDC3Server.ts b/packages/fdc3-get-agent/test/support/MockFDC3Server.ts index 95dc56fb9..11c8e0cb6 100644 --- a/packages/fdc3-get-agent/test/support/MockFDC3Server.ts +++ b/packages/fdc3-get-agent/test/support/MockFDC3Server.ts @@ -1,4 +1,4 @@ -import { FDC3Server } from "@kite9/da-server" +import { FDC3Server } from "@kite9/fdc3-web-impl" import { TestServerContext } from "./TestServerContext" import { MockWindow } from "./MockDocument" import { AutomaticResponse } from "./responses/AutomaticResponses" diff --git a/packages/fdc3-get-agent/test/support/TestServerContext.ts b/packages/fdc3-get-agent/test/support/TestServerContext.ts index 98e141af8..f7c062055 100644 --- a/packages/fdc3-get-agent/test/support/TestServerContext.ts +++ b/packages/fdc3-get-agent/test/support/TestServerContext.ts @@ -1,4 +1,4 @@ -import { ServerContext, InstanceID } from '@kite9/da-server' +import { ServerContext, InstanceID } from '@kite9/fdc3-web-impl' import { CustomWorld } from '../world' import { OpenError, AppIdentifier, AppIntent, Context } from '@kite9/fdc3' diff --git a/packages/fdc3-get-agent/test/support/responses/AutomaticResponses.ts b/packages/fdc3-get-agent/test/support/responses/AutomaticResponses.ts index de364ced3..1b218ad15 100644 --- a/packages/fdc3-get-agent/test/support/responses/AutomaticResponses.ts +++ b/packages/fdc3-get-agent/test/support/responses/AutomaticResponses.ts @@ -1,4 +1,4 @@ -import { InstanceID } from "@kite9/da-server"; +import { InstanceID } from "@kite9/fdc3-web-impl"; import { TestServerContext } from "../TestServerContext"; export interface AutomaticResponse { diff --git a/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts b/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts index 63b2ce280..7b75c361a 100644 --- a/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts +++ b/packages/fdc3-get-agent/test/support/responses/CurrentChannel.ts @@ -1,5 +1,5 @@ import { TestServerContext } from "../TestServerContext"; -import { InstanceID } from "@kite9/da-server"; +import { InstanceID } from "@kite9/fdc3-web-impl"; import { AutomaticResponse } from "./AutomaticResponses"; import { BrowserTypes } from "@kite9/fdc3-schema"; type GetCurrentChannelRequest = BrowserTypes.GetCurrentChannelRequest diff --git a/packages/fdc3-get-agent/test/support/responses/FindIntent.ts b/packages/fdc3-get-agent/test/support/responses/FindIntent.ts index 5ce59c0e9..add45bc04 100644 --- a/packages/fdc3-get-agent/test/support/responses/FindIntent.ts +++ b/packages/fdc3-get-agent/test/support/responses/FindIntent.ts @@ -1,5 +1,5 @@ import { TestServerContext } from "../TestServerContext"; -import { InstanceID } from "@kite9/da-server"; +import { InstanceID } from "@kite9/fdc3-web-impl"; import { AutomaticResponse } from "./AutomaticResponses"; import { BrowserTypes } from "@kite9/fdc3-schema"; diff --git a/packages/fdc3-get-agent/test/support/responses/Handshake.ts b/packages/fdc3-get-agent/test/support/responses/Handshake.ts index 192d61b8f..c65517839 100644 --- a/packages/fdc3-get-agent/test/support/responses/Handshake.ts +++ b/packages/fdc3-get-agent/test/support/responses/Handshake.ts @@ -1,5 +1,5 @@ import { TestServerContext } from "../TestServerContext"; -import { InstanceID } from "@kite9/da-server"; +import { InstanceID } from "@kite9/fdc3-web-impl"; import { AutomaticResponse } from "./AutomaticResponses"; import { BrowserTypes } from "@kite9/fdc3-schema"; diff --git a/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts b/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts index 6ef14be28..30e4a09f4 100644 --- a/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts +++ b/packages/fdc3-get-agent/test/support/responses/RaiseIntent.ts @@ -1,5 +1,5 @@ import { TestServerContext } from "../TestServerContext"; -import { InstanceID } from "@kite9/da-server"; +import { InstanceID } from "@kite9/fdc3-web-impl"; import { AutomaticResponse } from "./AutomaticResponses"; import { BrowserTypes } from "@kite9/fdc3-schema"; diff --git a/packages/fdc3-get-agent/test/support/responses/UserChannels.ts b/packages/fdc3-get-agent/test/support/responses/UserChannels.ts index e100dd11f..0d4c0fffa 100644 --- a/packages/fdc3-get-agent/test/support/responses/UserChannels.ts +++ b/packages/fdc3-get-agent/test/support/responses/UserChannels.ts @@ -1,5 +1,5 @@ import { TestServerContext } from "../TestServerContext"; -import { InstanceID } from "@kite9/da-server"; +import { InstanceID } from "@kite9/fdc3-web-impl"; import { AutomaticResponse } from "./AutomaticResponses"; import { BrowserTypes } from "@kite9/fdc3-schema"; diff --git a/packages/fdc3-get-agent/tsconfig.json b/packages/fdc3-get-agent/tsconfig.json index 756ac9895..050a5a5e9 100644 --- a/packages/fdc3-get-agent/tsconfig.json +++ b/packages/fdc3-get-agent/tsconfig.json @@ -27,7 +27,7 @@ "path": "../fdc3-context" }, { - "path": "../../toolbox/fdc3-for-web/da-server" + "path": "../../toolbox/fdc3-for-web/fdc3-web-impl" } ] } \ No newline at end of file diff --git a/toolbox/fdc3-for-web/demo/package.json b/toolbox/fdc3-for-web/demo/package.json index 0ae26fb6e..54e04e5bb 100644 --- a/toolbox/fdc3-for-web/demo/package.json +++ b/toolbox/fdc3-for-web/demo/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "@kite9/fdc3-get-agent": "2.2.0-beta.6", - "@kite9/da-server": "2.2.0-beta.6", + "@kite9/fdc3-web-impl": "2.2.0-beta.6", "@kite9/fdc3-standard": "2.2.0-beta.6", "@types/uuid": "^10.0.0", "@types/ws": "^8.5.10", diff --git a/toolbox/fdc3-for-web/demo/src/client/da/DemoServerContext.ts b/toolbox/fdc3-for-web/demo/src/client/da/DemoServerContext.ts index 130cbe128..fc3b5cbbd 100644 --- a/toolbox/fdc3-for-web/demo/src/client/da/DemoServerContext.ts +++ b/toolbox/fdc3-for-web/demo/src/client/da/DemoServerContext.ts @@ -1,4 +1,4 @@ -import { Directory, DirectoryApp, InstanceID, ServerContext } from '@kite9/da-server' +import { Directory, DirectoryApp, InstanceID, ServerContext } from '@kite9/fdc3-web-impl' import { Socket } from 'socket.io-client'; import { v4 as uuid } from 'uuid' import { FDC3_DA_EVENT } from '../../message-types'; diff --git a/toolbox/fdc3-for-web/demo/src/client/da/FDC3_2_1_JSONDirectory.ts b/toolbox/fdc3-for-web/demo/src/client/da/FDC3_2_1_JSONDirectory.ts index 27697c915..7f239a8e0 100644 --- a/toolbox/fdc3-for-web/demo/src/client/da/FDC3_2_1_JSONDirectory.ts +++ b/toolbox/fdc3-for-web/demo/src/client/da/FDC3_2_1_JSONDirectory.ts @@ -1,5 +1,5 @@ -import { BasicDirectory } from "@kite9/da-server/src/directory/BasicDirectory"; -import { DirectoryApp } from "@kite9/da-server/src/directory/DirectoryInterface"; +import { BasicDirectory } from "@kite9/fdc3-web-impl/src/directory/BasicDirectory"; +import { DirectoryApp } from "@kite9/fdc3-web-impl/src/directory/DirectoryInterface"; function loadRemotely(u: string) { return fetch(u).then((response) => response.json()); diff --git a/toolbox/fdc3-for-web/demo/src/client/da/dummy-desktop-agent.ts b/toolbox/fdc3-for-web/demo/src/client/da/dummy-desktop-agent.ts index 579623de1..0b8f3530b 100644 --- a/toolbox/fdc3-for-web/demo/src/client/da/dummy-desktop-agent.ts +++ b/toolbox/fdc3-for-web/demo/src/client/da/dummy-desktop-agent.ts @@ -3,9 +3,9 @@ import { v4 as uuid } from 'uuid' import { APP_GOODBYE, APP_HELLO, DA_HELLO, FDC3_APP_EVENT } from "../../message-types"; import { DemoServerContext } from "./DemoServerContext"; import { FDC3_2_1_JSONDirectory } from "./FDC3_2_1_JSONDirectory"; -import { DefaultFDC3Server, DirectoryApp, ServerContext } from "@kite9/da-server"; +import { DefaultFDC3Server, DirectoryApp, ServerContext } from "@kite9/fdc3-web-impl"; import { WebConnectionProtocol2LoadURL } from "@kite9/fdc3-standard"; -import { ChannelState, ChannelType } from "@kite9/da-server/src/handlers/BroadcastHandler"; +import { ChannelState, ChannelType } from "@kite9/fdc3-web-impl/src/handlers/BroadcastHandler"; import { link } from "./util"; diff --git a/toolbox/fdc3-for-web/demo/src/client/da/util.ts b/toolbox/fdc3-for-web/demo/src/client/da/util.ts index fd3ae5012..cedf0af40 100644 --- a/toolbox/fdc3-for-web/demo/src/client/da/util.ts +++ b/toolbox/fdc3-for-web/demo/src/client/da/util.ts @@ -1,4 +1,4 @@ -import { InstanceID } from "@kite9/da-server" +import { InstanceID } from "@kite9/fdc3-web-impl" import { Socket } from "socket.io-client" import { FDC3_APP_EVENT, FDC3_DA_EVENT } from "../../message-types" diff --git a/toolbox/fdc3-for-web/demo/tsconfig.json b/toolbox/fdc3-for-web/demo/tsconfig.json index 21eef46ab..82975fe97 100644 --- a/toolbox/fdc3-for-web/demo/tsconfig.json +++ b/toolbox/fdc3-for-web/demo/tsconfig.json @@ -29,7 +29,7 @@ "path": "../../../packages/fdc3-get-agent" }, { - "path": "../da-server" + "path": "../fdc3-web-impl" } ] } \ No newline at end of file diff --git a/toolbox/fdc3-for-web/da-server/cucumber.yml b/toolbox/fdc3-for-web/fdc3-web-impl/cucumber.yml similarity index 100% rename from toolbox/fdc3-for-web/da-server/cucumber.yml rename to toolbox/fdc3-for-web/fdc3-web-impl/cucumber.yml diff --git a/toolbox/fdc3-for-web/da-server/package.json b/toolbox/fdc3-for-web/fdc3-web-impl/package.json similarity index 97% rename from toolbox/fdc3-for-web/da-server/package.json rename to toolbox/fdc3-for-web/fdc3-web-impl/package.json index de912b345..0e9f20709 100644 --- a/toolbox/fdc3-for-web/da-server/package.json +++ b/toolbox/fdc3-for-web/fdc3-web-impl/package.json @@ -1,5 +1,5 @@ { - "name": "@kite9/da-server", + "name": "@kite9/fdc3-web-impl", "version": "2.2.0-beta.6", "files": [ "dist" diff --git a/toolbox/fdc3-for-web/da-server/src/BasicFDC3Server.ts b/toolbox/fdc3-for-web/fdc3-web-impl/src/BasicFDC3Server.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/src/BasicFDC3Server.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/src/BasicFDC3Server.ts diff --git a/toolbox/fdc3-for-web/da-server/src/FDC3Server.ts b/toolbox/fdc3-for-web/fdc3-web-impl/src/FDC3Server.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/src/FDC3Server.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/src/FDC3Server.ts diff --git a/toolbox/fdc3-for-web/da-server/src/ServerContext.ts b/toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/src/ServerContext.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts diff --git a/toolbox/fdc3-for-web/da-server/src/directory/BasicDirectory.ts b/toolbox/fdc3-for-web/fdc3-web-impl/src/directory/BasicDirectory.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/src/directory/BasicDirectory.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/src/directory/BasicDirectory.ts diff --git a/toolbox/fdc3-for-web/da-server/src/directory/DirectoryInterface.ts b/toolbox/fdc3-for-web/fdc3-web-impl/src/directory/DirectoryInterface.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/src/directory/DirectoryInterface.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/src/directory/DirectoryInterface.ts diff --git a/toolbox/fdc3-for-web/da-server/src/handlers/BroadcastHandler.ts b/toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/BroadcastHandler.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/src/handlers/BroadcastHandler.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/BroadcastHandler.ts diff --git a/toolbox/fdc3-for-web/da-server/src/handlers/IntentHandler.ts b/toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/src/handlers/IntentHandler.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts diff --git a/toolbox/fdc3-for-web/da-server/src/handlers/OpenHandler.ts b/toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/OpenHandler.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/src/handlers/OpenHandler.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/OpenHandler.ts diff --git a/toolbox/fdc3-for-web/da-server/src/handlers/support.ts b/toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/support.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/src/handlers/support.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/support.ts diff --git a/toolbox/fdc3-for-web/da-server/src/index.ts b/toolbox/fdc3-for-web/fdc3-web-impl/src/index.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/src/index.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/src/index.ts diff --git a/toolbox/fdc3-for-web/da-server/test/features/apps.feature b/toolbox/fdc3-for-web/fdc3-web-impl/test/features/apps.feature similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/features/apps.feature rename to toolbox/fdc3-for-web/fdc3-web-impl/test/features/apps.feature diff --git a/toolbox/fdc3-for-web/da-server/test/features/broadcast.feature b/toolbox/fdc3-for-web/fdc3-web-impl/test/features/broadcast.feature similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/features/broadcast.feature rename to toolbox/fdc3-for-web/fdc3-web-impl/test/features/broadcast.feature diff --git a/toolbox/fdc3-for-web/da-server/test/features/find-intent.feature b/toolbox/fdc3-for-web/fdc3-web-impl/test/features/find-intent.feature similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/features/find-intent.feature rename to toolbox/fdc3-for-web/fdc3-web-impl/test/features/find-intent.feature diff --git a/toolbox/fdc3-for-web/da-server/test/features/intent-result.feature b/toolbox/fdc3-for-web/fdc3-web-impl/test/features/intent-result.feature similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/features/intent-result.feature rename to toolbox/fdc3-for-web/fdc3-web-impl/test/features/intent-result.feature diff --git a/toolbox/fdc3-for-web/da-server/test/features/private-channel.feature b/toolbox/fdc3-for-web/fdc3-web-impl/test/features/private-channel.feature similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/features/private-channel.feature rename to toolbox/fdc3-for-web/fdc3-web-impl/test/features/private-channel.feature diff --git a/toolbox/fdc3-for-web/da-server/test/features/raise-intent-with-context.feature b/toolbox/fdc3-for-web/fdc3-web-impl/test/features/raise-intent-with-context.feature similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/features/raise-intent-with-context.feature rename to toolbox/fdc3-for-web/fdc3-web-impl/test/features/raise-intent-with-context.feature diff --git a/toolbox/fdc3-for-web/da-server/test/features/raise-intent.feature b/toolbox/fdc3-for-web/fdc3-web-impl/test/features/raise-intent.feature similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/features/raise-intent.feature rename to toolbox/fdc3-for-web/fdc3-web-impl/test/features/raise-intent.feature diff --git a/toolbox/fdc3-for-web/da-server/test/features/user-channels.feature b/toolbox/fdc3-for-web/fdc3-web-impl/test/features/user-channels.feature similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/features/user-channels.feature rename to toolbox/fdc3-for-web/fdc3-web-impl/test/features/user-channels.feature diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/app-channel.steps.ts b/toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/app-channel.steps.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/step-definitions/app-channel.steps.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/app-channel.steps.ts diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/broadcast.steps.ts b/toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/broadcast.steps.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/step-definitions/broadcast.steps.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/broadcast.steps.ts diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/generic.steps.ts b/toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/generic.steps.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/step-definitions/generic.steps.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/generic.steps.ts diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/intents.steps.ts b/toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/intents.steps.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/step-definitions/intents.steps.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/intents.steps.ts diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/messaging.steps.ts b/toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/messaging.steps.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/step-definitions/messaging.steps.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/messaging.steps.ts diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/private-channel.steps.ts b/toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/private-channel.steps.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/step-definitions/private-channel.steps.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/private-channel.steps.ts diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/start-app.steps.ts b/toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/start-app.steps.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/step-definitions/start-app.steps.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/start-app.steps.ts diff --git a/toolbox/fdc3-for-web/da-server/test/step-definitions/user-channel.steps.ts b/toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/user-channel.steps.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/step-definitions/user-channel.steps.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/test/step-definitions/user-channel.steps.ts diff --git a/toolbox/fdc3-for-web/da-server/test/support/TestServerContext.ts b/toolbox/fdc3-for-web/fdc3-web-impl/test/support/TestServerContext.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/support/TestServerContext.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/test/support/TestServerContext.ts diff --git a/toolbox/fdc3-for-web/da-server/test/world/index.ts b/toolbox/fdc3-for-web/fdc3-web-impl/test/world/index.ts similarity index 100% rename from toolbox/fdc3-for-web/da-server/test/world/index.ts rename to toolbox/fdc3-for-web/fdc3-web-impl/test/world/index.ts diff --git a/toolbox/fdc3-for-web/da-server/tsconfig.json b/toolbox/fdc3-for-web/fdc3-web-impl/tsconfig.json similarity index 100% rename from toolbox/fdc3-for-web/da-server/tsconfig.json rename to toolbox/fdc3-for-web/fdc3-web-impl/tsconfig.json