entodicton 9.7.1-beta.12 → 9.7.1-beta.13

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/client.js CHANGED
@@ -1334,6 +1334,7 @@ const knowledgeModuleImpl = async ({
1334
1334
  parser.add_argument('-cl', '--checkForLoop', { nargs: '?', help: 'Check for loops in the priorities, Optional argument is list of operator keys to consider. For example [["banana", 0], ["food", 1]]' })
1335
1335
  parser.add_argument('-r', '--reset', { action: 'store_true', help: 'Get the server to bypass the cache and rebuild everything' })
1336
1336
  parser.add_argument('-q', '--query', { help: 'Run the specified query' })
1337
+ parser.add_argument('-qn', '--queryNumber', { help: 'Run the query specified by the given index' })
1337
1338
  parser.add_argument('-f', '--filter', { help: 'for -pd only the data for the knowledge modules that start with this string will be shown' })
1338
1339
  parser.add_argument('-ip ', '--server', { help: 'Server to run against' })
1339
1340
  parser.add_argument('--trace', { action: 'store_true', help: 'Trace the semantics and generator calls.' })
@@ -1380,6 +1381,10 @@ const knowledgeModuleImpl = async ({
1380
1381
  const args = parser.parse_args()
1381
1382
  args.count = args.count || 1
1382
1383
 
1384
+ if (args.queryNumber) {
1385
+ args.query = test.contents[args.queryNumber].query
1386
+ }
1387
+
1383
1388
  if (args.rebuildTemplateFull) {
1384
1389
  args.rebuildTemplate = true
1385
1390
  }
@@ -1473,9 +1478,10 @@ const knowledgeModuleImpl = async ({
1473
1478
 
1474
1479
  if (args.deleteTest) {
1475
1480
  let tests = JSON.parse(runtime.fs.readFileSync(testConfig.name))
1481
+ const nTests = tests.length
1476
1482
  tests = tests.filter((test) => test.query !== args.deleteTest)
1477
1483
  writeTestFile(testConfig.name, tests)
1478
- console.log(`Delete the test for "${args.deleteTest}"`)
1484
+ console.log(`Deleted ${nTests - tests.length} tests for "${args.deleteTest}"`)
1479
1485
  return
1480
1486
  }
1481
1487
 
package/package.json CHANGED
@@ -73,6 +73,6 @@
73
73
  "scriptjs": "^2.5.9",
74
74
  "uuid": "^8.3.2"
75
75
  },
76
- "version": "9.7.1-beta.12",
76
+ "version": "9.7.1-beta.13",
77
77
  "license": "UNLICENSED"
78
78
  }
package/src/config.js CHANGED
@@ -563,7 +563,7 @@ const handleCalculatedProps = (baseConfig, moreConfig, { addFirst, uuid } = {})
563
563
  'generatorr',
564
564
  'generators',
565
565
  'id',
566
- 'init',
566
+ 'initial',
567
567
  'inverted',
568
568
  'isA',
569
569
  'level',
package/src/flatten.js CHANGED
@@ -76,6 +76,9 @@ const flatten = (markers, value) => {
76
76
  if (value.flatten === false) {
77
77
  return [[value], false]
78
78
  }
79
+
80
+ const flatten_ignore = value.flatten_ignore || []
81
+
79
82
  const marker = value.marker
80
83
  let properties = value
81
84
 
@@ -105,8 +108,9 @@ const flatten = (markers, value) => {
105
108
  for (const key in properties) {
106
109
  let wf = false
107
110
  let values
108
- // if isinstance(properties[key], Context) {
109
- if (isObject(properties[key])) {
111
+ if (flatten_ignore.includes(key)) {
112
+ values = [properties[key]]
113
+ } else if (isObject(properties[key])) {
110
114
  const context = properties[key];
111
115
  [values, wf] = flatten(markers, context)
112
116
  // } else if (isinstance(properties[key], list)) {