theprogrammablemind_4wp 7.10.0-beta.0 → 7.10.0-beta.2
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 +6 -26
- package/package.json +1 -1
- 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  | 
| 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 | 
            -
               | 
| 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
    
    
    
        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",
         |