@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.es.js
CHANGED
|
@@ -2938,7 +2938,7 @@ const ContextMessageReplaySpec = {
|
|
|
2938
2938
|
}
|
|
2939
2939
|
};
|
|
2940
2940
|
|
|
2941
|
-
var version$1 = "6.5.2
|
|
2941
|
+
var version$1 = "6.5.2";
|
|
2942
2942
|
|
|
2943
2943
|
function prepareConfig$1 (configuration, ext, glue42gd) {
|
|
2944
2944
|
let nodeStartingContext;
|
|
@@ -5658,10 +5658,7 @@ let GW3Bridge$1 = class GW3Bridge {
|
|
|
5658
5658
|
this._contextIdToName = {};
|
|
5659
5659
|
delete this._protocolVersion;
|
|
5660
5660
|
this._contextsTempCache = Object.keys(this._contextNameToData).reduce((cacheSoFar, ctxName) => {
|
|
5661
|
-
|
|
5662
|
-
if (contextData.isAnnounced && (contextData.activityId || contextData.sentExplicitSubscription)) {
|
|
5663
|
-
cacheSoFar[ctxName] = this._contextNameToData[ctxName].context;
|
|
5664
|
-
}
|
|
5661
|
+
cacheSoFar[ctxName] = this._contextNameToData[ctxName].context;
|
|
5665
5662
|
return cacheSoFar;
|
|
5666
5663
|
}, {});
|
|
5667
5664
|
this._contextNameToData = {};
|
|
@@ -11590,6 +11587,164 @@ function validate(callback, configuration) {
|
|
|
11590
11587
|
}
|
|
11591
11588
|
}
|
|
11592
11589
|
|
|
11590
|
+
const INTEROP_METHOD_RESPONSE_TIMEOUT_MS = 90000;
|
|
11591
|
+
const INTEROP_METHOD_WAIT_TIMEOUT_MS = 90000;
|
|
11592
|
+
|
|
11593
|
+
// This alphabet uses `A-Za-z0-9_-` symbols.
|
|
11594
|
+
// The order of characters is optimized for better gzip and brotli compression.
|
|
11595
|
+
// References to the same file (works both for gzip and brotli):
|
|
11596
|
+
// `'use`, `andom`, and `rict'`
|
|
11597
|
+
// References to the brotli default dictionary:
|
|
11598
|
+
// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`
|
|
11599
|
+
let urlAlphabet =
|
|
11600
|
+
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
11601
|
+
|
|
11602
|
+
let nanoid = (size = 21) => {
|
|
11603
|
+
let id = '';
|
|
11604
|
+
// A compact alternative for `for (var i = 0; i < step; i++)`.
|
|
11605
|
+
let i = size | 0;
|
|
11606
|
+
while (i--) {
|
|
11607
|
+
// `| 0` is more compact and faster than `Math.floor()`.
|
|
11608
|
+
id += urlAlphabet[(Math.random() * 64) | 0];
|
|
11609
|
+
}
|
|
11610
|
+
return id
|
|
11611
|
+
};
|
|
11612
|
+
|
|
11613
|
+
class Utils {
|
|
11614
|
+
static getGDMajorVersion() {
|
|
11615
|
+
if (typeof window === "undefined") {
|
|
11616
|
+
return -1;
|
|
11617
|
+
}
|
|
11618
|
+
if (!window.glueDesktop) {
|
|
11619
|
+
return -1;
|
|
11620
|
+
}
|
|
11621
|
+
if (!window.glueDesktop.version) {
|
|
11622
|
+
return -1;
|
|
11623
|
+
}
|
|
11624
|
+
const parsed = window.glueDesktop.version.split(".");
|
|
11625
|
+
const major = Number(parsed[0]);
|
|
11626
|
+
return isNaN(major) ? -1 : major;
|
|
11627
|
+
}
|
|
11628
|
+
static typedError(error) {
|
|
11629
|
+
let err;
|
|
11630
|
+
if (error instanceof Error) {
|
|
11631
|
+
err = error;
|
|
11632
|
+
}
|
|
11633
|
+
else if (typeof error === "string") {
|
|
11634
|
+
err = new Error(error);
|
|
11635
|
+
}
|
|
11636
|
+
else if ("message" in error && typeof error.message === "string" && error.message.length > 0) {
|
|
11637
|
+
err = new Error(error.message);
|
|
11638
|
+
}
|
|
11639
|
+
else if ("returned" in error
|
|
11640
|
+
&& typeof error.returned === "object"
|
|
11641
|
+
&& "errorMsg" in error.returned
|
|
11642
|
+
&& typeof error.returned.errorMsg === "string"
|
|
11643
|
+
&& error.returned.errorMsg.length > 0) {
|
|
11644
|
+
err = new Error(error.returned.errorMsg);
|
|
11645
|
+
}
|
|
11646
|
+
else {
|
|
11647
|
+
err = new Error("Unknown error");
|
|
11648
|
+
}
|
|
11649
|
+
return err;
|
|
11650
|
+
}
|
|
11651
|
+
static async callbackifyPromise(action, successCallback, errorCallback) {
|
|
11652
|
+
const success = (result) => {
|
|
11653
|
+
if (typeof successCallback === "function") {
|
|
11654
|
+
successCallback(result);
|
|
11655
|
+
}
|
|
11656
|
+
return Promise.resolve(result);
|
|
11657
|
+
};
|
|
11658
|
+
const fail = (error) => {
|
|
11659
|
+
const err = Utils.typedError(error);
|
|
11660
|
+
if (typeof errorCallback === "function") {
|
|
11661
|
+
errorCallback(err.message);
|
|
11662
|
+
return;
|
|
11663
|
+
}
|
|
11664
|
+
return Promise.reject(err);
|
|
11665
|
+
};
|
|
11666
|
+
try {
|
|
11667
|
+
const result = await action();
|
|
11668
|
+
return success(result);
|
|
11669
|
+
}
|
|
11670
|
+
catch (error) {
|
|
11671
|
+
return fail(error);
|
|
11672
|
+
}
|
|
11673
|
+
}
|
|
11674
|
+
static getMonitor(bounds, displays) {
|
|
11675
|
+
const monitorsSortedByOverlap = displays.map((m) => {
|
|
11676
|
+
const { left, top, workingAreaWidth: width, workingAreaHeight: height } = m;
|
|
11677
|
+
const overlap = this.calculateTotalOverlap({ left, top, width, height }, bounds);
|
|
11678
|
+
return {
|
|
11679
|
+
monitor: m,
|
|
11680
|
+
totalOverlap: overlap
|
|
11681
|
+
};
|
|
11682
|
+
}).sort((a, b) => b.totalOverlap - a.totalOverlap);
|
|
11683
|
+
return monitorsSortedByOverlap[0].monitor;
|
|
11684
|
+
}
|
|
11685
|
+
static getDisplayCenterOfScreen(a, currentDisplay, primaryDisplay) {
|
|
11686
|
+
const physicalWidth = a.width / currentDisplay.scaleFactor;
|
|
11687
|
+
const physicalHeight = a.height / currentDisplay.scaleFactor;
|
|
11688
|
+
const physicalDisplayLeft = currentDisplay.workArea.left / primaryDisplay.scaleFactor;
|
|
11689
|
+
const physicalDisplayTop = currentDisplay.workArea.top / primaryDisplay.scaleFactor;
|
|
11690
|
+
const physicalDisplayWidth = currentDisplay.workArea.width / currentDisplay.scaleFactor;
|
|
11691
|
+
const physicalDisplayHeight = currentDisplay.workArea.height / currentDisplay.scaleFactor;
|
|
11692
|
+
const physicalHOffset = Math.max((physicalDisplayWidth - physicalWidth) / 2, 0);
|
|
11693
|
+
const physicalVOffset = Math.max((physicalDisplayHeight - physicalHeight) / 2, 0);
|
|
11694
|
+
const centeredPhysicalLeft = Math.floor(physicalDisplayLeft + physicalHOffset);
|
|
11695
|
+
const centeredPhysicalTop = Math.floor(physicalDisplayTop + physicalVOffset);
|
|
11696
|
+
const left = centeredPhysicalLeft * primaryDisplay.scaleFactor;
|
|
11697
|
+
const top = centeredPhysicalTop * primaryDisplay.scaleFactor;
|
|
11698
|
+
return {
|
|
11699
|
+
left,
|
|
11700
|
+
top,
|
|
11701
|
+
width: a.width,
|
|
11702
|
+
height: a.height
|
|
11703
|
+
};
|
|
11704
|
+
}
|
|
11705
|
+
static isNode() {
|
|
11706
|
+
if (typeof Utils._isNode !== "undefined") {
|
|
11707
|
+
return Utils._isNode;
|
|
11708
|
+
}
|
|
11709
|
+
if (typeof window !== "undefined") {
|
|
11710
|
+
Utils._isNode = false;
|
|
11711
|
+
return false;
|
|
11712
|
+
}
|
|
11713
|
+
try {
|
|
11714
|
+
Utils._isNode = Object.prototype.toString.call(global.process) === "[object process]";
|
|
11715
|
+
}
|
|
11716
|
+
catch (e) {
|
|
11717
|
+
Utils._isNode = false;
|
|
11718
|
+
}
|
|
11719
|
+
return Utils._isNode;
|
|
11720
|
+
}
|
|
11721
|
+
static generateId() {
|
|
11722
|
+
return nanoid(10);
|
|
11723
|
+
}
|
|
11724
|
+
static isPromise(value) {
|
|
11725
|
+
return Boolean(value && typeof value.then === 'function');
|
|
11726
|
+
}
|
|
11727
|
+
static isAsyncFunction(value) {
|
|
11728
|
+
return value && {}.toString.call(value) === '[object AsyncFunction]';
|
|
11729
|
+
}
|
|
11730
|
+
static isNullOrUndefined(value) {
|
|
11731
|
+
return value === null || value === undefined;
|
|
11732
|
+
}
|
|
11733
|
+
static calculateTotalOverlap(r1, r2) {
|
|
11734
|
+
const r1x = r1.left;
|
|
11735
|
+
const r1y = r1.top;
|
|
11736
|
+
const r1xMax = r1x + r1.width;
|
|
11737
|
+
const r1yMax = r1y + r1.height;
|
|
11738
|
+
const r2x = r2.left;
|
|
11739
|
+
const r2y = r2.top;
|
|
11740
|
+
const r2xMax = r2x + r2.width;
|
|
11741
|
+
const r2yMax = r2y + r2.height;
|
|
11742
|
+
const xOverlap = Math.max(0, Math.min(r1xMax, r2xMax) - Math.max(r1x, r2x));
|
|
11743
|
+
const yOverlap = Math.max(0, Math.min(r1yMax, r2yMax) - Math.max(r1y, r2y));
|
|
11744
|
+
return xOverlap * yOverlap;
|
|
11745
|
+
}
|
|
11746
|
+
}
|
|
11747
|
+
|
|
11593
11748
|
class ApplicationImpl {
|
|
11594
11749
|
constructor(_appManager, _name, _agm, _logger, _configuration) {
|
|
11595
11750
|
this._appManager = _appManager;
|
|
@@ -11719,7 +11874,10 @@ class ApplicationImpl {
|
|
|
11719
11874
|
return "flat";
|
|
11720
11875
|
}
|
|
11721
11876
|
async getConfiguration() {
|
|
11722
|
-
const result = await this._agm.invoke(GetApplicationsMethodName, { v2: { apps: [this._name] } }
|
|
11877
|
+
const result = await this._agm.invoke(GetApplicationsMethodName, { v2: { apps: [this._name] } }, "best", {
|
|
11878
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
11879
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
11880
|
+
});
|
|
11723
11881
|
const config = result.returned.applications[0];
|
|
11724
11882
|
return config;
|
|
11725
11883
|
}
|
|
@@ -11733,7 +11891,7 @@ class ApplicationImpl {
|
|
|
11733
11891
|
}
|
|
11734
11892
|
start(context, options) {
|
|
11735
11893
|
return new Promise(async (resolve, reject) => {
|
|
11736
|
-
var _a, _b, _c, _d
|
|
11894
|
+
var _a, _b, _c, _d;
|
|
11737
11895
|
if (isUndefinedOrNull(context)) {
|
|
11738
11896
|
context = {};
|
|
11739
11897
|
}
|
|
@@ -11777,7 +11935,13 @@ class ApplicationImpl {
|
|
|
11777
11935
|
resolve(i);
|
|
11778
11936
|
};
|
|
11779
11937
|
if (waitForAGMInstance) {
|
|
11780
|
-
|
|
11938
|
+
const instance = this._appManager.instances().find((i) => i.id === id);
|
|
11939
|
+
if (instance) {
|
|
11940
|
+
unsub = instance.onAgmReady(waitFunc);
|
|
11941
|
+
}
|
|
11942
|
+
else {
|
|
11943
|
+
unsub = this._appManager.onInstanceAgmServerReady(waitFunc);
|
|
11944
|
+
}
|
|
11781
11945
|
}
|
|
11782
11946
|
else {
|
|
11783
11947
|
unsub = this._appManager.onInstanceStarted(waitFunc);
|
|
@@ -11790,7 +11954,8 @@ class ApplicationImpl {
|
|
|
11790
11954
|
Context: context,
|
|
11791
11955
|
Options: options
|
|
11792
11956
|
}, "best", {
|
|
11793
|
-
methodResponseTimeoutMs: startTimeout
|
|
11957
|
+
methodResponseTimeoutMs: startTimeout,
|
|
11958
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
11794
11959
|
});
|
|
11795
11960
|
const acsResult = result.returned;
|
|
11796
11961
|
if (typeof acsResult.timeout !== "undefined" && typeof options.timeout === "undefined") {
|
|
@@ -11821,7 +11986,8 @@ class ApplicationImpl {
|
|
|
11821
11986
|
}
|
|
11822
11987
|
}
|
|
11823
11988
|
catch (error) {
|
|
11824
|
-
|
|
11989
|
+
const err = Utils.typedError(error);
|
|
11990
|
+
reject(err);
|
|
11825
11991
|
}
|
|
11826
11992
|
});
|
|
11827
11993
|
}
|
|
@@ -12023,6 +12189,9 @@ class InstanceImpl {
|
|
|
12023
12189
|
this._agm.invoke(StopApplicationMethodName, {
|
|
12024
12190
|
Name: this._appName,
|
|
12025
12191
|
Id: this._id
|
|
12192
|
+
}, "best", {
|
|
12193
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12194
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12026
12195
|
})
|
|
12027
12196
|
.then(() => {
|
|
12028
12197
|
if (this._appManager.mode === "startOnly") {
|
|
@@ -12037,7 +12206,10 @@ class InstanceImpl {
|
|
|
12037
12206
|
});
|
|
12038
12207
|
}
|
|
12039
12208
|
activate() {
|
|
12040
|
-
return this._agm.invoke(ActivateApplicationMethodName, { Name: this._appName, Id: this._id }
|
|
12209
|
+
return this._agm.invoke(ActivateApplicationMethodName, { Name: this._appName, Id: this._id }, "best", {
|
|
12210
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12211
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12212
|
+
});
|
|
12041
12213
|
}
|
|
12042
12214
|
done() {
|
|
12043
12215
|
this._registry.clear();
|
|
@@ -12048,7 +12220,10 @@ class InstanceImpl {
|
|
|
12048
12220
|
return Promise.resolve(this.context);
|
|
12049
12221
|
}
|
|
12050
12222
|
async startedBy() {
|
|
12051
|
-
const result = await this._agm.invoke(ACSExecute, { command: "getStartedBy", Name: this._appName, Id: this._id }
|
|
12223
|
+
const result = await this._agm.invoke(ACSExecute, { command: "getStartedBy", Name: this._appName, Id: this._id }, "best", {
|
|
12224
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12225
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12226
|
+
});
|
|
12052
12227
|
return result.returned;
|
|
12053
12228
|
}
|
|
12054
12229
|
}
|
|
@@ -12076,7 +12251,10 @@ class AppManagerImpl {
|
|
|
12076
12251
|
apps
|
|
12077
12252
|
};
|
|
12078
12253
|
}
|
|
12079
|
-
const result = await this._agm.invoke(GetApplicationsMethodName, args
|
|
12254
|
+
const result = await this._agm.invoke(GetApplicationsMethodName, args, "best", {
|
|
12255
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12256
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12257
|
+
});
|
|
12080
12258
|
return result.returned.applications;
|
|
12081
12259
|
};
|
|
12082
12260
|
this.application = (name) => {
|
|
@@ -12393,7 +12571,10 @@ class EntitlementsImpl {
|
|
|
12393
12571
|
args = args || {};
|
|
12394
12572
|
return new Promise((resolve, reject) => {
|
|
12395
12573
|
const errHandler = (error) => reject(error);
|
|
12396
|
-
this._agm.invoke(method, args
|
|
12574
|
+
this._agm.invoke(method, args, "best", {
|
|
12575
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12576
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12577
|
+
})
|
|
12397
12578
|
.then((result) => {
|
|
12398
12579
|
if (!transformFunction) {
|
|
12399
12580
|
transformFunction = (d) => d.returned;
|
|
@@ -12422,7 +12603,10 @@ class EntitlementsImpl {
|
|
|
12422
12603
|
|
|
12423
12604
|
function snapshot(interop, appManager) {
|
|
12424
12605
|
return new Promise((resolve, reject) => {
|
|
12425
|
-
interop.invoke(GetApplicationsMethodName, { skipIcon: true }
|
|
12606
|
+
interop.invoke(GetApplicationsMethodName, { skipIcon: true }, "best", {
|
|
12607
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12608
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12609
|
+
})
|
|
12426
12610
|
.then((response) => {
|
|
12427
12611
|
var _a;
|
|
12428
12612
|
const data = response.returned;
|
|
@@ -12437,7 +12621,7 @@ function snapshot(interop, appManager) {
|
|
|
12437
12621
|
objectValues(applications).map((item) => appManager.handleAppAdded(item));
|
|
12438
12622
|
resolve(configuration);
|
|
12439
12623
|
})
|
|
12440
|
-
.catch((err) => reject(`Error getting application snapshot: ${err.message}`));
|
|
12624
|
+
.catch((err) => reject(new Error(`Error getting application snapshot: ${err.message}`)));
|
|
12441
12625
|
});
|
|
12442
12626
|
}
|
|
12443
12627
|
|
|
@@ -12547,10 +12731,10 @@ class InMemoryStore {
|
|
|
12547
12731
|
}
|
|
12548
12732
|
import(apps, mode) {
|
|
12549
12733
|
if (!apps || !Array.isArray(apps)) {
|
|
12550
|
-
return Promise.reject("invalid apps argument - should be an array of application definitions");
|
|
12734
|
+
return Promise.reject(new Error("invalid apps argument - should be an array of application definitions"));
|
|
12551
12735
|
}
|
|
12552
12736
|
if (mode && mode !== "replace" && mode !== "merge") {
|
|
12553
|
-
return Promise.reject("invalid mode argument - should be 'replace' or 'merge'");
|
|
12737
|
+
return Promise.reject(new Error("invalid mode argument - should be 'replace' or 'merge'"));
|
|
12554
12738
|
}
|
|
12555
12739
|
mode = mode !== null && mode !== void 0 ? mode : "replace";
|
|
12556
12740
|
const command = {
|
|
@@ -12560,16 +12744,22 @@ class InMemoryStore {
|
|
|
12560
12744
|
mode
|
|
12561
12745
|
}
|
|
12562
12746
|
};
|
|
12563
|
-
return this.interop.invoke(InMemoryStoreCommandMethodName, command
|
|
12747
|
+
return this.interop.invoke(InMemoryStoreCommandMethodName, command, "best", {
|
|
12748
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12749
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12750
|
+
})
|
|
12564
12751
|
.then((r) => r.returned);
|
|
12565
12752
|
}
|
|
12566
12753
|
export() {
|
|
12567
|
-
return this.interop.invoke(InMemoryStoreCommandMethodName, { command: "export" }
|
|
12754
|
+
return this.interop.invoke(InMemoryStoreCommandMethodName, { command: "export" }, "best", {
|
|
12755
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12756
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12757
|
+
})
|
|
12568
12758
|
.then((r) => r.returned.apps);
|
|
12569
12759
|
}
|
|
12570
12760
|
remove(app) {
|
|
12571
12761
|
if (!app || typeof app !== "string") {
|
|
12572
|
-
return Promise.reject("invalid app name, should be a string value");
|
|
12762
|
+
return Promise.reject(new Error("invalid app name, should be a string value"));
|
|
12573
12763
|
}
|
|
12574
12764
|
const command = {
|
|
12575
12765
|
command: "remove",
|
|
@@ -12577,13 +12767,19 @@ class InMemoryStore {
|
|
|
12577
12767
|
apps: [app]
|
|
12578
12768
|
}
|
|
12579
12769
|
};
|
|
12580
|
-
return this.interop.invoke(InMemoryStoreCommandMethodName, command
|
|
12770
|
+
return this.interop.invoke(InMemoryStoreCommandMethodName, command, "best", {
|
|
12771
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12772
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12773
|
+
}).then((r) => r.returned);
|
|
12581
12774
|
}
|
|
12582
12775
|
clear() {
|
|
12583
12776
|
const command = {
|
|
12584
12777
|
command: "clear"
|
|
12585
12778
|
};
|
|
12586
|
-
return this.interop.invoke(InMemoryStoreCommandMethodName, command
|
|
12779
|
+
return this.interop.invoke(InMemoryStoreCommandMethodName, command, "best", {
|
|
12780
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
12781
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
12782
|
+
}).then((r) => r.returned);
|
|
12587
12783
|
}
|
|
12588
12784
|
createAppDef(name, url) {
|
|
12589
12785
|
if (!url) {
|
|
@@ -12669,157 +12865,6 @@ var AppManagerFactory = (config) => {
|
|
|
12669
12865
|
return api;
|
|
12670
12866
|
};
|
|
12671
12867
|
|
|
12672
|
-
// This alphabet uses `A-Za-z0-9_-` symbols.
|
|
12673
|
-
// The order of characters is optimized for better gzip and brotli compression.
|
|
12674
|
-
// References to the same file (works both for gzip and brotli):
|
|
12675
|
-
// `'use`, `andom`, and `rict'`
|
|
12676
|
-
// References to the brotli default dictionary:
|
|
12677
|
-
// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`
|
|
12678
|
-
let urlAlphabet =
|
|
12679
|
-
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
12680
|
-
|
|
12681
|
-
let nanoid = (size = 21) => {
|
|
12682
|
-
let id = '';
|
|
12683
|
-
// A compact alternative for `for (var i = 0; i < step; i++)`.
|
|
12684
|
-
let i = size | 0;
|
|
12685
|
-
while (i--) {
|
|
12686
|
-
// `| 0` is more compact and faster than `Math.floor()`.
|
|
12687
|
-
id += urlAlphabet[(Math.random() * 64) | 0];
|
|
12688
|
-
}
|
|
12689
|
-
return id
|
|
12690
|
-
};
|
|
12691
|
-
|
|
12692
|
-
class Utils {
|
|
12693
|
-
static getGDMajorVersion() {
|
|
12694
|
-
if (typeof window === "undefined") {
|
|
12695
|
-
return -1;
|
|
12696
|
-
}
|
|
12697
|
-
if (!window.glueDesktop) {
|
|
12698
|
-
return -1;
|
|
12699
|
-
}
|
|
12700
|
-
if (!window.glueDesktop.version) {
|
|
12701
|
-
return -1;
|
|
12702
|
-
}
|
|
12703
|
-
const parsed = window.glueDesktop.version.split(".");
|
|
12704
|
-
const major = Number(parsed[0]);
|
|
12705
|
-
return isNaN(major) ? -1 : major;
|
|
12706
|
-
}
|
|
12707
|
-
static async callbackifyPromise(action, successCallback, errorCallback) {
|
|
12708
|
-
const success = (result) => {
|
|
12709
|
-
if (typeof successCallback === "function") {
|
|
12710
|
-
successCallback(result);
|
|
12711
|
-
}
|
|
12712
|
-
return Promise.resolve(result);
|
|
12713
|
-
};
|
|
12714
|
-
const fail = (error) => {
|
|
12715
|
-
let err;
|
|
12716
|
-
if (error instanceof Error) {
|
|
12717
|
-
err = error;
|
|
12718
|
-
}
|
|
12719
|
-
else if (typeof error === "string") {
|
|
12720
|
-
err = new Error(error);
|
|
12721
|
-
}
|
|
12722
|
-
else if ("message" in error && typeof error.message === "string" && error.message.length > 0) {
|
|
12723
|
-
err = new Error(error.message);
|
|
12724
|
-
}
|
|
12725
|
-
else if ("returned" in error
|
|
12726
|
-
&& typeof error.returned === "object"
|
|
12727
|
-
&& "errorMsg" in error.returned
|
|
12728
|
-
&& typeof error.returned.errorMsg === "string"
|
|
12729
|
-
&& error.returned.errorMsg.length > 0) {
|
|
12730
|
-
err = new Error(error.returned.errorMsg);
|
|
12731
|
-
}
|
|
12732
|
-
else {
|
|
12733
|
-
err = new Error("Unknown error");
|
|
12734
|
-
}
|
|
12735
|
-
if (typeof errorCallback === "function") {
|
|
12736
|
-
errorCallback(err.message);
|
|
12737
|
-
return;
|
|
12738
|
-
}
|
|
12739
|
-
return Promise.reject(err);
|
|
12740
|
-
};
|
|
12741
|
-
try {
|
|
12742
|
-
const result = await action();
|
|
12743
|
-
return success(result);
|
|
12744
|
-
}
|
|
12745
|
-
catch (error) {
|
|
12746
|
-
return fail(error);
|
|
12747
|
-
}
|
|
12748
|
-
}
|
|
12749
|
-
static getMonitor(bounds, displays) {
|
|
12750
|
-
const monitorsSortedByOverlap = displays.map((m) => {
|
|
12751
|
-
const { left, top, workingAreaWidth: width, workingAreaHeight: height } = m;
|
|
12752
|
-
const overlap = this.calculateTotalOverlap({ left, top, width, height }, bounds);
|
|
12753
|
-
return {
|
|
12754
|
-
monitor: m,
|
|
12755
|
-
totalOverlap: overlap
|
|
12756
|
-
};
|
|
12757
|
-
}).sort((a, b) => b.totalOverlap - a.totalOverlap);
|
|
12758
|
-
return monitorsSortedByOverlap[0].monitor;
|
|
12759
|
-
}
|
|
12760
|
-
static getDisplayCenterOfScreen(a, currentDisplay, primaryDisplay) {
|
|
12761
|
-
const physicalWidth = a.width / currentDisplay.scaleFactor;
|
|
12762
|
-
const physicalHeight = a.height / currentDisplay.scaleFactor;
|
|
12763
|
-
const physicalDisplayLeft = currentDisplay.workArea.left / primaryDisplay.scaleFactor;
|
|
12764
|
-
const physicalDisplayTop = currentDisplay.workArea.top / primaryDisplay.scaleFactor;
|
|
12765
|
-
const physicalDisplayWidth = currentDisplay.workArea.width / currentDisplay.scaleFactor;
|
|
12766
|
-
const physicalDisplayHeight = currentDisplay.workArea.height / currentDisplay.scaleFactor;
|
|
12767
|
-
const physicalHOffset = Math.max((physicalDisplayWidth - physicalWidth) / 2, 0);
|
|
12768
|
-
const physicalVOffset = Math.max((physicalDisplayHeight - physicalHeight) / 2, 0);
|
|
12769
|
-
const centeredPhysicalLeft = Math.floor(physicalDisplayLeft + physicalHOffset);
|
|
12770
|
-
const centeredPhysicalTop = Math.floor(physicalDisplayTop + physicalVOffset);
|
|
12771
|
-
const left = centeredPhysicalLeft * primaryDisplay.scaleFactor;
|
|
12772
|
-
const top = centeredPhysicalTop * primaryDisplay.scaleFactor;
|
|
12773
|
-
return {
|
|
12774
|
-
left,
|
|
12775
|
-
top,
|
|
12776
|
-
width: a.width,
|
|
12777
|
-
height: a.height
|
|
12778
|
-
};
|
|
12779
|
-
}
|
|
12780
|
-
static isNode() {
|
|
12781
|
-
if (typeof Utils._isNode !== "undefined") {
|
|
12782
|
-
return Utils._isNode;
|
|
12783
|
-
}
|
|
12784
|
-
if (typeof window !== "undefined") {
|
|
12785
|
-
Utils._isNode = false;
|
|
12786
|
-
return false;
|
|
12787
|
-
}
|
|
12788
|
-
try {
|
|
12789
|
-
Utils._isNode = Object.prototype.toString.call(global.process) === "[object process]";
|
|
12790
|
-
}
|
|
12791
|
-
catch (e) {
|
|
12792
|
-
Utils._isNode = false;
|
|
12793
|
-
}
|
|
12794
|
-
return Utils._isNode;
|
|
12795
|
-
}
|
|
12796
|
-
static generateId() {
|
|
12797
|
-
return nanoid(10);
|
|
12798
|
-
}
|
|
12799
|
-
static isPromise(value) {
|
|
12800
|
-
return Boolean(value && typeof value.then === 'function');
|
|
12801
|
-
}
|
|
12802
|
-
static isAsyncFunction(value) {
|
|
12803
|
-
return value && {}.toString.call(value) === '[object AsyncFunction]';
|
|
12804
|
-
}
|
|
12805
|
-
static isNullOrUndefined(value) {
|
|
12806
|
-
return value === null || value === undefined;
|
|
12807
|
-
}
|
|
12808
|
-
static calculateTotalOverlap(r1, r2) {
|
|
12809
|
-
const r1x = r1.left;
|
|
12810
|
-
const r1y = r1.top;
|
|
12811
|
-
const r1xMax = r1x + r1.width;
|
|
12812
|
-
const r1yMax = r1y + r1.height;
|
|
12813
|
-
const r2x = r2.left;
|
|
12814
|
-
const r2y = r2.top;
|
|
12815
|
-
const r2xMax = r2x + r2.width;
|
|
12816
|
-
const r2yMax = r2y + r2.height;
|
|
12817
|
-
const xOverlap = Math.max(0, Math.min(r1xMax, r2xMax) - Math.max(r1x, r2x));
|
|
12818
|
-
const yOverlap = Math.max(0, Math.min(r1yMax, r2yMax) - Math.max(r1y, r2y));
|
|
12819
|
-
return xOverlap * yOverlap;
|
|
12820
|
-
}
|
|
12821
|
-
}
|
|
12822
|
-
|
|
12823
12868
|
const T42JumpListAction = "T42.JumpList.Action";
|
|
12824
12869
|
class JumpListManager {
|
|
12825
12870
|
constructor() {
|
|
@@ -14701,7 +14746,10 @@ class GDExecutor {
|
|
|
14701
14746
|
finishedResolve = resolve;
|
|
14702
14747
|
});
|
|
14703
14748
|
try {
|
|
14704
|
-
const result = await this.agm.invoke("T42.Wnd.Create", options, this.agmTarget
|
|
14749
|
+
const result = await this.agm.invoke("T42.Wnd.Create", options, this.agmTarget, {
|
|
14750
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
14751
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS
|
|
14752
|
+
});
|
|
14705
14753
|
if (result.returned === undefined) {
|
|
14706
14754
|
throw new Error("failed to execute T42.Wnd.Create - unknown reason");
|
|
14707
14755
|
}
|
|
@@ -15291,7 +15339,7 @@ class GDExecutor {
|
|
|
15291
15339
|
const data = args.data;
|
|
15292
15340
|
if ("status" in data) {
|
|
15293
15341
|
if (data.status === "failed") {
|
|
15294
|
-
rej(data.message);
|
|
15342
|
+
rej(new Error(data.message));
|
|
15295
15343
|
}
|
|
15296
15344
|
else if (data.status === "successful") {
|
|
15297
15345
|
res(data.result);
|
|
@@ -15497,7 +15545,10 @@ class GDExecutor {
|
|
|
15497
15545
|
});
|
|
15498
15546
|
});
|
|
15499
15547
|
const action = new Promise((resolve, reject) => {
|
|
15500
|
-
this.agm.invoke("T42.Wnd.Execute", params, this.agmTarget
|
|
15548
|
+
this.agm.invoke("T42.Wnd.Execute", params, this.agmTarget, {
|
|
15549
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
15550
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS
|
|
15551
|
+
})
|
|
15501
15552
|
.then((i) => {
|
|
15502
15553
|
if (i.returned && i.returned.errorMsg) {
|
|
15503
15554
|
reject(i);
|
|
@@ -15551,17 +15602,30 @@ class GDExecutor {
|
|
|
15551
15602
|
});
|
|
15552
15603
|
const execute = new Promise((resolve, reject) => {
|
|
15553
15604
|
options.token = token;
|
|
15605
|
+
if (!invocationOptions) {
|
|
15606
|
+
invocationOptions = {
|
|
15607
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
15608
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS
|
|
15609
|
+
};
|
|
15610
|
+
}
|
|
15611
|
+
else if (!invocationOptions.methodResponseTimeoutMs) {
|
|
15612
|
+
invocationOptions.methodResponseTimeoutMs = INTEROP_METHOD_RESPONSE_TIMEOUT_MS;
|
|
15613
|
+
}
|
|
15614
|
+
else if (!invocationOptions.waitTimeoutMs) {
|
|
15615
|
+
invocationOptions.waitTimeoutMs = INTEROP_METHOD_WAIT_TIMEOUT_MS;
|
|
15616
|
+
}
|
|
15554
15617
|
this.agm.invoke(methodName, options, this.agmTarget, invocationOptions)
|
|
15555
15618
|
.then((i) => {
|
|
15556
15619
|
if (i.returned && i.returned.errorMsg) {
|
|
15557
|
-
reject(i);
|
|
15620
|
+
reject(new Error(i.returned.errorMsg));
|
|
15558
15621
|
}
|
|
15559
15622
|
else {
|
|
15560
15623
|
resolve(i.returned);
|
|
15561
15624
|
}
|
|
15562
15625
|
})
|
|
15563
|
-
.catch((
|
|
15564
|
-
|
|
15626
|
+
.catch((e) => {
|
|
15627
|
+
const error = Utils.typedError(e);
|
|
15628
|
+
reject(error);
|
|
15565
15629
|
});
|
|
15566
15630
|
});
|
|
15567
15631
|
const result = await Promise.all([execute, event]);
|
|
@@ -15714,13 +15778,6 @@ class GDEnvironment {
|
|
|
15714
15778
|
myGroup() {
|
|
15715
15779
|
return this._groupId;
|
|
15716
15780
|
}
|
|
15717
|
-
execute(command, windowId, options) {
|
|
15718
|
-
return this._agm.invoke("T42.Wnd.Execute", {
|
|
15719
|
-
command,
|
|
15720
|
-
options,
|
|
15721
|
-
windowId,
|
|
15722
|
-
});
|
|
15723
|
-
}
|
|
15724
15781
|
onCompositionChanged(callback) {
|
|
15725
15782
|
return this._registry.add("composition-changed", callback);
|
|
15726
15783
|
}
|
|
@@ -16966,84 +17023,83 @@ var main = {};
|
|
|
16966
17023
|
|
|
16967
17024
|
var application = {};
|
|
16968
17025
|
|
|
16969
|
-
/**
|
|
16970
|
-
* This file was automatically generated by json-schema-to-typescript.
|
|
16971
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
16972
|
-
* and run json-schema-to-typescript to regenerate this file.
|
|
16973
|
-
*/
|
|
17026
|
+
/**
|
|
17027
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
17028
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
17029
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
17030
|
+
*/
|
|
16974
17031
|
Object.defineProperty(application, "__esModule", { value: true });
|
|
16975
17032
|
|
|
16976
17033
|
var system = {};
|
|
16977
17034
|
|
|
16978
|
-
/**
|
|
16979
|
-
* This file was automatically generated by json-schema-to-typescript.
|
|
16980
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
16981
|
-
* and run json-schema-to-typescript to regenerate this file.
|
|
16982
|
-
*/
|
|
17035
|
+
/**
|
|
17036
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
17037
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
17038
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
17039
|
+
*/
|
|
16983
17040
|
Object.defineProperty(system, "__esModule", { value: true });
|
|
16984
17041
|
|
|
16985
17042
|
var layout = {};
|
|
16986
17043
|
|
|
16987
|
-
(
|
|
16988
|
-
|
|
16989
|
-
|
|
16990
|
-
|
|
16991
|
-
|
|
16992
|
-
|
|
16993
|
-
|
|
16994
|
-
|
|
16995
|
-
|
|
16996
|
-
|
|
16997
|
-
|
|
16998
|
-
|
|
16999
|
-
|
|
17000
|
-
|
|
17001
|
-
|
|
17002
|
-
|
|
17003
|
-
} (layout));
|
|
17044
|
+
Object.defineProperty(layout, "__esModule", { value: true });
|
|
17045
|
+
layout.SwimlaneItemType = layout.LayoutType = void 0;
|
|
17046
|
+
var LayoutType;
|
|
17047
|
+
(function (LayoutType) {
|
|
17048
|
+
LayoutType["Global"] = "Global";
|
|
17049
|
+
LayoutType["Activity"] = "Activity";
|
|
17050
|
+
LayoutType["ApplicationDefault"] = "ApplicationDefault";
|
|
17051
|
+
LayoutType["Swimlane"] = "Swimlane";
|
|
17052
|
+
LayoutType["Workspaces"] = "Workspace";
|
|
17053
|
+
})(LayoutType || (layout.LayoutType = LayoutType = {}));
|
|
17054
|
+
var SwimlaneItemType;
|
|
17055
|
+
(function (SwimlaneItemType) {
|
|
17056
|
+
SwimlaneItemType["Tab"] = "tab";
|
|
17057
|
+
SwimlaneItemType["Window"] = "window";
|
|
17058
|
+
SwimlaneItemType["Canvas"] = "canvas";
|
|
17059
|
+
})(SwimlaneItemType || (layout.SwimlaneItemType = SwimlaneItemType = {}));
|
|
17004
17060
|
|
|
17005
17061
|
var swTheme = {};
|
|
17006
17062
|
|
|
17007
|
-
/**
|
|
17008
|
-
* This file was automatically generated by json-schema-to-typescript.
|
|
17009
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
17010
|
-
* and run json-schema-to-typescript to regenerate this file.
|
|
17011
|
-
*/
|
|
17063
|
+
/**
|
|
17064
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
17065
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
17066
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
17067
|
+
*/
|
|
17012
17068
|
Object.defineProperty(swTheme, "__esModule", { value: true });
|
|
17013
17069
|
|
|
17014
17070
|
var swConfiguration = {};
|
|
17015
17071
|
|
|
17016
|
-
/**
|
|
17017
|
-
* This file was automatically generated by json-schema-to-typescript.
|
|
17018
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
17019
|
-
* and run json-schema-to-typescript to regenerate this file.
|
|
17020
|
-
*/
|
|
17072
|
+
/**
|
|
17073
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
17074
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
17075
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
17076
|
+
*/
|
|
17021
17077
|
Object.defineProperty(swConfiguration, "__esModule", { value: true });
|
|
17022
17078
|
|
|
17023
17079
|
(function (exports) {
|
|
17024
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17025
|
-
if (k2 === undefined) k2 = k;
|
|
17026
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17027
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17028
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17029
|
-
}
|
|
17030
|
-
Object.defineProperty(o, k2, desc);
|
|
17031
|
-
}) : (function(o, m, k, k2) {
|
|
17032
|
-
if (k2 === undefined) k2 = k;
|
|
17033
|
-
o[k2] = m[k];
|
|
17034
|
-
}));
|
|
17035
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
17036
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17037
|
-
};
|
|
17038
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17039
|
-
// export { SchemaValidator } from "./validator";
|
|
17040
|
-
// export { FileProvider } from "./fileProvider";
|
|
17041
|
-
// export { SchemaProvider } from "./provider";
|
|
17042
|
-
__exportStar(application, exports);
|
|
17043
|
-
__exportStar(system, exports);
|
|
17044
|
-
__exportStar(layout, exports);
|
|
17045
|
-
__exportStar(swTheme, exports);
|
|
17046
|
-
__exportStar(swConfiguration, exports);
|
|
17080
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17081
|
+
if (k2 === undefined) k2 = k;
|
|
17082
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17083
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17084
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17085
|
+
}
|
|
17086
|
+
Object.defineProperty(o, k2, desc);
|
|
17087
|
+
}) : (function(o, m, k, k2) {
|
|
17088
|
+
if (k2 === undefined) k2 = k;
|
|
17089
|
+
o[k2] = m[k];
|
|
17090
|
+
}));
|
|
17091
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
17092
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17093
|
+
};
|
|
17094
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17095
|
+
// export { SchemaValidator } from "./validator";
|
|
17096
|
+
// export { FileProvider } from "./fileProvider";
|
|
17097
|
+
// export { SchemaProvider } from "./provider";
|
|
17098
|
+
__exportStar(application, exports);
|
|
17099
|
+
__exportStar(system, exports);
|
|
17100
|
+
__exportStar(layout, exports);
|
|
17101
|
+
__exportStar(swTheme, exports);
|
|
17102
|
+
__exportStar(swConfiguration, exports);
|
|
17047
17103
|
|
|
17048
17104
|
} (main));
|
|
17049
17105
|
|
|
@@ -17399,7 +17455,7 @@ class LayoutsAPIImpl {
|
|
|
17399
17455
|
updateAppContextInCurrent(context) {
|
|
17400
17456
|
return new Promise((resolve, reject) => {
|
|
17401
17457
|
if (context && typeof context !== "object") {
|
|
17402
|
-
return reject(new Error("
|
|
17458
|
+
return reject(new Error("Context must be an object"));
|
|
17403
17459
|
}
|
|
17404
17460
|
context = context !== null && context !== void 0 ? context : {};
|
|
17405
17461
|
const request = {
|
|
@@ -17411,7 +17467,7 @@ class LayoutsAPIImpl {
|
|
|
17411
17467
|
updateDefaultContext(context) {
|
|
17412
17468
|
return new Promise((resolve, reject) => {
|
|
17413
17469
|
if (context && typeof context !== "object") {
|
|
17414
|
-
return reject(new Error("
|
|
17470
|
+
return reject(new Error("Context must be an object"));
|
|
17415
17471
|
}
|
|
17416
17472
|
context = context !== null && context !== void 0 ? context : {};
|
|
17417
17473
|
const request = {
|
|
@@ -17498,6 +17554,13 @@ class LayoutsAPIImpl {
|
|
|
17498
17554
|
.catch((err) => reject(err));
|
|
17499
17555
|
}
|
|
17500
17556
|
async invokeMethodCore(methodName, args, target, options) {
|
|
17557
|
+
options = options !== null && options !== void 0 ? options : {};
|
|
17558
|
+
if (typeof options.methodResponseTimeoutMs === "undefined") {
|
|
17559
|
+
options.methodResponseTimeoutMs = INTEROP_METHOD_WAIT_TIMEOUT_MS;
|
|
17560
|
+
}
|
|
17561
|
+
if (typeof options.waitTimeoutMs === "undefined") {
|
|
17562
|
+
options.waitTimeoutMs = INTEROP_METHOD_WAIT_TIMEOUT_MS;
|
|
17563
|
+
}
|
|
17501
17564
|
if (this.isCommandMethodPresent()) {
|
|
17502
17565
|
return await this.config.agm.invoke(LayoutsCommandMethod, { command: methodName, data: args }, target, options);
|
|
17503
17566
|
}
|
|
@@ -17678,16 +17741,6 @@ class ACSStream {
|
|
|
17678
17741
|
}
|
|
17679
17742
|
}
|
|
17680
17743
|
|
|
17681
|
-
function streamNull () {
|
|
17682
|
-
return {
|
|
17683
|
-
ready: Promise.resolve(undefined),
|
|
17684
|
-
subscribe: () => { },
|
|
17685
|
-
onEvent: (callback) => () => { },
|
|
17686
|
-
waitFor: (token, timeout) => Promise.resolve(undefined),
|
|
17687
|
-
gotSnapshot: Promise.resolve(undefined),
|
|
17688
|
-
};
|
|
17689
|
-
}
|
|
17690
|
-
|
|
17691
17744
|
function LayoutsFactory (config) {
|
|
17692
17745
|
if (!config.agm) {
|
|
17693
17746
|
throw Error("config.agm is required");
|
|
@@ -17702,9 +17755,6 @@ function LayoutsFactory (config) {
|
|
|
17702
17755
|
if (config.mode === "full" || "fullWaitSnapshot") {
|
|
17703
17756
|
acsStream = new ACSStream(config.agm, callbacks);
|
|
17704
17757
|
}
|
|
17705
|
-
else {
|
|
17706
|
-
acsStream = streamNull();
|
|
17707
|
-
}
|
|
17708
17758
|
return new LayoutsAPIImpl(config, acsStream, callbacks, logger);
|
|
17709
17759
|
}
|
|
17710
17760
|
|
|
@@ -17741,7 +17791,10 @@ class DisplayManager {
|
|
|
17741
17791
|
return point;
|
|
17742
17792
|
};
|
|
17743
17793
|
this.callGD = async (command, options) => {
|
|
17744
|
-
const invocationResult = await this._agm.invoke(T42DisplayCommand, { options: { ...options }, command }
|
|
17794
|
+
const invocationResult = await this._agm.invoke(T42DisplayCommand, { options: { ...options }, command }, "best", {
|
|
17795
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
17796
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
17797
|
+
});
|
|
17745
17798
|
return invocationResult.returned.data;
|
|
17746
17799
|
};
|
|
17747
17800
|
this.decorateDisplay = (original) => {
|
|
@@ -17936,61 +17989,42 @@ async function setupInterop(interopLib, channels) {
|
|
|
17936
17989
|
}
|
|
17937
17990
|
throw new Error(`unknown command ${command}`);
|
|
17938
17991
|
});
|
|
17939
|
-
const result = await interop.invoke(T42_ANNOUNCE_METHOD_NAME, { swId: windowId, instance: interop.instance.instance }
|
|
17992
|
+
const result = await interop.invoke(T42_ANNOUNCE_METHOD_NAME, { swId: windowId, instance: interop.instance.instance }, "best", {
|
|
17993
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
17994
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS
|
|
17995
|
+
});
|
|
17940
17996
|
if ((_a = result.returned) === null || _a === void 0 ? void 0 : _a.restrictions) {
|
|
17941
17997
|
channels.handleRestrictionsChanged((_b = result.returned) === null || _b === void 0 ? void 0 : _b.restrictions, windowId);
|
|
17942
17998
|
}
|
|
17943
17999
|
}
|
|
17944
18000
|
async function sendLeaveChannel(channel, winId) {
|
|
17945
|
-
await
|
|
17946
|
-
swId: winId !== null && winId !== void 0 ? winId : windowId,
|
|
17947
|
-
command: "leaveChannel",
|
|
17948
|
-
data: { channel }
|
|
17949
|
-
});
|
|
18001
|
+
await invoke("leaveChannel", { channel }, winId !== null && winId !== void 0 ? winId : windowId);
|
|
17950
18002
|
}
|
|
17951
18003
|
async function sendSwitchChannelUI(channel, winId) {
|
|
17952
|
-
await
|
|
17953
|
-
swId: winId !== null && winId !== void 0 ? winId : windowId,
|
|
17954
|
-
command: "switchChannel",
|
|
17955
|
-
data: { newChannel: channel }
|
|
17956
|
-
});
|
|
18004
|
+
await invoke("switchChannel", { newChannel: channel }, winId !== null && winId !== void 0 ? winId : windowId);
|
|
17957
18005
|
}
|
|
17958
18006
|
async function setRestrictions(restrictions) {
|
|
17959
18007
|
var _a;
|
|
17960
|
-
await
|
|
17961
|
-
swId: (_a = restrictions.windowId) !== null && _a !== void 0 ? _a : windowId,
|
|
17962
|
-
command: "restrict",
|
|
17963
|
-
data: restrictions
|
|
17964
|
-
});
|
|
17965
|
-
return;
|
|
18008
|
+
await invoke("restrict", restrictions, (_a = restrictions.windowId) !== null && _a !== void 0 ? _a : windowId);
|
|
17966
18009
|
}
|
|
17967
18010
|
async function getRestrictionsByWindow(id) {
|
|
17968
18011
|
try {
|
|
17969
|
-
const result = await
|
|
17970
|
-
swId: id !== null && id !== void 0 ? id : windowId,
|
|
17971
|
-
command: "getRestrictions"
|
|
17972
|
-
});
|
|
18012
|
+
const result = await invoke("getRestrictions", {}, id !== null && id !== void 0 ? id : windowId);
|
|
17973
18013
|
return result.returned;
|
|
17974
18014
|
}
|
|
17975
18015
|
catch (e) {
|
|
17976
|
-
return;
|
|
17977
18016
|
}
|
|
17978
18017
|
}
|
|
17979
18018
|
async function setRestrictionsForAllChannels(restrictions) {
|
|
17980
18019
|
var _a;
|
|
17981
|
-
await
|
|
17982
|
-
swId: (_a = restrictions.windowId) !== null && _a !== void 0 ? _a : windowId,
|
|
17983
|
-
command: "restrictAll",
|
|
17984
|
-
data: restrictions
|
|
17985
|
-
});
|
|
17986
|
-
return;
|
|
18020
|
+
await invoke("restrictAll", restrictions, (_a = restrictions.windowId) !== null && _a !== void 0 ? _a : windowId);
|
|
17987
18021
|
}
|
|
17988
18022
|
async function getWindowsWithChannels(filter) {
|
|
17989
|
-
const result = await
|
|
18023
|
+
const result = await invoke("getChannelsInfo", { filter });
|
|
17990
18024
|
return result.returned;
|
|
17991
18025
|
}
|
|
17992
18026
|
async function addOrRemoveChannel(command, id, color, label) {
|
|
17993
|
-
await
|
|
18027
|
+
await invoke(command, { id, color, label });
|
|
17994
18028
|
}
|
|
17995
18029
|
async function getChannelsMode(config, i) {
|
|
17996
18030
|
if (typeof config.operationMode !== "boolean" && typeof config.operationMode === "string") {
|
|
@@ -17998,7 +18032,10 @@ async function getChannelsMode(config, i) {
|
|
|
17998
18032
|
return config.operationMode;
|
|
17999
18033
|
}
|
|
18000
18034
|
try {
|
|
18001
|
-
const result = await i.invoke(T42_ANNOUNCE_METHOD_NAME, { command: "getChannelsMode" }
|
|
18035
|
+
const result = await i.invoke(T42_ANNOUNCE_METHOD_NAME, { command: "getChannelsMode" }, "best", {
|
|
18036
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
18037
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS,
|
|
18038
|
+
});
|
|
18002
18039
|
if (result.returned.mode === "single") {
|
|
18003
18040
|
return "single";
|
|
18004
18041
|
}
|
|
@@ -18013,6 +18050,16 @@ async function getChannelsMode(config, i) {
|
|
|
18013
18050
|
return "single";
|
|
18014
18051
|
}
|
|
18015
18052
|
}
|
|
18053
|
+
function invoke(command, data, swId) {
|
|
18054
|
+
const args = { command, data };
|
|
18055
|
+
if (swId) {
|
|
18056
|
+
args.swId = swId;
|
|
18057
|
+
}
|
|
18058
|
+
return interop.invoke(T42_ANNOUNCE_METHOD_NAME, args, "best", {
|
|
18059
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
18060
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS,
|
|
18061
|
+
});
|
|
18062
|
+
}
|
|
18016
18063
|
function validateMode(mode) {
|
|
18017
18064
|
if (mode !== "single" && mode !== "multi") {
|
|
18018
18065
|
throw new Error(`Invalid mode: ${mode}`);
|
|
@@ -18982,7 +19029,10 @@ class HotkeysImpl {
|
|
|
18982
19029
|
await this.registerInvokeAGMMethod();
|
|
18983
19030
|
}
|
|
18984
19031
|
this.registry.add(hkToLower, callback);
|
|
18985
|
-
await this.agm.invoke(CommandMethod, { command: RegisterCommand, hotkey: hkToLower, description: info.description }
|
|
19032
|
+
await this.agm.invoke(CommandMethod, { command: RegisterCommand, hotkey: hkToLower, description: info.description }, "best", {
|
|
19033
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19034
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19035
|
+
});
|
|
18986
19036
|
this.hotkeys.set(hkToLower, info);
|
|
18987
19037
|
}
|
|
18988
19038
|
async unregister(hotkey) {
|
|
@@ -18993,12 +19043,18 @@ class HotkeysImpl {
|
|
|
18993
19043
|
throw new Error("hotkey parameter must be string");
|
|
18994
19044
|
}
|
|
18995
19045
|
const hkToLower = this.formatHotkey(hotkey);
|
|
18996
|
-
await this.agm.invoke(CommandMethod, { command: UnregisterCommand, hotkey: hkToLower }
|
|
19046
|
+
await this.agm.invoke(CommandMethod, { command: UnregisterCommand, hotkey: hkToLower }, "best", {
|
|
19047
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19048
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19049
|
+
});
|
|
18997
19050
|
this.hotkeys.delete(hkToLower);
|
|
18998
19051
|
this.registry.clearKey(hkToLower);
|
|
18999
19052
|
}
|
|
19000
19053
|
async unregisterAll() {
|
|
19001
|
-
await this.agm.invoke(CommandMethod, { command: UnregisterAllCommand }
|
|
19054
|
+
await this.agm.invoke(CommandMethod, { command: UnregisterAllCommand }, "best", {
|
|
19055
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19056
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19057
|
+
});
|
|
19002
19058
|
this.hotkeys.clear();
|
|
19003
19059
|
this.registry.clear();
|
|
19004
19060
|
}
|
|
@@ -19031,7 +19087,7 @@ function factory$3(agm) {
|
|
|
19031
19087
|
};
|
|
19032
19088
|
}
|
|
19033
19089
|
|
|
19034
|
-
var version = "6.
|
|
19090
|
+
var version = "6.11.0";
|
|
19035
19091
|
|
|
19036
19092
|
var prepareConfig = (options) => {
|
|
19037
19093
|
function getLibConfig(value, defaultMode, trueMode) {
|
|
@@ -19149,16 +19205,25 @@ class PanelAPI {
|
|
|
19149
19205
|
return this.onStreamEvent("on-panel-visibility-changed", callback);
|
|
19150
19206
|
}
|
|
19151
19207
|
toggle() {
|
|
19152
|
-
return this.interop.invoke("T42.Notifications.Show"
|
|
19208
|
+
return this.interop.invoke("T42.Notifications.Show", undefined, "best", {
|
|
19209
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19210
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19211
|
+
});
|
|
19153
19212
|
}
|
|
19154
19213
|
show() {
|
|
19155
|
-
return this.interop.invoke("T42.Notifications.Show", { show: true }
|
|
19214
|
+
return this.interop.invoke("T42.Notifications.Show", { show: true }, "best", {
|
|
19215
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19216
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19217
|
+
});
|
|
19156
19218
|
}
|
|
19157
19219
|
hide() {
|
|
19158
19220
|
return this.interop.invoke("T42.Notifications.Hide");
|
|
19159
19221
|
}
|
|
19160
19222
|
async isVisible() {
|
|
19161
|
-
const interopResult = await this.interop.invoke("T42.Notifications.Execute", { command: "isPanelVisible" }
|
|
19223
|
+
const interopResult = await this.interop.invoke("T42.Notifications.Execute", { command: "isPanelVisible" }, "best", {
|
|
19224
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19225
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19226
|
+
});
|
|
19162
19227
|
return interopResult.returned.panelVisible;
|
|
19163
19228
|
}
|
|
19164
19229
|
toAPI() {
|
|
@@ -19180,6 +19245,7 @@ class Notifications {
|
|
|
19180
19245
|
this.NotificationsCounterStream = "T42.Notifications.Counter";
|
|
19181
19246
|
this.RaiseNotificationMethodName = "T42.GNS.Publish.RaiseNotification";
|
|
19182
19247
|
this.NotificationsExecuteMethod = "T42.Notifications.Execute";
|
|
19248
|
+
this.NotificationFilterMethodName = "T42.Notifications.Filter";
|
|
19183
19249
|
this.methodsRegistered = false;
|
|
19184
19250
|
this.NOTIFICATIONS_CONFIGURE_METHOD_NAME = "T42.Notifications.Configure";
|
|
19185
19251
|
this.methodNameRoot = "T42.Notifications.Handler-" + Utils.generateId();
|
|
@@ -19207,7 +19273,10 @@ class Notifications {
|
|
|
19207
19273
|
const g42notification = new Glue42Notification(options);
|
|
19208
19274
|
this.notifications[notification.id] = g42notification;
|
|
19209
19275
|
try {
|
|
19210
|
-
const invocationResult = await this.interop.invoke(this.RaiseNotificationMethodName, { notification }
|
|
19276
|
+
const invocationResult = await this.interop.invoke(this.RaiseNotificationMethodName, { notification }, "best", {
|
|
19277
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19278
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19279
|
+
});
|
|
19211
19280
|
g42notification.id = (_a = invocationResult.returned) === null || _a === void 0 ? void 0 : _a.id;
|
|
19212
19281
|
}
|
|
19213
19282
|
catch (err) {
|
|
@@ -19219,11 +19288,17 @@ class Notifications {
|
|
|
19219
19288
|
return g42notification;
|
|
19220
19289
|
}
|
|
19221
19290
|
async setFilter(filter) {
|
|
19222
|
-
const result = await this.interop.invoke(
|
|
19291
|
+
const result = await this.interop.invoke(this.NotificationFilterMethodName, filter, "best", {
|
|
19292
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19293
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19294
|
+
});
|
|
19223
19295
|
return result.returned;
|
|
19224
19296
|
}
|
|
19225
19297
|
async getFilter() {
|
|
19226
|
-
const result = await this.interop.invoke(
|
|
19298
|
+
const result = await this.interop.invoke(this.NotificationFilterMethodName, undefined, "best", {
|
|
19299
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19300
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19301
|
+
});
|
|
19227
19302
|
return result.returned;
|
|
19228
19303
|
}
|
|
19229
19304
|
async configure(options) {
|
|
@@ -19273,15 +19348,27 @@ class Notifications {
|
|
|
19273
19348
|
if (typeof options.closeNotificationOnClick !== "undefined" && typeof options.closeNotificationOnClick !== "boolean") {
|
|
19274
19349
|
throw new Error("Expected type of closeNotificationOnClick - boolean.");
|
|
19275
19350
|
}
|
|
19276
|
-
const result = await this.interop.invoke(this.NOTIFICATIONS_CONFIGURE_METHOD_NAME, options
|
|
19351
|
+
const result = await this.interop.invoke(this.NOTIFICATIONS_CONFIGURE_METHOD_NAME, options, "best", {
|
|
19352
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19353
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19354
|
+
});
|
|
19277
19355
|
return result.returned;
|
|
19278
19356
|
}
|
|
19279
19357
|
async getConfiguration() {
|
|
19280
|
-
const result = await this.interop.invoke(this.NotificationsExecuteMethod, { command: "getConfiguration" }
|
|
19358
|
+
const result = await this.interop.invoke(this.NotificationsExecuteMethod, { command: "getConfiguration" }, "best", {
|
|
19359
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19360
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19361
|
+
});
|
|
19281
19362
|
return result.returned;
|
|
19282
19363
|
}
|
|
19283
19364
|
async list() {
|
|
19284
|
-
const interopResult = await this.interop.invoke(this.NotificationsExecuteMethod, {
|
|
19365
|
+
const interopResult = await this.interop.invoke(this.NotificationsExecuteMethod, {
|
|
19366
|
+
command: "list",
|
|
19367
|
+
data: { statesVersion2: true }
|
|
19368
|
+
}, "best", {
|
|
19369
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19370
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19371
|
+
});
|
|
19285
19372
|
return interopResult.returned.notifications;
|
|
19286
19373
|
}
|
|
19287
19374
|
async updateData(id, data) {
|
|
@@ -19292,7 +19379,10 @@ class Notifications {
|
|
|
19292
19379
|
stringValue: JSON.stringify(data, replacer)
|
|
19293
19380
|
}
|
|
19294
19381
|
};
|
|
19295
|
-
const interopResult = await this.interop.invoke(this.NotificationsExecuteMethod, { command: "create-or-update-attribute", data: { id, attribute } }
|
|
19382
|
+
const interopResult = await this.interop.invoke(this.NotificationsExecuteMethod, { command: "create-or-update-attribute", data: { id, attribute } }, "best", {
|
|
19383
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19384
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19385
|
+
});
|
|
19296
19386
|
return interopResult.returned;
|
|
19297
19387
|
}
|
|
19298
19388
|
onRaised(callback) {
|
|
@@ -19338,10 +19428,16 @@ class Notifications {
|
|
|
19338
19428
|
};
|
|
19339
19429
|
}
|
|
19340
19430
|
async clearAll() {
|
|
19341
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearAll" }
|
|
19431
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearAll" }, "best", {
|
|
19432
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19433
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19434
|
+
});
|
|
19342
19435
|
}
|
|
19343
19436
|
async clearOld() {
|
|
19344
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearAllOld", data: { statesVersion2: true } }
|
|
19437
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearAllOld", data: { statesVersion2: true } }, "best", {
|
|
19438
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19439
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19440
|
+
});
|
|
19345
19441
|
}
|
|
19346
19442
|
async clear(id) {
|
|
19347
19443
|
if (!id) {
|
|
@@ -19350,17 +19446,29 @@ class Notifications {
|
|
|
19350
19446
|
if (typeof (id) !== "string") {
|
|
19351
19447
|
throw new Error("The 'id' argument must be a string");
|
|
19352
19448
|
}
|
|
19353
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clear", data: { id } }
|
|
19449
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clear", data: { id } }, "best", {
|
|
19450
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19451
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19452
|
+
});
|
|
19354
19453
|
}
|
|
19355
19454
|
async clearMany(notifications) {
|
|
19356
19455
|
this.validateNotificationsArr(notifications);
|
|
19357
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearMany", data: { notifications } }
|
|
19456
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearMany", data: { notifications } }, "best", {
|
|
19457
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19458
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19459
|
+
});
|
|
19358
19460
|
}
|
|
19359
19461
|
async click(id, action, options) {
|
|
19360
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "click", data: { id, action, options } }
|
|
19462
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "click", data: { id, action, options } }, "best", {
|
|
19463
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19464
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19465
|
+
});
|
|
19361
19466
|
}
|
|
19362
19467
|
async snooze(id, duration) {
|
|
19363
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "snooze", data: { id, duration } }
|
|
19468
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "snooze", data: { id, duration } }, "best", {
|
|
19469
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19470
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19471
|
+
});
|
|
19364
19472
|
}
|
|
19365
19473
|
async snoozeMany(notifications, duration) {
|
|
19366
19474
|
if (!duration) {
|
|
@@ -19370,7 +19478,10 @@ class Notifications {
|
|
|
19370
19478
|
throw new Error("The 'duration' argument must be a valid number");
|
|
19371
19479
|
}
|
|
19372
19480
|
this.validateNotificationsArr(notifications);
|
|
19373
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "snoozeMany", data: { notifications, duration } }
|
|
19481
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "snoozeMany", data: { notifications, duration } }, "best", {
|
|
19482
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19483
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19484
|
+
});
|
|
19374
19485
|
}
|
|
19375
19486
|
async setState(id, state) {
|
|
19376
19487
|
if (!id) {
|
|
@@ -19383,7 +19494,10 @@ class Notifications {
|
|
|
19383
19494
|
throw new Error("The 'state' argument cannot be null or undefined");
|
|
19384
19495
|
}
|
|
19385
19496
|
this.validateState(state);
|
|
19386
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "updateState", data: { id, state } }
|
|
19497
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "updateState", data: { id, state } }, "best", {
|
|
19498
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19499
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19500
|
+
});
|
|
19387
19501
|
}
|
|
19388
19502
|
async setStates(notifications, state) {
|
|
19389
19503
|
if (!state) {
|
|
@@ -19393,7 +19507,10 @@ class Notifications {
|
|
|
19393
19507
|
throw new Error("The 'state' argument must be a valid string");
|
|
19394
19508
|
}
|
|
19395
19509
|
this.validateNotificationsArr(notifications);
|
|
19396
|
-
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "updateStates", data: { notifications, state } }
|
|
19510
|
+
await this.interop.invoke(this.NotificationsExecuteMethod, { command: "updateStates", data: { notifications, state } }, "best", {
|
|
19511
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19512
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19513
|
+
});
|
|
19397
19514
|
}
|
|
19398
19515
|
toAPI() {
|
|
19399
19516
|
return {
|
|
@@ -19429,7 +19546,10 @@ class Notifications {
|
|
|
19429
19546
|
throw new Error("Notifications argument must be a valid array with notification options");
|
|
19430
19547
|
}
|
|
19431
19548
|
const notificationsToImport = await Promise.all(notifications.map((notificationOptions) => this.createNotification(notificationOptions, true)));
|
|
19432
|
-
const invocationResult = await this.interop.invoke(this.NotificationsExecuteMethod, { command: "importNotifications", data: { notificationSettings: notificationsToImport } }
|
|
19549
|
+
const invocationResult = await this.interop.invoke(this.NotificationsExecuteMethod, { command: "importNotifications", data: { notificationSettings: notificationsToImport } }, "best", {
|
|
19550
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
19551
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
19552
|
+
});
|
|
19433
19553
|
return invocationResult.returned.notifications;
|
|
19434
19554
|
}
|
|
19435
19555
|
async createNotification(options, imported) {
|
|
@@ -21397,7 +21517,10 @@ class Intents {
|
|
|
21397
21517
|
await Promise.all(this.unregisterIntentPromises);
|
|
21398
21518
|
let apps;
|
|
21399
21519
|
try {
|
|
21400
|
-
const result = await this.interop.invoke("T42.ACS.GetApplications", { withIntentsInfo: true }
|
|
21520
|
+
const result = await this.interop.invoke("T42.ACS.GetApplications", { withIntentsInfo: true }, "best", {
|
|
21521
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
21522
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
21523
|
+
});
|
|
21401
21524
|
apps = result.returned.applications;
|
|
21402
21525
|
}
|
|
21403
21526
|
catch (e) {
|
|
@@ -21436,7 +21559,10 @@ class Intents {
|
|
|
21436
21559
|
let windowsInfos;
|
|
21437
21560
|
if (isT42WndGetInfoMethodRegistered) {
|
|
21438
21561
|
try {
|
|
21439
|
-
const result = await this.interop.invoke(T42WndGetInfo, { ids: serverWindowIds }
|
|
21562
|
+
const result = await this.interop.invoke(T42WndGetInfo, { ids: serverWindowIds }, "best", {
|
|
21563
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
21564
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
21565
|
+
});
|
|
21440
21566
|
windowsInfos = result.returned.windows;
|
|
21441
21567
|
}
|
|
21442
21568
|
catch (e) {
|
|
@@ -21887,7 +22013,10 @@ class Intents {
|
|
|
21887
22013
|
this.intentsResolverResponsePromises[instanceId] = { intent, resolve, reject, promise, methodName: responseMethodName };
|
|
21888
22014
|
}
|
|
21889
22015
|
async invokeStartApp(application, context, options) {
|
|
21890
|
-
const result = await this.interop.invoke("T42.ACS.StartApplication", { Name: application, options: { ...options, startedByIntentAPI: true } }
|
|
22016
|
+
const result = await this.interop.invoke("T42.ACS.StartApplication", { Name: application, options: { ...options, startedByIntentAPI: true } }, "best", {
|
|
22017
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22018
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22019
|
+
});
|
|
21891
22020
|
return result.returned.Id;
|
|
21892
22021
|
}
|
|
21893
22022
|
subscribeOnInstanceStopped(instance, method) {
|
|
@@ -21973,10 +22102,10 @@ class Intents {
|
|
|
21973
22102
|
return handlers.length > 1;
|
|
21974
22103
|
}
|
|
21975
22104
|
if (request.target === "reuse") {
|
|
21976
|
-
return handlers.filter(
|
|
22105
|
+
return handlers.filter(handler => handler.type === "instance" && handler.instanceId).length > 1 || intent.handlers.filter(handler => handler.type === "app").length > 1;
|
|
21977
22106
|
}
|
|
21978
22107
|
if (request.target === "startNew") {
|
|
21979
|
-
return handlers.filter(
|
|
22108
|
+
return handlers.filter(handler => handler.type === "app").length > 1;
|
|
21980
22109
|
}
|
|
21981
22110
|
if (request.target.instance) {
|
|
21982
22111
|
return false;
|
|
@@ -22218,13 +22347,19 @@ class Prefs {
|
|
|
22218
22347
|
this.interopMethodRegistered = false;
|
|
22219
22348
|
}
|
|
22220
22349
|
async get(app) {
|
|
22221
|
-
const data = (await this.interop.invoke(
|
|
22350
|
+
const data = (await this.interop.invoke(Prefs.T42GetPrefsMethodName, { app: app !== null && app !== void 0 ? app : this.appName }, "best", {
|
|
22351
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22352
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22353
|
+
}));
|
|
22222
22354
|
return data.returned;
|
|
22223
22355
|
}
|
|
22224
22356
|
async set(data, options) {
|
|
22225
22357
|
var _a;
|
|
22226
22358
|
this.verifyDataObject(data);
|
|
22227
|
-
await this.interop.invoke(
|
|
22359
|
+
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", {
|
|
22360
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22361
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22362
|
+
});
|
|
22228
22363
|
}
|
|
22229
22364
|
async setFor(app, data) {
|
|
22230
22365
|
this.verifyApp(app);
|
|
@@ -22234,7 +22369,10 @@ class Prefs {
|
|
|
22234
22369
|
async update(data, options) {
|
|
22235
22370
|
var _a;
|
|
22236
22371
|
this.verifyDataObject(data);
|
|
22237
|
-
await this.interop.invoke(
|
|
22372
|
+
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", {
|
|
22373
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22374
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22375
|
+
});
|
|
22238
22376
|
}
|
|
22239
22377
|
async updateFor(app, data) {
|
|
22240
22378
|
this.verifyApp(app);
|
|
@@ -22242,18 +22380,30 @@ class Prefs {
|
|
|
22242
22380
|
return this.update(data, { app });
|
|
22243
22381
|
}
|
|
22244
22382
|
async clear(app) {
|
|
22245
|
-
await this.interop.invoke(
|
|
22383
|
+
await this.interop.invoke(Prefs.T42SetPrefsMethodName, { app: app !== null && app !== void 0 ? app : this.appName, clear: true }, "best", {
|
|
22384
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22385
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22386
|
+
});
|
|
22246
22387
|
}
|
|
22247
22388
|
async clearFor(app) {
|
|
22248
22389
|
this.verifyApp(app);
|
|
22249
|
-
await this.interop.invoke(
|
|
22390
|
+
await this.interop.invoke(Prefs.T42SetPrefsMethodName, { app, clear: true }, "best", {
|
|
22391
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22392
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22393
|
+
});
|
|
22250
22394
|
}
|
|
22251
22395
|
async getAll() {
|
|
22252
|
-
const data = (await this.interop.invoke(
|
|
22396
|
+
const data = (await this.interop.invoke(Prefs.T42GetPrefsMethodName, undefined, "best", {
|
|
22397
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22398
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22399
|
+
}));
|
|
22253
22400
|
return data.returned;
|
|
22254
22401
|
}
|
|
22255
22402
|
async clearAll() {
|
|
22256
|
-
await this.interop.invoke(
|
|
22403
|
+
await this.interop.invoke(Prefs.T42SetPrefsMethodName, { clear: true }, "best", {
|
|
22404
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22405
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22406
|
+
});
|
|
22257
22407
|
}
|
|
22258
22408
|
subscribe(callback) {
|
|
22259
22409
|
this.verifyCallback(callback);
|
|
@@ -22265,7 +22415,10 @@ class Prefs {
|
|
|
22265
22415
|
const unsubscribeFn = this.registry.add(app, callback);
|
|
22266
22416
|
this.registerInteropIfNeeded()
|
|
22267
22417
|
.then(() => {
|
|
22268
|
-
this.interop.invoke(
|
|
22418
|
+
this.interop.invoke(Prefs.T42GetPrefsMethodName, { app, subscribe: true }, "best", {
|
|
22419
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22420
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22421
|
+
});
|
|
22269
22422
|
});
|
|
22270
22423
|
return () => {
|
|
22271
22424
|
unsubscribeFn();
|
|
@@ -22276,7 +22429,7 @@ class Prefs {
|
|
|
22276
22429
|
return;
|
|
22277
22430
|
}
|
|
22278
22431
|
this.interopMethodRegistered = true;
|
|
22279
|
-
await this.interop.register(
|
|
22432
|
+
await this.interop.register(Prefs.T42UpdatePrefsMethodName, (args) => {
|
|
22280
22433
|
this.registry.execute(args.app, args);
|
|
22281
22434
|
});
|
|
22282
22435
|
}
|
|
@@ -22302,6 +22455,9 @@ class Prefs {
|
|
|
22302
22455
|
}
|
|
22303
22456
|
}
|
|
22304
22457
|
}
|
|
22458
|
+
Prefs.T42UpdatePrefsMethodName = "T42.Prefs.Update";
|
|
22459
|
+
Prefs.T42GetPrefsMethodName = "T42.Prefs.Get";
|
|
22460
|
+
Prefs.T42SetPrefsMethodName = "T42.Prefs.Set";
|
|
22305
22461
|
|
|
22306
22462
|
class Cookies {
|
|
22307
22463
|
constructor(methodName, interop) {
|
|
@@ -22326,7 +22482,10 @@ class Cookies {
|
|
|
22326
22482
|
await this.invoke("remove-cookie", { url, name });
|
|
22327
22483
|
}
|
|
22328
22484
|
invoke(command, data) {
|
|
22329
|
-
return this.interop.invoke(this.methodName, { command, args: data }
|
|
22485
|
+
return this.interop.invoke(this.methodName, { command, args: data }, "best", {
|
|
22486
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22487
|
+
methodResponseTimeoutMs: INTEROP_METHOD_RESPONSE_TIMEOUT_MS,
|
|
22488
|
+
});
|
|
22330
22489
|
}
|
|
22331
22490
|
verifyCookieObject(cookie) {
|
|
22332
22491
|
if (!cookie) {
|
|
@@ -22474,6 +22633,9 @@ class Interception {
|
|
|
22474
22633
|
await this.interop.invoke(this.InterceptorMethodName, {
|
|
22475
22634
|
command: "register",
|
|
22476
22635
|
interceptions
|
|
22636
|
+
}, "best", {
|
|
22637
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22638
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22477
22639
|
});
|
|
22478
22640
|
await this.registerMethodIfNotRegistered();
|
|
22479
22641
|
}
|
|
@@ -22494,6 +22656,9 @@ class Interception {
|
|
|
22494
22656
|
await this.interop.invoke(this.InterceptorMethodName, {
|
|
22495
22657
|
command: "unregister",
|
|
22496
22658
|
interceptions
|
|
22659
|
+
}, "best", {
|
|
22660
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22661
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22497
22662
|
});
|
|
22498
22663
|
this.interceptions = this.interceptions.filter((config) => {
|
|
22499
22664
|
return !interceptions.some((interception) => {
|
|
@@ -22521,7 +22686,10 @@ class Interception {
|
|
|
22521
22686
|
operation,
|
|
22522
22687
|
phase
|
|
22523
22688
|
}]
|
|
22524
|
-
}, 'best', {
|
|
22689
|
+
}, 'best', {
|
|
22690
|
+
waitTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS,
|
|
22691
|
+
methodResponseTimeoutMs: INTEROP_METHOD_WAIT_TIMEOUT_MS
|
|
22692
|
+
});
|
|
22525
22693
|
return result.returned;
|
|
22526
22694
|
}
|
|
22527
22695
|
static createProxyObject(apiToIntercept, domain, interception) {
|