@cutos/core 0.0.24 → 3.0.1
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 +1 -1
- package/dist/cutos.cjs.js +11 -4
- package/dist/cutos.esm.js +11 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cutos.cjs.js
CHANGED
|
@@ -364,7 +364,8 @@ const CORE = Object.freeze({ // core level api
|
|
|
364
364
|
SHELL: 'core-shell',
|
|
365
365
|
DATABASE: 'core-database',
|
|
366
366
|
GET_VOLUME: 'core-get-volume',
|
|
367
|
-
SET_VOLUME: 'core-set-volume'
|
|
367
|
+
SET_VOLUME: 'core-set-volume',
|
|
368
|
+
SET_HTTP_PROXY: 'core-set-http-proxy'
|
|
368
369
|
});
|
|
369
370
|
const CORE_NORESP = Object.freeze({ // core level api with no response
|
|
370
371
|
IPC: 'core-ipc',
|
|
@@ -392,12 +393,12 @@ const HEARTBEAT_STATUS = Object.freeze({
|
|
|
392
393
|
});
|
|
393
394
|
|
|
394
395
|
const cutosAPI$2 = {
|
|
395
|
-
version: '
|
|
396
|
+
version: '3.0.0', CORE, CORE_NORESP, CORE_APP, DEVICE, HEARTBEAT_STATUS
|
|
396
397
|
};
|
|
397
398
|
var cutosApi = cutosAPI$2;
|
|
398
399
|
|
|
399
400
|
var name = "@cutos/core";
|
|
400
|
-
var version = "
|
|
401
|
+
var version = "3.0.1";
|
|
401
402
|
var description = "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. ";
|
|
402
403
|
var main = "dist/cutos.cjs.js";
|
|
403
404
|
var module$1 = "dist/cutos.esm.js";
|
|
@@ -858,7 +859,9 @@ class Device {
|
|
|
858
859
|
}
|
|
859
860
|
|
|
860
861
|
onData(listener) {
|
|
861
|
-
|
|
862
|
+
if(!listenerMap.has(this.topicData)) {
|
|
863
|
+
client.subscribe(this.topicData); // receive data from device
|
|
864
|
+
}
|
|
862
865
|
let _this = this;
|
|
863
866
|
listenerMap.set(this.topicData, function (data) {
|
|
864
867
|
_this.data = data;
|
|
@@ -1049,6 +1052,10 @@ const CoreAPI$2 = {
|
|
|
1049
1052
|
|
|
1050
1053
|
setVolume(vol, callback) {
|
|
1051
1054
|
return publishRequest(cutosAPI$1.CORE.SET_VOLUME, callback, vol);
|
|
1055
|
+
},
|
|
1056
|
+
|
|
1057
|
+
setHttpProxy(api, target, callback) {
|
|
1058
|
+
return publishRequest(cutosAPI$1.CORE.SET_HTTP_PROXY, callback, {api, target});
|
|
1052
1059
|
}
|
|
1053
1060
|
};
|
|
1054
1061
|
|
package/dist/cutos.esm.js
CHANGED
|
@@ -656,7 +656,8 @@ const CORE = Object.freeze({ // core level api
|
|
|
656
656
|
SHELL: 'core-shell',
|
|
657
657
|
DATABASE: 'core-database',
|
|
658
658
|
GET_VOLUME: 'core-get-volume',
|
|
659
|
-
SET_VOLUME: 'core-set-volume'
|
|
659
|
+
SET_VOLUME: 'core-set-volume',
|
|
660
|
+
SET_HTTP_PROXY: 'core-set-http-proxy'
|
|
660
661
|
});
|
|
661
662
|
const CORE_NORESP = Object.freeze({ // core level api with no response
|
|
662
663
|
IPC: 'core-ipc',
|
|
@@ -684,12 +685,12 @@ const HEARTBEAT_STATUS = Object.freeze({
|
|
|
684
685
|
});
|
|
685
686
|
|
|
686
687
|
const cutosAPI$2 = {
|
|
687
|
-
version: '
|
|
688
|
+
version: '3.0.0', CORE, CORE_NORESP, CORE_APP, DEVICE, HEARTBEAT_STATUS
|
|
688
689
|
};
|
|
689
690
|
var cutosApi = cutosAPI$2;
|
|
690
691
|
|
|
691
692
|
var name = "@cutos/core";
|
|
692
|
-
var version = "
|
|
693
|
+
var version = "3.0.1";
|
|
693
694
|
var description = "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. ";
|
|
694
695
|
var main = "dist/cutos.cjs.js";
|
|
695
696
|
var module = "dist/cutos.esm.js";
|
|
@@ -1150,7 +1151,9 @@ class Device {
|
|
|
1150
1151
|
}
|
|
1151
1152
|
|
|
1152
1153
|
onData(listener) {
|
|
1153
|
-
|
|
1154
|
+
if(!listenerMap.has(this.topicData)) {
|
|
1155
|
+
client.subscribe(this.topicData); // receive data from device
|
|
1156
|
+
}
|
|
1154
1157
|
let _this = this;
|
|
1155
1158
|
listenerMap.set(this.topicData, function (data) {
|
|
1156
1159
|
_this.data = data;
|
|
@@ -1341,6 +1344,10 @@ const CoreAPI$2 = {
|
|
|
1341
1344
|
|
|
1342
1345
|
setVolume(vol, callback) {
|
|
1343
1346
|
return publishRequest(cutosAPI$1.CORE.SET_VOLUME, callback, vol);
|
|
1347
|
+
},
|
|
1348
|
+
|
|
1349
|
+
setHttpProxy(api, target, callback) {
|
|
1350
|
+
return publishRequest(cutosAPI$1.CORE.SET_HTTP_PROXY, callback, {api, target});
|
|
1344
1351
|
}
|
|
1345
1352
|
};
|
|
1346
1353
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cutos/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "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. ",
|
|
5
5
|
"main": "dist/cutos.cjs.js",
|
|
6
6
|
"module": "dist/cutos.esm.js",
|