dq-cus-lib 1.0.9 → 1.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/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { getConfig, setLibraryConfig } from 'sspart-common-lib';
1
+ export { getCookie } from 'sspart-common-lib';
package/dist/index.js CHANGED
@@ -193,12 +193,12 @@ var require_cookies_browser = __commonJS({
193
193
  document.cookie = `${encodedKey}=${encodedValue};${expires}path=/`;
194
194
  };
195
195
  exports.setCookieExpiry = setCookieExpiry;
196
- var getCookie = (cname) => {
196
+ var getCookie2 = (cname) => {
197
197
  const cookies = document.cookie.split(";").map((cookie) => cookie.trim());
198
198
  const targetCookie = cookies.find((cookie) => cookie.startsWith(`${cname}=`));
199
199
  return targetCookie ? targetCookie.split("=")[1] : "";
200
200
  };
201
- exports.getCookie = getCookie;
201
+ exports.getCookie = getCookie2;
202
202
  var setLocalStorage = (key, value) => {
203
203
  const encodedKey = encodeURIComponent(key);
204
204
  const encodedValue = encodeURIComponent(value);
@@ -337,25 +337,33 @@ var require_date_service = __commonJS({
337
337
  }
338
338
  });
339
339
 
340
- // node_modules/sspart-common-lib/dist/common/config.js
341
- var require_config = __commonJS({
342
- "node_modules/sspart-common-lib/dist/common/config.js"(exports) {
340
+ // node_modules/sspart-common-lib/dist/common/config.service.js
341
+ var require_config_service = __commonJS({
342
+ "node_modules/sspart-common-lib/dist/common/config.service.js"(exports) {
343
343
  "use strict";
344
344
  Object.defineProperty(exports, "__esModule", { value: true });
345
- exports.setLibraryConfig = setLibraryConfig2;
346
- exports.getConfig = getConfig2;
347
- exports.getConfigValue = getConfigValue;
348
- var config = {};
349
- function setLibraryConfig2(newConfig) {
350
- config = Object.assign(Object.assign({}, config), newConfig);
351
- }
352
- function getConfig2() {
353
- return config;
354
- }
355
- function getConfigValue(key, fallback = "") {
356
- var _a;
357
- return (_a = config[key]) !== null && _a !== void 0 ? _a : fallback;
358
- }
345
+ var ConfigService = class _ConfigService {
346
+ constructor() {
347
+ this.configData = {};
348
+ }
349
+ static getInstance() {
350
+ if (!_ConfigService.instance) {
351
+ _ConfigService.instance = new _ConfigService();
352
+ }
353
+ return _ConfigService.instance;
354
+ }
355
+ setData(alertD) {
356
+ this.configData = Object.assign({}, alertD);
357
+ }
358
+ getData() {
359
+ return this.configData;
360
+ }
361
+ resetData() {
362
+ this.configData = {};
363
+ }
364
+ };
365
+ ConfigService.instance = null;
366
+ exports.default = ConfigService.getInstance();
359
367
  }
360
368
  });
361
369
 
@@ -551,7 +559,7 @@ var require_dist = __commonJS({
551
559
  "node_modules/sspart-common-lib/dist/index.js"(exports) {
552
560
  "use strict";
553
561
  Object.defineProperty(exports, "__esModule", { value: true });
554
- exports.planAuth = exports.auth = exports.ns = exports.contentDs = exports.alertService = exports.setLibraryConfig = exports.getConfig = exports.parseCustomDate = exports.dateFormatter = exports.getDateWithoutTimeFromUnix = exports.getDatePlusDays = exports.getDatePlusMilliseconds = exports.STOCK_ORDER_TYPES = exports.TABLE_DIRECTION = exports.STATUSES = exports.ALERT_TYPES = exports.NOTIFICATION_SERVICES = exports.removeLocalStorage = exports.clearLocalStorage = exports.setLocalStorage = exports.getLocalStorage = exports.setCookieExpiry = exports.setCookie = exports.getCookie = exports.getCookies = exports.format = exports.validateStringIsValidNumber = exports.validateStringIsValidEmail = exports.isValidUsername = exports.sleep = exports.sendSuccessCodeResponse = exports.sendSuccessResponse = exports.sendSuccessCode = exports.sendFailureResponse = exports.logFailureWithoutReturn = exports.logFailure = void 0;
562
+ exports.planAuth = exports.auth = exports.ns = exports.contentDs = exports.alertService = exports.configService = exports.parseCustomDate = exports.dateFormatter = exports.getDateWithoutTimeFromUnix = exports.getDatePlusDays = exports.getDatePlusMilliseconds = exports.STOCK_ORDER_TYPES = exports.TABLE_DIRECTION = exports.STATUSES = exports.ALERT_TYPES = exports.NOTIFICATION_SERVICES = exports.removeLocalStorage = exports.clearLocalStorage = exports.setLocalStorage = exports.getLocalStorage = exports.setCookieExpiry = exports.setCookie = exports.getCookie = exports.getCookies = exports.format = exports.validateStringIsValidNumber = exports.validateStringIsValidEmail = exports.isValidUsername = exports.sleep = exports.sendSuccessCodeResponse = exports.sendSuccessResponse = exports.sendSuccessCode = exports.sendFailureResponse = exports.logFailureWithoutReturn = exports.logFailure = void 0;
555
563
  var response_service_1 = require_response_service();
556
564
  Object.defineProperty(exports, "logFailure", { enumerable: true, get: function() {
557
565
  return response_service_1.logFailure;
@@ -645,12 +653,9 @@ var require_dist = __commonJS({
645
653
  Object.defineProperty(exports, "parseCustomDate", { enumerable: true, get: function() {
646
654
  return date_service_1.parseCustomDate;
647
655
  } });
648
- var config_1 = require_config();
649
- Object.defineProperty(exports, "getConfig", { enumerable: true, get: function() {
650
- return config_1.getConfig;
651
- } });
652
- Object.defineProperty(exports, "setLibraryConfig", { enumerable: true, get: function() {
653
- return config_1.setLibraryConfig;
656
+ var config_service_1 = require_config_service();
657
+ Object.defineProperty(exports, "configService", { enumerable: true, get: function() {
658
+ return config_service_1.default;
654
659
  } });
655
660
  var alert_data_service_1 = require_alert_data_service();
656
661
  Object.defineProperty(exports, "alertService", { enumerable: true, get: function() {
@@ -702,9 +707,7 @@ styleInject(":root {\n --primary-color: #4CA8B4;\n --primary-color-hover: #2E8
702
707
 
703
708
  // src/index.ts
704
709
  var import_sspart_common_lib = __toESM(require_dist(), 1);
705
- var export_getConfig = import_sspart_common_lib.getConfig;
706
- var export_setLibraryConfig = import_sspart_common_lib.setLibraryConfig;
710
+ var export_getCookie = import_sspart_common_lib.getCookie;
707
711
  export {
708
- export_getConfig as getConfig,
709
- export_setLibraryConfig as setLibraryConfig
712
+ export_getCookie as getCookie
710
713
  };
@@ -337,25 +337,33 @@ var require_date_service = __commonJS({
337
337
  }
338
338
  });
339
339
 
340
- // node_modules/sspart-common-lib/dist/common/config.js
341
- var require_config = __commonJS({
342
- "node_modules/sspart-common-lib/dist/common/config.js"(exports) {
340
+ // node_modules/sspart-common-lib/dist/common/config.service.js
341
+ var require_config_service = __commonJS({
342
+ "node_modules/sspart-common-lib/dist/common/config.service.js"(exports) {
343
343
  "use strict";
344
344
  Object.defineProperty(exports, "__esModule", { value: true });
345
- exports.setLibraryConfig = setLibraryConfig;
346
- exports.getConfig = getConfig;
347
- exports.getConfigValue = getConfigValue;
348
- var config = {};
349
- function setLibraryConfig(newConfig) {
350
- config = Object.assign(Object.assign({}, config), newConfig);
351
- }
352
- function getConfig() {
353
- return config;
354
- }
355
- function getConfigValue(key, fallback = "") {
356
- var _a;
357
- return (_a = config[key]) !== null && _a !== void 0 ? _a : fallback;
358
- }
345
+ var ConfigService = class _ConfigService {
346
+ constructor() {
347
+ this.configData = {};
348
+ }
349
+ static getInstance() {
350
+ if (!_ConfigService.instance) {
351
+ _ConfigService.instance = new _ConfigService();
352
+ }
353
+ return _ConfigService.instance;
354
+ }
355
+ setData(alertD) {
356
+ this.configData = Object.assign({}, alertD);
357
+ }
358
+ getData() {
359
+ return this.configData;
360
+ }
361
+ resetData() {
362
+ this.configData = {};
363
+ }
364
+ };
365
+ ConfigService.instance = null;
366
+ exports.default = ConfigService.getInstance();
359
367
  }
360
368
  });
361
369
 
@@ -551,7 +559,7 @@ var require_dist = __commonJS({
551
559
  "node_modules/sspart-common-lib/dist/index.js"(exports) {
552
560
  "use strict";
553
561
  Object.defineProperty(exports, "__esModule", { value: true });
554
- exports.planAuth = exports.auth = exports.ns = exports.contentDs = exports.alertService = exports.setLibraryConfig = exports.getConfig = exports.parseCustomDate = exports.dateFormatter = exports.getDateWithoutTimeFromUnix = exports.getDatePlusDays = exports.getDatePlusMilliseconds = exports.STOCK_ORDER_TYPES = exports.TABLE_DIRECTION = exports.STATUSES = exports.ALERT_TYPES = exports.NOTIFICATION_SERVICES = exports.removeLocalStorage = exports.clearLocalStorage = exports.setLocalStorage = exports.getLocalStorage = exports.setCookieExpiry = exports.setCookie = exports.getCookie = exports.getCookies = exports.format = exports.validateStringIsValidNumber = exports.validateStringIsValidEmail = exports.isValidUsername = exports.sleep = exports.sendSuccessCodeResponse = exports.sendSuccessResponse = exports.sendSuccessCode = exports.sendFailureResponse = exports.logFailureWithoutReturn = exports.logFailure = void 0;
562
+ exports.planAuth = exports.auth = exports.ns = exports.contentDs = exports.alertService = exports.configService = exports.parseCustomDate = exports.dateFormatter = exports.getDateWithoutTimeFromUnix = exports.getDatePlusDays = exports.getDatePlusMilliseconds = exports.STOCK_ORDER_TYPES = exports.TABLE_DIRECTION = exports.STATUSES = exports.ALERT_TYPES = exports.NOTIFICATION_SERVICES = exports.removeLocalStorage = exports.clearLocalStorage = exports.setLocalStorage = exports.getLocalStorage = exports.setCookieExpiry = exports.setCookie = exports.getCookie = exports.getCookies = exports.format = exports.validateStringIsValidNumber = exports.validateStringIsValidEmail = exports.isValidUsername = exports.sleep = exports.sendSuccessCodeResponse = exports.sendSuccessResponse = exports.sendSuccessCode = exports.sendFailureResponse = exports.logFailureWithoutReturn = exports.logFailure = void 0;
555
563
  var response_service_1 = require_response_service();
556
564
  Object.defineProperty(exports, "logFailure", { enumerable: true, get: function() {
557
565
  return response_service_1.logFailure;
@@ -645,12 +653,9 @@ var require_dist = __commonJS({
645
653
  Object.defineProperty(exports, "parseCustomDate", { enumerable: true, get: function() {
646
654
  return date_service_1.parseCustomDate;
647
655
  } });
648
- var config_1 = require_config();
649
- Object.defineProperty(exports, "getConfig", { enumerable: true, get: function() {
650
- return config_1.getConfig;
651
- } });
652
- Object.defineProperty(exports, "setLibraryConfig", { enumerable: true, get: function() {
653
- return config_1.setLibraryConfig;
656
+ var config_service_1 = require_config_service();
657
+ Object.defineProperty(exports, "configService", { enumerable: true, get: function() {
658
+ return config_service_1.default;
654
659
  } });
655
660
  var alert_data_service_1 = require_alert_data_service();
656
661
  Object.defineProperty(exports, "alertService", { enumerable: true, get: function() {
@@ -337,25 +337,33 @@ var require_date_service = __commonJS({
337
337
  }
338
338
  });
339
339
 
340
- // node_modules/sspart-common-lib/dist/common/config.js
341
- var require_config = __commonJS({
342
- "node_modules/sspart-common-lib/dist/common/config.js"(exports) {
340
+ // node_modules/sspart-common-lib/dist/common/config.service.js
341
+ var require_config_service = __commonJS({
342
+ "node_modules/sspart-common-lib/dist/common/config.service.js"(exports) {
343
343
  "use strict";
344
344
  Object.defineProperty(exports, "__esModule", { value: true });
345
- exports.setLibraryConfig = setLibraryConfig;
346
- exports.getConfig = getConfig2;
347
- exports.getConfigValue = getConfigValue;
348
- var config = {};
349
- function setLibraryConfig(newConfig) {
350
- config = Object.assign(Object.assign({}, config), newConfig);
351
- }
352
- function getConfig2() {
353
- return config;
354
- }
355
- function getConfigValue(key, fallback = "") {
356
- var _a;
357
- return (_a = config[key]) !== null && _a !== void 0 ? _a : fallback;
358
- }
345
+ var ConfigService = class _ConfigService {
346
+ constructor() {
347
+ this.configData = {};
348
+ }
349
+ static getInstance() {
350
+ if (!_ConfigService.instance) {
351
+ _ConfigService.instance = new _ConfigService();
352
+ }
353
+ return _ConfigService.instance;
354
+ }
355
+ setData(alertD) {
356
+ this.configData = Object.assign({}, alertD);
357
+ }
358
+ getData() {
359
+ return this.configData;
360
+ }
361
+ resetData() {
362
+ this.configData = {};
363
+ }
364
+ };
365
+ ConfigService.instance = null;
366
+ exports.default = ConfigService.getInstance();
359
367
  }
360
368
  });
361
369
 
@@ -551,7 +559,7 @@ var require_dist = __commonJS({
551
559
  "node_modules/sspart-common-lib/dist/index.js"(exports) {
552
560
  "use strict";
553
561
  Object.defineProperty(exports, "__esModule", { value: true });
554
- exports.planAuth = exports.auth = exports.ns = exports.contentDs = exports.alertService = exports.setLibraryConfig = exports.getConfig = exports.parseCustomDate = exports.dateFormatter = exports.getDateWithoutTimeFromUnix = exports.getDatePlusDays = exports.getDatePlusMilliseconds = exports.STOCK_ORDER_TYPES = exports.TABLE_DIRECTION = exports.STATUSES = exports.ALERT_TYPES = exports.NOTIFICATION_SERVICES = exports.removeLocalStorage = exports.clearLocalStorage = exports.setLocalStorage = exports.getLocalStorage = exports.setCookieExpiry = exports.setCookie = exports.getCookie = exports.getCookies = exports.format = exports.validateStringIsValidNumber = exports.validateStringIsValidEmail = exports.isValidUsername = exports.sleep = exports.sendSuccessCodeResponse = exports.sendSuccessResponse = exports.sendSuccessCode = exports.sendFailureResponse = exports.logFailureWithoutReturn = exports.logFailure = void 0;
562
+ exports.planAuth = exports.auth = exports.ns = exports.contentDs = exports.alertService = exports.configService = exports.parseCustomDate = exports.dateFormatter = exports.getDateWithoutTimeFromUnix = exports.getDatePlusDays = exports.getDatePlusMilliseconds = exports.STOCK_ORDER_TYPES = exports.TABLE_DIRECTION = exports.STATUSES = exports.ALERT_TYPES = exports.NOTIFICATION_SERVICES = exports.removeLocalStorage = exports.clearLocalStorage = exports.setLocalStorage = exports.getLocalStorage = exports.setCookieExpiry = exports.setCookie = exports.getCookie = exports.getCookies = exports.format = exports.validateStringIsValidNumber = exports.validateStringIsValidEmail = exports.isValidUsername = exports.sleep = exports.sendSuccessCodeResponse = exports.sendSuccessResponse = exports.sendSuccessCode = exports.sendFailureResponse = exports.logFailureWithoutReturn = exports.logFailure = void 0;
555
563
  var response_service_1 = require_response_service();
556
564
  Object.defineProperty(exports, "logFailure", { enumerable: true, get: function() {
557
565
  return response_service_1.logFailure;
@@ -645,12 +653,9 @@ var require_dist = __commonJS({
645
653
  Object.defineProperty(exports, "parseCustomDate", { enumerable: true, get: function() {
646
654
  return date_service_1.parseCustomDate;
647
655
  } });
648
- var config_1 = require_config();
649
- Object.defineProperty(exports, "getConfig", { enumerable: true, get: function() {
650
- return config_1.getConfig;
651
- } });
652
- Object.defineProperty(exports, "setLibraryConfig", { enumerable: true, get: function() {
653
- return config_1.setLibraryConfig;
656
+ var config_service_1 = require_config_service();
657
+ Object.defineProperty(exports, "configService", { enumerable: true, get: function() {
658
+ return config_service_1.default;
654
659
  } });
655
660
  var alert_data_service_1 = require_alert_data_service();
656
661
  Object.defineProperty(exports, "alertService", { enumerable: true, get: function() {
@@ -747,7 +752,7 @@ var ROUTE_MAP = {
747
752
  signin: { service: "user", path: "/user/signin" }
748
753
  };
749
754
  function CUSTOMER_ROUTES(routeKey) {
750
- const config = (0, import_sspart_common_lib.getConfig)();
755
+ const config = import_sspart_common_lib.configService.getData();
751
756
  console.log("Config from cus in routes.jsx", config);
752
757
  const HOST_MAP = {
753
758
  user: config.API_USER_API_HOST,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dq-cus-lib",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "DheQuest Customer UI library",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -73,7 +73,7 @@
73
73
  "chart.js": "^4.5.1",
74
74
  "@emotion/react": "^11.14.0",
75
75
  "@emotion/styled": "^11.14.0",
76
- "sspart-fe-lib": "^1.1.2"
76
+ "sspart-fe-lib": "^1.1.3"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@types/react-window": "^1.8.8",