theprogrammablemind 9.5.1-beta.31 → 9.5.1-beta.32
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 +5 -4
- package/package.json +1 -1
- package/src/config.js +30 -4
package/client.js
CHANGED
|
@@ -14,7 +14,7 @@ const Lines = require('./lines')
|
|
|
14
14
|
const flattens = require('./src/flatten')
|
|
15
15
|
const { sortJson, appendNoDups, updateQueries, safeNoDups, stableId, where, suggestAssociationsFix, suggestAssociationsFixFromSummaries, validProps } = require('./src/helpers')
|
|
16
16
|
const runtime = require('./runtime')
|
|
17
|
-
const
|
|
17
|
+
const db = require('./src/debug')
|
|
18
18
|
|
|
19
19
|
const getConfig_getObjectsCheck = (config, testConfig) => {
|
|
20
20
|
let testConfigName = config.name
|
|
@@ -236,9 +236,10 @@ const doWithRetries = async (n, url, queryParams, data) => {
|
|
|
236
236
|
body: JSON.stringify(data),
|
|
237
237
|
timeout: 1000 * 60 * 5, // it does not respect this timeout so that's why I have the retries
|
|
238
238
|
headers: {
|
|
239
|
-
mode: 'no-cors',
|
|
239
|
+
// mode: 'no-cors',
|
|
240
240
|
'Content-Type': 'application/json'
|
|
241
|
-
}
|
|
241
|
+
},
|
|
242
|
+
credentials: 'same-origin',
|
|
242
243
|
})
|
|
243
244
|
if (result.ok) {
|
|
244
245
|
return JSON.parse(JSON.stringify(await result.json()))
|
|
@@ -2080,5 +2081,5 @@ module.exports = {
|
|
|
2080
2081
|
flattens,
|
|
2081
2082
|
writeTest,
|
|
2082
2083
|
getConfigForTest,
|
|
2083
|
-
debug,
|
|
2084
|
+
debug: db,
|
|
2084
2085
|
}
|
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -335,6 +335,8 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
|
|
|
335
335
|
config.addPriority({ context: [[bridge.id, bridge.level], after], choose: [0] })
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
+
|
|
339
|
+
// done in setTestConfig
|
|
338
340
|
if (bridge.check) {
|
|
339
341
|
if (!config.testConfig) {
|
|
340
342
|
config.testConfig = {}
|
|
@@ -345,7 +347,7 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
|
|
|
345
347
|
if (!config.testConfig?.checks?.context) {
|
|
346
348
|
config.testConfig.checks.context = []
|
|
347
349
|
}
|
|
348
|
-
config.
|
|
350
|
+
config.contextChecksFromBridges.push({
|
|
349
351
|
'bridge.id': bridge.id,
|
|
350
352
|
'bridge.check': bridge.check,
|
|
351
353
|
match: ({context}) => context.marker == bridge.id,
|
|
@@ -353,6 +355,7 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
|
|
|
353
355
|
apply: ({context}) => bridge.check,
|
|
354
356
|
})
|
|
355
357
|
}
|
|
358
|
+
|
|
356
359
|
if (bridge.after) {
|
|
357
360
|
for (let before of bridge.after) {
|
|
358
361
|
if (typeof before === 'string') {
|
|
@@ -1054,7 +1057,27 @@ class Config {
|
|
|
1054
1057
|
}
|
|
1055
1058
|
|
|
1056
1059
|
setTestConfig (testConfig) {
|
|
1057
|
-
this.testConfig = testConfig
|
|
1060
|
+
this.testConfig = { ...testConfig }
|
|
1061
|
+
if (!this.testConfig.checks) {
|
|
1062
|
+
this.testConfig.checks = {}
|
|
1063
|
+
}
|
|
1064
|
+
if (!this.testConfig?.checks?.context) {
|
|
1065
|
+
this.testConfig.checks.context = []
|
|
1066
|
+
}
|
|
1067
|
+
this.testConfig.checks.context = this.contextChecksFromBridges.concat(this.testConfig.checks.context)
|
|
1068
|
+
/*
|
|
1069
|
+
const currentTestConfig = testConfig // add bridge has added check.context's
|
|
1070
|
+
|
|
1071
|
+
if (!this.testConfig.checks) {
|
|
1072
|
+
debugger
|
|
1073
|
+
// this.testConfig.checks =
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
// set during bridge setup
|
|
1077
|
+
if (currentTestConfig.checks?.context) {
|
|
1078
|
+
this.testConfig.checks.context = currentTestConfig.checks.context.concat(this.testConfig.checks.context)
|
|
1079
|
+
}
|
|
1080
|
+
*/
|
|
1058
1081
|
}
|
|
1059
1082
|
|
|
1060
1083
|
getTestConfig () {
|
|
@@ -2101,6 +2124,8 @@ class Config {
|
|
|
2101
2124
|
config.priorities = config.priorities || []
|
|
2102
2125
|
}
|
|
2103
2126
|
|
|
2127
|
+
this.contextChecksFromBridges = []
|
|
2128
|
+
|
|
2104
2129
|
this._enable = []
|
|
2105
2130
|
this._apiKMs = apiKMs
|
|
2106
2131
|
|
|
@@ -2160,7 +2185,7 @@ class Config {
|
|
|
2160
2185
|
|
|
2161
2186
|
// set the default server so stuff just works
|
|
2162
2187
|
// this.server('https://184.67.27.82:3000', '6804954f-e56d-471f-bbb8-08e3c54d9321')
|
|
2163
|
-
this.server('https://thinktelligence.com
|
|
2188
|
+
this.server('https://thinktelligence.com/entodicton', '6804954f-e56d-471f-bbb8-08e3c54d9321')
|
|
2164
2189
|
|
|
2165
2190
|
this.defaultConfig()
|
|
2166
2191
|
this.initializerFn = ({ currentConfig }) => {
|
|
@@ -2427,6 +2452,7 @@ class Config {
|
|
|
2427
2452
|
// update uuid here set the uuid in the objects and add error checking
|
|
2428
2453
|
cp.initializerFn = this.initializerFn
|
|
2429
2454
|
cp.terminatorFn = this.terminatorFn
|
|
2455
|
+
cp.contextChecksFromBridges = this.contextChecksFromBridges
|
|
2430
2456
|
cp._apiKMs = this._apiKMs
|
|
2431
2457
|
cp._apiConstructor = this._apiConstructor
|
|
2432
2458
|
if (cp._apiConstructor) {
|
|
@@ -2795,7 +2821,7 @@ class Config {
|
|
|
2795
2821
|
for (const check of checks) {
|
|
2796
2822
|
if (!check.match) {
|
|
2797
2823
|
const oldDefaults = defaults
|
|
2798
|
-
defaults = () =>
|
|
2824
|
+
defaults = () => helpers.safeNoDups([...check.apply(), ...oldDefaults()])
|
|
2799
2825
|
continue
|
|
2800
2826
|
}
|
|
2801
2827
|
if (check.exported) {
|