@wlloyalty/wll-react-sdk 1.3.0 → 1.3.1
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/index.d.ts +1 -0
- package/dist/native.js +18 -2
- package/dist/native.js.map +1 -1
- package/dist/types/context/WllSdkContext.d.ts +1 -0
- package/dist/web.js +20 -2
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/native.js
CHANGED
|
@@ -1523,7 +1523,18 @@ var useNavigation = function (config) {
|
|
|
1523
1523
|
return handleNavigation;
|
|
1524
1524
|
};
|
|
1525
1525
|
|
|
1526
|
-
var
|
|
1526
|
+
var getBaseUrl = function (environment) {
|
|
1527
|
+
if (environment === void 0) { environment = 'STAGING'; }
|
|
1528
|
+
switch (environment) {
|
|
1529
|
+
case 'PRODUCTION':
|
|
1530
|
+
return 'https://api.core.wlloyalty.net/v1';
|
|
1531
|
+
case 'DEVELOPMENT':
|
|
1532
|
+
return 'https://localhost:8080/v1';
|
|
1533
|
+
case 'STAGING':
|
|
1534
|
+
default:
|
|
1535
|
+
return 'https://api.staging.core.wlloyalty.net/v1';
|
|
1536
|
+
}
|
|
1537
|
+
};
|
|
1527
1538
|
var useCreateRequestOptions = function (config) {
|
|
1528
1539
|
return React.useCallback(function (options) {
|
|
1529
1540
|
if (options === void 0) { options = {}; }
|
|
@@ -1586,9 +1597,11 @@ var createResourceGetter = function (resource, includeHydrate) {
|
|
|
1586
1597
|
}
|
|
1587
1598
|
// Always append locale=en
|
|
1588
1599
|
params.append('locale', config.locale || 'en');
|
|
1600
|
+
var env = config.environment || 'STAGING';
|
|
1601
|
+
var baseUrl = getBaseUrl(env);
|
|
1589
1602
|
var queryString = params.toString();
|
|
1590
1603
|
return makeRequest("".concat(baseUrl, "/tiles-management/").concat(resource, "/").concat(id).concat(queryString ? "?".concat(queryString) : ''));
|
|
1591
|
-
}, [makeRequest]);
|
|
1604
|
+
}, [makeRequest, config.environment]);
|
|
1592
1605
|
};
|
|
1593
1606
|
};
|
|
1594
1607
|
var useGetGroupByID = createResourceGetter('groups', true);
|
|
@@ -2090,6 +2103,9 @@ var validateConfig = function (config) {
|
|
|
2090
2103
|
if (config.locale && !/^[a-z]{2}$/.test(config.locale)) {
|
|
2091
2104
|
throw new Error('Invalid locale format. Expected ISO 639-1 language code (e.g. "en")');
|
|
2092
2105
|
}
|
|
2106
|
+
if (!config.environment) {
|
|
2107
|
+
config.environment = 'STAGING';
|
|
2108
|
+
}
|
|
2093
2109
|
};
|
|
2094
2110
|
|
|
2095
2111
|
function createVariantSystem(baseStyle, variantStyles) {
|