@open-wa/wa-automate 4.38.0 → 4.40.0

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.
@@ -149,6 +149,15 @@ function getLicense(config, me, debugInfo, spinner) {
149
149
  const hasSpin = !!spinner;
150
150
  if (!spinner)
151
151
  spinner = new events_1.Spin(config.sessionId || "session", "FETCH_LICENSE", config.disableSpins, true);
152
+ if (typeof config.licenseKey === "function") {
153
+ //run the funciton to get the key
154
+ config.licenseKey = yield config.licenseKey(config.sessionId, me._serialized);
155
+ }
156
+ if (typeof config.licenseKey === "object") {
157
+ //attempt to get the key from the object
158
+ config.licenseKey = config.licenseKey[me._serialized] || config.licenseKey[config.sessionId];
159
+ }
160
+ //asume by now the key is a string
152
161
  spinner === null || spinner === void 0 ? void 0 : spinner.start(`Fetching License: ${Array.isArray(config.licenseKey) ? config.licenseKey : typeof config.licenseKey === "string" ? config.licenseKey.indexOf("-") == -1 ? config.licenseKey.slice(-4) : config.licenseKey.split("-").slice(-1)[0] : config.licenseKey}`, hasSpin ? undefined : 2);
153
162
  try {
154
163
  const START = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.38.0",
3
+ "version": "4.40.0",
4
4
  "licenseCheckUrl": "https://funcs.openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://funcs.openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",