@hotwax/dxp-components 1.5.2 → 1.5.3

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,51 +1,50 @@
1
- export declare const useAuthStore: import("pinia").StoreDefinition<"userAuth", {
2
- token: {
3
- value: string;
4
- expiration: any;
5
- };
6
- oms: string;
7
- }, {
8
- getToken: (state: {
9
- token: {
10
- value: string;
11
- expiration: any;
12
- };
13
- oms: string;
14
- } & import("pinia").PiniaCustomStateProperties<{
15
- token: {
16
- value: string;
17
- expiration: any;
18
- };
19
- oms: string;
20
- }>) => {
21
- value: string;
22
- expiration: any;
23
- };
24
- getOms: (state: {
25
- token: {
26
- value: string;
27
- expiration: any;
28
- };
29
- oms: string;
30
- } & import("pinia").PiniaCustomStateProperties<{
31
- token: {
32
- value: string;
33
- expiration: any;
34
- };
35
- oms: string;
36
- }>) => string;
37
- isAuthenticated: (state: {
38
- token: {
39
- value: string;
40
- expiration: any;
41
- };
42
- oms: string;
43
- } & import("pinia").PiniaCustomStateProperties<{
44
- token: {
45
- value: string;
46
- expiration: any;
47
- };
48
- oms: string;
49
- }>) => boolean;
50
- }, {}>;
51
- //# sourceMappingURL=auth.d.ts.map
1
+ export declare const useAuthStore: import("pinia").StoreDefinition<"userAuth", {
2
+ token: {
3
+ value: string;
4
+ expiration: undefined;
5
+ };
6
+ oms: string;
7
+ }, {
8
+ getToken: (state: {
9
+ token: {
10
+ value: string;
11
+ expiration: undefined;
12
+ };
13
+ oms: string;
14
+ } & import("pinia").PiniaCustomStateProperties<{
15
+ token: {
16
+ value: string;
17
+ expiration: undefined;
18
+ };
19
+ oms: string;
20
+ }>) => {
21
+ value: string;
22
+ expiration: undefined;
23
+ };
24
+ getOms: (state: {
25
+ token: {
26
+ value: string;
27
+ expiration: undefined;
28
+ };
29
+ oms: string;
30
+ } & import("pinia").PiniaCustomStateProperties<{
31
+ token: {
32
+ value: string;
33
+ expiration: undefined;
34
+ };
35
+ oms: string;
36
+ }>) => string;
37
+ isAuthenticated: (state: {
38
+ token: {
39
+ value: string;
40
+ expiration: undefined;
41
+ };
42
+ oms: string;
43
+ } & import("pinia").PiniaCustomStateProperties<{
44
+ token: {
45
+ value: string;
46
+ expiration: undefined;
47
+ };
48
+ oms: string;
49
+ }>) => boolean | "";
50
+ }, {}>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useAuthStore = void 0;
7
+ var _pinia = require("pinia");
8
+ var _luxon = require("luxon");
9
+ const useAuthStore = (0, _pinia.defineStore)('userAuth', {
10
+ state: () => {
11
+ return {
12
+ token: {
13
+ value: '',
14
+ expiration: undefined
15
+ },
16
+ oms: ''
17
+ };
18
+ },
19
+ getters: {
20
+ getToken: state => state.token,
21
+ getOms: state => state.oms,
22
+ isAuthenticated: state => {
23
+ let isTokenExpired = false;
24
+ if (state.token.expiration) {
25
+ const currTime = _luxon.DateTime.now().toMillis();
26
+ isTokenExpired = state.token.expiration < currTime;
27
+ }
28
+ return state.token.value && !isTokenExpired;
29
+ }
30
+ },
31
+ persist: true
32
+ });
33
+ exports.useAuthStore = useAuthStore;
@@ -1,44 +1,43 @@
1
- export declare const useProductIdentificationStore: import("pinia").StoreDefinition<"productIdentification", {
2
- productIdentificationPref: {
3
- primaryId: string;
4
- secondaryId: string;
5
- };
6
- productIdentificationOptions: string[];
7
- }, {
8
- getProductIdentificationPref: (state: {
9
- productIdentificationPref: {
10
- primaryId: string;
11
- secondaryId: string;
12
- };
13
- productIdentificationOptions: string[];
14
- } & import("pinia").PiniaCustomStateProperties<{
15
- productIdentificationPref: {
16
- primaryId: string;
17
- secondaryId: string;
18
- };
19
- productIdentificationOptions: string[];
20
- }>) => {
21
- primaryId: string;
22
- secondaryId: string;
23
- };
24
- getProductIdentificationOptions: (state: {
25
- productIdentificationPref: {
26
- primaryId: string;
27
- secondaryId: string;
28
- };
29
- productIdentificationOptions: string[];
30
- } & import("pinia").PiniaCustomStateProperties<{
31
- productIdentificationPref: {
32
- primaryId: string;
33
- secondaryId: string;
34
- };
35
- productIdentificationOptions: string[];
36
- }>) => string[];
37
- }, {
38
- setProductIdentificationPref(id: any, value: any, eComStoreId: any): Promise<void>;
39
- getIdentificationPref(eComStoreId: any): Promise<{
40
- primaryId: string;
41
- secondaryId: string;
42
- }>;
43
- }>;
44
- //# sourceMappingURL=productIdentification.d.ts.map
1
+ export declare const useProductIdentificationStore: import("pinia").StoreDefinition<"productIdentification", {
2
+ productIdentificationPref: {
3
+ primaryId: string;
4
+ secondaryId: string;
5
+ };
6
+ productIdentificationOptions: string[];
7
+ }, {
8
+ getProductIdentificationPref: (state: {
9
+ productIdentificationPref: {
10
+ primaryId: string;
11
+ secondaryId: string;
12
+ };
13
+ productIdentificationOptions: string[];
14
+ } & import("pinia").PiniaCustomStateProperties<{
15
+ productIdentificationPref: {
16
+ primaryId: string;
17
+ secondaryId: string;
18
+ };
19
+ productIdentificationOptions: string[];
20
+ }>) => {
21
+ primaryId: string;
22
+ secondaryId: string;
23
+ };
24
+ getProductIdentificationOptions: (state: {
25
+ productIdentificationPref: {
26
+ primaryId: string;
27
+ secondaryId: string;
28
+ };
29
+ productIdentificationOptions: string[];
30
+ } & import("pinia").PiniaCustomStateProperties<{
31
+ productIdentificationPref: {
32
+ primaryId: string;
33
+ secondaryId: string;
34
+ };
35
+ productIdentificationOptions: string[];
36
+ }>) => string[];
37
+ }, {
38
+ setProductIdentificationPref(id: string, value: string, eComStoreId: string): Promise<void>;
39
+ getIdentificationPref(eComStoreId: string): Promise<{
40
+ primaryId: string;
41
+ secondaryId: string;
42
+ } | undefined>;
43
+ }>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useProductIdentificationStore = void 0;
7
+ var _index = require("../index");
8
+ var _pinia = require("pinia");
9
+ const useProductIdentificationStore = (0, _pinia.defineStore)('productIdentification', {
10
+ state: () => {
11
+ return {
12
+ productIdentificationPref: {
13
+ primaryId: '',
14
+ secondaryId: ''
15
+ },
16
+ productIdentificationOptions: ["productId", "groupId", "groupName", "internalName", "parentProductName", "primaryProductCategoryName", "productId", "sku", "title", "SHOPIFY_PROD_SKU"]
17
+ };
18
+ },
19
+ getters: {
20
+ getProductIdentificationPref: state => state.productIdentificationPref,
21
+ getProductIdentificationOptions: state => state.productIdentificationOptions
22
+ },
23
+ actions: {
24
+ async setProductIdentificationPref(id, value, eComStoreId) {
25
+ const productIdentificationPref = JSON.parse(JSON.stringify(this.getProductIdentificationPref));
26
+
27
+ // When eComStoreId is not available then make the values change to what selected previously
28
+ if (!eComStoreId) {
29
+ this.productIdentificationPref = productIdentificationPref;
30
+ return;
31
+ }
32
+ productIdentificationPref[id] = value;
33
+ try {
34
+ this.productIdentificationPref = await _index.productIdentificationContext.setProductIdentificationPref(eComStoreId, productIdentificationPref);
35
+ } catch (err) {
36
+ console.log('error', err);
37
+ }
38
+ },
39
+ async getIdentificationPref(eComStoreId) {
40
+ // when selecting none as ecom store, not fetching the pref as it returns all the entries with the pref id
41
+ if (!eComStoreId) {
42
+ return this.productIdentificationPref = {
43
+ primaryId: 'productId',
44
+ secondaryId: ''
45
+ };
46
+ }
47
+ this.productIdentificationPref = await _index.productIdentificationContext.getProductIdentificationPref(eComStoreId);
48
+ }
49
+ }
50
+ });
51
+ exports.useProductIdentificationStore = useProductIdentificationStore;
@@ -1,3 +1,2 @@
1
- declare const goToOms: (token: any, oms: any) => void;
2
- export { goToOms };
3
- //# sourceMappingURL=index.d.ts.map
1
+ declare const goToOms: (token: string, oms: string) => void;
2
+ export { goToOms };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.goToOms = void 0;
7
+ const goToOms = (token, oms) => {
8
+ const link = (oms.startsWith('http') ? oms.replace(/api\/?/, "") : `https://${oms}.hotwax.io/`) + `?token=${token}`;
9
+ window.open(link, '_blank', 'noopener, noreferrer');
10
+ };
11
+ exports.goToOms = goToOms;
package/package.json CHANGED
@@ -1,54 +1,42 @@
1
1
  {
2
2
  "name": "@hotwax/dxp-components",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "",
5
- "type": "module",
6
- "main": "lib/index.cjs",
7
- "module": "lib/index.js",
8
- "exports": {
9
- ".": "./lib/index.js",
10
- "./style.css": "./lib/style.css"
11
- },
12
- "browser": {
13
- "./styles.css": "./lib/style.css"
14
- },
5
+ "main": "lib/index.js",
15
6
  "types": "lib/index.d.ts",
16
7
  "files": [
17
- "lib"
8
+ "lib/**/*"
18
9
  ],
19
10
  "scripts": {
20
- "dev": "vite",
21
- "build": "vue-tsc --noEmit && vite build",
22
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
11
+ "watch": "babel --watch src --out-dir lib --extensions '.ts,.tsx'",
12
+ "tsc": "tsc --noEmit false --emitDeclarationOnly",
13
+ "build": "babel src --out-dir lib --extensions '.js,.ts,.tsx,.jsx' && npm run tsc"
23
14
  },
24
15
  "author": "HotWax Commerce",
25
16
  "license": "Apache-2.0",
26
17
  "dependencies": {
27
18
  "@hotwax/oms-api": "^1.8.1",
28
- "@ionic/core": "^6.7.5",
29
- "@ionic/vue": "^6.7.5",
30
- "luxon": "3.0.0",
19
+ "luxon": "^3.3.0",
31
20
  "pinia": "2.0.36",
32
21
  "pinia-plugin-persistedstate": "^3.1.0",
33
22
  "vue": "^3.3.4"
34
23
  },
35
24
  "devDependencies": {
36
- "@babel/types": "^7.22.11",
37
- "@types/luxon": "3.0.0",
38
- "@types/node": "^20.5.7",
39
- "@vitejs/plugin-vue": "^4.3.4",
40
- "@vue/eslint-config-prettier": "^8.0.0",
41
- "@vue/eslint-config-typescript": "^11.0.3",
42
- "@vue/tsconfig": "^0.1.3",
43
- "eslint": "^8.48.0",
44
- "eslint-plugin-vue": "^9.17.0",
45
- "rollup-plugin-typescript2": "^0.35.0",
46
- "typescript": "~4.7.4",
47
- "vite": "^4.4.9",
48
- "vue-tsc": "^1.8.8"
25
+ "@babel/cli": "^7.21.5",
26
+ "@babel/core": "^7.22.1",
27
+ "@babel/plugin-syntax-jsx": "^7.22.5",
28
+ "@babel/preset-env": "^7.22.4",
29
+ "@babel/preset-typescript": "^7.21.5",
30
+ "@types/luxon": "^3.3.0",
31
+ "@vue/babel-plugin-jsx": "^1.1.1",
32
+ "@vue/babel-plugin-transform-vue-jsx": "^1.4.0",
33
+ "babel-plugin-module-resolver": "^4.1.0",
34
+ "babel-preset-vue": "^2.0.2",
35
+ "eslint": "^7.32.0",
36
+ "typescript": "~4.7.4"
49
37
  },
50
38
  "repository": {
51
39
  "type": "git",
52
40
  "url": "https://github.com/hotwax/dxp-components"
53
41
  }
54
- }
42
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"Login.d.ts","sourceRoot":"","sources":["../../src/components/Login.ts"],"names":[],"mappings":";;;;;;;;AAGA,wBAuDG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ShopifyImg.d.ts","sourceRoot":"","sources":["../../src/components/ShopifyImg.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,wBA6CG"}
@@ -1,11 +0,0 @@
1
- import '@ionic/vue/css/core.css';
2
- import '@ionic/vue/css/normalize.css';
3
- import '@ionic/vue/css/structure.css';
4
- import '@ionic/vue/css/typography.css';
5
- import '@ionic/vue/css/padding.css';
6
- import '@ionic/vue/css/float-elements.css';
7
- import '@ionic/vue/css/text-alignment.css';
8
- import '@ionic/vue/css/text-transformation.css';
9
- import '@ionic/vue/css/flex-utils.css';
10
- import '@ionic/vue/css/display.css';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,yBAAyB,CAAC;AAGjC,OAAO,8BAA8B,CAAC;AACtC,OAAO,8BAA8B,CAAC;AACtC,OAAO,+BAA+B,CAAC;AAGvC,OAAO,4BAA4B,CAAC;AACpC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,mCAAmC,CAAC;AAC3C,OAAO,wCAAwC,CAAC;AAChD,OAAO,+BAA+B,CAAC;AACvC,OAAO,4BAA4B,CAAC"}