@openfin/core 41.102.7 → 41.103.2
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/out/mock-alpha.d.ts +17 -1
- package/out/mock-beta.d.ts +17 -1
- package/out/mock-public.d.ts +17 -1
- package/out/stub.d.ts +17 -1
- package/out/stub.js +128 -69
- package/package.json +1 -1
package/out/mock-alpha.d.ts
CHANGED
|
@@ -4572,7 +4572,22 @@ declare type DomainSettings = {
|
|
|
4572
4572
|
};
|
|
4573
4573
|
|
|
4574
4574
|
/**
|
|
4575
|
-
*
|
|
4575
|
+
* Enables or disables specific preload scripts by URL.
|
|
4576
|
+
*
|
|
4577
|
+
* Uses the script's full URL as the key and an object
|
|
4578
|
+
* with an `enabled` boolean property as the value.
|
|
4579
|
+
* @example
|
|
4580
|
+
* ```js
|
|
4581
|
+
* {
|
|
4582
|
+
"match": ["<all_urls>"],
|
|
4583
|
+
"options": {
|
|
4584
|
+
"preloadScripts": {
|
|
4585
|
+
"http://localhost:53000/block-preload.js": { "enabled": false }
|
|
4586
|
+
"http://localhost:53000/allow-preload.js": { "enabled": true }
|
|
4587
|
+
}
|
|
4588
|
+
}
|
|
4589
|
+
}
|
|
4590
|
+
* ```
|
|
4576
4591
|
*/
|
|
4577
4592
|
declare type DomainSettingsPreloadScripts = Record<string, {
|
|
4578
4593
|
enabled: boolean;
|
|
@@ -6616,6 +6631,7 @@ declare class InteropBroker extends Base {
|
|
|
6616
6631
|
private sessionContextGroupMap;
|
|
6617
6632
|
private channel;
|
|
6618
6633
|
private logging;
|
|
6634
|
+
private privateChannelProviderMap;
|
|
6619
6635
|
/* Excluded from this release type: __constructor */
|
|
6620
6636
|
private getProvider;
|
|
6621
6637
|
static createClosedConstructor(...args: ConstructorParameters<typeof InteropBroker>): {
|
package/out/mock-beta.d.ts
CHANGED
|
@@ -4572,7 +4572,22 @@ declare type DomainSettings = {
|
|
|
4572
4572
|
};
|
|
4573
4573
|
|
|
4574
4574
|
/**
|
|
4575
|
-
*
|
|
4575
|
+
* Enables or disables specific preload scripts by URL.
|
|
4576
|
+
*
|
|
4577
|
+
* Uses the script's full URL as the key and an object
|
|
4578
|
+
* with an `enabled` boolean property as the value.
|
|
4579
|
+
* @example
|
|
4580
|
+
* ```js
|
|
4581
|
+
* {
|
|
4582
|
+
"match": ["<all_urls>"],
|
|
4583
|
+
"options": {
|
|
4584
|
+
"preloadScripts": {
|
|
4585
|
+
"http://localhost:53000/block-preload.js": { "enabled": false }
|
|
4586
|
+
"http://localhost:53000/allow-preload.js": { "enabled": true }
|
|
4587
|
+
}
|
|
4588
|
+
}
|
|
4589
|
+
}
|
|
4590
|
+
* ```
|
|
4576
4591
|
*/
|
|
4577
4592
|
declare type DomainSettingsPreloadScripts = Record<string, {
|
|
4578
4593
|
enabled: boolean;
|
|
@@ -6616,6 +6631,7 @@ declare class InteropBroker extends Base {
|
|
|
6616
6631
|
private sessionContextGroupMap;
|
|
6617
6632
|
private channel;
|
|
6618
6633
|
private logging;
|
|
6634
|
+
private privateChannelProviderMap;
|
|
6619
6635
|
/* Excluded from this release type: __constructor */
|
|
6620
6636
|
private getProvider;
|
|
6621
6637
|
static createClosedConstructor(...args: ConstructorParameters<typeof InteropBroker>): {
|
package/out/mock-public.d.ts
CHANGED
|
@@ -4572,7 +4572,22 @@ declare type DomainSettings = {
|
|
|
4572
4572
|
};
|
|
4573
4573
|
|
|
4574
4574
|
/**
|
|
4575
|
-
*
|
|
4575
|
+
* Enables or disables specific preload scripts by URL.
|
|
4576
|
+
*
|
|
4577
|
+
* Uses the script's full URL as the key and an object
|
|
4578
|
+
* with an `enabled` boolean property as the value.
|
|
4579
|
+
* @example
|
|
4580
|
+
* ```js
|
|
4581
|
+
* {
|
|
4582
|
+
"match": ["<all_urls>"],
|
|
4583
|
+
"options": {
|
|
4584
|
+
"preloadScripts": {
|
|
4585
|
+
"http://localhost:53000/block-preload.js": { "enabled": false }
|
|
4586
|
+
"http://localhost:53000/allow-preload.js": { "enabled": true }
|
|
4587
|
+
}
|
|
4588
|
+
}
|
|
4589
|
+
}
|
|
4590
|
+
* ```
|
|
4576
4591
|
*/
|
|
4577
4592
|
declare type DomainSettingsPreloadScripts = Record<string, {
|
|
4578
4593
|
enabled: boolean;
|
|
@@ -6616,6 +6631,7 @@ declare class InteropBroker extends Base {
|
|
|
6616
6631
|
private sessionContextGroupMap;
|
|
6617
6632
|
private channel;
|
|
6618
6633
|
private logging;
|
|
6634
|
+
private privateChannelProviderMap;
|
|
6619
6635
|
/* Excluded from this release type: __constructor */
|
|
6620
6636
|
private getProvider;
|
|
6621
6637
|
static createClosedConstructor(...args: ConstructorParameters<typeof InteropBroker>): {
|
package/out/stub.d.ts
CHANGED
|
@@ -4631,7 +4631,22 @@ declare type DomainSettings = {
|
|
|
4631
4631
|
};
|
|
4632
4632
|
|
|
4633
4633
|
/**
|
|
4634
|
-
*
|
|
4634
|
+
* Enables or disables specific preload scripts by URL.
|
|
4635
|
+
*
|
|
4636
|
+
* Uses the script's full URL as the key and an object
|
|
4637
|
+
* with an `enabled` boolean property as the value.
|
|
4638
|
+
* @example
|
|
4639
|
+
* ```js
|
|
4640
|
+
* {
|
|
4641
|
+
"match": ["<all_urls>"],
|
|
4642
|
+
"options": {
|
|
4643
|
+
"preloadScripts": {
|
|
4644
|
+
"http://localhost:53000/block-preload.js": { "enabled": false }
|
|
4645
|
+
"http://localhost:53000/allow-preload.js": { "enabled": true }
|
|
4646
|
+
}
|
|
4647
|
+
}
|
|
4648
|
+
}
|
|
4649
|
+
* ```
|
|
4635
4650
|
*/
|
|
4636
4651
|
declare type DomainSettingsPreloadScripts = Record<string, {
|
|
4637
4652
|
enabled: boolean;
|
|
@@ -6722,6 +6737,7 @@ declare class InteropBroker extends Base {
|
|
|
6722
6737
|
private sessionContextGroupMap;
|
|
6723
6738
|
private channel;
|
|
6724
6739
|
private logging;
|
|
6740
|
+
private privateChannelProviderMap;
|
|
6725
6741
|
/**
|
|
6726
6742
|
* @internal
|
|
6727
6743
|
*/
|
package/out/stub.js
CHANGED
|
@@ -9025,7 +9025,7 @@ var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
9025
9025
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
9026
9026
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
9027
9027
|
};
|
|
9028
|
-
var __importDefault$
|
|
9028
|
+
var __importDefault$6 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
9029
9029
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9030
9030
|
};
|
|
9031
9031
|
var _ConnectionManager_messageReceiver, _ConnectionManager_rtcConnectionManager;
|
|
@@ -9039,7 +9039,7 @@ const ice_manager_1 = iceManager;
|
|
|
9039
9039
|
const provider_1$1 = provider;
|
|
9040
9040
|
const message_receiver_1 = messageReceiver;
|
|
9041
9041
|
const protocol_manager_1 = protocolManager;
|
|
9042
|
-
const strategy_3 = __importDefault$
|
|
9042
|
+
const strategy_3 = __importDefault$6(strategy);
|
|
9043
9043
|
class ConnectionManager extends base_1$i.Base {
|
|
9044
9044
|
static getProtocolOptionsFromStrings(protocols) {
|
|
9045
9045
|
return protocols.map((protocol) => {
|
|
@@ -13454,7 +13454,7 @@ Object.defineProperty(PrivateChannelProvider$1, "__esModule", { value: true });
|
|
|
13454
13454
|
PrivateChannelProvider$1.PrivateChannelProvider = void 0;
|
|
13455
13455
|
const utils_1$8 = utils$3;
|
|
13456
13456
|
class PrivateChannelProvider {
|
|
13457
|
-
constructor(provider, id) {
|
|
13457
|
+
constructor(provider, id, removePrivateChannelProvider) {
|
|
13458
13458
|
this.provider = provider;
|
|
13459
13459
|
this.id = id;
|
|
13460
13460
|
this.clients = new Map();
|
|
@@ -13462,6 +13462,7 @@ class PrivateChannelProvider {
|
|
|
13462
13462
|
this.contextByContextType = new Map();
|
|
13463
13463
|
this.lastContext = undefined;
|
|
13464
13464
|
this.provider.onConnection((clientIdentity) => this.registerNewClient(clientIdentity));
|
|
13465
|
+
this.removePrivateChannelProvider = removePrivateChannelProvider;
|
|
13465
13466
|
this.provider.onDisconnection(async (clientIdentity) => {
|
|
13466
13467
|
const { endpointId } = clientIdentity;
|
|
13467
13468
|
if (this.clients.has(endpointId)) {
|
|
@@ -13469,6 +13470,7 @@ class PrivateChannelProvider {
|
|
|
13469
13470
|
}
|
|
13470
13471
|
if ((await this.provider.getAllClientInfo()).length === 0) {
|
|
13471
13472
|
this.provider.destroy();
|
|
13473
|
+
this.removePrivateChannelProvider(this.id);
|
|
13472
13474
|
}
|
|
13473
13475
|
});
|
|
13474
13476
|
}
|
|
@@ -13720,8 +13722,8 @@ class PrivateChannelProvider {
|
|
|
13720
13722
|
});
|
|
13721
13723
|
});
|
|
13722
13724
|
}
|
|
13723
|
-
static init(channelProvider, id) {
|
|
13724
|
-
return new PrivateChannelProvider(channelProvider, id);
|
|
13725
|
+
static init(channelProvider, id, removePrivateChannelProvider) {
|
|
13726
|
+
return new PrivateChannelProvider(channelProvider, id, removePrivateChannelProvider);
|
|
13725
13727
|
}
|
|
13726
13728
|
}
|
|
13727
13729
|
PrivateChannelProvider$1.PrivateChannelProvider = PrivateChannelProvider;
|
|
@@ -13737,16 +13739,16 @@ var __classPrivateFieldGet$5 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
13737
13739
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
13738
13740
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
13739
13741
|
};
|
|
13740
|
-
var __importDefault$
|
|
13742
|
+
var __importDefault$5 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
13741
13743
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13742
13744
|
};
|
|
13743
13745
|
var _InteropBroker_fdc3Info, _InteropBroker_contextGroups, _InteropBroker_providerPromise;
|
|
13744
13746
|
Object.defineProperty(InteropBroker$1, "__esModule", { value: true });
|
|
13745
13747
|
InteropBroker$1.InteropBroker = void 0;
|
|
13746
13748
|
const base_1$5 = base;
|
|
13747
|
-
const SessionContextGroupBroker_1 = __importDefault$
|
|
13749
|
+
const SessionContextGroupBroker_1 = __importDefault$5(SessionContextGroupBroker$1);
|
|
13748
13750
|
const utils_1$7 = utils$3;
|
|
13749
|
-
const isEqual_1$
|
|
13751
|
+
const isEqual_1$2 = __importDefault$5(require$$3);
|
|
13750
13752
|
const PrivateChannelProvider_1 = PrivateChannelProvider$1;
|
|
13751
13753
|
const lazy_1 = lazy;
|
|
13752
13754
|
const defaultContextGroups = [
|
|
@@ -13935,6 +13937,7 @@ class InteropBroker extends base_1$5.Base {
|
|
|
13935
13937
|
this.intentClientMap = new Map();
|
|
13936
13938
|
this.lastContextMap = new Map();
|
|
13937
13939
|
this.sessionContextGroupMap = new Map();
|
|
13940
|
+
this.privateChannelProviderMap = new Map();
|
|
13938
13941
|
__classPrivateFieldSet$5(this, _InteropBroker_providerPromise, new lazy_1.Lazy(createProvider), "f");
|
|
13939
13942
|
this.setContextGroupMap();
|
|
13940
13943
|
this.setupChannelProvider();
|
|
@@ -13944,7 +13947,7 @@ class InteropBroker extends base_1$5.Base {
|
|
|
13944
13947
|
constructor(...unused) {
|
|
13945
13948
|
if (unused.length) {
|
|
13946
13949
|
const [_ignore1, ignore2, opts] = unused;
|
|
13947
|
-
if (opts && typeof opts === 'object' && !(0, isEqual_1$
|
|
13950
|
+
if (opts && typeof opts === 'object' && !(0, isEqual_1$2.default)(opts, args[2])) {
|
|
13948
13951
|
// eslint-disable-next-line no-console
|
|
13949
13952
|
console.warn('You have modified the parameters of the InteropOverride constructor. This behavior is deprecated and will be removed in a future version. You can modify these options in your manifest. Please consult our Interop docs for guidance on migrating to the new override scheme.');
|
|
13950
13953
|
super(args[0], args[1], opts);
|
|
@@ -14955,7 +14958,15 @@ class InteropBroker extends base_1$5.Base {
|
|
|
14955
14958
|
channel.register('createPrivateChannelProvider', async (payload) => {
|
|
14956
14959
|
const { channelId } = payload;
|
|
14957
14960
|
const channelProvider = await this.fin.InterApplicationBus.Channel.create(channelId);
|
|
14958
|
-
|
|
14961
|
+
const removePrivateChannelProvider = (channelId) => {
|
|
14962
|
+
this.privateChannelProviderMap.delete(channelId);
|
|
14963
|
+
};
|
|
14964
|
+
const privateChannelProvider = PrivateChannelProvider_1.PrivateChannelProvider.init(channelProvider, channelId, removePrivateChannelProvider);
|
|
14965
|
+
this.privateChannelProviderMap.set(channelId, privateChannelProvider);
|
|
14966
|
+
});
|
|
14967
|
+
channel.register('isIdUsedByPrivateChannel', async (payload) => {
|
|
14968
|
+
const { channelId } = payload;
|
|
14969
|
+
return this.privateChannelProviderMap.has(channelId);
|
|
14959
14970
|
});
|
|
14960
14971
|
}
|
|
14961
14972
|
/**
|
|
@@ -15088,14 +15099,14 @@ var __classPrivateFieldGet$3 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
|
15088
15099
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
15089
15100
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15090
15101
|
};
|
|
15091
|
-
var __importDefault$
|
|
15102
|
+
var __importDefault$4 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
15092
15103
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15093
15104
|
};
|
|
15094
15105
|
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups, _InteropClient_fdc3Factory;
|
|
15095
15106
|
Object.defineProperty(InteropClient$1, "__esModule", { value: true });
|
|
15096
15107
|
InteropClient$1.InteropClient = void 0;
|
|
15097
15108
|
const base_1$3 = base;
|
|
15098
|
-
const SessionContextGroupClient_1 = __importDefault$
|
|
15109
|
+
const SessionContextGroupClient_1 = __importDefault$4(SessionContextGroupClient$1);
|
|
15099
15110
|
const utils_1$5 = utils$3;
|
|
15100
15111
|
/**
|
|
15101
15112
|
* The Interop Client API is broken up into two groups:
|
|
@@ -15837,15 +15848,86 @@ class PrivateChannelClient {
|
|
|
15837
15848
|
}
|
|
15838
15849
|
PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
15839
15850
|
|
|
15851
|
+
var fdc3Channels2_0 = {};
|
|
15852
|
+
|
|
15853
|
+
var fdc3Channels1_2 = {};
|
|
15854
|
+
|
|
15855
|
+
var __importDefault$3 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
15856
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15857
|
+
};
|
|
15858
|
+
Object.defineProperty(fdc3Channels1_2, "__esModule", { value: true });
|
|
15859
|
+
fdc3Channels1_2.createV1Channel = void 0;
|
|
15860
|
+
const isEqual_1$1 = __importDefault$3(require$$3);
|
|
15861
|
+
const createV1Channel = (sessionContextGroup) => {
|
|
15862
|
+
return {
|
|
15863
|
+
id: sessionContextGroup.id,
|
|
15864
|
+
type: 'app',
|
|
15865
|
+
broadcast: sessionContextGroup.setContext,
|
|
15866
|
+
getCurrentContext: async (contextType) => {
|
|
15867
|
+
const context = await sessionContextGroup.getCurrentContext(contextType);
|
|
15868
|
+
return context === undefined ? null : context;
|
|
15869
|
+
},
|
|
15870
|
+
// @ts-expect-error TODO [CORE-1524]
|
|
15871
|
+
addContextListener: (contextType, handler) => {
|
|
15872
|
+
let realHandler;
|
|
15873
|
+
let realType;
|
|
15874
|
+
if (typeof contextType === 'function') {
|
|
15875
|
+
console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
|
|
15876
|
+
realHandler = contextType;
|
|
15877
|
+
}
|
|
15878
|
+
else {
|
|
15879
|
+
realHandler = handler;
|
|
15880
|
+
if (typeof contextType === 'string') {
|
|
15881
|
+
realType = contextType;
|
|
15882
|
+
}
|
|
15883
|
+
}
|
|
15884
|
+
const listener = (async () => {
|
|
15885
|
+
let first = true;
|
|
15886
|
+
const currentContext = await sessionContextGroup.getCurrentContext(realType);
|
|
15887
|
+
const wrappedHandler = (context, contextMetadata) => {
|
|
15888
|
+
if (first) {
|
|
15889
|
+
first = false;
|
|
15890
|
+
if ((0, isEqual_1$1.default)(currentContext, context)) {
|
|
15891
|
+
return;
|
|
15892
|
+
}
|
|
15893
|
+
}
|
|
15894
|
+
// eslint-disable-next-line consistent-return
|
|
15895
|
+
return realHandler(context, contextMetadata);
|
|
15896
|
+
};
|
|
15897
|
+
return sessionContextGroup.addContextHandler(wrappedHandler, realType);
|
|
15898
|
+
})();
|
|
15899
|
+
return {
|
|
15900
|
+
...listener,
|
|
15901
|
+
unsubscribe: () => listener.then((l) => l.unsubscribe())
|
|
15902
|
+
};
|
|
15903
|
+
}
|
|
15904
|
+
};
|
|
15905
|
+
};
|
|
15906
|
+
fdc3Channels1_2.createV1Channel = createV1Channel;
|
|
15907
|
+
|
|
15908
|
+
Object.defineProperty(fdc3Channels2_0, "__esModule", { value: true });
|
|
15909
|
+
fdc3Channels2_0.createV2Channel = void 0;
|
|
15910
|
+
const fdc3_channels_1_2_1$1 = fdc3Channels1_2;
|
|
15911
|
+
const createV2Channel = (sessionContextGroup) => {
|
|
15912
|
+
const channel = (0, fdc3_channels_1_2_1$1.createV1Channel)(sessionContextGroup);
|
|
15913
|
+
return {
|
|
15914
|
+
...channel,
|
|
15915
|
+
// @ts-expect-error Type incompatibility on signature.
|
|
15916
|
+
addContextListener: async (...args) => channel.addContextListener(...args)
|
|
15917
|
+
};
|
|
15918
|
+
};
|
|
15919
|
+
fdc3Channels2_0.createV2Channel = createV2Channel;
|
|
15920
|
+
|
|
15840
15921
|
(function (exports) {
|
|
15841
15922
|
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
15842
15923
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15843
15924
|
};
|
|
15844
15925
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15845
|
-
exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.
|
|
15926
|
+
exports.getIntentResolution = exports.isChannel = exports.isContext = exports.connectPrivateChannel = exports.buildPrivateChannelObject = exports.ChannelError = exports.ResultError = exports.UnsupportedChannelApiError = exports.getUnsupportedChannelApis = void 0;
|
|
15846
15927
|
const utils_1 = utils$3;
|
|
15847
15928
|
const PrivateChannelClient_1 = PrivateChannelClient$1;
|
|
15848
|
-
|
|
15929
|
+
__importDefault(require$$3);
|
|
15930
|
+
const fdc3_channels_2_0_1 = fdc3Channels2_0;
|
|
15849
15931
|
const getUnsupportedChannelApis = (channelType) => {
|
|
15850
15932
|
return {
|
|
15851
15933
|
addContextListener: () => {
|
|
@@ -15944,52 +16026,6 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
|
15944
16026
|
};
|
|
15945
16027
|
};
|
|
15946
16028
|
exports.buildPrivateChannelObject = buildPrivateChannelObject;
|
|
15947
|
-
const buildAppChannelObject = (sessionContextGroup) => {
|
|
15948
|
-
return {
|
|
15949
|
-
id: sessionContextGroup.id,
|
|
15950
|
-
type: 'app',
|
|
15951
|
-
broadcast: sessionContextGroup.setContext,
|
|
15952
|
-
getCurrentContext: async (contextType) => {
|
|
15953
|
-
const context = await sessionContextGroup.getCurrentContext(contextType);
|
|
15954
|
-
return context === undefined ? null : context;
|
|
15955
|
-
},
|
|
15956
|
-
// @ts-expect-error TODO [CORE-1524]
|
|
15957
|
-
addContextListener: (contextType, handler) => {
|
|
15958
|
-
let realHandler;
|
|
15959
|
-
let realType;
|
|
15960
|
-
if (typeof contextType === 'function') {
|
|
15961
|
-
console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
|
|
15962
|
-
realHandler = contextType;
|
|
15963
|
-
}
|
|
15964
|
-
else {
|
|
15965
|
-
realHandler = handler;
|
|
15966
|
-
if (typeof contextType === 'string') {
|
|
15967
|
-
realType = contextType;
|
|
15968
|
-
}
|
|
15969
|
-
}
|
|
15970
|
-
const listener = (async () => {
|
|
15971
|
-
let first = true;
|
|
15972
|
-
const currentContext = await sessionContextGroup.getCurrentContext(realType);
|
|
15973
|
-
const wrappedHandler = (context, contextMetadata) => {
|
|
15974
|
-
if (first) {
|
|
15975
|
-
first = false;
|
|
15976
|
-
if ((0, isEqual_1.default)(currentContext, context)) {
|
|
15977
|
-
return;
|
|
15978
|
-
}
|
|
15979
|
-
}
|
|
15980
|
-
// eslint-disable-next-line consistent-return
|
|
15981
|
-
return realHandler(context, contextMetadata);
|
|
15982
|
-
};
|
|
15983
|
-
return sessionContextGroup.addContextHandler(wrappedHandler, realType);
|
|
15984
|
-
})();
|
|
15985
|
-
return {
|
|
15986
|
-
...listener,
|
|
15987
|
-
unsubscribe: () => listener.then((l) => l.unsubscribe())
|
|
15988
|
-
};
|
|
15989
|
-
}
|
|
15990
|
-
};
|
|
15991
|
-
};
|
|
15992
|
-
exports.buildAppChannelObject = buildAppChannelObject;
|
|
15993
16029
|
const connectPrivateChannel = async (channelId) => {
|
|
15994
16030
|
try {
|
|
15995
16031
|
const channelClient = await fin.InterApplicationBus.Channel.connect(channelId);
|
|
@@ -16021,6 +16057,10 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
|
16021
16057
|
// Generate an ID to make a session context group with. We will pass that ID to the Broker.
|
|
16022
16058
|
// The broker will then setContext on that session context group later with our Intent Result,
|
|
16023
16059
|
const guid = (0, utils_1.generateId)(); // TODO make this undefined in web
|
|
16060
|
+
let isPromiseSettled = false;
|
|
16061
|
+
// Adding the intentResolutionResultId to the intentObj. Because fireIntent only accepts a single arg, we have to slap it in here.
|
|
16062
|
+
const metadata = app ? { target: app, intentResolutionResultId: guid } : { intentResolutionResultId: guid };
|
|
16063
|
+
const intentObj = intent ? { name: intent, context, metadata } : { ...context, metadata };
|
|
16024
16064
|
// Promise we'll use in getResult
|
|
16025
16065
|
const getResultPromise = new Promise((resolve, reject) => {
|
|
16026
16066
|
fin.InterApplicationBus.subscribe({ uuid: '*' }, guid, (intentResult) => {
|
|
@@ -16033,13 +16073,24 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
|
16033
16073
|
reject(new Error('getResult is not supported in this environment'));
|
|
16034
16074
|
});
|
|
16035
16075
|
});
|
|
16036
|
-
|
|
16037
|
-
|
|
16038
|
-
|
|
16076
|
+
getResultPromise
|
|
16077
|
+
.then(() => {
|
|
16078
|
+
isPromiseSettled = true;
|
|
16079
|
+
})
|
|
16080
|
+
.catch(() => {
|
|
16081
|
+
isPromiseSettled = true;
|
|
16082
|
+
});
|
|
16039
16083
|
// Set up the getResult call.
|
|
16040
16084
|
const getResult = async () => {
|
|
16085
|
+
// All this mumbo jumbo is needed to make sure that getResult resolves correctly and conforms to the FDC3 spec.
|
|
16086
|
+
if (!isPromiseSettled) {
|
|
16087
|
+
return undefined;
|
|
16088
|
+
}
|
|
16041
16089
|
let intentResult = await getResultPromise;
|
|
16042
|
-
if (
|
|
16090
|
+
if (isPromiseSettled && !intentResult) {
|
|
16091
|
+
return undefined;
|
|
16092
|
+
}
|
|
16093
|
+
if (typeof intentResult !== 'object') {
|
|
16043
16094
|
throw new Error(ResultError.NoResultReturned);
|
|
16044
16095
|
}
|
|
16045
16096
|
const { error } = intentResult;
|
|
@@ -16055,7 +16106,7 @@ PrivateChannelClient$1.PrivateChannelClient = PrivateChannelClient;
|
|
|
16055
16106
|
}
|
|
16056
16107
|
case 'app': {
|
|
16057
16108
|
const sessionContextGroup = await interopModule.joinSessionContextGroup(id);
|
|
16058
|
-
intentResult = (0,
|
|
16109
|
+
intentResult = (0, fdc3_channels_2_0_1.createV2Channel)(sessionContextGroup);
|
|
16059
16110
|
break;
|
|
16060
16111
|
}
|
|
16061
16112
|
}
|
|
@@ -16165,10 +16216,16 @@ class FDC3ModuleBase {
|
|
|
16165
16216
|
*
|
|
16166
16217
|
* @tutorial fdc3.getOrCreateChannel
|
|
16167
16218
|
*/
|
|
16168
|
-
async getOrCreateChannel(channelId) {
|
|
16219
|
+
async getOrCreateChannel(channelId, fdc3Factory) {
|
|
16169
16220
|
this.wire.sendAction('fdc3-get-or-create-channel').catch((e) => {
|
|
16170
16221
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
16171
16222
|
});
|
|
16223
|
+
const hasChannelIdBeenUsed = await InteropClient_1$2.InteropClient.ferryFdc3Call(this.client, 'isIdUsedByPrivateChannel', {
|
|
16224
|
+
channelId
|
|
16225
|
+
});
|
|
16226
|
+
if (hasChannelIdBeenUsed) {
|
|
16227
|
+
throw new Error(utils_1$4.ChannelError.AccessDenied);
|
|
16228
|
+
}
|
|
16172
16229
|
const systemChannels = await this._getChannels();
|
|
16173
16230
|
const userChannel = systemChannels.find((channel) => channel.id === channelId);
|
|
16174
16231
|
if (userChannel) {
|
|
@@ -16176,7 +16233,7 @@ class FDC3ModuleBase {
|
|
|
16176
16233
|
}
|
|
16177
16234
|
try {
|
|
16178
16235
|
const sessionContextGroup = await this.client.joinSessionContextGroup(channelId);
|
|
16179
|
-
return (
|
|
16236
|
+
return fdc3Factory(sessionContextGroup);
|
|
16180
16237
|
}
|
|
16181
16238
|
catch (error) {
|
|
16182
16239
|
console.error(error.message);
|
|
@@ -16326,6 +16383,7 @@ Object.defineProperty(fdc31_2, "__esModule", { value: true });
|
|
|
16326
16383
|
fdc31_2.Fdc3Module = void 0;
|
|
16327
16384
|
const utils_1$3 = utils$3;
|
|
16328
16385
|
const fdc3_common_1$1 = fdc3Common;
|
|
16386
|
+
const fdc3_channels_1_2_1 = fdc3Channels1_2;
|
|
16329
16387
|
/**
|
|
16330
16388
|
* @version 1.2
|
|
16331
16389
|
* The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
|
|
@@ -16508,7 +16566,7 @@ class Fdc3Module extends fdc3_common_1$1.FDC3ModuleBase {
|
|
|
16508
16566
|
* @tutorial fdc3.getOrCreateChannel
|
|
16509
16567
|
*/
|
|
16510
16568
|
async getOrCreateChannel(channelId) {
|
|
16511
|
-
return super.getOrCreateChannel(channelId);
|
|
16569
|
+
return super.getOrCreateChannel(channelId, fdc3_channels_1_2_1.createV1Channel);
|
|
16512
16570
|
}
|
|
16513
16571
|
/**
|
|
16514
16572
|
* Returns metadata relating to the FDC3 object and its provider, including the supported version of the FDC3 specification and the name of the provider of the implementation.
|
|
@@ -16538,6 +16596,7 @@ const utils_1$2 = utils$3;
|
|
|
16538
16596
|
const InteropClient_1$1 = InteropClient$1;
|
|
16539
16597
|
const utils_2 = utils$2;
|
|
16540
16598
|
const PrivateChannelClient_1 = PrivateChannelClient$1;
|
|
16599
|
+
const fdc3_channels_2_0_1 = fdc3Channels2_0;
|
|
16541
16600
|
/**
|
|
16542
16601
|
* @version 2.0
|
|
16543
16602
|
* The FDC3 Client Library provides a set APIs to be used for FDC3 compliance,
|
|
@@ -16789,7 +16848,7 @@ class Fdc3Module2 extends fdc3_common_1.FDC3ModuleBase {
|
|
|
16789
16848
|
* @tutorial fdc3.getOrCreateChannel
|
|
16790
16849
|
*/
|
|
16791
16850
|
async getOrCreateChannel(channelId) {
|
|
16792
|
-
return super.getOrCreateChannel(channelId);
|
|
16851
|
+
return super.getOrCreateChannel(channelId, fdc3_channels_2_0_1.createV2Channel);
|
|
16793
16852
|
}
|
|
16794
16853
|
/**
|
|
16795
16854
|
* Returns a Channel with an auto-generated identity that is intended for private communication between applications. Primarily used to create channels that will be returned to other applications via an IntentResolution for a raised intent.
|