@putkoff/abstract-utilities 0.1.174 → 0.1.176

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/dist/cjs/index.js CHANGED
@@ -1339,12 +1339,27 @@ function stripHost(str) {
1339
1339
  function get_app_config_url(endpoint) {
1340
1340
  return __awaiter(this, void 0, void 0, function* () {
1341
1341
  // 1) normalize your input
1342
- endpoint = endpoint || '';
1343
- stripHost(endpoint.trim().toLowerCase());
1344
- yield loadConfig();
1345
- const base = yield fetchIt('https://abstractendeavors.com/api/secure_env', { "key": 'BASE_API_URL', 'path': '/var/www/abstractendeavors/secure-files/public/config.json' }, 'POST', null, false, true);
1346
- endpoint = stripPrefixes(endpoint, ['/', 'https://', 'abstractendeavors.com', 'api']);
1347
- return make_path(base, endpoint);
1342
+ try {
1343
+ endpoint = endpoint || '';
1344
+ const clean = stripHost(endpoint.trim().toLowerCase());
1345
+ const cfg = yield loadConfig();
1346
+ // 2) pick the key you expect in your JSON
1347
+ const appKey = (`BASE_API_URL`);
1348
+ const base = yield fetchIt('https://abstractendeavors.com/api/secure_env', { "key": 'BASE_API_URL', 'path': '/var/www/abstractendeavors/secure-files/public/config.json' }, 'POST', null, false, true);
1349
+ endpoint = stripPrefixes(endpoint, ['/', 'https://', 'abstractendeavors.com', 'api']);
1350
+ if (base && endpoint) {
1351
+ return make_path(base, endpoint);
1352
+ }
1353
+ if (base) {
1354
+ return base;
1355
+ }
1356
+ if (endpoint) {
1357
+ return endpoint;
1358
+ }
1359
+ }
1360
+ catch (_a) {
1361
+ return endpoint;
1362
+ }
1348
1363
  });
1349
1364
  }
1350
1365
  function fetchIt(endpoint, body, method, headers, blob, noApi, withCredentials, returnJson, returnReult) {
@@ -1619,6 +1634,7 @@ exports.safeGlobalProp = safeGlobalProp;
1619
1634
  exports.safeStorage = safeStorage;
1620
1635
  exports.sanitizeFilename = sanitizeFilename;
1621
1636
  exports.secureFetchIt = secureFetchIt;
1637
+ exports.stripHost = stripHost;
1622
1638
  exports.stripPrefixes = stripPrefixes;
1623
1639
  exports.truncateString = truncateString;
1624
1640
  //# sourceMappingURL=index.js.map