@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/web.js
CHANGED
|
@@ -7843,7 +7843,20 @@ var useNavigation = function (config) {
|
|
|
7843
7843
|
return handleNavigation;
|
|
7844
7844
|
};
|
|
7845
7845
|
|
|
7846
|
-
var
|
|
7846
|
+
var getBaseUrl = function (environment) {
|
|
7847
|
+
if (environment === void 0) {
|
|
7848
|
+
environment = 'STAGING';
|
|
7849
|
+
}
|
|
7850
|
+
switch (environment) {
|
|
7851
|
+
case 'PRODUCTION':
|
|
7852
|
+
return 'https://api.core.wlloyalty.net/v1';
|
|
7853
|
+
case 'DEVELOPMENT':
|
|
7854
|
+
return 'https://localhost:8080/v1';
|
|
7855
|
+
case 'STAGING':
|
|
7856
|
+
default:
|
|
7857
|
+
return 'https://api.staging.core.wlloyalty.net/v1';
|
|
7858
|
+
}
|
|
7859
|
+
};
|
|
7847
7860
|
var useCreateRequestOptions = function (config) {
|
|
7848
7861
|
return React.useCallback(function (options) {
|
|
7849
7862
|
if (options === void 0) {
|
|
@@ -7915,9 +7928,11 @@ var createResourceGetter = function (resource, includeHydrate) {
|
|
|
7915
7928
|
}
|
|
7916
7929
|
// Always append locale=en
|
|
7917
7930
|
params.append('locale', config.locale || 'en');
|
|
7931
|
+
var env = config.environment || 'STAGING';
|
|
7932
|
+
var baseUrl = getBaseUrl(env);
|
|
7918
7933
|
var queryString = params.toString();
|
|
7919
7934
|
return makeRequest("".concat(baseUrl, "/tiles-management/").concat(resource, "/").concat(id).concat(queryString ? "?".concat(queryString) : ''));
|
|
7920
|
-
}, [makeRequest]);
|
|
7935
|
+
}, [makeRequest, config.environment]);
|
|
7921
7936
|
};
|
|
7922
7937
|
};
|
|
7923
7938
|
var useGetGroupByID = createResourceGetter('groups', true);
|
|
@@ -8655,6 +8670,9 @@ var validateConfig = function (config) {
|
|
|
8655
8670
|
if (config.locale && !/^[a-z]{2}$/.test(config.locale)) {
|
|
8656
8671
|
throw new Error('Invalid locale format. Expected ISO 639-1 language code (e.g. "en")');
|
|
8657
8672
|
}
|
|
8673
|
+
if (!config.environment) {
|
|
8674
|
+
config.environment = 'STAGING';
|
|
8675
|
+
}
|
|
8658
8676
|
};
|
|
8659
8677
|
|
|
8660
8678
|
function createVariantSystem(baseStyle, variantStyles) {
|