@interopio/desktop 6.10.2 → 6.11.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 +6 -6
- package/desktop.d.ts +20 -4
- package/dist/desktop.browser.js +502 -334
- 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 +502 -334
- package/dist/desktop.es.js.map +1 -1
- package/dist/desktop.umd.js +502 -334
- 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 +50 -51
package/dist/desktop.browser.js
CHANGED
|
@@ -2944,7 +2944,7 @@
|
|
|
2944
2944
|
}
|
|
2945
2945
|
};
|
|
2946
2946
|
|
|
2947
|
-
var version$1 = "6.5.2
|
|
2947
|
+
var version$1 = "6.5.2";
|
|
2948
2948
|
|
|
2949
2949
|
function prepareConfig$1 (configuration, ext, glue42gd) {
|
|
2950
2950
|
let nodeStartingContext;
|
|
@@ -5664,10 +5664,7 @@
|
|
|
5664
5664
|
this._contextIdToName = {};
|
|
5665
5665
|
delete this._protocolVersion;
|
|
5666
5666
|
this._contextsTempCache = Object.keys(this._contextNameToData).reduce((cacheSoFar, ctxName) => {
|
|
5667
|
-
|
|
5668
|
-
if (contextData.isAnnounced && (contextData.activityId || contextData.sentExplicitSubscription)) {
|
|
5669
|
-
cacheSoFar[ctxName] = this._contextNameToData[ctxName].context;
|
|
5670
|
-
}
|
|
5667
|
+
cacheSoFar[ctxName] = this._contextNameToData[ctxName].context;
|
|
5671
5668
|
return cacheSoFar;
|
|
5672
5669
|
}, {});
|
|
5673
5670
|
this._contextNameToData = {};
|
|
@@ -11596,6 +11593,164 @@
|
|
|
11596
11593
|
}
|
|
11597
11594
|
}
|
|
11598
11595
|
|
|
11596
|
+
const INTEROP_METHOD_RESPONSE_TIMEOUT_MS = 90000;
|
|
11597
|
+
const INTEROP_METHOD_WAIT_TIMEOUT_MS = 90000;
|
|
11598
|
+
|
|
11599
|
+
// This alphabet uses `A-Za-z0-9_-` symbols.
|
|
11600
|
+
// The order of characters is optimized for better gzip and brotli compression.
|
|
11601
|
+
// References to the same file (works both for gzip and brotli):
|
|
11602
|
+
// `'use`, `andom`, and `rict'`
|
|
11603
|
+
// References to the brotli default dictionary:
|
|
11604
|
+
// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`
|
|
11605
|
+
let urlAlphabet =
|
|
11606
|
+
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
11607
|
+
|
|
11608
|
+
let nanoid = (size = 21) => {
|
|
11609
|
+
let id = '';
|
|
11610
|
+
// A compact alternative for `for (var i = 0; i < step; i++)`.
|
|
11611
|
+
let i = size | 0;
|
|
11612
|
+
while (i--) {
|
|
11613
|
+
// `| 0` is more compact and faster than `Math.floor()`.
|
|
11614
|
+
id += urlAlphabet[(Math.random() * 64) | 0];
|
|
11615
|
+
}
|
|
11616
|
+
return id
|
|
11617
|
+
};
|
|
11618
|
+
|
|
11619
|
+
class Utils {
|
|
11620
|
+
static getGDMajorVersion() {
|
|
11621
|
+
if (typeof window === "undefined") {
|
|
11622
|
+
return -1;
|
|
11623
|
+
}
|
|
11624
|
+
if (!window.glueDesktop) {
|
|
11625
|
+
return -1;
|
|
11626
|
+
}
|
|
11627
|
+
if (!window.glueDesktop.version) {
|
|
11628
|
+
return -1;
|
|
11629
|
+
}
|
|
11630
|
+
const parsed = window.glueDesktop.version.split(".");
|
|
11631
|
+
const major = Number(parsed[0]);
|
|
11632
|
+
return isNaN(major) ? -1 : major;
|
|
11633
|
+
}
|
|
11634
|
+
static typedError(error) {
|
|
11635
|
+
let err;
|
|
11636
|
+
if (error instanceof Error) {
|
|
11637
|
+
err = error;
|
|
11638
|
+
}
|
|
11639
|
+
else if (typeof error === "string") {
|
|
11640
|
+
err = new Error(error);
|
|
11641
|
+
}
|
|
11642
|
+
else if ("message" in error && typeof error.message === "string" && error.message.length > 0) {
|
|
11643
|
+
err = new Error(error.message);
|
|
11644
|
+
}
|
|
11645
|
+
else if ("returned" in error
|
|
11646
|
+
&& typeof error.returned === "object"
|
|
11647
|
+
&& "errorMsg" in error.returned
|
|
11648
|
+
&& typeof error.returned.errorMsg === "string"
|
|
11649
|
+
&& error.returned.errorMsg.length > 0) {
|
|
11650
|
+
err = new Error(error.returned.errorMsg);
|
|
11651
|
+
}
|
|
11652
|
+
else {
|
|
11653
|
+
err = new Error("Unknown error");
|
|
11654
|
+
}
|
|
11655
|
+
return err;
|
|
11656
|
+
}
|
|
11657
|
+
static async callbackifyPromise(action, successCallback, errorCallback) {
|
|
11658
|
+
const success = (result) => {
|
|
11659
|
+
if (typeof successCallback === "function") {
|
|
11660
|
+
successCallback(result);
|
|
11661
|
+
}
|
|
11662
|
+
return Promise.resolve(result);
|
|
11663
|
+
};
|
|
11664
|
+
const fail = (error) => {
|
|
11665
|
+
const err = Utils.typedError(error);
|
|
11666
|
+
if (typeof errorCallback === "function") {
|
|
11667
|
+
errorCallback(err.message);
|
|
11668
|
+
return;
|
|
11669
|
+
}
|
|
11670
|
+
return Promise.reject(err);
|
|
11671
|
+
};
|
|
11672
|
+
try {
|
|
11673
|
+
const result = await action();
|
|
11674
|
+
return success(result);
|
|
11675
|
+
}
|
|
11676
|
+
catch (error) {
|
|
11677
|
+
return fail(error);
|
|
11678
|
+
}
|
|
11679
|
+
}
|
|
11680
|
+
static getMonitor(bounds, displays) {
|
|
11681
|
+
const monitorsSortedByOverlap = displays.map((m) => {
|
|
11682
|
+
const { left, top, workingAreaWidth: width, workingAreaHeight: height } = m;
|
|
11683
|
+
const overlap = this.calculateTotalOverlap({ left, top, width, height }, bounds);
|
|
11684
|
+
return {
|
|
11685
|
+
monitor: m,
|
|
11686
|
+
totalOverlap: overlap
|
|
11687
|
+
};
|
|
11688
|
+
}).sort((a, b) => b.totalOverlap - a.totalOverlap);
|
|
11689
|
+
return monitorsSortedByOverlap[0].monitor;
|
|
11690
|
+
}
|
|
11691
|
+
static getDisplayCenterOfScreen(a, currentDisplay, primaryDisplay) {
|
|
11692
|
+
const physicalWidth = a.width / currentDisplay.scaleFactor;
|
|
11693
|
+
const physicalHeight = a.height / currentDisplay.scaleFactor;
|
|
11694
|
+
const physicalDisplayLeft = currentDisplay.workArea.left / primaryDisplay.scaleFactor;
|
|
11695
|
+
const physicalDisplayTop = currentDisplay.workArea.top / primaryDisplay.scaleFactor;
|
|
11696
|
+
const physicalDisplayWidth = currentDisplay.workArea.width / currentDisplay.scaleFactor;
|
|
11697
|
+
const physicalDisplayHeight = currentDisplay.workArea.height / currentDisplay.scaleFactor;
|
|
11698
|
+
const physicalHOffset = Math.max((physicalDisplayWidth - physicalWidth) / 2, 0);
|
|
11699
|
+
const physicalVOffset = Math.max((physicalDisplayHeight - physicalHeight) / 2, 0);
|
|
11700
|
+
const centeredPhysicalLeft = Math.floor(physicalDisplayLeft + physicalHOffset);
|
|
11701
|
+
const centeredPhysicalTop = Math.floor(physicalDisplayTop + physicalVOffset);
|
|
11702
|
+
const left = centeredPhysicalLeft * primaryDisplay.scaleFactor;
|
|
11703
|
+
const top = centeredPhysicalTop * primaryDisplay.scaleFactor;
|
|
11704
|
+
return {
|
|
11705
|
+
left,
|
|
11706
|
+
top,
|
|
11707
|
+
width: a.width,
|
|
11708
|
+
height: a.height
|
|
11709
|
+
};
|
|
11710
|
+
}
|
|
11711
|
+
static isNode() {
|
|
11712
|
+
if (typeof Utils._isNode !== "undefined") {
|
|
11713
|
+
return Utils._isNode;
|
|
11714
|
+
}
|
|
11715
|
+
if (typeof window !== "undefined") {
|
|
11716
|
+
Utils._isNode = false;
|
|
11717
|
+
return false;
|
|
11718
|
+
}
|
|
11719
|
+
try {
|
|
11720
|
+
Utils._isNode = Object.prototype.toString.call(global.process) === "[object process]";
|
|
11721
|
+
}
|
|
11722
|
+
catch (e) {
|
|
11723
|
+
Utils._isNode = false;
|
|
11724
|
+
}
|
|
11725
|
+
return Utils._isNode;
|
|
11726
|
+
}
|
|
11727
|
+
static generateId() {
|
|
11728
|
+
return nanoid(10);
|
|
11729
|
+
}
|
|
11730
|
+
static isPromise(value) {
|
|
11731
|
+
return Boolean(value && typeof value.then === 'function');
|
|
11732
|
+
}
|
|
11733
|
+
static isAsyncFunction(value) {
|
|
11734
|
+
return value && {}.toString.call(value) === '[object AsyncFunction]';
|
|
11735
|
+
}
|
|
11736
|
+
static isNullOrUndefined(value) {
|
|
11737
|
+
return value === null || value === undefined;
|
|
11738
|
+
}
|
|
11739
|
+
static calculateTotalOverlap(r1, r2) {
|
|
11740
|
+
const r1x = r1.left;
|
|
11741
|
+
const r1y = r1.top;
|
|
11742
|
+
const r1xMax = r1x + r1.width;
|
|
11743
|
+
const r1yMax = r1y + r1.height;
|
|
11744
|
+
const r2x = r2.left;
|
|
11745
|
+
const r2y = r2.top;
|
|
11746
|
+
const r2xMax = r2x + r2.width;
|
|
11747
|
+
const r2yMax = r2y + r2.height;
|
|
11748
|
+
const xOverlap = Math.max(0, Math.min(r1xMax, r2xMax) - Math.max(r1x, r2x));
|
|
11749
|
+
const yOverlap = Math.max(0, Math.min(r1yMax, r2yMax) - Math.max(r1y, r2y));
|
|
11750
|
+
return xOverlap * yOverlap;
|
|
11751
|
+
}
|
|
11752
|
+
}
|
|
11753
|
+
|
|
11599
11754
|
class ApplicationImpl {
|
|
11600
11755
|
constructor(_appManager, _name, _agm, _logger, _configuration) {
|
|
11601
11756
|
this._appManager = _appManager;
|
|
@@ -11725,7 +11880,10 @@
|
|
|
11725
11880
|
return "flat";
|
|
11726
11881
|
}
|
|
11727
11882
|
async getConfiguration() {
|
|
11728
|
-
const result = await this._agm.invoke(GetApplicationsMethodName, { v2: { apps: [this._name] } }
|
|
11883
|
+
const result = await this._agm.invoke(GetApplicationsMethodName, { v2: { apps: [this._name] } }, "best", {
|
|
11884
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
11885
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
11886
|
+
});
|
|
11729
11887
|
const config = result.returned.applications[0];
|
|
11730
11888
|
return config;
|
|
11731
11889
|
}
|
|
@@ -11739,7 +11897,7 @@
|
|
|
11739
11897
|
}
|
|
11740
11898
|
start(context, options) {
|
|
11741
11899
|
return new Promise(async (resolve, reject) => {
|
|
11742
|
-
var _a, _b, _c, _d
|
|
11900
|
+
var _a, _b, _c, _d;
|
|
11743
11901
|
if (isUndefinedOrNull(context)) {
|
|
11744
11902
|
context = {};
|
|
11745
11903
|
}
|
|
@@ -11783,7 +11941,13 @@
|
|
|
11783
11941
|
resolve(i);
|
|
11784
11942
|
};
|
|
11785
11943
|
if (waitForAGMInstance) {
|
|
11786
|
-
|
|
11944
|
+
const instance = this._appManager.instances().find((i) => i.id === id);
|
|
11945
|
+
if (instance) {
|
|
11946
|
+
unsub = instance.onAgmReady(waitFunc);
|
|
11947
|
+
}
|
|
11948
|
+
else {
|
|
11949
|
+
unsub = this._appManager.onInstanceAgmServerReady(waitFunc);
|
|
11950
|
+
}
|
|
11787
11951
|
}
|
|
11788
11952
|
else {
|
|
11789
11953
|
unsub = this._appManager.onInstanceStarted(waitFunc);
|
|
@@ -11796,7 +11960,8 @@
|
|
|
11796
11960
|
Context: context,
|
|
11797
11961
|
Options: options
|
|
11798
11962
|
}, "best", {
|
|
11799
|
-
methodResponseTimeoutMs: startTimeout
|
|
11963
|
+
methodResponseTimeoutMs: startTimeout,
|
|
11964
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
11800
11965
|
});
|
|
11801
11966
|
const acsResult = result.returned;
|
|
11802
11967
|
if (typeof acsResult.timeout !== "undefined" && typeof options.timeout === "undefined") {
|
|
@@ -11827,7 +11992,8 @@
|
|
|
11827
11992
|
}
|
|
11828
11993
|
}
|
|
11829
11994
|
catch (error) {
|
|
11830
|
-
|
|
11995
|
+
const err = Utils.typedError(error);
|
|
11996
|
+
reject(err);
|
|
11831
11997
|
}
|
|
11832
11998
|
});
|
|
11833
11999
|
}
|
|
@@ -12029,6 +12195,9 @@
|
|
|
12029
12195
|
this._agm.invoke(StopApplicationMethodName, {
|
|
12030
12196
|
Name: this._appName,
|
|
12031
12197
|
Id: this._id
|
|
12198
|
+
}, "best", {
|
|
12199
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12200
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12032
12201
|
})
|
|
12033
12202
|
.then(() => {
|
|
12034
12203
|
if (this._appManager.mode === "startOnly") {
|
|
@@ -12043,7 +12212,10 @@
|
|
|
12043
12212
|
});
|
|
12044
12213
|
}
|
|
12045
12214
|
activate() {
|
|
12046
|
-
return this._agm.invoke(ActivateApplicationMethodName, { Name: this._appName, Id: this._id }
|
|
12215
|
+
return this._agm.invoke(ActivateApplicationMethodName, { Name: this._appName, Id: this._id }, "best", {
|
|
12216
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12217
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12218
|
+
});
|
|
12047
12219
|
}
|
|
12048
12220
|
done() {
|
|
12049
12221
|
this._registry.clear();
|
|
@@ -12054,7 +12226,10 @@
|
|
|
12054
12226
|
return Promise.resolve(this.context);
|
|
12055
12227
|
}
|
|
12056
12228
|
async startedBy() {
|
|
12057
|
-
const result = await this._agm.invoke(ACSExecute, { command: "getStartedBy", Name: this._appName, Id: this._id }
|
|
12229
|
+
const result = await this._agm.invoke(ACSExecute, { command: "getStartedBy", Name: this._appName, Id: this._id }, "best", {
|
|
12230
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12231
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12232
|
+
});
|
|
12058
12233
|
return result.returned;
|
|
12059
12234
|
}
|
|
12060
12235
|
}
|
|
@@ -12082,7 +12257,10 @@
|
|
|
12082
12257
|
apps
|
|
12083
12258
|
};
|
|
12084
12259
|
}
|
|
12085
|
-
const result = await this._agm.invoke(GetApplicationsMethodName, args
|
|
12260
|
+
const result = await this._agm.invoke(GetApplicationsMethodName, args, "best", {
|
|
12261
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12262
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12263
|
+
});
|
|
12086
12264
|
return result.returned.applications;
|
|
12087
12265
|
};
|
|
12088
12266
|
this.application = (name) => {
|
|
@@ -12399,7 +12577,10 @@
|
|
|
12399
12577
|
args = args || {};
|
|
12400
12578
|
return new Promise((resolve, reject) => {
|
|
12401
12579
|
const errHandler = (error) => reject(error);
|
|
12402
|
-
this._agm.invoke(method, args
|
|
12580
|
+
this._agm.invoke(method, args, "best", {
|
|
12581
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12582
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12583
|
+
})
|
|
12403
12584
|
.then((result) => {
|
|
12404
12585
|
if (!transformFunction) {
|
|
12405
12586
|
transformFunction = (d) => d.returned;
|
|
@@ -12428,7 +12609,10 @@
|
|
|
12428
12609
|
|
|
12429
12610
|
function snapshot(interop, appManager) {
|
|
12430
12611
|
return new Promise((resolve, reject) => {
|
|
12431
|
-
interop.invoke(GetApplicationsMethodName, { skipIcon: true }
|
|
12612
|
+
interop.invoke(GetApplicationsMethodName, { skipIcon: true }, "best", {
|
|
12613
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12614
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12615
|
+
})
|
|
12432
12616
|
.then((response) => {
|
|
12433
12617
|
var _a;
|
|
12434
12618
|
const data = response.returned;
|
|
@@ -12443,7 +12627,7 @@
|
|
|
12443
12627
|
objectValues(applications).map((item) => appManager.handleAppAdded(item));
|
|
12444
12628
|
resolve(configuration);
|
|
12445
12629
|
})
|
|
12446
|
-
.catch((err) => reject(`Error getting application snapshot: ${err.message}`));
|
|
12630
|
+
.catch((err) => reject(new Error(`Error getting application snapshot: ${err.message}`)));
|
|
12447
12631
|
});
|
|
12448
12632
|
}
|
|
12449
12633
|
|
|
@@ -12553,10 +12737,10 @@
|
|
|
12553
12737
|
}
|
|
12554
12738
|
import(apps, mode) {
|
|
12555
12739
|
if (!apps || !Array.isArray(apps)) {
|
|
12556
|
-
return Promise.reject("invalid apps argument - should be an array of application definitions");
|
|
12740
|
+
return Promise.reject(new Error("invalid apps argument - should be an array of application definitions"));
|
|
12557
12741
|
}
|
|
12558
12742
|
if (mode && mode !== "replace" && mode !== "merge") {
|
|
12559
|
-
return Promise.reject("invalid mode argument - should be 'replace' or 'merge'");
|
|
12743
|
+
return Promise.reject(new Error("invalid mode argument - should be 'replace' or 'merge'"));
|
|
12560
12744
|
}
|
|
12561
12745
|
mode = mode !== null && mode !== void 0 ? mode : "replace";
|
|
12562
12746
|
const command = {
|
|
@@ -12566,16 +12750,22 @@
|
|
|
12566
12750
|
mode
|
|
12567
12751
|
}
|
|
12568
12752
|
};
|
|
12569
|
-
return this.interop.invoke(InMemoryStoreCommandMethodName, command
|
|
12753
|
+
return this.interop.invoke(InMemoryStoreCommandMethodName, command, "best", {
|
|
12754
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12755
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12756
|
+
})
|
|
12570
12757
|
.then((r) => r.returned);
|
|
12571
12758
|
}
|
|
12572
12759
|
export() {
|
|
12573
|
-
return this.interop.invoke(InMemoryStoreCommandMethodName, { command: "export" }
|
|
12760
|
+
return this.interop.invoke(InMemoryStoreCommandMethodName, { command: "export" }, "best", {
|
|
12761
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12762
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12763
|
+
})
|
|
12574
12764
|
.then((r) => r.returned.apps);
|
|
12575
12765
|
}
|
|
12576
12766
|
remove(app) {
|
|
12577
12767
|
if (!app || typeof app !== "string") {
|
|
12578
|
-
return Promise.reject("invalid app name, should be a string value");
|
|
12768
|
+
return Promise.reject(new Error("invalid app name, should be a string value"));
|
|
12579
12769
|
}
|
|
12580
12770
|
const command = {
|
|
12581
12771
|
command: "remove",
|
|
@@ -12583,13 +12773,19 @@
|
|
|
12583
12773
|
apps: [app]
|
|
12584
12774
|
}
|
|
12585
12775
|
};
|
|
12586
|
-
return this.interop.invoke(InMemoryStoreCommandMethodName, command
|
|
12776
|
+
return this.interop.invoke(InMemoryStoreCommandMethodName, command, "best", {
|
|
12777
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12778
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12779
|
+
}).then((r) => r.returned);
|
|
12587
12780
|
}
|
|
12588
12781
|
clear() {
|
|
12589
12782
|
const command = {
|
|
12590
12783
|
command: "clear"
|
|
12591
12784
|
};
|
|
12592
|
-
return this.interop.invoke(InMemoryStoreCommandMethodName, command
|
|
12785
|
+
return this.interop.invoke(InMemoryStoreCommandMethodName, command, "best", {
|
|
12786
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12787
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12788
|
+
}).then((r) => r.returned);
|
|
12593
12789
|
}
|
|
12594
12790
|
createAppDef(name, url) {
|
|
12595
12791
|
if (!url) {
|
|
@@ -12675,157 +12871,6 @@
|
|
|
12675
12871
|
return api;
|
|
12676
12872
|
};
|
|
12677
12873
|
|
|
12678
|
-
// This alphabet uses `A-Za-z0-9_-` symbols.
|
|
12679
|
-
// The order of characters is optimized for better gzip and brotli compression.
|
|
12680
|
-
// References to the same file (works both for gzip and brotli):
|
|
12681
|
-
// `'use`, `andom`, and `rict'`
|
|
12682
|
-
// References to the brotli default dictionary:
|
|
12683
|
-
// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`
|
|
12684
|
-
let urlAlphabet =
|
|
12685
|
-
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
12686
|
-
|
|
12687
|
-
let nanoid = (size = 21) => {
|
|
12688
|
-
let id = '';
|
|
12689
|
-
// A compact alternative for `for (var i = 0; i < step; i++)`.
|
|
12690
|
-
let i = size | 0;
|
|
12691
|
-
while (i--) {
|
|
12692
|
-
// `| 0` is more compact and faster than `Math.floor()`.
|
|
12693
|
-
id += urlAlphabet[(Math.random() * 64) | 0];
|
|
12694
|
-
}
|
|
12695
|
-
return id
|
|
12696
|
-
};
|
|
12697
|
-
|
|
12698
|
-
class Utils {
|
|
12699
|
-
static getGDMajorVersion() {
|
|
12700
|
-
if (typeof window === "undefined") {
|
|
12701
|
-
return -1;
|
|
12702
|
-
}
|
|
12703
|
-
if (!window.glueDesktop) {
|
|
12704
|
-
return -1;
|
|
12705
|
-
}
|
|
12706
|
-
if (!window.glueDesktop.version) {
|
|
12707
|
-
return -1;
|
|
12708
|
-
}
|
|
12709
|
-
const parsed = window.glueDesktop.version.split(".");
|
|
12710
|
-
const major = Number(parsed[0]);
|
|
12711
|
-
return isNaN(major) ? -1 : major;
|
|
12712
|
-
}
|
|
12713
|
-
static async callbackifyPromise(action, successCallback, errorCallback) {
|
|
12714
|
-
const success = (result) => {
|
|
12715
|
-
if (typeof successCallback === "function") {
|
|
12716
|
-
successCallback(result);
|
|
12717
|
-
}
|
|
12718
|
-
return Promise.resolve(result);
|
|
12719
|
-
};
|
|
12720
|
-
const fail = (error) => {
|
|
12721
|
-
let err;
|
|
12722
|
-
if (error instanceof Error) {
|
|
12723
|
-
err = error;
|
|
12724
|
-
}
|
|
12725
|
-
else if (typeof error === "string") {
|
|
12726
|
-
err = new Error(error);
|
|
12727
|
-
}
|
|
12728
|
-
else if ("message" in error && typeof error.message === "string" && error.message.length > 0) {
|
|
12729
|
-
err = new Error(error.message);
|
|
12730
|
-
}
|
|
12731
|
-
else if ("returned" in error
|
|
12732
|
-
&& typeof error.returned === "object"
|
|
12733
|
-
&& "errorMsg" in error.returned
|
|
12734
|
-
&& typeof error.returned.errorMsg === "string"
|
|
12735
|
-
&& error.returned.errorMsg.length > 0) {
|
|
12736
|
-
err = new Error(error.returned.errorMsg);
|
|
12737
|
-
}
|
|
12738
|
-
else {
|
|
12739
|
-
err = new Error("Unknown error");
|
|
12740
|
-
}
|
|
12741
|
-
if (typeof errorCallback === "function") {
|
|
12742
|
-
errorCallback(err.message);
|
|
12743
|
-
return;
|
|
12744
|
-
}
|
|
12745
|
-
return Promise.reject(err);
|
|
12746
|
-
};
|
|
12747
|
-
try {
|
|
12748
|
-
const result = await action();
|
|
12749
|
-
return success(result);
|
|
12750
|
-
}
|
|
12751
|
-
catch (error) {
|
|
12752
|
-
return fail(error);
|
|
12753
|
-
}
|
|
12754
|
-
}
|
|
12755
|
-
static getMonitor(bounds, displays) {
|
|
12756
|
-
const monitorsSortedByOverlap = displays.map((m) => {
|
|
12757
|
-
const { left, top, workingAreaWidth: width, workingAreaHeight: height } = m;
|
|
12758
|
-
const overlap = this.calculateTotalOverlap({ left, top, width, height }, bounds);
|
|
12759
|
-
return {
|
|
12760
|
-
monitor: m,
|
|
12761
|
-
totalOverlap: overlap
|
|
12762
|
-
};
|
|
12763
|
-
}).sort((a, b) => b.totalOverlap - a.totalOverlap);
|
|
12764
|
-
return monitorsSortedByOverlap[0].monitor;
|
|
12765
|
-
}
|
|
12766
|
-
static getDisplayCenterOfScreen(a, currentDisplay, primaryDisplay) {
|
|
12767
|
-
const physicalWidth = a.width / currentDisplay.scaleFactor;
|
|
12768
|
-
const physicalHeight = a.height / currentDisplay.scaleFactor;
|
|
12769
|
-
const physicalDisplayLeft = currentDisplay.workArea.left / primaryDisplay.scaleFactor;
|
|
12770
|
-
const physicalDisplayTop = currentDisplay.workArea.top / primaryDisplay.scaleFactor;
|
|
12771
|
-
const physicalDisplayWidth = currentDisplay.workArea.width / currentDisplay.scaleFactor;
|
|
12772
|
-
const physicalDisplayHeight = currentDisplay.workArea.height / currentDisplay.scaleFactor;
|
|
12773
|
-
const physicalHOffset = Math.max((physicalDisplayWidth - physicalWidth) / 2, 0);
|
|
12774
|
-
const physicalVOffset = Math.max((physicalDisplayHeight - physicalHeight) / 2, 0);
|
|
12775
|
-
const centeredPhysicalLeft = Math.floor(physicalDisplayLeft + physicalHOffset);
|
|
12776
|
-
const centeredPhysicalTop = Math.floor(physicalDisplayTop + physicalVOffset);
|
|
12777
|
-
const left = centeredPhysicalLeft * primaryDisplay.scaleFactor;
|
|
12778
|
-
const top = centeredPhysicalTop * primaryDisplay.scaleFactor;
|
|
12779
|
-
return {
|
|
12780
|
-
left,
|
|
12781
|
-
top,
|
|
12782
|
-
width: a.width,
|
|
12783
|
-
height: a.height
|
|
12784
|
-
};
|
|
12785
|
-
}
|
|
12786
|
-
static isNode() {
|
|
12787
|
-
if (typeof Utils._isNode !== "undefined") {
|
|
12788
|
-
return Utils._isNode;
|
|
12789
|
-
}
|
|
12790
|
-
if (typeof window !== "undefined") {
|
|
12791
|
-
Utils._isNode = false;
|
|
12792
|
-
return false;
|
|
12793
|
-
}
|
|
12794
|
-
try {
|
|
12795
|
-
Utils._isNode = Object.prototype.toString.call(global.process) === "[object process]";
|
|
12796
|
-
}
|
|
12797
|
-
catch (e) {
|
|
12798
|
-
Utils._isNode = false;
|
|
12799
|
-
}
|
|
12800
|
-
return Utils._isNode;
|
|
12801
|
-
}
|
|
12802
|
-
static generateId() {
|
|
12803
|
-
return nanoid(10);
|
|
12804
|
-
}
|
|
12805
|
-
static isPromise(value) {
|
|
12806
|
-
return Boolean(value && typeof value.then === 'function');
|
|
12807
|
-
}
|
|
12808
|
-
static isAsyncFunction(value) {
|
|
12809
|
-
return value && {}.toString.call(value) === '[object AsyncFunction]';
|
|
12810
|
-
}
|
|
12811
|
-
static isNullOrUndefined(value) {
|
|
12812
|
-
return value === null || value === undefined;
|
|
12813
|
-
}
|
|
12814
|
-
static calculateTotalOverlap(r1, r2) {
|
|
12815
|
-
const r1x = r1.left;
|
|
12816
|
-
const r1y = r1.top;
|
|
12817
|
-
const r1xMax = r1x + r1.width;
|
|
12818
|
-
const r1yMax = r1y + r1.height;
|
|
12819
|
-
const r2x = r2.left;
|
|
12820
|
-
const r2y = r2.top;
|
|
12821
|
-
const r2xMax = r2x + r2.width;
|
|
12822
|
-
const r2yMax = r2y + r2.height;
|
|
12823
|
-
const xOverlap = Math.max(0, Math.min(r1xMax, r2xMax) - Math.max(r1x, r2x));
|
|
12824
|
-
const yOverlap = Math.max(0, Math.min(r1yMax, r2yMax) - Math.max(r1y, r2y));
|
|
12825
|
-
return xOverlap * yOverlap;
|
|
12826
|
-
}
|
|
12827
|
-
}
|
|
12828
|
-
|
|
12829
12874
|
const T42JumpListAction = "T42.JumpList.Action";
|
|
12830
12875
|
class JumpListManager {
|
|
12831
12876
|
constructor() {
|
|
@@ -14707,7 +14752,10 @@
|
|
|
14707
14752
|
finishedResolve = resolve;
|
|
14708
14753
|
});
|
|
14709
14754
|
try {
|
|
14710
|
-
const result = await this.agm.invoke("T42.Wnd.Create", options, this.agmTarget
|
|
14755
|
+
const result = await this.agm.invoke("T42.Wnd.Create", options, this.agmTarget, {
|
|
14756
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
14757
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS
|
|
14758
|
+
});
|
|
14711
14759
|
if (result.returned === undefined) {
|
|
14712
14760
|
throw new Error("failed to execute T42.Wnd.Create - unknown reason");
|
|
14713
14761
|
}
|
|
@@ -15297,7 +15345,7 @@
|
|
|
15297
15345
|
const data = args.data;
|
|
15298
15346
|
if ("status" in data) {
|
|
15299
15347
|
if (data.status === "failed") {
|
|
15300
|
-
rej(data.message);
|
|
15348
|
+
rej(new Error(data.message));
|
|
15301
15349
|
}
|
|
15302
15350
|
else if (data.status === "successful") {
|
|
15303
15351
|
res(data.result);
|
|
@@ -15503,7 +15551,10 @@
|
|
|
15503
15551
|
});
|
|
15504
15552
|
});
|
|
15505
15553
|
const action = new Promise((resolve, reject) => {
|
|
15506
|
-
this.agm.invoke("T42.Wnd.Execute", params, this.agmTarget
|
|
15554
|
+
this.agm.invoke("T42.Wnd.Execute", params, this.agmTarget, {
|
|
15555
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
15556
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS
|
|
15557
|
+
})
|
|
15507
15558
|
.then((i) => {
|
|
15508
15559
|
if (i.returned && i.returned.errorMsg) {
|
|
15509
15560
|
reject(i);
|
|
@@ -15557,17 +15608,30 @@
|
|
|
15557
15608
|
});
|
|
15558
15609
|
const execute = new Promise((resolve, reject) => {
|
|
15559
15610
|
options.token = token;
|
|
15611
|
+
if (!invocationOptions) {
|
|
15612
|
+
invocationOptions = {
|
|
15613
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
15614
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS
|
|
15615
|
+
};
|
|
15616
|
+
}
|
|
15617
|
+
else if (!invocationOptions.methodResponseTimeoutMs) {
|
|
15618
|
+
invocationOptions.methodResponseTimeoutMs = INTEROP_METHOD_RESPONSE_TIMEOUT_MS;
|
|
15619
|
+
}
|
|
15620
|
+
else if (!invocationOptions.waitTimeoutMs) {
|
|
15621
|
+
invocationOptions.waitTimeoutMs = INTEROP_METHOD_WAIT_TIMEOUT_MS;
|
|
15622
|
+
}
|
|
15560
15623
|
this.agm.invoke(methodName, options, this.agmTarget, invocationOptions)
|
|
15561
15624
|
.then((i) => {
|
|
15562
15625
|
if (i.returned && i.returned.errorMsg) {
|
|
15563
|
-
reject(i);
|
|
15626
|
+
reject(new Error(i.returned.errorMsg));
|
|
15564
15627
|
}
|
|
15565
15628
|
else {
|
|
15566
15629
|
resolve(i.returned);
|
|
15567
15630
|
}
|
|
15568
15631
|
})
|
|
15569
|
-
.catch((
|
|
15570
|
-
|
|
15632
|
+
.catch((e) => {
|
|
15633
|
+
const error = Utils.typedError(e);
|
|
15634
|
+
reject(error);
|
|
15571
15635
|
});
|
|
15572
15636
|
});
|
|
15573
15637
|
const result = await Promise.all([execute, event]);
|
|
@@ -15720,13 +15784,6 @@
|
|
|
15720
15784
|
myGroup() {
|
|
15721
15785
|
return this._groupId;
|
|
15722
15786
|
}
|
|
15723
|
-
execute(command, windowId, options) {
|
|
15724
|
-
return this._agm.invoke("T42.Wnd.Execute", {
|
|
15725
|
-
command,
|
|
15726
|
-
options,
|
|
15727
|
-
windowId,
|
|
15728
|
-
});
|
|
15729
|
-
}
|
|
15730
15787
|
onCompositionChanged(callback) {
|
|
15731
15788
|
return this._registry.add("composition-changed", callback);
|
|
15732
15789
|
}
|
|
@@ -16972,84 +17029,83 @@
|
|
|
16972
17029
|
|
|
16973
17030
|
var application = {};
|
|
16974
17031
|
|
|
16975
|
-
/**
|
|
16976
|
-
* This file was automatically generated by json-schema-to-typescript.
|
|
16977
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
16978
|
-
* and run json-schema-to-typescript to regenerate this file.
|
|
16979
|
-
*/
|
|
17032
|
+
/**
|
|
17033
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
17034
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
17035
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
17036
|
+
*/
|
|
16980
17037
|
Object.defineProperty(application, "__esModule", { value: true });
|
|
16981
17038
|
|
|
16982
17039
|
var system = {};
|
|
16983
17040
|
|
|
16984
|
-
/**
|
|
16985
|
-
* This file was automatically generated by json-schema-to-typescript.
|
|
16986
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
16987
|
-
* and run json-schema-to-typescript to regenerate this file.
|
|
16988
|
-
*/
|
|
17041
|
+
/**
|
|
17042
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
17043
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
17044
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
17045
|
+
*/
|
|
16989
17046
|
Object.defineProperty(system, "__esModule", { value: true });
|
|
16990
17047
|
|
|
16991
17048
|
var layout = {};
|
|
16992
17049
|
|
|
16993
|
-
(
|
|
16994
|
-
|
|
16995
|
-
|
|
16996
|
-
|
|
16997
|
-
|
|
16998
|
-
|
|
16999
|
-
|
|
17000
|
-
|
|
17001
|
-
|
|
17002
|
-
|
|
17003
|
-
|
|
17004
|
-
|
|
17005
|
-
|
|
17006
|
-
|
|
17007
|
-
|
|
17008
|
-
|
|
17009
|
-
} (layout));
|
|
17050
|
+
Object.defineProperty(layout, "__esModule", { value: true });
|
|
17051
|
+
layout.SwimlaneItemType = layout.LayoutType = void 0;
|
|
17052
|
+
var LayoutType;
|
|
17053
|
+
(function (LayoutType) {
|
|
17054
|
+
LayoutType["Global"] = "Global";
|
|
17055
|
+
LayoutType["Activity"] = "Activity";
|
|
17056
|
+
LayoutType["ApplicationDefault"] = "ApplicationDefault";
|
|
17057
|
+
LayoutType["Swimlane"] = "Swimlane";
|
|
17058
|
+
LayoutType["Workspaces"] = "Workspace";
|
|
17059
|
+
})(LayoutType || (layout.LayoutType = LayoutType = {}));
|
|
17060
|
+
var SwimlaneItemType;
|
|
17061
|
+
(function (SwimlaneItemType) {
|
|
17062
|
+
SwimlaneItemType["Tab"] = "tab";
|
|
17063
|
+
SwimlaneItemType["Window"] = "window";
|
|
17064
|
+
SwimlaneItemType["Canvas"] = "canvas";
|
|
17065
|
+
})(SwimlaneItemType || (layout.SwimlaneItemType = SwimlaneItemType = {}));
|
|
17010
17066
|
|
|
17011
17067
|
var swTheme = {};
|
|
17012
17068
|
|
|
17013
|
-
/**
|
|
17014
|
-
* This file was automatically generated by json-schema-to-typescript.
|
|
17015
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
17016
|
-
* and run json-schema-to-typescript to regenerate this file.
|
|
17017
|
-
*/
|
|
17069
|
+
/**
|
|
17070
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
17071
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
17072
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
17073
|
+
*/
|
|
17018
17074
|
Object.defineProperty(swTheme, "__esModule", { value: true });
|
|
17019
17075
|
|
|
17020
17076
|
var swConfiguration = {};
|
|
17021
17077
|
|
|
17022
|
-
/**
|
|
17023
|
-
* This file was automatically generated by json-schema-to-typescript.
|
|
17024
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
17025
|
-
* and run json-schema-to-typescript to regenerate this file.
|
|
17026
|
-
*/
|
|
17078
|
+
/**
|
|
17079
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
17080
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
17081
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
17082
|
+
*/
|
|
17027
17083
|
Object.defineProperty(swConfiguration, "__esModule", { value: true });
|
|
17028
17084
|
|
|
17029
17085
|
(function (exports) {
|
|
17030
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17031
|
-
if (k2 === undefined) k2 = k;
|
|
17032
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17033
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17034
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17035
|
-
}
|
|
17036
|
-
Object.defineProperty(o, k2, desc);
|
|
17037
|
-
}) : (function(o, m, k, k2) {
|
|
17038
|
-
if (k2 === undefined) k2 = k;
|
|
17039
|
-
o[k2] = m[k];
|
|
17040
|
-
}));
|
|
17041
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
17042
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17043
|
-
};
|
|
17044
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17045
|
-
// export { SchemaValidator } from "./validator";
|
|
17046
|
-
// export { FileProvider } from "./fileProvider";
|
|
17047
|
-
// export { SchemaProvider } from "./provider";
|
|
17048
|
-
__exportStar(application, exports);
|
|
17049
|
-
__exportStar(system, exports);
|
|
17050
|
-
__exportStar(layout, exports);
|
|
17051
|
-
__exportStar(swTheme, exports);
|
|
17052
|
-
__exportStar(swConfiguration, exports);
|
|
17086
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17087
|
+
if (k2 === undefined) k2 = k;
|
|
17088
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17089
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17090
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17091
|
+
}
|
|
17092
|
+
Object.defineProperty(o, k2, desc);
|
|
17093
|
+
}) : (function(o, m, k, k2) {
|
|
17094
|
+
if (k2 === undefined) k2 = k;
|
|
17095
|
+
o[k2] = m[k];
|
|
17096
|
+
}));
|
|
17097
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
17098
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17099
|
+
};
|
|
17100
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17101
|
+
// export { SchemaValidator } from "./validator";
|
|
17102
|
+
// export { FileProvider } from "./fileProvider";
|
|
17103
|
+
// export { SchemaProvider } from "./provider";
|
|
17104
|
+
__exportStar(application, exports);
|
|
17105
|
+
__exportStar(system, exports);
|
|
17106
|
+
__exportStar(layout, exports);
|
|
17107
|
+
__exportStar(swTheme, exports);
|
|
17108
|
+
__exportStar(swConfiguration, exports);
|
|
17053
17109
|
|
|
17054
17110
|
} (main));
|
|
17055
17111
|
|
|
@@ -17405,7 +17461,7 @@
|
|
|
17405
17461
|
updateAppContextInCurrent(context) {
|
|
17406
17462
|
return new Promise((resolve, reject) => {
|
|
17407
17463
|
if (context && typeof context !== "object") {
|
|
17408
|
-
return reject(new Error("
|
|
17464
|
+
return reject(new Error("Context must be an object"));
|
|
17409
17465
|
}
|
|
17410
17466
|
context = context !== null && context !== void 0 ? context : {};
|
|
17411
17467
|
const request = {
|
|
@@ -17417,7 +17473,7 @@
|
|
|
17417
17473
|
updateDefaultContext(context) {
|
|
17418
17474
|
return new Promise((resolve, reject) => {
|
|
17419
17475
|
if (context && typeof context !== "object") {
|
|
17420
|
-
return reject(new Error("
|
|
17476
|
+
return reject(new Error("Context must be an object"));
|
|
17421
17477
|
}
|
|
17422
17478
|
context = context !== null && context !== void 0 ? context : {};
|
|
17423
17479
|
const request = {
|
|
@@ -17504,6 +17560,13 @@
|
|
|
17504
17560
|
.catch((err) => reject(err));
|
|
17505
17561
|
}
|
|
17506
17562
|
async invokeMethodCore(methodName, args, target, options) {
|
|
17563
|
+
options = options !== null && options !== void 0 ? options : {};
|
|
17564
|
+
if (typeof options.methodResponseTimeoutMs === "undefined") {
|
|
17565
|
+
options.methodResponseTimeoutMs = INTEROP_METHOD_WAIT_TIMEOUT_MS;
|
|
17566
|
+
}
|
|
17567
|
+
if (typeof options.waitTimeoutMs === "undefined") {
|
|
17568
|
+
options.waitTimeoutMs = INTEROP_METHOD_WAIT_TIMEOUT_MS;
|
|
17569
|
+
}
|
|
17507
17570
|
if (this.isCommandMethodPresent()) {
|
|
17508
17571
|
return await this.config.agm.invoke(LayoutsCommandMethod, { command: methodName, data: args }, target, options);
|
|
17509
17572
|
}
|
|
@@ -17684,16 +17747,6 @@
|
|
|
17684
17747
|
}
|
|
17685
17748
|
}
|
|
17686
17749
|
|
|
17687
|
-
function streamNull () {
|
|
17688
|
-
return {
|
|
17689
|
-
ready: Promise.resolve(undefined),
|
|
17690
|
-
subscribe: () => { },
|
|
17691
|
-
onEvent: (callback) => () => { },
|
|
17692
|
-
waitFor: (token, timeout) => Promise.resolve(undefined),
|
|
17693
|
-
gotSnapshot: Promise.resolve(undefined),
|
|
17694
|
-
};
|
|
17695
|
-
}
|
|
17696
|
-
|
|
17697
17750
|
function LayoutsFactory (config) {
|
|
17698
17751
|
if (!config.agm) {
|
|
17699
17752
|
throw Error("config.agm is required");
|
|
@@ -17708,9 +17761,6 @@
|
|
|
17708
17761
|
if (config.mode === "full" || "fullWaitSnapshot") {
|
|
17709
17762
|
acsStream = new ACSStream(config.agm, callbacks);
|
|
17710
17763
|
}
|
|
17711
|
-
else {
|
|
17712
|
-
acsStream = streamNull();
|
|
17713
|
-
}
|
|
17714
17764
|
return new LayoutsAPIImpl(config, acsStream, callbacks, logger);
|
|
17715
17765
|
}
|
|
17716
17766
|
|
|
@@ -17747,7 +17797,10 @@
|
|
|
17747
17797
|
return point;
|
|
17748
17798
|
};
|
|
17749
17799
|
this.callGD = async (command, options) => {
|
|
17750
|
-
const invocationResult = await this._agm.invoke(T42DisplayCommand, { options: { ...options }, command }
|
|
17800
|
+
const invocationResult = await this._agm.invoke(T42DisplayCommand, { options: { ...options }, command }, "best", {
|
|
17801
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
17802
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
17803
|
+
});
|
|
17751
17804
|
return invocationResult.returned.data;
|
|
17752
17805
|
};
|
|
17753
17806
|
this.decorateDisplay = (original) => {
|
|
@@ -17942,61 +17995,42 @@
|
|
|
17942
17995
|
}
|
|
17943
17996
|
throw new Error(`unknown command ${command}`);
|
|
17944
17997
|
});
|
|
17945
|
-
const result = await interop.invoke(T42_ANNOUNCE_METHOD_NAME, { swId: windowId, instance: interop.instance.instance }
|
|
17998
|
+
const result = await interop.invoke(T42_ANNOUNCE_METHOD_NAME, { swId: windowId, instance: interop.instance.instance }, "best", {
|
|
17999
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
18000
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS
|
|
18001
|
+
});
|
|
17946
18002
|
if ((_a = result.returned) === null || _a === void 0 ? void 0 : _a.restrictions) {
|
|
17947
18003
|
channels.handleRestrictionsChanged((_b = result.returned) === null || _b === void 0 ? void 0 : _b.restrictions, windowId);
|
|
17948
18004
|
}
|
|
17949
18005
|
}
|
|
17950
18006
|
async function sendLeaveChannel(channel, winId) {
|
|
17951
|
-
await
|
|
17952
|
-
swId: winId !== null && winId !== void 0 ? winId : windowId,
|
|
17953
|
-
command: "leaveChannel",
|
|
17954
|
-
data: { channel }
|
|
17955
|
-
});
|
|
18007
|
+
await invoke("leaveChannel", { channel }, winId !== null && winId !== void 0 ? winId : windowId);
|
|
17956
18008
|
}
|
|
17957
18009
|
async function sendSwitchChannelUI(channel, winId) {
|
|
17958
|
-
await
|
|
17959
|
-
swId: winId !== null && winId !== void 0 ? winId : windowId,
|
|
17960
|
-
command: "switchChannel",
|
|
17961
|
-
data: { newChannel: channel }
|
|
17962
|
-
});
|
|
18010
|
+
await invoke("switchChannel", { newChannel: channel }, winId !== null && winId !== void 0 ? winId : windowId);
|
|
17963
18011
|
}
|
|
17964
18012
|
async function setRestrictions(restrictions) {
|
|
17965
18013
|
var _a;
|
|
17966
|
-
await
|
|
17967
|
-
swId: (_a = restrictions.windowId) !== null && _a !== void 0 ? _a : windowId,
|
|
17968
|
-
command: "restrict",
|
|
17969
|
-
data: restrictions
|
|
17970
|
-
});
|
|
17971
|
-
return;
|
|
18014
|
+
await invoke("restrict", restrictions, (_a = restrictions.windowId) !== null && _a !== void 0 ? _a : windowId);
|
|
17972
18015
|
}
|
|
17973
18016
|
async function getRestrictionsByWindow(id) {
|
|
17974
18017
|
try {
|
|
17975
|
-
const result = await
|
|
17976
|
-
swId: id !== null && id !== void 0 ? id : windowId,
|
|
17977
|
-
command: "getRestrictions"
|
|
17978
|
-
});
|
|
18018
|
+
const result = await invoke("getRestrictions", {}, id !== null && id !== void 0 ? id : windowId);
|
|
17979
18019
|
return result.returned;
|
|
17980
18020
|
}
|
|
17981
18021
|
catch (e) {
|
|
17982
|
-
return;
|
|
17983
18022
|
}
|
|
17984
18023
|
}
|
|
17985
18024
|
async function setRestrictionsForAllChannels(restrictions) {
|
|
17986
18025
|
var _a;
|
|
17987
|
-
await
|
|
17988
|
-
swId: (_a = restrictions.windowId) !== null && _a !== void 0 ? _a : windowId,
|
|
17989
|
-
command: "restrictAll",
|
|
17990
|
-
data: restrictions
|
|
17991
|
-
});
|
|
17992
|
-
return;
|
|
18026
|
+
await invoke("restrictAll", restrictions, (_a = restrictions.windowId) !== null && _a !== void 0 ? _a : windowId);
|
|
17993
18027
|
}
|
|
17994
18028
|
async function getWindowsWithChannels(filter) {
|
|
17995
|
-
const result = await
|
|
18029
|
+
const result = await invoke("getChannelsInfo", { filter });
|
|
17996
18030
|
return result.returned;
|
|
17997
18031
|
}
|
|
17998
18032
|
async function addOrRemoveChannel(command, id, color, label) {
|
|
17999
|
-
await
|
|
18033
|
+
await invoke(command, { id, color, label });
|
|
18000
18034
|
}
|
|
18001
18035
|
async function getChannelsMode(config, i) {
|
|
18002
18036
|
if (typeof config.operationMode !== "boolean" && typeof config.operationMode === "string") {
|
|
@@ -18004,7 +18038,10 @@
|
|
|
18004
18038
|
return config.operationMode;
|
|
18005
18039
|
}
|
|
18006
18040
|
try {
|
|
18007
|
-
const result = await i.invoke(T42_ANNOUNCE_METHOD_NAME, { command: "getChannelsMode" }
|
|
18041
|
+
const result = await i.invoke(T42_ANNOUNCE_METHOD_NAME, { command: "getChannelsMode" }, "best", {
|
|
18042
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
18043
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS,
|
|
18044
|
+
});
|
|
18008
18045
|
if (result.returned.mode === "single") {
|
|
18009
18046
|
return "single";
|
|
18010
18047
|
}
|
|
@@ -18019,6 +18056,16 @@
|
|
|
18019
18056
|
return "single";
|
|
18020
18057
|
}
|
|
18021
18058
|
}
|
|
18059
|
+
function invoke(command, data, swId) {
|
|
18060
|
+
const args = { command, data };
|
|
18061
|
+
if (swId) {
|
|
18062
|
+
args.swId = swId;
|
|
18063
|
+
}
|
|
18064
|
+
return interop.invoke(T42_ANNOUNCE_METHOD_NAME, args, "best", {
|
|
18065
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
18066
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS,
|
|
18067
|
+
});
|
|
18068
|
+
}
|
|
18022
18069
|
function validateMode(mode) {
|
|
18023
18070
|
if (mode !== "single" && mode !== "multi") {
|
|
18024
18071
|
throw new Error(`Invalid mode: ${mode}`);
|
|
@@ -18988,7 +19035,10 @@
|
|
|
18988
19035
|
await this.registerInvokeAGMMethod();
|
|
18989
19036
|
}
|
|
18990
19037
|
this.registry.add(hkToLower, callback);
|
|
18991
|
-
await this.agm.invoke(CommandMethod, { command: RegisterCommand, hotkey: hkToLower, description: info.description }
|
|
19038
|
+
await this.agm.invoke(CommandMethod, { command: RegisterCommand, hotkey: hkToLower, description: info.description }, "best", {
|
|
19039
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19040
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19041
|
+
});
|
|
18992
19042
|
this.hotkeys.set(hkToLower, info);
|
|
18993
19043
|
}
|
|
18994
19044
|
async unregister(hotkey) {
|
|
@@ -18999,12 +19049,18 @@
|
|
|
18999
19049
|
throw new Error("hotkey parameter must be string");
|
|
19000
19050
|
}
|
|
19001
19051
|
const hkToLower = this.formatHotkey(hotkey);
|
|
19002
|
-
await this.agm.invoke(CommandMethod, { command: UnregisterCommand, hotkey: hkToLower }
|
|
19052
|
+
await this.agm.invoke(CommandMethod, { command: UnregisterCommand, hotkey: hkToLower }, "best", {
|
|
19053
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19054
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19055
|
+
});
|
|
19003
19056
|
this.hotkeys.delete(hkToLower);
|
|
19004
19057
|
this.registry.clearKey(hkToLower);
|
|
19005
19058
|
}
|
|
19006
19059
|
async unregisterAll() {
|
|
19007
|
-
await this.agm.invoke(CommandMethod, { command: UnregisterAllCommand }
|
|
19060
|
+
await this.agm.invoke(CommandMethod, { command: UnregisterAllCommand }, "best", {
|
|
19061
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19062
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19063
|
+
});
|
|
19008
19064
|
this.hotkeys.clear();
|
|
19009
19065
|
this.registry.clear();
|
|
19010
19066
|
}
|
|
@@ -19037,7 +19093,7 @@
|
|
|
19037
19093
|
};
|
|
19038
19094
|
}
|
|
19039
19095
|
|
|
19040
|
-
var version = "6.
|
|
19096
|
+
var version = "6.11.0";
|
|
19041
19097
|
|
|
19042
19098
|
var prepareConfig = (options) => {
|
|
19043
19099
|
function getLibConfig(value, defaultMode, trueMode) {
|
|
@@ -19155,16 +19211,25 @@
|
|
|
19155
19211
|
return this.onStreamEvent("on-panel-visibility-changed", callback);
|
|
19156
19212
|
}
|
|
19157
19213
|
toggle() {
|
|
19158
|
-
return this.interop.invoke("T42.Notifications.Show"
|
|
19214
|
+
return this.interop.invoke("T42.Notifications.Show", undefined, "best", {
|
|
19215
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19216
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19217
|
+
});
|
|
19159
19218
|
}
|
|
19160
19219
|
show() {
|
|
19161
|
-
return this.interop.invoke("T42.Notifications.Show", { show: true }
|
|
19220
|
+
return this.interop.invoke("T42.Notifications.Show", { show: true }, "best", {
|
|
19221
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19222
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19223
|
+
});
|
|
19162
19224
|
}
|
|
19163
19225
|
hide() {
|
|
19164
19226
|
return this.interop.invoke("T42.Notifications.Hide");
|
|
19165
19227
|
}
|
|
19166
19228
|
async isVisible() {
|
|
19167
|
-
const interopResult = await this.interop.invoke("T42.Notifications.Execute", { command: "isPanelVisible" }
|
|
19229
|
+
const interopResult = await this.interop.invoke("T42.Notifications.Execute", { command: "isPanelVisible" }, "best", {
|
|
19230
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19231
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19232
|
+
});
|
|
19168
19233
|
return interopResult.returned.panelVisible;
|
|
19169
19234
|
}
|
|
19170
19235
|
toAPI() {
|
|
@@ -19186,6 +19251,7 @@
|
|
|
19186
19251
|
this.NotificationsCounterStream = "T42.Notifications.Counter";
|
|
19187
19252
|
this.RaiseNotificationMethodName = "T42.GNS.Publish.RaiseNotification";
|
|
19188
19253
|
this.NotificationsExecuteMethod = "T42.Notifications.Execute";
|
|
19254
|
+
this.NotificationFilterMethodName = "T42.Notifications.Filter";
|
|
19189
19255
|
this.methodsRegistered = false;
|
|
19190
19256
|
this.NOTIFICATIONS_CONFIGURE_METHOD_NAME = "T42.Notifications.Configure";
|
|
19191
19257
|
this.methodNameRoot = "T42.Notifications.Handler-" + Utils.generateId();
|
|
@@ -19213,7 +19279,10 @@
|
|
|
19213
19279
|
const g42notification = new Glue42Notification(options);
|
|
19214
19280
|
this.notifications[notification.id] = g42notification;
|
|
19215
19281
|
try {
|
|
19216
|
-
const invocationResult = await this.interop.invoke(this.RaiseNotificationMethodName, { notification }
|
|
19282
|
+
const invocationResult = await this.interop.invoke(this.RaiseNotificationMethodName, { notification }, "best", {
|
|
19283
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19284
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19285
|
+
});
|
|
19217
19286
|
g42notification.id = (_a = invocationResult.returned) === null || _a === void 0 ? void 0 : _a.id;
|
|
19218
19287
|
}
|
|
19219
19288
|
catch (err) {
|
|
@@ -19225,11 +19294,17 @@
|
|
|
19225
19294
|
return g42notification;
|
|
19226
19295
|
}
|
|
19227
19296
|
async setFilter(filter) {
|
|
19228
|
-
const result = await this.interop.invoke(
|
|
19297
|
+
const result = await this.interop.invoke(this.NotificationFilterMethodName, filter, "best", {
|
|
19298
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19299
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19300
|
+
});
|
|
19229
19301
|
return result.returned;
|
|
19230
19302
|
}
|
|
19231
19303
|
async getFilter() {
|
|
19232
|
-
const result = await this.interop.invoke(
|
|
19304
|
+
const result = await this.interop.invoke(this.NotificationFilterMethodName, undefined, "best", {
|
|
19305
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19306
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19307
|
+
});
|
|
19233
19308
|
return result.returned;
|
|
19234
19309
|
}
|
|
19235
19310
|
async configure(options) {
|
|
@@ -19279,15 +19354,27 @@
|
|
|
19279
19354
|
if (typeof options.closeNotificationOnClick !== "undefined" && typeof options.closeNotificationOnClick !== "boolean") {
|
|
19280
19355
|
throw new Error("Expected type of closeNotificationOnClick - boolean.");
|
|
19281
19356
|
}
|
|
19282
|
-
const result = await this.interop.invoke(this.NOTIFICATIONS_CONFIGURE_METHOD_NAME, options
|
|
19357
|
+
const result = await this.interop.invoke(this.NOTIFICATIONS_CONFIGURE_METHOD_NAME, options, "best", {
|
|
19358
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19359
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19360
|
+
});
|
|
19283
19361
|
return result.returned;
|
|
19284
19362
|
}
|
|
19285
19363
|
async getConfiguration() {
|
|
19286
|
-
const result = await this.interop.invoke(this.NotificationsExecuteMethod, { command: "getConfiguration" }
|
|
19364
|
+
const result = await this.interop.invoke(this.NotificationsExecuteMethod, { command: "getConfiguration" }, "best", {
|
|
19365
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19366
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19367
|
+
});
|
|
19287
19368
|
return result.returned;
|
|
19288
19369
|
}
|
|
19289
19370
|
async list() {
|
|
19290
|
-
const interopResult = await this.interop.invoke(this.NotificationsExecuteMethod, {
|
|
19371
|
+
const interopResult = await this.interop.invoke(this.NotificationsExecuteMethod, {
|
|
19372
|
+
command: "list",
|
|
19373
|
+
data: { statesVersion2: true }
|
|
19374
|
+
}, "best", {
|
|
19375
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19376
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19377
|
+
});
|
|
19291
19378
|
return interopResult.returned.notifications;
|
|
19292
19379
|
}
|
|
19293
19380
|
async updateData(id, data) {
|
|
@@ -19298,7 +19385,10 @@
|
|
|
19298
19385
|
stringValue: JSON.stringify(data, replacer)
|
|
19299
19386
|
}
|
|
19300
19387
|
};
|
|
19301
|
-
const interopResult = await this.interop.invoke(this.NotificationsExecuteMethod, { command: "create-or-update-attribute", data: { id, attribute } }
|
|
19388
|
+
const interopResult = await this.interop.invoke(this.NotificationsExecuteMethod, { command: "create-or-update-attribute", data: { id, attribute } }, "best", {
|
|
19389
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19390
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19391
|
+
});
|
|
19302
19392
|
return interopResult.returned;
|
|
19303
19393
|
}
|
|
19304
19394
|
onRaised(callback) {
|
|
@@ -19344,10 +19434,16 @@
|
|
|
19344
19434
|
};
|
|
19345
19435
|
}
|
|
19346
19436
|
async clearAll() {
|
|
19347
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearAll" }
|
|
19437
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearAll" }, "best", {
|
|
19438
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19439
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19440
|
+
});
|
|
19348
19441
|
}
|
|
19349
19442
|
async clearOld() {
|
|
19350
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearAllOld", data: { statesVersion2: true } }
|
|
19443
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearAllOld", data: { statesVersion2: true } }, "best", {
|
|
19444
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19445
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19446
|
+
});
|
|
19351
19447
|
}
|
|
19352
19448
|
async clear(id) {
|
|
19353
19449
|
if (!id) {
|
|
@@ -19356,17 +19452,29 @@
|
|
|
19356
19452
|
if (typeof (id) !== "string") {
|
|
19357
19453
|
throw new Error("The 'id' argument must be a string");
|
|
19358
19454
|
}
|
|
19359
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clear", data: { id } }
|
|
19455
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clear", data: { id } }, "best", {
|
|
19456
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19457
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19458
|
+
});
|
|
19360
19459
|
}
|
|
19361
19460
|
async clearMany(notifications) {
|
|
19362
19461
|
this.validateNotificationsArr(notifications);
|
|
19363
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearMany", data: { notifications } }
|
|
19462
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearMany", data: { notifications } }, "best", {
|
|
19463
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19464
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19465
|
+
});
|
|
19364
19466
|
}
|
|
19365
19467
|
async click(id, action, options) {
|
|
19366
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "click", data: { id, action, options } }
|
|
19468
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "click", data: { id, action, options } }, "best", {
|
|
19469
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19470
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19471
|
+
});
|
|
19367
19472
|
}
|
|
19368
19473
|
async snooze(id, duration) {
|
|
19369
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "snooze", data: { id, duration } }
|
|
19474
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "snooze", data: { id, duration } }, "best", {
|
|
19475
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19476
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19477
|
+
});
|
|
19370
19478
|
}
|
|
19371
19479
|
async snoozeMany(notifications, duration) {
|
|
19372
19480
|
if (!duration) {
|
|
@@ -19376,7 +19484,10 @@
|
|
|
19376
19484
|
throw new Error("The 'duration' argument must be a valid number");
|
|
19377
19485
|
}
|
|
19378
19486
|
this.validateNotificationsArr(notifications);
|
|
19379
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "snoozeMany", data: { notifications, duration } }
|
|
19487
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "snoozeMany", data: { notifications, duration } }, "best", {
|
|
19488
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19489
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19490
|
+
});
|
|
19380
19491
|
}
|
|
19381
19492
|
async setState(id, state) {
|
|
19382
19493
|
if (!id) {
|
|
@@ -19389,7 +19500,10 @@
|
|
|
19389
19500
|
throw new Error("The 'state' argument cannot be null or undefined");
|
|
19390
19501
|
}
|
|
19391
19502
|
this.validateState(state);
|
|
19392
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "updateState", data: { id, state } }
|
|
19503
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "updateState", data: { id, state } }, "best", {
|
|
19504
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19505
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19506
|
+
});
|
|
19393
19507
|
}
|
|
19394
19508
|
async setStates(notifications, state) {
|
|
19395
19509
|
if (!state) {
|
|
@@ -19399,7 +19513,10 @@
|
|
|
19399
19513
|
throw new Error("The 'state' argument must be a valid string");
|
|
19400
19514
|
}
|
|
19401
19515
|
this.validateNotificationsArr(notifications);
|
|
19402
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "updateStates", data: { notifications, state } }
|
|
19516
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "updateStates", data: { notifications, state } }, "best", {
|
|
19517
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19518
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19519
|
+
});
|
|
19403
19520
|
}
|
|
19404
19521
|
toAPI() {
|
|
19405
19522
|
return {
|
|
@@ -19435,7 +19552,10 @@
|
|
|
19435
19552
|
throw new Error("Notifications argument must be a valid array with notification options");
|
|
19436
19553
|
}
|
|
19437
19554
|
const notificationsToImport = await Promise.all(notifications.map((notificationOptions) => this.createNotification(notificationOptions, true)));
|
|
19438
|
-
const invocationResult = await this.interop.invoke(this.NotificationsExecuteMethod, { command: "importNotifications", data: { notificationSettings: notificationsToImport } }
|
|
19555
|
+
const invocationResult = await this.interop.invoke(this.NotificationsExecuteMethod, { command: "importNotifications", data: { notificationSettings: notificationsToImport } }, "best", {
|
|
19556
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19557
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19558
|
+
});
|
|
19439
19559
|
return invocationResult.returned.notifications;
|
|
19440
19560
|
}
|
|
19441
19561
|
async createNotification(options, imported) {
|
|
@@ -21403,7 +21523,10 @@
|
|
|
21403
21523
|
await Promise.all(this.unregisterIntentPromises);
|
|
21404
21524
|
let apps;
|
|
21405
21525
|
try {
|
|
21406
|
-
const result = await this.interop.invoke("T42.ACS.GetApplications", { withIntentsInfo: true }
|
|
21526
|
+
const result = await this.interop.invoke("T42.ACS.GetApplications", { withIntentsInfo: true }, "best", {
|
|
21527
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
21528
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
21529
|
+
});
|
|
21407
21530
|
apps = result.returned.applications;
|
|
21408
21531
|
}
|
|
21409
21532
|
catch (e) {
|
|
@@ -21442,7 +21565,10 @@
|
|
|
21442
21565
|
let windowsInfos;
|
|
21443
21566
|
if (isT42WndGetInfoMethodRegistered) {
|
|
21444
21567
|
try {
|
|
21445
|
-
const result = await this.interop.invoke(T42WndGetInfo, { ids: serverWindowIds }
|
|
21568
|
+
const result = await this.interop.invoke(T42WndGetInfo, { ids: serverWindowIds }, "best", {
|
|
21569
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
21570
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
21571
|
+
});
|
|
21446
21572
|
windowsInfos = result.returned.windows;
|
|
21447
21573
|
}
|
|
21448
21574
|
catch (e) {
|
|
@@ -21893,7 +22019,10 @@
|
|
|
21893
22019
|
this.intentsResolverResponsePromises[instanceId] = { intent, resolve, reject, promise, methodName: responseMethodName };
|
|
21894
22020
|
}
|
|
21895
22021
|
async invokeStartApp(application, context, options) {
|
|
21896
|
-
const result = await this.interop.invoke("T42.ACS.StartApplication", { Name: application, options: { ...options, startedByIntentAPI: true } }
|
|
22022
|
+
const result = await this.interop.invoke("T42.ACS.StartApplication", { Name: application, options: { ...options, startedByIntentAPI: true } }, "best", {
|
|
22023
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22024
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22025
|
+
});
|
|
21897
22026
|
return result.returned.Id;
|
|
21898
22027
|
}
|
|
21899
22028
|
subscribeOnInstanceStopped(instance, method) {
|
|
@@ -21979,10 +22108,10 @@
|
|
|
21979
22108
|
return handlers.length > 1;
|
|
21980
22109
|
}
|
|
21981
22110
|
if (request.target === "reuse") {
|
|
21982
|
-
return handlers.filter(
|
|
22111
|
+
return handlers.filter(handler => handler.type === "instance" && handler.instanceId).length > 1 || intent.handlers.filter(handler => handler.type === "app").length > 1;
|
|
21983
22112
|
}
|
|
21984
22113
|
if (request.target === "startNew") {
|
|
21985
|
-
return handlers.filter(
|
|
22114
|
+
return handlers.filter(handler => handler.type === "app").length > 1;
|
|
21986
22115
|
}
|
|
21987
22116
|
if (request.target.instance) {
|
|
21988
22117
|
return false;
|
|
@@ -22224,13 +22353,19 @@
|
|
|
22224
22353
|
this.interopMethodRegistered = false;
|
|
22225
22354
|
}
|
|
22226
22355
|
async get(app) {
|
|
22227
|
-
const data = (await this.interop.invoke(
|
|
22356
|
+
const data = (await this.interop.invoke(Prefs.T42GetPrefsMethodName, { app: app !== null && app !== void 0 ? app : this.appName }, "best", {
|
|
22357
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22358
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22359
|
+
}));
|
|
22228
22360
|
return data.returned;
|
|
22229
22361
|
}
|
|
22230
22362
|
async set(data, options) {
|
|
22231
22363
|
var _a;
|
|
22232
22364
|
this.verifyDataObject(data);
|
|
22233
|
-
await this.interop.invoke(
|
|
22365
|
+
await this.interop.invoke(Prefs.T42SetPrefsMethodName, { app: (_a = options === null || options === void 0 ? void 0 : options.app) !== null && _a !== void 0 ? _a : this.appName, data, merge: false }, "best", {
|
|
22366
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22367
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22368
|
+
});
|
|
22234
22369
|
}
|
|
22235
22370
|
async setFor(app, data) {
|
|
22236
22371
|
this.verifyApp(app);
|
|
@@ -22240,7 +22375,10 @@
|
|
|
22240
22375
|
async update(data, options) {
|
|
22241
22376
|
var _a;
|
|
22242
22377
|
this.verifyDataObject(data);
|
|
22243
|
-
await this.interop.invoke(
|
|
22378
|
+
await this.interop.invoke(Prefs.T42SetPrefsMethodName, { app: (_a = options === null || options === void 0 ? void 0 : options.app) !== null && _a !== void 0 ? _a : this.appName, data, merge: true }, "best", {
|
|
22379
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22380
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22381
|
+
});
|
|
22244
22382
|
}
|
|
22245
22383
|
async updateFor(app, data) {
|
|
22246
22384
|
this.verifyApp(app);
|
|
@@ -22248,18 +22386,30 @@
|
|
|
22248
22386
|
return this.update(data, { app });
|
|
22249
22387
|
}
|
|
22250
22388
|
async clear(app) {
|
|
22251
|
-
await this.interop.invoke(
|
|
22389
|
+
await this.interop.invoke(Prefs.T42SetPrefsMethodName, { app: app !== null && app !== void 0 ? app : this.appName, clear: true }, "best", {
|
|
22390
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22391
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22392
|
+
});
|
|
22252
22393
|
}
|
|
22253
22394
|
async clearFor(app) {
|
|
22254
22395
|
this.verifyApp(app);
|
|
22255
|
-
await this.interop.invoke(
|
|
22396
|
+
await this.interop.invoke(Prefs.T42SetPrefsMethodName, { app, clear: true }, "best", {
|
|
22397
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22398
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22399
|
+
});
|
|
22256
22400
|
}
|
|
22257
22401
|
async getAll() {
|
|
22258
|
-
const data = (await this.interop.invoke(
|
|
22402
|
+
const data = (await this.interop.invoke(Prefs.T42GetPrefsMethodName, undefined, "best", {
|
|
22403
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22404
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22405
|
+
}));
|
|
22259
22406
|
return data.returned;
|
|
22260
22407
|
}
|
|
22261
22408
|
async clearAll() {
|
|
22262
|
-
await this.interop.invoke(
|
|
22409
|
+
await this.interop.invoke(Prefs.T42SetPrefsMethodName, { clear: true }, "best", {
|
|
22410
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22411
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22412
|
+
});
|
|
22263
22413
|
}
|
|
22264
22414
|
subscribe(callback) {
|
|
22265
22415
|
this.verifyCallback(callback);
|
|
@@ -22271,7 +22421,10 @@
|
|
|
22271
22421
|
const unsubscribeFn = this.registry.add(app, callback);
|
|
22272
22422
|
this.registerInteropIfNeeded()
|
|
22273
22423
|
.then(() => {
|
|
22274
|
-
this.interop.invoke(
|
|
22424
|
+
this.interop.invoke(Prefs.T42GetPrefsMethodName, { app, subscribe: true }, "best", {
|
|
22425
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22426
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22427
|
+
});
|
|
22275
22428
|
});
|
|
22276
22429
|
return () => {
|
|
22277
22430
|
unsubscribeFn();
|
|
@@ -22282,7 +22435,7 @@
|
|
|
22282
22435
|
return;
|
|
22283
22436
|
}
|
|
22284
22437
|
this.interopMethodRegistered = true;
|
|
22285
|
-
await this.interop.register(
|
|
22438
|
+
await this.interop.register(Prefs.T42UpdatePrefsMethodName, (args) => {
|
|
22286
22439
|
this.registry.execute(args.app, args);
|
|
22287
22440
|
});
|
|
22288
22441
|
}
|
|
@@ -22308,6 +22461,9 @@
|
|
|
22308
22461
|
}
|
|
22309
22462
|
}
|
|
22310
22463
|
}
|
|
22464
|
+
Prefs.T42UpdatePrefsMethodName = "T42.Prefs.Update";
|
|
22465
|
+
Prefs.T42GetPrefsMethodName = "T42.Prefs.Get";
|
|
22466
|
+
Prefs.T42SetPrefsMethodName = "T42.Prefs.Set";
|
|
22311
22467
|
|
|
22312
22468
|
class Cookies {
|
|
22313
22469
|
constructor(methodName, interop) {
|
|
@@ -22332,7 +22488,10 @@
|
|
|
22332
22488
|
await this.invoke("remove-cookie", { url, name });
|
|
22333
22489
|
}
|
|
22334
22490
|
invoke(command, data) {
|
|
22335
|
-
return this.interop.invoke(this.methodName, { command, args: data }
|
|
22491
|
+
return this.interop.invoke(this.methodName, { command, args: data }, "best", {
|
|
22492
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22493
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS,
|
|
22494
|
+
});
|
|
22336
22495
|
}
|
|
22337
22496
|
verifyCookieObject(cookie) {
|
|
22338
22497
|
if (!cookie) {
|
|
@@ -22480,6 +22639,9 @@
|
|
|
22480
22639
|
await this.interop.invoke(this.InterceptorMethodName, {
|
|
22481
22640
|
command: "register",
|
|
22482
22641
|
interceptions
|
|
22642
|
+
}, "best", {
|
|
22643
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22644
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22483
22645
|
});
|
|
22484
22646
|
await this.registerMethodIfNotRegistered();
|
|
22485
22647
|
}
|
|
@@ -22500,6 +22662,9 @@
|
|
|
22500
22662
|
await this.interop.invoke(this.InterceptorMethodName, {
|
|
22501
22663
|
command: "unregister",
|
|
22502
22664
|
interceptions
|
|
22665
|
+
}, "best", {
|
|
22666
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22667
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22503
22668
|
});
|
|
22504
22669
|
this.interceptions = this.interceptions.filter((config) => {
|
|
22505
22670
|
return !interceptions.some((interception) => {
|
|
@@ -22527,7 +22692,10 @@
|
|
|
22527
22692
|
operation,
|
|
22528
22693
|
phase
|
|
22529
22694
|
}]
|
|
22530
|
-
}, 'best', {
|
|
22695
|
+
}, 'best', {
|
|
22696
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22697
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22698
|
+
});
|
|
22531
22699
|
return result.returned;
|
|
22532
22700
|
}
|
|
22533
22701
|
static createProxyObject(apiToIntercept, domain, interception) {
|