@openfin/core 41.100.111 → 41.100.112
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 +29 -1
- package/out/mock-beta.d.ts +29 -1
- package/out/mock-public.d.ts +29 -1
- package/out/stub.d.ts +29 -1
- 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
|
@@ -3888,7 +3904,17 @@ declare type ContentCreationRulesEvent = NamedEvent & {
|
|
3888
3904
|
* The features string passed to `window.open()` converted to OpenFin window options
|
3889
3905
|
*/
|
3890
3906
|
parsedFeatures: Partial<OpenFin_2.WindowOptions>;
|
3891
|
-
|
3907
|
+
/**
|
3908
|
+
* The reported disposition of the content creation request.
|
3909
|
+
* @remarks
|
3910
|
+
* - `default` - The default behavior of the browser.
|
3911
|
+
* - `foreground-tab` - The content is loaded in a new tab in the foreground. This is the default behavior for `window.open()` or a link with target=_blank.
|
3912
|
+
* - `background-tab` - The content is loaded in a new tab in the background. This is the default behavior when clicking on a link with the `ctrl` or `cmd` key pressed.
|
3913
|
+
* - `new-window` - The content is loaded in a new window. This is the default behavior when clicking on a link with the `shift` key pressed.
|
3914
|
+
* - `popup` - The content is loaded in a popup window. This is the result of passing popup features to `window.open()`.
|
3915
|
+
* - `other` - The content is loaded in some other way.
|
3916
|
+
*/
|
3917
|
+
disposition: 'default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'popup' | 'other';
|
3892
3918
|
};
|
3893
3919
|
|
3894
3920
|
/**
|
@@ -9569,6 +9595,7 @@ declare namespace OpenFin_2 {
|
|
9569
9595
|
OpenExternalPermission,
|
9570
9596
|
DeviceInfo,
|
9571
9597
|
Permissions_2 as Permissions,
|
9598
|
+
ClipboardApiPermissions,
|
9572
9599
|
PlatformWindowCreationOptions,
|
9573
9600
|
PlatformWindowOptions,
|
9574
9601
|
PlatformViewCreationOptions,
|
@@ -10086,6 +10113,7 @@ declare type PerformanceReportEvent = Performance & BaseEvent_5 & {
|
|
10086
10113
|
declare type Permissions_2 = {
|
10087
10114
|
Application?: Partial<ApplicationPermissions>;
|
10088
10115
|
System?: Partial<SystemPermissions>;
|
10116
|
+
Clipboard?: Partial<ClipboardApiPermissions>;
|
10089
10117
|
webAPIs?: WebPermission[];
|
10090
10118
|
devices?: DeviceInfo[];
|
10091
10119
|
};
|
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
|
@@ -3888,7 +3904,17 @@ declare type ContentCreationRulesEvent = NamedEvent & {
|
|
3888
3904
|
* The features string passed to `window.open()` converted to OpenFin window options
|
3889
3905
|
*/
|
3890
3906
|
parsedFeatures: Partial<OpenFin_2.WindowOptions>;
|
3891
|
-
|
3907
|
+
/**
|
3908
|
+
* The reported disposition of the content creation request.
|
3909
|
+
* @remarks
|
3910
|
+
* - `default` - The default behavior of the browser.
|
3911
|
+
* - `foreground-tab` - The content is loaded in a new tab in the foreground. This is the default behavior for `window.open()` or a link with target=_blank.
|
3912
|
+
* - `background-tab` - The content is loaded in a new tab in the background. This is the default behavior when clicking on a link with the `ctrl` or `cmd` key pressed.
|
3913
|
+
* - `new-window` - The content is loaded in a new window. This is the default behavior when clicking on a link with the `shift` key pressed.
|
3914
|
+
* - `popup` - The content is loaded in a popup window. This is the result of passing popup features to `window.open()`.
|
3915
|
+
* - `other` - The content is loaded in some other way.
|
3916
|
+
*/
|
3917
|
+
disposition: 'default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'popup' | 'other';
|
3892
3918
|
};
|
3893
3919
|
|
3894
3920
|
/**
|
@@ -9569,6 +9595,7 @@ declare namespace OpenFin_2 {
|
|
9569
9595
|
OpenExternalPermission,
|
9570
9596
|
DeviceInfo,
|
9571
9597
|
Permissions_2 as Permissions,
|
9598
|
+
ClipboardApiPermissions,
|
9572
9599
|
PlatformWindowCreationOptions,
|
9573
9600
|
PlatformWindowOptions,
|
9574
9601
|
PlatformViewCreationOptions,
|
@@ -10086,6 +10113,7 @@ declare type PerformanceReportEvent = Performance & BaseEvent_5 & {
|
|
10086
10113
|
declare type Permissions_2 = {
|
10087
10114
|
Application?: Partial<ApplicationPermissions>;
|
10088
10115
|
System?: Partial<SystemPermissions>;
|
10116
|
+
Clipboard?: Partial<ClipboardApiPermissions>;
|
10089
10117
|
webAPIs?: WebPermission[];
|
10090
10118
|
devices?: DeviceInfo[];
|
10091
10119
|
};
|
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
|
@@ -3888,7 +3904,17 @@ declare type ContentCreationRulesEvent = NamedEvent & {
|
|
3888
3904
|
* The features string passed to `window.open()` converted to OpenFin window options
|
3889
3905
|
*/
|
3890
3906
|
parsedFeatures: Partial<OpenFin_2.WindowOptions>;
|
3891
|
-
|
3907
|
+
/**
|
3908
|
+
* The reported disposition of the content creation request.
|
3909
|
+
* @remarks
|
3910
|
+
* - `default` - The default behavior of the browser.
|
3911
|
+
* - `foreground-tab` - The content is loaded in a new tab in the foreground. This is the default behavior for `window.open()` or a link with target=_blank.
|
3912
|
+
* - `background-tab` - The content is loaded in a new tab in the background. This is the default behavior when clicking on a link with the `ctrl` or `cmd` key pressed.
|
3913
|
+
* - `new-window` - The content is loaded in a new window. This is the default behavior when clicking on a link with the `shift` key pressed.
|
3914
|
+
* - `popup` - The content is loaded in a popup window. This is the result of passing popup features to `window.open()`.
|
3915
|
+
* - `other` - The content is loaded in some other way.
|
3916
|
+
*/
|
3917
|
+
disposition: 'default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'popup' | 'other';
|
3892
3918
|
};
|
3893
3919
|
|
3894
3920
|
/**
|
@@ -9569,6 +9595,7 @@ declare namespace OpenFin_2 {
|
|
9569
9595
|
OpenExternalPermission,
|
9570
9596
|
DeviceInfo,
|
9571
9597
|
Permissions_2 as Permissions,
|
9598
|
+
ClipboardApiPermissions,
|
9572
9599
|
PlatformWindowCreationOptions,
|
9573
9600
|
PlatformWindowOptions,
|
9574
9601
|
PlatformViewCreationOptions,
|
@@ -10086,6 +10113,7 @@ declare type PerformanceReportEvent = Performance & BaseEvent_5 & {
|
|
10086
10113
|
declare type Permissions_2 = {
|
10087
10114
|
Application?: Partial<ApplicationPermissions>;
|
10088
10115
|
System?: Partial<SystemPermissions>;
|
10116
|
+
Clipboard?: Partial<ClipboardApiPermissions>;
|
10089
10117
|
webAPIs?: WebPermission[];
|
10090
10118
|
devices?: DeviceInfo[];
|
10091
10119
|
};
|
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
|
@@ -3947,7 +3963,17 @@ declare type ContentCreationRulesEvent = NamedEvent & {
|
|
3947
3963
|
* The features string passed to `window.open()` converted to OpenFin window options
|
3948
3964
|
*/
|
3949
3965
|
parsedFeatures: Partial<OpenFin_2.WindowOptions>;
|
3950
|
-
|
3966
|
+
/**
|
3967
|
+
* The reported disposition of the content creation request.
|
3968
|
+
* @remarks
|
3969
|
+
* - `default` - The default behavior of the browser.
|
3970
|
+
* - `foreground-tab` - The content is loaded in a new tab in the foreground. This is the default behavior for `window.open()` or a link with target=_blank.
|
3971
|
+
* - `background-tab` - The content is loaded in a new tab in the background. This is the default behavior when clicking on a link with the `ctrl` or `cmd` key pressed.
|
3972
|
+
* - `new-window` - The content is loaded in a new window. This is the default behavior when clicking on a link with the `shift` key pressed.
|
3973
|
+
* - `popup` - The content is loaded in a popup window. This is the result of passing popup features to `window.open()`.
|
3974
|
+
* - `other` - The content is loaded in some other way.
|
3975
|
+
*/
|
3976
|
+
disposition: 'default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'popup' | 'other';
|
3951
3977
|
};
|
3952
3978
|
|
3953
3979
|
/**
|
@@ -9887,6 +9913,7 @@ declare namespace OpenFin_2 {
|
|
9887
9913
|
OpenExternalPermission,
|
9888
9914
|
DeviceInfo,
|
9889
9915
|
Permissions_2 as Permissions,
|
9916
|
+
ClipboardApiPermissions,
|
9890
9917
|
PlatformWindowCreationOptions,
|
9891
9918
|
PlatformWindowOptions,
|
9892
9919
|
PlatformViewCreationOptions,
|
@@ -10404,6 +10431,7 @@ declare type PerformanceReportEvent = Performance & BaseEvent_5 & {
|
|
10404
10431
|
declare type Permissions_2 = {
|
10405
10432
|
Application?: Partial<ApplicationPermissions>;
|
10406
10433
|
System?: Partial<SystemPermissions>;
|
10434
|
+
Clipboard?: Partial<ClipboardApiPermissions>;
|
10407
10435
|
webAPIs?: WebPermission[];
|
10408
10436
|
devices?: DeviceInfo[];
|
10409
10437
|
};
|
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$h = (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$i = (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$i(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$i(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$i(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$i(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$h(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
|
515
|
+
__classPrivateFieldSet$h(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$i(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$i(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$i(this, _EmitterBase_emitterAccessor, "f"));
|
636
636
|
}
|
637
637
|
}
|
638
638
|
}
|
@@ -7719,12 +7719,12 @@ class ChannelError extends Error {
|
|
7719
7719
|
}
|
7720
7720
|
channelError.ChannelError = ChannelError;
|
7721
7721
|
|
7722
|
-
var __classPrivateFieldGet$
|
7722
|
+
var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
7723
7723
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
7724
7724
|
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");
|
7725
7725
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
7726
7726
|
};
|
7727
|
-
var __classPrivateFieldSet$
|
7727
|
+
var __classPrivateFieldSet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
7728
7728
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
7729
7729
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
7730
7730
|
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");
|
@@ -7768,7 +7768,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7768
7768
|
static closeChannelByEndpointId(id) {
|
7769
7769
|
const channel = channelClientsByEndpointId.get(id);
|
7770
7770
|
if (channel) {
|
7771
|
-
__classPrivateFieldGet$
|
7771
|
+
__classPrivateFieldGet$h(channel, _ChannelClient_close, "f").call(channel);
|
7772
7772
|
}
|
7773
7773
|
}
|
7774
7774
|
/**
|
@@ -7779,7 +7779,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7779
7779
|
for (const channelClient of channelClientsByEndpointId.values()) {
|
7780
7780
|
if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
|
7781
7781
|
channelClient.disconnectListener(eventPayload);
|
7782
|
-
__classPrivateFieldGet$
|
7782
|
+
__classPrivateFieldGet$h(channelClient, _ChannelClient_close, "f").call(channelClient);
|
7783
7783
|
}
|
7784
7784
|
}
|
7785
7785
|
}
|
@@ -7794,12 +7794,12 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7794
7794
|
this.processAction = (action, payload, senderIdentity) => super.processAction(action, payload, senderIdentity);
|
7795
7795
|
_ChannelClient_close.set(this, () => {
|
7796
7796
|
channelClientsByEndpointId.delete(this.endpointId);
|
7797
|
-
__classPrivateFieldGet$
|
7797
|
+
__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").close();
|
7798
7798
|
});
|
7799
|
-
__classPrivateFieldSet$
|
7799
|
+
__classPrivateFieldSet$g(this, _ChannelClient_protectedObj, new channel_1$1.ProtectedItems(routingInfo, close), "f");
|
7800
7800
|
this.disconnectListener = () => undefined;
|
7801
7801
|
this.endpointId = routingInfo.endpointId;
|
7802
|
-
__classPrivateFieldSet$
|
7802
|
+
__classPrivateFieldSet$g(this, _ChannelClient_strategy, strategy, "f");
|
7803
7803
|
channelClientsByEndpointId.set(this.endpointId, this);
|
7804
7804
|
strategy.receive(this.processAction);
|
7805
7805
|
}
|
@@ -7807,7 +7807,7 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7807
7807
|
* a read-only provider identity
|
7808
7808
|
*/
|
7809
7809
|
get providerIdentity() {
|
7810
|
-
const protectedObj = __classPrivateFieldGet$
|
7810
|
+
const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
|
7811
7811
|
return protectedObj.providerIdentity;
|
7812
7812
|
}
|
7813
7813
|
/**
|
@@ -7836,9 +7836,9 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7836
7836
|
* ```
|
7837
7837
|
*/
|
7838
7838
|
async dispatch(action, payload) {
|
7839
|
-
if (__classPrivateFieldGet$
|
7839
|
+
if (__classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
|
7840
7840
|
const callSites = transport_errors_1$2.RuntimeError.getCallSite();
|
7841
|
-
return __classPrivateFieldGet$
|
7841
|
+
return __classPrivateFieldGet$h(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
|
7842
7842
|
throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
|
7843
7843
|
});
|
7844
7844
|
}
|
@@ -7890,10 +7890,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
|
|
7890
7890
|
*/
|
7891
7891
|
async disconnect() {
|
7892
7892
|
await this.sendDisconnectAction();
|
7893
|
-
__classPrivateFieldGet$
|
7893
|
+
__classPrivateFieldGet$h(this, _ChannelClient_close, "f").call(this);
|
7894
7894
|
}
|
7895
7895
|
async sendDisconnectAction() {
|
7896
|
-
const protectedObj = __classPrivateFieldGet$
|
7896
|
+
const protectedObj = __classPrivateFieldGet$h(this, _ChannelClient_protectedObj, "f");
|
7897
7897
|
await protectedObj.close();
|
7898
7898
|
}
|
7899
7899
|
/**
|
@@ -7926,13 +7926,13 @@ exhaustive.exhaustiveCheck = exhaustiveCheck;
|
|
7926
7926
|
|
7927
7927
|
var strategy$3 = {};
|
7928
7928
|
|
7929
|
-
var __classPrivateFieldSet$
|
7929
|
+
var __classPrivateFieldSet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
7930
7930
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
7931
7931
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
7932
7932
|
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");
|
7933
7933
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
7934
7934
|
};
|
7935
|
-
var __classPrivateFieldGet$
|
7935
|
+
var __classPrivateFieldGet$g = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
7936
7936
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
7937
7937
|
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");
|
7938
7938
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -7957,7 +7957,7 @@ class ClassicStrategy {
|
|
7957
7957
|
// connection problems occur
|
7958
7958
|
_ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
|
7959
7959
|
this.send = async (endpointId, action, payload) => {
|
7960
|
-
const to = __classPrivateFieldGet$
|
7960
|
+
const to = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
7961
7961
|
if (!to) {
|
7962
7962
|
throw new Error(`Could not locate routing info for endpoint ${endpointId}`);
|
7963
7963
|
}
|
@@ -7969,13 +7969,13 @@ class ClassicStrategy {
|
|
7969
7969
|
}
|
7970
7970
|
delete cleanId.isLocalEndpointId;
|
7971
7971
|
// grab the promise before awaiting it to save in our pending messages map
|
7972
|
-
const p = __classPrivateFieldGet$
|
7972
|
+
const p = __classPrivateFieldGet$g(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
|
7973
7973
|
...cleanId,
|
7974
7974
|
providerIdentity: this.providerIdentity,
|
7975
7975
|
action,
|
7976
7976
|
payload
|
7977
7977
|
});
|
7978
|
-
__classPrivateFieldGet$
|
7978
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
|
7979
7979
|
const raw = await p
|
7980
7980
|
.catch((error) => {
|
7981
7981
|
if ('cause' in error) {
|
@@ -7985,16 +7985,16 @@ class ClassicStrategy {
|
|
7985
7985
|
})
|
7986
7986
|
.finally(() => {
|
7987
7987
|
// clean up the pending promise
|
7988
|
-
__classPrivateFieldGet$
|
7988
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
|
7989
7989
|
});
|
7990
7990
|
return raw.payload.data.result;
|
7991
7991
|
};
|
7992
7992
|
this.close = async () => {
|
7993
7993
|
this.messageReceiver.removeEndpoint(this.providerIdentity.channelId, this.endpointId);
|
7994
|
-
[...__classPrivateFieldGet$
|
7995
|
-
__classPrivateFieldSet$
|
7994
|
+
[...__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").keys()].forEach((id) => this.closeEndpoint(id));
|
7995
|
+
__classPrivateFieldSet$f(this, _ClassicStrategy_endpointIdentityMap, new Map(), "f");
|
7996
7996
|
};
|
7997
|
-
__classPrivateFieldSet$
|
7997
|
+
__classPrivateFieldSet$f(this, _ClassicStrategy_wire, wire, "f");
|
7998
7998
|
}
|
7999
7999
|
onEndpointDisconnect(endpointId, listener) {
|
8000
8000
|
// Never fires for 'classic'.
|
@@ -8003,20 +8003,20 @@ class ClassicStrategy {
|
|
8003
8003
|
this.messageReceiver.addEndpoint(listener, this.providerIdentity.channelId, this.endpointId);
|
8004
8004
|
}
|
8005
8005
|
async closeEndpoint(endpointId) {
|
8006
|
-
const id = __classPrivateFieldGet$
|
8007
|
-
__classPrivateFieldGet$
|
8008
|
-
const pendingSet = __classPrivateFieldGet$
|
8006
|
+
const id = __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
|
8007
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").delete(endpointId);
|
8008
|
+
const pendingSet = __classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId);
|
8009
8009
|
pendingSet?.forEach((p) => {
|
8010
8010
|
const errorMsg = `Channel connection with identity uuid: ${id?.uuid} / name: ${id?.name} / endpointId: ${endpointId} no longer connected.`;
|
8011
8011
|
p.cancel(new Error(errorMsg));
|
8012
8012
|
});
|
8013
8013
|
}
|
8014
8014
|
isEndpointConnected(endpointId) {
|
8015
|
-
return __classPrivateFieldGet$
|
8015
|
+
return __classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").has(endpointId);
|
8016
8016
|
}
|
8017
8017
|
addEndpoint(endpointId, payload) {
|
8018
|
-
__classPrivateFieldGet$
|
8019
|
-
__classPrivateFieldGet$
|
8018
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_endpointIdentityMap, "f").set(endpointId, payload.endpointIdentity);
|
8019
|
+
__classPrivateFieldGet$g(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").set(endpointId, new Set());
|
8020
8020
|
}
|
8021
8021
|
isValidEndpointPayload(payload) {
|
8022
8022
|
return (typeof payload?.endpointIdentity?.endpointId === 'string' ||
|
@@ -8051,12 +8051,12 @@ function errorToPOJO(error) {
|
|
8051
8051
|
}
|
8052
8052
|
errors.errorToPOJO = errorToPOJO;
|
8053
8053
|
|
8054
|
-
var __classPrivateFieldGet$
|
8054
|
+
var __classPrivateFieldGet$f = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8055
8055
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8056
8056
|
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");
|
8057
8057
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8058
8058
|
};
|
8059
|
-
var __classPrivateFieldSet$
|
8059
|
+
var __classPrivateFieldSet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8060
8060
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8061
8061
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8062
8062
|
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");
|
@@ -8091,8 +8091,8 @@ class RTCEndpoint {
|
|
8091
8091
|
if (this.rtc.rtcClient.connectionState !== 'connected') {
|
8092
8092
|
this.rtc.rtcClient.removeEventListener('connectionstatechange', this.connectionStateChangeHandler);
|
8093
8093
|
this.close();
|
8094
|
-
if (__classPrivateFieldGet$
|
8095
|
-
__classPrivateFieldGet$
|
8094
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
8095
|
+
__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
8096
8096
|
}
|
8097
8097
|
}
|
8098
8098
|
};
|
@@ -8140,9 +8140,9 @@ class RTCEndpoint {
|
|
8140
8140
|
data = new TextDecoder().decode(e.data);
|
8141
8141
|
}
|
8142
8142
|
const { messageId, action, payload } = JSON.parse(data);
|
8143
|
-
if (__classPrivateFieldGet$
|
8143
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
|
8144
8144
|
try {
|
8145
|
-
const res = await __classPrivateFieldGet$
|
8145
|
+
const res = await __classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f").call(this, action, payload, endpointIdentity);
|
8146
8146
|
this.rtc.channels.response.send(JSON.stringify({
|
8147
8147
|
messageId,
|
8148
8148
|
payload: res,
|
@@ -8176,25 +8176,25 @@ class RTCEndpoint {
|
|
8176
8176
|
datachannel.onclose = (e) => {
|
8177
8177
|
[...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.')));
|
8178
8178
|
this.close();
|
8179
|
-
if (__classPrivateFieldGet$
|
8180
|
-
__classPrivateFieldGet$
|
8179
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
8180
|
+
__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f").call(this);
|
8181
8181
|
}
|
8182
8182
|
};
|
8183
8183
|
});
|
8184
8184
|
}
|
8185
8185
|
onDisconnect(listener) {
|
8186
|
-
if (!__classPrivateFieldGet$
|
8187
|
-
__classPrivateFieldSet$
|
8186
|
+
if (!__classPrivateFieldGet$f(this, _RTCEndpoint_disconnectListener, "f")) {
|
8187
|
+
__classPrivateFieldSet$e(this, _RTCEndpoint_disconnectListener, listener, "f");
|
8188
8188
|
}
|
8189
8189
|
else {
|
8190
8190
|
throw new Error('RTCEndpoint disconnectListener cannot be set twice.');
|
8191
8191
|
}
|
8192
8192
|
}
|
8193
8193
|
receive(listener) {
|
8194
|
-
if (__classPrivateFieldGet$
|
8194
|
+
if (__classPrivateFieldGet$f(this, _RTCEndpoint_processAction, "f")) {
|
8195
8195
|
throw new Error('You have already set a listener for this RTC Endpoint.');
|
8196
8196
|
}
|
8197
|
-
__classPrivateFieldSet$
|
8197
|
+
__classPrivateFieldSet$e(this, _RTCEndpoint_processAction, listener, "f");
|
8198
8198
|
}
|
8199
8199
|
get connected() {
|
8200
8200
|
return this.rtc.rtcClient.connectionState === 'connected';
|
@@ -8205,12 +8205,12 @@ _RTCEndpoint_processAction = new WeakMap(), _RTCEndpoint_disconnectListener = ne
|
|
8205
8205
|
|
8206
8206
|
var strategy$1 = {};
|
8207
8207
|
|
8208
|
-
var __classPrivateFieldGet$
|
8208
|
+
var __classPrivateFieldGet$e = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8209
8209
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8210
8210
|
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");
|
8211
8211
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8212
8212
|
};
|
8213
|
-
var __classPrivateFieldSet$
|
8213
|
+
var __classPrivateFieldSet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8214
8214
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8215
8215
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8216
8216
|
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");
|
@@ -8231,11 +8231,11 @@ class EndpointStrategy {
|
|
8231
8231
|
return this.getEndpointById(endpointId).send(action, payload);
|
8232
8232
|
};
|
8233
8233
|
this.close = async () => {
|
8234
|
-
if (__classPrivateFieldGet$
|
8235
|
-
__classPrivateFieldGet$
|
8236
|
-
__classPrivateFieldSet$
|
8234
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
|
8235
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.close());
|
8236
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_endpointMap, new Map(), "f");
|
8237
8237
|
}
|
8238
|
-
__classPrivateFieldSet$
|
8238
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_connected, false, "f");
|
8239
8239
|
};
|
8240
8240
|
this.isValidEndpointPayload = validateEndpoint;
|
8241
8241
|
}
|
@@ -8243,39 +8243,39 @@ class EndpointStrategy {
|
|
8243
8243
|
this.getEndpointById(endpointId).onDisconnect(listener);
|
8244
8244
|
}
|
8245
8245
|
receive(listener) {
|
8246
|
-
if (__classPrivateFieldGet$
|
8246
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
|
8247
8247
|
throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);
|
8248
8248
|
}
|
8249
|
-
__classPrivateFieldSet$
|
8249
|
+
__classPrivateFieldSet$d(this, _EndpointStrategy_processAction, listener, "f");
|
8250
8250
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
8251
|
-
__classPrivateFieldGet$
|
8251
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").forEach((endpoint) => endpoint.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")));
|
8252
8252
|
}
|
8253
8253
|
getEndpointById(endpointId) {
|
8254
|
-
const endpoint = __classPrivateFieldGet$
|
8254
|
+
const endpoint = __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").get(endpointId);
|
8255
8255
|
if (!endpoint) {
|
8256
8256
|
throw new Error(`Client with endpoint id ${endpointId} is not connected`);
|
8257
8257
|
}
|
8258
8258
|
return endpoint;
|
8259
8259
|
}
|
8260
8260
|
get connected() {
|
8261
|
-
return __classPrivateFieldGet$
|
8261
|
+
return __classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f");
|
8262
8262
|
}
|
8263
8263
|
isEndpointConnected(endpointId) {
|
8264
|
-
return __classPrivateFieldGet$
|
8264
|
+
return __classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").has(endpointId);
|
8265
8265
|
}
|
8266
8266
|
addEndpoint(endpointId, payload) {
|
8267
|
-
if (!__classPrivateFieldGet$
|
8267
|
+
if (!__classPrivateFieldGet$e(this, _EndpointStrategy_connected, "f")) {
|
8268
8268
|
console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);
|
8269
8269
|
return;
|
8270
8270
|
}
|
8271
8271
|
const clientStrat = new this.EndpointType(payload);
|
8272
|
-
if (__classPrivateFieldGet$
|
8273
|
-
clientStrat.receive(__classPrivateFieldGet$
|
8272
|
+
if (__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f")) {
|
8273
|
+
clientStrat.receive(__classPrivateFieldGet$e(this, _EndpointStrategy_processAction, "f"));
|
8274
8274
|
}
|
8275
|
-
__classPrivateFieldGet$
|
8275
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").set(endpointId, clientStrat);
|
8276
8276
|
}
|
8277
8277
|
async closeEndpoint(endpointId) {
|
8278
|
-
__classPrivateFieldGet$
|
8278
|
+
__classPrivateFieldGet$e(this, _EndpointStrategy_endpointMap, "f").delete(endpointId);
|
8279
8279
|
}
|
8280
8280
|
}
|
8281
8281
|
strategy$1.EndpointStrategy = EndpointStrategy;
|
@@ -8457,12 +8457,12 @@ function runtimeUuidMeetsMinimumRuntimeVersion(runtimeUuid, minVersion) {
|
|
8457
8457
|
}
|
8458
8458
|
runtimeVersioning.runtimeUuidMeetsMinimumRuntimeVersion = runtimeUuidMeetsMinimumRuntimeVersion;
|
8459
8459
|
|
8460
|
-
var __classPrivateFieldGet$
|
8460
|
+
var __classPrivateFieldGet$d = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8461
8461
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8462
8462
|
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");
|
8463
8463
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
8464
8464
|
};
|
8465
|
-
var __classPrivateFieldSet$
|
8465
|
+
var __classPrivateFieldSet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8466
8466
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8467
8467
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8468
8468
|
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");
|
@@ -8506,19 +8506,19 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8506
8506
|
* a read-only array containing all the identities of connecting clients.
|
8507
8507
|
*/
|
8508
8508
|
get connections() {
|
8509
|
-
return [...__classPrivateFieldGet$
|
8509
|
+
return [...__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f")];
|
8510
8510
|
}
|
8511
8511
|
static handleClientDisconnection(channel, payload) {
|
8512
8512
|
if (payload?.endpointId) {
|
8513
8513
|
const { uuid, name, endpointId, isLocalEndpointId } = payload;
|
8514
|
-
__classPrivateFieldGet$
|
8514
|
+
__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
8515
8515
|
}
|
8516
8516
|
else {
|
8517
8517
|
// this is here to support older runtimes that did not have endpointId
|
8518
8518
|
const multipleRemoves = channel.connections.filter((identity) => {
|
8519
8519
|
return identity.uuid === payload.uuid && identity.name === payload.name;
|
8520
8520
|
});
|
8521
|
-
multipleRemoves.forEach(__classPrivateFieldGet$
|
8521
|
+
multipleRemoves.forEach(__classPrivateFieldGet$d(channel, _ChannelProvider_removeEndpoint, "f"));
|
8522
8522
|
}
|
8523
8523
|
channel.disconnectListener(payload);
|
8524
8524
|
}
|
@@ -8535,8 +8535,8 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8535
8535
|
_ChannelProvider_strategy.set(this, void 0);
|
8536
8536
|
_ChannelProvider_removeEndpoint.set(this, (identity) => {
|
8537
8537
|
const remainingConnections = this.connections.filter((clientIdentity) => clientIdentity.endpointId !== identity.endpointId);
|
8538
|
-
__classPrivateFieldGet$
|
8539
|
-
__classPrivateFieldSet$
|
8538
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").closeEndpoint(identity.endpointId);
|
8539
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, remainingConnections, "f");
|
8540
8540
|
});
|
8541
8541
|
// Must be bound.
|
8542
8542
|
this.processAction = async (action, payload, senderIdentity) => {
|
@@ -8550,17 +8550,17 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8550
8550
|
return super.processAction(action, payload, senderIdentity);
|
8551
8551
|
};
|
8552
8552
|
_ChannelProvider_close.set(this, () => {
|
8553
|
-
__classPrivateFieldGet$
|
8553
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").close();
|
8554
8554
|
const remove = ChannelProvider.removalMap.get(this);
|
8555
8555
|
if (remove) {
|
8556
8556
|
remove();
|
8557
8557
|
}
|
8558
8558
|
});
|
8559
|
-
__classPrivateFieldSet$
|
8559
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_protectedObj, new channel_1.ProtectedItems(providerIdentity, close), "f");
|
8560
8560
|
this.connectListener = () => undefined;
|
8561
8561
|
this.disconnectListener = () => undefined;
|
8562
|
-
__classPrivateFieldSet$
|
8563
|
-
__classPrivateFieldSet$
|
8562
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
|
8563
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_strategy, strategy, "f");
|
8564
8564
|
strategy.receive(this.processAction);
|
8565
8565
|
}
|
8566
8566
|
/**
|
@@ -8591,16 +8591,16 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8591
8591
|
*/
|
8592
8592
|
dispatch(to, action, payload) {
|
8593
8593
|
const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
|
8594
|
-
if (endpointId && __classPrivateFieldGet$
|
8594
|
+
if (endpointId && __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
|
8595
8595
|
const callSites = transport_errors_1$1.RuntimeError.getCallSite();
|
8596
|
-
return __classPrivateFieldGet$
|
8596
|
+
return __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
|
8597
8597
|
throw new channel_error_1.ChannelError(e, action, payload, callSites);
|
8598
8598
|
});
|
8599
8599
|
}
|
8600
8600
|
return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
|
8601
8601
|
}
|
8602
8602
|
async processConnection(senderId, payload) {
|
8603
|
-
__classPrivateFieldGet$
|
8603
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_connections, "f").push(senderId);
|
8604
8604
|
return this.connectListener(senderId, payload);
|
8605
8605
|
}
|
8606
8606
|
/**
|
@@ -8623,7 +8623,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8623
8623
|
* ```
|
8624
8624
|
*/
|
8625
8625
|
publish(action, payload) {
|
8626
|
-
return this.connections.map((to) => __classPrivateFieldGet$
|
8626
|
+
return this.connections.map((to) => __classPrivateFieldGet$d(this, _ChannelProvider_strategy, "f").send(to.endpointId, action, payload));
|
8627
8627
|
}
|
8628
8628
|
/**
|
8629
8629
|
* Register a listener that is called on every new client connection.
|
@@ -8697,11 +8697,11 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8697
8697
|
* ```
|
8698
8698
|
*/
|
8699
8699
|
async destroy() {
|
8700
|
-
const protectedObj = __classPrivateFieldGet$
|
8700
|
+
const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
|
8701
8701
|
protectedObj.providerIdentity;
|
8702
|
-
__classPrivateFieldSet$
|
8702
|
+
__classPrivateFieldSet$c(this, _ChannelProvider_connections, [], "f");
|
8703
8703
|
await protectedObj.close();
|
8704
|
-
__classPrivateFieldGet$
|
8704
|
+
__classPrivateFieldGet$d(this, _ChannelProvider_close, "f").call(this);
|
8705
8705
|
}
|
8706
8706
|
/**
|
8707
8707
|
* Returns an array with info on every Client connected to the Provider
|
@@ -8771,7 +8771,7 @@ class ChannelProvider extends channel_1.ChannelBase {
|
|
8771
8771
|
getEndpointIdForOpenFinId(clientIdentity, action) {
|
8772
8772
|
const matchingConnections = this.connections.filter((c) => c.name === clientIdentity.name && c.uuid === clientIdentity.uuid);
|
8773
8773
|
if (matchingConnections.length >= 2) {
|
8774
|
-
const protectedObj = __classPrivateFieldGet$
|
8774
|
+
const protectedObj = __classPrivateFieldGet$d(this, _ChannelProvider_protectedObj, "f");
|
8775
8775
|
const { uuid, name } = clientIdentity;
|
8776
8776
|
const providerUuid = protectedObj?.providerIdentity.uuid;
|
8777
8777
|
const providerName = protectedObj?.providerIdentity.name;
|
@@ -8983,13 +8983,13 @@ class CombinedStrategy {
|
|
8983
8983
|
}
|
8984
8984
|
strategy.default = CombinedStrategy;
|
8985
8985
|
|
8986
|
-
var __classPrivateFieldSet$
|
8986
|
+
var __classPrivateFieldSet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
8987
8987
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
8988
8988
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
8989
8989
|
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");
|
8990
8990
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
8991
8991
|
};
|
8992
|
-
var __classPrivateFieldGet$
|
8992
|
+
var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8993
8993
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
8994
8994
|
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");
|
8995
8995
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -9038,8 +9038,8 @@ class ConnectionManager extends base_1$i.Base {
|
|
9038
9038
|
};
|
9039
9039
|
this.providerMap = new Map();
|
9040
9040
|
this.protocolManager = new protocol_manager_1.ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
9041
|
-
__classPrivateFieldSet$
|
9042
|
-
__classPrivateFieldSet$
|
9041
|
+
__classPrivateFieldSet$b(this, _ConnectionManager_messageReceiver, new message_receiver_1.MessageReceiver(wire), "f");
|
9042
|
+
__classPrivateFieldSet$b(this, _ConnectionManager_rtcConnectionManager, new ice_manager_1.RTCICEManager(wire), "f");
|
9043
9043
|
wire.registerMessageHandler(this.onmessage.bind(this));
|
9044
9044
|
}
|
9045
9045
|
createProvider(options, providerIdentity) {
|
@@ -9050,7 +9050,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
9050
9050
|
case 'rtc':
|
9051
9051
|
return new strategy_2.RTCStrategy();
|
9052
9052
|
case 'classic':
|
9053
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
9053
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"),
|
9054
9054
|
// Providers do not have an endpointId, use channelId as endpointId in the strategy.
|
9055
9055
|
providerIdentity.channelId, providerIdentity);
|
9056
9056
|
default:
|
@@ -9086,7 +9086,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
9086
9086
|
const supportedProtocols = await Promise.all(protocols.map(async (type) => {
|
9087
9087
|
switch (type) {
|
9088
9088
|
case 'rtc': {
|
9089
|
-
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$
|
9089
|
+
const { rtcClient, channels, offer, rtcConnectionId, channelsOpened } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").startClientOffer();
|
9090
9090
|
rtcPacket = { rtcClient, channels, channelsOpened };
|
9091
9091
|
return {
|
9092
9092
|
type: 'rtc',
|
@@ -9113,18 +9113,18 @@ class ConnectionManager extends base_1$i.Base {
|
|
9113
9113
|
routingInfo.endpointId = this.wire.environment.getNextMessageId();
|
9114
9114
|
// For New Clients connecting to Old Providers. To prevent multi-dispatching and publishing, we delete previously-connected
|
9115
9115
|
// clients that are in the same context as the newly-connected client.
|
9116
|
-
__classPrivateFieldGet$
|
9116
|
+
__classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f").checkForPreviousClientConnection(routingInfo.channelId);
|
9117
9117
|
}
|
9118
9118
|
const answer = routingInfo.answer ?? {
|
9119
9119
|
supportedProtocols: [{ type: 'classic', version: 1 }]
|
9120
9120
|
};
|
9121
9121
|
const createStrategyFromAnswer = async (protocol) => {
|
9122
9122
|
if (protocol.type === 'rtc' && rtcPacket) {
|
9123
|
-
await __classPrivateFieldGet$
|
9123
|
+
await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").finishClientOffer(rtcPacket.rtcClient, protocol.payload.answer, rtcPacket.channelsOpened);
|
9124
9124
|
return new strategy_2.RTCStrategy();
|
9125
9125
|
}
|
9126
9126
|
if (protocol.type === 'classic') {
|
9127
|
-
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$
|
9127
|
+
return new strategy_1.ClassicStrategy(this.wire, __classPrivateFieldGet$c(this, _ConnectionManager_messageReceiver, "f"), routingInfo.endpointId, routingInfo);
|
9128
9128
|
}
|
9129
9129
|
return null;
|
9130
9130
|
};
|
@@ -9192,7 +9192,7 @@ class ConnectionManager extends base_1$i.Base {
|
|
9192
9192
|
clientAnswer = await overlappingProtocols.reduce(async (accumP, protocolToUse) => {
|
9193
9193
|
const answer = await accumP;
|
9194
9194
|
if (protocolToUse.type === 'rtc') {
|
9195
|
-
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$
|
9195
|
+
const { answer: rtcAnswer, rtcClient, channels } = await __classPrivateFieldGet$c(this, _ConnectionManager_rtcConnectionManager, "f").createProviderAnswer(protocolToUse.payload.rtcConnectionId, protocolToUse.payload.offer);
|
9196
9196
|
answer.supportedProtocols.push({
|
9197
9197
|
type: 'rtc',
|
9198
9198
|
version: strategy_2.RTCInfo.version,
|
@@ -9240,13 +9240,13 @@ _ConnectionManager_messageReceiver = new WeakMap(), _ConnectionManager_rtcConnec
|
|
9240
9240
|
*
|
9241
9241
|
* @packageDocumentation
|
9242
9242
|
*/
|
9243
|
-
var __classPrivateFieldSet$
|
9243
|
+
var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
9244
9244
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
9245
9245
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
9246
9246
|
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");
|
9247
9247
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
9248
9248
|
};
|
9249
|
-
var __classPrivateFieldGet$
|
9249
|
+
var __classPrivateFieldGet$b = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9250
9250
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9251
9251
|
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");
|
9252
9252
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
@@ -9303,11 +9303,11 @@ class Channel extends base_1$h.EmitterBase {
|
|
9303
9303
|
client_1.ChannelClient.handleProviderDisconnect(eventPayload);
|
9304
9304
|
}),
|
9305
9305
|
this.on('connected', (...args) => {
|
9306
|
-
__classPrivateFieldGet$
|
9306
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").emit('connected', ...args);
|
9307
9307
|
})
|
9308
9308
|
]).catch(() => new Error('error setting up channel connection listeners'));
|
9309
9309
|
}));
|
9310
|
-
__classPrivateFieldSet$
|
9310
|
+
__classPrivateFieldSet$a(this, _Channel_connectionManager, new connection_manager_1.ConnectionManager(wire), "f");
|
9311
9311
|
}
|
9312
9312
|
/**
|
9313
9313
|
*
|
@@ -9382,7 +9382,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9382
9382
|
resolve(true);
|
9383
9383
|
}
|
9384
9384
|
};
|
9385
|
-
__classPrivateFieldGet$
|
9385
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").on('connected', connectedListener);
|
9386
9386
|
});
|
9387
9387
|
try {
|
9388
9388
|
if (retryInfo.count > 0) {
|
@@ -9414,7 +9414,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9414
9414
|
finally {
|
9415
9415
|
retryInfo.count += 1;
|
9416
9416
|
// in case of other errors, remove our listener
|
9417
|
-
__classPrivateFieldGet$
|
9417
|
+
__classPrivateFieldGet$b(this, _Channel_internalEmitter, "f").removeListener('connected', connectedListener);
|
9418
9418
|
}
|
9419
9419
|
} while (shouldWait); // If we're waiting we retry the above loop
|
9420
9420
|
// Should wait was false, no channel was found.
|
@@ -9473,12 +9473,12 @@ class Channel extends base_1$h.EmitterBase {
|
|
9473
9473
|
async connect(channelName, options = {}) {
|
9474
9474
|
// Make sure we don't connect before listeners are set up
|
9475
9475
|
// This also errors if we're not in OpenFin, ensuring we don't run unnecessary code
|
9476
|
-
await __classPrivateFieldGet$
|
9476
|
+
await __classPrivateFieldGet$b(this, _Channel_readyToConnect, "f").getValue();
|
9477
9477
|
if (!channelName || typeof channelName !== 'string') {
|
9478
9478
|
throw new Error('Please provide a channelName string to connect to a channel.');
|
9479
9479
|
}
|
9480
9480
|
const opts = { wait: true, ...this.wire.environment.getDefaultChannelOptions().connect, ...options };
|
9481
|
-
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$
|
9481
|
+
const { offer, rtc: rtcPacket } = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientOffer(opts);
|
9482
9482
|
let connectionUrl;
|
9483
9483
|
if (this.fin.me.isFrame || this.fin.me.isView || this.fin.me.isWindow) {
|
9484
9484
|
connectionUrl = (await this.fin.me.getInfo()).url;
|
@@ -9490,7 +9490,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9490
9490
|
connectionUrl
|
9491
9491
|
};
|
9492
9492
|
const routingInfo = await this.safeConnect(channelName, opts.wait, connectPayload);
|
9493
|
-
const strategy = await __classPrivateFieldGet$
|
9493
|
+
const strategy = await __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createClientStrategy(rtcPacket, routingInfo);
|
9494
9494
|
const channel = new client_1.ChannelClient(routingInfo, () => client_1.ChannelClient.wireClose(this.wire, routingInfo, routingInfo.endpointId), strategy);
|
9495
9495
|
// It is the client's responsibility to handle endpoint disconnection to the provider.
|
9496
9496
|
// If the endpoint dies, the client will force a disconnection through the core.
|
@@ -9559,7 +9559,7 @@ class Channel extends base_1$h.EmitterBase {
|
|
9559
9559
|
throw new Error('Please provide a channelName to create a channel');
|
9560
9560
|
}
|
9561
9561
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
9562
|
-
const channel = __classPrivateFieldGet$
|
9562
|
+
const channel = __classPrivateFieldGet$b(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
9563
9563
|
// TODO: fix typing (internal)
|
9564
9564
|
// @ts-expect-error
|
9565
9565
|
this.on('client-disconnected', (eventPayload) => {
|
@@ -9795,14 +9795,32 @@ var clipboard = {};
|
|
9795
9795
|
*
|
9796
9796
|
* @packageDocumentation
|
9797
9797
|
*/
|
9798
|
+
var __classPrivateFieldGet$a = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9799
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9800
|
+
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");
|
9801
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
9802
|
+
};
|
9803
|
+
var __classPrivateFieldSet$9 = (commonjsGlobal && commonjsGlobal.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
9804
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
9805
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
9806
|
+
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");
|
9807
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
9808
|
+
};
|
9809
|
+
var _Clipboard_instances, _Clipboard_securedApiWarningCount, _Clipboard_warnSecuredApi;
|
9798
9810
|
Object.defineProperty(clipboard, "__esModule", { value: true });
|
9799
9811
|
clipboard.Clipboard = void 0;
|
9800
9812
|
const base_1$f = base;
|
9813
|
+
const maxSecuredApiWarnings = 10;
|
9801
9814
|
/**
|
9802
9815
|
* The Clipboard API allows reading and writing to the clipboard in multiple formats.
|
9803
9816
|
*
|
9804
9817
|
*/
|
9805
9818
|
class Clipboard extends base_1$f.Base {
|
9819
|
+
constructor() {
|
9820
|
+
super(...arguments);
|
9821
|
+
_Clipboard_instances.add(this);
|
9822
|
+
_Clipboard_securedApiWarningCount.set(this, 0);
|
9823
|
+
}
|
9806
9824
|
/**
|
9807
9825
|
* Writes data into the clipboard as plain text
|
9808
9826
|
* @param writeObj The object for writing data into the clipboard
|
@@ -9815,6 +9833,7 @@ class Clipboard extends base_1$f.Base {
|
|
9815
9833
|
* ```
|
9816
9834
|
*/
|
9817
9835
|
async writeText(writeObj) {
|
9836
|
+
__classPrivateFieldGet$a(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeText');
|
9818
9837
|
await this.wire.sendAction('clipboard-write-text', writeObj);
|
9819
9838
|
}
|
9820
9839
|
/**
|
@@ -9827,6 +9846,7 @@ class Clipboard extends base_1$f.Base {
|
|
9827
9846
|
* ```
|
9828
9847
|
*/
|
9829
9848
|
async readText(type) {
|
9849
|
+
__classPrivateFieldGet$a(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readText');
|
9830
9850
|
// NOTE: When we start supporting linux, we could detect the OS and choose 'selection' automatically for the user
|
9831
9851
|
const { payload } = await this.wire.sendAction('clipboard-read-text', { type });
|
9832
9852
|
return payload.data;
|
@@ -9844,6 +9864,7 @@ class Clipboard extends base_1$f.Base {
|
|
9844
9864
|
* ```
|
9845
9865
|
*/
|
9846
9866
|
async writeImage(writeRequest) {
|
9867
|
+
__classPrivateFieldGet$a(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeImage');
|
9847
9868
|
await this.wire.sendAction('clipboard-write-image', writeRequest);
|
9848
9869
|
}
|
9849
9870
|
/**
|
@@ -9879,6 +9900,7 @@ class Clipboard extends base_1$f.Base {
|
|
9879
9900
|
* ```
|
9880
9901
|
*/
|
9881
9902
|
async readImage(readRequest = { format: 'dataURL' }) {
|
9903
|
+
__classPrivateFieldGet$a(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readImage');
|
9882
9904
|
const { payload } = await this.wire.sendAction('clipboard-read-image', readRequest);
|
9883
9905
|
return payload.data;
|
9884
9906
|
}
|
@@ -9894,6 +9916,7 @@ class Clipboard extends base_1$f.Base {
|
|
9894
9916
|
* ```
|
9895
9917
|
*/
|
9896
9918
|
async writeHtml(writeObj) {
|
9919
|
+
__classPrivateFieldGet$a(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeHtml');
|
9897
9920
|
await this.wire.sendAction('clipboard-write-html', writeObj);
|
9898
9921
|
}
|
9899
9922
|
/**
|
@@ -9906,6 +9929,7 @@ class Clipboard extends base_1$f.Base {
|
|
9906
9929
|
* ```
|
9907
9930
|
*/
|
9908
9931
|
async readHtml(type) {
|
9932
|
+
__classPrivateFieldGet$a(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readHtml');
|
9909
9933
|
const { payload } = await this.wire.sendAction('clipboard-read-html', { type });
|
9910
9934
|
return payload.data;
|
9911
9935
|
}
|
@@ -9921,6 +9945,7 @@ class Clipboard extends base_1$f.Base {
|
|
9921
9945
|
* ```
|
9922
9946
|
*/
|
9923
9947
|
async writeRtf(writeObj) {
|
9948
|
+
__classPrivateFieldGet$a(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.writeRtf');
|
9924
9949
|
await this.wire.sendAction('clipboard-write-rtf', writeObj);
|
9925
9950
|
}
|
9926
9951
|
/**
|
@@ -9941,6 +9966,7 @@ class Clipboard extends base_1$f.Base {
|
|
9941
9966
|
* ```
|
9942
9967
|
*/
|
9943
9968
|
async readRtf(type) {
|
9969
|
+
__classPrivateFieldGet$a(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.readRtf');
|
9944
9970
|
const { payload } = await this.wire.sendAction('clipboard-read-rtf', { type });
|
9945
9971
|
return payload.data;
|
9946
9972
|
}
|
@@ -9964,6 +9990,7 @@ class Clipboard extends base_1$f.Base {
|
|
9964
9990
|
* ```
|
9965
9991
|
*/
|
9966
9992
|
async write(writeObj) {
|
9993
|
+
__classPrivateFieldGet$a(this, _Clipboard_instances, "m", _Clipboard_warnSecuredApi).call(this, 'Clipboard.write');
|
9967
9994
|
await this.wire.sendAction('clipboard-write', writeObj);
|
9968
9995
|
}
|
9969
9996
|
/**
|
@@ -9981,6 +10008,12 @@ class Clipboard extends base_1$f.Base {
|
|
9981
10008
|
}
|
9982
10009
|
}
|
9983
10010
|
clipboard.Clipboard = Clipboard;
|
10011
|
+
_Clipboard_securedApiWarningCount = new WeakMap(), _Clipboard_instances = new WeakSet(), _Clipboard_warnSecuredApi = async function _Clipboard_warnSecuredApi(apiName) {
|
10012
|
+
if (__classPrivateFieldGet$a(this, _Clipboard_securedApiWarningCount, "f") <= maxSecuredApiWarnings) {
|
10013
|
+
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/`);
|
10014
|
+
__classPrivateFieldSet$9(this, _Clipboard_securedApiWarningCount, __classPrivateFieldGet$a(this, _Clipboard_securedApiWarningCount, "f") + 1, "f");
|
10015
|
+
}
|
10016
|
+
};
|
9984
10017
|
|
9985
10018
|
var externalApplication = {};
|
9986
10019
|
|