@openfin/core 40.104.2 → 40.104.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/mock-alpha.d.ts +18 -0
- package/out/mock-beta.d.ts +18 -0
- package/out/mock-public.d.ts +18 -0
- package/out/stub.d.ts +18 -0
- package/out/stub.js +139 -106
- package/package.json +1 -1
package/out/mock-alpha.d.ts
CHANGED
@@ -3069,6 +3069,7 @@ declare type ClientInfo = Omit<ClientIdentity, 'isLocalEndpointId'> & {
|
|
3069
3069
|
*
|
3070
3070
|
*/
|
3071
3071
|
declare class Clipboard_2 extends Base {
|
3072
|
+
#private;
|
3072
3073
|
/**
|
3073
3074
|
* Writes data into the clipboard as plain text
|
3074
3075
|
* @param writeObj The object for writing data into the clipboard
|
@@ -3221,6 +3222,21 @@ declare class Clipboard_2 extends Base {
|
|
3221
3222
|
getAvailableFormats(type?: OpenFin_2.ClipboardSelectionType): Promise<Array<string>>;
|
3222
3223
|
}
|
3223
3224
|
|
3225
|
+
/**
|
3226
|
+
* Permissions for {@link Clipboard} APIs.
|
3227
|
+
*/
|
3228
|
+
declare type ClipboardApiPermissions = {
|
3229
|
+
writeText: boolean;
|
3230
|
+
readText: boolean;
|
3231
|
+
writeImage: boolean;
|
3232
|
+
readImage: boolean;
|
3233
|
+
writeHtml: boolean;
|
3234
|
+
readHtml: boolean;
|
3235
|
+
writeRtf: boolean;
|
3236
|
+
readRtf: boolean;
|
3237
|
+
write: boolean;
|
3238
|
+
};
|
3239
|
+
|
3224
3240
|
/**
|
3225
3241
|
* Generated when a copy operation is blocked through {@link OpenFin.DomainSettings}.
|
3226
3242
|
* @interface
|
@@ -9519,6 +9535,7 @@ declare namespace OpenFin_2 {
|
|
9519
9535
|
OpenExternalPermission,
|
9520
9536
|
DeviceInfo,
|
9521
9537
|
Permissions_2 as Permissions,
|
9538
|
+
ClipboardApiPermissions,
|
9522
9539
|
PlatformWindowCreationOptions,
|
9523
9540
|
PlatformWindowOptions,
|
9524
9541
|
PlatformViewCreationOptions,
|
@@ -10030,6 +10047,7 @@ declare type PerformanceReportEvent = Performance & BaseEvent_5 & {
|
|
10030
10047
|
declare type Permissions_2 = {
|
10031
10048
|
Application?: Partial<ApplicationPermissions>;
|
10032
10049
|
System?: Partial<SystemPermissions>;
|
10050
|
+
Clipboard?: Partial<ClipboardApiPermissions>;
|
10033
10051
|
webAPIs?: WebPermission[];
|
10034
10052
|
devices?: DeviceInfo[];
|
10035
10053
|
};
|
package/out/mock-beta.d.ts
CHANGED
@@ -3069,6 +3069,7 @@ declare type ClientInfo = Omit<ClientIdentity, 'isLocalEndpointId'> & {
|
|
3069
3069
|
*
|
3070
3070
|
*/
|
3071
3071
|
declare class Clipboard_2 extends Base {
|
3072
|
+
#private;
|
3072
3073
|
/**
|
3073
3074
|
* Writes data into the clipboard as plain text
|
3074
3075
|
* @param writeObj The object for writing data into the clipboard
|
@@ -3221,6 +3222,21 @@ declare class Clipboard_2 extends Base {
|
|
3221
3222
|
getAvailableFormats(type?: OpenFin_2.ClipboardSelectionType): Promise<Array<string>>;
|
3222
3223
|
}
|
3223
3224
|
|
3225
|
+
/**
|
3226
|
+
* Permissions for {@link Clipboard} APIs.
|
3227
|
+
*/
|
3228
|
+
declare type ClipboardApiPermissions = {
|
3229
|
+
writeText: boolean;
|
3230
|
+
readText: boolean;
|
3231
|
+
writeImage: boolean;
|
3232
|
+
readImage: boolean;
|
3233
|
+
writeHtml: boolean;
|
3234
|
+
readHtml: boolean;
|
3235
|
+
writeRtf: boolean;
|
3236
|
+
readRtf: boolean;
|
3237
|
+
write: boolean;
|
3238
|
+
};
|
3239
|
+
|
3224
3240
|
/**
|
3225
3241
|
* Generated when a copy operation is blocked through {@link OpenFin.DomainSettings}.
|
3226
3242
|
* @interface
|
@@ -9519,6 +9535,7 @@ declare namespace OpenFin_2 {
|
|
9519
9535
|
OpenExternalPermission,
|
9520
9536
|
DeviceInfo,
|
9521
9537
|
Permissions_2 as Permissions,
|
9538
|
+
ClipboardApiPermissions,
|
9522
9539
|
PlatformWindowCreationOptions,
|
9523
9540
|
PlatformWindowOptions,
|
9524
9541
|
PlatformViewCreationOptions,
|
@@ -10030,6 +10047,7 @@ declare type PerformanceReportEvent = Performance & BaseEvent_5 & {
|
|
10030
10047
|
declare type Permissions_2 = {
|
10031
10048
|
Application?: Partial<ApplicationPermissions>;
|
10032
10049
|
System?: Partial<SystemPermissions>;
|
10050
|
+
Clipboard?: Partial<ClipboardApiPermissions>;
|
10033
10051
|
webAPIs?: WebPermission[];
|
10034
10052
|
devices?: DeviceInfo[];
|
10035
10053
|
};
|
package/out/mock-public.d.ts
CHANGED
@@ -3069,6 +3069,7 @@ declare type ClientInfo = Omit<ClientIdentity, 'isLocalEndpointId'> & {
|
|
3069
3069
|
*
|
3070
3070
|
*/
|
3071
3071
|
declare class Clipboard_2 extends Base {
|
3072
|
+
#private;
|
3072
3073
|
/**
|
3073
3074
|
* Writes data into the clipboard as plain text
|
3074
3075
|
* @param writeObj The object for writing data into the clipboard
|
@@ -3221,6 +3222,21 @@ declare class Clipboard_2 extends Base {
|
|
3221
3222
|
getAvailableFormats(type?: OpenFin_2.ClipboardSelectionType): Promise<Array<string>>;
|
3222
3223
|
}
|
3223
3224
|
|
3225
|
+
/**
|
3226
|
+
* Permissions for {@link Clipboard} APIs.
|
3227
|
+
*/
|
3228
|
+
declare type ClipboardApiPermissions = {
|
3229
|
+
writeText: boolean;
|
3230
|
+
readText: boolean;
|
3231
|
+
writeImage: boolean;
|
3232
|
+
readImage: boolean;
|
3233
|
+
writeHtml: boolean;
|
3234
|
+
readHtml: boolean;
|
3235
|
+
writeRtf: boolean;
|
3236
|
+
readRtf: boolean;
|
3237
|
+
write: boolean;
|
3238
|
+
};
|
3239
|
+
|
3224
3240
|
/**
|
3225
3241
|
* Generated when a copy operation is blocked through {@link OpenFin.DomainSettings}.
|
3226
3242
|
* @interface
|
@@ -9519,6 +9535,7 @@ declare namespace OpenFin_2 {
|
|
9519
9535
|
OpenExternalPermission,
|
9520
9536
|
DeviceInfo,
|
9521
9537
|
Permissions_2 as Permissions,
|
9538
|
+
ClipboardApiPermissions,
|
9522
9539
|
PlatformWindowCreationOptions,
|
9523
9540
|
PlatformWindowOptions,
|
9524
9541
|
PlatformViewCreationOptions,
|
@@ -10030,6 +10047,7 @@ declare type PerformanceReportEvent = Performance & BaseEvent_5 & {
|
|
10030
10047
|
declare type Permissions_2 = {
|
10031
10048
|
Application?: Partial<ApplicationPermissions>;
|
10032
10049
|
System?: Partial<SystemPermissions>;
|
10050
|
+
Clipboard?: Partial<ClipboardApiPermissions>;
|
10033
10051
|
webAPIs?: WebPermission[];
|
10034
10052
|
devices?: DeviceInfo[];
|
10035
10053
|
};
|
package/out/stub.d.ts
CHANGED
@@ -3125,6 +3125,7 @@ declare type ClientInfo = Omit<ClientIdentity, 'isLocalEndpointId'> & {
|
|
3125
3125
|
*
|
3126
3126
|
*/
|
3127
3127
|
declare class Clipboard_2 extends Base {
|
3128
|
+
#private;
|
3128
3129
|
/**
|
3129
3130
|
* Writes data into the clipboard as plain text
|
3130
3131
|
* @param writeObj The object for writing data into the clipboard
|
@@ -3277,6 +3278,21 @@ declare class Clipboard_2 extends Base {
|
|
3277
3278
|
getAvailableFormats(type?: OpenFin_2.ClipboardSelectionType): Promise<Array<string>>;
|
3278
3279
|
}
|
3279
3280
|
|
3281
|
+
/**
|
3282
|
+
* Permissions for {@link Clipboard} APIs.
|
3283
|
+
*/
|
3284
|
+
declare type ClipboardApiPermissions = {
|
3285
|
+
writeText: boolean;
|
3286
|
+
readText: boolean;
|
3287
|
+
writeImage: boolean;
|
3288
|
+
readImage: boolean;
|
3289
|
+
writeHtml: boolean;
|
3290
|
+
readHtml: boolean;
|
3291
|
+
writeRtf: boolean;
|
3292
|
+
readRtf: boolean;
|
3293
|
+
write: boolean;
|
3294
|
+
};
|
3295
|
+
|
3280
3296
|
/**
|
3281
3297
|
* Generated when a copy operation is blocked through {@link OpenFin.DomainSettings}.
|
3282
3298
|
* @interface
|
@@ -9837,6 +9853,7 @@ declare namespace OpenFin_2 {
|
|
9837
9853
|
OpenExternalPermission,
|
9838
9854
|
DeviceInfo,
|
9839
9855
|
Permissions_2 as Permissions,
|
9856
|
+
ClipboardApiPermissions,
|
9840
9857
|
PlatformWindowCreationOptions,
|
9841
9858
|
PlatformWindowOptions,
|
9842
9859
|
PlatformViewCreationOptions,
|
@@ -10348,6 +10365,7 @@ declare type PerformanceReportEvent = Performance & BaseEvent_5 & {
|
|
10348
10365
|
declare type Permissions_2 = {
|
10349
10366
|
Application?: Partial<ApplicationPermissions>;
|
10350
10367
|
System?: Partial<SystemPermissions>;
|
10368
|
+
Clipboard?: Partial<ClipboardApiPermissions>;
|
10351
10369
|
webAPIs?: WebPermission[];
|
10352
10370
|
devices?: DeviceInfo[];
|
10353
10371
|
};
|
package/out/stub.js
CHANGED
@@ -361,13 +361,13 @@ async function promiseMapSerial(arr, func) {
|
|
361
361
|
}
|
362
362
|
promises.promiseMapSerial = promiseMapSerial;
|
363
363
|
|
364
|
-
var __classPrivateFieldSet$
|
364
|
+
var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
365
365
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
366
366
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
367
367
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
368
368
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
369
369
|
};
|
370
|
-
var __classPrivateFieldGet$
|
370
|
+
var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
371
371
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
372
372
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
373
373
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -452,7 +452,7 @@ class EmitterBase extends Base {
|
|
452
452
|
this.emit = (eventType, payload, ...args) => {
|
453
453
|
return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
|
454
454
|
};
|
455
|
-
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$
|
455
|
+
this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$f(this, _EmitterBase_emitterAccessor, "f"));
|
456
456
|
/**
|
457
457
|
* Cleans up after removal of a listener, e.g. deleting any lingering deregistration handlers for a
|
458
458
|
* `once` subscription.
|
@@ -462,14 +462,14 @@ class EmitterBase extends Base {
|
|
462
462
|
* which would involve less "magic," but would be more-vulnerable to accidental re-introduction of a leak.
|
463
463
|
*/
|
464
464
|
this.cleanUpRemovedListener = (eventType, listener) => {
|
465
|
-
const deregister = __classPrivateFieldGet$
|
465
|
+
const deregister = __classPrivateFieldGet$f(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
|
466
466
|
if (deregister) {
|
467
|
-
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
467
|
+
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$f(this, _EmitterBase_emitterAccessor, "f"));
|
468
468
|
emitter.removeListener(eventType, deregister);
|
469
469
|
}
|
470
470
|
};
|
471
471
|
this.getOrCreateEmitter = () => {
|
472
|
-
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$
|
472
|
+
const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$f(this, _EmitterBase_emitterAccessor, "f"));
|
473
473
|
if (!emitter.listeners('removeListener').includes(this.cleanUpRemovedListener)) {
|
474
474
|
emitter.on('removeListener', this.cleanUpRemovedListener);
|
475
475
|
}
|
@@ -511,8 +511,8 @@ class EmitterBase extends Base {
|
|
511
511
|
// This will only be reached if unsubscribe from event that does not exist but do not want to error here
|
512
512
|
return Promise.resolve();
|
513
513
|
};
|
514
|
-
__classPrivateFieldSet$
|
515
|
-
__classPrivateFieldSet$
|
514
|
+
__classPrivateFieldSet$e(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
515
|
+
__classPrivateFieldSet$e(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
|
516
516
|
this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
|
517
517
|
}
|
518
518
|
/**
|
@@ -541,7 +541,7 @@ class EmitterBase extends Base {
|
|
541
541
|
*/
|
542
542
|
async once(eventType, listener, options) {
|
543
543
|
const deregister = () => this.deregisterEventListener(eventType);
|
544
|
-
__classPrivateFieldGet$
|
544
|
+
__classPrivateFieldGet$f(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
545
545
|
await this.registerEventListener(eventType, options, (emitter) => {
|
546
546
|
emitter.once(eventType, deregister);
|
547
547
|
emitter.once(eventType, listener);
|
@@ -572,7 +572,7 @@ class EmitterBase extends Base {
|
|
572
572
|
*/
|
573
573
|
async prependOnceListener(eventType, listener, options) {
|
574
574
|
const deregister = () => this.deregisterEventListener(eventType);
|
575
|
-
__classPrivateFieldGet$
|
575
|
+
__classPrivateFieldGet$f(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
|
576
576
|
await this.registerEventListener(eventType, options, (emitter) => {
|
577
577
|
emitter.prependOnceListener(eventType, listener);
|
578
578
|
emitter.once(eventType, deregister);
|
@@ -632,7 +632,7 @@ class EmitterBase extends Base {
|
|
632
632
|
}
|
633
633
|
deleteEmitterIfNothingRegistered(emitter) {
|
634
634
|
if (emitter.eventNames().every((type) => type === 'removeListener')) {
|
635
|
-
this.wire.eventAggregator.delete(__classPrivateFieldGet$
|
635
|
+
this.wire.eventAggregator.delete(__classPrivateFieldGet$f(this, _EmitterBase_emitterAccessor, "f"));
|
636
636
|
}
|
637
637
|
}
|
638
638
|
}
|
@@ -7713,12 +7713,12 @@ class ChannelError extends Error {
|
|
7713
7713
|
}
|
7714
7714
|
channelError.ChannelError = ChannelError;
|
7715
7715
|
|
7716
|
-
var __classPrivateFieldGet$
|
7716
|
+
var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
7717
7717
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
7718
7718
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
7719
7719
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
7720
7720
|
};
|
7721
|
-
var __classPrivateFieldSet$
|
7721
|
+
var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
7722
7722
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
7723
7723
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
7724
7724
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
@@ -7762,7 +7762,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7762
7762
|
static closeChannelByEndpointId(id) {
|
7763
7763
|
const channel = channelClientsByEndpointId.get(id);
|
7764
7764
|
if (channel) {
|
7765
|
-
__classPrivateFieldGet$
|
7765
|
+
__classPrivateFieldGet$e(channel, _ChannelClient_close, "f").call(channel);
|
7766
7766
|
}
|
7767
7767
|
}
|
7768
7768
|
/**
|
@@ -7773,7 +7773,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7773
7773
|
for (const channelClient of channelClientsByEndpointId.values()) {
|
7774
7774
|
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
7775
7775
|
channelClient.disconnectListener(eventPayload);
|
7776
|
-
__classPrivateFieldGet$
|
7776
|
+
__classPrivateFieldGet$e(channelClient, _ChannelClient_close, "f").call(channelClient);
|
7777
7777
|
}
|
7778
7778
|
}
|
7779
7779
|
}
|
@@ -7788,12 +7788,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7788
7788
|
this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
|
7789
7789
|
_ChannelClient_close.set(this, () => {
|
7790
7790
|
channelClientsByEndpointId.delete(this.endpointId);
|
7791
|
-
__classPrivateFieldGet$
|
7791
|
+
__classPrivateFieldGet$e(this, _ChannelClient_strategy, "f").close();
|
7792
7792
|
});
|
7793
|
-
__classPrivateFieldSet$
|
7793
|
+
__classPrivateFieldSet$d(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
|
7794
7794
|
this.disconnectListener = () => undefined;
|
7795
7795
|
this.endpointId = routingInfo.endpointId;
|
7796
|
-
__classPrivateFieldSet$
|
7796
|
+
__classPrivateFieldSet$d(this, _ChannelClient_strategy, strategy, "f");
|
7797
7797
|
channelClientsByEndpointId.set(this.endpointId, this);
|
7798
7798
|
strategy.receive(this.processAction);
|
7799
7799
|
}
|
@@ -7801,7 +7801,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7801
7801
|
* a read-only provider identity
|
7802
7802
|
*/
|
7803
7803
|
get providerIdentity() {
|
7804
|
-
const protectedObj = __classPrivateFieldGet$
|
7804
|
+
const protectedObj = __classPrivateFieldGet$e(this, _ChannelClient_protectedObj, "f");
|
7805
7805
|
return protectedObj.providerIdentity;
|
7806
7806
|
}
|
7807
7807
|
/**
|
@@ -7830,9 +7830,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7830
7830
|
* ```
|
7831
7831
|
*/
|
7832
7832
|
async dispatch(action, payload) {
|
7833
|
-
if (__classPrivateFieldGet$
|
7833
|
+
if (__classPrivateFieldGet$e(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
7834
7834
|
const callSites = transport_errors_1$2.RuntimeError.getCallSite();
|
7835
|
-
return __classPrivateFieldGet$
|
7835
|
+
return __classPrivateFieldGet$e(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
7836
7836
|
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
7837
7837
|
});
|
7838
7838
|
}
|
@@ -7884,10 +7884,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7884
7884
|
*/
|
7885
7885
|
async disconnect() {
|
7886
7886
|
await this.sendDisconnectAction();
|
7887
|
-
__classPrivateFieldGet$
|
7887
|
+
__classPrivateFieldGet$e(this, _ChannelClient_close, "f").call(this);
|
7888
7888
|
}
|
7889
7889
|
async sendDisconnectAction() {
|
7890
|
-
const protectedObj = __classPrivateFieldGet$
|
7890
|
+
const protectedObj = __classPrivateFieldGet$e(this, _ChannelClient_protectedObj, "f");
|
7891
7891
|
await protectedObj.close();
|
7892
7892
|
}
|
7893
7893
|
/**
|
@@ -7920,13 +7920,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
|
|
7920
7920
|
|
7921
7921
|
var strategy$3 = {};
|
7922
7922
|
|
7923
|
-
var __classPrivateFieldSet$
|
7923
|
+
var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
7924
7924
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
7925
7925
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
7926
7926
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
7927
7927
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
7928
7928
|
};
|
7929
|
-
var __classPrivateFieldGet$
|
7929
|
+
var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
7930
7930
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
7931
7931
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
7932
7932
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -7951,7 +7951,7 @@ class ClassicStrategy {
|
|
7951
7951
|
// connection problems occur
|
7952
7952
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
7953
7953
|
this.send = async (endpointId, action, payload) => {
|
7954
|
-
const to = __classPrivateFieldGet$
|
7954
|
+
const to = __classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
7955
7955
|
if (!to) {
|
7956
7956
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
7957
7957
|
}
|
@@ -7963,13 +7963,13 @@ class ClassicStrategy {
|
|
7963
7963
|
}
|
7964
7964
|
delete cleanId.isLocalEndpointId;
|
7965
7965
|
// grab the promise before awaiting it to save in our pending messages map
|
7966
|
-
const p = __classPrivateFieldGet$
|
7966
|
+
const p = __classPrivateFieldGet$d(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
7967
7967
|
...cleanId,
|
7968
7968
|
providerIdentity: this.providerIdentity,
|
7969
7969
|
action,
|
7970
7970
|
payload
|
7971
7971
|
});
|
7972
|
-
__classPrivateFieldGet$
|
7972
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
7973
7973
|
const raw = await p
|
7974
7974
|
.catch((error) => {
|
7975
7975
|
if ('cause' in error) {
|
@@ -7979,16 +7979,16 @@ class ClassicStrategy {
|
|
7979
7979
|
})
|
7980
7980
|
.finally(() => {
|
7981
7981
|
// clean up the pending promise
|
7982
|
-
__classPrivateFieldGet$
|
7982
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
7983
7983
|
});
|
7984
7984
|
return raw.payload.data.result;
|
7985
7985
|
};
|
7986
7986
|
this.close = async () => {
|
7987
7987
|
this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
|
7988
|
-
[...__classPrivateFieldGet$
|
7989
|
-
__classPrivateFieldSet$
|
7988
|
+
[...__classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
|
7989
|
+
__classPrivateFieldSet$c(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
|
7990
7990
|
};
|
7991
|
-
__classPrivateFieldSet$
|
7991
|
+
__classPrivateFieldSet$c(this, _ClassicStrategy_wire, wire, "f");
|
7992
7992
|
}
|
7993
7993
|
onEndpointDisconnect(endpointId, listener) {
|
7994
7994
|
// Never fires for 'classic'.
|
@@ -7997,20 +7997,20 @@ class ClassicStrategy {
|
|
7997
7997
|
this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
|
7998
7998
|
}
|
7999
7999
|
async closeEndpoint(endpointId) {
|
8000
|
-
const id = __classPrivateFieldGet$
|
8001
|
-
__classPrivateFieldGet$
|
8002
|
-
const pendingSet = __classPrivateFieldGet$
|
8000
|
+
const id = __classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
8001
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
8002
|
+
const pendingSet = __classPrivateFieldGet$d(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
8003
8003
|
pendingSet?.forEach((p) => {
|
8004
8004
|
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
8005
8005
|
p.cancel(new Error(errorMsg));
|
8006
8006
|
});
|
8007
8007
|
}
|
8008
8008
|
isEndpointConnected(endpointId) {
|
8009
|
-
return __classPrivateFieldGet$
|
8009
|
+
return __classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
|
8010
8010
|
}
|
8011
8011
|
addEndpoint(endpointId, payload) {
|
8012
|
-
__classPrivateFieldGet$
|
8013
|
-
__classPrivateFieldGet$
|
8012
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
|
8013
|
+
__classPrivateFieldGet$d(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
8014
8014
|
}
|
8015
8015
|
isValidEndpointPayload(payload) {
|
8016
8016
|
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
@@ -8045,12 +8045,12 @@ function errorToPOJO(error) {
|
|
8045
8045
|
}
|
8046
8046
|
errors.errorToPOJO = errorToPOJO;
|
8047
8047
|
|
8048
|
-
var __classPrivateFieldGet$
|
8048
|
+
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8049
8049
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8050
8050
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
8051
8051
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8052
8052
|
};
|
8053
|
-
var __classPrivateFieldSet$
|
8053
|
+
var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8054
8054
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8055
8055
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8056
8056
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
@@ -8085,8 +8085,8 @@ class RTCEndpoint {
|
|
8085
8085
|
if (this.rtc.rtcClient.connectionState !== 'connected') {
|
8086
8086
|
this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
|
8087
8087
|
this.close();
|
8088
|
-
if (__classPrivateFieldGet$
|
8089
|
-
__classPrivateFieldGet$
|
8088
|
+
if (__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f")) {
|
8089
|
+
__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
8090
8090
|
}
|
8091
8091
|
}
|
8092
8092
|
};
|
@@ -8134,9 +8134,9 @@ class RTCEndpoint {
|
|
8134
8134
|
data = new TextDecoder().decode(e.data);
|
8135
8135
|
}
|
8136
8136
|
const { messageId, action, payload } = JSON.parse(data);
|
8137
|
-
if (__classPrivateFieldGet$
|
8137
|
+
if (__classPrivateFieldGet$c(this, _RTCEndpoint_processAction, "f")) {
|
8138
8138
|
try {
|
8139
|
-
const res = await __classPrivateFieldGet$
|
8139
|
+
const res = await __classPrivateFieldGet$c(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
8140
8140
|
this.rtc.channels.response.send(JSON.stringify({
|
8141
8141
|
messageId,
|
8142
8142
|
payload: res,
|
@@ -8170,25 +8170,25 @@ class RTCEndpoint {
|
|
8170
8170
|
datachannel.onclose = (e) => {
|
8171
8171
|
[...this.responseMap.values()].forEach((promise) => promise.reject(new Error('RTCDataChannel closed unexpectedly, this is most commonly caused by message size. Note: RTC Channels have a message size limit of ~255kB.')));
|
8172
8172
|
this.close();
|
8173
|
-
if (__classPrivateFieldGet$
|
8174
|
-
__classPrivateFieldGet$
|
8173
|
+
if (__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f")) {
|
8174
|
+
__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
8175
8175
|
}
|
8176
8176
|
};
|
8177
8177
|
});
|
8178
8178
|
}
|
8179
8179
|
onDisconnect(listener) {
|
8180
|
-
if (!__classPrivateFieldGet$
|
8181
|
-
__classPrivateFieldSet$
|
8180
|
+
if (!__classPrivateFieldGet$c(this, _RTCEndpoint_disconnectListener, "f")) {
|
8181
|
+
__classPrivateFieldSet$b(this, _RTCEndpoint_disconnectListener, listener, "f");
|
8182
8182
|
}
|
8183
8183
|
else {
|
8184
8184
|
throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
|
8185
8185
|
}
|
8186
8186
|
}
|
8187
8187
|
receive(listener) {
|
8188
|
-
if (__classPrivateFieldGet$
|
8188
|
+
if (__classPrivateFieldGet$c(this, _RTCEndpoint_processAction, "f")) {
|
8189
8189
|
throw new Error('You have already set a listener for this RTC Endpoint.');
|
8190
8190
|
}
|
8191
|
-
__classPrivateFieldSet$
|
8191
|
+
__classPrivateFieldSet$b(this, _RTCEndpoint_processAction, listener, "f");
|
8192
8192
|
}
|
8193
8193
|
get connected() {
|
8194
8194
|
return this.rtc.rtcClient.connectionState === 'connected';
|
@@ -8199,12 +8199,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
|
|
8199
8199
|
|
8200
8200
|
var strategy$1 = {};
|
8201
8201
|
|
8202
|
-
var __classPrivateFieldGet$
|
8202
|
+
var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8203
8203
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8204
8204
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
8205
8205
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8206
8206
|
};
|
8207
|
-
var __classPrivateFieldSet$
|
8207
|
+
var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8208
8208
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8209
8209
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8210
8210
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
@@ -8225,11 +8225,11 @@ class EndpointStrategy {
|
|
8225
8225
|
return this.getEndpointById(endpointId).send(action, payload);
|
8226
8226
|
};
|
8227
8227
|
this.close = async () => {
|
8228
|
-
if (__classPrivateFieldGet$
|
8229
|
-
__classPrivateFieldGet$
|
8230
|
-
__classPrivateFieldSet$
|
8228
|
+
if (__classPrivateFieldGet$b(this, _EndpointStrategy_connected, "f")) {
|
8229
|
+
__classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
|
8230
|
+
__classPrivateFieldSet$a(this, _EndpointStrategy_endpointMap, new Map(), "f");
|
8231
8231
|
}
|
8232
|
-
__classPrivateFieldSet$
|
8232
|
+
__classPrivateFieldSet$a(this, _EndpointStrategy_connected, false, "f");
|
8233
8233
|
};
|
8234
8234
|
this.isValidEndpointPayload = validateEndpoint;
|
8235
8235
|
}
|
@@ -8237,39 +8237,39 @@ class EndpointStrategy {
|
|
8237
8237
|
this.getEndpointById(endpointId).onDisconnect(listener);
|
8238
8238
|
}
|
8239
8239
|
receive(listener) {
|
8240
|
-
if (__classPrivateFieldGet$
|
8240
|
+
if (__classPrivateFieldGet$b(this, _EndpointStrategy_processAction, "f")) {
|
8241
8241
|
throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
|
8242
8242
|
}
|
8243
|
-
__classPrivateFieldSet$
|
8243
|
+
__classPrivateFieldSet$a(this, _EndpointStrategy_processAction, listener, "f");
|
8244
8244
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
8245
|
-
__classPrivateFieldGet$
|
8245
|
+
__classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$b(this, _EndpointStrategy_processAction, "f")));
|
8246
8246
|
}
|
8247
8247
|
getEndpointById(endpointId) {
|
8248
|
-
const endpoint = __classPrivateFieldGet$
|
8248
|
+
const endpoint = __classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
|
8249
8249
|
if (!endpoint) {
|
8250
8250
|
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
8251
8251
|
}
|
8252
8252
|
return endpoint;
|
8253
8253
|
}
|
8254
8254
|
get connected() {
|
8255
|
-
return __classPrivateFieldGet$
|
8255
|
+
return __classPrivateFieldGet$b(this, _EndpointStrategy_connected, "f");
|
8256
8256
|
}
|
8257
8257
|
isEndpointConnected(endpointId) {
|
8258
|
-
return __classPrivateFieldGet$
|
8258
|
+
return __classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
|
8259
8259
|
}
|
8260
8260
|
addEndpoint(endpointId, payload) {
|
8261
|
-
if (!__classPrivateFieldGet$
|
8261
|
+
if (!__classPrivateFieldGet$b(this, _EndpointStrategy_connected, "f")) {
|
8262
8262
|
console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
|
8263
8263
|
return;
|
8264
8264
|
}
|
8265
8265
|
const clientStrat = new this.EndpointType(payload);
|
8266
|
-
if (__classPrivateFieldGet$
|
8267
|
-
clientStrat.receive(__classPrivateFieldGet$
|
8266
|
+
if (__classPrivateFieldGet$b(this, _EndpointStrategy_processAction, "f")) {
|
8267
|
+
clientStrat.receive(__classPrivateFieldGet$b(this, _EndpointStrategy_processAction, "f"));
|
8268
8268
|
}
|
8269
|
-
__classPrivateFieldGet$
|
8269
|
+
__classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
|
8270
8270
|
}
|
8271
8271
|
async closeEndpoint(endpointId) {
|
8272
|
-
__classPrivateFieldGet$
|
8272
|
+
__classPrivateFieldGet$b(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
|
8273
8273
|
}
|
8274
8274
|
}
|
8275
8275
|
strategy$1.EndpointStrategy = EndpointStrategy;
|
@@ -8451,12 +8451,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
|
|
8451
8451
|
}
|
8452
8452
|
runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
|
8453
8453
|
|
8454
|
-
var __classPrivateFieldGet$
|
8454
|
+
var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8455
8455
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8456
8456
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
8457
8457
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8458
8458
|
};
|
8459
|
-
var __classPrivateFieldSet$
|
8459
|
+
var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8460
8460
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8461
8461
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8462
8462
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
@@ -8500,19 +8500,19 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8500
8500
|
* a read-only array containing all the identities of connecting clients.
|
8501
8501
|
*/
|
8502
8502
|
get connections() {
|
8503
|
-
return [...__classPrivateFieldGet$
|
8503
|
+
return [...__classPrivateFieldGet$a(this, _ChannelProvider_connections, "f")];
|
8504
8504
|
}
|
8505
8505
|
static handleClientDisconnection(channel, payload) {
|
8506
8506
|
if (payload?.endpointId) {
|
8507
8507
|
const { uuid, name, endpointId, isLocalEndpointId } = payload;
|
8508
|
-
__classPrivateFieldGet$
|
8508
|
+
__classPrivateFieldGet$a(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
8509
8509
|
}
|
8510
8510
|
else {
|
8511
8511
|
// this is here to support older runtimes that did not have endpointId
|
8512
8512
|
const multipleRemoves = channel.connections.filter((identity) => {
|
8513
8513
|
return identity.uuid === payload.uuid && identity.name === payload.name;
|
8514
8514
|
});
|
8515
|
-
multipleRemoves.forEach(__classPrivateFieldGet$
|
8515
|
+
multipleRemoves.forEach(__classPrivateFieldGet$a(channel, _ChannelProvider_removeEndpoint, "f"));
|
8516
8516
|
}
|
8517
8517
|
channel.disconnectListener(payload);
|
8518
8518
|
}
|
@@ -8529,8 +8529,8 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8529
8529
|
_ChannelProvider_strategy.set(this, void 0);
|
8530
8530
|
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
8531
8531
|
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
8532
|
-
__classPrivateFieldGet$
|
8533
|
-
__classPrivateFieldSet$
|
8532
|
+
__classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
8533
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_connections, remainingConnections, "f");
|
8534
8534
|
});
|
8535
8535
|
// Must be bound.
|
8536
8536
|
this.processAction = async (action, payload, senderIdentity) => {
|
@@ -8544,17 +8544,17 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8544
8544
|
return super.processAction(action, payload, senderIdentity);
|
8545
8545
|
};
|
8546
8546
|
_ChannelProvider_close.set(this, () => {
|
8547
|
-
__classPrivateFieldGet$
|
8547
|
+
__classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").close();
|
8548
8548
|
const remove = ChannelProvider.removalMap.get(this);
|
8549
8549
|
if (remove) {
|
8550
8550
|
remove();
|
8551
8551
|
}
|
8552
8552
|
});
|
8553
|
-
__classPrivateFieldSet$
|
8553
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
|
8554
8554
|
this.connectListener = () => undefined;
|
8555
8555
|
this.disconnectListener = () => undefined;
|
8556
|
-
__classPrivateFieldSet$
|
8557
|
-
__classPrivateFieldSet$
|
8556
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_connections, [], "f");
|
8557
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_strategy, strategy, "f");
|
8558
8558
|
strategy.receive(this.processAction);
|
8559
8559
|
}
|
8560
8560
|
/**
|
@@ -8585,16 +8585,16 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8585
8585
|
*/
|
8586
8586
|
dispatch(to, action, payload) {
|
8587
8587
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
8588
|
-
if (endpointId && __classPrivateFieldGet$
|
8588
|
+
if (endpointId && __classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
8589
8589
|
const callSites = transport_errors_1$1.RuntimeError.getCallSite();
|
8590
|
-
return __classPrivateFieldGet$
|
8590
|
+
return __classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
8591
8591
|
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
8592
8592
|
});
|
8593
8593
|
}
|
8594
8594
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
8595
8595
|
}
|
8596
8596
|
async processConnection(senderId, payload) {
|
8597
|
-
__classPrivateFieldGet$
|
8597
|
+
__classPrivateFieldGet$a(this, _ChannelProvider_connections, "f").push(senderId);
|
8598
8598
|
return this.connectListener(senderId, payload);
|
8599
8599
|
}
|
8600
8600
|
/**
|
@@ -8617,7 +8617,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8617
8617
|
* ```
|
8618
8618
|
*/
|
8619
8619
|
publish(action, payload) {
|
8620
|
-
return this.connections.map((to) => __classPrivateFieldGet$
|
8620
|
+
return this.connections.map((to) => __classPrivateFieldGet$a(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
8621
8621
|
}
|
8622
8622
|
/**
|
8623
8623
|
* Register a listener that is called on every new client connection.
|
@@ -8691,11 +8691,11 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8691
8691
|
* ```
|
8692
8692
|
*/
|
8693
8693
|
async destroy() {
|
8694
|
-
const protectedObj = __classPrivateFieldGet$
|
8694
|
+
const protectedObj = __classPrivateFieldGet$a(this, _ChannelProvider_protectedObj, "f");
|
8695
8695
|
protectedObj.providerIdentity;
|
8696
|
-
__classPrivateFieldSet$
|
8696
|
+
__classPrivateFieldSet$9(this, _ChannelProvider_connections, [], "f");
|
8697
8697
|
await protectedObj.close();
|
8698
|
-
__classPrivateFieldGet$
|
8698
|
+
__classPrivateFieldGet$a(this, _ChannelProvider_close, "f").call(this);
|
8699
8699
|
}
|
8700
8700
|
/**
|
8701
8701
|
* Returns an array with info on every Client connected to the Provider
|
@@ -8765,7 +8765,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8765
8765
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
8766
8766
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
8767
8767
|
if (matchingConnections.length >= 2) {
|
8768
|
-
const protectedObj = __classPrivateFieldGet$
|
8768
|
+
const protectedObj = __classPrivateFieldGet$a(this, _ChannelProvider_protectedObj, "f");
|
8769
8769
|
const { uuid, name } = clientIdentity;
|
8770
8770
|
const providerUuid = protectedObj?.providerIdentity.uuid;
|
8771
8771
|
const providerName = protectedObj?.providerIdentity.name;
|
@@ -8977,13 +8977,13 @@ class CombinedStrategy {
|
|
8977
8977
|
}
|
8978
8978
|
strategy.default = CombinedStrategy;
|
8979
8979
|
|
8980
|
-
var __classPrivateFieldSet$
|
8980
|
+
var __classPrivateFieldSet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8981
8981
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8982
8982
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8983
8983
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
8984
8984
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
8985
8985
|
};
|
8986
|
-
var __classPrivateFieldGet$
|
8986
|
+
var __classPrivateFieldGet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8987
8987
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8988
8988
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
8989
8989
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -9032,8 +9032,8 @@ class ConnectionManager extends base_1$f.Base {
|
|
9032
9032
|
};
|
9033
9033
|
this.providerMap = new Map();
|
9034
9034
|
this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
9035
|
-
__classPrivateFieldSet$
|
9036
|
-
__classPrivateFieldSet$
|
9035
|
+
__classPrivateFieldSet$8(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
|
9036
|
+
__classPrivateFieldSet$8(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
|
9037
9037
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
9038
9038
|
}
|
9039
9039
|
createProvider(options, providerIdentity) {
|
@@ -9044,7 +9044,7 @@ class ConnectionManager extends base_1$f.Base {
|
|
9044
9044
|
case 'rtc':
|
9045
9045
|
return new strategy_2.RTCStrategy();
|
9046
9046
|
case 'classic':
|
9047
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
9047
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$9(this, _ConnectionManager_messageReceiver, "f"),
|
9048
9048
|
// Providers do not have an endpointId, use channelId as endpointId in the strategy.
|
9049
9049
|
providerIdentity.channelId, providerIdentity);
|
9050
9050
|
default:
|
@@ -9080,7 +9080,7 @@ class ConnectionManager extends base_1$f.Base {
|
|
9080
9080
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
9081
9081
|
switch (type) {
|
9082
9082
|
case 'rtc': {
|
9083
|
-
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$
|
9083
|
+
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$9(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
|
9084
9084
|
rtcPacket = { rtcClient, channels, channelsOpened };
|
9085
9085
|
return {
|
9086
9086
|
type: 'rtc',
|
@@ -9107,18 +9107,18 @@ class ConnectionManager extends base_1$f.Base {
|
|
9107
9107
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
9108
9108
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
9109
9109
|
// clients that are in the same context as the newly-connected client.
|
9110
|
-
__classPrivateFieldGet$
|
9110
|
+
__classPrivateFieldGet$9(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
9111
9111
|
}
|
9112
9112
|
const answer = routingInfo.answer ?? {
|
9113
9113
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
9114
9114
|
};
|
9115
9115
|
const createStrategyFromAnswer = async (protocol) => {
|
9116
9116
|
if (protocol.type === 'rtc' && rtcPacket) {
|
9117
|
-
await __classPrivateFieldGet$
|
9117
|
+
await __classPrivateFieldGet$9(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
|
9118
9118
|
return new strategy_2.RTCStrategy();
|
9119
9119
|
}
|
9120
9120
|
if (protocol.type === 'classic') {
|
9121
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
9121
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$9(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
|
9122
9122
|
}
|
9123
9123
|
return null;
|
9124
9124
|
};
|
@@ -9186,7 +9186,7 @@ class ConnectionManager extends base_1$f.Base {
|
|
9186
9186
|
clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
|
9187
9187
|
const answer = await accumP;
|
9188
9188
|
if (protocolToUse.type === 'rtc') {
|
9189
|
-
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$
|
9189
|
+
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$9(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
|
9190
9190
|
answer.supportedProtocols.push({
|
9191
9191
|
type: 'rtc',
|
9192
9192
|
version: strategy_2.RTCInfo.version,
|
@@ -9234,13 +9234,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
|
|
9234
9234
|
*
|
9235
9235
|
* @packageDocumentation
|
9236
9236
|
*/
|
9237
|
-
var __classPrivateFieldSet$
|
9237
|
+
var __classPrivateFieldSet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
9238
9238
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
9239
9239
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
9240
9240
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
9241
9241
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
9242
9242
|
};
|
9243
|
-
var __classPrivateFieldGet$
|
9243
|
+
var __classPrivateFieldGet$8 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9244
9244
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9245
9245
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
9246
9246
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -9297,11 +9297,11 @@ class Channel extends base_1$e.EmitterBase {
|
|
9297
9297
|
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
9298
9298
|
}),
|
9299
9299
|
this.on('connected', (...args) => {
|
9300
|
-
__classPrivateFieldGet$
|
9300
|
+
__classPrivateFieldGet$8(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
9301
9301
|
})
|
9302
9302
|
]).catch(() => new Error('error setting up channel connection listeners'));
|
9303
9303
|
}));
|
9304
|
-
__classPrivateFieldSet$
|
9304
|
+
__classPrivateFieldSet$7(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
|
9305
9305
|
}
|
9306
9306
|
/**
|
9307
9307
|
*
|
@@ -9376,7 +9376,7 @@ class Channel extends base_1$e.EmitterBase {
|
|
9376
9376
|
resolve(true);
|
9377
9377
|
}
|
9378
9378
|
};
|
9379
|
-
__classPrivateFieldGet$
|
9379
|
+
__classPrivateFieldGet$8(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
|
9380
9380
|
});
|
9381
9381
|
try {
|
9382
9382
|
if (retryInfo.count > 0) {
|
@@ -9408,7 +9408,7 @@ class Channel extends base_1$e.EmitterBase {
|
|
9408
9408
|
finally {
|
9409
9409
|
retryInfo.count += 1;
|
9410
9410
|
// in case of other errors, remove our listener
|
9411
|
-
__classPrivateFieldGet$
|
9411
|
+
__classPrivateFieldGet$8(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
|
9412
9412
|
}
|
9413
9413
|
} while (shouldWait); // If we're waiting we retry the above loop
|
9414
9414
|
// Should wait was false, no channel was found.
|
@@ -9467,12 +9467,12 @@ class Channel extends base_1$e.EmitterBase {
|
|
9467
9467
|
async connect(channelName, options = {}) {
|
9468
9468
|
// Make sure we don't connect before listeners are set up
|
9469
9469
|
// This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
|
9470
|
-
await __classPrivateFieldGet$
|
9470
|
+
await __classPrivateFieldGet$8(this, _Channel_readyToConnect, "f").getValue();
|
9471
9471
|
if (!channelName || typeof channelName !== 'string') {
|
9472
9472
|
throw new Error('Please provide a channelName string to connect to a channel.');
|
9473
9473
|
}
|
9474
9474
|
const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
|
9475
|
-
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$
|
9475
|
+
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$8(this, _Channel_connectionManager, "f").createClientOffer(opts);
|
9476
9476
|
let connectionUrl;
|
9477
9477
|
if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
|
9478
9478
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
@@ -9484,7 +9484,7 @@ class Channel extends base_1$e.EmitterBase {
|
|
9484
9484
|
connectionUrl
|
9485
9485
|
};
|
9486
9486
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
9487
|
-
const strategy = await __classPrivateFieldGet$
|
9487
|
+
const strategy = await __classPrivateFieldGet$8(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
9488
9488
|
const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
|
9489
9489
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
9490
9490
|
// If the endpoint dies, the client will force a disconnection through the core.
|
@@ -9553,7 +9553,7 @@ class Channel extends base_1$e.EmitterBase {
|
|
9553
9553
|
throw new Error('Please provide a channelName to create a channel');
|
9554
9554
|
}
|
9555
9555
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
9556
|
-
const channel = __classPrivateFieldGet$
|
9556
|
+
const channel = __classPrivateFieldGet$8(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
9557
9557
|
// TODO: fix typing (internal)
|
9558
9558
|
// @ts-expect-error
|
9559
9559
|
this.on('client-disconnected', (eventPayload) => {
|
@@ -9789,14 +9789,32 @@ var clipboard = {};
|
|
9789
9789
|
*
|
9790
9790
|
* @packageDocumentation
|
9791
9791
|
*/
|
9792
|
+
var __classPrivateFieldGet$7 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9793
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9794
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
9795
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
9796
|
+
};
|
9797
|
+
var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
9798
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
9799
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
9800
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
9801
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
9802
|
+
};
|
9803
|
+
var _Clipboard_instances, _Clipboard_securedApiWarningCount, _Clipboard_warnSecuredApi;
|
9792
9804
|
Object.defineProperty(clipboard, "__esModule", { value: true });
|
9793
9805
|
clipboard.Clipboard = void 0;
|
9794
9806
|
const base_1$c = base;
|
9807
|
+
const maxSecuredApiWarnings = 10;
|
9795
9808
|
/**
|
9796
9809
|
* The Clipboard API allows reading and writing to the clipboard in multiple formats.
|
9797
9810
|
*
|
9798
9811
|
*/
|
9799
9812
|
class Clipboard extends base_1$c.Base {
|
9813
|
+
constructor() {
|
9814
|
+
super(...arguments);
|
9815
|
+
_Clipboard_instances.add(this);
|
9816
|
+
_Clipboard_securedApiWarningCount.set(this, 0);
|
9817
|
+
}
|
9800
9818
|
/**
|
9801
9819
|
* Writes data into the clipboard as plain text
|
9802
9820
|
* @param writeObj The object for writing data into the clipboard
|
@@ -9809,6 +9827,7 @@ class Clipboard extends base_1$c.Base {
|
|
9809
9827
|
* ```
|
9810
9828
|
*/
|
9811
9829
|
async writeText(writeObj) {
|
9830
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeText');
|
9812
9831
|
await this.wire.sendAction('clipboard-write-text', writeObj);
|
9813
9832
|
}
|
9814
9833
|
/**
|
@@ -9821,6 +9840,7 @@ class Clipboard extends base_1$c.Base {
|
|
9821
9840
|
* ```
|
9822
9841
|
*/
|
9823
9842
|
async readText(type) {
|
9843
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readText');
|
9824
9844
|
// NOTE: When we start supporting linux, we could detect the OS and choose 'selection' automatically for the user
|
9825
9845
|
const { payload } = await this.wire.sendAction('clipboard-read-text', { type });
|
9826
9846
|
return payload.data;
|
@@ -9838,6 +9858,7 @@ class Clipboard extends base_1$c.Base {
|
|
9838
9858
|
* ```
|
9839
9859
|
*/
|
9840
9860
|
async writeImage(writeRequest) {
|
9861
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeImage');
|
9841
9862
|
await this.wire.sendAction('clipboard-write-image', writeRequest);
|
9842
9863
|
}
|
9843
9864
|
/**
|
@@ -9873,6 +9894,7 @@ class Clipboard extends base_1$c.Base {
|
|
9873
9894
|
* ```
|
9874
9895
|
*/
|
9875
9896
|
async readImage(readRequest = { format: 'dataURL' }) {
|
9897
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readImage');
|
9876
9898
|
const { payload } = await this.wire.sendAction('clipboard-read-image', readRequest);
|
9877
9899
|
return payload.data;
|
9878
9900
|
}
|
@@ -9888,6 +9910,7 @@ class Clipboard extends base_1$c.Base {
|
|
9888
9910
|
* ```
|
9889
9911
|
*/
|
9890
9912
|
async writeHtml(writeObj) {
|
9913
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeHtml');
|
9891
9914
|
await this.wire.sendAction('clipboard-write-html', writeObj);
|
9892
9915
|
}
|
9893
9916
|
/**
|
@@ -9900,6 +9923,7 @@ class Clipboard extends base_1$c.Base {
|
|
9900
9923
|
* ```
|
9901
9924
|
*/
|
9902
9925
|
async readHtml(type) {
|
9926
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readHtml');
|
9903
9927
|
const { payload } = await this.wire.sendAction('clipboard-read-html', { type });
|
9904
9928
|
return payload.data;
|
9905
9929
|
}
|
@@ -9915,6 +9939,7 @@ class Clipboard extends base_1$c.Base {
|
|
9915
9939
|
* ```
|
9916
9940
|
*/
|
9917
9941
|
async writeRtf(writeObj) {
|
9942
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeRtf');
|
9918
9943
|
await this.wire.sendAction('clipboard-write-rtf', writeObj);
|
9919
9944
|
}
|
9920
9945
|
/**
|
@@ -9935,6 +9960,7 @@ class Clipboard extends base_1$c.Base {
|
|
9935
9960
|
* ```
|
9936
9961
|
*/
|
9937
9962
|
async readRtf(type) {
|
9963
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readRtf');
|
9938
9964
|
const { payload } = await this.wire.sendAction('clipboard-read-rtf', { type });
|
9939
9965
|
return payload.data;
|
9940
9966
|
}
|
@@ -9958,6 +9984,7 @@ class Clipboard extends base_1$c.Base {
|
|
9958
9984
|
* ```
|
9959
9985
|
*/
|
9960
9986
|
async write(writeObj) {
|
9987
|
+
__classPrivateFieldGet$7(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.write');
|
9961
9988
|
await this.wire.sendAction('clipboard-write', writeObj);
|
9962
9989
|
}
|
9963
9990
|
/**
|
@@ -9975,6 +10002,12 @@ class Clipboard extends base_1$c.Base {
|
|
9975
10002
|
}
|
9976
10003
|
}
|
9977
10004
|
clipboard.Clipboard = Clipboard;
|
10005
|
+
_Clipboard_securedApiWarningCount = new WeakMap(), _Clipboard_instances = new WeakSet(), _Clipboard_warnSecuredApi = async function _Clipboard_warnSecuredApi(apiName) {
|
10006
|
+
if (__classPrivateFieldGet$7(this, _Clipboard_securedApiWarningCount, "f") <= maxSecuredApiWarnings) {
|
10007
|
+
console.warn(`Clipboard APIs will be secure-by-default starting in v42. To continue using this API without interruption, make sure to grant explicit API permissions for ${apiName} in the Desktop Owner Settings, and in the Application, Window, View, or Domain Settings. For more information, see https://resources.here.io/docs/core/develop/security/api-security/`);
|
10008
|
+
__classPrivateFieldSet$6(this, _Clipboard_securedApiWarningCount, __classPrivateFieldGet$7(this, _Clipboard_securedApiWarningCount, "f") + 1, "f");
|
10009
|
+
}
|
10010
|
+
};
|
9978
10011
|
|
9979
10012
|
var externalApplication = {};
|
9980
10013
|
|