feed-common 1.49.2 → 1.49.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/constants/profile.constants.d.ts +2 -2
  3. package/dist/constants/profile.constants.d.ts.map +1 -1
  4. package/dist/constants/profile.constants.js +146 -145
  5. package/dist/constants/profile.constants.js.map +1 -1
  6. package/dist/types/profile.types.d.ts +3 -5
  7. package/dist/types/profile.types.d.ts.map +1 -1
  8. package/dist/utils/feed-templates/facebook.template.d.ts.map +1 -1
  9. package/dist/utils/feed-templates/facebook.template.js +2 -0
  10. package/dist/utils/feed-templates/facebook.template.js.map +1 -1
  11. package/dist/utils/feed-templates/google-api.template.d.ts.map +1 -1
  12. package/dist/utils/feed-templates/google-api.template.js +8 -0
  13. package/dist/utils/feed-templates/google-api.template.js.map +1 -1
  14. package/dist/utils/feed-templates/google.template.d.ts.map +1 -1
  15. package/dist/utils/feed-templates/google.template.js +10 -0
  16. package/dist/utils/feed-templates/google.template.js.map +1 -1
  17. package/dist/utils/feed-templates/microsoft.template.d.ts.map +1 -1
  18. package/dist/utils/feed-templates/microsoft.template.js +3 -0
  19. package/dist/utils/feed-templates/microsoft.template.js.map +1 -1
  20. package/dist/utils/feed-templates/tiktok.template.d.ts.map +1 -1
  21. package/dist/utils/feed-templates/tiktok.template.js +2 -0
  22. package/dist/utils/feed-templates/tiktok.template.js.map +1 -1
  23. package/dist/utils/profile.d.ts +0 -7
  24. package/dist/utils/profile.d.ts.map +1 -1
  25. package/dist/utils/profile.js +57 -52
  26. package/dist/utils/profile.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/constants/profile.constants.ts +149 -146
  29. package/src/types/profile.types.ts +3 -5
  30. package/src/utils/feed-templates/facebook.template.ts +2 -0
  31. package/src/utils/feed-templates/google-api.template.ts +8 -0
  32. package/src/utils/feed-templates/google.template.ts +10 -0
  33. package/src/utils/feed-templates/microsoft.template.ts +3 -0
  34. package/src/utils/feed-templates/tiktok.template.ts +2 -0
  35. package/src/utils/profile.ts +62 -62
  36. package/tests/profile.spec.ts +765 -755
@@ -1,4 +1,4 @@
1
- import { MappingSourceValueType, ProductUploadMappings, RULES_OPERATORS } from '../constants/profile.constants.js';
1
+ import { MappingSourceValueType, RULES_OPERATORS } from '../constants/profile.constants.js';
2
2
  import { code } from './utils.js';
3
3
  /**
4
4
  * Check for rules duplication
@@ -111,29 +111,29 @@ export function getOperatorCounterpart(operator) {
111
111
  export function getEmptyRuleItem(attribute = '') {
112
112
  return { attribute, operator: '', value: '', id: code() };
113
113
  }
114
- export function sortMappings(a, b) {
115
- if (!a.attribute) {
116
- return 1;
117
- }
118
- if (!b.attribute) {
119
- return -1;
120
- }
121
- const sourceA = ProductUploadMappings.find(m => m.attribute === a.attribute);
122
- const sourceB = ProductUploadMappings.find(m => m.attribute === b.attribute);
123
- if (sourceA?.required && !sourceB?.required) {
124
- return -1;
125
- }
126
- if (sourceB?.required && !sourceA?.required) {
127
- return 1;
128
- }
129
- if (a.attribute < b.attribute) {
130
- return -1;
131
- }
132
- if (a.attribute > b.attribute) {
133
- return 1;
134
- }
135
- return 0;
136
- }
114
+ // export function sortMappings(a: ProductUploadMapping, b: ProductUploadMapping): number {
115
+ // if (!a.attribute) {
116
+ // return 1;
117
+ // }
118
+ // if (!b.attribute) {
119
+ // return -1;
120
+ // }
121
+ // const sourceA = ProductUploadMappings.find(m => m.attribute === a.attribute);
122
+ // const sourceB = ProductUploadMappings.find(m => m.attribute === b.attribute);
123
+ // if (sourceA?.required && !sourceB?.required) {
124
+ // return -1;
125
+ // }
126
+ // if (sourceB?.required && !sourceA?.required) {
127
+ // return 1;
128
+ // }
129
+ // if (a.attribute < b.attribute) {
130
+ // return -1;
131
+ // }
132
+ // if (a.attribute > b.attribute) {
133
+ // return 1;
134
+ // }
135
+ // return 0;
136
+ // }
137
137
  export function hasRules(rules) {
138
138
  return Array.isArray(rules?.sections) && rules.sections.some(section => section.ruleItems.length > 0);
139
139
  }
@@ -208,34 +208,39 @@ export function optionIsItem(option) {
208
208
  export function optionIsGroup(option) {
209
209
  return typeof option !== 'string' && 'options' in option;
210
210
  }
211
- export function detectProfileChange(a, b) {
212
- const changes = {
213
- name: false,
214
- rules: false,
215
- mappings: false,
216
- id: false,
217
- };
218
- if (a.name !== b.name) {
219
- changes.name = true;
220
- }
221
- if (ProductUploadMappings.filter(m => m.required)
222
- .map(m => m.attribute)
223
- .some(key => {
224
- const mappingA = a.mappings?.filter(m => m.attribute === key) ?? [];
225
- const mappingB = b.mappings?.filter(m => m.attribute === key) ?? [];
226
- return !compareMappings(mappingA, mappingB);
227
- })) {
228
- changes.id = true;
229
- }
230
- const requiredAttrs = ProductUploadMappings.filter(m => m.required).map(m => m.attribute);
231
- const mappingsA = a.mappings?.filter(m => !requiredAttrs.includes(m.attribute));
232
- const mappingsB = b.mappings?.filter(m => !requiredAttrs.includes(m.attribute));
233
- changes.mappings = !compareMappings(mappingsA, mappingsB);
234
- if (!compareRules(a.rules, b.rules)) {
235
- changes.rules = true;
236
- }
237
- return changes;
238
- }
211
+ // export function detectProfileChange(
212
+ // a: ProductUploadProfile,
213
+ // b: ProductUploadProfile
214
+ // ): { name: boolean; rules: boolean; mappings: boolean; id: boolean } {
215
+ // const changes = {
216
+ // name: false,
217
+ // rules: false,
218
+ // mappings: false,
219
+ // id: false,
220
+ // };
221
+ // if (a.name !== b.name) {
222
+ // changes.name = true;
223
+ // }
224
+ // if (
225
+ // ProductUploadMappings.filter(m => m.required)
226
+ // .map(m => m.attribute)
227
+ // .some(key => {
228
+ // const mappingA = a.mappings?.filter(m => m.attribute === key) ?? [];
229
+ // const mappingB = b.mappings?.filter(m => m.attribute === key) ?? [];
230
+ // return !compareMappings(mappingA, mappingB);
231
+ // })
232
+ // ) {
233
+ // changes.id = true;
234
+ // }
235
+ // const requiredAttrs = ProductUploadMappings.filter(m => m.required).map(m => m.attribute);
236
+ // const mappingsA = a.mappings?.filter(m => !requiredAttrs.includes(m.attribute));
237
+ // const mappingsB = b.mappings?.filter(m => !requiredAttrs.includes(m.attribute));
238
+ // changes.mappings = !compareMappings(mappingsA, mappingsB);
239
+ // if (!compareRules(a.rules, b.rules)) {
240
+ // changes.rules = true;
241
+ // }
242
+ // return changes;
243
+ // }
239
244
  export function sanitizeUploadProfile(profile) {
240
245
  if (profile.rules?.sections) {
241
246
  profile.rules.sections = profile.rules.sections.filter(section => section.ruleItems.length > 0);
@@ -1 +1 @@
1
- {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/utils/profile.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACnH,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;IAChB,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAa,CAAC;AACrC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAA8B;IAC9D,OAAO,KAAK;SACP,GAAG,CAAC,CAAC,CAAC,EAAE;QACL,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,IAAI,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;gBACvB,OAAO,CAAC,CAAC,EAAE,CAAC;YAChB,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AC,EAAE,CAAC;QACvD,OAAO,sBAAsB,CAAC,KAAK,CAAC;IACxC,CAAC;IAED,OAAO,sBAAsB,CAAC,GAAG,CAAC;AACtC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feed-common",
3
- "version": "1.49.2",
3
+ "version": "1.49.4",
4
4
  "description": "Maxify feed common library",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,4 +1,5 @@
1
- import { ProductUploadMapSource, ProductUploadRuleFilterType } from '../types/profile.types.js';
1
+ /* eslint-disable max-len */
2
+ import { ProductUploadRuleFilterType } from '../types/profile.types.js';
2
3
 
3
4
  export const SOURCE_VENDORS = 'source.vendor';
4
5
  export const SOURCE_TAGS = 'source.tag';
@@ -374,151 +375,151 @@ export const ShopifyProductSource = {
374
375
  custom: { label: 'Custom input', value: SOURCE_CUSTOM, type: MappingSourceValueType.STRING },
375
376
  };
376
377
 
377
- export const ProductUploadMappings: ProductUploadMapSource[] = [
378
- {
379
- required: true,
380
- label: 'Content Language',
381
- attribute: MAPPING_ATTRIBUTES.CONTENT_LANGUAGE,
382
- type: 'select',
383
- choices: [SOURCE_LANGUAGE],
384
- rules: { sections: [] },
385
- description: 'Language for the item',
386
- },
387
- {
388
- required: true,
389
- label: 'Target Country',
390
- attribute: MAPPING_ATTRIBUTES.TARGET_COUNTRY,
391
- type: 'select',
392
- choices: [SOURCE_COUNTRY],
393
- rules: { sections: [] },
394
- // eslint-disable-next-line quotes
395
- description: "The item's country of sale",
396
- },
397
- {
398
- required: false,
399
- label: 'Adult',
400
- attribute: MAPPING_ATTRIBUTES.ADULT,
401
- type: 'select',
402
- choices: [
403
- { label: 'Yes', value: true },
404
- { label: 'No', value: false },
405
- ],
406
- rules: { sections: [] },
407
- description: 'Should be set to "Yes" if the item is targeted towards adults',
408
- },
409
- {
410
- required: false,
411
- label: 'Age Group',
412
- attribute: MAPPING_ATTRIBUTES.AGE_GROUP,
413
- type: 'select',
414
- choices: [
415
- { label: '0-3 months old', value: 'newborn' },
416
- { label: '3-12 months old', value: 'infant' },
417
- { label: '1-5 years old', value: 'toddler' },
418
- { label: '5-13 years old', value: 'kids' },
419
- { label: '13 years old or more', value: 'adult' },
420
- ],
421
- rules: { sections: [] },
422
- description: 'Target age group of the item',
423
- },
424
- {
425
- required: true,
426
- label: 'Availability',
427
- attribute: MAPPING_ATTRIBUTES.AVAILABILITY,
428
- type: 'select',
429
- choices: [
430
- { label: 'In Stock', value: 'in_stock' },
431
- { label: 'Out Of Stock', value: 'out_of_stock' },
432
- { label: 'Preorder', value: 'preorder' },
433
- { label: 'Backorder', value: 'backorder' },
434
- ],
435
- rules: { sections: [] },
436
- description: 'Availability status of the item',
437
- },
438
- {
439
- required: false,
440
- label: 'Brand',
441
- attribute: MAPPING_ATTRIBUTES.BRAND,
442
- type: 'select',
443
- defaultValue: 'shopify.vendor',
444
- rules: { sections: [] },
445
- description: 'Brand of the item',
446
- choices: [ShopifyProductSource.vendor, SOURCE_VENDORS, ShopifyProductSource.custom],
447
- },
448
- {
449
- required: false,
450
- label: 'Gender',
451
- attribute: MAPPING_ATTRIBUTES.GENDER,
452
- type: 'select',
453
- choices: [
454
- { label: 'Male', value: 'male' },
455
- { label: 'Female', value: 'female' },
456
- { label: 'Unisex', value: 'unisex' },
457
- ],
458
- rules: { sections: [] },
459
- description: 'Target gender of the item',
460
- },
461
- // {
462
- // required: false,
463
- // label: 'Google category',
464
- // attribute: MAPPING_ATTRIBUTES.GOOGLE_PRODUCT_CATEGORY,
465
- // type: 'select',
466
- // choices: [SOURCE_GOOGLE_CATEGORY],
467
- // rules: { sections: [] },
468
- // description: 'Google\'s category of the item',
469
- // },
470
- {
471
- required: false,
472
- label: 'GTIN',
473
- attribute: MAPPING_ATTRIBUTES.GTIN,
474
- type: 'select',
475
- defaultValue: 'shopify.vendor',
476
- rules: { sections: [] },
477
- description: 'Global Trade Item Number (GTIN) of the item',
478
- choices: [
479
- ShopifyProductSource.barcode,
480
- ShopifyProductSource.sku,
481
- { label: 'Custom input', value: SOURCE_CUSTOM },
482
- ],
483
- },
484
- {
485
- required: false,
486
- label: 'MPN',
487
- attribute: MAPPING_ATTRIBUTES.MPN,
488
- type: 'select',
489
- defaultValue: 'shopify.vendor',
490
- rules: { sections: [] },
491
- description: 'Manufacturer Part Number (MPN) of the item',
492
- choices: [
493
- ShopifyProductSource.barcode,
494
- ShopifyProductSource.sku,
495
- { label: 'Custom input', value: SOURCE_CUSTOM },
496
- ],
497
- },
498
- {
499
- required: false,
500
- label: 'Included Destinations',
501
- attribute: MAPPING_ATTRIBUTES.INCLUDED_DESTINATIONS,
502
- type: 'multiselect',
503
- choices: [
504
- { label: 'Shopping ads', value: 'Shopping_ads' },
505
- { label: 'Dynamic remarketing ads', value: 'Display_ads' },
506
- { label: 'Free listings', value: 'Free_listings' },
507
- ],
508
- rules: { sections: [] },
509
- description:
510
- // eslint-disable-next-line max-len
511
- 'The list of destinations to include for this target (corresponds to checked check boxes in Merchant Center)',
512
- },
513
- {
514
- required: false,
515
- label: 'Shipping label',
516
- attribute: MAPPING_ATTRIBUTES.SHIPPING_LABEL,
517
- type: 'text',
518
- rules: { sections: [] },
519
- description: 'The shipping label of the product, used to group product in account-level shipping rules',
520
- },
521
- ];
378
+ // export const ProductUploadMappings: ProductUploadMapSource[] = [
379
+ // {
380
+ // required: true,
381
+ // label: 'Content Language',
382
+ // attribute: MAPPING_ATTRIBUTES.CONTENT_LANGUAGE,
383
+ // type: 'select',
384
+ // choices: [SOURCE_LANGUAGE],
385
+ // rules: { sections: [] },
386
+ // description: 'Language for the item',
387
+ // },
388
+ // {
389
+ // required: true,
390
+ // label: 'Target Country',
391
+ // attribute: MAPPING_ATTRIBUTES.TARGET_COUNTRY,
392
+ // type: 'select',
393
+ // choices: [SOURCE_COUNTRY],
394
+ // rules: { sections: [] },
395
+ // // eslint-disable-next-line quotes
396
+ // description: "The item's country of sale",
397
+ // },
398
+ // {
399
+ // required: false,
400
+ // label: 'Adult',
401
+ // attribute: MAPPING_ATTRIBUTES.ADULT,
402
+ // type: 'select',
403
+ // choices: [
404
+ // { label: 'Yes', value: true },
405
+ // { label: 'No', value: false },
406
+ // ],
407
+ // rules: { sections: [] },
408
+ // description: 'Should be set to "Yes" if the item is targeted towards adults',
409
+ // },
410
+ // {
411
+ // required: false,
412
+ // label: 'Age Group',
413
+ // attribute: MAPPING_ATTRIBUTES.AGE_GROUP,
414
+ // type: 'select',
415
+ // choices: [
416
+ // { label: '0-3 months old', value: 'newborn' },
417
+ // { label: '3-12 months old', value: 'infant' },
418
+ // { label: '1-5 years old', value: 'toddler' },
419
+ // { label: '5-13 years old', value: 'kids' },
420
+ // { label: '13 years old or more', value: 'adult' },
421
+ // ],
422
+ // rules: { sections: [] },
423
+ // description: 'Target age group of the item',
424
+ // },
425
+ // {
426
+ // required: true,
427
+ // label: 'Availability',
428
+ // attribute: MAPPING_ATTRIBUTES.AVAILABILITY,
429
+ // type: 'select',
430
+ // choices: [
431
+ // { label: 'In Stock', value: 'in_stock' },
432
+ // { label: 'Out Of Stock', value: 'out_of_stock' },
433
+ // { label: 'Preorder', value: 'preorder' },
434
+ // { label: 'Backorder', value: 'backorder' },
435
+ // ],
436
+ // rules: { sections: [] },
437
+ // description: 'Availability status of the item',
438
+ // },
439
+ // {
440
+ // required: false,
441
+ // label: 'Brand',
442
+ // attribute: MAPPING_ATTRIBUTES.BRAND,
443
+ // type: 'select',
444
+ // defaultValue: 'shopify.vendor',
445
+ // rules: { sections: [] },
446
+ // description: 'Brand of the item',
447
+ // choices: [ShopifyProductSource.vendor, SOURCE_VENDORS, ShopifyProductSource.custom],
448
+ // },
449
+ // {
450
+ // required: false,
451
+ // label: 'Gender',
452
+ // attribute: MAPPING_ATTRIBUTES.GENDER,
453
+ // type: 'select',
454
+ // choices: [
455
+ // { label: 'Male', value: 'male' },
456
+ // { label: 'Female', value: 'female' },
457
+ // { label: 'Unisex', value: 'unisex' },
458
+ // ],
459
+ // rules: { sections: [] },
460
+ // description: 'Target gender of the item',
461
+ // },
462
+ // // {
463
+ // // required: false,
464
+ // // label: 'Google category',
465
+ // // attribute: MAPPING_ATTRIBUTES.GOOGLE_PRODUCT_CATEGORY,
466
+ // // type: 'select',
467
+ // // choices: [SOURCE_GOOGLE_CATEGORY],
468
+ // // rules: { sections: [] },
469
+ // // description: 'Google\'s category of the item',
470
+ // // },
471
+ // {
472
+ // required: false,
473
+ // label: 'GTIN',
474
+ // attribute: MAPPING_ATTRIBUTES.GTIN,
475
+ // type: 'select',
476
+ // defaultValue: 'shopify.vendor',
477
+ // rules: { sections: [] },
478
+ // description: 'Global Trade Item Number (GTIN) of the item',
479
+ // choices: [
480
+ // ShopifyProductSource.barcode,
481
+ // ShopifyProductSource.sku,
482
+ // { label: 'Custom input', value: SOURCE_CUSTOM },
483
+ // ],
484
+ // },
485
+ // {
486
+ // required: false,
487
+ // label: 'MPN',
488
+ // attribute: MAPPING_ATTRIBUTES.MPN,
489
+ // type: 'select',
490
+ // defaultValue: 'shopify.vendor',
491
+ // rules: { sections: [] },
492
+ // description: 'Manufacturer Part Number (MPN) of the item',
493
+ // choices: [
494
+ // ShopifyProductSource.barcode,
495
+ // ShopifyProductSource.sku,
496
+ // { label: 'Custom input', value: SOURCE_CUSTOM },
497
+ // ],
498
+ // },
499
+ // {
500
+ // required: false,
501
+ // label: 'Included Destinations',
502
+ // attribute: MAPPING_ATTRIBUTES.INCLUDED_DESTINATIONS,
503
+ // type: 'multiselect',
504
+ // choices: [
505
+ // { label: 'Shopping ads', value: 'Shopping_ads' },
506
+ // { label: 'Dynamic remarketing ads', value: 'Display_ads' },
507
+ // { label: 'Free listings', value: 'Free_listings' },
508
+ // ],
509
+ // rules: { sections: [] },
510
+ // description:
511
+ // // eslint-disable-next-line max-len
512
+ // 'The list of destinations to include for this target (corresponds to checked check boxes in Merchant Center)',
513
+ // },
514
+ // {
515
+ // required: false,
516
+ // label: 'Shipping label',
517
+ // attribute: MAPPING_ATTRIBUTES.SHIPPING_LABEL,
518
+ // type: 'text',
519
+ // rules: { sections: [] },
520
+ // description: 'The shipping label of the product, used to group product in account-level shipping rules',
521
+ // },
522
+ // ];
522
523
  export const CHANNEL = 'online';
523
524
  export const GMC_PRODUCT_ID_TEMPLATE = '{PRODUCT_ID}_{VARIANT_ID}';
524
525
  export const ProfileIdTemplateCodes = ['PRODUCT_ID', 'VARIANT_ID', 'COUNTRY', 'LANGUAGE'];
@@ -539,3 +540,5 @@ export enum XMLFeedType {
539
540
  TikTok = 'TikTok',
540
541
  Microsoft = 'Microsoft',
541
542
  }
543
+
544
+ export const GmcApiConstAttrs = ['targetCounty', 'contentLanguage', 'offerId'];
@@ -1,4 +1,4 @@
1
- import { ProductUploadMappings, RuleOperators, XmlFeedFormat, XMLFeedType } from '../constants/profile.constants.js';
1
+ import { RuleOperators, XmlFeedFormat, XMLFeedType } from '../constants/profile.constants.js';
2
2
  import { SafeParseReturnType } from 'zod';
3
3
 
4
4
  export type SelectItem = { label: string; value: string };
@@ -26,7 +26,7 @@ export type ProductUploadMapSource = {
26
26
  choices?: OptionType[];
27
27
  rules: ProductUploadRules;
28
28
  description?: string;
29
- defaultValue?: ValueType;
29
+ defaultValue: ValueType;
30
30
  validator?: (v: string | number) => SafeParseReturnType<any, any>;
31
31
  show?: () => boolean;
32
32
  allowDuplicates?: boolean;
@@ -46,13 +46,11 @@ export type ProductUploadMapSource = {
46
46
 
47
47
  export type ProductUploadMapping = {
48
48
  id: string;
49
- attribute: MappingFields;
49
+ attribute: string;
50
50
  value: ValueType;
51
51
  rules: ProductUploadRules;
52
52
  };
53
53
 
54
- type MappingFields = (typeof ProductUploadMappings)[number]['attribute'];
55
-
56
54
  export type BaseProductUploadProfile = {
57
55
  id: string;
58
56
  type: XMLFeedType;
@@ -16,6 +16,7 @@ const availabilityMapping = {
16
16
  type: 'macro-input' as any,
17
17
  validator: (v: string | number) => validateIfNoMacro(v, z.enum(['in stock', 'out of stock'])),
18
18
  baseMode: true,
19
+ defaultValue: '',
19
20
  };
20
21
 
21
22
  const conditionMapping = {
@@ -26,6 +27,7 @@ const conditionMapping = {
26
27
  type: 'macro-input' as any,
27
28
  validator: (v: string | number) => validateIfNoMacro(v, z.enum(['new', 'refurbished', 'used'])),
28
29
  baseMode: true,
30
+ defaultValue: '',
29
31
  };
30
32
 
31
33
  const videoMapping = {
@@ -18,6 +18,7 @@ const availabilityMapping: ProductUploadMapSource = {
18
18
  validateIfNoMacro(v, z.enum(['in_stock', 'out_of_stock', 'preorder', 'backorder'])),
19
19
  rules: { sections: [] },
20
20
  baseMode: true,
21
+ defaultValue: '',
21
22
  };
22
23
 
23
24
  const customLabelMapping: ProductUploadMapSource = {
@@ -608,6 +609,7 @@ export const googleApiTemplate: XmlFeedTemplateType = {
608
609
  // TODO: add to check if product is apparel
609
610
  validator: (v: string | number) => validateIfNoMacro(v, z.string().max(100)),
610
611
  rules: { sections: [] },
612
+ defaultValue: '',
611
613
  },
612
614
  {
613
615
  attribute: 'gender',
@@ -619,6 +621,7 @@ export const googleApiTemplate: XmlFeedTemplateType = {
619
621
  // TODO: add to check if product is apparel
620
622
  validator: (v: string | number) => validateIfNoMacro(v, z.enum(['male', 'female', 'unisex', ''])),
621
623
  rules: { sections: [] },
624
+ defaultValue: '',
622
625
  },
623
626
  {
624
627
  attribute: 'material',
@@ -629,6 +632,7 @@ export const googleApiTemplate: XmlFeedTemplateType = {
629
632
  type: 'macro-input',
630
633
  validator: (v: string | number) => validateIfNoMacro(v, z.string().max(200)),
631
634
  rules: { sections: [] },
635
+ defaultValue: '',
632
636
  },
633
637
  {
634
638
  attribute: 'pattern',
@@ -639,6 +643,7 @@ export const googleApiTemplate: XmlFeedTemplateType = {
639
643
  type: 'macro-input',
640
644
  validator: (v: string | number) => validateIfNoMacro(v, z.string().max(100)),
641
645
  rules: { sections: [] },
646
+ defaultValue: '',
642
647
  },
643
648
  {
644
649
  attribute: 'sizes',
@@ -650,6 +655,7 @@ export const googleApiTemplate: XmlFeedTemplateType = {
650
655
  // TODO: add to check if product is apparel
651
656
  validator: (v: string | number) => validateIfNoMacro(v, z.string().max(100)),
652
657
  rules: { sections: [] },
658
+ defaultValue: '',
653
659
  },
654
660
  {
655
661
  attribute: 'sizeType',
@@ -661,6 +667,7 @@ export const googleApiTemplate: XmlFeedTemplateType = {
661
667
  validator: (v: string | number) =>
662
668
  validateIfNoMacro(v, z.enum(['regular', 'petite', 'maternity', 'big', 'tall', 'plus', ''])),
663
669
  rules: { sections: [] },
670
+ defaultValue: '',
664
671
  },
665
672
  {
666
673
  attribute: 'sizeSystem',
@@ -672,6 +679,7 @@ export const googleApiTemplate: XmlFeedTemplateType = {
672
679
  validator: (v: string | number) =>
673
680
  validateIfNoMacro(v, z.enum(['US', 'EU', 'UK', 'DE', 'FR', 'JP', 'CN', 'IT', 'BR', 'MEX', 'AU', ''])),
674
681
  rules: { sections: [] },
682
+ defaultValue: '',
675
683
  },
676
684
  {
677
685
  attribute: 'itemGroupId',