@interopio/fdc3 2.4.1 → 2.4.3
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 +7 -0
- package/dist/fdc3.electron.es.js +29 -21
- package/dist/fdc3.electron.umd.js +29 -21
- package/dist/fdc3.es.js +29 -21
- package/dist/fdc3.umd.js +29 -21
- package/package.json +3 -3
package/changelog.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
2.4.3
|
|
2
|
+
fix: leaving channel from io api was not reflected in the fdc3 api
|
|
3
|
+
chore: unfroze the fdc3 api
|
|
4
|
+
2.4.2
|
|
5
|
+
fix: fdc3.raiseIntent with target { appId } starts a new instance
|
|
6
|
+
fix: context passed to io.intents.raise
|
|
7
|
+
chore: Add fdc3Info to window object
|
|
1
8
|
2.4.1
|
|
2
9
|
fix: fixed initialization delay when running in a io.cd clients outside of io.cd
|
|
3
10
|
chore: improvement to getOrCreateChannel to be more compliant with the standard
|
package/dist/fdc3.electron.es.js
CHANGED
|
@@ -894,7 +894,7 @@ const v2InteropDecoder = object$1({
|
|
|
894
894
|
appChannels: optional$1(array$1(v2AppChannelDecoder))
|
|
895
895
|
});
|
|
896
896
|
const glue42ApplicationDetailsDecoder = object$1({
|
|
897
|
-
url: nonEmptyStringDecoder$1,
|
|
897
|
+
url: optional$1(nonEmptyStringDecoder$1),
|
|
898
898
|
top: optional$1(number$1()),
|
|
899
899
|
left: optional$1(number$1()),
|
|
900
900
|
width: optional$1(nonNegativeNumberDecoder),
|
|
@@ -912,10 +912,6 @@ const glue42HostManifestsBrowserDecoder = object$1({
|
|
|
912
912
|
intents: optional$1(array$1(intentDefinitionDecoder)),
|
|
913
913
|
hidden: optional$1(boolean())
|
|
914
914
|
});
|
|
915
|
-
const hostManifestsBrowserDecoder = oneOf$1(object$1({
|
|
916
|
-
"ioConnect": optional$1(oneOf$1(glue42HostManifestsBrowserDecoder, anyJson$1())),
|
|
917
|
-
"Glue42": optional$1(oneOf$1(glue42HostManifestsBrowserDecoder, anyJson$1()))
|
|
918
|
-
}), anyJson$1());
|
|
919
915
|
const v1DefinitionDecoder = object$1({
|
|
920
916
|
name: nonEmptyStringDecoder$1,
|
|
921
917
|
appId: nonEmptyStringDecoder$1,
|
|
@@ -950,7 +946,7 @@ const v2LocalizedDefinitionDecoder = object$1({
|
|
|
950
946
|
moreInfo: optional$1(nonEmptyStringDecoder$1),
|
|
951
947
|
publisher: optional$1(nonEmptyStringDecoder$1),
|
|
952
948
|
customConfig: optional$1(array$1(anyJson$1())),
|
|
953
|
-
hostManifests: optional$1(
|
|
949
|
+
hostManifests: optional$1(anyJson$1()),
|
|
954
950
|
interop: optional$1(v2InteropDecoder)
|
|
955
951
|
});
|
|
956
952
|
const v2DefinitionDecoder = object$1({
|
|
@@ -971,7 +967,7 @@ const v2DefinitionDecoder = object$1({
|
|
|
971
967
|
moreInfo: optional$1(nonEmptyStringDecoder$1),
|
|
972
968
|
publisher: optional$1(nonEmptyStringDecoder$1),
|
|
973
969
|
customConfig: optional$1(array$1(anyJson$1())),
|
|
974
|
-
hostManifests: optional$1(
|
|
970
|
+
hostManifests: optional$1(anyJson$1()),
|
|
975
971
|
interop: optional$1(v2InteropDecoder),
|
|
976
972
|
localizedVersions: optional$1(dict(v2LocalizedDefinitionDecoder))
|
|
977
973
|
});
|
|
@@ -2683,7 +2679,7 @@ class DesktopAgent {
|
|
|
2683
2679
|
raiseIntent: this.raiseIntent.bind(this),
|
|
2684
2680
|
raiseIntentForContext: this.raiseIntentForContext.bind(this),
|
|
2685
2681
|
};
|
|
2686
|
-
return
|
|
2682
|
+
return api;
|
|
2687
2683
|
}
|
|
2688
2684
|
async open(target, context) {
|
|
2689
2685
|
targetAppDecoder.runWithException(target);
|
|
@@ -3020,24 +3016,24 @@ class IntentsController {
|
|
|
3020
3016
|
if (!searchedGlueIntent) {
|
|
3021
3017
|
throw { message: ResolveError.NoAppsFound, reason: `There's no app registering an intent '${intent}'` };
|
|
3022
3018
|
}
|
|
3023
|
-
const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
|
|
3024
3019
|
if (!target) {
|
|
3020
|
+
const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
|
|
3025
3021
|
this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} and handlers ${filteredGlueIntent.handlers.map(h => h.applicationName && h.instanceId)}`);
|
|
3026
3022
|
return this.invokeRaiseIntent(commandId, { intent, context: glueContext, handlers: filteredGlueIntent.handlers });
|
|
3027
3023
|
}
|
|
3028
|
-
if (
|
|
3029
|
-
this.logger?.info(`[${commandId}] -
|
|
3024
|
+
if (target?.instanceId) {
|
|
3025
|
+
this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} to target instance of app ${target.appId} and id ${target.instanceId}`);
|
|
3030
3026
|
return this.invokeRaiseIntent(commandId, {
|
|
3031
3027
|
intent,
|
|
3032
3028
|
context: glueContext,
|
|
3033
|
-
target: {
|
|
3029
|
+
target: { instance: target.instanceId }
|
|
3034
3030
|
});
|
|
3035
3031
|
}
|
|
3036
|
-
|
|
3032
|
+
const targetAppName = typeof target === "string" ? target : target.appId;
|
|
3037
3033
|
return this.invokeRaiseIntent(commandId, {
|
|
3038
3034
|
intent,
|
|
3039
3035
|
context: glueContext,
|
|
3040
|
-
target: {
|
|
3036
|
+
target: { app: targetAppName }
|
|
3041
3037
|
});
|
|
3042
3038
|
}
|
|
3043
3039
|
async raiseIntentForContext({ commandId, context, target }) {
|
|
@@ -3046,8 +3042,9 @@ class IntentsController {
|
|
|
3046
3042
|
const filteredHandlersMethodExist = this.glueController.doesFilterHandlersExist();
|
|
3047
3043
|
const getIntentsMethodExist = this.glueController.doesGetIntentsExist();
|
|
3048
3044
|
const rememberedIntentHandlerForContextType = await this.checkForRememberedIntentHandlerForContext(context.type);
|
|
3045
|
+
const glueContext = { type: context.type, data: { ...context } };
|
|
3049
3046
|
if (rememberedIntentHandlerForContextType) {
|
|
3050
|
-
return this.invokeRaiseIntent(commandId, { context, intent: rememberedIntentHandlerForContextType.intent });
|
|
3047
|
+
return this.invokeRaiseIntent(commandId, { context: glueContext, intent: rememberedIntentHandlerForContextType.intent });
|
|
3051
3048
|
}
|
|
3052
3049
|
if (!filteredHandlersMethodExist || !getIntentsMethodExist || target) {
|
|
3053
3050
|
return this.legacyRaiseIntentForContext({ commandId, context, target });
|
|
@@ -3072,7 +3069,11 @@ class IntentsController {
|
|
|
3072
3069
|
this.logger?.warn(`[${commandId}] - ${ResolveError.IntentDeliveryFailed} - There's no valid intent for handler ${JSON.stringify(handler)} and context type ${context.type}`);
|
|
3073
3070
|
throw new Error(ResolveError.IntentDeliveryFailed);
|
|
3074
3071
|
}
|
|
3075
|
-
return this.invokeRaiseIntent(commandId, {
|
|
3072
|
+
return this.invokeRaiseIntent(commandId, {
|
|
3073
|
+
intent: validIntent.intent,
|
|
3074
|
+
context: glueContext,
|
|
3075
|
+
target: { app: handler.applicationName, instance: handler.instanceId }
|
|
3076
|
+
});
|
|
3076
3077
|
}
|
|
3077
3078
|
async addIntentListener({ commandId, intent, handler }) {
|
|
3078
3079
|
await this.glueController.gluePromise;
|
|
@@ -3303,8 +3304,6 @@ class IntentsController {
|
|
|
3303
3304
|
}
|
|
3304
3305
|
}
|
|
3305
3306
|
|
|
3306
|
-
var version = "2.4.1";
|
|
3307
|
-
|
|
3308
3307
|
class ApplicationsController {
|
|
3309
3308
|
glueController;
|
|
3310
3309
|
appsStateStore;
|
|
@@ -3379,10 +3378,11 @@ class ApplicationsController {
|
|
|
3379
3378
|
await this.glueController.gluePromise;
|
|
3380
3379
|
this.logger?.info(`${commandId} - getInfo() invoked`);
|
|
3381
3380
|
const appMetadata = await this.getCurrentAppMetadata();
|
|
3381
|
+
const { provider, providerVersion, standardVersion } = window.fdc3Info;
|
|
3382
3382
|
return {
|
|
3383
|
-
provider
|
|
3384
|
-
providerVersion
|
|
3385
|
-
fdc3Version:
|
|
3383
|
+
provider,
|
|
3384
|
+
providerVersion,
|
|
3385
|
+
fdc3Version: standardVersion,
|
|
3386
3386
|
optionalFeatures: {
|
|
3387
3387
|
OriginatingAppMetadata: true,
|
|
3388
3388
|
UserChannelMembershipAPIs: true,
|
|
@@ -4336,6 +4336,7 @@ class ChannelsBaseController {
|
|
|
4336
4336
|
}
|
|
4337
4337
|
async handleOnChannelChanged(channelId) {
|
|
4338
4338
|
if (!channelId) {
|
|
4339
|
+
this.stateStore.currentChannel = null;
|
|
4339
4340
|
return;
|
|
4340
4341
|
}
|
|
4341
4342
|
const isFdc3ChannelName = fdc3ChannelNames.includes(channelId);
|
|
@@ -4690,7 +4691,14 @@ const fdc3Factory = () => {
|
|
|
4690
4691
|
return ioc.fdc3;
|
|
4691
4692
|
};
|
|
4692
4693
|
|
|
4694
|
+
var version = "2.4.3";
|
|
4695
|
+
|
|
4693
4696
|
let globalFdc3 = window.fdc3;
|
|
4697
|
+
window.fdc3Info = {
|
|
4698
|
+
provider: "io.Connect",
|
|
4699
|
+
providerVersion: version,
|
|
4700
|
+
standardVersion: "2.1"
|
|
4701
|
+
};
|
|
4694
4702
|
if (typeof globalFdc3 === "undefined") {
|
|
4695
4703
|
globalFdc3 = fdc3Factory();
|
|
4696
4704
|
checkIfInElectron(globalFdc3);
|
|
@@ -900,7 +900,7 @@
|
|
|
900
900
|
appChannels: optional$1(array$1(v2AppChannelDecoder))
|
|
901
901
|
});
|
|
902
902
|
const glue42ApplicationDetailsDecoder = object$1({
|
|
903
|
-
url: nonEmptyStringDecoder$1,
|
|
903
|
+
url: optional$1(nonEmptyStringDecoder$1),
|
|
904
904
|
top: optional$1(number$1()),
|
|
905
905
|
left: optional$1(number$1()),
|
|
906
906
|
width: optional$1(nonNegativeNumberDecoder),
|
|
@@ -918,10 +918,6 @@
|
|
|
918
918
|
intents: optional$1(array$1(intentDefinitionDecoder)),
|
|
919
919
|
hidden: optional$1(boolean())
|
|
920
920
|
});
|
|
921
|
-
const hostManifestsBrowserDecoder = oneOf$1(object$1({
|
|
922
|
-
"ioConnect": optional$1(oneOf$1(glue42HostManifestsBrowserDecoder, anyJson$1())),
|
|
923
|
-
"Glue42": optional$1(oneOf$1(glue42HostManifestsBrowserDecoder, anyJson$1()))
|
|
924
|
-
}), anyJson$1());
|
|
925
921
|
const v1DefinitionDecoder = object$1({
|
|
926
922
|
name: nonEmptyStringDecoder$1,
|
|
927
923
|
appId: nonEmptyStringDecoder$1,
|
|
@@ -956,7 +952,7 @@
|
|
|
956
952
|
moreInfo: optional$1(nonEmptyStringDecoder$1),
|
|
957
953
|
publisher: optional$1(nonEmptyStringDecoder$1),
|
|
958
954
|
customConfig: optional$1(array$1(anyJson$1())),
|
|
959
|
-
hostManifests: optional$1(
|
|
955
|
+
hostManifests: optional$1(anyJson$1()),
|
|
960
956
|
interop: optional$1(v2InteropDecoder)
|
|
961
957
|
});
|
|
962
958
|
const v2DefinitionDecoder = object$1({
|
|
@@ -977,7 +973,7 @@
|
|
|
977
973
|
moreInfo: optional$1(nonEmptyStringDecoder$1),
|
|
978
974
|
publisher: optional$1(nonEmptyStringDecoder$1),
|
|
979
975
|
customConfig: optional$1(array$1(anyJson$1())),
|
|
980
|
-
hostManifests: optional$1(
|
|
976
|
+
hostManifests: optional$1(anyJson$1()),
|
|
981
977
|
interop: optional$1(v2InteropDecoder),
|
|
982
978
|
localizedVersions: optional$1(dict(v2LocalizedDefinitionDecoder))
|
|
983
979
|
});
|
|
@@ -2689,7 +2685,7 @@
|
|
|
2689
2685
|
raiseIntent: this.raiseIntent.bind(this),
|
|
2690
2686
|
raiseIntentForContext: this.raiseIntentForContext.bind(this),
|
|
2691
2687
|
};
|
|
2692
|
-
return
|
|
2688
|
+
return api;
|
|
2693
2689
|
}
|
|
2694
2690
|
async open(target, context) {
|
|
2695
2691
|
targetAppDecoder.runWithException(target);
|
|
@@ -3026,24 +3022,24 @@
|
|
|
3026
3022
|
if (!searchedGlueIntent) {
|
|
3027
3023
|
throw { message: ResolveError.NoAppsFound, reason: `There's no app registering an intent '${intent}'` };
|
|
3028
3024
|
}
|
|
3029
|
-
const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
|
|
3030
3025
|
if (!target) {
|
|
3026
|
+
const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
|
|
3031
3027
|
this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} and handlers ${filteredGlueIntent.handlers.map(h => h.applicationName && h.instanceId)}`);
|
|
3032
3028
|
return this.invokeRaiseIntent(commandId, { intent, context: glueContext, handlers: filteredGlueIntent.handlers });
|
|
3033
3029
|
}
|
|
3034
|
-
if (
|
|
3035
|
-
this.logger?.info(`[${commandId}] -
|
|
3030
|
+
if (target?.instanceId) {
|
|
3031
|
+
this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} to target instance of app ${target.appId} and id ${target.instanceId}`);
|
|
3036
3032
|
return this.invokeRaiseIntent(commandId, {
|
|
3037
3033
|
intent,
|
|
3038
3034
|
context: glueContext,
|
|
3039
|
-
target: {
|
|
3035
|
+
target: { instance: target.instanceId }
|
|
3040
3036
|
});
|
|
3041
3037
|
}
|
|
3042
|
-
|
|
3038
|
+
const targetAppName = typeof target === "string" ? target : target.appId;
|
|
3043
3039
|
return this.invokeRaiseIntent(commandId, {
|
|
3044
3040
|
intent,
|
|
3045
3041
|
context: glueContext,
|
|
3046
|
-
target: {
|
|
3042
|
+
target: { app: targetAppName }
|
|
3047
3043
|
});
|
|
3048
3044
|
}
|
|
3049
3045
|
async raiseIntentForContext({ commandId, context, target }) {
|
|
@@ -3052,8 +3048,9 @@
|
|
|
3052
3048
|
const filteredHandlersMethodExist = this.glueController.doesFilterHandlersExist();
|
|
3053
3049
|
const getIntentsMethodExist = this.glueController.doesGetIntentsExist();
|
|
3054
3050
|
const rememberedIntentHandlerForContextType = await this.checkForRememberedIntentHandlerForContext(context.type);
|
|
3051
|
+
const glueContext = { type: context.type, data: { ...context } };
|
|
3055
3052
|
if (rememberedIntentHandlerForContextType) {
|
|
3056
|
-
return this.invokeRaiseIntent(commandId, { context, intent: rememberedIntentHandlerForContextType.intent });
|
|
3053
|
+
return this.invokeRaiseIntent(commandId, { context: glueContext, intent: rememberedIntentHandlerForContextType.intent });
|
|
3057
3054
|
}
|
|
3058
3055
|
if (!filteredHandlersMethodExist || !getIntentsMethodExist || target) {
|
|
3059
3056
|
return this.legacyRaiseIntentForContext({ commandId, context, target });
|
|
@@ -3078,7 +3075,11 @@
|
|
|
3078
3075
|
this.logger?.warn(`[${commandId}] - ${ResolveError.IntentDeliveryFailed} - There's no valid intent for handler ${JSON.stringify(handler)} and context type ${context.type}`);
|
|
3079
3076
|
throw new Error(ResolveError.IntentDeliveryFailed);
|
|
3080
3077
|
}
|
|
3081
|
-
return this.invokeRaiseIntent(commandId, {
|
|
3078
|
+
return this.invokeRaiseIntent(commandId, {
|
|
3079
|
+
intent: validIntent.intent,
|
|
3080
|
+
context: glueContext,
|
|
3081
|
+
target: { app: handler.applicationName, instance: handler.instanceId }
|
|
3082
|
+
});
|
|
3082
3083
|
}
|
|
3083
3084
|
async addIntentListener({ commandId, intent, handler }) {
|
|
3084
3085
|
await this.glueController.gluePromise;
|
|
@@ -3309,8 +3310,6 @@
|
|
|
3309
3310
|
}
|
|
3310
3311
|
}
|
|
3311
3312
|
|
|
3312
|
-
var version = "2.4.1";
|
|
3313
|
-
|
|
3314
3313
|
class ApplicationsController {
|
|
3315
3314
|
glueController;
|
|
3316
3315
|
appsStateStore;
|
|
@@ -3385,10 +3384,11 @@
|
|
|
3385
3384
|
await this.glueController.gluePromise;
|
|
3386
3385
|
this.logger?.info(`${commandId} - getInfo() invoked`);
|
|
3387
3386
|
const appMetadata = await this.getCurrentAppMetadata();
|
|
3387
|
+
const { provider, providerVersion, standardVersion } = window.fdc3Info;
|
|
3388
3388
|
return {
|
|
3389
|
-
provider
|
|
3390
|
-
providerVersion
|
|
3391
|
-
fdc3Version:
|
|
3389
|
+
provider,
|
|
3390
|
+
providerVersion,
|
|
3391
|
+
fdc3Version: standardVersion,
|
|
3392
3392
|
optionalFeatures: {
|
|
3393
3393
|
OriginatingAppMetadata: true,
|
|
3394
3394
|
UserChannelMembershipAPIs: true,
|
|
@@ -4342,6 +4342,7 @@
|
|
|
4342
4342
|
}
|
|
4343
4343
|
async handleOnChannelChanged(channelId) {
|
|
4344
4344
|
if (!channelId) {
|
|
4345
|
+
this.stateStore.currentChannel = null;
|
|
4345
4346
|
return;
|
|
4346
4347
|
}
|
|
4347
4348
|
const isFdc3ChannelName = fdc3ChannelNames.includes(channelId);
|
|
@@ -4696,7 +4697,14 @@
|
|
|
4696
4697
|
return ioc.fdc3;
|
|
4697
4698
|
};
|
|
4698
4699
|
|
|
4700
|
+
var version = "2.4.3";
|
|
4701
|
+
|
|
4699
4702
|
let globalFdc3 = window.fdc3;
|
|
4703
|
+
window.fdc3Info = {
|
|
4704
|
+
provider: "io.Connect",
|
|
4705
|
+
providerVersion: version,
|
|
4706
|
+
standardVersion: "2.1"
|
|
4707
|
+
};
|
|
4700
4708
|
if (typeof globalFdc3 === "undefined") {
|
|
4701
4709
|
globalFdc3 = fdc3Factory();
|
|
4702
4710
|
checkIfInElectron(globalFdc3);
|
package/dist/fdc3.es.js
CHANGED
|
@@ -883,7 +883,7 @@ const v2InteropDecoder = object$1({
|
|
|
883
883
|
appChannels: optional$1(array$1(v2AppChannelDecoder))
|
|
884
884
|
});
|
|
885
885
|
const glue42ApplicationDetailsDecoder = object$1({
|
|
886
|
-
url: nonEmptyStringDecoder$1,
|
|
886
|
+
url: optional$1(nonEmptyStringDecoder$1),
|
|
887
887
|
top: optional$1(number$1()),
|
|
888
888
|
left: optional$1(number$1()),
|
|
889
889
|
width: optional$1(nonNegativeNumberDecoder),
|
|
@@ -901,10 +901,6 @@ const glue42HostManifestsBrowserDecoder = object$1({
|
|
|
901
901
|
intents: optional$1(array$1(intentDefinitionDecoder)),
|
|
902
902
|
hidden: optional$1(boolean())
|
|
903
903
|
});
|
|
904
|
-
const hostManifestsBrowserDecoder = oneOf$1(object$1({
|
|
905
|
-
"ioConnect": optional$1(oneOf$1(glue42HostManifestsBrowserDecoder, anyJson$1())),
|
|
906
|
-
"Glue42": optional$1(oneOf$1(glue42HostManifestsBrowserDecoder, anyJson$1()))
|
|
907
|
-
}), anyJson$1());
|
|
908
904
|
const v1DefinitionDecoder = object$1({
|
|
909
905
|
name: nonEmptyStringDecoder$1,
|
|
910
906
|
appId: nonEmptyStringDecoder$1,
|
|
@@ -939,7 +935,7 @@ const v2LocalizedDefinitionDecoder = object$1({
|
|
|
939
935
|
moreInfo: optional$1(nonEmptyStringDecoder$1),
|
|
940
936
|
publisher: optional$1(nonEmptyStringDecoder$1),
|
|
941
937
|
customConfig: optional$1(array$1(anyJson$1())),
|
|
942
|
-
hostManifests: optional$1(
|
|
938
|
+
hostManifests: optional$1(anyJson$1()),
|
|
943
939
|
interop: optional$1(v2InteropDecoder)
|
|
944
940
|
});
|
|
945
941
|
const v2DefinitionDecoder = object$1({
|
|
@@ -960,7 +956,7 @@ const v2DefinitionDecoder = object$1({
|
|
|
960
956
|
moreInfo: optional$1(nonEmptyStringDecoder$1),
|
|
961
957
|
publisher: optional$1(nonEmptyStringDecoder$1),
|
|
962
958
|
customConfig: optional$1(array$1(anyJson$1())),
|
|
963
|
-
hostManifests: optional$1(
|
|
959
|
+
hostManifests: optional$1(anyJson$1()),
|
|
964
960
|
interop: optional$1(v2InteropDecoder),
|
|
965
961
|
localizedVersions: optional$1(dict(v2LocalizedDefinitionDecoder))
|
|
966
962
|
});
|
|
@@ -2672,7 +2668,7 @@ class DesktopAgent {
|
|
|
2672
2668
|
raiseIntent: this.raiseIntent.bind(this),
|
|
2673
2669
|
raiseIntentForContext: this.raiseIntentForContext.bind(this),
|
|
2674
2670
|
};
|
|
2675
|
-
return
|
|
2671
|
+
return api;
|
|
2676
2672
|
}
|
|
2677
2673
|
async open(target, context) {
|
|
2678
2674
|
targetAppDecoder.runWithException(target);
|
|
@@ -3009,24 +3005,24 @@ class IntentsController {
|
|
|
3009
3005
|
if (!searchedGlueIntent) {
|
|
3010
3006
|
throw { message: ResolveError.NoAppsFound, reason: `There's no app registering an intent '${intent}'` };
|
|
3011
3007
|
}
|
|
3012
|
-
const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
|
|
3013
3008
|
if (!target) {
|
|
3009
|
+
const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
|
|
3014
3010
|
this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} and handlers ${filteredGlueIntent.handlers.map(h => h.applicationName && h.instanceId)}`);
|
|
3015
3011
|
return this.invokeRaiseIntent(commandId, { intent, context: glueContext, handlers: filteredGlueIntent.handlers });
|
|
3016
3012
|
}
|
|
3017
|
-
if (
|
|
3018
|
-
this.logger?.info(`[${commandId}] -
|
|
3013
|
+
if (target?.instanceId) {
|
|
3014
|
+
this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} to target instance of app ${target.appId} and id ${target.instanceId}`);
|
|
3019
3015
|
return this.invokeRaiseIntent(commandId, {
|
|
3020
3016
|
intent,
|
|
3021
3017
|
context: glueContext,
|
|
3022
|
-
target: {
|
|
3018
|
+
target: { instance: target.instanceId }
|
|
3023
3019
|
});
|
|
3024
3020
|
}
|
|
3025
|
-
|
|
3021
|
+
const targetAppName = typeof target === "string" ? target : target.appId;
|
|
3026
3022
|
return this.invokeRaiseIntent(commandId, {
|
|
3027
3023
|
intent,
|
|
3028
3024
|
context: glueContext,
|
|
3029
|
-
target: {
|
|
3025
|
+
target: { app: targetAppName }
|
|
3030
3026
|
});
|
|
3031
3027
|
}
|
|
3032
3028
|
async raiseIntentForContext({ commandId, context, target }) {
|
|
@@ -3035,8 +3031,9 @@ class IntentsController {
|
|
|
3035
3031
|
const filteredHandlersMethodExist = this.glueController.doesFilterHandlersExist();
|
|
3036
3032
|
const getIntentsMethodExist = this.glueController.doesGetIntentsExist();
|
|
3037
3033
|
const rememberedIntentHandlerForContextType = await this.checkForRememberedIntentHandlerForContext(context.type);
|
|
3034
|
+
const glueContext = { type: context.type, data: { ...context } };
|
|
3038
3035
|
if (rememberedIntentHandlerForContextType) {
|
|
3039
|
-
return this.invokeRaiseIntent(commandId, { context, intent: rememberedIntentHandlerForContextType.intent });
|
|
3036
|
+
return this.invokeRaiseIntent(commandId, { context: glueContext, intent: rememberedIntentHandlerForContextType.intent });
|
|
3040
3037
|
}
|
|
3041
3038
|
if (!filteredHandlersMethodExist || !getIntentsMethodExist || target) {
|
|
3042
3039
|
return this.legacyRaiseIntentForContext({ commandId, context, target });
|
|
@@ -3061,7 +3058,11 @@ class IntentsController {
|
|
|
3061
3058
|
this.logger?.warn(`[${commandId}] - ${ResolveError.IntentDeliveryFailed} - There's no valid intent for handler ${JSON.stringify(handler)} and context type ${context.type}`);
|
|
3062
3059
|
throw new Error(ResolveError.IntentDeliveryFailed);
|
|
3063
3060
|
}
|
|
3064
|
-
return this.invokeRaiseIntent(commandId, {
|
|
3061
|
+
return this.invokeRaiseIntent(commandId, {
|
|
3062
|
+
intent: validIntent.intent,
|
|
3063
|
+
context: glueContext,
|
|
3064
|
+
target: { app: handler.applicationName, instance: handler.instanceId }
|
|
3065
|
+
});
|
|
3065
3066
|
}
|
|
3066
3067
|
async addIntentListener({ commandId, intent, handler }) {
|
|
3067
3068
|
await this.glueController.gluePromise;
|
|
@@ -3292,8 +3293,6 @@ class IntentsController {
|
|
|
3292
3293
|
}
|
|
3293
3294
|
}
|
|
3294
3295
|
|
|
3295
|
-
var version = "2.4.1";
|
|
3296
|
-
|
|
3297
3296
|
class ApplicationsController {
|
|
3298
3297
|
glueController;
|
|
3299
3298
|
appsStateStore;
|
|
@@ -3368,10 +3367,11 @@ class ApplicationsController {
|
|
|
3368
3367
|
await this.glueController.gluePromise;
|
|
3369
3368
|
this.logger?.info(`${commandId} - getInfo() invoked`);
|
|
3370
3369
|
const appMetadata = await this.getCurrentAppMetadata();
|
|
3370
|
+
const { provider, providerVersion, standardVersion } = window.fdc3Info;
|
|
3371
3371
|
return {
|
|
3372
|
-
provider
|
|
3373
|
-
providerVersion
|
|
3374
|
-
fdc3Version:
|
|
3372
|
+
provider,
|
|
3373
|
+
providerVersion,
|
|
3374
|
+
fdc3Version: standardVersion,
|
|
3375
3375
|
optionalFeatures: {
|
|
3376
3376
|
OriginatingAppMetadata: true,
|
|
3377
3377
|
UserChannelMembershipAPIs: true,
|
|
@@ -4325,6 +4325,7 @@ class ChannelsBaseController {
|
|
|
4325
4325
|
}
|
|
4326
4326
|
async handleOnChannelChanged(channelId) {
|
|
4327
4327
|
if (!channelId) {
|
|
4328
|
+
this.stateStore.currentChannel = null;
|
|
4328
4329
|
return;
|
|
4329
4330
|
}
|
|
4330
4331
|
const isFdc3ChannelName = fdc3ChannelNames.includes(channelId);
|
|
@@ -4679,7 +4680,14 @@ const fdc3Factory = () => {
|
|
|
4679
4680
|
return ioc.fdc3;
|
|
4680
4681
|
};
|
|
4681
4682
|
|
|
4683
|
+
var version = "2.4.3";
|
|
4684
|
+
|
|
4682
4685
|
let globalFdc3 = window.fdc3;
|
|
4686
|
+
window.fdc3Info = {
|
|
4687
|
+
provider: "io.Connect",
|
|
4688
|
+
providerVersion: version,
|
|
4689
|
+
standardVersion: "2.1"
|
|
4690
|
+
};
|
|
4683
4691
|
if (typeof globalFdc3 === "undefined") {
|
|
4684
4692
|
globalFdc3 = fdc3Factory();
|
|
4685
4693
|
window.fdc3 = globalFdc3;
|
package/dist/fdc3.umd.js
CHANGED
|
@@ -889,7 +889,7 @@
|
|
|
889
889
|
appChannels: optional$1(array$1(v2AppChannelDecoder))
|
|
890
890
|
});
|
|
891
891
|
const glue42ApplicationDetailsDecoder = object$1({
|
|
892
|
-
url: nonEmptyStringDecoder$1,
|
|
892
|
+
url: optional$1(nonEmptyStringDecoder$1),
|
|
893
893
|
top: optional$1(number$1()),
|
|
894
894
|
left: optional$1(number$1()),
|
|
895
895
|
width: optional$1(nonNegativeNumberDecoder),
|
|
@@ -907,10 +907,6 @@
|
|
|
907
907
|
intents: optional$1(array$1(intentDefinitionDecoder)),
|
|
908
908
|
hidden: optional$1(boolean())
|
|
909
909
|
});
|
|
910
|
-
const hostManifestsBrowserDecoder = oneOf$1(object$1({
|
|
911
|
-
"ioConnect": optional$1(oneOf$1(glue42HostManifestsBrowserDecoder, anyJson$1())),
|
|
912
|
-
"Glue42": optional$1(oneOf$1(glue42HostManifestsBrowserDecoder, anyJson$1()))
|
|
913
|
-
}), anyJson$1());
|
|
914
910
|
const v1DefinitionDecoder = object$1({
|
|
915
911
|
name: nonEmptyStringDecoder$1,
|
|
916
912
|
appId: nonEmptyStringDecoder$1,
|
|
@@ -945,7 +941,7 @@
|
|
|
945
941
|
moreInfo: optional$1(nonEmptyStringDecoder$1),
|
|
946
942
|
publisher: optional$1(nonEmptyStringDecoder$1),
|
|
947
943
|
customConfig: optional$1(array$1(anyJson$1())),
|
|
948
|
-
hostManifests: optional$1(
|
|
944
|
+
hostManifests: optional$1(anyJson$1()),
|
|
949
945
|
interop: optional$1(v2InteropDecoder)
|
|
950
946
|
});
|
|
951
947
|
const v2DefinitionDecoder = object$1({
|
|
@@ -966,7 +962,7 @@
|
|
|
966
962
|
moreInfo: optional$1(nonEmptyStringDecoder$1),
|
|
967
963
|
publisher: optional$1(nonEmptyStringDecoder$1),
|
|
968
964
|
customConfig: optional$1(array$1(anyJson$1())),
|
|
969
|
-
hostManifests: optional$1(
|
|
965
|
+
hostManifests: optional$1(anyJson$1()),
|
|
970
966
|
interop: optional$1(v2InteropDecoder),
|
|
971
967
|
localizedVersions: optional$1(dict(v2LocalizedDefinitionDecoder))
|
|
972
968
|
});
|
|
@@ -2678,7 +2674,7 @@
|
|
|
2678
2674
|
raiseIntent: this.raiseIntent.bind(this),
|
|
2679
2675
|
raiseIntentForContext: this.raiseIntentForContext.bind(this),
|
|
2680
2676
|
};
|
|
2681
|
-
return
|
|
2677
|
+
return api;
|
|
2682
2678
|
}
|
|
2683
2679
|
async open(target, context) {
|
|
2684
2680
|
targetAppDecoder.runWithException(target);
|
|
@@ -3015,24 +3011,24 @@
|
|
|
3015
3011
|
if (!searchedGlueIntent) {
|
|
3016
3012
|
throw { message: ResolveError.NoAppsFound, reason: `There's no app registering an intent '${intent}'` };
|
|
3017
3013
|
}
|
|
3018
|
-
const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
|
|
3019
3014
|
if (!target) {
|
|
3015
|
+
const filteredGlueIntent = this.filterGlueIntentHandlers({ commandId, intent: searchedGlueIntent, context, target });
|
|
3020
3016
|
this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} and handlers ${filteredGlueIntent.handlers.map(h => h.applicationName && h.instanceId)}`);
|
|
3021
3017
|
return this.invokeRaiseIntent(commandId, { intent, context: glueContext, handlers: filteredGlueIntent.handlers });
|
|
3022
3018
|
}
|
|
3023
|
-
if (
|
|
3024
|
-
this.logger?.info(`[${commandId}] -
|
|
3019
|
+
if (target?.instanceId) {
|
|
3020
|
+
this.logger?.info(`[${commandId}] - raising intent ${intent} with contextType ${context.type} to target instance of app ${target.appId} and id ${target.instanceId}`);
|
|
3025
3021
|
return this.invokeRaiseIntent(commandId, {
|
|
3026
3022
|
intent,
|
|
3027
3023
|
context: glueContext,
|
|
3028
|
-
target: {
|
|
3024
|
+
target: { instance: target.instanceId }
|
|
3029
3025
|
});
|
|
3030
3026
|
}
|
|
3031
|
-
|
|
3027
|
+
const targetAppName = typeof target === "string" ? target : target.appId;
|
|
3032
3028
|
return this.invokeRaiseIntent(commandId, {
|
|
3033
3029
|
intent,
|
|
3034
3030
|
context: glueContext,
|
|
3035
|
-
target: {
|
|
3031
|
+
target: { app: targetAppName }
|
|
3036
3032
|
});
|
|
3037
3033
|
}
|
|
3038
3034
|
async raiseIntentForContext({ commandId, context, target }) {
|
|
@@ -3041,8 +3037,9 @@
|
|
|
3041
3037
|
const filteredHandlersMethodExist = this.glueController.doesFilterHandlersExist();
|
|
3042
3038
|
const getIntentsMethodExist = this.glueController.doesGetIntentsExist();
|
|
3043
3039
|
const rememberedIntentHandlerForContextType = await this.checkForRememberedIntentHandlerForContext(context.type);
|
|
3040
|
+
const glueContext = { type: context.type, data: { ...context } };
|
|
3044
3041
|
if (rememberedIntentHandlerForContextType) {
|
|
3045
|
-
return this.invokeRaiseIntent(commandId, { context, intent: rememberedIntentHandlerForContextType.intent });
|
|
3042
|
+
return this.invokeRaiseIntent(commandId, { context: glueContext, intent: rememberedIntentHandlerForContextType.intent });
|
|
3046
3043
|
}
|
|
3047
3044
|
if (!filteredHandlersMethodExist || !getIntentsMethodExist || target) {
|
|
3048
3045
|
return this.legacyRaiseIntentForContext({ commandId, context, target });
|
|
@@ -3067,7 +3064,11 @@
|
|
|
3067
3064
|
this.logger?.warn(`[${commandId}] - ${ResolveError.IntentDeliveryFailed} - There's no valid intent for handler ${JSON.stringify(handler)} and context type ${context.type}`);
|
|
3068
3065
|
throw new Error(ResolveError.IntentDeliveryFailed);
|
|
3069
3066
|
}
|
|
3070
|
-
return this.invokeRaiseIntent(commandId, {
|
|
3067
|
+
return this.invokeRaiseIntent(commandId, {
|
|
3068
|
+
intent: validIntent.intent,
|
|
3069
|
+
context: glueContext,
|
|
3070
|
+
target: { app: handler.applicationName, instance: handler.instanceId }
|
|
3071
|
+
});
|
|
3071
3072
|
}
|
|
3072
3073
|
async addIntentListener({ commandId, intent, handler }) {
|
|
3073
3074
|
await this.glueController.gluePromise;
|
|
@@ -3298,8 +3299,6 @@
|
|
|
3298
3299
|
}
|
|
3299
3300
|
}
|
|
3300
3301
|
|
|
3301
|
-
var version = "2.4.1";
|
|
3302
|
-
|
|
3303
3302
|
class ApplicationsController {
|
|
3304
3303
|
glueController;
|
|
3305
3304
|
appsStateStore;
|
|
@@ -3374,10 +3373,11 @@
|
|
|
3374
3373
|
await this.glueController.gluePromise;
|
|
3375
3374
|
this.logger?.info(`${commandId} - getInfo() invoked`);
|
|
3376
3375
|
const appMetadata = await this.getCurrentAppMetadata();
|
|
3376
|
+
const { provider, providerVersion, standardVersion } = window.fdc3Info;
|
|
3377
3377
|
return {
|
|
3378
|
-
provider
|
|
3379
|
-
providerVersion
|
|
3380
|
-
fdc3Version:
|
|
3378
|
+
provider,
|
|
3379
|
+
providerVersion,
|
|
3380
|
+
fdc3Version: standardVersion,
|
|
3381
3381
|
optionalFeatures: {
|
|
3382
3382
|
OriginatingAppMetadata: true,
|
|
3383
3383
|
UserChannelMembershipAPIs: true,
|
|
@@ -4331,6 +4331,7 @@
|
|
|
4331
4331
|
}
|
|
4332
4332
|
async handleOnChannelChanged(channelId) {
|
|
4333
4333
|
if (!channelId) {
|
|
4334
|
+
this.stateStore.currentChannel = null;
|
|
4334
4335
|
return;
|
|
4335
4336
|
}
|
|
4336
4337
|
const isFdc3ChannelName = fdc3ChannelNames.includes(channelId);
|
|
@@ -4685,7 +4686,14 @@
|
|
|
4685
4686
|
return ioc.fdc3;
|
|
4686
4687
|
};
|
|
4687
4688
|
|
|
4689
|
+
var version = "2.4.3";
|
|
4690
|
+
|
|
4688
4691
|
let globalFdc3 = window.fdc3;
|
|
4692
|
+
window.fdc3Info = {
|
|
4693
|
+
provider: "io.Connect",
|
|
4694
|
+
providerVersion: version,
|
|
4695
|
+
standardVersion: "2.1"
|
|
4696
|
+
};
|
|
4689
4697
|
if (typeof globalFdc3 === "undefined") {
|
|
4690
4698
|
globalFdc3 = fdc3Factory();
|
|
4691
4699
|
window.fdc3 = globalFdc3;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interopio/fdc3",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
4
4
|
"description": "IO Connect implementation of the FDC3 standard",
|
|
5
5
|
"main": "dist/fdc3.umd.js",
|
|
6
6
|
"module": "dist/fdc3.es.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@interopio/utils": "^1.4.
|
|
35
|
+
"@interopio/utils": "^1.4.1"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@finos/fdc3": "2.1.0"
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"@interopio:registry": "https://registry.npmjs.org",
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "9f1b8ec1615dd165712cdabc26f0cb7a25e7be4f"
|
|
45
45
|
}
|