@interopio/fdc3 2.7.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +4 -0
- package/dist/fdc3.electron.es.js +110 -70
- package/dist/fdc3.electron.umd.js +110 -70
- package/dist/fdc3.es.js +110 -70
- package/dist/fdc3.umd.js +110 -70
- package/package.json +5 -3
package/dist/fdc3.umd.js
CHANGED
|
@@ -4996,6 +4996,9 @@
|
|
|
4996
4996
|
|
|
4997
4997
|
const nonEmptyStringDecoder$1 = string$1().where((s) => s.length > 0, "Expected a non-empty string");
|
|
4998
4998
|
const nonNegativeNumberDecoder = number$1().where((num) => num >= 0, "Expected a non-negative number");
|
|
4999
|
+
const regexDecoder = anyJson$1().andThen((value) => {
|
|
5000
|
+
return value instanceof RegExp ? anyJson$1() : fail(`expected a regex, got a ${typeof value}`);
|
|
5001
|
+
});
|
|
4999
5002
|
|
|
5000
5003
|
const intentDefinitionDecoder = object$1({
|
|
5001
5004
|
name: nonEmptyStringDecoder$1,
|
|
@@ -5322,7 +5325,8 @@
|
|
|
5322
5325
|
const decoders$1 = {
|
|
5323
5326
|
common: {
|
|
5324
5327
|
nonEmptyStringDecoder: nonEmptyStringDecoder$1,
|
|
5325
|
-
nonNegativeNumberDecoder
|
|
5328
|
+
nonNegativeNumberDecoder,
|
|
5329
|
+
regexDecoder
|
|
5326
5330
|
},
|
|
5327
5331
|
fdc3: {
|
|
5328
5332
|
allDefinitionsDecoder,
|
|
@@ -6254,9 +6258,6 @@
|
|
|
6254
6258
|
})
|
|
6255
6259
|
})
|
|
6256
6260
|
});
|
|
6257
|
-
object({
|
|
6258
|
-
channelId: optional(nonEmptyStringDecoder)
|
|
6259
|
-
});
|
|
6260
6261
|
const privateChannelEventTypesDecoder = oneOf(constant("addContextListener"), constant("unsubscribe"), constant("disconnect"));
|
|
6261
6262
|
const optionalPrivateChannelEventTypesDecoder = optional(privateChannelEventTypesDecoder);
|
|
6262
6263
|
const optionalFdc3EventTypesDecoder = optional(constant("userChannelChanged"));
|
|
@@ -6309,12 +6310,12 @@
|
|
|
6309
6310
|
interopInstance() {
|
|
6310
6311
|
return this.glue.interop.instance;
|
|
6311
6312
|
}
|
|
6312
|
-
async getApplication(
|
|
6313
|
+
async getApplication(options) {
|
|
6313
6314
|
const isAppsAPIAvailable = this.isAppsAPIAvailable();
|
|
6314
6315
|
if (!isAppsAPIAvailable) {
|
|
6315
|
-
return this.glue.appManager.application(name);
|
|
6316
|
+
return this.glue.appManager.application(options.name);
|
|
6316
6317
|
}
|
|
6317
|
-
const app = await this.glue.apps.registry.get(
|
|
6318
|
+
const app = await this.glue.apps.registry.get(options);
|
|
6318
6319
|
return app ?? undefined;
|
|
6319
6320
|
}
|
|
6320
6321
|
async getApplicationInstances(appName) {
|
|
@@ -6333,6 +6334,21 @@
|
|
|
6333
6334
|
const appInstance = await this.glue.apps.instances.get({ id });
|
|
6334
6335
|
return appInstance ?? undefined;
|
|
6335
6336
|
}
|
|
6337
|
+
async getIoCDAppConfiguration(app) {
|
|
6338
|
+
const isAppsAPIAvailable = this.isAppsAPIAvailable();
|
|
6339
|
+
if (!isAppsAPIAvailable) {
|
|
6340
|
+
return app.getConfiguration();
|
|
6341
|
+
}
|
|
6342
|
+
const definition = app.definition;
|
|
6343
|
+
if (definition) {
|
|
6344
|
+
return definition;
|
|
6345
|
+
}
|
|
6346
|
+
const appWithDefinition = await this.glue.apps.registry.get({ name: app.name, includeDefinition: true });
|
|
6347
|
+
if (!appWithDefinition?.definition) {
|
|
6348
|
+
throw new Error(`Application definition for app '${app.name}' could not be found`);
|
|
6349
|
+
}
|
|
6350
|
+
return appWithDefinition.definition;
|
|
6351
|
+
}
|
|
6336
6352
|
async startApplication({ app, context, waitForInstanceReady }) {
|
|
6337
6353
|
const isAppsAPIAvailable = this.isAppsAPIAvailable();
|
|
6338
6354
|
if (!isAppsAPIAvailable) {
|
|
@@ -6350,13 +6366,14 @@
|
|
|
6350
6366
|
return this.glue.intents.find(intentFilter);
|
|
6351
6367
|
}
|
|
6352
6368
|
async raiseIntent(request) {
|
|
6353
|
-
|
|
6369
|
+
const result = await this.glue.intents.raise(request);
|
|
6370
|
+
return result;
|
|
6354
6371
|
}
|
|
6355
6372
|
doesFilterHandlersExist() {
|
|
6356
6373
|
return !!this.glue.intents.filterHandlers;
|
|
6357
6374
|
}
|
|
6358
6375
|
async filterHandlers(handlerFilter) {
|
|
6359
|
-
if (!this.
|
|
6376
|
+
if (!this.doesFilterHandlersExist()) {
|
|
6360
6377
|
throw new Error("Intents method 'filterHandlers' does not exist");
|
|
6361
6378
|
}
|
|
6362
6379
|
return this.glue.intents.filterHandlers(handlerFilter);
|
|
@@ -6378,10 +6395,10 @@
|
|
|
6378
6395
|
return myWin.getContext();
|
|
6379
6396
|
}
|
|
6380
6397
|
async addIntentListener(intent, handler) {
|
|
6381
|
-
if (typeof this.glue.intents.register
|
|
6382
|
-
return
|
|
6398
|
+
if (typeof this.glue.intents.register !== "function") {
|
|
6399
|
+
return this.glue.intents.addIntentListener(intent, handler);
|
|
6383
6400
|
}
|
|
6384
|
-
return this.glue.intents.
|
|
6401
|
+
return this.glue.intents.register(intent, handler);
|
|
6385
6402
|
}
|
|
6386
6403
|
getAllContexts() {
|
|
6387
6404
|
return this.glue.contexts.all();
|
|
@@ -6406,7 +6423,7 @@
|
|
|
6406
6423
|
async getMyChannels() {
|
|
6407
6424
|
if (!this.glue.channels.getMyChannels) {
|
|
6408
6425
|
const myChannel = await this.glue.channels.getMy();
|
|
6409
|
-
return [myChannel];
|
|
6426
|
+
return myChannel ? [myChannel] : [];
|
|
6410
6427
|
}
|
|
6411
6428
|
return this.glue.channels.getMyChannels();
|
|
6412
6429
|
}
|
|
@@ -6455,12 +6472,16 @@
|
|
|
6455
6472
|
return this.glue.channels.get(channelId);
|
|
6456
6473
|
}
|
|
6457
6474
|
getMyWindow() {
|
|
6458
|
-
const
|
|
6459
|
-
const isValidWindow = isValidNonEmptyObject(
|
|
6475
|
+
const myWindow = this.glue.windows.my();
|
|
6476
|
+
const isValidWindow = isValidNonEmptyObject(myWindow);
|
|
6460
6477
|
if (isValidWindow) {
|
|
6461
|
-
return
|
|
6478
|
+
return myWindow;
|
|
6479
|
+
}
|
|
6480
|
+
const myInstance = this.getMyInteropInstance();
|
|
6481
|
+
if (!myInstance?.instance) {
|
|
6482
|
+
return;
|
|
6462
6483
|
}
|
|
6463
|
-
return this.glue.windows.findById(
|
|
6484
|
+
return this.glue.windows.findById(myInstance.instance);
|
|
6464
6485
|
}
|
|
6465
6486
|
getMyInteropInstance() {
|
|
6466
6487
|
return this.glue.interop.instance;
|
|
@@ -6554,8 +6575,8 @@
|
|
|
6554
6575
|
async checkIsFdc3DataWrappingSupported() {
|
|
6555
6576
|
const inBrowserNamespace = this.isRunningInBrowser();
|
|
6556
6577
|
const methodName = inBrowserNamespace ? BrowserClientControlMethodName : DesktopClientControlMethodName;
|
|
6557
|
-
const myServer = this.
|
|
6558
|
-
if (!myServer) {
|
|
6578
|
+
const myServer = this.getInteropServers().find((server) => server.instance === this.glue.interop.instance.instance && server.isLocal);
|
|
6579
|
+
if (!myServer || typeof myServer.getMethods !== "function") {
|
|
6559
6580
|
return false;
|
|
6560
6581
|
}
|
|
6561
6582
|
const registersControlMethod = myServer.getMethods().some((method) => method.name === methodName);
|
|
@@ -6582,13 +6603,13 @@
|
|
|
6582
6603
|
return this.glue.interop.instance.peerId === updaterId;
|
|
6583
6604
|
}
|
|
6584
6605
|
getContextMetadata(updaterId) {
|
|
6585
|
-
const instanceServer = this.
|
|
6606
|
+
const instanceServer = this.getInteropServers().find((server) => server.peerId === updaterId);
|
|
6586
6607
|
if (!instanceServer) {
|
|
6587
6608
|
return;
|
|
6588
6609
|
}
|
|
6589
6610
|
return {
|
|
6590
6611
|
source: {
|
|
6591
|
-
appId: instanceServer.application ?? instanceServer.applicationName,
|
|
6612
|
+
appId: (instanceServer.application ?? instanceServer.applicationName),
|
|
6592
6613
|
instanceId: instanceServer.instance
|
|
6593
6614
|
}
|
|
6594
6615
|
};
|
|
@@ -8429,9 +8450,9 @@
|
|
|
8429
8450
|
async getCurrentChannels() {
|
|
8430
8451
|
return this.channelsController.getCurrentChannels(generateCommandId());
|
|
8431
8452
|
}
|
|
8432
|
-
async leaveChannel(
|
|
8433
|
-
nonEmptyStringDecoder.runWithException(
|
|
8434
|
-
return this.channelsController.leave(generateCommandId(), {
|
|
8453
|
+
async leaveChannel(channel) {
|
|
8454
|
+
nonEmptyStringDecoder.runWithException(channel);
|
|
8455
|
+
return this.channelsController.leave(generateCommandId(), { channel });
|
|
8435
8456
|
}
|
|
8436
8457
|
async leaveCurrentChannels() {
|
|
8437
8458
|
return this.channelsController.leave(generateCommandId());
|
|
@@ -8659,7 +8680,7 @@
|
|
|
8659
8680
|
if (!context && !resultType) {
|
|
8660
8681
|
return this.convertGlue42IntentToFDC3Intent(searchedGlueIntent);
|
|
8661
8682
|
}
|
|
8662
|
-
const contextType =
|
|
8683
|
+
const contextType = context?.type === fdc3NothingContextType ? undefined : context?.type;
|
|
8663
8684
|
const filteredIntent = this.getGlueIntentWithFilteredHandlers(searchedGlueIntent, { contextType, resultType });
|
|
8664
8685
|
if (!filteredIntent.handlers.length) {
|
|
8665
8686
|
throw new Error(ResolveError.NoAppsFound);
|
|
@@ -8782,7 +8803,7 @@
|
|
|
8782
8803
|
this._logger?.warn(`Cannot get prefs due to the following error: ${error}`);
|
|
8783
8804
|
return;
|
|
8784
8805
|
}
|
|
8785
|
-
const intentPrefs = prefs
|
|
8806
|
+
const intentPrefs = prefs?.data?.intents;
|
|
8786
8807
|
if (!intentPrefs) {
|
|
8787
8808
|
return;
|
|
8788
8809
|
}
|
|
@@ -8811,7 +8832,7 @@
|
|
|
8811
8832
|
const appName = typeof target === "string" ? target : target.appId;
|
|
8812
8833
|
const instanceId = typeof target === "string" ? undefined : target.instanceId;
|
|
8813
8834
|
this.logger?.info(`[${commandId}] - Checking if application with name ${appName} exists`);
|
|
8814
|
-
const app = await this.glueController.getApplication(appName);
|
|
8835
|
+
const app = await this.glueController.getApplication({ name: appName, includeDefinition: true, includeInstances: true });
|
|
8815
8836
|
const serverInstances = this.serverInstanceAsIntentHandler(intent.name);
|
|
8816
8837
|
if (!app && (typeof target === "string" || !target.instanceId || !serverInstances.length)) {
|
|
8817
8838
|
throw new Error(ResolveError.TargetAppUnavailable);
|
|
@@ -8825,8 +8846,9 @@
|
|
|
8825
8846
|
this.logger?.log(`[${commandId}] - returning all handlers for intent ${intent.name} and target: ${JSON.stringify(target)}`);
|
|
8826
8847
|
return { name: intent.name, handlers: validHandlersByApplicationName };
|
|
8827
8848
|
}
|
|
8849
|
+
const appInstances = app?.instances ?? await (this.glueController.getApplicationInstances(appName));
|
|
8828
8850
|
const isValidInstanceOfTheApp = app
|
|
8829
|
-
?
|
|
8851
|
+
? appInstances.find((inst) => inst.id === instanceId)
|
|
8830
8852
|
: serverInstances.find((inst) => inst.instance === instanceId);
|
|
8831
8853
|
if (!isValidInstanceOfTheApp) {
|
|
8832
8854
|
throw new Error(ResolveError.TargetInstanceUnavailable);
|
|
@@ -8893,17 +8915,23 @@
|
|
|
8893
8915
|
}
|
|
8894
8916
|
async convertGlue42IntentToFDC3Intent(glueIntent) {
|
|
8895
8917
|
const { name, handlers } = glueIntent;
|
|
8918
|
+
const displayName = handlers.find((handler) => handler.displayName)?.displayName ?? name;
|
|
8896
8919
|
const apps = await Promise.all(handlers.map(async (handler) => {
|
|
8897
8920
|
const appName = handler.applicationName;
|
|
8898
|
-
const app = await this.glueController.getApplication(appName);
|
|
8899
|
-
const icons =
|
|
8900
|
-
|
|
8921
|
+
const app = await this.glueController.getApplication({ name: appName, includeDefinition: true });
|
|
8922
|
+
const icons = [app?.icon, ...(app?.userProperties?.icons ?? []), ...(app?.customProperties?.icons ?? [])]
|
|
8923
|
+
.filter((icon) => !!icon)
|
|
8924
|
+
.map((icon) => ({ src: icon }));
|
|
8925
|
+
const images = [...(app?.userProperties?.images ?? []), ...(app?.customProperties?.images ?? [])]
|
|
8926
|
+
.filter((image) => !!image)
|
|
8927
|
+
.map((image) => ({ src: image }));
|
|
8928
|
+
const tooltip = app?.title || app?.userProperties?.tooltip || `${appName} (${handler.type})`;
|
|
8901
8929
|
return {
|
|
8902
8930
|
appId: appName,
|
|
8903
8931
|
instanceId: handler.instanceId,
|
|
8904
8932
|
name: appName,
|
|
8905
8933
|
title: handler.applicationTitle || handler.instanceTitle || appName,
|
|
8906
|
-
tooltip
|
|
8934
|
+
tooltip,
|
|
8907
8935
|
description: handler.applicationDescription,
|
|
8908
8936
|
icons,
|
|
8909
8937
|
images,
|
|
@@ -8911,7 +8939,7 @@
|
|
|
8911
8939
|
};
|
|
8912
8940
|
}));
|
|
8913
8941
|
const appIntent = {
|
|
8914
|
-
intent: { name, displayName
|
|
8942
|
+
intent: { name, displayName },
|
|
8915
8943
|
apps
|
|
8916
8944
|
};
|
|
8917
8945
|
return appIntent;
|
|
@@ -9025,7 +9053,7 @@
|
|
|
9025
9053
|
await this.glueController.gluePromise;
|
|
9026
9054
|
this.logger?.log(`[${commandId}] - open() invoked with target ${JSON.stringify(target)} ${context ? `and contextType ${context.type}` : ""}`);
|
|
9027
9055
|
const name = typeof target === "object" ? target.appId : target;
|
|
9028
|
-
const app = await this.glueController.getApplication(name);
|
|
9056
|
+
const app = await this.glueController.getApplication({ name });
|
|
9029
9057
|
if (!app) {
|
|
9030
9058
|
throw new Error(OpenError.AppNotFound);
|
|
9031
9059
|
}
|
|
@@ -9048,12 +9076,12 @@
|
|
|
9048
9076
|
await this.glueController.gluePromise;
|
|
9049
9077
|
this.logger?.info(`[${commandId}] - findInstances() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
|
|
9050
9078
|
const { appId } = appIdentifier;
|
|
9051
|
-
const app = await this.glueController.getApplication(appId);
|
|
9079
|
+
const app = await this.glueController.getApplication({ name: appId, includeInstances: true, includeDefinition: true });
|
|
9052
9080
|
if (!app) {
|
|
9053
9081
|
throw new Error(ResolveError.NoAppsFound);
|
|
9054
9082
|
}
|
|
9055
|
-
const
|
|
9056
|
-
const fdc3Instances =
|
|
9083
|
+
const appInstances = app.instances ?? await this.glueController.getApplicationInstances(appId);
|
|
9084
|
+
const fdc3Instances = appInstances.map(glueInst => this.parseGlueInstToAppIdentifier(glueInst));
|
|
9057
9085
|
this.logger?.info(`[${commandId}] - ids of opened instances for appIdentifier ${JSON.stringify(appIdentifier)}: ${JSON.stringify(fdc3Instances.map(inst => inst.instanceId))}`);
|
|
9058
9086
|
return fdc3Instances;
|
|
9059
9087
|
}
|
|
@@ -9061,7 +9089,7 @@
|
|
|
9061
9089
|
await this.glueController.gluePromise;
|
|
9062
9090
|
this.logger?.info(`[${commandId}] - getAppMetadata() invoked with appIdentifier ${JSON.stringify(appIdentifier)}`);
|
|
9063
9091
|
const { appId, instanceId } = appIdentifier;
|
|
9064
|
-
const app = await this.glueController.getApplication(appId);
|
|
9092
|
+
const app = await this.glueController.getApplication({ name: appId, includeDefinition: true, includeInstances: true });
|
|
9065
9093
|
if (!app) {
|
|
9066
9094
|
throw new Error(OpenError.AppNotFound);
|
|
9067
9095
|
}
|
|
@@ -9095,7 +9123,7 @@
|
|
|
9095
9123
|
async getCurrentAppMetadata() {
|
|
9096
9124
|
const myInstance = this.glueController.interopInstance();
|
|
9097
9125
|
const myInstanceApplicationName = myInstance.application ?? myInstance.applicationName;
|
|
9098
|
-
const myApp = await this.glueController.getApplication(myInstanceApplicationName);
|
|
9126
|
+
const myApp = await this.glueController.getApplication({ name: myInstanceApplicationName, includeDefinition: true });
|
|
9099
9127
|
if (myApp) {
|
|
9100
9128
|
return { appId: myApp.name, instanceId: myInstance.instance };
|
|
9101
9129
|
}
|
|
@@ -9109,40 +9137,43 @@
|
|
|
9109
9137
|
};
|
|
9110
9138
|
}
|
|
9111
9139
|
async parseGlueAppToAppMetadata(app, instance) {
|
|
9112
|
-
const
|
|
9140
|
+
const inBrowserNamespace = this.glueController.isRunningInBrowser();
|
|
9141
|
+
const appMetadata = inBrowserNamespace
|
|
9142
|
+
? await this.getBaseGlueAppToAppMetadataInBrowser(app)
|
|
9143
|
+
: await this.getBaseGlueAppToAppMetadataInDesktop(app);
|
|
9113
9144
|
if (!instance) {
|
|
9114
9145
|
return appMetadata;
|
|
9115
9146
|
}
|
|
9116
|
-
|
|
9147
|
+
const instanceData = {
|
|
9148
|
+
instanceId: instance.id,
|
|
9149
|
+
instanceMetadata: this.isApplicationInstance(instance) ? instance.interopInstance : instance.agm
|
|
9150
|
+
};
|
|
9151
|
+
return { ...appMetadata, ...instanceData };
|
|
9117
9152
|
}
|
|
9118
|
-
async
|
|
9119
|
-
const
|
|
9120
|
-
const
|
|
9121
|
-
? app.userProperties
|
|
9122
|
-
: await app.getConfiguration();
|
|
9123
|
-
const icon = inBrowserNamespace
|
|
9124
|
-
? app.icon
|
|
9125
|
-
: (await app.getConfiguration()).icon;
|
|
9126
|
-
const desktopScreenshots = appConfiguration.customProperties?.screenshots ?? appConfiguration.userProperties?.screenshots;
|
|
9127
|
-
const screenshots = inBrowserNamespace
|
|
9128
|
-
? appConfiguration.screenshots
|
|
9129
|
-
: desktopScreenshots;
|
|
9153
|
+
async getBaseGlueAppToAppMetadataInDesktop(app) {
|
|
9154
|
+
const appConfiguration = await this.glueController.getIoCDAppConfiguration(app);
|
|
9155
|
+
const screenshots = appConfiguration.customProperties?.screenshots ?? appConfiguration.userProperties?.screenshots;
|
|
9130
9156
|
return {
|
|
9131
|
-
appId:
|
|
9132
|
-
name:
|
|
9133
|
-
version:
|
|
9157
|
+
appId: appConfiguration.name,
|
|
9158
|
+
name: appConfiguration.name,
|
|
9159
|
+
version: appConfiguration.version,
|
|
9134
9160
|
description: appConfiguration.description,
|
|
9135
|
-
title:
|
|
9136
|
-
icons: icon ? [{ src: icon }] : [],
|
|
9161
|
+
title: appConfiguration.title,
|
|
9162
|
+
icons: appConfiguration.icon ? [{ src: appConfiguration.icon }] : [],
|
|
9137
9163
|
tooltip: appConfiguration.tooltip,
|
|
9138
9164
|
screenshots
|
|
9139
9165
|
};
|
|
9140
9166
|
}
|
|
9141
|
-
|
|
9167
|
+
async getBaseGlueAppToAppMetadataInBrowser(app) {
|
|
9142
9168
|
return {
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9169
|
+
appId: app.name,
|
|
9170
|
+
name: app.name,
|
|
9171
|
+
version: app.version,
|
|
9172
|
+
description: app.userProperties.description,
|
|
9173
|
+
title: app.title,
|
|
9174
|
+
icons: app.icon ? [{ src: app.icon }] : [],
|
|
9175
|
+
tooltip: app.userProperties.tooltip,
|
|
9176
|
+
screenshots: app.userProperties.screenshots
|
|
9146
9177
|
};
|
|
9147
9178
|
}
|
|
9148
9179
|
isApplicationInstance(instance) {
|
|
@@ -9151,7 +9182,7 @@
|
|
|
9151
9182
|
async openAppWithContext(app, context) {
|
|
9152
9183
|
const guid = nanoid();
|
|
9153
9184
|
const startContext = this.buildStartContext(context, guid);
|
|
9154
|
-
const wrappedPromise = this.createContextListenerWrappedPromise(app);
|
|
9185
|
+
const wrappedPromise = this.createContextListenerWrappedPromise(app.name);
|
|
9155
9186
|
this.appsStateStore.addOpenAppPromise(guid, wrappedPromise);
|
|
9156
9187
|
try {
|
|
9157
9188
|
const glueInst = await this.glueController.startApplication({
|
|
@@ -9185,15 +9216,16 @@
|
|
|
9185
9216
|
}
|
|
9186
9217
|
};
|
|
9187
9218
|
}
|
|
9188
|
-
createContextListenerWrappedPromise(
|
|
9219
|
+
createContextListenerWrappedPromise(appName) {
|
|
9189
9220
|
let resolve = () => { };
|
|
9190
9221
|
let reject = () => { };
|
|
9222
|
+
const timeoutMessage = `Timeout of ${this.defaultContextListenerInvokedPromiseTimeout}ms hit waiting for application with appId: ${appName} to register context listener`;
|
|
9191
9223
|
const promise = promisePlus(() => {
|
|
9192
9224
|
return new Promise((res, rej) => {
|
|
9193
9225
|
resolve = res;
|
|
9194
9226
|
reject = rej;
|
|
9195
9227
|
});
|
|
9196
|
-
}, this.defaultContextListenerInvokedPromiseTimeout,
|
|
9228
|
+
}, this.defaultContextListenerInvokedPromiseTimeout, timeoutMessage);
|
|
9197
9229
|
return { promise, resolve, reject };
|
|
9198
9230
|
}
|
|
9199
9231
|
}
|
|
@@ -10051,12 +10083,12 @@
|
|
|
10051
10083
|
async leave(commandId, options) {
|
|
10052
10084
|
await this.initDonePromise;
|
|
10053
10085
|
this.logger?.info(`[${commandId}] - leave() invoked with options: ${JSON.stringify(options)}`);
|
|
10054
|
-
if (!options?.
|
|
10086
|
+
if (!options?.channel) {
|
|
10055
10087
|
this.logger?.info(`[${commandId}] - leaving all channels`);
|
|
10056
10088
|
return this.glueController.leaveChannel();
|
|
10057
10089
|
}
|
|
10058
10090
|
const allIoChannels = await this.glueController.listAllChannels();
|
|
10059
|
-
const ioChannelToLeave = allIoChannels.find((ch) => ch.meta.fdc3?.id === options.
|
|
10091
|
+
const ioChannelToLeave = allIoChannels.find((ch) => ch.meta.fdc3?.id === options.channel);
|
|
10060
10092
|
if (!ioChannelToLeave) {
|
|
10061
10093
|
throw new Error(ChannelError.NoChannelFound);
|
|
10062
10094
|
}
|
|
@@ -10255,7 +10287,11 @@
|
|
|
10255
10287
|
return context.latest_fdc3_type ? this.parser.parseContextsDataToInitialFDC3Data(context) : null;
|
|
10256
10288
|
}
|
|
10257
10289
|
const parsedType = this.parser.mapFDC3TypeToChannelsDelimiter(contextType);
|
|
10258
|
-
const
|
|
10290
|
+
const ioChannel = await this.glueController.getChannel(ioChannelName);
|
|
10291
|
+
if (!ioChannel) {
|
|
10292
|
+
return null;
|
|
10293
|
+
}
|
|
10294
|
+
const { data } = ioChannel;
|
|
10259
10295
|
return data?.[`fdc3_${parsedType}`]
|
|
10260
10296
|
? this.parser.parseContextsDataToInitialFDC3Data({ data, latest_fdc3_type: parsedType })
|
|
10261
10297
|
: null;
|
|
@@ -10304,6 +10340,9 @@
|
|
|
10304
10340
|
throw new Error(ChannelError.AccessDenied);
|
|
10305
10341
|
}
|
|
10306
10342
|
const ioChannel = await this.glueController.getChannel(ioChannelName);
|
|
10343
|
+
if (!ioChannel) {
|
|
10344
|
+
return null;
|
|
10345
|
+
}
|
|
10307
10346
|
if (!contextType) {
|
|
10308
10347
|
return ioChannel.data.fdc3 || null;
|
|
10309
10348
|
}
|
|
@@ -10530,9 +10569,10 @@
|
|
|
10530
10569
|
return ioc.fdc3;
|
|
10531
10570
|
};
|
|
10532
10571
|
|
|
10533
|
-
var version = "2.
|
|
10572
|
+
var version = "2.8.0";
|
|
10534
10573
|
|
|
10535
|
-
const
|
|
10574
|
+
const inNodeEnv = typeof process !== "undefined" && typeof window === "undefined" && typeof document === "undefined";
|
|
10575
|
+
const globalScope = inNodeEnv ? process : window;
|
|
10536
10576
|
globalScope.fdc3Info = {
|
|
10537
10577
|
provider: "io.Connect",
|
|
10538
10578
|
providerVersion: version,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interopio/fdc3",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "IO Connect implementation of the FDC3 standard",
|
|
5
5
|
"main": "dist/fdc3.umd.js",
|
|
6
6
|
"module": "dist/fdc3.es.js",
|
|
@@ -31,7 +31,9 @@
|
|
|
31
31
|
},
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@interopio/
|
|
34
|
+
"@interopio/browser": "^4.2.0",
|
|
35
|
+
"@interopio/desktop": "^6.14.0",
|
|
36
|
+
"@interopio/utils": "^2.2.0"
|
|
35
37
|
},
|
|
36
38
|
"dependencies": {
|
|
37
39
|
"@finos/fdc3": "^2.2.0"
|
|
@@ -40,5 +42,5 @@
|
|
|
40
42
|
"@interopio:registry": "https://registry.npmjs.org",
|
|
41
43
|
"access": "public"
|
|
42
44
|
},
|
|
43
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "1805933707f7317dc5e0ccb540c2eabd9225ccef"
|
|
44
46
|
}
|