feed-common 1.77.1 → 1.77.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/.vscode/settings.json +1 -1
  2. package/CHANGELOG.md +14 -0
  3. package/dist/constants/profile.constants.d.ts +12 -0
  4. package/dist/constants/profile.constants.d.ts.map +1 -1
  5. package/dist/constants/profile.constants.js +39 -1
  6. package/dist/constants/profile.constants.js.map +1 -1
  7. package/dist/index.d.ts +11 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +11 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/sources/country.source.d.ts +5 -0
  12. package/dist/sources/country.source.d.ts.map +1 -0
  13. package/dist/sources/country.source.js +78 -0
  14. package/dist/sources/country.source.js.map +1 -0
  15. package/dist/sources/currency.source.d.ts.map +1 -1
  16. package/dist/sources/currency.source.js +0 -1
  17. package/dist/sources/currency.source.js.map +1 -1
  18. package/dist/sources/ebay-gallery-type.source.d.ts +5 -0
  19. package/dist/sources/ebay-gallery-type.source.d.ts.map +1 -0
  20. package/dist/sources/ebay-gallery-type.source.js +5 -0
  21. package/dist/sources/ebay-gallery-type.source.js.map +1 -0
  22. package/dist/sources/ebay-inventory-tracking.source.d.ts +3 -0
  23. package/dist/sources/ebay-inventory-tracking.source.d.ts.map +1 -0
  24. package/dist/sources/ebay-inventory-tracking.source.js +11 -0
  25. package/dist/sources/ebay-inventory-tracking.source.js.map +1 -0
  26. package/dist/sources/ebay-listing-type.source.d.ts +5 -0
  27. package/dist/sources/ebay-listing-type.source.d.ts.map +1 -0
  28. package/dist/sources/ebay-listing-type.source.js +5 -0
  29. package/dist/sources/ebay-listing-type.source.js.map +1 -0
  30. package/dist/sources/ebay-yes-no.source.d.ts +5 -0
  31. package/dist/sources/ebay-yes-no.source.d.ts.map +1 -0
  32. package/dist/sources/ebay-yes-no.source.js +2 -0
  33. package/dist/sources/ebay-yes-no.source.js.map +1 -0
  34. package/dist/sources/google-availability.source.d.ts +5 -0
  35. package/dist/sources/google-availability.source.d.ts.map +1 -0
  36. package/dist/sources/google-availability.source.js +7 -0
  37. package/dist/sources/google-availability.source.js.map +1 -0
  38. package/dist/sources/language.source.d.ts +5 -0
  39. package/dist/sources/language.source.d.ts.map +1 -0
  40. package/dist/sources/language.source.js +31 -0
  41. package/dist/sources/language.source.js.map +1 -0
  42. package/dist/utils/feed-templates/{index.d.ts → common-schemas.d.ts} +24 -29
  43. package/dist/utils/feed-templates/common-schemas.d.ts.map +1 -0
  44. package/dist/utils/feed-templates/{index.js → common-schemas.js} +668 -176
  45. package/dist/utils/feed-templates/common-schemas.js.map +1 -0
  46. package/dist/utils/feed-templates/common.d.ts +20 -0
  47. package/dist/utils/feed-templates/common.d.ts.map +1 -0
  48. package/dist/utils/feed-templates/common.js +60 -0
  49. package/dist/utils/feed-templates/common.js.map +1 -0
  50. package/dist/utils/feed-templates/ebay.template.d.ts +1 -1
  51. package/dist/utils/feed-templates/ebay.template.d.ts.map +1 -1
  52. package/dist/utils/feed-templates/ebay.template.js +189 -2
  53. package/dist/utils/feed-templates/ebay.template.js.map +1 -1
  54. package/dist/utils/feed-templates/facebook.template.d.ts.map +1 -1
  55. package/dist/utils/feed-templates/facebook.template.js +2 -1
  56. package/dist/utils/feed-templates/facebook.template.js.map +1 -1
  57. package/dist/utils/feed-templates/google-api.template.d.ts.map +1 -1
  58. package/dist/utils/feed-templates/google-api.template.js +19 -7
  59. package/dist/utils/feed-templates/google-api.template.js.map +1 -1
  60. package/dist/utils/feed-templates/google.template.d.ts.map +1 -1
  61. package/dist/utils/feed-templates/google.template.js +7 -15
  62. package/dist/utils/feed-templates/google.template.js.map +1 -1
  63. package/dist/utils/feed-templates/microsoft.template.d.ts.map +1 -1
  64. package/dist/utils/feed-templates/microsoft.template.js +11 -7
  65. package/dist/utils/feed-templates/microsoft.template.js.map +1 -1
  66. package/dist/utils/feed-templates/template-utils.d.ts +4 -0
  67. package/dist/utils/feed-templates/template-utils.d.ts.map +1 -0
  68. package/dist/utils/feed-templates/template-utils.js +29 -0
  69. package/dist/utils/feed-templates/template-utils.js.map +1 -0
  70. package/dist/utils/feed-templates/tiktok.template.d.ts.map +1 -1
  71. package/dist/utils/feed-templates/tiktok.template.js +2 -1
  72. package/dist/utils/feed-templates/tiktok.template.js.map +1 -1
  73. package/dist/utils/profile.d.ts +2 -1
  74. package/dist/utils/profile.d.ts.map +1 -1
  75. package/dist/utils/profile.js +82 -1
  76. package/dist/utils/profile.js.map +1 -1
  77. package/dist/utils/utils.d.ts +2 -0
  78. package/dist/utils/utils.d.ts.map +1 -1
  79. package/dist/utils/utils.js +23 -3
  80. package/dist/utils/utils.js.map +1 -1
  81. package/package.json +5 -4
  82. package/src/constants/profile.constants.ts +39 -1
  83. package/src/index.ts +11 -1
  84. package/src/sources/country.source.ts +77 -0
  85. package/src/sources/currency.source.ts +0 -1
  86. package/src/sources/ebay-gallery-type.source.ts +4 -0
  87. package/src/sources/ebay-inventory-tracking.source.ts +12 -0
  88. package/src/sources/ebay-listing-type.source.ts +4 -0
  89. package/src/sources/ebay-yes-no.source.ts +1 -0
  90. package/src/sources/google-availability.source.ts +6 -0
  91. package/src/sources/language.source.ts +30 -0
  92. package/src/utils/feed-templates/common-schemas.ts +1014 -0
  93. package/src/utils/feed-templates/common.ts +82 -0
  94. package/src/utils/feed-templates/ebay.template.ts +215 -4
  95. package/src/utils/feed-templates/facebook.template.ts +2 -1
  96. package/src/utils/feed-templates/google-api.template.ts +54 -29
  97. package/src/utils/feed-templates/google.template.ts +46 -52
  98. package/src/utils/feed-templates/microsoft.template.ts +26 -21
  99. package/src/utils/feed-templates/template-utils.ts +30 -0
  100. package/src/utils/feed-templates/tiktok.template.ts +4 -2
  101. package/src/utils/profile.ts +116 -2
  102. package/src/utils/utils.ts +25 -5
  103. package/tests/company.spec.ts +39 -39
  104. package/tests/profile-utils.spec.ts +38 -0
  105. package/tests/validator.spec.ts +1 -5
  106. package/dist/utils/feed-templates/index.d.ts.map +0 -1
  107. package/dist/utils/feed-templates/index.js.map +0 -1
  108. package/src/utils/feed-templates/index.ts +0 -514
@@ -1,9 +1,10 @@
1
1
  /* eslint-disable max-len */
2
- import { dateRangeSchema, measureUnitsSchema, priceSchema, validate, validateIfNoMacro } from './index.js';
3
- import { SOURCE_LANGUAGE, XmlFeedFormat } from '../../constants/profile.constants.js';
2
+ import { validate, validateIfNoMacro } from './common-schemas.js';
3
+ import { XmlFeedFormat } from '../../constants/profile.constants.js';
4
4
  import { z } from 'zod';
5
5
  import { ulid } from 'ulid';
6
6
  import { ProductUploadMapSource, XmlFeedTemplateType } from '../../types/profile.types.js';
7
+ import { dateRangeSchema, measureUnitsSchema, priceSchema } from './common-schemas.js';
7
8
 
8
9
  const availabilityMapping: ProductUploadMapSource = {
9
10
  attribute: 'availability',
@@ -180,7 +181,8 @@ export const microsoftTemplate: XmlFeedTemplateType = {
180
181
  rules: { sections: [] },
181
182
  singleChoice: true,
182
183
  fixedValue: true,
183
- validator: v => validateIfNoMacro(v, z.enum(['newborn', 'infant', 'toddler', 'kids', 'adult', '']).optional()),
184
+ validator: v =>
185
+ validateIfNoMacro(v, z.enum(['newborn', 'infant', 'toddler', 'kids', 'adult', '']).optional()),
184
186
  },
185
187
  {
186
188
  attribute: 'color',
@@ -253,13 +255,7 @@ export const microsoftTemplate: XmlFeedTemplateType = {
253
255
  type: 'macro-input',
254
256
  defaultValue: '{{shopify.images}}',
255
257
  rules: { sections: [] },
256
- validator: (v: string | number) =>
257
- validate(
258
- v,
259
- z
260
- .string()
261
- .optional()
262
- ),
258
+ validator: (v: string | number) => validate(v, z.string().optional()),
263
259
  },
264
260
  {
265
261
  attribute: 'item_group_id',
@@ -421,8 +417,10 @@ export const microsoftTemplate: XmlFeedTemplateType = {
421
417
  v,
422
418
  z
423
419
  .string()
424
- .refine(v => !v || z.string().datetime({ offset: true }).safeParse(v).success, { message: 'invalid date' })
425
- .refine(v => !v || new Date(v).getTime() < (1000 * 60 * 60 * 24 * 30 + new Date().getTime()), {
420
+ .refine(v => !v || z.string().datetime({ offset: true }).safeParse(v).success, {
421
+ message: 'invalid date',
422
+ })
423
+ .refine(v => !v || new Date(v).getTime() < 1000 * 60 * 60 * 24 * 30 + new Date().getTime(), {
426
424
  message: 'The date should be less than 30 days in the future',
427
425
  })
428
426
  ),
@@ -437,17 +435,24 @@ export const microsoftTemplate: XmlFeedTemplateType = {
437
435
  'The monthly installment plan for a product, displayed by the number of months. The installment amount must be greater than 0.00 USD. The installment attribute is available only for mobile and tablet category of products. For any other categories, the installment attribute will be ignored. The price attribute is the up-front payment and the installment attribute is the monthly installments. If you have a single product with both full price and installment price, add two rows for the same product in the feed: One row will be for the full price to be submitted in the price field, The other row will be for the installment price, with the upfront cost in the price field and the installment months and price in the installment field. months: The number of installments, displayed as an integer with a range from 1 to 1000. amount: The amount paid per month, displayed as a number greater than 0 with two decimals in the local currency, with no symbols. Example: 12:15 USD',
438
436
  required: false,
439
437
  type: 'macro-input',
440
- validator: (v: string | number) => validateIfNoMacro(v, z.string().optional().refine(v => {
441
- if (!v) return true;
442
- const [months, amount] = v.split(':');
443
- if (!months || !amount) return false;
438
+ validator: (v: string | number) =>
439
+ validateIfNoMacro(
440
+ v,
441
+ z
442
+ .string()
443
+ .optional()
444
+ .refine(v => {
445
+ if (!v) return true;
446
+ const [months, amount] = v.split(':');
447
+ if (!months || !amount) return false;
444
448
 
445
- if (!priceSchema().safeParse(amount).success) {
446
- return false
447
- }
449
+ if (!priceSchema().safeParse(amount).success) {
450
+ return false;
451
+ }
448
452
 
449
- return true;
450
- })),
453
+ return true;
454
+ })
455
+ ),
451
456
  defaultValue: '{{source.google_instalment:}}',
452
457
  fixedValue: true,
453
458
  rules: { sections: [] },
@@ -0,0 +1,30 @@
1
+ import { XMLFeedType } from '../../constants/profile.constants';
2
+ import { XmlFeedTemplateType } from '../../types/profile.types';
3
+ import { customFeedTemplate } from './custom.template';
4
+ import { eBayFeedTemplate } from './ebay.template';
5
+ import { facebookFeedTemplate } from './facebook.template';
6
+ import { googleApiTemplate } from './google-api.template';
7
+ import { googleFeedTemplate } from './google.template';
8
+ import { microsoftTemplate } from './microsoft.template';
9
+ import { tiktokFeedTemplate } from './tiktok.template';
10
+
11
+ export function getTemplate(type: XMLFeedType): XmlFeedTemplateType {
12
+ switch (type) {
13
+ case XMLFeedType.Custom:
14
+ return customFeedTemplate;
15
+ case XMLFeedType.Facebook:
16
+ return facebookFeedTemplate;
17
+ case XMLFeedType.Google:
18
+ return googleFeedTemplate;
19
+ case XMLFeedType.TikTok:
20
+ return tiktokFeedTemplate;
21
+ case XMLFeedType.Microsoft:
22
+ return microsoftTemplate;
23
+ case XMLFeedType.GMC_API:
24
+ return googleApiTemplate;
25
+ case XMLFeedType.eBay:
26
+ return eBayFeedTemplate;
27
+ default:
28
+ throw new Error(`Invalid feed type: ${type}`);
29
+ }
30
+ }
@@ -2,9 +2,10 @@
2
2
  /* eslint-disable quotes */
3
3
  import * as z from 'zod';
4
4
  import { ulid } from 'ulid';
5
- import { dateRangeSchema, measureUnitsSchema, validate, validateIfNoMacro } from './index.js';
5
+ import { validate, validateIfNoMacro } from './common-schemas.js';
6
6
  import { XmlFeedTemplateType } from '../../types/profile.types.js';
7
7
  import { XmlFeedFormat } from '../../constants/profile.constants.js';
8
+ import { dateRangeSchema, measureUnitsSchema } from './common-schemas.js';
8
9
 
9
10
  /* eslint-disable max-len */
10
11
  const availabilityMapping = {
@@ -216,7 +217,8 @@ export const tiktokFeedTemplate: XmlFeedTemplateType = {
216
217
  fixedValue: true,
217
218
  singleChoice: true,
218
219
  rules: { sections: [] },
219
- validator: v => validateIfNoMacro(v, z.enum(['newborn', 'infant', 'toddler', 'kids', 'adult', '']).optional()),
220
+ validator: v =>
221
+ validateIfNoMacro(v, z.enum(['newborn', 'infant', 'toddler', 'kids', 'adult', '']).optional()),
220
222
  },
221
223
  {
222
224
  attribute: 'color',
@@ -11,9 +11,64 @@ import {
11
11
  ProductUploadRuleSection,
12
12
  ProductUploadRules,
13
13
  ValueType,
14
+ SelectItem,
14
15
  } from '../types/profile.types.js';
15
- import { GmcApiConstAttrs, MappingSourceValueType, RULES_OPERATORS } from '../constants/profile.constants.js';
16
+ import {
17
+ GmcApiConstAttrs,
18
+ MappingSourceValueType,
19
+ RULES_OPERATORS,
20
+ SOURCE_COUNTRY,
21
+ SOURCE_CURRENCY,
22
+ SOURCE_EBAY_GALLERY_TYPE,
23
+ SOURCE_EBAY_INVENTORY_TRACKING,
24
+ SOURCE_EBAY_LISTING_TYPE,
25
+ SOURCE_EBAY_YES_NO,
26
+ SOURCE_ENERGY_EFFICIENCY,
27
+ SOURCE_FB_AGE_GROUP,
28
+ SOURCE_FB_CATEGORY,
29
+ SOURCE_GOOGLE_AGE_GROUP,
30
+ SOURCE_GOOGLE_AVAILABILITY,
31
+ SOURCE_GOOGLE_CATEGORY,
32
+ SOURCE_GOOGLE_CONDITION,
33
+ SOURCE_GOOGLE_DIMENSION_UNIT,
34
+ SOURCE_GOOGLE_GENDER,
35
+ SOURCE_GOOGLE_GMC_DESTINATIONS,
36
+ SOURCE_GOOGLE_SIZE_SYSTEM,
37
+ SOURCE_GOOGLE_SIZE_TYPE,
38
+ SOURCE_GOOGLE_VOLUME_UNIT,
39
+ SOURCE_GOOGLE_WEIGHT_UNIT,
40
+ SOURCE_LANGUAGE,
41
+ SOURCE_MS_AVAILABILITY,
42
+ SOURCE_MS_SIZE_SYSTEM,
43
+ SOURCE_TRUE_FALSE,
44
+ SOURCE_YES_NO,
45
+ } from '../constants/profile.constants.js';
16
46
  import { code } from './utils.js';
47
+ import { countrySource } from '../sources/country.source.js';
48
+ import { CurrencySource } from '../sources/currency.source.js';
49
+ import { EnergyEfficiencySource } from '../sources/ee.source.js';
50
+ import { fbAgeGroup } from '../sources/fb-age-group.source.js';
51
+ import { FbCategorySource } from '../sources/fb-category.source.js';
52
+ import { GoogleAgeGroupSource } from '../sources/google-age-group.source.js';
53
+ import { availability } from '../sources/google-availability.source.js';
54
+ import { GoogleCategorySource } from '../sources/google-category.source.js';
55
+ import { GoogleProductConditionSource } from '../sources/google-condition.source.js';
56
+ import { GoogleDimensionUnitSource } from '../sources/google-dimension-unit.source.js';
57
+ import { GoogleGenderSource } from '../sources/google-gender.source.js';
58
+ import { GoogleGmcDestinations } from '../sources/google-gmc-destinations.source.js';
59
+ import { GoogleSizeSystemSource } from '../sources/google-size-system.source.js';
60
+ import { GoogleSizeTypeSource } from '../sources/google-size-type.source.js';
61
+ import { GoogleVolumeUnitSource } from '../sources/google-volume-unit.source.js';
62
+ import { GoogleWeightUnitSource } from '../sources/google-weight-unit.source.js';
63
+ import { languageSource } from '../sources/language.source.js';
64
+ import { MsAvailabilitySource } from '../sources/ms-availability.source.js';
65
+ import { MsSizeSystemSource } from '../sources/ms-size-system.source.js';
66
+ import { TrueFalseSource } from '../sources/true-false.source.js';
67
+ import { YesNoSource } from '../sources/yes-no.source.js';
68
+ import { EbayYesNoSource } from '../sources/ebay-yes-no.source.js';
69
+ import { eBayInventoryTrackingSource } from '../sources/ebay-inventory-tracking.source.js';
70
+ import { EbayListingTypeSource } from '../sources/ebay-listing-type.source.js';
71
+ import { EbayGalleryTypeSource } from '../sources/ebay-gallery-type.source.js';
17
72
 
18
73
  /**
19
74
  * Check for rules duplication
@@ -135,7 +190,9 @@ export function getOperatorCounterpart(operator: keyof RuleOperatorsType): keyof
135
190
  }
136
191
  }
137
192
 
138
- export function getEmptyRuleItem(attribute: Readonly<ProductUploadRuleFilterType['value']> = ''): ProductUploadRuleItem {
193
+ export function getEmptyRuleItem(
194
+ attribute: Readonly<ProductUploadRuleFilterType['value']> = ''
195
+ ): ProductUploadRuleItem {
139
196
  return { attribute, operator: '', value: '', id: code() };
140
197
  }
141
198
 
@@ -311,3 +368,60 @@ export function variableType(values: Readonly<MappingSourceValueType[]>): Mappin
311
368
 
312
369
  return MappingSourceValueType.ANY;
313
370
  }
371
+
372
+ export function resolveSourceValue(source: string): SelectItem[] | null {
373
+ switch (source) {
374
+ case SOURCE_COUNTRY:
375
+ return countrySource;
376
+ case SOURCE_CURRENCY:
377
+ return CurrencySource;
378
+ case SOURCE_ENERGY_EFFICIENCY:
379
+ return EnergyEfficiencySource;
380
+ case SOURCE_FB_AGE_GROUP:
381
+ return fbAgeGroup;
382
+ case SOURCE_FB_CATEGORY:
383
+ return FbCategorySource as unknown as SelectItem[];
384
+ case SOURCE_GOOGLE_AGE_GROUP:
385
+ return GoogleAgeGroupSource;
386
+ case SOURCE_GOOGLE_AVAILABILITY:
387
+ return availability;
388
+ case SOURCE_GOOGLE_CATEGORY:
389
+ return GoogleCategorySource as unknown as SelectItem[];
390
+ case SOURCE_GOOGLE_CONDITION:
391
+ return GoogleProductConditionSource;
392
+ case SOURCE_GOOGLE_DIMENSION_UNIT:
393
+ return GoogleDimensionUnitSource;
394
+ case SOURCE_GOOGLE_GENDER:
395
+ return GoogleGenderSource;
396
+ case SOURCE_GOOGLE_GMC_DESTINATIONS:
397
+ return GoogleGmcDestinations;
398
+ case SOURCE_GOOGLE_SIZE_SYSTEM:
399
+ return GoogleSizeSystemSource;
400
+ case SOURCE_GOOGLE_SIZE_TYPE:
401
+ return GoogleSizeTypeSource;
402
+ case SOURCE_GOOGLE_VOLUME_UNIT:
403
+ return GoogleVolumeUnitSource;
404
+ case SOURCE_GOOGLE_WEIGHT_UNIT:
405
+ return GoogleWeightUnitSource;
406
+ case SOURCE_LANGUAGE:
407
+ return languageSource;
408
+ case SOURCE_MS_AVAILABILITY:
409
+ return MsAvailabilitySource;
410
+ case SOURCE_MS_SIZE_SYSTEM:
411
+ return MsSizeSystemSource;
412
+ case SOURCE_TRUE_FALSE:
413
+ return TrueFalseSource;
414
+ case SOURCE_YES_NO:
415
+ return YesNoSource;
416
+ case SOURCE_EBAY_YES_NO:
417
+ return EbayYesNoSource;
418
+ case SOURCE_EBAY_INVENTORY_TRACKING:
419
+ return eBayInventoryTrackingSource;
420
+ case SOURCE_EBAY_LISTING_TYPE:
421
+ return EbayListingTypeSource;
422
+ case SOURCE_EBAY_GALLERY_TYPE:
423
+ return EbayGalleryTypeSource;
424
+ default:
425
+ return null;
426
+ }
427
+ }
@@ -1,3 +1,4 @@
1
+ import { SOURCE_GOOGLE_PRODUCT_HIGHLIGHT, SOURCE_FB_CATEGORY } from '../constants/profile.constants.js';
1
2
  import { MacroPartType, SelectItem } from '../types/profile.types.js';
2
3
 
3
4
  export function code() {
@@ -97,7 +98,7 @@ export function isSourceJSON(input: any): input is string {
97
98
  const content = JSON.parse(input);
98
99
 
99
100
  if (Array.isArray(content)) {
100
- return content.every((item) => item?.label !== undefined && item?.value !== undefined);
101
+ return content.every(item => item?.label !== undefined && item?.value !== undefined);
101
102
  }
102
103
 
103
104
  return content?.label !== undefined && content?.value !== undefined;
@@ -107,7 +108,7 @@ export function getSourceTagParts(content: string): {
107
108
  tag: string;
108
109
  value: string | null;
109
110
  } {
110
- const splitPoint = content.indexOf(":");
111
+ const splitPoint = content.indexOf(':');
111
112
  const tag = splitPoint !== -1 ? content.slice(0, splitPoint) : content;
112
113
  const value = splitPoint !== -1 ? content.slice(splitPoint + 1) : null;
113
114
 
@@ -122,15 +123,15 @@ export function getSourceTagValueAndStripTags(content: string): {
122
123
  }
123
124
 
124
125
  /**
125
- *
126
+ *
126
127
  * @param content with tags stripped
127
- * @returns
128
+ * @returns
128
129
  */
129
130
  export function getSourceTagValue(content: Readonly<string>): {
130
131
  tag: string;
131
132
  value: SelectItem[] | null;
132
133
  } {
133
- const splitPoint = content.indexOf(":");
134
+ const splitPoint = content.indexOf(':');
134
135
  const tag = splitPoint !== -1 ? content.substring(0, splitPoint) : content;
135
136
  const valueText = splitPoint !== -1 ? content.substring(splitPoint + 1) : null;
136
137
  const value = isSourceJSON(valueText) ? JSON.parse(valueText) : null;
@@ -141,3 +142,22 @@ export function getSourceTagValue(content: Readonly<string>): {
141
142
  export function resolveSourceTagValue(content: string): SelectItem[] {
142
143
  return getSourceTagValue(content.slice(0, -2))?.value || [];
143
144
  }
145
+ export function resolveSourceMacro(macro: any): any {
146
+ if (typeof macro !== 'string') {
147
+ return macro;
148
+ }
149
+ return macro.replace(/{{source\..+?}}/g, macro => {
150
+ const { tag, value } = getSourceTagValue(macro.slice(2, -2));
151
+ return value?.map(v => v.value)?.join(getSourceValueSeparator(tag)) ?? '';
152
+ });
153
+ }
154
+ export function getSourceValueSeparator(source = ''): string {
155
+ switch (source) {
156
+ case SOURCE_GOOGLE_PRODUCT_HIGHLIGHT:
157
+ return '|';
158
+ case SOURCE_FB_CATEGORY:
159
+ return ':';
160
+ default:
161
+ return ',';
162
+ }
163
+ }
@@ -1,49 +1,49 @@
1
1
  import { describe, test, expect } from 'vitest';
2
2
  import {
3
- extractSubscriptionCode,
4
- makeSubscriptionCode,
5
- makeSubscriptionName,
6
- parseSubscriptionName,
3
+ extractSubscriptionCode,
4
+ makeSubscriptionCode,
5
+ makeSubscriptionName,
6
+ parseSubscriptionName,
7
7
  } from '../src/utils/company.js';
8
8
  import { ShopifyRecurringCharge } from '../src/types/shopify.types.js';
9
9
 
10
10
  describe('Company', () => {
11
- test('Make subscription code', () => {
12
- expect(
13
- makeSubscriptionCode({
14
- code: 'G',
15
- level: 20,
16
- products: 100,
17
- profiles: 100,
18
- price: 100,
19
- })
20
- ).toBe('G20');
21
- });
11
+ test('Make subscription code', () => {
12
+ expect(
13
+ makeSubscriptionCode({
14
+ code: 'G',
15
+ level: 20,
16
+ products: 100,
17
+ profiles: 100,
18
+ price: 100,
19
+ })
20
+ ).toBe('G20');
21
+ });
22
22
 
23
- test('Make subscription name', () => {
24
- expect(
25
- makeSubscriptionName({
26
- code: 'G',
27
- level: 10,
28
- products: 100,
29
- profiles: 100,
30
- price: 100,
31
- })
32
- ).toBe('G10');
33
- });
23
+ test('Make subscription name', () => {
24
+ expect(
25
+ makeSubscriptionName({
26
+ code: 'G',
27
+ level: 10,
28
+ products: 100,
29
+ profiles: 100,
30
+ price: 100,
31
+ })
32
+ ).toBe('G10');
33
+ });
34
34
 
35
- test('Extract subscription code', () => {
36
- expect(
37
- extractSubscriptionCode({
38
- name: 'G50 subscription',
39
- price: 100,
40
- status: 'active',
41
- trial_ends_at: '2022-01-01',
42
- } as unknown as ShopifyRecurringCharge)
43
- ).toBe('G50');
44
- });
35
+ test('Extract subscription code', () => {
36
+ expect(
37
+ extractSubscriptionCode({
38
+ name: 'G50 subscription',
39
+ price: 100,
40
+ status: 'active',
41
+ trial_ends_at: '2022-01-01',
42
+ } as unknown as ShopifyRecurringCharge)
43
+ ).toBe('G50');
44
+ });
45
45
 
46
- test('Parse subscription name', () => {
47
- expect(parseSubscriptionName('G50')).toEqual({ code: 'G', level: '50' });
48
- });
46
+ test('Parse subscription name', () => {
47
+ expect(parseSubscriptionName('G50')).toEqual({ code: 'G', level: '50' });
48
+ });
49
49
  });
@@ -0,0 +1,38 @@
1
+ import { describe, test, expect } from 'vitest';
2
+ import { ACTION_ADD, makeMacroString, SOURCE_DATE, SOURCE_FB_AGE_GROUP, SOURCE_SHOPIFY_BARCODE } from '../src';
3
+
4
+ describe('Profile utils', () => {
5
+ describe('Make macro string', () => {
6
+ test('Mapping macro', () => {
7
+ expect(makeMacroString(SOURCE_SHOPIFY_BARCODE)).toBe(`{{${SOURCE_SHOPIFY_BARCODE}}}`);
8
+ });
9
+
10
+ test('Empty source macro', () => {
11
+ expect(makeMacroString(SOURCE_FB_AGE_GROUP)).toBe(`{{${SOURCE_FB_AGE_GROUP}:}}`);
12
+ });
13
+
14
+ test('Empty source macro (no source file)', () => {
15
+ expect(makeMacroString(SOURCE_DATE)).toBe(`{{${SOURCE_DATE}:}}`);
16
+ });
17
+
18
+ test('Empty source macro (no source file) with value (kinda not gonna happen)', () => {
19
+ expect(makeMacroString(SOURCE_DATE, ['foo'])).toBe(`{{${SOURCE_DATE}:}}`);
20
+ });
21
+
22
+ test('Source with value macro', () => {
23
+ expect(makeMacroString(SOURCE_FB_AGE_GROUP, ['adult'])).toBe(
24
+ `{{${SOURCE_FB_AGE_GROUP}:[{"label":"Adult","value":"adult"}]}}`
25
+ );
26
+ });
27
+
28
+ test('Source with multiple value macro', () => {
29
+ expect(makeMacroString(SOURCE_FB_AGE_GROUP, ['adult', 'teen'])).toBe(
30
+ `{{${SOURCE_FB_AGE_GROUP}:[{"label":"Adult","value":"adult"},{"label":"Teen","value":"teen"}]}}`
31
+ );
32
+ });
33
+
34
+ test('Action macro', () => {
35
+ expect(makeMacroString(ACTION_ADD, ['5'])).toBe(`{{${ACTION_ADD}:5}}`);
36
+ });
37
+ });
38
+ });
@@ -1,7 +1,6 @@
1
1
  import { describe, expect, test } from 'vitest';
2
- import { hasMacro, languageSchema, resolveSourceMacro, validateIfNoMacro } from '../src/utils/feed-templates';
2
+ import { hasMacro, languageSchema, resolveSourceMacro, validateIfNoMacro } from '../src';
3
3
  import { z } from 'zod';
4
- import { googleFeedTemplate } from '../src/utils/feed-templates/google.template';
5
4
 
6
5
  describe('Validator', () => {
7
6
  test('hasMacro', () => {
@@ -10,7 +9,6 @@ describe('Validator', () => {
10
9
  expect(hasMacro('Hello {{source.world}} {{source.world:any value}}')).toBe(false);
11
10
  expect(hasMacro('Hello {{source.world}} {{source.world:[{"a": "b"}]}}')).toBe(false);
12
11
  });
13
-
14
12
  test('resolveSourceMacro', () => {
15
13
  expect(resolveSourceMacro('Hello {{shopify.id}}')).toBe('Hello {{shopify.id}}');
16
14
  expect(resolveSourceMacro('Hello {{source.foo}}')).toBe('Hello ');
@@ -33,13 +31,11 @@ describe('Validator', () => {
33
31
  )
34
32
  ).toBe('Hello value1:value2');
35
33
  });
36
-
37
34
  test('multiple validators', () => {
38
35
  expect(validateIfNoMacro('en', [z.string(), z.string().min(2)]).success).toBe(true);
39
36
  expect(validateIfNoMacro('en', [z.string(), z.string().min(3)]).success).toBe(false);
40
37
  expect(validateIfNoMacro('en', [z.number(), z.string().min(2)]).success).toBe(false);
41
38
  });
42
-
43
39
  describe('language validate', () => {
44
40
  test('languageSchema', () => {
45
41
  expect(languageSchema.saf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