@redneckz/wildless-cms-uni-blocks 0.14.1088 → 0.14.1089

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.
@@ -1,12 +1,22 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.getBaseUrl = void 0;
3
3
  const apiBaseUrl_1 = require("../api/apiBaseUrl");
4
+ const getProductType = () => {
5
+ const raw = globalThis.localStorage?.getItem('productType');
6
+ if (!raw) {
7
+ return null;
8
+ }
9
+ try {
10
+ return JSON.parse(raw);
11
+ }
12
+ catch {
13
+ return null;
14
+ }
15
+ };
4
16
  const getBaseUrl = () => {
5
17
  const isNewMicroservice = globalThis.sessionStorage?.getItem('isNewMicroservice');
6
- const productType = globalThis.localStorage?.getItem('productType');
7
- const newRetailApi = productType === '"credit"'
8
- ? apiBaseUrl_1.NEW_RETAIL_CREDIT_API_BASE_URI
9
- : apiBaseUrl_1.NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
18
+ const productType = getProductType();
19
+ const newRetailApi = productType === 'credit' ? apiBaseUrl_1.NEW_RETAIL_CREDIT_API_BASE_URI : apiBaseUrl_1.NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
10
20
  return isNewMicroservice ? newRetailApi : apiBaseUrl_1.RETAIL_API_BASE_URI;
11
21
  };
12
22
  exports.getBaseUrl = getBaseUrl;
@@ -1 +1 @@
1
- {"version":3,"file":"getBaseUrl.js","sourceRoot":"","sources":["../../../src/retail/utils/getBaseUrl.ts"],"names":[],"mappings":";;AAAA,kDAI2B;AAEpB,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,iBAAiB,GAAG,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClF,MAAM,WAAW,GAAG,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAEpE,MAAM,YAAY,GAChB,WAAW,KAAK,UAAU;QACxB,CAAC,CAAC,2CAA8B;QAChC,CAAC,CAAC,gDAAmC,CAAC;IAE1C,OAAO,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,gCAAmB,CAAC;AAChE,CAAC,CAAC;AAVW,QAAA,UAAU,cAUrB"}
1
+ {"version":3,"file":"getBaseUrl.js","sourceRoot":"","sources":["../../../src/retail/utils/getBaseUrl.ts"],"names":[],"mappings":";;AAAA,kDAI2B;AAG3B,MAAM,cAAc,GAAG,GAAuB,EAAE;IAC9C,MAAM,GAAG,GAAG,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5D,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,IAAI,CAAC;KACb;IACD,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACxB;IAAC,MAAM;QACN,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AAEK,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,iBAAiB,GAAG,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClF,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,MAAM,YAAY,GAChB,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,2CAA8B,CAAC,CAAC,CAAC,gDAAmC,CAAC;IAElG,OAAO,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,gCAAmB,CAAC;AAChE,CAAC,CAAC;AARW,QAAA,UAAU,cAQrB"}
@@ -1,10 +1,20 @@
1
1
  import { NEW_RETAIL_CREDIT_API_BASE_URI, NEW_RETAIL_CREDIT_CARD_API_BASE_URI, RETAIL_API_BASE_URI, } from '../api/apiBaseUrl.js';
2
+ const getProductType = () => {
3
+ const raw = globalThis.localStorage?.getItem('productType');
4
+ if (!raw) {
5
+ return null;
6
+ }
7
+ try {
8
+ return JSON.parse(raw);
9
+ }
10
+ catch {
11
+ return null;
12
+ }
13
+ };
2
14
  export const getBaseUrl = () => {
3
15
  const isNewMicroservice = globalThis.sessionStorage?.getItem('isNewMicroservice');
4
- const productType = globalThis.localStorage?.getItem('productType');
5
- const newRetailApi = productType === '"credit"'
6
- ? NEW_RETAIL_CREDIT_API_BASE_URI
7
- : NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
16
+ const productType = getProductType();
17
+ const newRetailApi = productType === 'credit' ? NEW_RETAIL_CREDIT_API_BASE_URI : NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
8
18
  return isNewMicroservice ? newRetailApi : RETAIL_API_BASE_URI;
9
19
  };
10
20
  //# sourceMappingURL=getBaseUrl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBaseUrl.js","sourceRoot":"","sources":["../../../src/retail/utils/getBaseUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,mCAAmC,EACnC,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,iBAAiB,GAAG,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClF,MAAM,WAAW,GAAG,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAEpE,MAAM,YAAY,GAChB,WAAW,KAAK,UAAU;QACxB,CAAC,CAAC,8BAA8B;QAChC,CAAC,CAAC,mCAAmC,CAAC;IAE1C,OAAO,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,mBAAmB,CAAC;AAChE,CAAC,CAAC"}
1
+ {"version":3,"file":"getBaseUrl.js","sourceRoot":"","sources":["../../../src/retail/utils/getBaseUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,mCAAmC,EACnC,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,cAAc,GAAG,GAAuB,EAAE;IAC9C,MAAM,GAAG,GAAG,UAAU,CAAC,YAAY,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5D,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,IAAI,CAAC;KACb;IACD,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACxB;IAAC,MAAM;QACN,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,iBAAiB,GAAG,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClF,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,MAAM,YAAY,GAChB,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,mCAAmC,CAAC;IAElG,OAAO,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,mBAAmB,CAAC;AAChE,CAAC,CAAC"}
@@ -3,15 +3,26 @@ import {
3
3
  NEW_RETAIL_CREDIT_CARD_API_BASE_URI,
4
4
  RETAIL_API_BASE_URI,
5
5
  } from '../api/apiBaseUrl';
6
+ import { type ProductType } from '../model/ApplicationLeadFormTypes';
7
+
8
+ const getProductType = (): ProductType | null => {
9
+ const raw = globalThis.localStorage?.getItem('productType');
10
+ if (!raw) {
11
+ return null;
12
+ }
13
+ try {
14
+ return JSON.parse(raw);
15
+ } catch {
16
+ return null;
17
+ }
18
+ };
6
19
 
7
20
  export const getBaseUrl = () => {
8
21
  const isNewMicroservice = globalThis.sessionStorage?.getItem('isNewMicroservice');
9
- const productType = globalThis.localStorage?.getItem('productType');
22
+ const productType = getProductType();
10
23
 
11
24
  const newRetailApi =
12
- productType === '"credit"'
13
- ? NEW_RETAIL_CREDIT_API_BASE_URI
14
- : NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
25
+ productType === 'credit' ? NEW_RETAIL_CREDIT_API_BASE_URI : NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
15
26
 
16
27
  return isNewMicroservice ? newRetailApi : RETAIL_API_BASE_URI;
17
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.14.1088",
3
+ "version": "0.14.1089",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -3,15 +3,26 @@ import {
3
3
  NEW_RETAIL_CREDIT_CARD_API_BASE_URI,
4
4
  RETAIL_API_BASE_URI,
5
5
  } from '../api/apiBaseUrl';
6
+ import { type ProductType } from '../model/ApplicationLeadFormTypes';
7
+
8
+ const getProductType = (): ProductType | null => {
9
+ const raw = globalThis.localStorage?.getItem('productType');
10
+ if (!raw) {
11
+ return null;
12
+ }
13
+ try {
14
+ return JSON.parse(raw);
15
+ } catch {
16
+ return null;
17
+ }
18
+ };
6
19
 
7
20
  export const getBaseUrl = () => {
8
21
  const isNewMicroservice = globalThis.sessionStorage?.getItem('isNewMicroservice');
9
- const productType = globalThis.localStorage?.getItem('productType');
22
+ const productType = getProductType();
10
23
 
11
24
  const newRetailApi =
12
- productType === '"credit"'
13
- ? NEW_RETAIL_CREDIT_API_BASE_URI
14
- : NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
25
+ productType === 'credit' ? NEW_RETAIL_CREDIT_API_BASE_URI : NEW_RETAIL_CREDIT_CARD_API_BASE_URI;
15
26
 
16
27
  return isNewMicroservice ? newRetailApi : RETAIL_API_BASE_URI;
17
28
  };