feed-common 1.13.0 → 1.14.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -0
- package/dist/constants/profile.constants.d.ts +58 -18
- package/dist/constants/profile.constants.d.ts.map +1 -1
- package/dist/constants/profile.constants.js +77 -34
- package/dist/constants/profile.constants.js.map +1 -1
- package/dist/types/product.types.d.ts +5 -1
- package/dist/types/product.types.d.ts.map +1 -1
- package/dist/utils/profile.js +29 -29
- package/dist/utils/profile.js.map +1 -1
- package/package.json +1 -1
- package/src/constants/profile.constants.ts +78 -34
- package/src/types/product.types.ts +99 -110
- package/src/utils/profile.ts +29 -29
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
## [1.14.1](https://github.com/advertikon/package-maxify-feed-common/compare/v1.14.0...v1.14.1) (2024-06-09)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* change numeric types of AppProductVariant ([611b08c](https://github.com/advertikon/package-maxify-feed-common/commit/611b08c48607a5b2cada3d4dc04fa947613ae039))
|
7
|
+
|
8
|
+
# [1.14.0](https://github.com/advertikon/package-maxify-feed-common/compare/v1.13.0...v1.14.0) (2024-06-08)
|
9
|
+
|
10
|
+
|
11
|
+
### Features
|
12
|
+
|
13
|
+
* put rule attributes, rule operators and mapping attribures to ENUMs ([521897b](https://github.com/advertikon/package-maxify-feed-common/commit/521897ba758af9c56f22dd5b98aefa89702aacb0))
|
14
|
+
|
1
15
|
# [1.13.0](https://github.com/advertikon/package-maxify-feed-common/compare/v1.12.0...v1.13.0) (2024-06-08)
|
2
16
|
|
3
17
|
|
@@ -10,80 +10,120 @@ export declare const SOURCE_SHOPIFY_VENDORS = "shopify.vendor";
|
|
10
10
|
export declare const SOURCE_SHOPIFY_BARCODE = "shopify.barcode";
|
11
11
|
export declare const SOURCE_SHOPIFY_SKU = "shopify.sku";
|
12
12
|
export declare const SOURCE_CUSTOM = "custom_input";
|
13
|
+
export declare enum RULES_OPERATORS {
|
14
|
+
CONTAINS = "contains",
|
15
|
+
NOT_CONTAINS = "notContains",
|
16
|
+
EQUALS = "equals",
|
17
|
+
NOT_EQUALS = "notEquals",
|
18
|
+
STARTS_WITH = "startsWith",
|
19
|
+
NOT_STARTS_WITH = "notStartsWith",
|
20
|
+
ENDS_WITH = "endsWith",
|
21
|
+
NOT_ENDS_WITH = "notEndsWith",
|
22
|
+
IN = "in",
|
23
|
+
NOT_IN = "notIn",
|
24
|
+
LESS = "less",
|
25
|
+
GREATER = "greater",
|
26
|
+
LESS_OR_EQUAL = "lessOrEqual",
|
27
|
+
GREATER_OR_EQUAL = "greaterOrEqual"
|
28
|
+
}
|
29
|
+
export declare enum RULES_ATTRIBUTES {
|
30
|
+
TITLE = "title",
|
31
|
+
COLLECTION = "collection",
|
32
|
+
PRODUCT_TYPE = "product_type",
|
33
|
+
VENDOR = "vendor",
|
34
|
+
TAG = "tag",
|
35
|
+
INVENTORY_POLICY = "inventory_policy",
|
36
|
+
INVENTORY_QUANTITY = "inventory_quantity",
|
37
|
+
PRICE = "price"
|
38
|
+
}
|
39
|
+
export declare enum MAPPING_ATTRIBUTES {
|
40
|
+
CONTENT_LANGUAGE = "contentLanguage",
|
41
|
+
TARGET_COUNTRY = "targetCountry",
|
42
|
+
ADULT = "adult",
|
43
|
+
AGE_GROUP = "ageGroup",
|
44
|
+
AVAILABILITY = "availability",
|
45
|
+
BRAND = "brand",
|
46
|
+
GENDER = "gender",
|
47
|
+
GOOGLE_PRODUCT_CATEGORY = "googleProductCategory",
|
48
|
+
GTIN = "gtin",
|
49
|
+
MPN = "mpn",
|
50
|
+
INCLUDED_DESTINATIONS = "includedDestinations",
|
51
|
+
SHIPPING_LABEL = "shippingLabel"
|
52
|
+
}
|
13
53
|
export declare const RuleOperators: {
|
14
54
|
contains: {
|
15
55
|
label: string;
|
16
|
-
value:
|
56
|
+
value: RULES_OPERATORS;
|
17
57
|
};
|
18
58
|
notContains: {
|
19
59
|
label: string;
|
20
|
-
value:
|
60
|
+
value: RULES_OPERATORS;
|
21
61
|
};
|
22
62
|
equals: {
|
23
63
|
label: string;
|
24
|
-
value:
|
64
|
+
value: RULES_OPERATORS;
|
25
65
|
};
|
26
66
|
notEquals: {
|
27
67
|
label: string;
|
28
|
-
value:
|
68
|
+
value: RULES_OPERATORS;
|
29
69
|
};
|
30
70
|
startsWith: {
|
31
71
|
label: string;
|
32
|
-
value:
|
72
|
+
value: RULES_OPERATORS;
|
33
73
|
};
|
34
74
|
notStartsWith: {
|
35
75
|
label: string;
|
36
|
-
value:
|
76
|
+
value: RULES_OPERATORS;
|
37
77
|
};
|
38
78
|
endsWith: {
|
39
79
|
label: string;
|
40
|
-
value:
|
80
|
+
value: RULES_OPERATORS;
|
41
81
|
};
|
42
82
|
notEndsWith: {
|
43
83
|
label: string;
|
44
|
-
value:
|
84
|
+
value: RULES_OPERATORS;
|
45
85
|
};
|
46
86
|
in: {
|
47
87
|
label: string;
|
48
|
-
value:
|
88
|
+
value: RULES_OPERATORS;
|
49
89
|
};
|
50
90
|
notIn: {
|
51
91
|
label: string;
|
52
|
-
value:
|
92
|
+
value: RULES_OPERATORS;
|
53
93
|
};
|
54
94
|
less: {
|
55
95
|
label: string;
|
56
|
-
value:
|
96
|
+
value: RULES_OPERATORS;
|
57
97
|
};
|
58
98
|
greater: {
|
59
99
|
label: string;
|
60
|
-
value:
|
100
|
+
value: RULES_OPERATORS;
|
61
101
|
};
|
62
102
|
lessOrEqual: {
|
63
103
|
label: string;
|
64
|
-
value:
|
104
|
+
value: RULES_OPERATORS;
|
65
105
|
};
|
66
106
|
greaterOrEqual: {
|
67
107
|
label: string;
|
68
|
-
value:
|
108
|
+
value: RULES_OPERATORS;
|
69
109
|
};
|
70
110
|
};
|
71
111
|
export declare const ProductUploadRulesOperators: {
|
72
112
|
string: {
|
73
113
|
label: string;
|
74
|
-
value:
|
114
|
+
value: RULES_OPERATORS;
|
75
115
|
}[];
|
76
116
|
number: {
|
77
117
|
label: string;
|
78
|
-
value:
|
118
|
+
value: RULES_OPERATORS;
|
79
119
|
}[];
|
80
120
|
list: {
|
81
121
|
label: string;
|
82
|
-
value:
|
122
|
+
value: RULES_OPERATORS;
|
83
123
|
}[];
|
84
124
|
is: {
|
85
125
|
label: string;
|
86
|
-
value:
|
126
|
+
value: RULES_OPERATORS;
|
87
127
|
}[];
|
88
128
|
};
|
89
129
|
export declare const ProductUploadRuleFilters: ProductUploadRuleFilterType[];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"profile.constants.d.ts","sourceRoot":"","sources":["../../src/constants/profile.constants.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"profile.constants.d.ts","sourceRoot":"","sources":["../../src/constants/profile.constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAEhG,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAC9C,eAAO,MAAM,WAAW,eAAe,CAAC;AACxC,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AACtD,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,eAAO,MAAM,sBAAsB,oBAAoB,CAAC;AACxD,eAAO,MAAM,kBAAkB,gBAAgB,CAAC;AAEhD,eAAO,MAAM,aAAa,iBAAiB,CAAC;AAE5C,oBAAY,eAAe;IACvB,QAAQ,aAAa;IACrB,YAAY,gBAAgB;IAC5B,MAAM,WAAW;IACjB,UAAU,cAAc;IACxB,WAAW,eAAe;IAC1B,eAAe,kBAAkB;IACjC,SAAS,aAAa;IACtB,aAAa,gBAAgB;IAC7B,EAAE,OAAO;IACT,MAAM,UAAU;IAChB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,aAAa,gBAAgB;IAC7B,gBAAgB,mBAAmB;CACtC;AAED,oBAAY,gBAAgB;IACxB,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,gBAAgB,qBAAqB;IACrC,kBAAkB,uBAAuB;IACzC,KAAK,UAAU;CAClB;AAED,oBAAY,kBAAkB;IAC1B,gBAAgB,oBAAoB;IACpC,cAAc,kBAAkB;IAChC,KAAK,UAAU;IACf,SAAS,aAAa;IACtB,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,uBAAuB,0BAA0B;IACjD,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,qBAAqB,yBAAyB;IAC9C,cAAc,kBAAkB;CACnC;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDzB,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;CAoBvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,2BAA2B,EA6CjE,CAAC;AASF,eAAO,MAAM,qBAAqB,EAAE,sBAAsB,EA2PzD,CAAC;AACF,eAAO,MAAM,OAAO,WAAW,CAAC;AAChC,eAAO,MAAM,uBAAuB,8BAA8B,CAAC;AACnE,eAAO,MAAM,sBAAsB,UAAsD,CAAC"}
|
@@ -9,62 +9,105 @@ export const SOURCE_SHOPIFY_VENDORS = 'shopify.vendor';
|
|
9
9
|
export const SOURCE_SHOPIFY_BARCODE = 'shopify.barcode';
|
10
10
|
export const SOURCE_SHOPIFY_SKU = 'shopify.sku';
|
11
11
|
export const SOURCE_CUSTOM = 'custom_input';
|
12
|
+
export var RULES_OPERATORS;
|
13
|
+
(function (RULES_OPERATORS) {
|
14
|
+
RULES_OPERATORS["CONTAINS"] = "contains";
|
15
|
+
RULES_OPERATORS["NOT_CONTAINS"] = "notContains";
|
16
|
+
RULES_OPERATORS["EQUALS"] = "equals";
|
17
|
+
RULES_OPERATORS["NOT_EQUALS"] = "notEquals";
|
18
|
+
RULES_OPERATORS["STARTS_WITH"] = "startsWith";
|
19
|
+
RULES_OPERATORS["NOT_STARTS_WITH"] = "notStartsWith";
|
20
|
+
RULES_OPERATORS["ENDS_WITH"] = "endsWith";
|
21
|
+
RULES_OPERATORS["NOT_ENDS_WITH"] = "notEndsWith";
|
22
|
+
RULES_OPERATORS["IN"] = "in";
|
23
|
+
RULES_OPERATORS["NOT_IN"] = "notIn";
|
24
|
+
RULES_OPERATORS["LESS"] = "less";
|
25
|
+
RULES_OPERATORS["GREATER"] = "greater";
|
26
|
+
RULES_OPERATORS["LESS_OR_EQUAL"] = "lessOrEqual";
|
27
|
+
RULES_OPERATORS["GREATER_OR_EQUAL"] = "greaterOrEqual";
|
28
|
+
})(RULES_OPERATORS || (RULES_OPERATORS = {}));
|
29
|
+
export var RULES_ATTRIBUTES;
|
30
|
+
(function (RULES_ATTRIBUTES) {
|
31
|
+
RULES_ATTRIBUTES["TITLE"] = "title";
|
32
|
+
RULES_ATTRIBUTES["COLLECTION"] = "collection";
|
33
|
+
RULES_ATTRIBUTES["PRODUCT_TYPE"] = "product_type";
|
34
|
+
RULES_ATTRIBUTES["VENDOR"] = "vendor";
|
35
|
+
RULES_ATTRIBUTES["TAG"] = "tag";
|
36
|
+
RULES_ATTRIBUTES["INVENTORY_POLICY"] = "inventory_policy";
|
37
|
+
RULES_ATTRIBUTES["INVENTORY_QUANTITY"] = "inventory_quantity";
|
38
|
+
RULES_ATTRIBUTES["PRICE"] = "price";
|
39
|
+
})(RULES_ATTRIBUTES || (RULES_ATTRIBUTES = {}));
|
40
|
+
export var MAPPING_ATTRIBUTES;
|
41
|
+
(function (MAPPING_ATTRIBUTES) {
|
42
|
+
MAPPING_ATTRIBUTES["CONTENT_LANGUAGE"] = "contentLanguage";
|
43
|
+
MAPPING_ATTRIBUTES["TARGET_COUNTRY"] = "targetCountry";
|
44
|
+
MAPPING_ATTRIBUTES["ADULT"] = "adult";
|
45
|
+
MAPPING_ATTRIBUTES["AGE_GROUP"] = "ageGroup";
|
46
|
+
MAPPING_ATTRIBUTES["AVAILABILITY"] = "availability";
|
47
|
+
MAPPING_ATTRIBUTES["BRAND"] = "brand";
|
48
|
+
MAPPING_ATTRIBUTES["GENDER"] = "gender";
|
49
|
+
MAPPING_ATTRIBUTES["GOOGLE_PRODUCT_CATEGORY"] = "googleProductCategory";
|
50
|
+
MAPPING_ATTRIBUTES["GTIN"] = "gtin";
|
51
|
+
MAPPING_ATTRIBUTES["MPN"] = "mpn";
|
52
|
+
MAPPING_ATTRIBUTES["INCLUDED_DESTINATIONS"] = "includedDestinations";
|
53
|
+
MAPPING_ATTRIBUTES["SHIPPING_LABEL"] = "shippingLabel";
|
54
|
+
})(MAPPING_ATTRIBUTES || (MAPPING_ATTRIBUTES = {}));
|
12
55
|
export const RuleOperators = {
|
13
56
|
contains: {
|
14
57
|
label: 'Contains',
|
15
|
-
value:
|
58
|
+
value: RULES_OPERATORS.CONTAINS,
|
16
59
|
},
|
17
60
|
notContains: {
|
18
61
|
label: 'Not Contains',
|
19
|
-
value:
|
62
|
+
value: RULES_OPERATORS.NOT_CONTAINS,
|
20
63
|
},
|
21
64
|
equals: {
|
22
65
|
label: 'Equals',
|
23
|
-
value:
|
66
|
+
value: RULES_OPERATORS.EQUALS,
|
24
67
|
},
|
25
68
|
notEquals: {
|
26
69
|
label: 'Not Equals',
|
27
|
-
value:
|
70
|
+
value: RULES_OPERATORS.NOT_EQUALS,
|
28
71
|
},
|
29
72
|
startsWith: {
|
30
73
|
label: 'Starts With',
|
31
|
-
value:
|
74
|
+
value: RULES_OPERATORS.STARTS_WITH,
|
32
75
|
},
|
33
76
|
notStartsWith: {
|
34
77
|
label: 'Not Starts With',
|
35
|
-
value:
|
78
|
+
value: RULES_OPERATORS.NOT_STARTS_WITH,
|
36
79
|
},
|
37
80
|
endsWith: {
|
38
81
|
label: 'Ends With',
|
39
|
-
value:
|
82
|
+
value: RULES_OPERATORS.ENDS_WITH,
|
40
83
|
},
|
41
84
|
notEndsWith: {
|
42
85
|
label: 'Not Ends With',
|
43
|
-
value:
|
86
|
+
value: RULES_OPERATORS.NOT_ENDS_WITH,
|
44
87
|
},
|
45
88
|
in: {
|
46
89
|
label: 'In',
|
47
|
-
value:
|
90
|
+
value: RULES_OPERATORS.IN,
|
48
91
|
},
|
49
92
|
notIn: {
|
50
93
|
label: 'Not In',
|
51
|
-
value:
|
94
|
+
value: RULES_OPERATORS.NOT_IN,
|
52
95
|
},
|
53
96
|
less: {
|
54
97
|
label: 'Less Than',
|
55
|
-
value:
|
98
|
+
value: RULES_OPERATORS.LESS,
|
56
99
|
},
|
57
100
|
greater: {
|
58
101
|
label: 'Greater Than',
|
59
|
-
value:
|
102
|
+
value: RULES_OPERATORS.GREATER,
|
60
103
|
},
|
61
104
|
lessOrEqual: {
|
62
105
|
label: 'Less Than or Equal',
|
63
|
-
value:
|
106
|
+
value: RULES_OPERATORS.LESS_OR_EQUAL,
|
64
107
|
},
|
65
108
|
greaterOrEqual: {
|
66
109
|
label: 'Greater Than or Equal',
|
67
|
-
value:
|
110
|
+
value: RULES_OPERATORS.GREATER_OR_EQUAL,
|
68
111
|
},
|
69
112
|
};
|
70
113
|
export const ProductUploadRulesOperators = {
|
@@ -92,32 +135,32 @@ export const ProductUploadRuleFilters = [
|
|
92
135
|
{
|
93
136
|
label: 'Title',
|
94
137
|
operators: ProductUploadRulesOperators.string,
|
95
|
-
value:
|
138
|
+
value: RULES_ATTRIBUTES.TITLE,
|
96
139
|
},
|
97
140
|
{
|
98
141
|
label: 'Collection',
|
99
142
|
operators: ProductUploadRulesOperators.list,
|
100
|
-
value:
|
143
|
+
value: RULES_ATTRIBUTES.COLLECTION,
|
101
144
|
},
|
102
145
|
{
|
103
146
|
label: 'Product Type',
|
104
147
|
operators: ProductUploadRulesOperators.list,
|
105
|
-
value:
|
148
|
+
value: RULES_ATTRIBUTES.PRODUCT_TYPE,
|
106
149
|
},
|
107
150
|
{
|
108
151
|
label: 'Vendor',
|
109
152
|
operators: ProductUploadRulesOperators.list,
|
110
|
-
value:
|
153
|
+
value: RULES_ATTRIBUTES.VENDOR,
|
111
154
|
},
|
112
155
|
{
|
113
156
|
label: 'Tag',
|
114
157
|
operators: ProductUploadRulesOperators.list,
|
115
|
-
value:
|
158
|
+
value: RULES_ATTRIBUTES.TAG,
|
116
159
|
},
|
117
160
|
{
|
118
161
|
label: 'Inventory Policy',
|
119
162
|
operators: ProductUploadRulesOperators.is,
|
120
|
-
value:
|
163
|
+
value: RULES_ATTRIBUTES.INVENTORY_POLICY,
|
121
164
|
values: [
|
122
165
|
{ label: 'Deny', value: 'deny' },
|
123
166
|
{ label: 'Continue', value: 'continue' },
|
@@ -126,12 +169,12 @@ export const ProductUploadRuleFilters = [
|
|
126
169
|
{
|
127
170
|
label: 'Inventory Quantity',
|
128
171
|
operators: ProductUploadRulesOperators.number,
|
129
|
-
value:
|
172
|
+
value: RULES_ATTRIBUTES.INVENTORY_QUANTITY,
|
130
173
|
},
|
131
174
|
{
|
132
175
|
label: 'Price',
|
133
176
|
operators: ProductUploadRulesOperators.number,
|
134
|
-
value:
|
177
|
+
value: RULES_ATTRIBUTES.PRICE,
|
135
178
|
},
|
136
179
|
];
|
137
180
|
const ShopifyProductSource = {
|
@@ -144,7 +187,7 @@ export const ProductUploadMappings = [
|
|
144
187
|
{
|
145
188
|
required: true,
|
146
189
|
label: 'Content Language',
|
147
|
-
attribute:
|
190
|
+
attribute: MAPPING_ATTRIBUTES.CONTENT_LANGUAGE,
|
148
191
|
type: 'select',
|
149
192
|
choices: [SOURCE_LANGUAGE],
|
150
193
|
rules: [],
|
@@ -153,7 +196,7 @@ export const ProductUploadMappings = [
|
|
153
196
|
{
|
154
197
|
required: true,
|
155
198
|
label: 'Target Country',
|
156
|
-
attribute:
|
199
|
+
attribute: MAPPING_ATTRIBUTES.TARGET_COUNTRY,
|
157
200
|
type: 'select',
|
158
201
|
choices: [SOURCE_COUNTRY],
|
159
202
|
rules: [],
|
@@ -162,7 +205,7 @@ export const ProductUploadMappings = [
|
|
162
205
|
{
|
163
206
|
required: false,
|
164
207
|
label: 'Adult',
|
165
|
-
attribute:
|
208
|
+
attribute: MAPPING_ATTRIBUTES.ADULT,
|
166
209
|
type: 'select',
|
167
210
|
choices: [
|
168
211
|
{ label: 'Yes', value: true },
|
@@ -174,7 +217,7 @@ export const ProductUploadMappings = [
|
|
174
217
|
{
|
175
218
|
required: false,
|
176
219
|
label: 'Age Group',
|
177
|
-
attribute:
|
220
|
+
attribute: MAPPING_ATTRIBUTES.AGE_GROUP,
|
178
221
|
type: 'select',
|
179
222
|
choices: [
|
180
223
|
{ label: '0-3 months old', value: 'newborn' },
|
@@ -189,7 +232,7 @@ export const ProductUploadMappings = [
|
|
189
232
|
{
|
190
233
|
required: true,
|
191
234
|
label: 'Availability',
|
192
|
-
attribute:
|
235
|
+
attribute: MAPPING_ATTRIBUTES.AVAILABILITY,
|
193
236
|
type: 'select',
|
194
237
|
choices: [
|
195
238
|
{ label: 'In Stock', value: 'in_stock' },
|
@@ -203,7 +246,7 @@ export const ProductUploadMappings = [
|
|
203
246
|
{
|
204
247
|
required: false,
|
205
248
|
label: 'Brand',
|
206
|
-
attribute:
|
249
|
+
attribute: MAPPING_ATTRIBUTES.BRAND,
|
207
250
|
type: 'select',
|
208
251
|
defaultValue: 'shopify.vendor',
|
209
252
|
rules: [],
|
@@ -213,7 +256,7 @@ export const ProductUploadMappings = [
|
|
213
256
|
{
|
214
257
|
required: false,
|
215
258
|
label: 'Gender',
|
216
|
-
attribute:
|
259
|
+
attribute: MAPPING_ATTRIBUTES.GENDER,
|
217
260
|
type: 'select',
|
218
261
|
choices: [
|
219
262
|
{ label: 'Male', value: 'male' },
|
@@ -226,7 +269,7 @@ export const ProductUploadMappings = [
|
|
226
269
|
{
|
227
270
|
required: false,
|
228
271
|
label: 'Google category',
|
229
|
-
attribute:
|
272
|
+
attribute: MAPPING_ATTRIBUTES.GOOGLE_PRODUCT_CATEGORY,
|
230
273
|
type: 'select',
|
231
274
|
choices: [SOURCE_GOOGLE_CATEGORY],
|
232
275
|
rules: [],
|
@@ -235,7 +278,7 @@ export const ProductUploadMappings = [
|
|
235
278
|
{
|
236
279
|
required: false,
|
237
280
|
label: 'GTIN',
|
238
|
-
attribute:
|
281
|
+
attribute: MAPPING_ATTRIBUTES.GTIN,
|
239
282
|
type: 'select',
|
240
283
|
defaultValue: 'shopify.vendor',
|
241
284
|
rules: [],
|
@@ -249,7 +292,7 @@ export const ProductUploadMappings = [
|
|
249
292
|
{
|
250
293
|
required: false,
|
251
294
|
label: 'MPN',
|
252
|
-
attribute:
|
295
|
+
attribute: MAPPING_ATTRIBUTES.MPN,
|
253
296
|
type: 'select',
|
254
297
|
defaultValue: 'shopify.vendor',
|
255
298
|
rules: [],
|
@@ -263,7 +306,7 @@ export const ProductUploadMappings = [
|
|
263
306
|
{
|
264
307
|
required: false,
|
265
308
|
label: 'Included Destinations',
|
266
|
-
attribute:
|
309
|
+
attribute: MAPPING_ATTRIBUTES.INCLUDED_DESTINATIONS,
|
267
310
|
type: 'multiselect',
|
268
311
|
choices: [
|
269
312
|
{ label: 'Shopping ads', value: 'Shopping_ads' },
|
@@ -276,7 +319,7 @@ export const ProductUploadMappings = [
|
|
276
319
|
{
|
277
320
|
required: false,
|
278
321
|
label: 'Shipping label',
|
279
|
-
attribute:
|
322
|
+
attribute: MAPPING_ATTRIBUTES.SHIPPING_LABEL,
|
280
323
|
type: 'text',
|
281
324
|
rules: [],
|
282
325
|
description: 'The shipping label of the product, used to group product in account-level shipping rules',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"profile.constants.js","sourceRoot":"","sources":["../../src/constants/profile.constants.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"profile.constants.js","sourceRoot":"","sources":["../../src/constants/profile.constants.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,cAAc,GAAG,e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E,MAAM;IACN,8BAA8B;IAC9B,MAAM;IACN,yDAAyD;IACzD,MAAM;IACN,4BAA4B;CAC/B,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAChC,MAAM,CAAC,MAAM,uBAAuB,GAAG,2BAA2B,CAAC;AACnE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC"}
|
@@ -2,7 +2,11 @@ import { GmcProductSyncStatus } from '../constants/google.constants.js';
|
|
2
2
|
import { ProductSyncStatus } from '../constants/product.constants.js';
|
3
3
|
import { ShopifyProductImage, ShopifyProductVariant } from './shopify.types.js';
|
4
4
|
export type AppProductStatus = 'active' | 'draft' | 'archived';
|
5
|
-
export type AppProductVariant = Pick<ShopifyProductVariant, 'id' | 'title' | '
|
5
|
+
export type AppProductVariant = Pick<ShopifyProductVariant, 'id' | 'title' | 'sku' | 'barcode' | 'image_id' | 'inventory_policy' | 'weight_unit' | 'requires_shipping'> & {
|
6
|
+
price: number;
|
7
|
+
compare_at_price: number | null;
|
8
|
+
weight: number;
|
9
|
+
inventory_quantity: number;
|
6
10
|
gmcProduct?: GmcProductId[];
|
7
11
|
};
|
8
12
|
export type GmcProductId = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"product.types.d.ts","sourceRoot":"","sources":["../../src/types/product.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAE/D,MAAM,MAAM,iBAAiB,
|
1
|
+
{"version":3,"file":"product.types.d.ts","sourceRoot":"","sources":["../../src/types/product.types.ts"],"names":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CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
|
package/dist/utils/profile.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ProductUploadMappings } from '../constants/profile.constants.js';
|
1
|
+
import { ProductUploadMappings, RULES_OPERATORS } from '../constants/profile.constants.js';
|
2
2
|
import { code } from './utils.js';
|
3
3
|
/**
|
4
4
|
* Check for rules duplication
|
@@ -72,34 +72,34 @@ function isExclusive(rule1, rule2) {
|
|
72
72
|
}
|
73
73
|
export function getOperatorCounterpart(operator) {
|
74
74
|
switch (operator) {
|
75
|
-
case
|
76
|
-
return
|
77
|
-
case
|
78
|
-
return
|
79
|
-
case
|
80
|
-
return
|
81
|
-
case
|
82
|
-
return
|
83
|
-
case
|
84
|
-
return
|
85
|
-
case
|
86
|
-
return
|
87
|
-
case
|
88
|
-
return
|
89
|
-
case
|
90
|
-
return
|
91
|
-
case
|
92
|
-
return
|
93
|
-
case
|
94
|
-
return
|
95
|
-
case
|
96
|
-
return
|
97
|
-
case
|
98
|
-
return
|
99
|
-
case
|
100
|
-
return
|
101
|
-
case
|
102
|
-
return
|
75
|
+
case RULES_OPERATORS.EQUALS:
|
76
|
+
return RULES_OPERATORS.NOT_EQUALS;
|
77
|
+
case RULES_OPERATORS.NOT_EQUALS:
|
78
|
+
return RULES_OPERATORS.EQUALS;
|
79
|
+
case RULES_OPERATORS.CONTAINS:
|
80
|
+
return RULES_OPERATORS.NOT_CONTAINS;
|
81
|
+
case RULES_OPERATORS.NOT_CONTAINS:
|
82
|
+
return RULES_OPERATORS.CONTAINS;
|
83
|
+
case RULES_OPERATORS.STARTS_WITH:
|
84
|
+
return RULES_OPERATORS.NOT_STARTS_WITH;
|
85
|
+
case RULES_OPERATORS.NOT_STARTS_WITH:
|
86
|
+
return RULES_OPERATORS.STARTS_WITH;
|
87
|
+
case RULES_OPERATORS.ENDS_WITH:
|
88
|
+
return RULES_OPERATORS.NOT_ENDS_WITH;
|
89
|
+
case RULES_OPERATORS.NOT_ENDS_WITH:
|
90
|
+
return RULES_OPERATORS.ENDS_WITH;
|
91
|
+
case RULES_OPERATORS.IN:
|
92
|
+
return RULES_OPERATORS.NOT_IN;
|
93
|
+
case RULES_OPERATORS.NOT_IN:
|
94
|
+
return RULES_OPERATORS.IN;
|
95
|
+
case RULES_OPERATORS.GREATER:
|
96
|
+
return RULES_OPERATORS.LESS;
|
97
|
+
case RULES_OPERATORS.LESS:
|
98
|
+
return RULES_OPERATORS.GREATER;
|
99
|
+
case RULES_OPERATORS.GREATER_OR_EQUAL:
|
100
|
+
return RULES_OPERATORS.LESS_OR_EQUAL;
|
101
|
+
case RULES_OPERATORS.LESS_OR_EQUAL:
|
102
|
+
return RULES_OPERATORS.GREATER_OR_EQUAL;
|
103
103
|
default:
|
104
104
|
throw new Error(`Unknown operator ${String(operator)}`);
|
105
105
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/utils/profile.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAE,MAAM,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GED
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable max-len */
|
1
2
|
/* eslint-disable quotes */
|
2
3
|
import { ProductUploadMapSource, ProductUploadRuleFilterType } from '../types/profile.types.js';
|
3
4
|
|
@@ -15,62 +16,105 @@ export const SOURCE_SHOPIFY_SKU = 'shopify.sku';
|
|
15
16
|
|
16
17
|
export const SOURCE_CUSTOM = 'custom_input';
|
17
18
|
|
19
|
+
export enum RULES_OPERATORS {
|
20
|
+
CONTAINS = 'contains',
|
21
|
+
NOT_CONTAINS = 'notContains',
|
22
|
+
EQUALS = 'equals',
|
23
|
+
NOT_EQUALS = 'notEquals',
|
24
|
+
STARTS_WITH = 'startsWith',
|
25
|
+
NOT_STARTS_WITH = 'notStartsWith',
|
26
|
+
ENDS_WITH = 'endsWith',
|
27
|
+
NOT_ENDS_WITH = 'notEndsWith',
|
28
|
+
IN = 'in',
|
29
|
+
NOT_IN = 'notIn',
|
30
|
+
LESS = 'less',
|
31
|
+
GREATER = 'greater',
|
32
|
+
LESS_OR_EQUAL = 'lessOrEqual',
|
33
|
+
GREATER_OR_EQUAL = 'greaterOrEqual',
|
34
|
+
}
|
35
|
+
|
36
|
+
export enum RULES_ATTRIBUTES {
|
37
|
+
TITLE = 'title',
|
38
|
+
COLLECTION = 'collection',
|
39
|
+
PRODUCT_TYPE = 'product_type',
|
40
|
+
VENDOR = 'vendor',
|
41
|
+
TAG = 'tag',
|
42
|
+
INVENTORY_POLICY = 'inventory_policy',
|
43
|
+
INVENTORY_QUANTITY = 'inventory_quantity',
|
44
|
+
PRICE = 'price',
|
45
|
+
}
|
46
|
+
|
47
|
+
export enum MAPPING_ATTRIBUTES {
|
48
|
+
CONTENT_LANGUAGE = 'contentLanguage',
|
49
|
+
TARGET_COUNTRY = 'targetCountry',
|
50
|
+
ADULT = 'adult',
|
51
|
+
AGE_GROUP = 'ageGroup',
|
52
|
+
AVAILABILITY = 'availability',
|
53
|
+
BRAND = 'brand',
|
54
|
+
GENDER = 'gender',
|
55
|
+
GOOGLE_PRODUCT_CATEGORY = 'googleProductCategory',
|
56
|
+
GTIN = 'gtin',
|
57
|
+
MPN = 'mpn',
|
58
|
+
INCLUDED_DESTINATIONS = 'includedDestinations',
|
59
|
+
SHIPPING_LABEL = 'shippingLabel',
|
60
|
+
}
|
61
|
+
|
18
62
|
export const RuleOperators = {
|
19
63
|
contains: {
|
20
64
|
label: 'Contains',
|
21
|
-
value:
|
65
|
+
value: RULES_OPERATORS.CONTAINS,
|
22
66
|
},
|
23
67
|
notContains: {
|
24
68
|
label: 'Not Contains',
|
25
|
-
value:
|
69
|
+
value: RULES_OPERATORS.NOT_CONTAINS,
|
26
70
|
},
|
27
71
|
equals: {
|
28
72
|
label: 'Equals',
|
29
|
-
value:
|
73
|
+
value: RULES_OPERATORS.EQUALS,
|
30
74
|
},
|
31
75
|
notEquals: {
|
32
76
|
label: 'Not Equals',
|
33
|
-
value:
|
77
|
+
value: RULES_OPERATORS.NOT_EQUALS,
|
34
78
|
},
|
35
79
|
startsWith: {
|
36
80
|
label: 'Starts With',
|
37
|
-
value:
|
81
|
+
value: RULES_OPERATORS.STARTS_WITH,
|
38
82
|
},
|
39
83
|
notStartsWith: {
|
40
84
|
label: 'Not Starts With',
|
41
|
-
value:
|
85
|
+
value: RULES_OPERATORS.NOT_STARTS_WITH,
|
42
86
|
},
|
43
87
|
endsWith: {
|
44
88
|
label: 'Ends With',
|
45
|
-
value:
|
89
|
+
value: RULES_OPERATORS.ENDS_WITH,
|
46
90
|
},
|
47
91
|
notEndsWith: {
|
48
92
|
label: 'Not Ends With',
|
49
|
-
value:
|
93
|
+
value: RULES_OPERATORS.NOT_ENDS_WITH,
|
50
94
|
},
|
51
95
|
in: {
|
52
96
|
label: 'In',
|
53
|
-
value:
|
97
|
+
value: RULES_OPERATORS.IN,
|
54
98
|
},
|
55
99
|
notIn: {
|
56
100
|
label: 'Not In',
|
57
|
-
value:
|
101
|
+
value: RULES_OPERATORS.NOT_IN,
|
58
102
|
},
|
59
103
|
less: {
|
60
104
|
label: 'Less Than',
|
61
|
-
value:
|
105
|
+
value: RULES_OPERATORS.LESS,
|
62
106
|
},
|
63
107
|
greater: {
|
64
108
|
label: 'Greater Than',
|
65
|
-
value:
|
109
|
+
value: RULES_OPERATORS.GREATER,
|
66
110
|
},
|
67
111
|
lessOrEqual: {
|
68
112
|
label: 'Less Than or Equal',
|
69
|
-
value:
|
113
|
+
value: RULES_OPERATORS.LESS_OR_EQUAL,
|
70
114
|
},
|
71
115
|
greaterOrEqual: {
|
72
116
|
label: 'Greater Than or Equal',
|
73
|
-
value:
|
117
|
+
value: RULES_OPERATORS.GREATER_OR_EQUAL,
|
74
118
|
},
|
75
119
|
};
|
76
120
|
|
@@ -100,32 +144,32 @@ export const ProductUploadRuleFilters: ProductUploadRuleFilterType[] = [
|
|
100
144
|
{
|
101
145
|
label: 'Title',
|
102
146
|
operators: ProductUploadRulesOperators.string,
|
103
|
-
value:
|
147
|
+
value: RULES_ATTRIBUTES.TITLE,
|
104
148
|
},
|
105
149
|
{
|
106
150
|
label: 'Collection',
|
107
151
|
operators: ProductUploadRulesOperators.list,
|
108
|
-
value:
|
152
|
+
value: RULES_ATTRIBUTES.COLLECTION,
|
109
153
|
},
|
110
154
|
{
|
111
155
|
label: 'Product Type',
|
112
156
|
operators: ProductUploadRulesOperators.list,
|
113
|
-
value:
|
157
|
+
value: RULES_ATTRIBUTES.PRODUCT_TYPE,
|
114
158
|
},
|
115
159
|
{
|
116
160
|
label: 'Vendor',
|
117
161
|
operators: ProductUploadRulesOperators.list,
|
118
|
-
value:
|
162
|
+
value: RULES_ATTRIBUTES.VENDOR,
|
119
163
|
},
|
120
164
|
{
|
121
165
|
label: 'Tag',
|
122
166
|
operators: ProductUploadRulesOperators.list,
|
123
|
-
value:
|
167
|
+
value: RULES_ATTRIBUTES.TAG,
|
124
168
|
},
|
125
169
|
{
|
126
170
|
label: 'Inventory Policy',
|
127
171
|
operators: ProductUploadRulesOperators.is,
|
128
|
-
value:
|
172
|
+
value: RULES_ATTRIBUTES.INVENTORY_POLICY,
|
129
173
|
values: [
|
130
174
|
{ label: 'Deny', value: 'deny' },
|
131
175
|
{ label: 'Continue', value: 'continue' },
|
@@ -134,12 +178,12 @@ export const ProductUploadRuleFilters: ProductUploadRuleFilterType[] = [
|
|
134
178
|
{
|
135
179
|
label: 'Inventory Quantity',
|
136
180
|
operators: ProductUploadRulesOperators.number,
|
137
|
-
value:
|
181
|
+
value: RULES_ATTRIBUTES.INVENTORY_QUANTITY,
|
138
182
|
},
|
139
183
|
{
|
140
184
|
label: 'Price',
|
141
185
|
operators: ProductUploadRulesOperators.number,
|
142
|
-
value:
|
186
|
+
value: RULES_ATTRIBUTES.PRICE,
|
143
187
|
},
|
144
188
|
];
|
145
189
|
|
@@ -154,7 +198,7 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
154
198
|
{
|
155
199
|
required: true,
|
156
200
|
label: 'Content Language',
|
157
|
-
attribute:
|
201
|
+
attribute: MAPPING_ATTRIBUTES.CONTENT_LANGUAGE,
|
158
202
|
type: 'select',
|
159
203
|
choices: [SOURCE_LANGUAGE],
|
160
204
|
rules: [],
|
@@ -163,7 +207,7 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
163
207
|
{
|
164
208
|
required: true,
|
165
209
|
label: 'Target Country',
|
166
|
-
attribute:
|
210
|
+
attribute: MAPPING_ATTRIBUTES.TARGET_COUNTRY,
|
167
211
|
type: 'select',
|
168
212
|
choices: [SOURCE_COUNTRY],
|
169
213
|
rules: [],
|
@@ -172,7 +216,7 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
172
216
|
{
|
173
217
|
required: false,
|
174
218
|
label: 'Adult',
|
175
|
-
attribute:
|
219
|
+
attribute: MAPPING_ATTRIBUTES.ADULT,
|
176
220
|
type: 'select',
|
177
221
|
choices: [
|
178
222
|
{ label: 'Yes', value: true },
|
@@ -184,7 +228,7 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
184
228
|
{
|
185
229
|
required: false,
|
186
230
|
label: 'Age Group',
|
187
|
-
attribute:
|
231
|
+
attribute: MAPPING_ATTRIBUTES.AGE_GROUP,
|
188
232
|
type: 'select',
|
189
233
|
choices: [
|
190
234
|
{ label: '0-3 months old', value: 'newborn' },
|
@@ -199,7 +243,7 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
199
243
|
{
|
200
244
|
required: true,
|
201
245
|
label: 'Availability',
|
202
|
-
attribute:
|
246
|
+
attribute: MAPPING_ATTRIBUTES.AVAILABILITY,
|
203
247
|
type: 'select',
|
204
248
|
choices: [
|
205
249
|
{ label: 'In Stock', value: 'in_stock' },
|
@@ -213,7 +257,7 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
213
257
|
{
|
214
258
|
required: false,
|
215
259
|
label: 'Brand',
|
216
|
-
attribute:
|
260
|
+
attribute: MAPPING_ATTRIBUTES.BRAND,
|
217
261
|
type: 'select',
|
218
262
|
defaultValue: 'shopify.vendor',
|
219
263
|
rules: [],
|
@@ -223,7 +267,7 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
223
267
|
{
|
224
268
|
required: false,
|
225
269
|
label: 'Gender',
|
226
|
-
attribute:
|
270
|
+
attribute: MAPPING_ATTRIBUTES.GENDER,
|
227
271
|
type: 'select',
|
228
272
|
choices: [
|
229
273
|
{ label: 'Male', value: 'male' },
|
@@ -236,7 +280,7 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
236
280
|
{
|
237
281
|
required: false,
|
238
282
|
label: 'Google category',
|
239
|
-
attribute:
|
283
|
+
attribute: MAPPING_ATTRIBUTES.GOOGLE_PRODUCT_CATEGORY,
|
240
284
|
type: 'select',
|
241
285
|
choices: [SOURCE_GOOGLE_CATEGORY],
|
242
286
|
rules: [],
|
@@ -245,7 +289,7 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
245
289
|
{
|
246
290
|
required: false,
|
247
291
|
label: 'GTIN',
|
248
|
-
attribute:
|
292
|
+
attribute: MAPPING_ATTRIBUTES.GTIN,
|
249
293
|
type: 'select',
|
250
294
|
defaultValue: 'shopify.vendor',
|
251
295
|
rules: [],
|
@@ -259,7 +303,7 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
259
303
|
{
|
260
304
|
required: false,
|
261
305
|
label: 'MPN',
|
262
|
-
attribute:
|
306
|
+
attribute: MAPPING_ATTRIBUTES.MPN,
|
263
307
|
type: 'select',
|
264
308
|
defaultValue: 'shopify.vendor',
|
265
309
|
rules: [],
|
@@ -273,7 +317,7 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
273
317
|
{
|
274
318
|
required: false,
|
275
319
|
label: 'Included Destinations',
|
276
|
-
attribute:
|
320
|
+
attribute: MAPPING_ATTRIBUTES.INCLUDED_DESTINATIONS,
|
277
321
|
type: 'multiselect',
|
278
322
|
choices: [
|
279
323
|
{ label: 'Shopping ads', value: 'Shopping_ads' },
|
@@ -287,7 +331,7 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
287
331
|
{
|
288
332
|
required: false,
|
289
333
|
label: 'Shipping label',
|
290
|
-
attribute:
|
334
|
+
attribute: MAPPING_ATTRIBUTES.SHIPPING_LABEL,
|
291
335
|
type: 'text',
|
292
336
|
rules: [],
|
293
337
|
description: 'The shipping label of the product, used to group product in account-level shipping rules',
|
@@ -5,150 +5,139 @@ import { ShopifyProductImage, ShopifyProductVariant } from './shopify.types.js';
|
|
5
5
|
export type AppProductStatus = 'active' | 'draft' | 'archived';
|
6
6
|
|
7
7
|
export type AppProductVariant =
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
| 'weight'
|
19
|
-
| 'weight_unit'
|
20
|
-
| 'compare_at_price'
|
21
|
-
| 'requires_shipping'
|
22
|
-
>
|
23
|
-
& {
|
24
|
-
gmcProduct?: GmcProductId[];
|
25
|
-
};
|
8
|
+
| Pick<
|
9
|
+
ShopifyProductVariant,
|
10
|
+
'id' | 'title' | 'sku' | 'barcode' | 'image_id' | 'inventory_policy' | 'weight_unit' | 'requires_shipping'
|
11
|
+
> & {
|
12
|
+
price: number;
|
13
|
+
compare_at_price: number | null;
|
14
|
+
weight: number;
|
15
|
+
inventory_quantity: number;
|
16
|
+
gmcProduct?: GmcProductId[];
|
17
|
+
};
|
26
18
|
|
27
19
|
export type GmcProductId = {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
20
|
+
id: string;
|
21
|
+
profileId: string;
|
22
|
+
gmcAccount: string;
|
23
|
+
uploaded_at: string;
|
24
|
+
status?: GmcProductSyncStatus;
|
25
|
+
uploadError?: string;
|
26
|
+
issues?: GoogleProductIssue[];
|
35
27
|
};
|
36
28
|
|
37
29
|
export type GoogleProductIssue = {
|
38
|
-
|
39
|
-
|
40
|
-
|
30
|
+
servability?: 'demoted' | 'disapproved' | 'unaffected' | string;
|
31
|
+
description?: string;
|
32
|
+
documentation?: string;
|
41
33
|
};
|
42
34
|
|
43
35
|
export type gmcIssue = {
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
36
|
+
gmcProductId: string;
|
37
|
+
gmcAccount: string;
|
38
|
+
updated_at: string;
|
39
|
+
issue: GoogleProductIssue[];
|
48
40
|
};
|
49
41
|
|
50
42
|
export type AppCollection = {
|
51
|
-
|
52
|
-
|
53
|
-
|
43
|
+
id: number;
|
44
|
+
handle: string;
|
45
|
+
title: string;
|
54
46
|
};
|
55
47
|
|
56
48
|
export type AppProduct = {
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
49
|
+
status: AppProductStatus;
|
50
|
+
handle: string;
|
51
|
+
title: string;
|
52
|
+
category?: string;
|
53
|
+
id: number;
|
54
|
+
_id: string;
|
55
|
+
updated_at: string;
|
56
|
+
variants: AppProductVariant[];
|
57
|
+
images: {
|
58
|
+
src: string;
|
59
|
+
id: string;
|
60
|
+
variant_ids: number[];
|
61
|
+
}[];
|
62
|
+
collections: AppCollection[];
|
63
|
+
tags: string[];
|
64
|
+
vendor: string;
|
65
|
+
product_type: string;
|
66
|
+
syncStatus: ProductSyncStatus;
|
75
67
|
};
|
76
68
|
|
77
69
|
export type AppVariant = {
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
70
|
+
status: AppProductStatus;
|
71
|
+
handle: string;
|
72
|
+
title: string;
|
73
|
+
id: number;
|
74
|
+
_id: string;
|
75
|
+
updated_at: string;
|
76
|
+
variants: AppProductVariant;
|
77
|
+
images: Pick<ShopifyProductImage, 'src' | 'id' | 'variant_ids'>[];
|
78
|
+
collections: AppCollection[];
|
79
|
+
tags: string[];
|
80
|
+
vendor: string;
|
81
|
+
product_type: string;
|
82
|
+
syncStatus: ProductSyncStatus;
|
91
83
|
};
|
92
84
|
|
93
|
-
export type AppGmcProduct = Omit<
|
94
|
-
AppVariant,
|
95
|
-
'variants.gmcProduct'
|
96
|
-
> & { variants: {gmcProduct: GmcProductId} };
|
85
|
+
export type AppGmcProduct = Omit<AppVariant, 'variants.gmcProduct'> & { variants: { gmcProduct: GmcProductId } };
|
97
86
|
|
98
87
|
export type GetProductsQuery = {
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
88
|
+
before?: string;
|
89
|
+
after?: string;
|
90
|
+
limit?: number;
|
91
|
+
handle?: string;
|
92
|
+
title?: string;
|
93
|
+
id?: number[];
|
94
|
+
sortField?: 'title' | 'id';
|
95
|
+
sort?: 'asc' | 'desc';
|
96
|
+
fields?: string[];
|
97
|
+
gmcProductId?: string[] | boolean;
|
109
98
|
};
|
110
99
|
|
111
100
|
export type GetProductsResponse = {
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
101
|
+
products: AppProduct[];
|
102
|
+
pagination: {
|
103
|
+
firstId: string;
|
104
|
+
lastId: string;
|
105
|
+
hasMore: boolean;
|
106
|
+
hasLess: boolean;
|
107
|
+
};
|
119
108
|
};
|
120
109
|
|
121
110
|
export type GetGmcProductsResponse = {
|
122
|
-
|
123
|
-
|
111
|
+
products: GmcProduct[];
|
112
|
+
total: number;
|
124
113
|
};
|
125
114
|
|
126
115
|
export type ProductsList = {
|
127
|
-
|
116
|
+
ids: string[];
|
128
117
|
};
|
129
118
|
|
130
119
|
export type UploadProductBulkPayload = {
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
120
|
+
collections: string[];
|
121
|
+
vendors: string[];
|
122
|
+
types: string[];
|
123
|
+
tags: string[];
|
135
124
|
};
|
136
125
|
|
137
126
|
export type GmcProduct = {
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
127
|
+
id: number;
|
128
|
+
title: string;
|
129
|
+
price: string;
|
130
|
+
sku: string;
|
131
|
+
image?: string;
|
132
|
+
locale: string;
|
133
|
+
country: string;
|
134
|
+
gmcProductId: string;
|
135
|
+
gmcIssues?: gmcIssue[][number]['issue'];
|
136
|
+
profileId: string;
|
137
|
+
updated_at: string;
|
138
|
+
uploaded_to_gmc_at: string;
|
139
|
+
updated_issue_at?: string;
|
140
|
+
profile: string;
|
141
|
+
status?: GmcProductSyncStatus;
|
142
|
+
uploadError?: string;
|
154
143
|
};
|
package/src/utils/profile.ts
CHANGED
@@ -11,7 +11,7 @@ import {
|
|
11
11
|
ProductUploadRuleSection,
|
12
12
|
ProductUploadRules,
|
13
13
|
} from '../types/profile.types.js';
|
14
|
-
import { ProductUploadMappings } from '../constants/profile.constants.js';
|
14
|
+
import { ProductUploadMappings, RULES_OPERATORS } from '../constants/profile.constants.js';
|
15
15
|
import { code } from './utils.js';
|
16
16
|
|
17
17
|
/**
|
@@ -97,34 +97,34 @@ function isExclusive(rule1: ProductUploadRuleItem, rule2: ProductUploadRuleItem)
|
|
97
97
|
|
98
98
|
export function getOperatorCounterpart(operator: keyof RuleOperatorsType): keyof RuleOperatorsType {
|
99
99
|
switch (operator) {
|
100
|
-
case
|
101
|
-
return
|
102
|
-
case
|
103
|
-
return
|
104
|
-
case
|
105
|
-
return
|
106
|
-
case
|
107
|
-
return
|
108
|
-
case
|
109
|
-
return
|
110
|
-
case
|
111
|
-
return
|
112
|
-
case
|
113
|
-
return
|
114
|
-
case
|
115
|
-
return
|
116
|
-
case
|
117
|
-
return
|
118
|
-
case
|
119
|
-
return
|
120
|
-
case
|
121
|
-
return
|
122
|
-
case
|
123
|
-
return
|
124
|
-
case
|
125
|
-
return
|
126
|
-
case
|
127
|
-
return
|
100
|
+
case RULES_OPERATORS.EQUALS:
|
101
|
+
return RULES_OPERATORS.NOT_EQUALS;
|
102
|
+
case RULES_OPERATORS.NOT_EQUALS:
|
103
|
+
return RULES_OPERATORS.EQUALS;
|
104
|
+
case RULES_OPERATORS.CONTAINS:
|
105
|
+
return RULES_OPERATORS.NOT_CONTAINS;
|
106
|
+
case RULES_OPERATORS.NOT_CONTAINS:
|
107
|
+
return RULES_OPERATORS.CONTAINS;
|
108
|
+
case RULES_OPERATORS.STARTS_WITH:
|
109
|
+
return RULES_OPERATORS.NOT_STARTS_WITH;
|
110
|
+
case RULES_OPERATORS.NOT_STARTS_WITH:
|
111
|
+
return RULES_OPERATORS.STARTS_WITH;
|
112
|
+
case RULES_OPERATORS.ENDS_WITH:
|
113
|
+
return RULES_OPERATORS.NOT_ENDS_WITH;
|
114
|
+
case RULES_OPERATORS.NOT_ENDS_WITH:
|
115
|
+
return RULES_OPERATORS.ENDS_WITH;
|
116
|
+
case RULES_OPERATORS.IN:
|
117
|
+
return RULES_OPERATORS.NOT_IN;
|
118
|
+
case RULES_OPERATORS.NOT_IN:
|
119
|
+
return RULES_OPERATORS.IN;
|
120
|
+
case RULES_OPERATORS.GREATER:
|
121
|
+
return RULES_OPERATORS.LESS;
|
122
|
+
case RULES_OPERATORS.LESS:
|
123
|
+
return RULES_OPERATORS.GREATER;
|
124
|
+
case RULES_OPERATORS.GREATER_OR_EQUAL:
|
125
|
+
return RULES_OPERATORS.LESS_OR_EQUAL;
|
126
|
+
case RULES_OPERATORS.LESS_OR_EQUAL:
|
127
|
+
return RULES_OPERATORS.GREATER_OR_EQUAL;
|
128
128
|
default:
|
129
129
|
throw new Error(`Unknown operator ${String(operator)}`);
|
130
130
|
}
|