theprogrammablemind_4wp 8.0.0-beta.1 → 8.0.0-beta.11
Sign up to get free protection for your applications and to get access to all the features.
- package/client.js +1 -1
- package/package.json +12 -13
- package/src/config.js +33 -10
package/client.js
CHANGED
@@ -1663,7 +1663,7 @@ const knowledgeModuleImpl = async ({
|
|
1663
1663
|
throw new Error('Error for the checkForLoop argument. Expected a JSON array of operator keys of the form "[<id>, <level>]"')
|
1664
1664
|
}
|
1665
1665
|
} catch (e) {
|
1666
|
-
throw new Error(
|
1666
|
+
throw new Error('Error for the checkForLoop argument. Expected a JSON array of operator keys of the form "[<id>, <level>]"')
|
1667
1667
|
}
|
1668
1668
|
} else {
|
1669
1669
|
if (process.argv.includes('--checkForLoop') || process.argv.includes('-cl')) {
|
package/package.json
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"devDependencies": {
|
3
|
-
"eslint-plugin-import": "^2.23.4",
|
4
|
-
"jest": "^29.7.0",
|
5
|
-
"@typescript-eslint/parser": "^4.28.4",
|
6
3
|
"@typescript-eslint/eslint-plugin": "^4.28.4",
|
7
|
-
"eslint
|
4
|
+
"@typescript-eslint/parser": "^4.28.4",
|
5
|
+
"eslint": "^7.31.0",
|
8
6
|
"eslint-config-standard": "^16.0.3",
|
7
|
+
"eslint-plugin-import": "^2.23.4",
|
8
|
+
"eslint-plugin-node": "^11.1.0",
|
9
9
|
"eslint-plugin-promise": "^5.1.0",
|
10
|
-
"
|
10
|
+
"jest": "^29.7.0"
|
11
11
|
},
|
12
12
|
"scripts": {
|
13
13
|
"to:debug": "node inspect node_modules/.bin/jest --runInBand -t NEO23",
|
@@ -52,19 +52,18 @@
|
|
52
52
|
],
|
53
53
|
"author": "dev@thinktelligence.com",
|
54
54
|
"dependencies": {
|
55
|
+
"base-64": "^1.0.0",
|
55
56
|
"deep-equal": "^2.0.4",
|
56
|
-
"
|
57
|
+
"fs": "0.0.1-security",
|
57
58
|
"json-diff": "^1.0.3",
|
59
|
+
"json-stable-stringify": "^1.0.1",
|
58
60
|
"lodash": "^4.17.20",
|
59
|
-
"
|
60
|
-
"base-64": "^1.0.0",
|
61
|
-
"sort-json": "^2.0.0",
|
61
|
+
"node-fetch": "^2.6.1",
|
62
62
|
"readline": "^1.3.0",
|
63
63
|
"scriptjs": "^2.5.9",
|
64
|
-
"
|
65
|
-
"
|
66
|
-
"node-fetch": "^2.6.1"
|
64
|
+
"sort-json": "^2.0.0",
|
65
|
+
"uuid": "^8.3.2"
|
67
66
|
},
|
68
|
-
"version": "8.0.0-beta.
|
67
|
+
"version": "8.0.0-beta.11",
|
69
68
|
"license": "UNLICENSED"
|
70
69
|
}
|
package/src/config.js
CHANGED
@@ -262,7 +262,12 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
|
|
262
262
|
}
|
263
263
|
if (bridge.children) {
|
264
264
|
for (const child of bridge.children) {
|
265
|
-
config.addHierarchy(child, bridge.id)
|
265
|
+
// config.addHierarchy(child, bridge.id)
|
266
|
+
if (child.child) {
|
267
|
+
config.addHierarchy(child.child, bridge.id, child.instance)
|
268
|
+
} else {
|
269
|
+
config.addHierarchy(child, bridge.id)
|
270
|
+
}
|
266
271
|
}
|
267
272
|
}
|
268
273
|
if (bridge.operator) {
|
@@ -270,12 +275,20 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
|
|
270
275
|
}
|
271
276
|
if (bridge.parents) {
|
272
277
|
for (const parent of bridge.parents) {
|
273
|
-
|
278
|
+
if (parent.parent) {
|
279
|
+
config.addHierarchy(bridge.id, parent.parent, parent.instance)
|
280
|
+
} else {
|
281
|
+
config.addHierarchy(bridge.id, parent)
|
282
|
+
}
|
274
283
|
}
|
275
284
|
}
|
276
285
|
if (bridge.isA) {
|
277
286
|
for (const parent of bridge.isA) {
|
278
|
-
|
287
|
+
if (parent.parent) {
|
288
|
+
config.addHierarchy(bridge.id, parent.parent, parent.instance)
|
289
|
+
} else {
|
290
|
+
config.addHierarchy(bridge.id, parent)
|
291
|
+
}
|
279
292
|
}
|
280
293
|
}
|
281
294
|
if (bridge.before) {
|
@@ -1309,9 +1322,9 @@ class Config {
|
|
1309
1322
|
}
|
1310
1323
|
}
|
1311
1324
|
|
1312
|
-
addHierarchy (child, parent) {
|
1325
|
+
addHierarchy (child, parent, instance) {
|
1313
1326
|
if (child && parent || !child || Array.isArray(child) || (typeof child === 'string' && !parent)) {
|
1314
|
-
this.addHierarchyChildParent(child, parent)
|
1327
|
+
this.addHierarchyChildParent(child, parent, instance)
|
1315
1328
|
// this.addHierarchyProperties ({ child, parent })
|
1316
1329
|
} else {
|
1317
1330
|
this.addHierarchyProperties(child)
|
@@ -1319,26 +1332,32 @@ class Config {
|
|
1319
1332
|
}
|
1320
1333
|
|
1321
1334
|
addHierarchyProperties (edge) {
|
1322
|
-
const { child, parent } = edge
|
1335
|
+
const { child, parent, instance } = edge
|
1323
1336
|
if (typeof child !== 'string') {
|
1324
1337
|
throw new Error(`addHierarchy expected child property to be a string. got ${JSON.stringify(child)}`)
|
1325
1338
|
}
|
1326
1339
|
if (typeof parent !== 'string') {
|
1327
1340
|
throw new Error(`addHierarchy expected parent property to be a string. got ${JSON.stringify(parent)}`)
|
1328
1341
|
}
|
1342
|
+
if (instance && typeof instance !== 'boolean') {
|
1343
|
+
throw new Error(`addHierarchy expected instance property to be a boolean or undefined. got ${JSON.stringify(instance)}`)
|
1344
|
+
}
|
1329
1345
|
debugHierarchy([child, parent])
|
1330
1346
|
this.config.hierarchy.push(edge)
|
1331
1347
|
// TODO greg11 this.hierarchy.addEdge(edge)
|
1332
|
-
this._delta.json.hierarchy.push([child, parent])
|
1348
|
+
this._delta.json.hierarchy.push([child, parent, instance || false])
|
1333
1349
|
}
|
1334
1350
|
|
1335
|
-
addHierarchyChildParent (child, parent) {
|
1351
|
+
addHierarchyChildParent (child, parent, instance) {
|
1336
1352
|
if (typeof child !== 'string') {
|
1337
1353
|
throw new Error(`addHierarchy expected child to be a string. got ${JSON.stringify(child)}`)
|
1338
1354
|
}
|
1339
1355
|
if (typeof parent !== 'string') {
|
1340
1356
|
throw new Error(`addHierarchy expected parent to be a string. got ${JSON.stringify(parent)}`)
|
1341
1357
|
}
|
1358
|
+
if (instance && typeof instance !== 'boolean') {
|
1359
|
+
throw new Error(`addHierarchy expected instance property to be a boolean or undefined. got ${JSON.stringify(instance)}`)
|
1360
|
+
}
|
1342
1361
|
debugHierarchy([child, parent])
|
1343
1362
|
if (this.config.hierarchy.find((element) => {
|
1344
1363
|
const hc = hierarchyCanonical(element)
|
@@ -1349,9 +1368,9 @@ class Config {
|
|
1349
1368
|
return
|
1350
1369
|
}
|
1351
1370
|
|
1352
|
-
this.config.hierarchy.push([child, parent])
|
1371
|
+
this.config.hierarchy.push([child, parent, instance || false])
|
1353
1372
|
// this.hierarchy.addEdge([child, parent])
|
1354
|
-
this._delta.json.hierarchy.push([child, parent])
|
1373
|
+
this._delta.json.hierarchy.push([child, parent, instance || false])
|
1355
1374
|
}
|
1356
1375
|
|
1357
1376
|
getBridge (id, level) {
|
@@ -1620,6 +1639,10 @@ class Config {
|
|
1620
1639
|
return client.process(this, query, options)
|
1621
1640
|
}
|
1622
1641
|
|
1642
|
+
query (query, options) {
|
1643
|
+
return this.process(query, options)
|
1644
|
+
}
|
1645
|
+
|
1623
1646
|
processQuery (query, options) {
|
1624
1647
|
return this.process(query, options)
|
1625
1648
|
}
|