@openfin/core 44.101.5 → 44.101.7
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 +5 -1
- package/out/mock-beta.d.ts +5 -1
- package/out/mock-public.d.ts +5 -1
- package/out/stub.d.ts +5 -1
- package/out/stub.js +39 -16
- package/out/stub.mjs +39 -16
- package/package.json +1 -1
package/out/mock-alpha.d.ts
CHANGED
|
@@ -2885,7 +2885,7 @@ declare class ChannelProvider extends ChannelBase {
|
|
|
2885
2885
|
* a read-only array containing all the identities of connecting clients.
|
|
2886
2886
|
*/
|
|
2887
2887
|
get connections(): OpenFin_2.ClientConnectionPayload[];
|
|
2888
|
-
static handleClientDisconnection(channel: ChannelProvider, payload:
|
|
2888
|
+
static handleClientDisconnection(channel: ChannelProvider, payload: ClientDisconnectionPayload): void;
|
|
2889
2889
|
static setProviderRemoval(provider: ChannelProvider, remove: Function): void;
|
|
2890
2890
|
/* Excluded from this release type: __constructor */
|
|
2891
2891
|
/**
|
|
@@ -3235,6 +3235,10 @@ declare type ClientChangedContextGroup = InteropClientEvent<'client-changed-cont
|
|
|
3235
3235
|
*/
|
|
3236
3236
|
declare type ClientConnectionPayload = ClientIdentity & ClientInfo;
|
|
3237
3237
|
|
|
3238
|
+
declare type ClientDisconnectionPayload = OpenFin_2.Identity & {
|
|
3239
|
+
endpointId?: string;
|
|
3240
|
+
};
|
|
3241
|
+
|
|
3238
3242
|
/**
|
|
3239
3243
|
* Identity of a channel client. Includes endpointId to differentiate between different connections for an entity.
|
|
3240
3244
|
* @interface
|
package/out/mock-beta.d.ts
CHANGED
|
@@ -2885,7 +2885,7 @@ declare class ChannelProvider extends ChannelBase {
|
|
|
2885
2885
|
* a read-only array containing all the identities of connecting clients.
|
|
2886
2886
|
*/
|
|
2887
2887
|
get connections(): OpenFin_2.ClientConnectionPayload[];
|
|
2888
|
-
static handleClientDisconnection(channel: ChannelProvider, payload:
|
|
2888
|
+
static handleClientDisconnection(channel: ChannelProvider, payload: ClientDisconnectionPayload): void;
|
|
2889
2889
|
static setProviderRemoval(provider: ChannelProvider, remove: Function): void;
|
|
2890
2890
|
/* Excluded from this release type: __constructor */
|
|
2891
2891
|
/**
|
|
@@ -3235,6 +3235,10 @@ declare type ClientChangedContextGroup = InteropClientEvent<'client-changed-cont
|
|
|
3235
3235
|
*/
|
|
3236
3236
|
declare type ClientConnectionPayload = ClientIdentity & ClientInfo;
|
|
3237
3237
|
|
|
3238
|
+
declare type ClientDisconnectionPayload = OpenFin_2.Identity & {
|
|
3239
|
+
endpointId?: string;
|
|
3240
|
+
};
|
|
3241
|
+
|
|
3238
3242
|
/**
|
|
3239
3243
|
* Identity of a channel client. Includes endpointId to differentiate between different connections for an entity.
|
|
3240
3244
|
* @interface
|
package/out/mock-public.d.ts
CHANGED
|
@@ -2885,7 +2885,7 @@ declare class ChannelProvider extends ChannelBase {
|
|
|
2885
2885
|
* a read-only array containing all the identities of connecting clients.
|
|
2886
2886
|
*/
|
|
2887
2887
|
get connections(): OpenFin_2.ClientConnectionPayload[];
|
|
2888
|
-
static handleClientDisconnection(channel: ChannelProvider, payload:
|
|
2888
|
+
static handleClientDisconnection(channel: ChannelProvider, payload: ClientDisconnectionPayload): void;
|
|
2889
2889
|
static setProviderRemoval(provider: ChannelProvider, remove: Function): void;
|
|
2890
2890
|
/* Excluded from this release type: __constructor */
|
|
2891
2891
|
/**
|
|
@@ -3235,6 +3235,10 @@ declare type ClientChangedContextGroup = InteropClientEvent<'client-changed-cont
|
|
|
3235
3235
|
*/
|
|
3236
3236
|
declare type ClientConnectionPayload = ClientIdentity & ClientInfo;
|
|
3237
3237
|
|
|
3238
|
+
declare type ClientDisconnectionPayload = OpenFin_2.Identity & {
|
|
3239
|
+
endpointId?: string;
|
|
3240
|
+
};
|
|
3241
|
+
|
|
3238
3242
|
/**
|
|
3239
3243
|
* Identity of a channel client. Includes endpointId to differentiate between different connections for an entity.
|
|
3240
3244
|
* @interface
|
package/out/stub.d.ts
CHANGED
|
@@ -2938,7 +2938,7 @@ declare class ChannelProvider extends ChannelBase {
|
|
|
2938
2938
|
* a read-only array containing all the identities of connecting clients.
|
|
2939
2939
|
*/
|
|
2940
2940
|
get connections(): OpenFin_2.ClientConnectionPayload[];
|
|
2941
|
-
static handleClientDisconnection(channel: ChannelProvider, payload:
|
|
2941
|
+
static handleClientDisconnection(channel: ChannelProvider, payload: ClientDisconnectionPayload): void;
|
|
2942
2942
|
static setProviderRemoval(provider: ChannelProvider, remove: Function): void;
|
|
2943
2943
|
/**
|
|
2944
2944
|
* @internal
|
|
@@ -3291,6 +3291,10 @@ declare type ClientChangedContextGroup = InteropClientEvent<'client-changed-cont
|
|
|
3291
3291
|
*/
|
|
3292
3292
|
declare type ClientConnectionPayload = ClientIdentity & ClientInfo;
|
|
3293
3293
|
|
|
3294
|
+
declare type ClientDisconnectionPayload = OpenFin_2.Identity & {
|
|
3295
|
+
endpointId?: string;
|
|
3296
|
+
};
|
|
3297
|
+
|
|
3294
3298
|
/**
|
|
3295
3299
|
* Identity of a channel client. Includes endpointId to differentiate between different connections for an entity.
|
|
3296
3300
|
* @interface
|
package/out/stub.js
CHANGED
|
@@ -8288,9 +8288,8 @@ class ChannelProvider extends ChannelBase {
|
|
|
8288
8288
|
return [...__classPrivateFieldGet$e(this, _ChannelProvider_connections, "f")];
|
|
8289
8289
|
}
|
|
8290
8290
|
static handleClientDisconnection(channel, payload) {
|
|
8291
|
-
if (payload
|
|
8292
|
-
|
|
8293
|
-
__classPrivateFieldGet$e(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
|
8291
|
+
if (payload.endpointId) {
|
|
8292
|
+
__classPrivateFieldGet$e(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { endpointId: payload.endpointId });
|
|
8294
8293
|
}
|
|
8295
8294
|
else {
|
|
8296
8295
|
// this is here to support older runtimes that did not have endpointId
|
|
@@ -8460,7 +8459,9 @@ class ChannelProvider extends ChannelBase {
|
|
|
8460
8459
|
* ```
|
|
8461
8460
|
*/
|
|
8462
8461
|
onDisconnection(listener) {
|
|
8463
|
-
this.disconnectListener =
|
|
8462
|
+
this.disconnectListener = (identity) => {
|
|
8463
|
+
listener(identity);
|
|
8464
|
+
};
|
|
8464
8465
|
}
|
|
8465
8466
|
/**
|
|
8466
8467
|
* Destroy the channel, raises `disconnected` events on all connected channel clients.
|
|
@@ -8477,7 +8478,6 @@ class ChannelProvider extends ChannelBase {
|
|
|
8477
8478
|
*/
|
|
8478
8479
|
async destroy() {
|
|
8479
8480
|
const protectedObj = __classPrivateFieldGet$e(this, _ChannelProvider_protectedObj, "f");
|
|
8480
|
-
protectedObj.providerIdentity;
|
|
8481
8481
|
__classPrivateFieldSet$d(this, _ChannelProvider_connections, [], "f");
|
|
8482
8482
|
await protectedObj.close();
|
|
8483
8483
|
__classPrivateFieldGet$e(this, _ChannelProvider_close, "f").call(this);
|
|
@@ -8774,6 +8774,13 @@ class ConnectionManager extends Base {
|
|
|
8774
8774
|
_ConnectionManager_messageReceiver.set(this, void 0);
|
|
8775
8775
|
_ConnectionManager_rtcConnectionManager.set(this, void 0);
|
|
8776
8776
|
this.removeChannelFromProviderMap = (channelId) => {
|
|
8777
|
+
const providerEntry = this.providerMap.get(channelId);
|
|
8778
|
+
if (providerEntry) {
|
|
8779
|
+
const { channelName } = providerEntry.providerIdentity;
|
|
8780
|
+
if (this.providerChannelIdByName.get(channelName) === channelId) {
|
|
8781
|
+
this.providerChannelIdByName.delete(channelName);
|
|
8782
|
+
}
|
|
8783
|
+
}
|
|
8777
8784
|
this.providerMap.delete(channelId);
|
|
8778
8785
|
};
|
|
8779
8786
|
this.onmessage = (msg) => {
|
|
@@ -8784,6 +8791,7 @@ class ConnectionManager extends Base {
|
|
|
8784
8791
|
return false;
|
|
8785
8792
|
};
|
|
8786
8793
|
this.providerMap = new Map();
|
|
8794
|
+
this.providerChannelIdByName = new Map();
|
|
8787
8795
|
this.protocolManager = new ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
|
8788
8796
|
__classPrivateFieldSet$c(this, _ConnectionManager_messageReceiver, new MessageReceiver(wire), "f");
|
|
8789
8797
|
__classPrivateFieldSet$c(this, _ConnectionManager_rtcConnectionManager, new RTCICEManager(wire), "f");
|
|
@@ -8820,10 +8828,12 @@ class ConnectionManager extends Base {
|
|
|
8820
8828
|
const channel = new ChannelProvider(providerIdentity, () => ChannelProvider.wireClose(this.wire, providerIdentity.channelName), strategy);
|
|
8821
8829
|
const key = providerIdentity.channelId;
|
|
8822
8830
|
this.providerMap.set(key, {
|
|
8831
|
+
providerIdentity,
|
|
8823
8832
|
provider: channel,
|
|
8824
8833
|
strategy,
|
|
8825
8834
|
supportedProtocols: ConnectionManager.getProtocolOptionsFromStrings(protocols)
|
|
8826
8835
|
});
|
|
8836
|
+
this.providerChannelIdByName.set(providerIdentity.channelName, key);
|
|
8827
8837
|
ChannelProvider.setProviderRemoval(channel, this.removeChannelFromProviderMap.bind(this));
|
|
8828
8838
|
return channel;
|
|
8829
8839
|
}
|
|
@@ -8898,6 +8908,16 @@ class ConnectionManager extends Base {
|
|
|
8898
8908
|
strategy.addEndpoint(routingInfo.channelId, endpointPayload);
|
|
8899
8909
|
return strategy;
|
|
8900
8910
|
}
|
|
8911
|
+
handleClientDisconnection(eventPayload) {
|
|
8912
|
+
const channelId = eventPayload.channelId ?? this.providerChannelIdByName.get(eventPayload.channelName ?? '');
|
|
8913
|
+
if (!channelId) {
|
|
8914
|
+
return;
|
|
8915
|
+
}
|
|
8916
|
+
const providerEntry = this.providerMap.get(channelId);
|
|
8917
|
+
if (providerEntry) {
|
|
8918
|
+
ChannelProvider.handleClientDisconnection(providerEntry.provider, eventPayload);
|
|
8919
|
+
}
|
|
8920
|
+
}
|
|
8901
8921
|
async processChannelConnection(msg) {
|
|
8902
8922
|
const { clientIdentity, providerIdentity, ackToSender, payload, offer: clientOffer } = msg.payload;
|
|
8903
8923
|
if (!clientIdentity.endpointId) {
|
|
@@ -8997,7 +9017,7 @@ var __classPrivateFieldGet$c = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
8997
9017
|
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");
|
|
8998
9018
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
8999
9019
|
};
|
|
9000
|
-
var _Channel_connectionManager, _Channel_internalEmitter, _Channel_readyToConnect;
|
|
9020
|
+
var _Channel_connectionManager, _Channel_internalEmitter, _Channel_readyForProvider, _Channel_readyToConnect;
|
|
9001
9021
|
function retryDelay(count) {
|
|
9002
9022
|
const interval = 500; // base delay
|
|
9003
9023
|
const steps = 10; // How many retries to do before incrementing the delay
|
|
@@ -9033,9 +9053,19 @@ class Channel extends EmitterBase {
|
|
|
9033
9053
|
super(wire, 'channel');
|
|
9034
9054
|
_Channel_connectionManager.set(this, void 0);
|
|
9035
9055
|
_Channel_internalEmitter.set(this, new events.EventEmitter());
|
|
9056
|
+
// Provider-side disconnect routing setup. This must exist before first create()
|
|
9057
|
+
// so provider onDisconnection callbacks are wired even if connect() is never called.
|
|
9058
|
+
_Channel_readyForProvider.set(this, new AsyncRetryableLazy(async () => {
|
|
9059
|
+
// TODO: fix typing (internal)
|
|
9060
|
+
// @ts-expect-error
|
|
9061
|
+
await this.on('client-disconnected', (eventPayload) => {
|
|
9062
|
+
__classPrivateFieldGet$c(this, _Channel_connectionManager, "f").handleClientDisconnection(eventPayload);
|
|
9063
|
+
});
|
|
9064
|
+
}));
|
|
9036
9065
|
// OpenFin API has not been injected at construction time, *must* wait for API to be ready.
|
|
9037
9066
|
_Channel_readyToConnect.set(this, new AsyncRetryableLazy(async () => {
|
|
9038
9067
|
await Promise.all([
|
|
9068
|
+
__classPrivateFieldGet$c(this, _Channel_readyForProvider, "f").getValue(),
|
|
9039
9069
|
this.on('disconnected', (eventPayload) => {
|
|
9040
9070
|
ChannelClient.handleProviderDisconnect(eventPayload);
|
|
9041
9071
|
}),
|
|
@@ -9292,22 +9322,15 @@ class Channel extends EmitterBase {
|
|
|
9292
9322
|
* ```
|
|
9293
9323
|
*/
|
|
9294
9324
|
async create(channelName, options) {
|
|
9325
|
+
await __classPrivateFieldGet$c(this, _Channel_readyForProvider, "f").getValue();
|
|
9295
9326
|
if (!channelName) {
|
|
9296
9327
|
throw new Error('Please provide a channelName to create a channel');
|
|
9297
9328
|
}
|
|
9298
9329
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
|
9299
|
-
|
|
9300
|
-
// TODO: fix typing (internal)
|
|
9301
|
-
// @ts-expect-error
|
|
9302
|
-
this.on('client-disconnected', (eventPayload) => {
|
|
9303
|
-
if (eventPayload.channelName === channelName) {
|
|
9304
|
-
ChannelProvider.handleClientDisconnection(channel, eventPayload);
|
|
9305
|
-
}
|
|
9306
|
-
});
|
|
9307
|
-
return channel;
|
|
9330
|
+
return __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
|
9308
9331
|
}
|
|
9309
9332
|
}
|
|
9310
|
-
_Channel_connectionManager = new WeakMap(), _Channel_internalEmitter = new WeakMap(), _Channel_readyToConnect = new WeakMap();
|
|
9333
|
+
_Channel_connectionManager = new WeakMap(), _Channel_internalEmitter = new WeakMap(), _Channel_readyForProvider = new WeakMap(), _Channel_readyToConnect = new WeakMap();
|
|
9311
9334
|
|
|
9312
9335
|
/**
|
|
9313
9336
|
* Entry point for the OpenFin `InterApplicationBus` API (`fin.InterApplicationBus`).
|
package/out/stub.mjs
CHANGED
|
@@ -8284,9 +8284,8 @@ class ChannelProvider extends ChannelBase {
|
|
|
8284
8284
|
return [...__classPrivateFieldGet$e(this, _ChannelProvider_connections, "f")];
|
|
8285
8285
|
}
|
|
8286
8286
|
static handleClientDisconnection(channel, payload) {
|
|
8287
|
-
if (payload
|
|
8288
|
-
|
|
8289
|
-
__classPrivateFieldGet$e(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { uuid, name, endpointId, isLocalEndpointId });
|
|
8287
|
+
if (payload.endpointId) {
|
|
8288
|
+
__classPrivateFieldGet$e(channel, _ChannelProvider_removeEndpoint, "f").call(channel, { endpointId: payload.endpointId });
|
|
8290
8289
|
}
|
|
8291
8290
|
else {
|
|
8292
8291
|
// this is here to support older runtimes that did not have endpointId
|
|
@@ -8456,7 +8455,9 @@ class ChannelProvider extends ChannelBase {
|
|
|
8456
8455
|
* ```
|
|
8457
8456
|
*/
|
|
8458
8457
|
onDisconnection(listener) {
|
|
8459
|
-
this.disconnectListener =
|
|
8458
|
+
this.disconnectListener = (identity) => {
|
|
8459
|
+
listener(identity);
|
|
8460
|
+
};
|
|
8460
8461
|
}
|
|
8461
8462
|
/**
|
|
8462
8463
|
* Destroy the channel, raises `disconnected` events on all connected channel clients.
|
|
@@ -8473,7 +8474,6 @@ class ChannelProvider extends ChannelBase {
|
|
|
8473
8474
|
*/
|
|
8474
8475
|
async destroy() {
|
|
8475
8476
|
const protectedObj = __classPrivateFieldGet$e(this, _ChannelProvider_protectedObj, "f");
|
|
8476
|
-
protectedObj.providerIdentity;
|
|
8477
8477
|
__classPrivateFieldSet$d(this, _ChannelProvider_connections, [], "f");
|
|
8478
8478
|
await protectedObj.close();
|
|
8479
8479
|
__classPrivateFieldGet$e(this, _ChannelProvider_close, "f").call(this);
|
|
@@ -8770,6 +8770,13 @@ class ConnectionManager extends Base {
|
|
|
8770
8770
|
_ConnectionManager_messageReceiver.set(this, void 0);
|
|
8771
8771
|
_ConnectionManager_rtcConnectionManager.set(this, void 0);
|
|
8772
8772
|
this.removeChannelFromProviderMap = (channelId) => {
|
|
8773
|
+
const providerEntry = this.providerMap.get(channelId);
|
|
8774
|
+
if (providerEntry) {
|
|
8775
|
+
const { channelName } = providerEntry.providerIdentity;
|
|
8776
|
+
if (this.providerChannelIdByName.get(channelName) === channelId) {
|
|
8777
|
+
this.providerChannelIdByName.delete(channelName);
|
|
8778
|
+
}
|
|
8779
|
+
}
|
|
8773
8780
|
this.providerMap.delete(channelId);
|
|
8774
8781
|
};
|
|
8775
8782
|
this.onmessage = (msg) => {
|
|
@@ -8780,6 +8787,7 @@ class ConnectionManager extends Base {
|
|
|
8780
8787
|
return false;
|
|
8781
8788
|
};
|
|
8782
8789
|
this.providerMap = new Map();
|
|
8790
|
+
this.providerChannelIdByName = new Map();
|
|
8783
8791
|
this.protocolManager = new ProtocolManager(this.wire.environment.type === 'node' ? ['classic'] : ['rtc', 'classic']);
|
|
8784
8792
|
__classPrivateFieldSet$c(this, _ConnectionManager_messageReceiver, new MessageReceiver(wire), "f");
|
|
8785
8793
|
__classPrivateFieldSet$c(this, _ConnectionManager_rtcConnectionManager, new RTCICEManager(wire), "f");
|
|
@@ -8816,10 +8824,12 @@ class ConnectionManager extends Base {
|
|
|
8816
8824
|
const channel = new ChannelProvider(providerIdentity, () => ChannelProvider.wireClose(this.wire, providerIdentity.channelName), strategy);
|
|
8817
8825
|
const key = providerIdentity.channelId;
|
|
8818
8826
|
this.providerMap.set(key, {
|
|
8827
|
+
providerIdentity,
|
|
8819
8828
|
provider: channel,
|
|
8820
8829
|
strategy,
|
|
8821
8830
|
supportedProtocols: ConnectionManager.getProtocolOptionsFromStrings(protocols)
|
|
8822
8831
|
});
|
|
8832
|
+
this.providerChannelIdByName.set(providerIdentity.channelName, key);
|
|
8823
8833
|
ChannelProvider.setProviderRemoval(channel, this.removeChannelFromProviderMap.bind(this));
|
|
8824
8834
|
return channel;
|
|
8825
8835
|
}
|
|
@@ -8894,6 +8904,16 @@ class ConnectionManager extends Base {
|
|
|
8894
8904
|
strategy.addEndpoint(routingInfo.channelId, endpointPayload);
|
|
8895
8905
|
return strategy;
|
|
8896
8906
|
}
|
|
8907
|
+
handleClientDisconnection(eventPayload) {
|
|
8908
|
+
const channelId = eventPayload.channelId ?? this.providerChannelIdByName.get(eventPayload.channelName ?? '');
|
|
8909
|
+
if (!channelId) {
|
|
8910
|
+
return;
|
|
8911
|
+
}
|
|
8912
|
+
const providerEntry = this.providerMap.get(channelId);
|
|
8913
|
+
if (providerEntry) {
|
|
8914
|
+
ChannelProvider.handleClientDisconnection(providerEntry.provider, eventPayload);
|
|
8915
|
+
}
|
|
8916
|
+
}
|
|
8897
8917
|
async processChannelConnection(msg) {
|
|
8898
8918
|
const { clientIdentity, providerIdentity, ackToSender, payload, offer: clientOffer } = msg.payload;
|
|
8899
8919
|
if (!clientIdentity.endpointId) {
|
|
@@ -8993,7 +9013,7 @@ var __classPrivateFieldGet$c = (undefined && undefined.__classPrivateFieldGet) |
|
|
|
8993
9013
|
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");
|
|
8994
9014
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
8995
9015
|
};
|
|
8996
|
-
var _Channel_connectionManager, _Channel_internalEmitter, _Channel_readyToConnect;
|
|
9016
|
+
var _Channel_connectionManager, _Channel_internalEmitter, _Channel_readyForProvider, _Channel_readyToConnect;
|
|
8997
9017
|
function retryDelay(count) {
|
|
8998
9018
|
const interval = 500; // base delay
|
|
8999
9019
|
const steps = 10; // How many retries to do before incrementing the delay
|
|
@@ -9029,9 +9049,19 @@ class Channel extends EmitterBase {
|
|
|
9029
9049
|
super(wire, 'channel');
|
|
9030
9050
|
_Channel_connectionManager.set(this, void 0);
|
|
9031
9051
|
_Channel_internalEmitter.set(this, new EventEmitter());
|
|
9052
|
+
// Provider-side disconnect routing setup. This must exist before first create()
|
|
9053
|
+
// so provider onDisconnection callbacks are wired even if connect() is never called.
|
|
9054
|
+
_Channel_readyForProvider.set(this, new AsyncRetryableLazy(async () => {
|
|
9055
|
+
// TODO: fix typing (internal)
|
|
9056
|
+
// @ts-expect-error
|
|
9057
|
+
await this.on('client-disconnected', (eventPayload) => {
|
|
9058
|
+
__classPrivateFieldGet$c(this, _Channel_connectionManager, "f").handleClientDisconnection(eventPayload);
|
|
9059
|
+
});
|
|
9060
|
+
}));
|
|
9032
9061
|
// OpenFin API has not been injected at construction time, *must* wait for API to be ready.
|
|
9033
9062
|
_Channel_readyToConnect.set(this, new AsyncRetryableLazy(async () => {
|
|
9034
9063
|
await Promise.all([
|
|
9064
|
+
__classPrivateFieldGet$c(this, _Channel_readyForProvider, "f").getValue(),
|
|
9035
9065
|
this.on('disconnected', (eventPayload) => {
|
|
9036
9066
|
ChannelClient.handleProviderDisconnect(eventPayload);
|
|
9037
9067
|
}),
|
|
@@ -9288,22 +9318,15 @@ class Channel extends EmitterBase {
|
|
|
9288
9318
|
* ```
|
|
9289
9319
|
*/
|
|
9290
9320
|
async create(channelName, options) {
|
|
9321
|
+
await __classPrivateFieldGet$c(this, _Channel_readyForProvider, "f").getValue();
|
|
9291
9322
|
if (!channelName) {
|
|
9292
9323
|
throw new Error('Please provide a channelName to create a channel');
|
|
9293
9324
|
}
|
|
9294
9325
|
const { payload: { data: providerIdentity } } = await this.wire.sendAction('create-channel', { channelName });
|
|
9295
|
-
|
|
9296
|
-
// TODO: fix typing (internal)
|
|
9297
|
-
// @ts-expect-error
|
|
9298
|
-
this.on('client-disconnected', (eventPayload) => {
|
|
9299
|
-
if (eventPayload.channelName === channelName) {
|
|
9300
|
-
ChannelProvider.handleClientDisconnection(channel, eventPayload);
|
|
9301
|
-
}
|
|
9302
|
-
});
|
|
9303
|
-
return channel;
|
|
9326
|
+
return __classPrivateFieldGet$c(this, _Channel_connectionManager, "f").createProvider(options, providerIdentity);
|
|
9304
9327
|
}
|
|
9305
9328
|
}
|
|
9306
|
-
_Channel_connectionManager = new WeakMap(), _Channel_internalEmitter = new WeakMap(), _Channel_readyToConnect = new WeakMap();
|
|
9329
|
+
_Channel_connectionManager = new WeakMap(), _Channel_internalEmitter = new WeakMap(), _Channel_readyForProvider = new WeakMap(), _Channel_readyToConnect = new WeakMap();
|
|
9307
9330
|
|
|
9308
9331
|
/**
|
|
9309
9332
|
* Entry point for the OpenFin `InterApplicationBus` API (`fin.InterApplicationBus`).
|