@agility/content-fetch 2.0.9 → 2.0.10
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/browser.js +12 -8
- package/dist/node.js +12 -8
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -493,20 +493,24 @@
|
|
|
493
493
|
}
|
|
494
494
|
};
|
|
495
495
|
function buildBaseUrl(guid) {
|
|
496
|
-
|
|
496
|
+
const baseUrlSuffixes = {
|
|
497
497
|
u: "",
|
|
498
498
|
c: "-ca",
|
|
499
499
|
e: "-eu",
|
|
500
500
|
a: "-aus",
|
|
501
|
-
d: "-dev"
|
|
501
|
+
d: "-dev",
|
|
502
|
+
us2: "-usa2"
|
|
502
503
|
};
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
504
|
+
const match = guid.match(/-(us2|[ucead])$/);
|
|
505
|
+
if (match) {
|
|
506
|
+
const env = match[1];
|
|
507
|
+
if (baseUrlSuffixes.hasOwnProperty(env)) {
|
|
508
|
+
const url = `https://api${baseUrlSuffixes[env]}.aglty.io/${guid}`;
|
|
509
|
+
return url;
|
|
510
|
+
}
|
|
509
511
|
}
|
|
512
|
+
const legacyUrl = `https://${guid}-api.agilitycms.cloud`;
|
|
513
|
+
return legacyUrl;
|
|
510
514
|
}
|
|
511
515
|
function validateConfigParams(configParams) {
|
|
512
516
|
if (!configParams.guid || configParams.guid.length == 0) {
|
package/dist/node.js
CHANGED
|
@@ -511,20 +511,24 @@ var defaultConfig = {
|
|
|
511
511
|
}
|
|
512
512
|
};
|
|
513
513
|
function buildBaseUrl(guid) {
|
|
514
|
-
|
|
514
|
+
const baseUrlSuffixes = {
|
|
515
515
|
u: "",
|
|
516
516
|
c: "-ca",
|
|
517
517
|
e: "-eu",
|
|
518
518
|
a: "-aus",
|
|
519
|
-
d: "-dev"
|
|
519
|
+
d: "-dev",
|
|
520
|
+
us2: "-usa2"
|
|
520
521
|
};
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
522
|
+
const match = guid.match(/-(us2|[ucead])$/);
|
|
523
|
+
if (match) {
|
|
524
|
+
const env = match[1];
|
|
525
|
+
if (baseUrlSuffixes.hasOwnProperty(env)) {
|
|
526
|
+
const url = `https://api${baseUrlSuffixes[env]}.aglty.io/${guid}`;
|
|
527
|
+
return url;
|
|
528
|
+
}
|
|
527
529
|
}
|
|
530
|
+
const legacyUrl = `https://${guid}-api.agilitycms.cloud`;
|
|
531
|
+
return legacyUrl;
|
|
528
532
|
}
|
|
529
533
|
function validateConfigParams(configParams) {
|
|
530
534
|
if (!configParams.guid || configParams.guid.length == 0) {
|