@cutos/core 0.0.17 → 0.0.19
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/README.md +246 -0
- package/dist/cutos.cjs.js +51 -17
- package/dist/cutos.esm.js +51 -17
- package/package.json +4 -7
package/README.md
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# Introduction
|
|
2
|
+
|
|
3
|
+
The CUTOS (CUT Operating System) Core API is a JavaScript library that provides essential functionalities for LWA (Local Web Application) edge computing and communication in the CUTOS ecosystem. The module is designed to facilitate communication between edge devices, edge gateways, and the cloud. Key features include platform information accessing, edge database operations, IPC (Inter-Process Communication), logging, heartbeat monitoring, and device management, etc. The API is designed to be modular and extensible.
|
|
4
|
+
|
|
5
|
+
## Core API Modules Components
|
|
6
|
+
|
|
7
|
+
### Platform
|
|
8
|
+
- The CoreAPI class is the main entry point for interacting with the CUTOS Core API.
|
|
9
|
+
- It provides methods for connecting to the platform, accessing information, and obtaining instances of other classes such as Database, IPC, Logger, etc.
|
|
10
|
+
|
|
11
|
+
### IPC Implementation
|
|
12
|
+
- IPC (Inter-Process Communication) is implemented for communication between processes on the same machine or between processes on different machines within the same network segment.
|
|
13
|
+
- The IPC class allows sending messages to a specific channel and registering listeners for incoming messages.
|
|
14
|
+
|
|
15
|
+
### Database Operations
|
|
16
|
+
- The Database class facilitates database operations, including table creation, insertion, updating, querying, and synchronization.
|
|
17
|
+
- Provides a structured interface for managing edge databases.
|
|
18
|
+
|
|
19
|
+
### Device and Driver Management
|
|
20
|
+
- The Device and Driver classes represent edge devices and drivers, respectively. The Device can also refer to external devices or modules, such as NFC, fingerprint modules, ID card readers, printers, sensors, GPIO and so on.
|
|
21
|
+
- Devices and drivers communicate for data transmission, command reception, and status updates.
|
|
22
|
+
- Heartbeat monitoring is implemented for drivers to ensure continuous communication.
|
|
23
|
+
|
|
24
|
+
### Notification
|
|
25
|
+
- The Notification class provides functionality for registering, unregistering, and emitting events.
|
|
26
|
+
|
|
27
|
+
### Logging
|
|
28
|
+
- The Logger class enables logging of information, warnings, errors, and debug messages.
|
|
29
|
+
- Logs are sent and saved to the CUTOS Cloud. In the CUSOS Cloud administration web page, the logs can be queried for a specified device.
|
|
30
|
+
|
|
31
|
+
# Conclusion
|
|
32
|
+
|
|
33
|
+
The CUTOS Core API provides a comprehensive set of classes for interacting with the CUTOS platform. Developers can use these classes to build applications, manage databases, communicate with devices, and handle various aspects of the CUTOS ecosystem. The modular design allows for flexibility and extensibility, making it suitable for a wide range of use cases within the IoT and smart device domain.
|
|
34
|
+
|
|
35
|
+
# Table of Contents
|
|
36
|
+
|
|
37
|
+
1.Quick Start
|
|
38
|
+
|
|
39
|
+
- Installation
|
|
40
|
+
- Initialization
|
|
41
|
+
|
|
42
|
+
2.PlatformAPI
|
|
43
|
+
|
|
44
|
+
- Version
|
|
45
|
+
- Platform Information
|
|
46
|
+
- Configuration
|
|
47
|
+
- Box Information
|
|
48
|
+
- Shell Command Execution
|
|
49
|
+
- Volume Control
|
|
50
|
+
|
|
51
|
+
3.IPC (Inter-Process Communication)
|
|
52
|
+
|
|
53
|
+
4.Database
|
|
54
|
+
|
|
55
|
+
5.Device & Driver
|
|
56
|
+
|
|
57
|
+
6.Notification
|
|
58
|
+
|
|
59
|
+
7.Logger
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# Quick Start
|
|
63
|
+
|
|
64
|
+
##### Install
|
|
65
|
+
|
|
66
|
+
`
|
|
67
|
+
npm install @cutos/core
|
|
68
|
+
`
|
|
69
|
+
|
|
70
|
+
##### Initialize
|
|
71
|
+
|
|
72
|
+
```js
|
|
73
|
+
// Initialize the CUTOS Core module
|
|
74
|
+
import { CoreAPI } from '@cutos/core';
|
|
75
|
+
CoreAPI.init();
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
# Platform API
|
|
79
|
+
|
|
80
|
+
### CoreAPI.getVersion
|
|
81
|
+
##### Get platform version information
|
|
82
|
+
```js
|
|
83
|
+
CoreAPI.getVersion();
|
|
84
|
+
```
|
|
85
|
+
- Return result example:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
0.0.17
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### CoreAPI.getPlatform
|
|
92
|
+
##### Get platform information
|
|
93
|
+
|
|
94
|
+
```js
|
|
95
|
+
CoreAPI.getPlatform(callback);
|
|
96
|
+
```
|
|
97
|
+
- callback: callback function
|
|
98
|
+
|
|
99
|
+
##### Example:
|
|
100
|
+
|
|
101
|
+
```js
|
|
102
|
+
CoreAPI.getPlatform(result => {
|
|
103
|
+
console.log(result)
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- Return result example:
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"arch": "x64",
|
|
112
|
+
"type": "Windows_NT"
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### CoreAPI.getConfig
|
|
117
|
+
##### Get configuration information
|
|
118
|
+
```js
|
|
119
|
+
CoreAPI.getConfig(callback);
|
|
120
|
+
```
|
|
121
|
+
- callback: callback function
|
|
122
|
+
|
|
123
|
+
##### Example:
|
|
124
|
+
|
|
125
|
+
```js
|
|
126
|
+
CoreAPI.getConfig(result => {
|
|
127
|
+
console.log(result)
|
|
128
|
+
});
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
- Return result example:
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"srvAddress": "www.cut-os.com",
|
|
136
|
+
"srvRestProtocol": "https",
|
|
137
|
+
"enableTimeSync": true,
|
|
138
|
+
"playReport": false,
|
|
139
|
+
"language": "Chinese",
|
|
140
|
+
"debug": false
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
### CoreAPI.getSignInfo
|
|
144
|
+
##### Get device information
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
CoreAPI.getSignInfo(callback);
|
|
148
|
+
```
|
|
149
|
+
- callback: callback function
|
|
150
|
+
|
|
151
|
+
##### Example:
|
|
152
|
+
|
|
153
|
+
```js
|
|
154
|
+
CoreAPI.getSignInfo(result => {
|
|
155
|
+
console.log(result)
|
|
156
|
+
})
|
|
157
|
+
```
|
|
158
|
+
### CoreAPI.getBoxInfo
|
|
159
|
+
##### Get host information
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
CoreAPI.getBoxInfo(callback);
|
|
163
|
+
```
|
|
164
|
+
- callback: callback function
|
|
165
|
+
|
|
166
|
+
##### Example:
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
CoreAPI.getBoxInfo(result => {
|
|
170
|
+
console.log(result)
|
|
171
|
+
})
|
|
172
|
+
```
|
|
173
|
+
- Return result example:
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"id": 1004,
|
|
178
|
+
"macAddress": "54-48-10-D9-BB-27_D8-9C-67-6D-DA-B3_D8-9C-67-6D-DA-B4",
|
|
179
|
+
"ipAddress": "192.168.1.136",
|
|
180
|
+
"masterIpAddress": "",
|
|
181
|
+
"status": 1
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
-Return results:
|
|
185
|
+
- `macAddress`: Host MAC address
|
|
186
|
+
- `ipAddress`: host IP address
|
|
187
|
+
- `masterIpAddress`: Master IP address, used when multiple hosts form a host group
|
|
188
|
+
- `status`: 1 means online, 0 means offline
|
|
189
|
+
|
|
190
|
+
### CoreAPI.getVolume
|
|
191
|
+
##### Get the volume
|
|
192
|
+
|
|
193
|
+
```js
|
|
194
|
+
CoreAPI.getVolume(callback);
|
|
195
|
+
```
|
|
196
|
+
- callback: callback function
|
|
197
|
+
|
|
198
|
+
##### Example:
|
|
199
|
+
|
|
200
|
+
```js
|
|
201
|
+
CoreAPI.getVolume(result => {
|
|
202
|
+
console.log(result)
|
|
203
|
+
})
|
|
204
|
+
```
|
|
205
|
+
- Return result example:
|
|
206
|
+
|
|
207
|
+
```js
|
|
208
|
+
10
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### CoreAPI.setVolume
|
|
212
|
+
##### Set the volume
|
|
213
|
+
|
|
214
|
+
```js
|
|
215
|
+
CoreAPI.setVolume(value,callback)
|
|
216
|
+
```
|
|
217
|
+
- value: volume (0-100)
|
|
218
|
+
- callback: callback function
|
|
219
|
+
|
|
220
|
+
##### Example:
|
|
221
|
+
|
|
222
|
+
```js
|
|
223
|
+
CoreAPI.setVolume(70,result => {
|
|
224
|
+
console.log(result)
|
|
225
|
+
})
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
- Return result example:
|
|
229
|
+
|
|
230
|
+
```js
|
|
231
|
+
success
|
|
232
|
+
```
|
|
233
|
+
### CoreAPI.shell
|
|
234
|
+
##### Shell command execution
|
|
235
|
+
|
|
236
|
+
```js
|
|
237
|
+
CoreAPI.shell(command, callback)
|
|
238
|
+
```
|
|
239
|
+
- command: command
|
|
240
|
+
- callback: callback function
|
|
241
|
+
|
|
242
|
+
##### Example:
|
|
243
|
+
|
|
244
|
+
```js
|
|
245
|
+
CoreAPI.shell('sudo reboot', null) //Restart the system
|
|
246
|
+
```
|
package/dist/cutos.cjs.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var crypto = require('crypto');
|
|
6
6
|
var require$$1 = require('mqtt');
|
|
7
|
-
require('lodash');
|
|
8
7
|
|
|
9
8
|
function getAugmentedNamespace(n) {
|
|
10
9
|
if (n.__esModule) return n;
|
|
@@ -396,7 +395,7 @@ const cutosAPI$1 = {
|
|
|
396
395
|
var cutosApi = cutosAPI$1;
|
|
397
396
|
|
|
398
397
|
var name = "@cutos/core";
|
|
399
|
-
var version = "0.0.
|
|
398
|
+
var version = "0.0.19";
|
|
400
399
|
var description = "";
|
|
401
400
|
var main = "dist/cutos.cjs.js";
|
|
402
401
|
var module$1 = "dist/cutos.esm.js";
|
|
@@ -404,14 +403,12 @@ var scripts = {
|
|
|
404
403
|
"build:rollup": "rollup -c rollup.config.cjs"
|
|
405
404
|
};
|
|
406
405
|
var keywords = [
|
|
407
|
-
"cutos"
|
|
406
|
+
"cutos",
|
|
407
|
+
"core"
|
|
408
408
|
];
|
|
409
|
-
var author = "";
|
|
410
|
-
var license = "ISC";
|
|
409
|
+
var author = "SipTimes";
|
|
411
410
|
var dependencies = {
|
|
412
|
-
|
|
413
|
-
mqtt: "4.0.1",
|
|
414
|
-
qs: "6.11.2"
|
|
411
|
+
mqtt: "^5.3.6"
|
|
415
412
|
};
|
|
416
413
|
var devDependencies = {
|
|
417
414
|
"@rollup/plugin-commonjs": "25.0.7",
|
|
@@ -425,7 +422,7 @@ var files = [
|
|
|
425
422
|
"dist/cutos.esm.js",
|
|
426
423
|
"package.json"
|
|
427
424
|
];
|
|
428
|
-
var require$$
|
|
425
|
+
var require$$3 = {
|
|
429
426
|
name: name,
|
|
430
427
|
version: version,
|
|
431
428
|
description: description,
|
|
@@ -434,7 +431,6 @@ var require$$4 = {
|
|
|
434
431
|
scripts: scripts,
|
|
435
432
|
keywords: keywords,
|
|
436
433
|
author: author,
|
|
437
|
-
license: license,
|
|
438
434
|
dependencies: dependencies,
|
|
439
435
|
devDependencies: devDependencies,
|
|
440
436
|
files: files
|
|
@@ -446,14 +442,17 @@ var require$$4 = {
|
|
|
446
442
|
|
|
447
443
|
const {v4: uuidv4} = require$$0;
|
|
448
444
|
const mqtt = require$$1;
|
|
445
|
+
|
|
449
446
|
const cutosAPI = cutosApi;
|
|
450
447
|
const callbackMap = new Map();
|
|
448
|
+
const callbackInterval = 5000; // 5s超时
|
|
451
449
|
const listenerMap = new Map();
|
|
452
|
-
const packageJson = require$$
|
|
450
|
+
const packageJson = require$$3;
|
|
453
451
|
|
|
454
452
|
const ipformat = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
|
455
453
|
|
|
456
454
|
let client = null;
|
|
455
|
+
let callbackTimer = null;
|
|
457
456
|
|
|
458
457
|
function publishRequest(topic, callback, body, destAddress) {
|
|
459
458
|
let request = {};
|
|
@@ -462,7 +461,10 @@ function publishRequest(topic, callback, body, destAddress) {
|
|
|
462
461
|
request.context.destAddress = destAddress;
|
|
463
462
|
request.body = body;
|
|
464
463
|
if (typeof callback === "function") {
|
|
465
|
-
|
|
464
|
+
let callbackItem = {};
|
|
465
|
+
callbackItem.callback = callback;
|
|
466
|
+
callbackItem.timeStamp = Date.now();
|
|
467
|
+
saveCallback(request.context.id, callbackItem);
|
|
466
468
|
}
|
|
467
469
|
client.publish(topic, JSON.stringify(request));
|
|
468
470
|
return true;
|
|
@@ -479,6 +481,42 @@ function publishResponse(topic, request, result) {
|
|
|
479
481
|
return true;
|
|
480
482
|
}
|
|
481
483
|
|
|
484
|
+
function saveCallback(id, item) {
|
|
485
|
+
callbackMap.set(id, item);
|
|
486
|
+
|
|
487
|
+
if (callbackTimer) {
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// 处理超时callback
|
|
492
|
+
callbackTimer = setInterval(() => {
|
|
493
|
+
let currentTimestamp = new Date().getTime();
|
|
494
|
+
callbackMap.forEach((callbackItem, id) => {
|
|
495
|
+
if (currentTimestamp - callbackItem.timestamp > callbackInterval) {
|
|
496
|
+
callbackItem.callback({
|
|
497
|
+
context: {id: id},
|
|
498
|
+
response: {
|
|
499
|
+
result: "failure",
|
|
500
|
+
reason: "callback is timeout!"
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
callbackMap.delete(id);
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
}, callbackInterval);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
function doCallback(id, body) {
|
|
510
|
+
if (!callbackMap.has(id)) {
|
|
511
|
+
return false;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
callbackMap.get(id).callback(body);
|
|
515
|
+
callbackMap.delete(id);
|
|
516
|
+
return true;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
|
|
482
520
|
/*
|
|
483
521
|
retentionTime: retention time, default 48 hours
|
|
484
522
|
*/
|
|
@@ -933,11 +971,7 @@ const CoreAPI = {
|
|
|
933
971
|
listener(_message);
|
|
934
972
|
}
|
|
935
973
|
} else { // cutos core api callback
|
|
936
|
-
|
|
937
|
-
if (typeof callback === "function") {
|
|
938
|
-
callbackMap.delete(_message.id);
|
|
939
|
-
callback(_message.result);
|
|
940
|
-
}
|
|
974
|
+
doCallback(_message.id, _message.result);
|
|
941
975
|
}
|
|
942
976
|
});
|
|
943
977
|
|
package/dist/cutos.esm.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import require$$1 from 'mqtt/dist/mqtt';
|
|
2
|
-
import 'lodash';
|
|
3
2
|
|
|
4
3
|
function getAugmentedNamespace(n) {
|
|
5
4
|
if (n.__esModule) return n;
|
|
@@ -688,7 +687,7 @@ const cutosAPI$1 = {
|
|
|
688
687
|
var cutosApi = cutosAPI$1;
|
|
689
688
|
|
|
690
689
|
var name = "@cutos/core";
|
|
691
|
-
var version = "0.0.
|
|
690
|
+
var version = "0.0.19";
|
|
692
691
|
var description = "";
|
|
693
692
|
var main = "dist/cutos.cjs.js";
|
|
694
693
|
var module = "dist/cutos.esm.js";
|
|
@@ -696,14 +695,12 @@ var scripts = {
|
|
|
696
695
|
"build:rollup": "rollup -c rollup.config.cjs"
|
|
697
696
|
};
|
|
698
697
|
var keywords = [
|
|
699
|
-
"cutos"
|
|
698
|
+
"cutos",
|
|
699
|
+
"core"
|
|
700
700
|
];
|
|
701
|
-
var author = "";
|
|
702
|
-
var license = "ISC";
|
|
701
|
+
var author = "SipTimes";
|
|
703
702
|
var dependencies = {
|
|
704
|
-
|
|
705
|
-
mqtt: "4.0.1",
|
|
706
|
-
qs: "6.11.2"
|
|
703
|
+
mqtt: "^5.3.6"
|
|
707
704
|
};
|
|
708
705
|
var devDependencies = {
|
|
709
706
|
"@rollup/plugin-commonjs": "25.0.7",
|
|
@@ -717,7 +714,7 @@ var files = [
|
|
|
717
714
|
"dist/cutos.esm.js",
|
|
718
715
|
"package.json"
|
|
719
716
|
];
|
|
720
|
-
var require$$
|
|
717
|
+
var require$$3 = {
|
|
721
718
|
name: name,
|
|
722
719
|
version: version,
|
|
723
720
|
description: description,
|
|
@@ -726,7 +723,6 @@ var require$$4 = {
|
|
|
726
723
|
scripts: scripts,
|
|
727
724
|
keywords: keywords,
|
|
728
725
|
author: author,
|
|
729
|
-
license: license,
|
|
730
726
|
dependencies: dependencies,
|
|
731
727
|
devDependencies: devDependencies,
|
|
732
728
|
files: files
|
|
@@ -738,14 +734,17 @@ var require$$4 = {
|
|
|
738
734
|
|
|
739
735
|
const {v4: uuidv4} = require$$0;
|
|
740
736
|
const mqtt = require$$1;
|
|
737
|
+
|
|
741
738
|
const cutosAPI = cutosApi;
|
|
742
739
|
const callbackMap = new Map();
|
|
740
|
+
const callbackInterval = 5000; // 5s超时
|
|
743
741
|
const listenerMap = new Map();
|
|
744
|
-
const packageJson = require$$
|
|
742
|
+
const packageJson = require$$3;
|
|
745
743
|
|
|
746
744
|
const ipformat = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
|
747
745
|
|
|
748
746
|
let client = null;
|
|
747
|
+
let callbackTimer = null;
|
|
749
748
|
|
|
750
749
|
function publishRequest(topic, callback, body, destAddress) {
|
|
751
750
|
let request = {};
|
|
@@ -754,7 +753,10 @@ function publishRequest(topic, callback, body, destAddress) {
|
|
|
754
753
|
request.context.destAddress = destAddress;
|
|
755
754
|
request.body = body;
|
|
756
755
|
if (typeof callback === "function") {
|
|
757
|
-
|
|
756
|
+
let callbackItem = {};
|
|
757
|
+
callbackItem.callback = callback;
|
|
758
|
+
callbackItem.timeStamp = Date.now();
|
|
759
|
+
saveCallback(request.context.id, callbackItem);
|
|
758
760
|
}
|
|
759
761
|
client.publish(topic, JSON.stringify(request));
|
|
760
762
|
return true;
|
|
@@ -771,6 +773,42 @@ function publishResponse(topic, request, result) {
|
|
|
771
773
|
return true;
|
|
772
774
|
}
|
|
773
775
|
|
|
776
|
+
function saveCallback(id, item) {
|
|
777
|
+
callbackMap.set(id, item);
|
|
778
|
+
|
|
779
|
+
if (callbackTimer) {
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
// 处理超时callback
|
|
784
|
+
callbackTimer = setInterval(() => {
|
|
785
|
+
let currentTimestamp = new Date().getTime();
|
|
786
|
+
callbackMap.forEach((callbackItem, id) => {
|
|
787
|
+
if (currentTimestamp - callbackItem.timestamp > callbackInterval) {
|
|
788
|
+
callbackItem.callback({
|
|
789
|
+
context: {id: id},
|
|
790
|
+
response: {
|
|
791
|
+
result: "failure",
|
|
792
|
+
reason: "callback is timeout!"
|
|
793
|
+
}
|
|
794
|
+
});
|
|
795
|
+
callbackMap.delete(id);
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
}, callbackInterval);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
function doCallback(id, body) {
|
|
802
|
+
if (!callbackMap.has(id)) {
|
|
803
|
+
return false;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
callbackMap.get(id).callback(body);
|
|
807
|
+
callbackMap.delete(id);
|
|
808
|
+
return true;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
|
|
774
812
|
/*
|
|
775
813
|
retentionTime: retention time, default 48 hours
|
|
776
814
|
*/
|
|
@@ -1225,11 +1263,7 @@ const CoreAPI = {
|
|
|
1225
1263
|
listener(_message);
|
|
1226
1264
|
}
|
|
1227
1265
|
} else { // cutos core api callback
|
|
1228
|
-
|
|
1229
|
-
if (typeof callback === "function") {
|
|
1230
|
-
callbackMap.delete(_message.id);
|
|
1231
|
-
callback(_message.result);
|
|
1232
|
-
}
|
|
1266
|
+
doCallback(_message.id, _message.result);
|
|
1233
1267
|
}
|
|
1234
1268
|
});
|
|
1235
1269
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cutos/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cutos.cjs.js",
|
|
6
6
|
"module": "dist/cutos.esm.js",
|
|
@@ -8,14 +8,11 @@
|
|
|
8
8
|
"build:rollup": "rollup -c rollup.config.cjs"
|
|
9
9
|
},
|
|
10
10
|
"keywords": [
|
|
11
|
-
"cutos"
|
|
11
|
+
"cutos", "core"
|
|
12
12
|
],
|
|
13
|
-
"author": "",
|
|
14
|
-
"license": "ISC",
|
|
13
|
+
"author": "SipTimes",
|
|
15
14
|
"dependencies": {
|
|
16
|
-
"
|
|
17
|
-
"mqtt": "4.0.1",
|
|
18
|
-
"qs": "6.11.2"
|
|
15
|
+
"mqtt": "^5.3.6"
|
|
19
16
|
},
|
|
20
17
|
"devDependencies": {
|
|
21
18
|
"@rollup/plugin-commonjs": "25.0.7",
|