@openfin/core 25.68.30 → 25.70.2
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/OpenFin.d.ts +30 -826
- package/README.md +12 -2
- package/package.json +1 -1
- package/src/api/application/Factory.d.ts +145 -145
- package/src/api/application/Factory.js +229 -229
- package/src/api/application/Instance.d.ts +301 -302
- package/src/api/application/Instance.js +412 -412
- package/src/api/application/index.d.ts +3 -3
- package/src/api/application/index.js +15 -15
- package/src/api/base.d.ts +43 -43
- package/src/api/base.js +177 -177
- package/src/api/clipboard/index.d.ts +69 -69
- package/src/api/clipboard/index.js +88 -88
- package/src/api/events/application.d.ts +69 -0
- package/src/api/events/application.js +2 -0
- package/src/api/events/base.d.ts +17 -0
- package/src/api/events/base.js +2 -0
- package/src/api/events/channel.d.ts +10 -11
- package/src/api/events/channel.js +2 -2
- package/src/api/events/emitterMap.d.ts +11 -11
- package/src/api/events/emitterMap.js +35 -35
- package/src/api/events/eventAggregator.d.ts +5 -5
- package/src/api/events/eventAggregator.js +43 -43
- package/src/api/events/externalApplication.d.ts +5 -0
- package/src/api/events/externalApplication.js +2 -0
- package/src/api/events/frame.d.ts +9 -0
- package/src/api/events/frame.js +2 -0
- package/src/api/events/globalHotkey.d.ts +10 -0
- package/src/api/events/globalHotkey.js +2 -0
- package/src/api/events/platform.d.ts +18 -0
- package/src/api/events/platform.js +2 -0
- package/src/api/events/system.d.ts +22 -0
- package/src/api/events/system.js +2 -0
- package/src/api/events/view.d.ts +56 -0
- package/src/api/events/view.js +2 -0
- package/src/api/events/webcontents.d.ts +48 -0
- package/src/api/events/webcontents.js +2 -0
- package/src/api/events/window.d.ts +176 -0
- package/src/api/events/window.js +2 -0
- package/src/api/external-application/Factory.d.ts +26 -26
- package/src/api/external-application/Factory.js +40 -40
- package/src/api/external-application/Instance.d.ts +101 -102
- package/src/api/external-application/Instance.js +109 -109
- package/src/api/external-application/index.d.ts +3 -3
- package/src/api/external-application/index.js +15 -15
- package/src/api/fin.d.ts +49 -49
- package/src/api/fin.js +43 -43
- package/src/api/frame/Factory.d.ts +36 -36
- package/src/api/frame/Factory.js +69 -69
- package/src/api/frame/Instance.d.ts +121 -121
- package/src/api/frame/Instance.js +130 -130
- package/src/api/frame/index.d.ts +3 -3
- package/src/api/frame/index.js +15 -15
- package/src/api/global-hotkey/index.d.ts +38 -38
- package/src/api/global-hotkey/index.js +58 -58
- package/src/api/interappbus/channel/channel.d.ts +26 -26
- package/src/api/interappbus/channel/channel.js +77 -77
- package/src/api/interappbus/channel/channels-docs.d.ts +318 -318
- package/src/api/interappbus/channel/channels-docs.js +376 -376
- package/src/api/interappbus/channel/client.d.ts +22 -22
- package/src/api/interappbus/channel/client.js +84 -84
- package/src/api/interappbus/channel/connection-manager.d.ts +28 -28
- package/src/api/interappbus/channel/connection-manager.js +244 -244
- package/src/api/interappbus/channel/index.d.ts +22 -23
- package/src/api/interappbus/channel/index.js +121 -121
- package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +13 -13
- package/src/api/interappbus/channel/protocols/classic/message-receiver.js +73 -73
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +22 -22
- package/src/api/interappbus/channel/protocols/classic/strategy.js +84 -84
- package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +20 -20
- package/src/api/interappbus/channel/protocols/combined/strategy.js +58 -58
- package/src/api/interappbus/channel/protocols/index.d.ts +44 -44
- package/src/api/interappbus/channel/protocols/index.js +2 -2
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +10 -10
- package/src/api/interappbus/channel/protocols/protocol-manager.js +43 -43
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +23 -23
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +135 -135
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +30 -30
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +131 -131
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +22 -22
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +87 -87
- package/src/api/interappbus/channel/protocols/strategy-types.d.ts +13 -13
- package/src/api/interappbus/channel/protocols/strategy-types.js +2 -2
- package/src/api/interappbus/channel/protocols/strategy.d.ts +15 -15
- package/src/api/interappbus/channel/protocols/strategy.js +2 -2
- package/src/api/interappbus/channel/provider.d.ts +31 -31
- package/src/api/interappbus/channel/provider.js +160 -160
- package/src/api/interappbus/index.d.ts +85 -86
- package/src/api/interappbus/index.js +175 -175
- package/src/api/interop/Factory.d.ts +37 -37
- package/src/api/interop/Factory.js +54 -54
- package/src/api/interop/InteropBroker.d.ts +363 -363
- package/src/api/interop/InteropBroker.js +914 -914
- package/src/api/interop/InteropClient.d.ts +268 -268
- package/src/api/interop/InteropClient.js +450 -450
- package/src/api/interop/SessionContextGroupBroker.d.ts +26 -26
- package/src/api/interop/SessionContextGroupBroker.js +107 -107
- package/src/api/interop/SessionContextGroupClient.d.ts +20 -20
- package/src/api/interop/SessionContextGroupClient.js +85 -85
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +187 -187
- package/src/api/interop/fdc3/fdc3-1.2.js +385 -385
- package/src/api/interop/fdc3/fdc3.js +17 -17
- package/src/api/interop/fdc3/utils.d.ts +6 -6
- package/src/api/interop/fdc3/utils.js +17 -17
- package/src/api/interop/index.d.ts +4 -4
- package/src/api/interop/index.js +16 -16
- package/src/api/interop/utils.d.ts +11 -11
- package/src/api/interop/utils.js +36 -36
- package/src/api/me.d.ts +38 -35
- package/src/api/me.js +128 -60
- package/src/api/platform/Factory.d.ts +109 -109
- package/src/api/platform/Factory.js +188 -188
- package/src/api/platform/Instance.d.ts +122 -122
- package/src/api/platform/Instance.js +298 -298
- package/src/api/platform/common-utils.d.ts +6 -6
- package/src/api/platform/common-utils.js +16 -16
- package/src/api/platform/index.d.ts +3 -3
- package/src/api/platform/index.js +15 -15
- package/src/api/platform/layout/Factory.d.ts +108 -108
- package/src/api/platform/layout/Factory.js +189 -189
- package/src/api/platform/layout/Instance.d.ts +49 -49
- package/src/api/platform/layout/Instance.js +99 -99
- package/src/api/platform/layout/index.d.ts +2 -2
- package/src/api/platform/layout/index.js +14 -14
- package/src/api/platform/layout/shapes.d.ts +11 -0
- package/src/api/{window → platform/layout}/shapes.js +2 -2
- package/src/api/snapshot-source/Factory.d.ts +36 -36
- package/src/api/snapshot-source/Factory.js +65 -65
- package/src/api/snapshot-source/Instance.d.ts +30 -30
- package/src/api/snapshot-source/Instance.js +134 -134
- package/src/api/snapshot-source/index.d.ts +3 -3
- package/src/api/snapshot-source/index.js +15 -15
- package/src/api/snapshot-source/utils.d.ts +1 -1
- package/src/api/snapshot-source/utils.js +5 -5
- package/src/api/system/index.d.ts +960 -961
- package/src/api/system/index.js +1241 -1241
- package/src/api/view/Factory.d.ts +49 -49
- package/src/api/view/Factory.js +103 -103
- package/src/api/view/Instance.d.ts +387 -380
- package/src/api/view/Instance.js +422 -415
- package/src/api/view/index.d.ts +3 -3
- package/src/api/view/index.js +15 -15
- package/src/api/webcontents/main.d.ts +36 -36
- package/src/api/webcontents/main.js +82 -82
- package/src/api/window/Factory.d.ts +44 -44
- package/src/api/window/Factory.js +91 -91
- package/src/api/window/Instance.d.ts +972 -966
- package/src/api/window/Instance.js +1209 -1202
- package/src/api/window/index.d.ts +3 -5
- package/src/api/window/index.js +15 -17
- package/src/environment/environment.d.ts +28 -25
- package/src/environment/environment.js +4 -4
- package/src/environment/node-env.d.ts +25 -26
- package/src/environment/node-env.js +64 -64
- package/src/environment/openfin-env.d.ts +29 -30
- package/src/environment/openfin-env.js +107 -107
- package/src/mock.d.ts +3 -3
- package/src/mock.js +91 -90
- package/src/shapes/ERROR_BOX_TYPES.d.ts +1 -0
- package/src/shapes/ERROR_BOX_TYPES.js +2 -0
- package/src/shapes/WebOptions.d.ts +12 -0
- package/src/shapes/WebOptions.js +2 -0
- package/src/shapes/WindowOptions.d.ts +42 -0
- package/src/shapes/WindowOptions.js +2 -0
- package/src/shapes/protocol.d.ts +178 -0
- package/src/shapes/protocol.js +2 -0
- package/src/transport/fin_store.d.ts +4 -4
- package/src/transport/fin_store.js +16 -16
- package/src/transport/transport-errors.d.ts +18 -18
- package/src/transport/transport-errors.js +37 -37
- package/src/transport/transport.d.ts +56 -43
- package/src/transport/transport.js +181 -181
- package/src/transport/wire.d.ts +71 -11
- package/src/transport/wire.js +32 -32
- package/src/util/asyncFilter.d.ts +1 -1
- package/src/util/asyncFilter.js +7 -7
- package/src/util/errors.d.ts +9 -5
- package/src/util/errors.js +11 -11
- package/src/util/exhaustive.d.ts +1 -1
- package/src/util/exhaustive.js +7 -7
- package/src/util/http.d.ts +11 -11
- package/src/util/http.js +83 -83
- package/src/util/normalize-config.d.ts +3 -5
- package/src/util/normalize-config.js +47 -47
- package/src/util/promises.d.ts +5 -5
- package/src/util/promises.js +27 -27
- package/src/util/ref-counter.d.ts +7 -7
- package/src/util/ref-counter.js +51 -51
- package/src/util/runtimeVersioning.d.ts +3 -3
- package/src/util/runtimeVersioning.js +25 -25
- package/src/util/utilTypes.d.ts +8 -8
- package/src/util/utilTypes.js +2 -2
- package/src/util/validate.d.ts +3 -3
- package/src/util/validate.js +11 -11
- package/docs.README(OLD).md +0 -82
- package/resources/win/OpenFinRVM.exe +0 -0
- package/src/api/window/bounds-changed.d.ts +0 -10
- package/src/api/window/bounds-changed.js +0 -6
- package/src/api/window/shapes.d.ts +0 -13
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _WindowModule from './Factory';
|
|
2
|
-
export default _WindowModule;
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './Instance';
|
|
5
|
-
export * from './bounds-changed';
|
|
1
|
+
import _WindowModule from './Factory';
|
|
2
|
+
export default _WindowModule;
|
|
3
|
+
export * from './Instance';
|
package/src/api/window/index.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const Factory_1 = require("./Factory");
|
|
14
|
-
exports.default = Factory_1.default;
|
|
15
|
-
__exportStar(require("./
|
|
16
|
-
__exportStar(require("./Instance"), exports);
|
|
17
|
-
__exportStar(require("./bounds-changed"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
const Factory_1 = require("./Factory");
|
|
14
|
+
exports.default = Factory_1.default;
|
|
15
|
+
__exportStar(require("./Instance"), exports);
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import NewConnectConfig
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { NewConnectConfig } from '../transport/wire';
|
|
2
|
+
import EntityType = OpenFin.EntityType;
|
|
3
|
+
export interface Environment {
|
|
4
|
+
getManagerConstructor(): Promise<any>;
|
|
5
|
+
getProviderInitializer(): Promise<any>;
|
|
6
|
+
writeToken(path: string, token: string): Promise<string>;
|
|
7
|
+
retrievePort(config: NewConnectConfig): Promise<number>;
|
|
8
|
+
getNextMessageId(): any;
|
|
9
|
+
getRandomId(): string;
|
|
10
|
+
createChildContent(options: ChildContentOptions): Promise<any>;
|
|
11
|
+
getWebWindow(identity: OpenFin.Identity): globalThis.Window;
|
|
12
|
+
getCurrentEntityIdentity(): OpenFin.EntityInfo;
|
|
13
|
+
getCurrentEntityType(): EntityType;
|
|
14
|
+
raiseEvent(eventName: string, eventArgs: any): void;
|
|
15
|
+
childViews: boolean;
|
|
16
|
+
getUrl(): string;
|
|
17
|
+
getDefaultChannelOptions(): {
|
|
18
|
+
create: OpenFin.ChannelCreateOptions;
|
|
19
|
+
connect: OpenFin.ChannelConnectOptions;
|
|
20
|
+
};
|
|
21
|
+
getRtcPeer(): RTCPeerConnection;
|
|
22
|
+
whenReady(): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export interface ChildContentOptions {
|
|
25
|
+
options: any;
|
|
26
|
+
entityType: EntityType;
|
|
27
|
+
}
|
|
28
|
+
export declare const notImplementedEnvErrorMsg = "Not implemented in this environment";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.notImplementedEnvErrorMsg = void 0;
|
|
4
|
-
exports.notImplementedEnvErrorMsg = 'Not implemented in this environment';
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.notImplementedEnvErrorMsg = void 0;
|
|
4
|
+
exports.notImplementedEnvErrorMsg = 'Not implemented in this environment';
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { Environment } from './environment';
|
|
2
|
-
import NewConnectConfig
|
|
3
|
-
import EntityType = OpenFin.EntityType;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
1
|
+
import { Environment } from './environment';
|
|
2
|
+
import { NewConnectConfig } from '../transport/wire';
|
|
3
|
+
import EntityType = OpenFin.EntityType;
|
|
4
|
+
export default class NodeEnvironment implements Environment {
|
|
5
|
+
getDefaultChannelOptions(): {
|
|
6
|
+
create: OpenFin.ChannelCreateOptions;
|
|
7
|
+
connect: OpenFin.ChannelConnectOptions;
|
|
8
|
+
};
|
|
9
|
+
getRtcPeer(): RTCPeerConnection;
|
|
10
|
+
private messageCounter;
|
|
11
|
+
childViews: boolean;
|
|
12
|
+
getManagerConstructor(): Promise<any>;
|
|
13
|
+
getProviderInitializer(): Promise<any>;
|
|
14
|
+
whenReady(): Promise<void>;
|
|
15
|
+
writeToken: (path: string, token: string) => Promise<string>;
|
|
16
|
+
retrievePort: (config: NewConnectConfig) => Promise<number>;
|
|
17
|
+
getNextMessageId: () => any;
|
|
18
|
+
getRandomId: () => string;
|
|
19
|
+
createChildContent(options: any): Promise<any>;
|
|
20
|
+
getWebWindow: (identity: OpenFin.Identity) => globalThis.Window;
|
|
21
|
+
getCurrentEntityIdentity: () => OpenFin.EntityInfo;
|
|
22
|
+
getCurrentEntityType: () => EntityType;
|
|
23
|
+
raiseEvent: (eventName: string, eventArgs: any) => void;
|
|
24
|
+
getUrl: () => string;
|
|
25
|
+
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/* eslint-disable class-methods-use-this */
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
const crypto_1 = require("crypto");
|
|
6
|
-
const environment_1 = require("./environment");
|
|
7
|
-
const port_discovery_1 = require("../transport/port-discovery");
|
|
8
|
-
const transport_errors_1 = require("../transport/transport-errors");
|
|
9
|
-
class NodeEnvironment {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.messageCounter = 0;
|
|
12
|
-
this.childViews = false;
|
|
13
|
-
this.writeToken = (path, token) => {
|
|
14
|
-
return new Promise((resolve) => {
|
|
15
|
-
fs_1.writeFile(path, token, () => resolve(token));
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
this.retrievePort = (config) => {
|
|
19
|
-
const pd = new port_discovery_1.default(config, this);
|
|
20
|
-
return pd.retrievePort();
|
|
21
|
-
};
|
|
22
|
-
this.getNextMessageId = () => {
|
|
23
|
-
// eslint-disable-next-line no-plusplus
|
|
24
|
-
return this.messageCounter++;
|
|
25
|
-
};
|
|
26
|
-
this.getRandomId = () => {
|
|
27
|
-
return crypto_1.randomBytes(16).toString('hex');
|
|
28
|
-
};
|
|
29
|
-
this.getWebWindow = (identity) => {
|
|
30
|
-
throw new transport_errors_1.NotSupportedError('Not supported outside of OpenFin web context');
|
|
31
|
-
};
|
|
32
|
-
this.getCurrentEntityIdentity = () => {
|
|
33
|
-
throw new transport_errors_1.NotImplementedError(environment_1.notImplementedEnvErrorMsg);
|
|
34
|
-
};
|
|
35
|
-
this.getCurrentEntityType = () => {
|
|
36
|
-
return 'external connection';
|
|
37
|
-
};
|
|
38
|
-
this.raiseEvent = (eventName, eventArgs) => {
|
|
39
|
-
throw new transport_errors_1.NotImplementedError(environment_1.notImplementedEnvErrorMsg);
|
|
40
|
-
};
|
|
41
|
-
this.getUrl = () => {
|
|
42
|
-
throw new transport_errors_1.NotImplementedError('Not Implemented');
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
getDefaultChannelOptions() {
|
|
46
|
-
return { create: {}, connect: {} };
|
|
47
|
-
}
|
|
48
|
-
getRtcPeer() {
|
|
49
|
-
throw new Error('Method not implemented.');
|
|
50
|
-
}
|
|
51
|
-
async getManagerConstructor() {
|
|
52
|
-
throw new Error('Method not implemented.');
|
|
53
|
-
}
|
|
54
|
-
async getProviderInitializer() {
|
|
55
|
-
throw new Error('Method not implemented.');
|
|
56
|
-
}
|
|
57
|
-
whenReady() {
|
|
58
|
-
return Promise.resolve();
|
|
59
|
-
}
|
|
60
|
-
createChildContent(options) {
|
|
61
|
-
throw new transport_errors_1.NotImplementedError('Not Implemented');
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.default = NodeEnvironment;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable class-methods-use-this */
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
const environment_1 = require("./environment");
|
|
7
|
+
const port_discovery_1 = require("../transport/port-discovery");
|
|
8
|
+
const transport_errors_1 = require("../transport/transport-errors");
|
|
9
|
+
class NodeEnvironment {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.messageCounter = 0;
|
|
12
|
+
this.childViews = false;
|
|
13
|
+
this.writeToken = (path, token) => {
|
|
14
|
+
return new Promise((resolve) => {
|
|
15
|
+
fs_1.writeFile(path, token, () => resolve(token));
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
this.retrievePort = (config) => {
|
|
19
|
+
const pd = new port_discovery_1.default(config, this);
|
|
20
|
+
return pd.retrievePort();
|
|
21
|
+
};
|
|
22
|
+
this.getNextMessageId = () => {
|
|
23
|
+
// eslint-disable-next-line no-plusplus
|
|
24
|
+
return this.messageCounter++;
|
|
25
|
+
};
|
|
26
|
+
this.getRandomId = () => {
|
|
27
|
+
return crypto_1.randomBytes(16).toString('hex');
|
|
28
|
+
};
|
|
29
|
+
this.getWebWindow = (identity) => {
|
|
30
|
+
throw new transport_errors_1.NotSupportedError('Not supported outside of OpenFin web context');
|
|
31
|
+
};
|
|
32
|
+
this.getCurrentEntityIdentity = () => {
|
|
33
|
+
throw new transport_errors_1.NotImplementedError(environment_1.notImplementedEnvErrorMsg);
|
|
34
|
+
};
|
|
35
|
+
this.getCurrentEntityType = () => {
|
|
36
|
+
return 'external connection';
|
|
37
|
+
};
|
|
38
|
+
this.raiseEvent = (eventName, eventArgs) => {
|
|
39
|
+
throw new transport_errors_1.NotImplementedError(environment_1.notImplementedEnvErrorMsg);
|
|
40
|
+
};
|
|
41
|
+
this.getUrl = () => {
|
|
42
|
+
throw new transport_errors_1.NotImplementedError('Not Implemented');
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
getDefaultChannelOptions() {
|
|
46
|
+
return { create: {}, connect: {} };
|
|
47
|
+
}
|
|
48
|
+
getRtcPeer() {
|
|
49
|
+
throw new Error('Method not implemented.');
|
|
50
|
+
}
|
|
51
|
+
async getManagerConstructor() {
|
|
52
|
+
throw new Error('Method not implemented.');
|
|
53
|
+
}
|
|
54
|
+
async getProviderInitializer() {
|
|
55
|
+
throw new Error('Method not implemented.');
|
|
56
|
+
}
|
|
57
|
+
whenReady() {
|
|
58
|
+
return Promise.resolve();
|
|
59
|
+
}
|
|
60
|
+
createChildContent(options) {
|
|
61
|
+
throw new transport_errors_1.NotImplementedError('Not Implemented');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.default = NodeEnvironment;
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { Environment } from './environment';
|
|
2
|
-
import NewConnectConfig
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
1
|
+
import { ChildContentOptions, Environment } from './environment';
|
|
2
|
+
import { NewConnectConfig } from '../transport/wire';
|
|
3
|
+
import EntityType = OpenFin.EntityType;
|
|
4
|
+
export default class OpenFinEnvironment implements Environment {
|
|
5
|
+
#private;
|
|
6
|
+
private raiseEventAsync;
|
|
7
|
+
childViews: boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
getDefaultChannelOptions(): {
|
|
10
|
+
create: OpenFin.ChannelCreateOptions;
|
|
11
|
+
connect: OpenFin.ChannelConnectOptions;
|
|
12
|
+
};
|
|
13
|
+
getRtcPeer(): RTCPeerConnection;
|
|
14
|
+
getManagerConstructor(): Promise<any>;
|
|
15
|
+
getProviderInitializer(): Promise<any>;
|
|
16
|
+
writeToken: (path: string, token: string) => Promise<string>;
|
|
17
|
+
retrievePort: (config: NewConnectConfig) => Promise<number>;
|
|
18
|
+
getNextMessageId: () => any;
|
|
19
|
+
createChildContent: ({ options, entityType }: ChildContentOptions) => Promise<unknown>;
|
|
20
|
+
private normalizeOptions;
|
|
21
|
+
getRandomId: () => string;
|
|
22
|
+
private resolveUrl;
|
|
23
|
+
getWebWindow: (identity: OpenFin.Identity) => globalThis.Window;
|
|
24
|
+
getCurrentEntityIdentity: () => OpenFin.EntityInfo;
|
|
25
|
+
getCurrentEntityType: () => EntityType;
|
|
26
|
+
raiseEvent: (eventName: string, eventArgs: any) => void;
|
|
27
|
+
getUrl: () => string;
|
|
28
|
+
whenReady(): Promise<void>;
|
|
29
|
+
}
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
|
|
3
|
-
if (!privateMap.has(receiver)) {
|
|
4
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
5
|
-
}
|
|
6
|
-
privateMap.set(receiver, value);
|
|
7
|
-
return value;
|
|
8
|
-
};
|
|
9
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
|
10
|
-
if (!privateMap.has(receiver)) {
|
|
11
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
12
|
-
}
|
|
13
|
-
return privateMap.get(receiver);
|
|
14
|
-
};
|
|
15
|
-
var _ready;
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
/* global window, location */
|
|
18
|
-
/* eslint-disable class-methods-use-this */
|
|
19
|
-
const transport_errors_1 = require("../transport/transport-errors");
|
|
20
|
-
class OpenFinEnvironment {
|
|
21
|
-
constructor() {
|
|
22
|
-
_ready.set(this, void 0);
|
|
23
|
-
this.writeToken = (path, token) => {
|
|
24
|
-
throw new transport_errors_1.NotImplementedError('Not Implemented');
|
|
25
|
-
};
|
|
26
|
-
this.retrievePort = (config) => {
|
|
27
|
-
throw new transport_errors_1.NotImplementedError('Not Implemented');
|
|
28
|
-
};
|
|
29
|
-
this.getNextMessageId = () => {
|
|
30
|
-
return fin.desktop.getUuid();
|
|
31
|
-
};
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
33
|
-
this.createChildContent = async ({ options, entityType }) => {
|
|
34
|
-
const opts = this.normalizeOptions(options);
|
|
35
|
-
return new Promise((y, n) => fin.__internal_.createChildContent({ entityType, options: opts }, y, n));
|
|
36
|
-
};
|
|
37
|
-
this.normalizeOptions = (options) => {
|
|
38
|
-
const { uuid: parentUuid } = fin.__internal_.initialOptions;
|
|
39
|
-
const opts = JSON.parse(JSON.stringify(options));
|
|
40
|
-
const ABOUT_BLANK = 'about:blank';
|
|
41
|
-
opts.uuid = opts.uuid || parentUuid;
|
|
42
|
-
opts.url = opts.url || ABOUT_BLANK;
|
|
43
|
-
if (opts.url !== ABOUT_BLANK) {
|
|
44
|
-
opts.url = this.resolveUrl(opts.url);
|
|
45
|
-
}
|
|
46
|
-
return opts;
|
|
47
|
-
};
|
|
48
|
-
this.getRandomId = () => {
|
|
49
|
-
const intArray = new Uint32Array(1);
|
|
50
|
-
return window.crypto.getRandomValues(intArray)[0].toString(32);
|
|
51
|
-
};
|
|
52
|
-
this.getWebWindow = (identity) => {
|
|
53
|
-
return fin.__internal_.getWebWindow(identity.name);
|
|
54
|
-
};
|
|
55
|
-
this.getCurrentEntityIdentity = () => {
|
|
56
|
-
return fin.__internal_.entityInfo;
|
|
57
|
-
};
|
|
58
|
-
this.getCurrentEntityType = () => {
|
|
59
|
-
return this.getCurrentEntityIdentity().entityType || 'unknown';
|
|
60
|
-
};
|
|
61
|
-
this.raiseEvent = (eventName, eventArgs) => {
|
|
62
|
-
this.raiseEventAsync(eventName, eventArgs);
|
|
63
|
-
};
|
|
64
|
-
this.getUrl = () => {
|
|
65
|
-
return location.href;
|
|
66
|
-
};
|
|
67
|
-
this.raiseEventAsync = fin.__internal_.raiseEventAsync;
|
|
68
|
-
delete fin.__internal_.raiseEventAsync;
|
|
69
|
-
this.childViews = fin.__internal_.childViews;
|
|
70
|
-
__classPrivateFieldSet(this, _ready, new Promise((resolve) => {
|
|
71
|
-
fin.desktop.main(resolve);
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
getDefaultChannelOptions() {
|
|
75
|
-
var _a, _b;
|
|
76
|
-
return {
|
|
77
|
-
create: {},
|
|
78
|
-
connect: {},
|
|
79
|
-
...((_b = (_a = fin.__internal_.initialOptions.experimental) === null || _a === void 0 ? void 0 : _a.defaultChannelOptions) !== null && _b !== void 0 ? _b : {})
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
getRtcPeer() {
|
|
83
|
-
return new RTCPeerConnection();
|
|
84
|
-
}
|
|
85
|
-
async getManagerConstructor() {
|
|
86
|
-
const ManagerConstructor = (await Promise.resolve().then(() => require(
|
|
87
|
-
/* webpackChunkName: 'layout' */
|
|
88
|
-
'../api/platform/renderer/openfin-layout'))).default;
|
|
89
|
-
return ManagerConstructor;
|
|
90
|
-
}
|
|
91
|
-
async getProviderInitializer() {
|
|
92
|
-
const providerInitializer = (await Promise.resolve().then(() => require(
|
|
93
|
-
/* webpackChunkName: 'provider' */
|
|
94
|
-
'../api/platform/renderer/platform-provider'))).default;
|
|
95
|
-
return providerInitializer;
|
|
96
|
-
}
|
|
97
|
-
// eslint-disable-next-line class-methods-use-this
|
|
98
|
-
resolveUrl(url) {
|
|
99
|
-
const newUrl = new URL(url, location.href);
|
|
100
|
-
return newUrl.href;
|
|
101
|
-
}
|
|
102
|
-
whenReady() {
|
|
103
|
-
return __classPrivateFieldGet(this, _ready);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
exports.default = OpenFinEnvironment;
|
|
107
|
-
_ready = new WeakMap();
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
|
|
3
|
+
if (!privateMap.has(receiver)) {
|
|
4
|
+
throw new TypeError("attempted to set private field on non-instance");
|
|
5
|
+
}
|
|
6
|
+
privateMap.set(receiver, value);
|
|
7
|
+
return value;
|
|
8
|
+
};
|
|
9
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
|
10
|
+
if (!privateMap.has(receiver)) {
|
|
11
|
+
throw new TypeError("attempted to get private field on non-instance");
|
|
12
|
+
}
|
|
13
|
+
return privateMap.get(receiver);
|
|
14
|
+
};
|
|
15
|
+
var _ready;
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* global window, location */
|
|
18
|
+
/* eslint-disable class-methods-use-this */
|
|
19
|
+
const transport_errors_1 = require("../transport/transport-errors");
|
|
20
|
+
class OpenFinEnvironment {
|
|
21
|
+
constructor() {
|
|
22
|
+
_ready.set(this, void 0);
|
|
23
|
+
this.writeToken = (path, token) => {
|
|
24
|
+
throw new transport_errors_1.NotImplementedError('Not Implemented');
|
|
25
|
+
};
|
|
26
|
+
this.retrievePort = (config) => {
|
|
27
|
+
throw new transport_errors_1.NotImplementedError('Not Implemented');
|
|
28
|
+
};
|
|
29
|
+
this.getNextMessageId = () => {
|
|
30
|
+
return fin.desktop.getUuid();
|
|
31
|
+
};
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
33
|
+
this.createChildContent = async ({ options, entityType }) => {
|
|
34
|
+
const opts = this.normalizeOptions(options);
|
|
35
|
+
return new Promise((y, n) => fin.__internal_.createChildContent({ entityType, options: opts }, y, n));
|
|
36
|
+
};
|
|
37
|
+
this.normalizeOptions = (options) => {
|
|
38
|
+
const { uuid: parentUuid } = fin.__internal_.initialOptions;
|
|
39
|
+
const opts = JSON.parse(JSON.stringify(options));
|
|
40
|
+
const ABOUT_BLANK = 'about:blank';
|
|
41
|
+
opts.uuid = opts.uuid || parentUuid;
|
|
42
|
+
opts.url = opts.url || ABOUT_BLANK;
|
|
43
|
+
if (opts.url !== ABOUT_BLANK) {
|
|
44
|
+
opts.url = this.resolveUrl(opts.url);
|
|
45
|
+
}
|
|
46
|
+
return opts;
|
|
47
|
+
};
|
|
48
|
+
this.getRandomId = () => {
|
|
49
|
+
const intArray = new Uint32Array(1);
|
|
50
|
+
return window.crypto.getRandomValues(intArray)[0].toString(32);
|
|
51
|
+
};
|
|
52
|
+
this.getWebWindow = (identity) => {
|
|
53
|
+
return fin.__internal_.getWebWindow(identity.name);
|
|
54
|
+
};
|
|
55
|
+
this.getCurrentEntityIdentity = () => {
|
|
56
|
+
return fin.__internal_.entityInfo;
|
|
57
|
+
};
|
|
58
|
+
this.getCurrentEntityType = () => {
|
|
59
|
+
return this.getCurrentEntityIdentity().entityType || 'unknown';
|
|
60
|
+
};
|
|
61
|
+
this.raiseEvent = (eventName, eventArgs) => {
|
|
62
|
+
this.raiseEventAsync(eventName, eventArgs);
|
|
63
|
+
};
|
|
64
|
+
this.getUrl = () => {
|
|
65
|
+
return location.href;
|
|
66
|
+
};
|
|
67
|
+
this.raiseEventAsync = fin.__internal_.raiseEventAsync;
|
|
68
|
+
delete fin.__internal_.raiseEventAsync;
|
|
69
|
+
this.childViews = fin.__internal_.childViews;
|
|
70
|
+
__classPrivateFieldSet(this, _ready, new Promise((resolve) => {
|
|
71
|
+
fin.desktop.main(resolve);
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
getDefaultChannelOptions() {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
return {
|
|
77
|
+
create: {},
|
|
78
|
+
connect: {},
|
|
79
|
+
...((_b = (_a = fin.__internal_.initialOptions.experimental) === null || _a === void 0 ? void 0 : _a.defaultChannelOptions) !== null && _b !== void 0 ? _b : {})
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
getRtcPeer() {
|
|
83
|
+
return new RTCPeerConnection();
|
|
84
|
+
}
|
|
85
|
+
async getManagerConstructor() {
|
|
86
|
+
const ManagerConstructor = (await Promise.resolve().then(() => require(
|
|
87
|
+
/* webpackChunkName: 'layout' */
|
|
88
|
+
'../api/platform/renderer/openfin-layout'))).default;
|
|
89
|
+
return ManagerConstructor;
|
|
90
|
+
}
|
|
91
|
+
async getProviderInitializer() {
|
|
92
|
+
const providerInitializer = (await Promise.resolve().then(() => require(
|
|
93
|
+
/* webpackChunkName: 'provider' */
|
|
94
|
+
'../api/platform/renderer/platform-provider'))).default;
|
|
95
|
+
return providerInitializer;
|
|
96
|
+
}
|
|
97
|
+
// eslint-disable-next-line class-methods-use-this
|
|
98
|
+
resolveUrl(url) {
|
|
99
|
+
const newUrl = new URL(url, location.href);
|
|
100
|
+
return newUrl.href;
|
|
101
|
+
}
|
|
102
|
+
whenReady() {
|
|
103
|
+
return __classPrivateFieldGet(this, _ready);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.default = OpenFinEnvironment;
|
|
107
|
+
_ready = new WeakMap();
|
package/src/mock.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/// <reference path="../OpenFin.d.ts" />
|
|
2
|
-
export declare const fin: import("./api/fin").FinApi<"window" | "
|
|
3
|
-
export default OpenFin;
|
|
1
|
+
/// <reference path="../OpenFin.d.ts" />
|
|
2
|
+
export declare const fin: import("./api/fin").FinApi<"window" | "view">;
|
|
3
|
+
export default OpenFin;
|