theprogrammablemind_4wp 7.10.0-beta.0 → 7.10.0-beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/client.js +6 -26
  2. package/package.json +1 -1
  3. package/src/config.js +21 -0
package/client.js CHANGED
@@ -667,7 +667,11 @@ const loadInstance = (config, instance) => {
667
667
  global.transitoryMode = transitoryMode
668
668
  }
669
669
 
670
- const _process = async (config, query, { initializer, commandLineArgs, credentials, writeTests, isTest, saveDeveloper, rebuildingTemplate, testConfig, testsFN, errorHandler = defaultErrorHandler } = {}) => {
670
+ const throwErrorHandler = (error) => {
671
+ throw error
672
+ }
673
+
674
+ const _process = async (config, query, { initializer, commandLineArgs, credentials, writeTests, isTest, saveDeveloper, rebuildingTemplate, testConfig, testsFN, errorHandler = throwErrorHandler } = {}) => {
671
675
  if (credentials) {
672
676
  config.server(credentials.server, credentials.key)
673
677
  }
@@ -1025,31 +1029,7 @@ const showExamples = (testFile) => {
1025
1029
  */
1026
1030
 
1027
1031
  const showInfo = (description, section, config) => {
1028
- const name = config.name
1029
- const includes = config.configs.slice(1).map((km) => km.config.name)
1030
- const visibleExamples = []
1031
- for (const test of config.tests) {
1032
- if (!test.developerTest) {
1033
- visibleExamples.push(test.query)
1034
- }
1035
- }
1036
- const templateQueries = []
1037
- if (config.instances && config.instances.length > 0) {
1038
- for (let query of config.instances.slice(-1)[0].queries) {
1039
- if (typeof query == 'string') {
1040
- templateQueries.push(query)
1041
- }
1042
- }
1043
- }
1044
- const info = { name, description, examples: visibleExamples, template: templateQueries, section, includes, demo: config.demo }
1045
- /*
1046
- if (config.instances.length > 0) {
1047
- info.template = {
1048
- base: config.instances[0].base
1049
- }
1050
- }
1051
- */
1052
- console.log(JSON.stringify(info, null, 2))
1032
+ console.log(JSON.stringify(config.getInfo(), null, 2))
1053
1033
  }
1054
1034
 
1055
1035
  const submitBugToAPI = async (subscription_id, subscription_password, config) => {
package/package.json CHANGED
@@ -65,6 +65,6 @@
65
65
  "json-stable-stringify": "^1.0.1",
66
66
  "node-fetch": "^2.6.1"
67
67
  },
68
- "version": "7.10.0-beta.0",
68
+ "version": "7.10.0-beta.2",
69
69
  "license": "ISC"
70
70
  }
package/src/config.js CHANGED
@@ -722,6 +722,27 @@ class Config {
722
722
  return base
723
723
  }
724
724
 
725
+ getInfo () {
726
+ const name = this.name
727
+ const includes = this.configs.slice(1).map((km) => km.config.name)
728
+ const visibleExamples = []
729
+ for (const test of this.tests) {
730
+ if (!test.developerTest) {
731
+ visibleExamples.push(test.query)
732
+ }
733
+ }
734
+ const templateQueries = []
735
+ if (this.instances && this.instances.length > 0) {
736
+ for (let query of this.instances.slice(-1)[0].queries) {
737
+ if (typeof query == 'string') {
738
+ templateQueries.push(query)
739
+ }
740
+ }
741
+ }
742
+ const info = { name, description: this.description, examples: visibleExamples, template: templateQueries, includes }
743
+ return info
744
+ }
745
+
725
746
  getPseudoConfig (uuid, config) {
726
747
  return {
727
748
  description: "this is a pseudo config that has limited functionality due to being available in the initializer function context",