@interopio/desktop 6.16.3 → 6.17.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 +7 -1
- package/desktop.d.ts +14 -8
- package/dist/desktop.browser.js +66 -25
- package/dist/desktop.browser.js.map +1 -1
- package/dist/desktop.browser.min.js +1 -1
- package/dist/desktop.browser.min.js.map +1 -1
- package/dist/desktop.es.js +66 -25
- package/dist/desktop.es.js.map +1 -1
- package/dist/desktop.umd.js +66 -25
- package/dist/desktop.umd.js.map +1 -1
- package/dist/desktop.umd.min.js +1 -1
- package/dist/desktop.umd.min.js.map +1 -1
- package/package.json +2 -2
package/dist/desktop.umd.js
CHANGED
|
@@ -13650,7 +13650,11 @@
|
|
|
13650
13650
|
resolveFunc = resolve;
|
|
13651
13651
|
rejectFunc = reject;
|
|
13652
13652
|
});
|
|
13653
|
-
agm.subscribe(OnEventMethodName, {
|
|
13653
|
+
agm.subscribe(OnEventMethodName, {
|
|
13654
|
+
arguments: { skipIcon: skipIcons },
|
|
13655
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
13656
|
+
methodResponseTimeout: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
13657
|
+
})
|
|
13654
13658
|
.then((s) => {
|
|
13655
13659
|
subscription = s;
|
|
13656
13660
|
subscription.onData((streamData) => {
|
|
@@ -16877,6 +16881,8 @@
|
|
|
16877
16881
|
arguments: {
|
|
16878
16882
|
withConfig: true
|
|
16879
16883
|
},
|
|
16884
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
16885
|
+
methodResponseTimeout: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
16880
16886
|
onData: (streamData) => {
|
|
16881
16887
|
if (streamData.data.type === "Configuration") {
|
|
16882
16888
|
this._configuration = streamData.data;
|
|
@@ -18447,9 +18453,6 @@
|
|
|
18447
18453
|
if (!isUndefinedOrNull(options.context) && !isObject(options.context)) {
|
|
18448
18454
|
return reject(new Error("`context` must hold an object value."));
|
|
18449
18455
|
}
|
|
18450
|
-
if (!isUndefinedOrNull(options.timeout) && typeof options.timeout !== "number") {
|
|
18451
|
-
return reject(new Error("`timeout` must hold an number value."));
|
|
18452
|
-
}
|
|
18453
18456
|
options.context = (_c = options.context) !== null && _c !== void 0 ? _c : {};
|
|
18454
18457
|
const restoreOptions = {
|
|
18455
18458
|
activityToJoin: options.activityIdToJoin,
|
|
@@ -18464,11 +18467,9 @@
|
|
|
18464
18467
|
type: options.type,
|
|
18465
18468
|
name: options.name,
|
|
18466
18469
|
context: options.context,
|
|
18467
|
-
options: restoreOptions
|
|
18470
|
+
options: restoreOptions,
|
|
18471
|
+
timeout: INTEROP_METHOD_MAX_TIMEOUT_MS
|
|
18468
18472
|
};
|
|
18469
|
-
if (options.timeout) {
|
|
18470
|
-
arg.timeout = options.timeout;
|
|
18471
|
-
}
|
|
18472
18473
|
this.invokeMethodAndTrack("RestoreLayout", arg, resolve, reject, true);
|
|
18473
18474
|
});
|
|
18474
18475
|
}
|
|
@@ -18602,6 +18603,7 @@
|
|
|
18602
18603
|
const request = {
|
|
18603
18604
|
name,
|
|
18604
18605
|
type: "Global",
|
|
18606
|
+
timeout: INTEROP_METHOD_MAX_TIMEOUT_MS,
|
|
18605
18607
|
context,
|
|
18606
18608
|
...options
|
|
18607
18609
|
};
|
|
@@ -18750,7 +18752,7 @@
|
|
|
18750
18752
|
const err = Utils.typedError(error);
|
|
18751
18753
|
reject(err);
|
|
18752
18754
|
};
|
|
18753
|
-
const methodResponseTimeoutMs = 120 * 1000;
|
|
18755
|
+
const methodResponseTimeoutMs = ("timeout" in args && typeof args.timeout === "number") ? args.timeout : 120 * 1000;
|
|
18754
18756
|
if (!skipStreamEvent) {
|
|
18755
18757
|
this.stream.waitFor(token, methodResponseTimeoutMs)
|
|
18756
18758
|
.then(() => {
|
|
@@ -18839,7 +18841,7 @@
|
|
|
18839
18841
|
}
|
|
18840
18842
|
else {
|
|
18841
18843
|
this.logger.trace(`subscribing to "${this.StreamName}" stream`);
|
|
18842
|
-
this.agm.subscribe(this.StreamName, { waitTimeoutMs:
|
|
18844
|
+
this.agm.subscribe(this.StreamName, { waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS, methodResponseTimeout: INTEROP_METHOD_WAIT_TIMEOUT_MS })
|
|
18843
18845
|
.then((subs) => {
|
|
18844
18846
|
this.logger.trace(`subscribed to "${this.StreamName}" stream`);
|
|
18845
18847
|
subs.onData((args) => {
|
|
@@ -19520,12 +19522,17 @@
|
|
|
19520
19522
|
validateFdc3Options(options);
|
|
19521
19523
|
}
|
|
19522
19524
|
const id = Utils.generateId();
|
|
19525
|
+
let handlerInvoked = false;
|
|
19526
|
+
const markHandlerInvoked = () => { handlerInvoked = true; };
|
|
19523
19527
|
const wrappedCallback = (options === null || options === void 0 ? void 0 : options.contextType)
|
|
19524
|
-
? this.getWrappedSubscribeCallbackWithFdc3Type(callback, id, options.contextType)
|
|
19525
|
-
: this.getWrappedSubscribeCallback(callback, id);
|
|
19528
|
+
? this.getWrappedSubscribeCallbackWithFdc3Type(callback, id, options.contextType, markHandlerInvoked)
|
|
19529
|
+
: this.getWrappedSubscribeCallback(callback, id, markHandlerInvoked);
|
|
19526
19530
|
let timeoutIndex;
|
|
19527
19531
|
if (this.lastUpdate) {
|
|
19528
19532
|
timeoutIndex = setTimeout(() => {
|
|
19533
|
+
if (handlerInvoked) {
|
|
19534
|
+
return;
|
|
19535
|
+
}
|
|
19529
19536
|
wrappedCallback(this.lastUpdate.context.data, this.lastUpdate.context, {}, this.lastUpdate.updaterId);
|
|
19530
19537
|
}, 0);
|
|
19531
19538
|
}
|
|
@@ -19547,9 +19554,10 @@
|
|
|
19547
19554
|
validateFdc3Options(options);
|
|
19548
19555
|
}
|
|
19549
19556
|
const id = Utils.generateId();
|
|
19557
|
+
const markHandlerInvoked = () => { };
|
|
19550
19558
|
const wrappedCallback = (options === null || options === void 0 ? void 0 : options.contextType)
|
|
19551
|
-
? this.getWrappedSubscribeCallbackWithFdc3Type(callback, id, options.contextType)
|
|
19552
|
-
: this.getWrappedSubscribeCallback(callback, id);
|
|
19559
|
+
? this.getWrappedSubscribeCallbackWithFdc3Type(callback, id, options.contextType, markHandlerInvoked)
|
|
19560
|
+
: this.getWrappedSubscribeCallback(callback, id, markHandlerInvoked);
|
|
19553
19561
|
const unsub = await this.shared.subscribeFor(name, wrappedCallback);
|
|
19554
19562
|
return () => {
|
|
19555
19563
|
this.pendingRestrictionCallbacks.delete(id);
|
|
@@ -20085,8 +20093,9 @@
|
|
|
20085
20093
|
const fdc3DataToPublish = { [`fdc3_${parsedType}`]: rest };
|
|
20086
20094
|
return this.shared.updateData(channelName, fdc3DataToPublish);
|
|
20087
20095
|
}
|
|
20088
|
-
getWrappedSubscribeCallback(callback, id) {
|
|
20096
|
+
getWrappedSubscribeCallback(callback, id, markHandlerInvoked) {
|
|
20089
20097
|
const wrappedCallback = async (_, context, delta, updaterId) => {
|
|
20098
|
+
markHandlerInvoked();
|
|
20090
20099
|
const restrictionByChannel = await this.getRestrictionsByChannel(context.name);
|
|
20091
20100
|
const channelData = this.getDataWithFdc3Encoding(context, delta);
|
|
20092
20101
|
if (restrictionByChannel.read) {
|
|
@@ -20097,9 +20106,10 @@
|
|
|
20097
20106
|
};
|
|
20098
20107
|
return wrappedCallback;
|
|
20099
20108
|
}
|
|
20100
|
-
getWrappedSubscribeCallbackWithFdc3Type(callback, id, fdc3Type) {
|
|
20109
|
+
getWrappedSubscribeCallbackWithFdc3Type(callback, id, fdc3Type, markHandlerInvoked) {
|
|
20101
20110
|
const didReplay = { replayed: false };
|
|
20102
20111
|
const wrappedCallback = async (_, context, delta, updaterId) => {
|
|
20112
|
+
markHandlerInvoked();
|
|
20103
20113
|
const restrictionByChannel = await this.getRestrictionsByChannel(context.name);
|
|
20104
20114
|
const callbackWithTypesChecks = () => {
|
|
20105
20115
|
const { data, latest_fdc3_type } = context;
|
|
@@ -20457,7 +20467,7 @@
|
|
|
20457
20467
|
}
|
|
20458
20468
|
}
|
|
20459
20469
|
|
|
20460
|
-
var version = "6.
|
|
20470
|
+
var version = "6.17.0";
|
|
20461
20471
|
|
|
20462
20472
|
var prepareConfig = (options) => {
|
|
20463
20473
|
function getLibConfig(value, defaultMode, trueMode) {
|
|
@@ -21076,7 +21086,9 @@
|
|
|
21076
21086
|
arguments: {
|
|
21077
21087
|
sendDeltaOnly: true,
|
|
21078
21088
|
statesVersion2: true
|
|
21079
|
-
}
|
|
21089
|
+
},
|
|
21090
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
21091
|
+
methodResponseTimeout: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
21080
21092
|
})
|
|
21081
21093
|
.then((sub) => {
|
|
21082
21094
|
this.subscriptionForNotifications = sub;
|
|
@@ -21108,7 +21120,9 @@
|
|
|
21108
21120
|
.subscribe(this.NotificationsCounterStream, {
|
|
21109
21121
|
arguments: {
|
|
21110
21122
|
sendDeltaOnly: true
|
|
21111
|
-
}
|
|
21123
|
+
},
|
|
21124
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
21125
|
+
methodResponseTimeout: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
21112
21126
|
})
|
|
21113
21127
|
.then((sub) => {
|
|
21114
21128
|
this.subscriptionForCounter = sub;
|
|
@@ -22860,6 +22874,32 @@
|
|
|
22860
22874
|
}
|
|
22861
22875
|
});
|
|
22862
22876
|
};
|
|
22877
|
+
const validateAddIntentListenerRequest = (request) => {
|
|
22878
|
+
if ((typeof request !== "string" && typeof request !== "object") || (typeof request === "object" && typeof request.intent !== "string")) {
|
|
22879
|
+
throw new Error("Please provide the intent as a string or an object with an intent property!");
|
|
22880
|
+
}
|
|
22881
|
+
if (typeof request === "string") {
|
|
22882
|
+
return;
|
|
22883
|
+
}
|
|
22884
|
+
if (typeof request.contextTypes !== "undefined" && (!Array.isArray(request.contextTypes) || request.contextTypes.some(ctx => typeof ctx !== "string"))) {
|
|
22885
|
+
throw new Error("Please provide the 'contextTypes' as an array of strings!");
|
|
22886
|
+
}
|
|
22887
|
+
if (typeof request.resultType !== "undefined" && typeof request.resultType !== "string") {
|
|
22888
|
+
throw new Error("Please provide the 'resultType' as a string!");
|
|
22889
|
+
}
|
|
22890
|
+
if (typeof request.displayName !== "undefined" && typeof request.displayName !== "string") {
|
|
22891
|
+
throw new Error("Please provide the 'displayName' as a string!");
|
|
22892
|
+
}
|
|
22893
|
+
if (typeof request.icon !== "undefined" && typeof request.icon !== "string") {
|
|
22894
|
+
throw new Error("Please provide the 'icon' as a string!");
|
|
22895
|
+
}
|
|
22896
|
+
if (typeof request.description !== "undefined" && typeof request.description !== "string") {
|
|
22897
|
+
throw new Error("Please provide the 'description' as a string!");
|
|
22898
|
+
}
|
|
22899
|
+
if (typeof request.customConfig !== "undefined" && (typeof request.customConfig !== "object" || Array.isArray(request.customConfig))) {
|
|
22900
|
+
throw new Error("Please provide the 'customConfig' as an object!");
|
|
22901
|
+
}
|
|
22902
|
+
};
|
|
22863
22903
|
|
|
22864
22904
|
class Intents {
|
|
22865
22905
|
constructor(interop, windows, logger, options, prefsController, appsController) {
|
|
@@ -22964,7 +23004,8 @@
|
|
|
22964
23004
|
contextTypes: intentDef.contexts,
|
|
22965
23005
|
applicationIcon: app.icon,
|
|
22966
23006
|
type: "app",
|
|
22967
|
-
resultType: intentDef.resultType
|
|
23007
|
+
resultType: intentDef.resultType,
|
|
23008
|
+
customConfig: intentDef === null || intentDef === void 0 ? void 0 : intentDef.customConfig,
|
|
22968
23009
|
};
|
|
22969
23010
|
intent.handlers.push(handler);
|
|
22970
23011
|
}
|
|
@@ -23045,9 +23086,7 @@
|
|
|
23045
23086
|
return result;
|
|
23046
23087
|
}
|
|
23047
23088
|
async register(intent, handler) {
|
|
23048
|
-
|
|
23049
|
-
throw new Error("Please provide the intent as a string or an object with an intent property!");
|
|
23050
|
-
}
|
|
23089
|
+
validateAddIntentListenerRequest(intent);
|
|
23051
23090
|
if (typeof handler !== "function") {
|
|
23052
23091
|
throw new Error("Please provide the handler as a function!");
|
|
23053
23092
|
}
|
|
@@ -23750,7 +23789,8 @@
|
|
|
23750
23789
|
contextTypes: info.contextTypes || (appIntent === null || appIntent === void 0 ? void 0 : appIntent.contexts),
|
|
23751
23790
|
instanceTitle: title,
|
|
23752
23791
|
type: "instance",
|
|
23753
|
-
resultType: (appIntent === null || appIntent === void 0 ? void 0 : appIntent.resultType) || info.resultType
|
|
23792
|
+
resultType: (appIntent === null || appIntent === void 0 ? void 0 : appIntent.resultType) || info.resultType,
|
|
23793
|
+
customConfig: info === null || info === void 0 ? void 0 : info.customConfig
|
|
23754
23794
|
};
|
|
23755
23795
|
return handler;
|
|
23756
23796
|
}
|
|
@@ -23763,7 +23803,8 @@
|
|
|
23763
23803
|
contextTypes: intent.contexts,
|
|
23764
23804
|
applicationIcon: app.icon,
|
|
23765
23805
|
type: "app",
|
|
23766
|
-
resultType: intent.resultType
|
|
23806
|
+
resultType: intent.resultType,
|
|
23807
|
+
customConfig: intent === null || intent === void 0 ? void 0 : intent.customConfig
|
|
23767
23808
|
};
|
|
23768
23809
|
}
|
|
23769
23810
|
}
|