@putkoff/abstract-utilities 0.1.174 → 0.1.175
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,19 @@ 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
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
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
|
+
return make_path(base, endpoint);
|
|
1351
|
+
}
|
|
1352
|
+
catch (_a) {
|
|
1353
|
+
return endpoint;
|
|
1354
|
+
}
|
|
1348
1355
|
});
|
|
1349
1356
|
}
|
|
1350
1357
|
function fetchIt(endpoint, body, method, headers, blob, noApi, withCredentials, returnJson, returnReult) {
|
|
@@ -1619,6 +1626,7 @@ exports.safeGlobalProp = safeGlobalProp;
|
|
|
1619
1626
|
exports.safeStorage = safeStorage;
|
|
1620
1627
|
exports.sanitizeFilename = sanitizeFilename;
|
|
1621
1628
|
exports.secureFetchIt = secureFetchIt;
|
|
1629
|
+
exports.stripHost = stripHost;
|
|
1622
1630
|
exports.stripPrefixes = stripPrefixes;
|
|
1623
1631
|
exports.truncateString = truncateString;
|
|
1624
1632
|
//# sourceMappingURL=index.js.map
|