@cityofzion/bs-electron 0.1.51 → 0.1.53
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/dist/main.js +2 -3
- package/dist/preload.js +1 -1
- package/dist/renderer.js +1 -2
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +6 -6
- package/package.json +11 -14
package/dist/main.js
CHANGED
|
@@ -12,7 +12,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.eraseApi = eraseApi;
|
|
16
|
+
exports.exposeApiToRenderer = exposeApiToRenderer;
|
|
16
17
|
const utils_1 = require("./utils");
|
|
17
18
|
const utils_2 = require("./utils");
|
|
18
19
|
const electron_1 = require("electron");
|
|
@@ -49,7 +50,6 @@ function eraseApi(api, prefix) {
|
|
|
49
50
|
});
|
|
50
51
|
return response;
|
|
51
52
|
}
|
|
52
|
-
exports.eraseApi = eraseApi;
|
|
53
53
|
function exposeApiToRenderer(api) {
|
|
54
54
|
init();
|
|
55
55
|
// Class name
|
|
@@ -101,7 +101,6 @@ function exposeApiToRenderer(api) {
|
|
|
101
101
|
});
|
|
102
102
|
exposedApis.set(apiName, { properties, asyncMethods, syncMethods });
|
|
103
103
|
}
|
|
104
|
-
exports.exposeApiToRenderer = exposeApiToRenderer;
|
|
105
104
|
// This function is called only once to initialize the ipcMain listener so renderer can request the exposed api
|
|
106
105
|
function init() {
|
|
107
106
|
if (initialized)
|
package/dist/preload.js
CHANGED
package/dist/renderer.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.bindApiFromMain =
|
|
12
|
+
exports.bindApiFromMain = bindApiFromMain;
|
|
13
13
|
const utils_1 = require("./utils");
|
|
14
14
|
const boundApis = new Map();
|
|
15
15
|
function bindApiFromMain(apiName) {
|
|
@@ -64,4 +64,3 @@ function bindApiFromMain(apiName) {
|
|
|
64
64
|
boundApis.set(apiName, api);
|
|
65
65
|
return api;
|
|
66
66
|
}
|
|
67
|
-
exports.bindApiFromMain = bindApiFromMain;
|
package/dist/utils.d.ts
CHANGED
package/dist/utils.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.GET_EXPOSED_API_CHANNEL = exports.CHANNEL_PREFIX = void 0;
|
|
4
|
+
exports.getPropertiesAndMethods = getPropertiesAndMethods;
|
|
5
|
+
exports.getValueFromPath = getValueFromPath;
|
|
6
|
+
exports.populateObjectFromPath = populateObjectFromPath;
|
|
7
|
+
exports.buildIpcChannelName = buildIpcChannelName;
|
|
8
|
+
exports.toPlainObject = toPlainObject;
|
|
4
9
|
exports.CHANNEL_PREFIX = 'bsElectron';
|
|
5
10
|
exports.GET_EXPOSED_API_CHANNEL = `${exports.CHANNEL_PREFIX}:getExposedApi`;
|
|
6
11
|
// It returns all properties and methods from an object and its prototype chain, that is, extended classes are also considered
|
|
@@ -39,7 +44,6 @@ function getPropertiesAndMethods(object) {
|
|
|
39
44
|
asyncMethods: Array.from(asyncMethods),
|
|
40
45
|
};
|
|
41
46
|
}
|
|
42
|
-
exports.getPropertiesAndMethods = getPropertiesAndMethods;
|
|
43
47
|
function getValueFromPath(obj, path) {
|
|
44
48
|
return path.split('.').reduce((acc, key) => {
|
|
45
49
|
// If the key is a function, we need to bind it to the object to keep the context
|
|
@@ -49,7 +53,6 @@ function getValueFromPath(obj, path) {
|
|
|
49
53
|
return acc[key];
|
|
50
54
|
}, obj);
|
|
51
55
|
}
|
|
52
|
-
exports.getValueFromPath = getValueFromPath;
|
|
53
56
|
function populateObjectFromPath(obj, path, value) {
|
|
54
57
|
var _a;
|
|
55
58
|
const splittedPath = path.split('.');
|
|
@@ -66,11 +69,9 @@ function populateObjectFromPath(obj, path, value) {
|
|
|
66
69
|
}
|
|
67
70
|
return obj;
|
|
68
71
|
}
|
|
69
|
-
exports.populateObjectFromPath = populateObjectFromPath;
|
|
70
72
|
function buildIpcChannelName(apiName, methodOrProperty) {
|
|
71
73
|
return `${exports.CHANNEL_PREFIX}:${apiName}:${String(methodOrProperty)}`;
|
|
72
74
|
}
|
|
73
|
-
exports.buildIpcChannelName = buildIpcChannelName;
|
|
74
75
|
function toPlainObject(obj) {
|
|
75
76
|
if (obj === null || typeof obj !== 'object') {
|
|
76
77
|
return obj;
|
|
@@ -117,4 +118,3 @@ function toPlainObject(obj) {
|
|
|
117
118
|
}
|
|
118
119
|
return plain;
|
|
119
120
|
}
|
|
120
|
-
exports.toPlainObject = toPlainObject;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-electron",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.53",
|
|
4
4
|
"repository": "https://github.com/CityOfZion/blockchain-services",
|
|
5
5
|
"author": "Coz",
|
|
6
6
|
"license": "GPL-3.0-only",
|
|
@@ -9,24 +9,21 @@
|
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"lodash.clonedeep": "~4.5.0",
|
|
12
|
-
"@cityofzion/blockchain-service": "1.21.
|
|
12
|
+
"@cityofzion/blockchain-service": "1.21.3"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@types/
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
18
|
-
"eslint": "^8.48.0",
|
|
19
|
-
"ts-node": "10.9.1",
|
|
20
|
-
"typescript": "4.9.5",
|
|
21
|
-
"@types/lodash.clonedeep": "~4.5.9"
|
|
22
|
-
},
|
|
23
|
-
"peerDependencies": {
|
|
15
|
+
"@types/lodash.clonedeep": "~4.5.9",
|
|
16
|
+
"@types/node": "~24.5.2",
|
|
17
|
+
"@electron-toolkit/preload": "*",
|
|
24
18
|
"electron": "*",
|
|
25
|
-
"
|
|
19
|
+
"eslint": "~9.36.0",
|
|
20
|
+
"ts-node": "~10.9.2",
|
|
21
|
+
"typescript": "~5.9.2"
|
|
26
22
|
},
|
|
27
23
|
"scripts": {
|
|
28
|
-
"build": "tsc",
|
|
24
|
+
"build": "rm -rf ./dist && tsc",
|
|
29
25
|
"lint": "eslint .",
|
|
30
|
-
"format": "eslint --fix"
|
|
26
|
+
"format": "eslint --fix",
|
|
27
|
+
"package": "npm run build && npm pack"
|
|
31
28
|
}
|
|
32
29
|
}
|