theprogrammablemind_4wp 9.3.0-beta.3 → 9.3.0-beta.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/config.js +7 -1
package/package.json CHANGED
@@ -69,6 +69,6 @@
69
69
  "sort-json": "^2.0.0",
70
70
  "uuid": "^8.3.2"
71
71
  },
72
- "version": "9.3.0-beta.3",
72
+ "version": "9.3.0-beta.4",
73
73
  "license": "UNLICENSED"
74
74
  }
package/src/config.js CHANGED
@@ -2150,7 +2150,12 @@ class Config {
2150
2150
  }
2151
2151
  }
2152
2152
 
2153
+ setApiKMs(apiKMs) {
2154
+ this._apiKMs = [...apiKMs]
2155
+ }
2156
+
2153
2157
  // constructors is a constructor
2158
+ // TODO fix Api to be API WTF
2154
2159
  async setApi (constructor) {
2155
2160
  if (typeof constructor !== 'function') {
2156
2161
  throw new Error(`Expected the argument to be an API constructor for ${this.name}.`)
@@ -2168,7 +2173,7 @@ class Config {
2168
2173
  }
2169
2174
  } else {
2170
2175
  if (!value.initialize) {
2171
- throw new Error(`Expected the API to have an initialize function for ${this.name}.`)
2176
+ throw new Error(`Expected the API to have an initialize function for ${this.name}. If you are trying to pass in multiple API configs at once use setApiKMs to set the names of the configs that you want set.`)
2172
2177
  }
2173
2178
  }
2174
2179
 
@@ -2185,6 +2190,7 @@ class Config {
2185
2190
  this._apiConstructor = constructor
2186
2191
  if (this._apiKMs.length > 0) {
2187
2192
  for (const name of this._apiKMs) {
2193
+ debugger
2188
2194
  this.km(name)._api = value[name]
2189
2195
  }
2190
2196
  } else {