mind-client-js 0.20.0
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/.gitattributes +3 -0
- package/LICENSE +674 -0
- package/README.md +1 -0
- package/js/dynamic-pool.js +145 -0
- package/js/errors.js +84 -0
- package/js/extends/global.js +134 -0
- package/js/extends/glvn.js +940 -0
- package/js/extends/glvnManagement.js +76 -0
- package/js/index.js +811 -0
- package/js/login.js +215 -0
- package/js/namespaces/RESP3.js +211 -0
- package/js/namespaces/_staticPool.js +156 -0
- package/js/namespaces/db.js +23 -0
- package/js/namespaces/dbms.js +18 -0
- package/js/namespaces/fs.js +708 -0
- package/js/namespaces/globals.js +35 -0
- package/js/namespaces/process.js +451 -0
- package/js/namespaces/server.js +438 -0
- package/js/namespaces/session.js +622 -0
- package/js/namespaces/uApi.js +157 -0
- package/js/namespaces/vars.js +51 -0
- package/js/static-pool.js +789 -0
- package/js/uapi.js +270 -0
- package/js/utils.js +174 -0
- package/package.json +34 -0
- package/sketch.txt +22 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*###############################################################
|
|
2
|
+
# #
|
|
3
|
+
# Copyright (c) 2026 DnaSoft BV and/or its subsidiaries. #
|
|
4
|
+
# All rights reserved. #
|
|
5
|
+
# #
|
|
6
|
+
# This source code contains the intellectual property #
|
|
7
|
+
# of its copyright holder(s), and is made available #
|
|
8
|
+
# under a license. If you do not know the terms of #
|
|
9
|
+
# the license, please stop and do not read further. #
|
|
10
|
+
# #
|
|
11
|
+
###############################################################*/
|
|
12
|
+
|
|
13
|
+
const Glvn = require('./glvn')
|
|
14
|
+
const Global = require('./global')
|
|
15
|
+
const utils = require('../utils')
|
|
16
|
+
const errors = require("../errors");
|
|
17
|
+
|
|
18
|
+
class GlvnManagement {
|
|
19
|
+
addName = function (name) {
|
|
20
|
+
if (this.objRoot.connected === false || this.objRoot.loggedIn === false) throw new Error(errors.NOT_LOGGED_IN + 'Not logged in')
|
|
21
|
+
|
|
22
|
+
// validate name
|
|
23
|
+
utils.validateGlvnName(name)
|
|
24
|
+
|
|
25
|
+
// check existance
|
|
26
|
+
const names = Object.keys(this)
|
|
27
|
+
if (names.find(lName => lName === name)) {
|
|
28
|
+
throw new Error(errors.NAME_ALREADY_REGISTERED + 'Name already registered')
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// create new entry
|
|
32
|
+
this[name] = this._type === 'vars' ? new Glvn : new Global
|
|
33
|
+
|
|
34
|
+
Object.defineProperties(this[name], {
|
|
35
|
+
_type: {
|
|
36
|
+
value: this._type,
|
|
37
|
+
enumerable: false,
|
|
38
|
+
configurable: false
|
|
39
|
+
},
|
|
40
|
+
objRoot: {
|
|
41
|
+
value: this.objRoot,
|
|
42
|
+
enumerable: false,
|
|
43
|
+
configurable: false
|
|
44
|
+
},
|
|
45
|
+
_glvnName: {
|
|
46
|
+
value: name,
|
|
47
|
+
enumerable: false,
|
|
48
|
+
configurable: false
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
this[name]._init(this[name])
|
|
54
|
+
|
|
55
|
+
// append reader and writer
|
|
56
|
+
utils.appendToObject(this[name], this)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
removeName = function (name) {
|
|
60
|
+
if (this.objRoot.connected === false || this.objRoot.loggedIn === false) throw new Error(errors.NOT_LOGGED_IN + 'Not logged in')
|
|
61
|
+
|
|
62
|
+
// validate name
|
|
63
|
+
utils.validateGlvnName(name)
|
|
64
|
+
|
|
65
|
+
// check existance
|
|
66
|
+
const names = Object.keys(this)
|
|
67
|
+
if (names.find(lName => lName === name)) {
|
|
68
|
+
delete this[name]
|
|
69
|
+
|
|
70
|
+
} else {
|
|
71
|
+
throw new Error(errors.NAME_NOT_FOUND + 'Name not found')
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
module.exports = GlvnManagement
|