feed-common 1.12.0 → 1.14.0
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 +89 -46
- package/dist/constants/profile.constants.js.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 +90 -46
- package/src/utils/profile.ts +29 -29
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# [1.14.0](https://github.com/advertikon/package-maxify-feed-common/compare/v1.13.0...v1.14.0) (2024-06-08)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* put rule attributes, rule operators and mapping attribures to ENUMs ([521897b](https://github.com/advertikon/package-maxify-feed-common/commit/521897ba758af9c56f22dd5b98aefa89702aacb0))
|
7
|
+
|
8
|
+
# [1.13.0](https://github.com/advertikon/package-maxify-feed-common/compare/v1.12.0...v1.13.0) (2024-06-08)
|
9
|
+
|
10
|
+
|
11
|
+
### Features
|
12
|
+
|
13
|
+
* remove rules restriction on upload mappings ([9405040](https://github.com/advertikon/package-maxify-feed-common/commit/9405040406bf693dbaa637cf4e3f1b670112aa8d))
|
14
|
+
|
1
15
|
# [1.12.0](https://github.com/advertikon/package-maxify-feed-common/compare/v1.11.1...v1.12.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,37 +187,37 @@ 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
|
-
rules: [
|
193
|
+
rules: [],
|
151
194
|
description: 'Language for the item',
|
152
195
|
},
|
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
|
-
rules: [
|
202
|
+
rules: [],
|
160
203
|
description: "The item's country of sale",
|
161
204
|
},
|
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 },
|
169
212
|
{ label: 'No', value: false },
|
170
213
|
],
|
171
|
-
rules: [
|
214
|
+
rules: [],
|
172
215
|
description: 'Should be set to "Yes" if the item is targeted towards adults',
|
173
216
|
},
|
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' },
|
@@ -183,13 +226,13 @@ export const ProductUploadMappings = [
|
|
183
226
|
{ label: '5-13 years old', value: 'kids' },
|
184
227
|
{ label: '13 years old or more', value: 'adult' },
|
185
228
|
],
|
186
|
-
rules: [
|
229
|
+
rules: [],
|
187
230
|
description: 'Target age group of the item',
|
188
231
|
},
|
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' },
|
@@ -197,48 +240,48 @@ export const ProductUploadMappings = [
|
|
197
240
|
{ label: 'Preorder', value: 'preorder' },
|
198
241
|
{ label: 'Backorder', value: 'backorder' },
|
199
242
|
],
|
200
|
-
rules: [
|
243
|
+
rules: [],
|
201
244
|
description: 'Availability status of the item',
|
202
245
|
},
|
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
|
-
rules: [
|
252
|
+
rules: [],
|
210
253
|
description: 'Brand of the item',
|
211
254
|
choices: [ShopifyProductSource.vendor, SOURCE_VENDORS, ShopifyProductSource.custom],
|
212
255
|
},
|
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' },
|
220
263
|
{ label: 'Female', value: 'female' },
|
221
264
|
{ label: 'Unisex', value: 'unisex' },
|
222
265
|
],
|
223
|
-
rules: [
|
266
|
+
rules: [],
|
224
267
|
description: 'Target gender of the item',
|
225
268
|
},
|
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
|
-
rules: [
|
275
|
+
rules: [],
|
233
276
|
description: "Google's category of the item",
|
234
277
|
},
|
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
|
-
rules: [
|
284
|
+
rules: [],
|
242
285
|
description: 'Global Trade Item Number (GTIN) of the item',
|
243
286
|
choices: [
|
244
287
|
ShopifyProductSource.barcode,
|
@@ -249,10 +292,10 @@ 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
|
-
rules: [
|
298
|
+
rules: [],
|
256
299
|
description: 'Manufacturer Part Number (MPN) of the item',
|
257
300
|
choices: [
|
258
301
|
ShopifyProductSource.barcode,
|
@@ -263,22 +306,22 @@ 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' },
|
270
313
|
{ label: 'Dynamic remarketing ads', value: 'Display_ads' },
|
271
314
|
{ label: 'Free listings', value: 'Free_listings' },
|
272
315
|
],
|
273
|
-
rules: [
|
316
|
+
rules: [],
|
274
317
|
description: 'The list of destinations to include for this target (corresponds to checked check boxes in Merchant Center)',
|
275
318
|
},
|
276
319
|
{
|
277
320
|
required: false,
|
278
321
|
label: 'Shipping label',
|
279
|
-
attribute:
|
322
|
+
attribute: MAPPING_ATTRIBUTES.SHIPPING_LABEL,
|
280
323
|
type: 'text',
|
281
|
-
rules: [
|
324
|
+
rules: [],
|
282
325
|
description: 'The shipping label of the product, used to group product in account-level shipping rules',
|
283
326
|
},
|
284
327
|
// /**
|
@@ -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,eAAe,CAAC;AAC9C,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC;AACxC,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AACzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AACtD,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAC;AACjD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE/C,M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@@
|
|
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,mCAAmC,CAAC;
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/utils/profile.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAA8B;IAC/D,OAAO,KAAK;SACP,GAAG,CAAC,CAAC,CAAC,EAAE;QACL,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,IACI,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE;gBAChB,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS;gBAC9B,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ;gBAC5B,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,EACxB,CAAC;gBACC,OAAO,CAAC,CAAC,EAAE,CAAC;YAChB,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC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AQ,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpG,CAAC;IAED,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE;QAC/C,IAAI,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC;YAC1B,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpG,CAAC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
@@ -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,37 +198,37 @@ 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
|
-
rules: [
|
204
|
+
rules: [],
|
161
205
|
description: 'Language for the item',
|
162
206
|
},
|
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
|
-
rules: [
|
213
|
+
rules: [],
|
170
214
|
description: "The item's country of sale",
|
171
215
|
},
|
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 },
|
179
223
|
{ label: 'No', value: false },
|
180
224
|
],
|
181
|
-
rules: [
|
225
|
+
rules: [],
|
182
226
|
description: 'Should be set to "Yes" if the item is targeted towards adults',
|
183
227
|
},
|
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' },
|
@@ -193,13 +237,13 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
193
237
|
{ label: '5-13 years old', value: 'kids' },
|
194
238
|
{ label: '13 years old or more', value: 'adult' },
|
195
239
|
],
|
196
|
-
rules: [
|
240
|
+
rules: [],
|
197
241
|
description: 'Target age group of the item',
|
198
242
|
},
|
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' },
|
@@ -207,48 +251,48 @@ export const ProductUploadMappings: ProductUploadMapSource[] = [
|
|
207
251
|
{ label: 'Preorder', value: 'preorder' },
|
208
252
|
{ label: 'Backorder', value: 'backorder' },
|
209
253
|
],
|
210
|
-
rules: [
|
254
|
+
rules: [],
|
211
255
|
description: 'Availability status of the item',
|
212
256
|
},
|
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
|
-
rules: [
|
263
|
+
rules: [],
|
220
264
|
description: 'Brand of the item',
|
221
265
|
choices: [ShopifyProductSource.vendor, SOURCE_VENDORS, ShopifyProductSource.custom],
|
222
266
|
},
|
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' },
|
230
274
|
{ label: 'Female', value: 'female' },
|
231
275
|
{ label: 'Unisex', value: 'unisex' },
|
232
276
|
],
|
233
|
-
rules: [
|
277
|
+
rules: [],
|
234
278
|
description: 'Target gender of the item',
|
235
279
|
},
|
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
|
-
rules: [
|
286
|
+
rules: [],
|
243
287
|
description: "Google's category of the item",
|
244
288
|
},
|
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
|
-
rules: [
|
295
|
+
rules: [],
|
252
296
|
description: 'Global Trade Item Number (GTIN) of the item',
|
253
297
|
choices: [
|
254
298
|
ShopifyProductSource.barcode,
|
@@ -259,10 +303,10 @@ 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
|
-
rules: [
|
309
|
+
rules: [],
|
266
310
|
description: 'Manufacturer Part Number (MPN) of the item',
|
267
311
|
choices: [
|
268
312
|
ShopifyProductSource.barcode,
|
@@ -273,23 +317,23 @@ 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' },
|
280
324
|
{ label: 'Dynamic remarketing ads', value: 'Display_ads' },
|
281
325
|
{ label: 'Free listings', value: 'Free_listings' },
|
282
326
|
],
|
283
|
-
rules: [
|
327
|
+
rules: [],
|
284
328
|
description:
|
285
329
|
'The list of destinations to include for this target (corresponds to checked check boxes in Merchant Center)',
|
286
330
|
},
|
287
331
|
{
|
288
332
|
required: false,
|
289
333
|
label: 'Shipping label',
|
290
|
-
attribute:
|
334
|
+
attribute: MAPPING_ATTRIBUTES.SHIPPING_LABEL,
|
291
335
|
type: 'text',
|
292
|
-
rules: [
|
336
|
+
rules: [],
|
293
337
|
description: 'The shipping label of the product, used to group product in account-level shipping rules',
|
294
338
|
},
|
295
339
|
|
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
|
}
|