From dfedf0d29e09e831c480d092c3111634fcbf08fa Mon Sep 17 00:00:00 2001 From: Rob Moffat Date: Fri, 15 Dec 2023 17:21:21 +0000 Subject: [PATCH] Now contains iframe and port-based connection approaches in demo --- .gitignore | 4 ++ packages/client/src/messaging/message-port.ts | 36 ++++++----- .../client/src/strategies/post-message.ts | 13 ++-- packages/client/tsconfig.tsbuildinfo | 2 +- packages/demo/index.html | 5 ++ packages/demo/src/constants.ts | 4 +- packages/demo/src/dummy-desktop-agent.ts | 63 +++++++++++++++---- packages/fdc3-common/src/index.ts | 15 ++++- packages/server/src/index.ts | 27 ++++++-- 9 files changed, 126 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index 5f60dbacc..e5eca8876 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ target/ **/*.buildinfo /**/dist /**/node_modules +**/tsconfig.buildinfo +packages/server/tsconfig.tsbuildinfo +packages/fdc3-common/tsconfig.tsbuildinfo +packages/client/tsconfig.tsbuildinfo diff --git a/packages/client/src/messaging/message-port.ts b/packages/client/src/messaging/message-port.ts index 98aba3a95..8d28d0f24 100644 --- a/packages/client/src/messaging/message-port.ts +++ b/packages/client/src/messaging/message-port.ts @@ -5,21 +5,9 @@ import { MessagePortMessaging } from "./MessagePortMessaging"; import { ConnectionStep2Hello, ConnectionStep3Handshake } from "@finos/fdc3/dist/bridging/BridgingTypes"; /** - * Initialises the desktop agent by opening an iframe - * on the desktop agent host and communicating via a messsage port to it. - * - * It is up to the desktop agent to arrange communucation between other - * windows. + * Given a message port, constructs a desktop agent to communicate via that. */ -export async function messagePortInit(data: APIResponseMessage, options: Options) : Promise { - - const action = data.uri ? () => { - return openFrame(data.uri!!); - } : () => { - return messageParentWindow(options.frame) - } - - const mp = await exchangeForMessagePort(window, FDC3_PORT_TRANSFER_RESPONSE_TYPE, action) as MessagePort +export async function messagePortInit(mp: MessagePort, data: APIResponseMessage) : Promise { mp.start() const handshakeData = (await exchange(mp, "handshake", () => sendHello(mp, data))).data as ConnectionStep3Handshake @@ -35,6 +23,26 @@ export async function messagePortInit(data: APIResponseMessage, options: Options data.provider); } +/** + * Initialises the desktop agent by opening an iframe + * on the desktop agent host and communicating via a messsage port to it. + * + * It is up to the desktop agent to arrange communucation between other + * windows. + */ +export async function messagePortIFrameInit(data: APIResponseMessage, options: Options) : Promise { + + const action = data.uri ? () => { + return openFrame(data.uri!!); + } : () => { + return messageParentWindow(options.frame) + } + + const mp = await exchangeForMessagePort(window, FDC3_PORT_TRANSFER_RESPONSE_TYPE, action) as MessagePort + + return messagePortInit(mp, data); +} + /** * If the desktop agent doesn't provide an opener URL, we message another iframe asking for the port. */ diff --git a/packages/client/src/strategies/post-message.ts b/packages/client/src/strategies/post-message.ts index 9eb72b632..f22b78e6a 100644 --- a/packages/client/src/strategies/post-message.ts +++ b/packages/client/src/strategies/post-message.ts @@ -1,6 +1,6 @@ import { DesktopAgent } from '@finos/fdc3' import { APIResponseMessage, Loader, Options, FDC3_API_RESPONSE_MESSAGE_TYPE, FDC3_API_REQUEST_MESSAGE_TYPE } from 'fdc3-common' -import { messagePortInit } from '../messaging/message-port'; +import { messagePortIFrameInit, messagePortInit } from '../messaging/message-port'; const loader: Loader = (options: Options) => { @@ -9,10 +9,15 @@ const loader: Loader = (options: Options) => { window.addEventListener("message", (event) => { const data: APIResponseMessage = event.data; if ((data.type == FDC3_API_RESPONSE_MESSAGE_TYPE) && (data.method == 'message-port')) { - resolve(messagePortInit(data, options)) - } else { - reject("Incorrect API Response Message"); + if (event.ports.length == 1) { + resolve(messagePortInit(event.ports[0], data)); + } else if (data.uri) { + resolve(messagePortIFrameInit(data, options)) + } } + + // need either a port or a uri + reject("Incorrect API Response Message: "+JSON.stringify(data)); }, { once: true }); }); diff --git a/packages/client/tsconfig.tsbuildinfo b/packages/client/tsconfig.tsbuildinfo index 5c79d84a0..90fd8d171 100644 --- a/packages/client/tsconfig.tsbuildinfo +++ b/packages/client/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"program":{"fileNames":["../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es5.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2016.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2018.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2019.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2021.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.dom.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.decorators.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/AppIdentifier.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Icon.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Image.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/AppMetadata.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/IntentMetadata.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/AppIntent.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/context/ContextTypes.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Types.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/DisplayMetadata.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Listener.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Channel.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/IntentResolution.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/ImplementationMetadata.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/PrivateChannel.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/DesktopAgent.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/bridging/BridgingTypes.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/ContextMetadata.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Errors.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Methods.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/RecommendedChannels.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/context/ContextType.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/intents/Intents.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/index.d.ts","../fdc3-common/dist/exchange.d.ts","../fdc3-common/dist/index.d.ts","../da/dist/channels/ChannelSupport.d.ts","../da/dist/intents/IntentSupport.d.ts","../da/dist/apps/AppSupport.d.ts","../da/dist/BasicDesktopAgent.d.ts","../da/dist/Messaging.d.ts","../da/dist/channels/StatefulChannel.d.ts","../da/dist/channels/DefaultChannel.d.ts","../da/dist/listeners/DefaultContextListener.d.ts","../da/dist/DesktopAgentProvider.d.ts","../da/dist/intents/DefaultIntentSupport.d.ts","../da/dist/channels/ChannelContextListener.d.ts","../da/dist/channels/DefaultChannelSupport.d.ts","../da/dist/apps/DefaultAppSupport.d.ts","../da/dist/index.d.ts","../../../../../../.yarn/berry/cache/@types-uuid-npm-9.0.7-c380bb8654-10c0.zip/node_modules/@types/uuid/index.d.ts","./src/messaging/MessagePortMessaging.ts","./src/messaging/message-port.ts","./src/strategies/post-message.ts","./src/index.ts","./src/strategies/electron-event.ts"],"fileInfos":[{"version":"f33e5332b24c3773e930e212cbb8b6867c8ba3ec4492064ea78e55a524d57450","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","26f2f787e82c4222710f3b676b4d83eb5ad0a72fa7b746f03449e7a026ce5073","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569",{"version":"21e41a76098aa7a191028256e52a726baafd45a925ea5cf0222eb430c96c1d83","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"e0275cd0e42990dc3a16f0b7c8bca3efe87f1c8ad404f80c6db1c7c0b828c59f","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"acae90d417bee324b1372813b5a00829d31c7eb670d299cd7f8f9a648ac05688","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"62a4966981264d1f04c44eb0f4b5bdc3d81c1a54725608861e44755aa24ad6a5","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"f92fbd8b37c0aeb9869e4b20293ddb6148214efe94de0fa58eb4f6fd7ce9e98f","7a2d75b282ad18739297d21013ff5acce340add530bb24830de7075731bd5654","49203d1c497068739e0e6cc2491451af9aa9405299ebfb191f6943f51dc7ef9d","94854ff64e0e5f50f3d0483dcf18510f58122801be741c876380bdf26f4defc0","66fa6b37e8076e165d5273f2badae209b7220b27a96f94dc44a32183a9a0d937","338e0dc9b6b39371af7d127d530b9d50220a25f20bf3baa5278580f71ce9c345","810b8adb482de42c1eadf24fa280f0010276f4c5931241676837358bfe8e16aa","6ce28ea14070f3c91678be9b7f06e92c88272efab56ea99ceb2a27f922d67cdd","cf27dae9a66966d3d615c4f03e14ad526d589a153241b2728fe116c52da017b6","cdb9952b59fa59e17078368c4af3d54dad8cfa4784481ae319ea04b61f907509","4f53bc7f120296effc148962fe51044fd306f67d9d8d757000ec40592ad56762","6900630a6b5eaf2c87d1dac021d2f3081aa47874ba90fc5daca1517cfe07b4ca","5edafab68d5a0c8d6ec3bfbc304385b2e39413e98de629865451d8b1d1f045a9","7549c231aeccdf08dde7e39c345733fb697867fb2c29dac2f80e54430a58aa72","df0b9bdd990dfab1b81f93814d1480d7e27e7b73f6cb0246bcb7d1b523977d03","8eeb579bb2bf27f5c19c6c463eaacd78f9366f363409960b9dd5dfda7001d5b1","8a46318db8e49a3504bd6fd02bbd4133c6b7997c8c382e4fb0ebf50ddab23cf8","ba08a07976474d82a63f80f4d109daa13c27a3b397a82d774a3e87601bd15a6c","f45b5b6caf3504f4c513448592aa51244c2646821731bd4365d8913a0520a8cb","b1ee7cdb57f18fddb6f0539e3ab72a0489b6f1524ff899b00575e7906baa001d","31ded1a3b4fef461f11b843a1802c5bc98be75870588bd4d8ae9f0008acd3668","73d42630e307d657ce41df6453941b62d78148bf5d862373ad940cd43ea446c1",{"version":"78cc777e8c04d5debe5aebf4b1ec396dff66c8f28fd8279935cfb2160056a5f9","affectsGlobalScope":true},"6996d84561e59993e522ba3e6fb97c2e7906d6652aaa6945faa7c3ac5fe21bd9","234132c7f6315187aa23762e3085e0816ee5cac1fefa815d9a64a285dbf1c6e5","f82fa191b0f642718ce386fa44a8cb9150b88055f1c3fe59d8d3d17eeb465ec8","24c216b8f7e198b7c74660f6fc78f18f0d7c7e0af5b967a3acb378b6b78cfa67","7c2873ef40679f6f904b81e9cf363e179abd9a938f9e34b99e94b8b282c1114c","415cd0b6340fa03a4c6c379842271bbb235ed880fc36db5c4cc055002538e3f1","e195660bf297f8184b3bfdfed7f647bde58b2782a19b1c8268df4bb578c8b67c","fc37fd40d4f4c9890180d1743a5365d8d0e36efa970e5e7dbf467676e97b2413","e1fbf5fce37e360e0e6683ea903ded7fbc6314233c9e76415d8890e3549627ff","130548423b41c45d5cd07c1900b1b041235380cab3120403940619e90b60d941","f019d2db24a5349458ed587caa945d73e4b14a5c18cabb9e0826f8bbf28aa9a4","724d2cc1f1211c1e14a4044d9b3f4df75425c7676eb356103f3e50b4866a860d","b957b19633dd7c87a072a76323b6e98b0d1520b7e54257bdf0ace127742a8e32","0c536fd1ba2c103bbce31ce474f4b2f13b4478fda60b6be8ba26c0c58bc32d83","2cdd6b570fd345f89f01b19c978280eeca06209d2050fd832d5bcc563a28ecd4","58b86706c2ecdbf388731d66027e8b87af4633cd25c94ac59075d1c2d77f75e5","7d2b7fe4adb76d8253f20e4dbdce044f1cdfab4902ec33c3604585f553883f7d",{"version":"f9908a9b05105e38f284baa5a999df28e294f8cefc4299b42851faa3169398a4","signature":"4c58592de8238ec605b66e3abf36a9156dce82d8b3f5eafe8d484d40832a40b1"},{"version":"bc6fc279904e4f81b140a2a1513aa603e8e4c503d7db0fb90894a780300ca2ed","signature":"edfc8587d86a04f83ca3f795c2053d1e3d01155c995ef374e1712732e4a272af"},{"version":"33df2e05198ccd5a3a835cad08d98f4b9db781cf7758dd2727095d168232eac8","signature":"3720109503cb5449c9db839c8842af9a2fd7caa84d7769bb2a58a6396b891c23"},{"version":"53313f3dd8d909d258778dce81237afc4f54aa6c173479ef6006212e1626fbbb","signature":"2df893eab28e316f64be70c73243b68bcf03598316d00084d5a9c388d8f7c0e5"},{"version":"8031a689bd27a13c144e3a2e5e6e05c35c162058d6501ebd73475fd33a6441c3","signature":"f22f6bdb19df55bc5afd000ba54988b51c77bc637162357bef772eedf99d044f"}],"root":[[90,94]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":99,"noFallthroughCasesInSwitch":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./dist","rootDir":"./src","sourceMap":true,"strict":true,"target":1},"fileIdsList":[[53,54],[50,51,52],[56,57,58,59],[50],[50,53,55,56,57,59,60,61,62,63],[53],[50,57],[72],[59,60],[58],[56,72],[50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71],[72,74,92],[65,72,74,88,89],[65,72,74,88,90],[72,74],[72,74,91],[72,75,76,77],[65,72],[72,77,79],[72,79,82],[72,79,80],[72,75,79,80,85],[75,76,77,78,79,80,81,82,83,84,86,87],[72,76],[72,79],[72,73],[72,88],[74]],"referencedMap":[[55,1],[53,2],[60,3],[66,4],[64,5],[62,6],[61,7],[68,8],[63,9],[69,10],[57,11],[72,12],[93,13],[90,14],[91,15],[94,16],[92,17],[78,18],[83,19],[79,8],[77,8],[87,20],[85,21],[75,8],[81,22],[86,23],[80,8],[88,24],[84,25],[76,8],[82,26],[74,27]],"exportedModulesMap":[[55,1],[53,2],[60,3],[66,4],[64,5],[62,6],[61,7],[68,8],[63,9],[69,10],[57,11],[72,12],[93,16],[90,28],[91,16],[94,29],[92,29],[78,18],[83,19],[79,8],[77,8],[87,20],[85,21],[75,8],[81,22],[86,23],[80,8],[88,24],[84,25],[76,8],[82,26],[74,27]],"semanticDiagnosticsPerFile":[50,55,53,60,66,64,58,67,51,52,62,54,61,59,68,63,69,57,65,70,56,72,71,89,48,49,9,11,10,2,12,13,14,15,16,17,18,19,3,4,20,24,21,22,23,25,26,27,5,28,29,30,31,6,35,32,33,34,36,7,37,42,43,38,39,40,41,8,47,44,45,46,1,93,90,91,94,92,78,83,79,77,87,85,75,81,86,80,88,84,76,82,73,74],"latestChangedDtsFile":"./dist/strategies/electron-event.d.ts"},"version":"5.3.2"} \ No newline at end of file +{"program":{"fileNames":["../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es5.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2016.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2018.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2019.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2021.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.dom.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.decorators.d.ts","../../../../../../.yarn/berry/cache/typescript-patch-71fdfda6a2-10c0.zip/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/AppIdentifier.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Icon.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Image.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/AppMetadata.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/IntentMetadata.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/AppIntent.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/context/ContextTypes.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Types.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/DisplayMetadata.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Listener.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Channel.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/IntentResolution.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/ImplementationMetadata.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/PrivateChannel.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/DesktopAgent.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/bridging/BridgingTypes.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/ContextMetadata.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Errors.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/Methods.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/api/RecommendedChannels.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/context/ContextType.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/intents/Intents.d.ts","../../../../../../.yarn/berry/cache/@finos-fdc3-npm-2.1.0-beta.4-a2c7cde941-10c0.zip/node_modules/@finos/fdc3/dist/index.d.ts","../fdc3-common/dist/exchange.d.ts","../fdc3-common/dist/index.d.ts","../da/dist/channels/ChannelSupport.d.ts","../da/dist/intents/IntentSupport.d.ts","../da/dist/apps/AppSupport.d.ts","../da/dist/BasicDesktopAgent.d.ts","../da/dist/Messaging.d.ts","../da/dist/channels/StatefulChannel.d.ts","../da/dist/channels/DefaultChannel.d.ts","../da/dist/listeners/DefaultContextListener.d.ts","../da/dist/DesktopAgentProvider.d.ts","../da/dist/intents/DefaultIntentSupport.d.ts","../da/dist/channels/ChannelContextListener.d.ts","../da/dist/channels/DefaultChannelSupport.d.ts","../da/dist/apps/DefaultAppSupport.d.ts","../da/dist/index.d.ts","../../../../../../.yarn/berry/cache/@types-uuid-npm-9.0.7-c380bb8654-10c0.zip/node_modules/@types/uuid/index.d.ts","./src/messaging/MessagePortMessaging.ts","./src/messaging/message-port.ts","./src/strategies/post-message.ts","./src/index.ts","./src/strategies/electron-event.ts"],"fileInfos":[{"version":"f33e5332b24c3773e930e212cbb8b6867c8ba3ec4492064ea78e55a524d57450","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","26f2f787e82c4222710f3b676b4d83eb5ad0a72fa7b746f03449e7a026ce5073","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569",{"version":"21e41a76098aa7a191028256e52a726baafd45a925ea5cf0222eb430c96c1d83","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"e0275cd0e42990dc3a16f0b7c8bca3efe87f1c8ad404f80c6db1c7c0b828c59f","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"acae90d417bee324b1372813b5a00829d31c7eb670d299cd7f8f9a648ac05688","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"62a4966981264d1f04c44eb0f4b5bdc3d81c1a54725608861e44755aa24ad6a5","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"f92fbd8b37c0aeb9869e4b20293ddb6148214efe94de0fa58eb4f6fd7ce9e98f","7a2d75b282ad18739297d21013ff5acce340add530bb24830de7075731bd5654","49203d1c497068739e0e6cc2491451af9aa9405299ebfb191f6943f51dc7ef9d","94854ff64e0e5f50f3d0483dcf18510f58122801be741c876380bdf26f4defc0","66fa6b37e8076e165d5273f2badae209b7220b27a96f94dc44a32183a9a0d937","338e0dc9b6b39371af7d127d530b9d50220a25f20bf3baa5278580f71ce9c345","810b8adb482de42c1eadf24fa280f0010276f4c5931241676837358bfe8e16aa","6ce28ea14070f3c91678be9b7f06e92c88272efab56ea99ceb2a27f922d67cdd","cf27dae9a66966d3d615c4f03e14ad526d589a153241b2728fe116c52da017b6","cdb9952b59fa59e17078368c4af3d54dad8cfa4784481ae319ea04b61f907509","4f53bc7f120296effc148962fe51044fd306f67d9d8d757000ec40592ad56762","6900630a6b5eaf2c87d1dac021d2f3081aa47874ba90fc5daca1517cfe07b4ca","5edafab68d5a0c8d6ec3bfbc304385b2e39413e98de629865451d8b1d1f045a9","7549c231aeccdf08dde7e39c345733fb697867fb2c29dac2f80e54430a58aa72","df0b9bdd990dfab1b81f93814d1480d7e27e7b73f6cb0246bcb7d1b523977d03","8eeb579bb2bf27f5c19c6c463eaacd78f9366f363409960b9dd5dfda7001d5b1","8a46318db8e49a3504bd6fd02bbd4133c6b7997c8c382e4fb0ebf50ddab23cf8","ba08a07976474d82a63f80f4d109daa13c27a3b397a82d774a3e87601bd15a6c","f45b5b6caf3504f4c513448592aa51244c2646821731bd4365d8913a0520a8cb","b1ee7cdb57f18fddb6f0539e3ab72a0489b6f1524ff899b00575e7906baa001d","31ded1a3b4fef461f11b843a1802c5bc98be75870588bd4d8ae9f0008acd3668","73d42630e307d657ce41df6453941b62d78148bf5d862373ad940cd43ea446c1",{"version":"78cc777e8c04d5debe5aebf4b1ec396dff66c8f28fd8279935cfb2160056a5f9","affectsGlobalScope":true},"6996d84561e59993e522ba3e6fb97c2e7906d6652aaa6945faa7c3ac5fe21bd9","5ad9570a3285ce113acffa3a9d67b7e436fc0969fc5de3f149eeb2494e8505b3","f82fa191b0f642718ce386fa44a8cb9150b88055f1c3fe59d8d3d17eeb465ec8","24c216b8f7e198b7c74660f6fc78f18f0d7c7e0af5b967a3acb378b6b78cfa67","7c2873ef40679f6f904b81e9cf363e179abd9a938f9e34b99e94b8b282c1114c","415cd0b6340fa03a4c6c379842271bbb235ed880fc36db5c4cc055002538e3f1","e195660bf297f8184b3bfdfed7f647bde58b2782a19b1c8268df4bb578c8b67c","fc37fd40d4f4c9890180d1743a5365d8d0e36efa970e5e7dbf467676e97b2413","e1fbf5fce37e360e0e6683ea903ded7fbc6314233c9e76415d8890e3549627ff","130548423b41c45d5cd07c1900b1b041235380cab3120403940619e90b60d941","f019d2db24a5349458ed587caa945d73e4b14a5c18cabb9e0826f8bbf28aa9a4","724d2cc1f1211c1e14a4044d9b3f4df75425c7676eb356103f3e50b4866a860d","b957b19633dd7c87a072a76323b6e98b0d1520b7e54257bdf0ace127742a8e32","0c536fd1ba2c103bbce31ce474f4b2f13b4478fda60b6be8ba26c0c58bc32d83","2cdd6b570fd345f89f01b19c978280eeca06209d2050fd832d5bcc563a28ecd4","58b86706c2ecdbf388731d66027e8b87af4633cd25c94ac59075d1c2d77f75e5","7d2b7fe4adb76d8253f20e4dbdce044f1cdfab4902ec33c3604585f553883f7d",{"version":"f9908a9b05105e38f284baa5a999df28e294f8cefc4299b42851faa3169398a4","signature":"4c58592de8238ec605b66e3abf36a9156dce82d8b3f5eafe8d484d40832a40b1"},{"version":"c8082cd669f60efcb99036c569d8cd10f716286ef0532d5aa791e33e1ad463f2","signature":"396f222fdb6a0f9a8ca17f90287f8417a976c01edd0962fb3817ac64fd6eb101"},{"version":"b31dcfbefd566f86097e486beba8ea0e46af7bf551daa1290aedaf8c36b88cd0","signature":"3720109503cb5449c9db839c8842af9a2fd7caa84d7769bb2a58a6396b891c23"},{"version":"53313f3dd8d909d258778dce81237afc4f54aa6c173479ef6006212e1626fbbb","signature":"2df893eab28e316f64be70c73243b68bcf03598316d00084d5a9c388d8f7c0e5"},{"version":"8031a689bd27a13c144e3a2e5e6e05c35c162058d6501ebd73475fd33a6441c3","signature":"f22f6bdb19df55bc5afd000ba54988b51c77bc637162357bef772eedf99d044f"}],"root":[[90,94]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":99,"noFallthroughCasesInSwitch":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./dist","rootDir":"./src","sourceMap":true,"strict":true,"target":1},"fileIdsList":[[53,54],[50,51,52],[56,57,58,59],[50],[50,53,55,56,57,59,60,61,62,63],[53],[50,57],[72],[59,60],[58],[56,72],[50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71],[72,74,92],[65,72,74,88,89],[65,72,74,88,90],[72,74],[72,74,91],[72,75,76,77],[65,72],[72,77,79],[72,79,82],[72,79,80],[72,75,79,80,85],[75,76,77,78,79,80,81,82,83,84,86,87],[72,76],[72,79],[72,73],[72,88],[74]],"referencedMap":[[55,1],[53,2],[60,3],[66,4],[64,5],[62,6],[61,7],[68,8],[63,9],[69,10],[57,11],[72,12],[93,13],[90,14],[91,15],[94,16],[92,17],[78,18],[83,19],[79,8],[77,8],[87,20],[85,21],[75,8],[81,22],[86,23],[80,8],[88,24],[84,25],[76,8],[82,26],[74,27]],"exportedModulesMap":[[55,1],[53,2],[60,3],[66,4],[64,5],[62,6],[61,7],[68,8],[63,9],[69,10],[57,11],[72,12],[93,16],[90,28],[91,16],[94,29],[92,29],[78,18],[83,19],[79,8],[77,8],[87,20],[85,21],[75,8],[81,22],[86,23],[80,8],[88,24],[84,25],[76,8],[82,26],[74,27]],"semanticDiagnosticsPerFile":[50,55,53,60,66,64,58,67,51,52,62,54,61,59,68,63,69,57,65,70,56,72,71,89,48,49,9,11,10,2,12,13,14,15,16,17,18,19,3,4,20,24,21,22,23,25,26,27,5,28,29,30,31,6,35,32,33,34,36,7,37,42,43,38,39,40,41,8,47,44,45,46,1,93,90,91,94,92,78,83,79,77,87,85,75,81,86,80,88,84,76,82,73,74],"latestChangedDtsFile":"./dist/messaging/message-port.d.ts"},"version":"5.3.2"} \ No newline at end of file diff --git a/packages/demo/index.html b/packages/demo/index.html index dfd04d1bf..20ee14286 100644 --- a/packages/demo/index.html +++ b/packages/demo/index.html @@ -15,6 +15,11 @@ + +
  • Open App 1 on MAIN HOST diff --git a/packages/demo/src/constants.ts b/packages/demo/src/constants.ts index 777aeac74..fb6fac94b 100644 --- a/packages/demo/src/constants.ts +++ b/packages/demo/src/constants.ts @@ -1,4 +1,4 @@ -export const MAIN_HOST = 'http://robs-pro:8080' -export const SECOND_HOST = 'http://localhost:8080' \ No newline at end of file +export const MAIN_HOST = 'http://localhost:8080' +export const SECOND_HOST = 'http://robs-pro:8080' diff --git a/packages/demo/src/dummy-desktop-agent.ts b/packages/demo/src/dummy-desktop-agent.ts index 1671f521d..4b66a2534 100644 --- a/packages/demo/src/dummy-desktop-agent.ts +++ b/packages/demo/src/dummy-desktop-agent.ts @@ -1,9 +1,11 @@ import { AppIdentifier } from "@finos/fdc3"; -import { AppChecker, DesktopAgentDetailResolver, FDC3_PORT_TRANSFER_REQUEST_TYPE, } from "fdc3-common"; +import { AppChecker, DesktopAgentDetailResolver, DesktopAgentDetails, DesktopAgentPortResolver, FDC3_PORT_TRANSFER_REQUEST_TYPE, } from "fdc3-common"; import { supply } from "server"; import { MAIN_HOST, SECOND_HOST } from "./constants"; -enum Approach { Tab, Frame, Nested } +enum Opener { Tab, Frame, Nested } + +enum Approach { IFRAME, PARENT_POST_MESSAGE } window.addEventListener("load", () => { @@ -14,9 +16,16 @@ window.addEventListener("load", () => { const instances : AppIdentifierAndWindow[] = [] - function getApproach() : Approach { + function getOpener() : Opener { const cb = document.getElementById("opener") as HTMLInputElement; const val = cb.value + var out : Opener = Opener[val as keyof typeof Opener]; //Works with --noImplicitAny + return out; + } + + function getApproach() : Approach { + const cb = document.getElementById("approach") as HTMLInputElement; + const val = cb.value var out : Approach = Approach[val as keyof typeof Approach]; //Works with --noImplicitAny return out; } @@ -44,13 +53,13 @@ window.addEventListener("load", () => { } function open(url: string): Window { - const approach = getApproach(); - switch (approach) { - case Approach.Tab: + const opener = getOpener(); + switch (opener) { + case Opener.Tab: return openTab(url); - case Approach.Nested: + case Opener.Nested: return openNested(url); - case Approach.Frame: + case Opener.Frame: return openFrame(url); } throw new Error("unsupported") @@ -71,17 +80,45 @@ window.addEventListener("load", () => { // for a given window, allows us to determine which app it is (if any) const appChecker : AppChecker = o => instances.find(i => i.window == o) + // this is for when the API is using an iframe, and needs to know the address to load const detailsResolver : DesktopAgentDetailResolver = (o, a) => { const apiKey = "ABC"+ (currentApiInstance++) - return { - apiKey + if (getApproach() == Approach.IFRAME) { + return { + apiKey, + uri: MAIN_HOST+ "/static/embed/index.html" + } + } else { + return { + apiKey + } as DesktopAgentDetails } } - // set up desktop agent handler here using FDC3 Web Loader (or whatever we call it) - supply(appChecker, detailsResolver, { - uri: MAIN_HOST+ "/static/embed/index.html" + // this is for when the api isn't using an iframe, and just requests a port from this host directly. + const sw = new SharedWorker(MAIN_HOST+'/src/server/SimpleServer.ts', { + type: "module", + name: "Demo FDC3 Server" }) + + sw.port.start() + + const portResolver : DesktopAgentPortResolver = (o, a) => { + if (getApproach() == Approach.IFRAME) { + return null; + } else { + const sw = new SharedWorker(MAIN_HOST+'/src/server/SimpleServer.ts', { + type: "module", + name: "Demo FDC3 Server" + }) + + sw.port.start() + return sw.port; + } + } + + // set up desktop agent handler here using FDC3 Web Loader (or whatever we call it) + supply(appChecker, detailsResolver, portResolver) // hook up the buttons document.getElementById("app1")?.addEventListener("click", () => launch(MAIN_HOST+"/static/app1/index.html", "1")); diff --git a/packages/fdc3-common/src/index.ts b/packages/fdc3-common/src/index.ts index 9fc797763..48dc83249 100644 --- a/packages/fdc3-common/src/index.ts +++ b/packages/fdc3-common/src/index.ts @@ -16,7 +16,10 @@ export { exchange, exchangePostMessage, exchangeForMessagePort } export type AppChecker = (o: Window) => AppIdentifier | undefined; -export type Supplier = (checker: AppChecker, detailsResolver: DesktopAgentDetailResolver, staticDetails: DesktopAgentDetails) => void +export type Supplier = ( + checker: AppChecker, + detailsResolver: DesktopAgentDetailResolver, + portResolver?: DesktopAgentPortResolver) => void; export type Loader = (options: Options) => Promise @@ -26,9 +29,15 @@ export type Loader = (options: Options) => Promise */ export type DesktopAgentDetails = { [key: string] : string | number | boolean } +/** + * Use these to return details specific to the window/app needing a connection + */ export type DesktopAgentDetailResolver = (o: Window, a: AppIdentifier) => DesktopAgentDetails -export type Method = (r: APIResponseMessage, options: Options) => Promise +/** + * Return a MessagePort specific to the window/app in question + */ +export type DesktopAgentPortResolver = (o: Window, a: AppIdentifier) => MessagePort | null /** * This is the object that the desktop agent must get back to the App. @@ -38,7 +47,7 @@ export type Method = (r: APIResponseMessage, options: Options) => Promise { +export const supply: Supplier = ( + checker: AppChecker, + detailsResolver: DesktopAgentDetailResolver, + portResolver: DesktopAgentPortResolver = () => null) => { function createResponseMessage(source: Window, appId: AppIdentifier): APIResponseMessage { return { @@ -16,7 +19,6 @@ export const supply: Supplier = (checker: AppChecker, detailsResolver: DesktopAg supportedFDC3Versions: [ '2.0'], fdc3Version: "2.0", type: FDC3_API_RESPONSE_MESSAGE_TYPE, - ...staticDetails, ...detailsResolver(source, appId), method: "message-port", @@ -29,19 +31,32 @@ export const supply: Supplier = (checker: AppChecker, detailsResolver: DesktopAg } } + function createTransferrableArray(source: Window, appId: AppIdentifier): Transferable[] { + const port = portResolver(source, appId); + if (port) { + return [ port ] + } else { + return [] + } + } + window.addEventListener( "message", (event) => { - console.log("Received: " + JSON.stringify(event)); const data = event.data; + console.log("Received: " + JSON.stringify(event.data)); if (data.type == FDC3_API_REQUEST_MESSAGE_TYPE) { const origin = event.origin; const source = event.source as Window const appDetails = checker(source) if (appDetails) { console.log(`API Request Origin: ${origin}`); - - source.postMessage(createResponseMessage(source,appDetails), origin); + const message = createResponseMessage(source,appDetails) + const transferrables = createTransferrableArray(source, appDetails) + source.postMessage(message, { + targetOrigin: origin, + transfer: transferrables + }) } } });