@itwin/core-electron 4.3.0-dev.2 → 4.3.0-dev.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -1
- package/lib/cjs/common/ElectronPush.d.ts.map +1 -1
- package/lib/cjs/common/ElectronPush.js +0 -1
- package/lib/cjs/common/ElectronPush.js.map +1 -1
- package/lib/cjs/common/ElectronRpcManager.d.ts.map +1 -1
- package/lib/cjs/common/ElectronRpcManager.js +0 -1
- package/lib/cjs/common/ElectronRpcManager.js.map +1 -1
- package/lib/cjs/common/ElectronRpcProtocol.d.ts.map +1 -1
- package/lib/cjs/common/ElectronRpcProtocol.js +0 -1
- package/lib/cjs/common/ElectronRpcProtocol.js.map +1 -1
- package/lib/cjs/common/ElectronRpcRequest.d.ts.map +1 -1
- package/lib/cjs/common/ElectronRpcRequest.js +1 -2
- package/lib/cjs/common/ElectronRpcRequest.js.map +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
# Change Log - @itwin/core-electron
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 06 Nov 2023 14:03:28 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.2.3
|
|
6
|
+
Mon, 06 Nov 2023 14:01:52 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 4.2.2
|
|
11
|
+
Thu, 02 Nov 2023 15:36:20 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 4.2.1
|
|
16
|
+
Tue, 24 Oct 2023 15:09:13 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 4.2.0
|
|
21
|
+
Tue, 17 Oct 2023 15:14:32 GMT
|
|
22
|
+
|
|
23
|
+
### Updates
|
|
24
|
+
|
|
25
|
+
- Mitigate GHSA-j7hp-h8jx-5ppr by bumping electron to first patched version (26.2.1)
|
|
26
|
+
- Add support for Electron 26
|
|
27
|
+
|
|
28
|
+
## 4.1.9
|
|
29
|
+
Tue, 10 Oct 2023 18:48:12 GMT
|
|
30
|
+
|
|
31
|
+
_Version update only_
|
|
4
32
|
|
|
5
33
|
## 4.1.8
|
|
6
34
|
Fri, 06 Oct 2023 04:00:18 GMT
|
|
@@ -99,6 +127,16 @@ Mon, 22 May 2023 15:34:14 GMT
|
|
|
99
127
|
- Drop Electron 14, 15, 16, 17, 22. Start supporting Electron 23.
|
|
100
128
|
- Stopped registering any rpcs by default
|
|
101
129
|
|
|
130
|
+
## 3.7.16
|
|
131
|
+
Mon, 16 Oct 2023 12:49:07 GMT
|
|
132
|
+
|
|
133
|
+
_Version update only_
|
|
134
|
+
|
|
135
|
+
## 3.7.15
|
|
136
|
+
Tue, 10 Oct 2023 19:58:35 GMT
|
|
137
|
+
|
|
138
|
+
_Version update only_
|
|
139
|
+
|
|
102
140
|
## 3.7.14
|
|
103
141
|
Fri, 29 Sep 2023 16:57:16 GMT
|
|
104
142
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronPush.d.ts","sourceRoot":"","sources":["../../../src/common/ElectronPush.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiB,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC/H,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ElectronPush.d.ts","sourceRoot":"","sources":["../../../src/common/ElectronPush.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiB,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC/H,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAInF,gBAAgB;AAChB,qBAAa,qBAAsB,SAAQ,gBAAgB;IACzD,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,KAAK,CAAc;IAE3B,IAAW,IAAI,WAAyB;gBAErB,GAAG,EAAE,oBAAoB;IAKrC,OAAO,CAAC,QAAQ,EAAE,qBAAqB,GAAG,OAAO;CAczD;AAED,gBAAgB;AAChB,qBAAa,sBAAsB,CAAC,CAAC,CAAE,SAAQ,iBAAiB,CAAC,CAAC,CAAC;IACjE,OAAO,CAAC,IAAI,CAAsB;IAClC,OAAO,CAAC,KAAK,CAAc;gBAER,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,mBAAmB;IAK3E,IAAI,CAAC,WAAW,EAAE,GAAG;CAKnC"}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.ElectronPushConnection = exports.ElectronPushTransport = void 0;
|
|
8
8
|
const core_common_1 = require("@itwin/core-common");
|
|
9
|
-
/* eslint-disable deprecation/deprecation */
|
|
10
9
|
const PUSH = "__push__";
|
|
11
10
|
/** @internal */
|
|
12
11
|
class ElectronPushTransport extends core_common_1.RpcPushTransport {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronPush.js","sourceRoot":"","sources":["../../../src/common/ElectronPush.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,oDAA+H;AAG/H,
|
|
1
|
+
{"version":3,"file":"ElectronPush.js","sourceRoot":"","sources":["../../../src/common/ElectronPush.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,oDAA+H;AAG/H,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB,gBAAgB;AAChB,MAAa,qBAAsB,SAAQ,8BAAgB;IAIzD,IAAW,IAAI,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAExC,YAAmB,GAAyB;QAC1C,KAAK,EAAE,CAAC;QALF,UAAK,GAAW,CAAC,CAAC,CAAC;QAMzB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAEM,OAAO,CAAC,QAA+B;QAC5C,IAAI,QAAQ,CAAC,aAAa,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SACd;QAED,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC;QAE7B,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,WAAW,GAAG,2BAAa,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;YACnF,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;SAC1C;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAzBD,sDAyBC;AAED,gBAAgB;AAChB,MAAa,sBAA0B,SAAQ,+BAAoB;IAIjE,YAAmB,OAA0B,EAAE,MAAe,EAAE,GAAwB;QACtF,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAHjB,UAAK,GAAW,CAAC,CAAC,CAAC;QAIzB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAgB;QAChC,MAAM,MAAM,GAAG,MAAM,2BAAa,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC9E,MAAM,WAAW,GAA0B,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9I,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACjD,CAAC;CACF;AAdD,wDAcC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { RpcMarshaling, RpcPushChannel, RpcPushConnection, RpcPushTransport, RpcRequestFulfillment } from \"@itwin/core-common\";\r\nimport { BackendIpcTransport, FrontendIpcTransport } from \"./ElectronIpcTransport\";\r\n\r\nconst PUSH = \"__push__\";\r\n\r\n/** @internal */\r\nexport class ElectronPushTransport extends RpcPushTransport {\r\n private _ipc: FrontendIpcTransport;\r\n private _last: number = -1;\r\n\r\n public get last() { return this._last; }\r\n\r\n public constructor(ipc: FrontendIpcTransport) {\r\n super();\r\n this._ipc = ipc;\r\n }\r\n\r\n public consume(response: RpcRequestFulfillment): boolean {\r\n if (response.interfaceName !== PUSH) {\r\n return false;\r\n }\r\n\r\n this._last = response.status;\r\n\r\n if (this.onMessage) {\r\n const messageData = RpcMarshaling.deserialize(this._ipc.protocol, response.result);\r\n this.onMessage(response.id, messageData);\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class ElectronPushConnection<T> extends RpcPushConnection<T> {\r\n private _ipc: BackendIpcTransport;\r\n private _next: number = -1;\r\n\r\n public constructor(channel: RpcPushChannel<T>, client: unknown, ipc: BackendIpcTransport) {\r\n super(channel, client);\r\n this._ipc = ipc;\r\n }\r\n\r\n public async send(messageData: any) {\r\n const result = await RpcMarshaling.serialize(this._ipc.protocol, messageData);\r\n const fulfillment: RpcRequestFulfillment = { result, rawResult: messageData, interfaceName: PUSH, id: this.channel.id, status: ++this._next };\r\n this._ipc.sendResponse(fulfillment, undefined);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronRpcManager.d.ts","sourceRoot":"","sources":["../../../src/common/ElectronRpcManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,UAAU,EAAe,MAAM,oBAAoB,CAAC;AACvJ,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ElectronRpcManager.d.ts","sourceRoot":"","sources":["../../../src/common/ElectronRpcManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,UAAU,EAAe,MAAM,oBAAoB,CAAC;AACvJ,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;GAEG;AACH,8BAAsB,wBAAyB,SAAQ,gBAAgB;IAErE,OAAc,cAAc,CAAC,EAAE,MAAM,CAAC;IAEtC,yCAAyC;IACzC,SAAyB,QAAQ,EAAE,mBAAmB,CAAC;CACxD;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;IAChD,yEAAyE;WAC3D,kBAAkB,CAAC,WAAW,EAAE,iBAAiB,EAAE,UAAU,CAAC,EAAE,sBAAsB,EAAE,GAAG,wBAAwB;IAIjI,wEAAwE;WAC1D,iBAAiB,CAAC,UAAU,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,sBAAsB,EAAE,GAAG,wBAAwB;IAI9H,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAiBpC,wEAAwE;WAC1D,iBAAiB;IAI/B,OAAO,CAAC,MAAM,CAAC,kBAAkB;CAOlC"}
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.ElectronRpcManager = exports.ElectronRpcConfiguration = void 0;
|
|
8
8
|
const core_common_1 = require("@itwin/core-common");
|
|
9
9
|
const ElectronRpcProtocol_1 = require("./ElectronRpcProtocol");
|
|
10
|
-
/* eslint-disable deprecation/deprecation */
|
|
11
10
|
/** RPC interface configuration for an Electron-based application.
|
|
12
11
|
* @internal
|
|
13
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronRpcManager.js","sourceRoot":"","sources":["../../../src/common/ElectronRpcManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,oDAAuJ;AACvJ,+DAA4D;AAE5D
|
|
1
|
+
{"version":3,"file":"ElectronRpcManager.js","sourceRoot":"","sources":["../../../src/common/ElectronRpcManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,oDAAuJ;AACvJ,+DAA4D;AAE5D;;GAEG;AACH,MAAsB,wBAAyB,SAAQ,8BAAgB;CAMtE;AAND,4DAMC;AAED;;GAEG;AACH,MAAa,kBAAmB,SAAQ,wBAAU;IAChD,yEAAyE;IAClE,MAAM,CAAC,kBAAkB,CAAC,WAA8B,EAAE,UAAqC;QACpG,OAAO,kBAAkB,CAAC,qBAAqB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAC3E,CAAC;IAED,wEAAwE;IACjE,MAAM,CAAC,iBAAiB,CAAC,UAA4B,EAAE,UAAqC;QACjG,OAAO,kBAAkB,CAAC,qBAAqB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC1E,CAAC;IAEO,MAAM,CAAC,qBAAqB,CAAC,SAAoB,EAAE,IAA+B;QACxF,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,KAAM,SAAQ,wBAAwB;YAAtC;;gBACN,eAAU,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC;gBAC9B,aAAQ,GAAwB,IAAI,yCAAmB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YAClF,CAAC;SAAA,CAAC;QAEF,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;YAC5B,8BAAgB,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC;SAC5C;QAED,MAAM,QAAQ,GAAG,8BAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACjD,8BAAgB,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QAEhD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,wEAAwE;IACjE,MAAM,CAAC,iBAAiB;QAC7B,OAAO,kBAAkB,CAAC,kBAAkB,EAAE,CAAC;IACjD,CAAC;IAEO,MAAM,CAAC,kBAAkB;QAC/B,MAAM,WAAW,GAAG,yBAAW,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QAE3D,KAAK,MAAM,CAAC,EAAE,YAAY,CAAC,IAAI,WAAW,EAAE;YAC1C,wBAAU,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;SAC7C;IACH,CAAC;CACF;AAxCD,gDAwCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { IpcSocket, IpcSocketBackend, IpcSocketFrontend, RpcConfiguration, RpcInterfaceDefinition, RpcManager, RpcRegistry } from \"@itwin/core-common\";\r\nimport { ElectronRpcProtocol } from \"./ElectronRpcProtocol\";\r\n\r\n/** RPC interface configuration for an Electron-based application.\r\n * @internal\r\n */\r\nexport abstract class ElectronRpcConfiguration extends RpcConfiguration {\r\n\r\n public static targetWindowId?: number;\r\n\r\n /** The protocol of the configuration. */\r\n public abstract override protocol: ElectronRpcProtocol;\r\n}\r\n\r\n/** Coordinates usage of RPC interfaces for an Electron-based application.\r\n * @internal\r\n */\r\nexport class ElectronRpcManager extends RpcManager {\r\n /** Initializes ElectronRpcManager for the frontend of an application. */\r\n public static initializeFrontend(ipcFrontend: IpcSocketFrontend, interfaces?: RpcInterfaceDefinition[]): ElectronRpcConfiguration {\r\n return ElectronRpcManager.performInitialization(ipcFrontend, interfaces);\r\n }\r\n\r\n /** Initializes ElectronRpcManager for the backend of an application. */\r\n public static initializeBackend(ipcBackend: IpcSocketBackend, interfaces?: RpcInterfaceDefinition[]): ElectronRpcConfiguration {\r\n return ElectronRpcManager.performInitialization(ipcBackend, interfaces);\r\n }\r\n\r\n private static performInitialization(ipcSocket: IpcSocket, rpcs?: RpcInterfaceDefinition[]): ElectronRpcConfiguration {\r\n const interfaces = rpcs ?? [];\r\n const config = class extends ElectronRpcConfiguration {\r\n public interfaces = () => interfaces;\r\n public protocol: ElectronRpcProtocol = new ElectronRpcProtocol(this, ipcSocket);\r\n };\r\n\r\n for (const def of interfaces) {\r\n RpcConfiguration.assign(def, () => config);\r\n }\r\n\r\n const instance = RpcConfiguration.obtain(config);\r\n RpcConfiguration.initializeInterfaces(instance);\r\n\r\n return instance;\r\n }\r\n\r\n /** Terminates ElectronRpcManager for the frontend of an application. */\r\n public static terminateFrontend() {\r\n return ElectronRpcManager.performTermination();\r\n }\r\n\r\n private static performTermination() {\r\n const definitions = RpcRegistry.instance.definitionClasses;\r\n\r\n for (const [, interfaceDef] of definitions) {\r\n RpcManager.terminateInterface(interfaceDef);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronRpcProtocol.d.ts","sourceRoot":"","sources":["../../../src/common/ElectronRpcProtocol.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAe,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAiB,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"ElectronRpcProtocol.d.ts","sourceRoot":"","sources":["../../../src/common/ElectronRpcProtocol.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAe,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAiB,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,OAAc,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAa;IAC/D,SAAS,EAAE,SAAS,CAAC;IAE5B,+CAA+C;IAC/C,SAAgB,WAAW,4BAAsB;IAEjD,8DAA8D;IAC9C,sBAAsB,SAAoB;IAE1D,gBAAgB;IACT,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAa;IAE7D,gBAAgB;IAChB,SAAgB,SAAS,EAAE,oBAAoB,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;IAE1F,uCAAuC;gBACpB,aAAa,EAAE,wBAAwB,EAAE,SAAS,EAAE,SAAS;IAMhF,gBAAgB;IACA,sBAAsB,CAAC,UAAU,EAAE,sBAAsB,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI;IAIvG,gBAAgB;IACA,oBAAoB,CAAC,UAAU,EAAE,sBAAsB,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;IAInG,gBAAgB;IACA,qBAAqB,CAAC,UAAU,EAAE,sBAAsB,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI;IAItG,gBAAgB;IACA,mBAAmB,CAAC,UAAU,EAAE,sBAAsB,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI;IAIlG,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,cAAc;CAGvB"}
|
|
@@ -12,7 +12,6 @@ const core_bentley_1 = require("@itwin/core-bentley");
|
|
|
12
12
|
const core_common_1 = require("@itwin/core-common");
|
|
13
13
|
const ElectronIpcTransport_1 = require("./ElectronIpcTransport");
|
|
14
14
|
const ElectronRpcRequest_1 = require("./ElectronRpcRequest");
|
|
15
|
-
/* eslint-disable deprecation/deprecation */
|
|
16
15
|
/** RPC interface protocol for an Electron-based application.
|
|
17
16
|
* @internal
|
|
18
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronRpcProtocol.js","sourceRoot":"","sources":["../../../src/common/ElectronRpcProtocol.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,oDAA+G;AAC/G,iEAAkG;AAElG,6DAA0D;AAE1D
|
|
1
|
+
{"version":3,"file":"ElectronRpcProtocol.js","sourceRoot":"","sources":["../../../src/common/ElectronRpcProtocol.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,oDAA+G;AAC/G,iEAAkG;AAElG,6DAA0D;AAE1D;;GAEG;AACH,MAAa,mBAAoB,SAAQ,yBAAW;IAgBlD,uCAAuC;IACvC,YAAmB,aAAuC,EAAE,SAAoB;QAC9E,KAAK,CAAC,aAAa,CAAC,CAAC;QAdvB,+CAA+C;QAC/B,gBAAW,GAAG,uCAAkB,CAAC;QAEjD,8DAA8D;QAC9C,2BAAsB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;QAE1D,gBAAgB;QACT,aAAQ,GAAoC,IAAI,GAAG,EAAE,CAAC;QAQ3D,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,IAAA,oCAAa,EAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,gBAAgB;IACA,sBAAsB,CAAC,UAAkC,EAAE,OAAqB;QAC9F,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IAED,gBAAgB;IACA,oBAAoB,CAAC,UAAkC,EAAE,KAAmB;QAC1F,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IAED,gBAAgB;IACA,qBAAqB,CAAC,UAAkC,EAAE,OAAqB;QAC7F,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;IAED,gBAAgB;IACA,mBAAmB,CAAC,UAAkC,EAAE,KAAmB;QACzF,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;IAEO,iBAAiB,CAAC,UAAkC;QAC1D,IAAI,mBAAmB,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC;YAC7D,MAAM,IAAI,yBAAW,CAAC,4BAAa,CAAC,KAAK,EAAE,kBAAkB,UAAU,CAAC,aAAa,2CAA2C,CAAC,CAAC;QAEpI,mBAAmB,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IACpE,CAAC;IAEO,cAAc,CAAC,UAAkC;QACvD,mBAAmB,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,CAAC;;AAnDa,6BAAS,GAAqC,IAAI,GAAG,EAAE,AAA9C,CAA+C;AAD3D,kDAAmB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module RpcInterface\r\n */\r\n\r\nimport { BentleyStatus } from \"@itwin/core-bentley\";\r\nimport { IModelError, IpcSocket, RpcInterface, RpcInterfaceDefinition, RpcProtocol } from \"@itwin/core-common\";\r\nimport { ElectronIpcTransport, initializeIpc, IpcTransportMessage } from \"./ElectronIpcTransport\";\r\nimport { ElectronRpcConfiguration } from \"./ElectronRpcManager\";\r\nimport { ElectronRpcRequest } from \"./ElectronRpcRequest\";\r\n\r\n/** RPC interface protocol for an Electron-based application.\r\n * @internal\r\n */\r\nexport class ElectronRpcProtocol extends RpcProtocol {\r\n public static instances: Map<string, ElectronRpcProtocol> = new Map();\r\n public ipcSocket: IpcSocket;\r\n\r\n /** The RPC request class for this protocol. */\r\n public readonly requestType = ElectronRpcRequest;\r\n\r\n /** Specifies where to break large binary request payloads. */\r\n public override transferChunkThreshold = 48 * 1024 * 1024;\r\n\r\n /** @internal */\r\n public requests: Map<string, ElectronRpcRequest> = new Map();\r\n\r\n /** @internal */\r\n public readonly transport: ElectronIpcTransport<IpcTransportMessage, IpcTransportMessage>;\r\n\r\n /** Constructs an Electron protocol. */\r\n public constructor(configuration: ElectronRpcConfiguration, ipcSocket: IpcSocket) {\r\n super(configuration);\r\n this.ipcSocket = ipcSocket;\r\n this.transport = initializeIpc(this);\r\n }\r\n\r\n /** @internal */\r\n public override onRpcClientInitialized(definition: RpcInterfaceDefinition, _client: RpcInterface): void {\r\n this.registerInterface(definition);\r\n }\r\n\r\n /** @internal */\r\n public override onRpcImplInitialized(definition: RpcInterfaceDefinition, _impl: RpcInterface): void {\r\n this.registerInterface(definition);\r\n }\r\n\r\n /** @internal */\r\n public override onRpcClientTerminated(definition: RpcInterfaceDefinition, _client: RpcInterface): void {\r\n this.purgeInterface(definition);\r\n }\r\n\r\n /** @internal */\r\n public override onRpcImplTerminated(definition: RpcInterfaceDefinition, _impl: RpcInterface): void {\r\n this.purgeInterface(definition);\r\n }\r\n\r\n private registerInterface(definition: RpcInterfaceDefinition) {\r\n if (ElectronRpcProtocol.instances.has(definition.interfaceName))\r\n throw new IModelError(BentleyStatus.ERROR, `RPC interface \"${definition.interfaceName}\"\" is already associated with a protocol.`);\r\n\r\n ElectronRpcProtocol.instances.set(definition.interfaceName, this);\r\n }\r\n\r\n private purgeInterface(definition: RpcInterfaceDefinition) {\r\n ElectronRpcProtocol.instances.delete(definition.interfaceName);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronRpcRequest.d.ts","sourceRoot":"","sources":["../../../src/common/ElectronRpcRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,UAAU,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ElectronRpcRequest.d.ts","sourceRoot":"","sources":["../../../src/common/ElectronRpcRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,UAAU,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,gBAAgB;AAChB,qBAAa,kBAAmB,SAAQ,UAAU;IAChD,OAAO,CAAC,IAAI,CAA4C;IACxD,OAAO,CAAC,YAAY,CAAgD;IAEpE,0DAA0D;IAC1D,SAAyB,QAAQ,EAAE,mBAAmB,CAA6C;IAEnG,yBAAyB;cACT,IAAI;IAcpB,yBAAyB;cACT,IAAI;IASpB,kCAAkC;IAClC,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAIxD,gBAAgB;IACT,cAAc,CAAC,WAAW,EAAE,qBAAqB;IAKxD,gBAAgB;IACA,OAAO;CAIxB"}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.ElectronRpcRequest = void 0;
|
|
8
8
|
const core_common_1 = require("@itwin/core-common");
|
|
9
|
-
/* eslint-disable deprecation/deprecation */
|
|
10
9
|
/** @internal */
|
|
11
10
|
class ElectronRpcRequest extends core_common_1.RpcRequest {
|
|
12
11
|
constructor() {
|
|
@@ -24,7 +23,7 @@ class ElectronRpcRequest extends core_common_1.RpcRequest {
|
|
|
24
23
|
this.protocol.transport.sendRequest(request);
|
|
25
24
|
}
|
|
26
25
|
catch (e) {
|
|
27
|
-
this.protocol.events.raiseEvent(core_common_1.RpcProtocolEvent.ConnectionErrorReceived, this);
|
|
26
|
+
this.protocol.events.raiseEvent(core_common_1.RpcProtocolEvent.ConnectionErrorReceived, this); // eslint-disable-line deprecation/deprecation
|
|
28
27
|
}
|
|
29
28
|
return new Promise((resolve) => {
|
|
30
29
|
this._res = resolve;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronRpcRequest.js","sourceRoot":"","sources":["../../../src/common/ElectronRpcRequest.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,oDAAyF;AAGzF,
|
|
1
|
+
{"version":3,"file":"ElectronRpcRequest.js","sourceRoot":"","sources":["../../../src/common/ElectronRpcRequest.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,oDAAyF;AAGzF,gBAAgB;AAChB,MAAa,kBAAmB,SAAQ,wBAAU;IAAlD;;QACU,SAAI,GAA4B,GAAG,EAAE,CAAC,SAAS,CAAC;QAChD,iBAAY,GAAsC,SAAS,CAAC;QAEpE,0DAA0D;QACjC,aAAQ,GAAwB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAe,CAAC;IA2CrG,CAAC;IAzCC,yBAAyB;IACf,KAAK,CAAC,IAAI;QAClB,IAAI;YACF,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YAC1C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACpD,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SAC9C;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,8BAAgB,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC,CAAC,8CAA8C;SAChI;QAED,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;YACrC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,yBAAyB;IACf,KAAK,CAAC,IAAI;QAClB,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC;QACtC,IAAI,CAAC,WAAW,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;SACtD;QAED,OAAO,WAAW,CAAC,MAAM,CAAC;IAC5B,CAAC;IAED,kCAAkC;IACxB,SAAS,CAAC,KAAa,EAAE,MAAc;QAC/C,oBAAoB;IACtB,CAAC;IAED,gBAAgB;IACT,cAAc,CAAC,WAAkC;QACtD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,gBAAgB;IACA,OAAO;QACrB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvC,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF;AAhDD,gDAgDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { RpcProtocolEvent, RpcRequest, RpcRequestFulfillment } from \"@itwin/core-common\";\r\nimport { ElectronRpcProtocol } from \"./ElectronRpcProtocol\";\r\n\r\n/** @internal */\r\nexport class ElectronRpcRequest extends RpcRequest {\r\n private _res: (value: number) => void = () => undefined;\r\n private _fulfillment: RpcRequestFulfillment | undefined = undefined;\r\n\r\n /** Convenience access to the protocol of this request. */\r\n public override readonly protocol: ElectronRpcProtocol = this.client.configuration.protocol as any;\r\n\r\n /** Sends the request. */\r\n protected async send() {\r\n try {\r\n this.protocol.requests.set(this.id, this);\r\n const request = await this.protocol.serialize(this);\r\n this.protocol.transport.sendRequest(request);\r\n } catch (e) {\r\n this.protocol.events.raiseEvent(RpcProtocolEvent.ConnectionErrorReceived, this); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n return new Promise<number>((resolve) => {\r\n this._res = resolve;\r\n });\r\n }\r\n\r\n /** Loads the request. */\r\n protected async load() {\r\n const fulfillment = this._fulfillment;\r\n if (!fulfillment) {\r\n throw new Error(\"No request fulfillment available.\");\r\n }\r\n\r\n return fulfillment.result;\r\n }\r\n\r\n /** Sets request header values. */\r\n protected setHeader(_name: string, _value: string): void {\r\n // No implementation\r\n }\r\n\r\n /** @internal */\r\n public notifyResponse(fulfillment: RpcRequestFulfillment) {\r\n this._fulfillment = fulfillment;\r\n this._res(fulfillment.status);\r\n }\r\n\r\n /** @internal */\r\n public override dispose() {\r\n this.protocol.requests.delete(this.id);\r\n super.dispose();\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-electron",
|
|
3
|
-
"version": "4.3.0-dev.
|
|
3
|
+
"version": "4.3.0-dev.21",
|
|
4
4
|
"description": "iTwin.js ElectronHost and ElectronApp",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"url": "http://www.bentley.com"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@itwin/core-backend": "^4.3.0-dev.
|
|
25
|
-
"@itwin/core-bentley": "^4.3.0-dev.
|
|
26
|
-
"@itwin/core-common": "^4.3.0-dev.
|
|
27
|
-
"@itwin/core-frontend": "^4.3.0-dev.
|
|
28
|
-
"electron": ">=23.0.0 <
|
|
24
|
+
"@itwin/core-backend": "^4.3.0-dev.21",
|
|
25
|
+
"@itwin/core-bentley": "^4.3.0-dev.21",
|
|
26
|
+
"@itwin/core-common": "^4.3.0-dev.21",
|
|
27
|
+
"@itwin/core-frontend": "^4.3.0-dev.21",
|
|
28
|
+
"electron": ">=23.0.0 <28.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@itwin/eslint-plugin": "4.0.0-dev.44",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@types/mocha": "^8.2.2",
|
|
34
34
|
"@types/node": "18.16.1",
|
|
35
35
|
"chai": "^4.3.10",
|
|
36
|
-
"electron": "^
|
|
36
|
+
"electron": "^27.0.0",
|
|
37
37
|
"eslint": "^8.44.0",
|
|
38
38
|
"glob": "^7.1.2",
|
|
39
39
|
"mocha": "^10.0.0",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"typescript": "~5.0.2",
|
|
43
43
|
"webpack": "^5.76.0",
|
|
44
44
|
"webpack-cli": "^5.0.1",
|
|
45
|
-
"@itwin/
|
|
46
|
-
"@itwin/
|
|
47
|
-
"@itwin/
|
|
48
|
-
"@itwin/core-
|
|
49
|
-
"@itwin/core-
|
|
50
|
-
"@itwin/core-bentley": "4.3.0-dev.
|
|
45
|
+
"@itwin/certa": "4.3.0-dev.21",
|
|
46
|
+
"@itwin/core-backend": "4.3.0-dev.21",
|
|
47
|
+
"@itwin/build-tools": "4.3.0-dev.21",
|
|
48
|
+
"@itwin/core-frontend": "4.3.0-dev.21",
|
|
49
|
+
"@itwin/core-common": "4.3.0-dev.21",
|
|
50
|
+
"@itwin/core-bentley": "4.3.0-dev.21"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@openid/appauth": "^1.2.6",
|