pim-import 4.30.3 → 4.30.5

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 (124) hide show
  1. package/dist/algolia/clean.js +10 -10
  2. package/dist/algolia/clean.js.map +1 -1
  3. package/dist/algolia/config.js +9 -9
  4. package/dist/algolia/config.js.map +1 -1
  5. package/dist/algolia/downloads.js +42 -43
  6. package/dist/algolia/downloads.js.map +1 -1
  7. package/dist/algolia/families.js +71 -73
  8. package/dist/algolia/families.js.map +1 -1
  9. package/dist/algolia/models.js +49 -50
  10. package/dist/algolia/models.js.map +1 -1
  11. package/dist/algolia/news.js +40 -41
  12. package/dist/algolia/news.js.map +1 -1
  13. package/dist/algolia/pressRelease.js +37 -38
  14. package/dist/algolia/pressRelease.js.map +1 -1
  15. package/dist/algolia/pressReview.js +35 -36
  16. package/dist/algolia/pressReview.js.map +1 -1
  17. package/dist/algolia/products.js +84 -85
  18. package/dist/algolia/products.js.map +1 -1
  19. package/dist/algolia/projects.js +44 -45
  20. package/dist/algolia/projects.js.map +1 -1
  21. package/dist/algolia/stories.js +53 -54
  22. package/dist/algolia/stories.js.map +1 -1
  23. package/dist/algolia/subFamilies.js +78 -80
  24. package/dist/algolia/subFamilies.js.map +1 -1
  25. package/dist/algolia/subModels.js +48 -49
  26. package/dist/algolia/subModels.js.map +1 -1
  27. package/dist/downloads/classes/manageEntry.js +3 -3
  28. package/dist/downloads/classes/manageEntry.js.map +1 -1
  29. package/dist/downloads/import.js +27 -27
  30. package/dist/downloads/import.js.map +1 -1
  31. package/dist/libs/contentful-cda.js +37 -44
  32. package/dist/libs/contentful-cda.js.map +1 -1
  33. package/dist/libs/contentful.js +131 -130
  34. package/dist/libs/contentful.js.map +1 -1
  35. package/dist/libs/imgix.js +23 -23
  36. package/dist/libs/imgix.js.map +1 -1
  37. package/dist/libs/logs.js +4 -4
  38. package/dist/libs/logs.js.map +1 -1
  39. package/dist/libs/pdf.js +5 -5
  40. package/dist/libs/pdf.js.map +1 -1
  41. package/dist/libs/s3.js +28 -28
  42. package/dist/libs/s3.js.map +1 -1
  43. package/dist/libs/sentry.js +6 -2
  44. package/dist/libs/sentry.js.map +1 -1
  45. package/dist/pim/config.js +3 -3
  46. package/dist/pim/config.js.map +1 -1
  47. package/dist/pim/endpoints.js +39 -39
  48. package/dist/pim/endpoints.js.map +1 -1
  49. package/dist/pim/methods/bulkPublish.js +10 -10
  50. package/dist/pim/methods/bulkPublish.js.map +1 -1
  51. package/dist/pim/methods/catalogs.js +62 -62
  52. package/dist/pim/methods/catalogs.js.map +1 -1
  53. package/dist/pim/methods/designers.js +19 -19
  54. package/dist/pim/methods/designers.js.map +1 -1
  55. package/dist/pim/methods/dictionary.js +66 -66
  56. package/dist/pim/methods/dictionary.js.map +1 -1
  57. package/dist/pim/methods/families.js +37 -37
  58. package/dist/pim/methods/families.js.map +1 -1
  59. package/dist/pim/methods/latestProducts.js +7 -7
  60. package/dist/pim/methods/latestProducts.js.map +1 -1
  61. package/dist/pim/methods/models.js +47 -47
  62. package/dist/pim/methods/models.js.map +1 -1
  63. package/dist/pim/methods/pages/catalogs.js +6 -6
  64. package/dist/pim/methods/pages/catalogs.js.map +1 -1
  65. package/dist/pim/methods/pages/families.js +7 -7
  66. package/dist/pim/methods/pages/families.js.map +1 -1
  67. package/dist/pim/methods/pages/subfamilies.js +11 -11
  68. package/dist/pim/methods/pages/subfamilies.js.map +1 -1
  69. package/dist/pim/methods/products.js +426 -426
  70. package/dist/pim/methods/products.js.map +1 -1
  71. package/dist/pim/methods/subfamilies.js +107 -107
  72. package/dist/pim/methods/subfamilies.js.map +1 -1
  73. package/dist/pim/methods/submodels.js +37 -37
  74. package/dist/pim/methods/submodels.js.map +1 -1
  75. package/dist/pim/request.js +2 -2
  76. package/dist/pim/request.js.map +1 -1
  77. package/dist/utils.js +23 -23
  78. package/dist/utils.js.map +1 -1
  79. package/package.json +4 -4
  80. package/src/algolia/downloads.ts +1 -2
  81. package/src/algolia/families.ts +2 -4
  82. package/src/algolia/models.ts +1 -2
  83. package/src/algolia/news.ts +1 -2
  84. package/src/algolia/pressRelease.ts +1 -2
  85. package/src/algolia/pressReview.ts +1 -2
  86. package/src/algolia/products.ts +1 -2
  87. package/src/algolia/projects.ts +1 -2
  88. package/src/algolia/stories.ts +1 -2
  89. package/src/algolia/subFamilies.ts +2 -4
  90. package/src/algolia/subModels.ts +1 -2
  91. package/src/downloads/import.ts +1 -1
  92. package/src/libs/contentful-cda.ts +7 -10
  93. package/src/libs/contentful.ts +8 -7
  94. package/src/libs/s3.ts +2 -2
  95. package/src/pim/endpoints.ts +8 -8
  96. package/src/pim/methods/bulkPublish.ts +1 -1
  97. package/src/pim/methods/dictionary.ts +1 -1
  98. package/src/pim/methods/families.ts +1 -1
  99. package/src/pim/methods/products.ts +7 -7
  100. package/types/algolia/clean.d.ts +1 -1
  101. package/types/algolia/config.d.ts +1 -1
  102. package/types/algolia/downloads.d.ts +1 -1
  103. package/types/algolia/families.d.ts +3 -3
  104. package/types/algolia/models.d.ts +1 -1
  105. package/types/algolia/news.d.ts +1 -1
  106. package/types/algolia/pressRelease.d.ts +1 -1
  107. package/types/algolia/pressReview.d.ts +1 -1
  108. package/types/algolia/products.d.ts +2 -2
  109. package/types/algolia/projects.d.ts +1 -1
  110. package/types/algolia/stories.d.ts +1 -1
  111. package/types/algolia/subFamilies.d.ts +1 -1
  112. package/types/algolia/subModels.d.ts +1 -1
  113. package/types/libs/contentful-cda.d.ts +2 -2
  114. package/types/libs/contentful.d.ts +10 -10
  115. package/types/libs/logs.d.ts +1 -1
  116. package/types/libs/pdf.d.ts +1 -1
  117. package/types/libs/s3.d.ts +1 -1
  118. package/types/pim/config.d.ts +1 -1
  119. package/types/pim/endpoints.d.ts +3 -3
  120. package/types/pim/methods/designers.d.ts +1 -1
  121. package/types/pim/methods/products.d.ts +3 -3
  122. package/types/resources/Audit.d.ts +1 -1
  123. package/types/types.d.ts +21 -21
  124. package/types/utils.d.ts +1 -1
@@ -8,21 +8,21 @@ const utils_1 = require("../../utils");
8
8
  const designers_1 = require("./designers");
9
9
  const products_1 = require("./products");
10
10
  const getFamilyPageData = async (names, slugs, pageId, familyEntry, familyPageEntry) => {
11
- const defEnvLocaleCode = await contentful_1.getEnvironmentDefaultLocaleCode();
11
+ const defEnvLocaleCode = await (0, contentful_1.getEnvironmentDefaultLocaleCode)();
12
12
  const pageData = {
13
13
  fields: familyPageEntry?.fields || {},
14
14
  };
15
15
  pageData.fields.title = names;
16
16
  pageData.fields.slug = slugs;
17
- pageData.fields = await contentful_1.addFieldValue(pageData, "internalName", pageId);
18
- pageData.fields = await contentful_1.addFieldValue(pageData, "type", "CatalogFamily");
19
- pageData.fields = await contentful_1.addToRelationFields(pageData, "topic", familyEntry.sys.id);
17
+ pageData.fields = await (0, contentful_1.addFieldValue)(pageData, "internalName", pageId);
18
+ pageData.fields = await (0, contentful_1.addFieldValue)(pageData, "type", "CatalogFamily");
19
+ pageData.fields = await (0, contentful_1.addToRelationFields)(pageData, "topic", familyEntry.sys.id);
20
20
  const destinations = familyEntry?.fields?.destinations?.[defEnvLocaleCode] || [];
21
- pageData.fields = await products_1.setHideInRegionField(destinations, pageData);
21
+ pageData.fields = await (0, products_1.setHideInRegionField)(destinations, pageData);
22
22
  return pageData;
23
23
  };
24
24
  const createOrUpdatePage = async (familyEntry) => {
25
- const defaultEnvironmentLocaleCode = await contentful_1.getEnvironmentDefaultLocaleCode();
25
+ const defaultEnvironmentLocaleCode = await (0, contentful_1.getEnvironmentDefaultLocaleCode)();
26
26
  const pageId = `${familyEntry.sys.id}_PAGE`;
27
27
  const names = {};
28
28
  const slugs = {};
@@ -32,83 +32,83 @@ const createOrUpdatePage = async (familyEntry) => {
32
32
  familyEntry.fields.name[defaultEnvironmentLocaleCode];
33
33
  }
34
34
  for (const locale of contentful_1.cfLocales) {
35
- slugs[locale] = utils_1.stringToSlug(`${familyEntry.fields.name[locale] ||
35
+ slugs[locale] = (0, utils_1.stringToSlug)(`${familyEntry.fields.name[locale] ||
36
36
  familyEntry.fields.name[defaultEnvironmentLocaleCode]}`.toLowerCase());
37
37
  }
38
- let familyPageEntry = await contentful_1.getEntryByID(pageId, "page");
38
+ let familyPageEntry = await (0, contentful_1.getEntryByID)(pageId, "page");
39
39
  const pageData = await getFamilyPageData(names, slugs, pageId, familyEntry, familyPageEntry);
40
40
  if (familyPageEntry) {
41
- logs_1.log(`Family page ${pageId} already exists. Updating...`);
42
- familyPageEntry = await contentful_1.updateEntry(familyPageEntry, pageData, familyPageEntry.isPublished());
41
+ (0, logs_1.log)(`Family page ${pageId} already exists. Updating...`);
42
+ familyPageEntry = await (0, contentful_1.updateEntry)(familyPageEntry, pageData, familyPageEntry.isPublished());
43
43
  }
44
44
  else {
45
- logs_1.log(`Family page ${pageId} not exists. Create new entry with data`);
46
- familyPageEntry = await contentful_1.createEntryWithId("page", pageId, pageData);
45
+ (0, logs_1.log)(`Family page ${pageId} not exists. Create new entry with data`);
46
+ familyPageEntry = await (0, contentful_1.createEntryWithId)("page", pageId, pageData);
47
47
  }
48
48
  return familyPageEntry;
49
49
  };
50
50
  exports.createOrUpdatePage = createOrUpdatePage;
51
51
  const getTopicFamilyData = async (family, topicFamily) => {
52
- const defaultEnvironmentLocaleCode = await contentful_1.getEnvironmentDefaultLocaleCode();
52
+ const defaultEnvironmentLocaleCode = await (0, contentful_1.getEnvironmentDefaultLocaleCode)();
53
53
  const data = {
54
54
  fields: topicFamily?.fields || {},
55
55
  };
56
- data.fields.name = utils_1.getPimTranslations(family.data);
57
- data.fields = await contentful_1.addFieldValue(data, "code", family.data.code);
58
- data.fields = await contentful_1.addFieldValue(data, "priority", family.priority);
59
- data.fields.description = utils_1.getPimTranslations(family, "description1");
56
+ data.fields.name = (0, utils_1.getPimTranslations)(family.data);
57
+ data.fields = await (0, contentful_1.addFieldValue)(data, "code", family.data.code);
58
+ data.fields = await (0, contentful_1.addFieldValue)(data, "priority", family.priority);
59
+ data.fields.description = (0, utils_1.getPimTranslations)(family, "description1");
60
60
  if (family?.designers) {
61
61
  const designer = family.designers[0];
62
62
  if (designer?.code) {
63
- logs_1.log(`set ${designer.code} designer relation`);
64
- data.fields = await designers_1.addDesignerData(data, designer);
63
+ (0, logs_1.log)(`set ${designer.code} designer relation`);
64
+ data.fields = await (0, designers_1.addDesignerData)(data, designer);
65
65
  }
66
66
  else {
67
- logs_1.log(`no designer found`, "WARN");
67
+ (0, logs_1.log)(`no designer found`, "WARN");
68
68
  if (data.fields.designer?.[defaultEnvironmentLocaleCode]) {
69
- logs_1.log(`remove old designer relation with ${data.fields.designer?.[defaultEnvironmentLocaleCode].sys.id}`);
69
+ (0, logs_1.log)(`remove old designer relation with ${data.fields.designer?.[defaultEnvironmentLocaleCode].sys.id}`);
70
70
  data.fields.designer = {};
71
71
  }
72
72
  }
73
73
  }
74
74
  if (family?.destinations?.length) {
75
- logs_1.log(`set destinations`);
76
- data.fields = await contentful_1.addFieldValue(data, "destinations", family.destinations);
75
+ (0, logs_1.log)(`set destinations`);
76
+ data.fields = await (0, contentful_1.addFieldValue)(data, "destinations", family.destinations);
77
77
  }
78
78
  else {
79
- logs_1.log(`destinations not found`, "WARN");
79
+ (0, logs_1.log)(`destinations not found`, "WARN");
80
80
  }
81
- data.fields = await contentful_1.addFieldValue(data, "lastPimSyncDate", utils_1.getLocalISOTime());
81
+ data.fields = await (0, contentful_1.addFieldValue)(data, "lastPimSyncDate", (0, utils_1.getLocalISOTime)());
82
82
  return data;
83
83
  };
84
84
  const importFamily = async (family) => {
85
85
  const code = `${family.data.code}`;
86
- let topicFamily = await contentful_1.getEntryByID(code, "topicFamily");
86
+ let topicFamily = await (0, contentful_1.getEntryByID)(code, "topicFamily");
87
87
  const topicFamilyData = await getTopicFamilyData(family, topicFamily);
88
88
  if (topicFamily) {
89
- logs_1.log(`The topicFamily ${code} already exists. Updating...`);
90
- topicFamily = await contentful_1.updateEntry(topicFamily, topicFamilyData, topicFamily.isPublished());
89
+ (0, logs_1.log)(`The topicFamily ${code} already exists. Updating...`);
90
+ topicFamily = await (0, contentful_1.updateEntry)(topicFamily, topicFamilyData, topicFamily.isPublished());
91
91
  }
92
92
  else {
93
- logs_1.log(`The topicFamily ${code} not exists. Creating...`);
94
- topicFamily = await contentful_1.createEntryWithId("topicFamily", code, topicFamilyData);
93
+ (0, logs_1.log)(`The topicFamily ${code} not exists. Creating...`);
94
+ topicFamily = await (0, contentful_1.createEntryWithId)("topicFamily", code, topicFamilyData);
95
95
  }
96
96
  return topicFamily;
97
97
  };
98
98
  const importFamilies = async (offset = 0, limit = 50) => {
99
- logs_1.log(`importFamilies - offset: ${offset} limit: ${limit}`, "INFO");
100
- const families = await endpoints_1.getFamilies();
99
+ (0, logs_1.log)(`importFamilies - offset: ${offset} limit: ${limit}`, "INFO");
100
+ const families = await (0, endpoints_1.getFamilies)();
101
101
  let count = 0;
102
102
  let current = 0;
103
103
  for (const family of families) {
104
104
  if (offset <= count || limit === -1) {
105
- if (!utils_1.sanitizeValue(family.data.code)) {
106
- logs_1.log(`The family code ${family.data.code} is not valid`, "WARN");
105
+ if (!(0, utils_1.sanitizeValue)(family.data.code)) {
106
+ (0, logs_1.log)(`The family code ${family.data.code} is not valid`, "WARN");
107
107
  }
108
108
  else {
109
- logs_1.log(`${count + 1} of ${families.length}`);
109
+ (0, logs_1.log)(`${count + 1} of ${families.length}`);
110
110
  const topicFamily = await importFamily(family);
111
- await exports.createOrUpdatePage(topicFamily);
111
+ await (0, exports.createOrUpdatePage)(topicFamily);
112
112
  if (logs_1.serverUtils) {
113
113
  const currentTotal = families.length > limit && limit !== -1 ? limit : families.length;
114
114
  const progress = Math.floor((++current / currentTotal) * 100);
@@ -118,7 +118,7 @@ const importFamilies = async (offset = 0, limit = 50) => {
118
118
  break;
119
119
  }
120
120
  if (count % 2 === 0 && count < families.length) {
121
- await utils_1.sleep(1000);
121
+ await (0, utils_1.sleep)(1000);
122
122
  }
123
123
  if (logs_1.serverUtils) {
124
124
  logs_1.serverUtils.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C,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC,GAAG,GAAG,CAAC,CAAC;oBAC9D,kBAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;iBACtC;gBAED,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE;oBAC/C,MAAM;iBACP;gBAED,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE;oBAC9C,MAAM,IAAA,aAAK,EAAC,IAAI,CAAC,CAAC;iBACnB;gBACD,IAAI,kBAAW,EAAE;oBACf,kBAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBACnC;aACF;SACF;QACD,KAAK,EAAE,CAAC;KACT;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAElD,IAAI,kBAAW,EAAE;QACf,kBAAW,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;KACjC;IAED,OAAO;QACL,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;QACpB,SAAS,EAAE,UAAU,IAAI,QAAQ,CAAC,MAAM;QACxC,KAAK,EAAE,QAAQ,CAAC,MAAM;KACvB,CAAC;AACJ,CAAC,CAAC;AArDW,QAAA,cAAc,kBAqDzB"}
@@ -9,17 +9,17 @@ const importLatestProducts = async (catalog, lastModified, offset = 0, limit = 1
9
9
  const timeStart = new Date();
10
10
  offset = Number(offset);
11
11
  limit = Number(limit);
12
- logs_1.log(`importLatestProducts - catalog: ${catalog} lastModified: ${lastModified} offset: ${offset} limit: ${limit} lastModifiedTo: ${lastModifiedTo}`, "INFO");
13
- const data = await endpoints_1.getLatestProducts(catalog, lastModified, offset, limit, lastModifiedTo);
12
+ (0, logs_1.log)(`importLatestProducts - catalog: ${catalog} lastModified: ${lastModified} offset: ${offset} limit: ${limit} lastModifiedTo: ${lastModifiedTo}`, "INFO");
13
+ const data = await (0, endpoints_1.getLatestProducts)(catalog, lastModified, offset, limit, lastModifiedTo);
14
14
  const total = data.totalCount;
15
15
  const products = data.pagedCollection;
16
- logs_1.log(`${total} products founded`);
16
+ (0, logs_1.log)(`${total} products founded`);
17
17
  let count = offset + 1;
18
18
  let current = 0;
19
19
  for (const product of products) {
20
- logs_1.log(`${count} of ${total}`);
20
+ (0, logs_1.log)(`${count} of ${total}`);
21
21
  const productDetails = product.content;
22
- await products_1.importProduct(productDetails, catalog);
22
+ await (0, products_1.importProduct)(productDetails, catalog);
23
23
  count++;
24
24
  if (logs_1.serverUtils) {
25
25
  logs_1.serverUtils.log(productDetails.code);
@@ -28,8 +28,8 @@ const importLatestProducts = async (catalog, lastModified, offset = 0, limit = 1
28
28
  }
29
29
  }
30
30
  const timeEnd = new Date();
31
- const seconds = utils_1.secondBetweenTwoDate(timeStart, timeEnd);
32
- logs_1.log(`Request time: ${seconds} seconds`);
31
+ const seconds = (0, utils_1.secondBetweenTwoDate)(timeStart, timeEnd);
32
+ (0, logs_1.log)(`Request time: ${seconds} seconds`);
33
33
  const completed = limit === -1 || offset >= total;
34
34
  return {
35
35
  offset: completed ? offset : offset + limit,
@@ -1 +1 @@
1
- {"version":3,"file":"latestProducts.js","sourceRoot":"","sources":["../../../src/pim/methods/latestProducts.ts"],"names":[],"mappings":";;;AACA,4CAAiD;AACjD,0CAAmD;AAEnD,yCAA2C;AAC3C,uCAAmD;AAW5C,MAAM,oBAAoB,GAAG,KAAK,EACvC,OAA0B,EAC1B,YAAoB,EACpB,SAAiB,CAAC,EAClB,QAAgB,GAAG,EACnB,iBAAyB,EAAE,EACC,EAAE;IAC9B,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CA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AM,IAAA,wBAAa,EAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAC7C,KAAK,EAAE,CAAC;QACR,IAAI,kBAAW,EAAE;YACf,kBAAW,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC;YACjE,kBAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;SACtC;KACF;IAED,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,IAAA,4BAAoB,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACzD,IAAA,UAAG,EAAC,iBAAiB,OAAO,UAAU,CAAC,CAAC;IAExC,MAAM,SAAS,GAAG,KAAK,KAAK,CAAC,CAAC,IAAI,MAAM,IAAI,KAAK,CAAC;IAClD,OAAO;QACL,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK;QAC3C,KAAK;QACL,SAAS;QACT,KAAK;KACN,CAAC;AACJ,CAAC,CAAC;AArDW,QAAA,oBAAoB,wBAqD/B"}
@@ -8,21 +8,21 @@ const utils_1 = require("../../utils");
8
8
  const subfamilies_1 = require("./subfamilies");
9
9
  const products_1 = require("./products");
10
10
  const getModelPageData = async (names, slugs, pageId, modelEntry, modelPageEntry) => {
11
- const defEnvLocaleCode = await contentful_1.getEnvironmentDefaultLocaleCode();
11
+ const defEnvLocaleCode = await (0, contentful_1.getEnvironmentDefaultLocaleCode)();
12
12
  const pageData = {
13
13
  fields: modelPageEntry?.fields || {},
14
14
  };
15
15
  pageData.fields.title = names;
16
16
  pageData.fields.slug = slugs;
17
- pageData.fields = await contentful_1.addFieldValue(pageData, "internalName", pageId);
18
- pageData.fields = await contentful_1.addFieldValue(pageData, "type", "CatalogModel");
19
- pageData.fields = await contentful_1.addToRelationFields(pageData, "topic", modelEntry.sys.id);
17
+ pageData.fields = await (0, contentful_1.addFieldValue)(pageData, "internalName", pageId);
18
+ pageData.fields = await (0, contentful_1.addFieldValue)(pageData, "type", "CatalogModel");
19
+ pageData.fields = await (0, contentful_1.addToRelationFields)(pageData, "topic", modelEntry.sys.id);
20
20
  const destinations = modelEntry?.fields?.destinations?.[defEnvLocaleCode] || [];
21
- pageData.fields = await products_1.setHideInRegionField(destinations, pageData);
21
+ pageData.fields = await (0, products_1.setHideInRegionField)(destinations, pageData);
22
22
  return pageData;
23
23
  };
24
24
  const createOrUpdatePage = async (modelEntry) => {
25
- const defaultEnvironmentLocaleCode = await contentful_1.getEnvironmentDefaultLocaleCode();
25
+ const defaultEnvironmentLocaleCode = await (0, contentful_1.getEnvironmentDefaultLocaleCode)();
26
26
  const pageId = `${modelEntry.sys.id}_PAGE`;
27
27
  const names = {};
28
28
  const slugs = {};
@@ -32,104 +32,104 @@ const createOrUpdatePage = async (modelEntry) => {
32
32
  modelEntry.fields.name[defaultEnvironmentLocaleCode];
33
33
  }
34
34
  for (const locale of contentful_1.cfLocales) {
35
- slugs[locale] = utils_1.stringToSlug(`${modelEntry.fields.name[locale] ||
35
+ slugs[locale] = (0, utils_1.stringToSlug)(`${modelEntry.fields.name[locale] ||
36
36
  modelEntry.fields.name[defaultEnvironmentLocaleCode]}-${modelEntry.fields.code[defaultEnvironmentLocaleCode]}`.toLowerCase());
37
37
  }
38
- let modelPageEntry = await contentful_1.getEntryByID(pageId, "page");
38
+ let modelPageEntry = await (0, contentful_1.getEntryByID)(pageId, "page");
39
39
  const pageData = await getModelPageData(names, slugs, pageId, modelEntry, modelPageEntry);
40
40
  if (modelPageEntry) {
41
- logs_1.log(`Model page ${pageId} already exists. Updating...`);
42
- modelPageEntry = await contentful_1.updateEntry(modelPageEntry, pageData, modelPageEntry.isPublished());
41
+ (0, logs_1.log)(`Model page ${pageId} already exists. Updating...`);
42
+ modelPageEntry = await (0, contentful_1.updateEntry)(modelPageEntry, pageData, modelPageEntry.isPublished());
43
43
  }
44
44
  else {
45
- logs_1.log(`Model page ${pageId} not exists. Create new entry with data`);
46
- modelPageEntry = await contentful_1.createEntryWithId("page", pageId, pageData);
45
+ (0, logs_1.log)(`Model page ${pageId} not exists. Create new entry with data`);
46
+ modelPageEntry = await (0, contentful_1.createEntryWithId)("page", pageId, pageData);
47
47
  }
48
48
  return modelPageEntry;
49
49
  };
50
50
  const getTopicModelData = async (model, topicModel) => {
51
- const defaultEnvironmentLocaleCode = await contentful_1.getEnvironmentDefaultLocaleCode();
51
+ const defaultEnvironmentLocaleCode = await (0, contentful_1.getEnvironmentDefaultLocaleCode)();
52
52
  const data = {
53
53
  fields: topicModel?.fields || {},
54
54
  };
55
- data.fields.name = utils_1.getPimTranslations(model.data);
56
- data.fields = await contentful_1.addFieldValue(data, "code", model.code);
57
- data.fields = await contentful_1.addFieldValue(data, "priority", model.priority);
58
- data.fields.description = utils_1.getPimTranslations(model, "description1");
55
+ data.fields.name = (0, utils_1.getPimTranslations)(model.data);
56
+ data.fields = await (0, contentful_1.addFieldValue)(data, "code", model.code);
57
+ data.fields = await (0, contentful_1.addFieldValue)(data, "priority", model.priority);
58
+ data.fields.description = (0, utils_1.getPimTranslations)(model, "description1");
59
59
  if (model.subFamilyCode) {
60
- const subFamilyEntry = await contentful_1.getEntryByCode(model.subFamilyCode, "topicSubFamily", "sys,fields.code,fields.catalog");
60
+ const subFamilyEntry = await (0, contentful_1.getEntryByCode)(model.subFamilyCode, "topicSubFamily", "sys,fields.code,fields.catalog");
61
61
  if (subFamilyEntry) {
62
- data.fields = await contentful_1.addToRelationFields(data, "subFamily", subFamilyEntry.sys.id);
63
- data.fields = await contentful_1.addToRelationFields(data, "catalog", subFamilyEntry.fields.catalog[defaultEnvironmentLocaleCode].sys.id);
62
+ data.fields = await (0, contentful_1.addToRelationFields)(data, "subFamily", subFamilyEntry.sys.id);
63
+ data.fields = await (0, contentful_1.addToRelationFields)(data, "catalog", subFamilyEntry.fields.catalog[defaultEnvironmentLocaleCode].sys.id);
64
64
  }
65
65
  else {
66
- logs_1.log(`topicSubFamily with code ${model.subFamilyCode} not found so it is not possible to set subFamily and the catalog fields`, "WARN");
66
+ (0, logs_1.log)(`topicSubFamily with code ${model.subFamilyCode} not found so it is not possible to set subFamily and the catalog fields`, "WARN");
67
67
  }
68
68
  }
69
69
  else {
70
- logs_1.log(`subFamily not set so it is not possible to set it and the catalog fields`, "WARN");
70
+ (0, logs_1.log)(`subFamily not set so it is not possible to set it and the catalog fields`, "WARN");
71
71
  }
72
72
  if (model.productLineCode) {
73
- const productLineEntry = await contentful_1.getEntryByCode(model.productLineCode, "topicProductLine", "sys,fields.code");
73
+ const productLineEntry = await (0, contentful_1.getEntryByCode)(model.productLineCode, "topicProductLine", "sys,fields.code");
74
74
  if (productLineEntry) {
75
- data.fields = await contentful_1.addToRelationFields(data, "productLine", productLineEntry.sys.id);
75
+ data.fields = await (0, contentful_1.addToRelationFields)(data, "productLine", productLineEntry.sys.id);
76
76
  }
77
77
  else {
78
- logs_1.log(`topicProductLine with code ${model.productLineCode} not found`, "WARN");
78
+ (0, logs_1.log)(`topicProductLine with code ${model.productLineCode} not found`, "WARN");
79
79
  }
80
80
  }
81
81
  if (model?.destinations?.length) {
82
- logs_1.log(`set destinations`);
83
- data.fields = await contentful_1.addFieldValue(data, "destinations", model.destinations);
82
+ (0, logs_1.log)(`set destinations`);
83
+ data.fields = await (0, contentful_1.addFieldValue)(data, "destinations", model.destinations);
84
84
  }
85
85
  else {
86
- logs_1.log(`destinations not found`, "WARN");
86
+ (0, logs_1.log)(`destinations not found`, "WARN");
87
87
  }
88
- data.fields = await contentful_1.addFieldValue(data, "lastPimSyncDate", utils_1.getLocalISOTime());
88
+ data.fields = await (0, contentful_1.addFieldValue)(data, "lastPimSyncDate", (0, utils_1.getLocalISOTime)());
89
89
  return data;
90
90
  };
91
91
  const updateComponentModelOfSubFamilyPages = async (topicModel) => {
92
- const defaultEnvironmentLocaleCode = await contentful_1.getEnvironmentDefaultLocaleCode();
92
+ const defaultEnvironmentLocaleCode = await (0, contentful_1.getEnvironmentDefaultLocaleCode)();
93
93
  const subFamilyId = topicModel?.fields?.subFamily?.[defaultEnvironmentLocaleCode]?.sys?.id;
94
94
  if (subFamilyId) {
95
- const subFamilyEntry = await contentful_1.getEntryByID(subFamilyId, "topicSubFamily");
95
+ const subFamilyEntry = await (0, contentful_1.getEntryByID)(subFamilyId, "topicSubFamily");
96
96
  if (subFamilyEntry) {
97
- logs_1.log(`Add ${topicModel?.sys?.id} to componentModelPages of the ${subFamilyEntry.sys.id} subFamily page`);
98
- const subFamilyPageEntry = await subfamilies_1.updateComponentModelPagesToSubFamilyPage(subFamilyEntry);
99
- logs_1.log(`${subFamilyPageEntry?.sys?.id} subFamilyPage updated`);
97
+ (0, logs_1.log)(`Add ${topicModel?.sys?.id} to componentModelPages of the ${subFamilyEntry.sys.id} subFamily page`);
98
+ const subFamilyPageEntry = await (0, subfamilies_1.updateComponentModelPagesToSubFamilyPage)(subFamilyEntry);
99
+ (0, logs_1.log)(`${subFamilyPageEntry?.sys?.id} subFamilyPage updated`);
100
100
  }
101
101
  else {
102
- logs_1.log(`subFamily entry with id ${subFamilyId} not found, I cannot add the relationship with the ${topicModel?.sys?.id} model to the componentModelPages contained in the subfamily page`, "WARN");
102
+ (0, logs_1.log)(`subFamily entry with id ${subFamilyId} not found, I cannot add the relationship with the ${topicModel?.sys?.id} model to the componentModelPages contained in the subfamily page`, "WARN");
103
103
  }
104
104
  }
105
105
  else {
106
- logs_1.log(`subFamilyId not found to model ${topicModel?.sys?.id}, I cannot add the relationship to the componentModelPages contained in the subfamily page`, "WARN");
106
+ (0, logs_1.log)(`subFamilyId not found to model ${topicModel?.sys?.id}, I cannot add the relationship to the componentModelPages contained in the subfamily page`, "WARN");
107
107
  }
108
108
  };
109
109
  const importModel = async (model) => {
110
110
  const code = `${model.code}`;
111
- let topicModel = await contentful_1.getEntryByID(code, "topicModel");
111
+ let topicModel = await (0, contentful_1.getEntryByID)(code, "topicModel");
112
112
  const topicModelData = await getTopicModelData(model, topicModel);
113
113
  if (topicModel) {
114
- logs_1.log(`The topicModel ${code} already exists. Updating...`);
115
- topicModel = await contentful_1.updateEntry(topicModel, topicModelData, topicModel.isPublished());
114
+ (0, logs_1.log)(`The topicModel ${code} already exists. Updating...`);
115
+ topicModel = await (0, contentful_1.updateEntry)(topicModel, topicModelData, topicModel.isPublished());
116
116
  }
117
117
  else {
118
- logs_1.log(`The topicModel ${code} not exists. Creating...`);
119
- topicModel = await contentful_1.createEntryWithId("topicModel", code, topicModelData);
118
+ (0, logs_1.log)(`The topicModel ${code} not exists. Creating...`);
119
+ topicModel = await (0, contentful_1.createEntryWithId)("topicModel", code, topicModelData);
120
120
  }
121
121
  return topicModel;
122
122
  };
123
123
  const importModels = async (offset = 0, limit = 40) => {
124
- logs_1.log(`importModels - offset: ${offset}, limit: ${limit}`, "INFO");
125
- const models = await endpoints_1.getOtherCatalogData("models", offset, limit);
124
+ (0, logs_1.log)(`importModels - offset: ${offset}, limit: ${limit}`, "INFO");
125
+ const models = await (0, endpoints_1.getOtherCatalogData)("models", offset, limit);
126
126
  const total = models?.pagedCollection?.length || 0;
127
127
  if (models?.pagedCollection?.length) {
128
- logs_1.log(`Founded ${total} models`);
128
+ (0, logs_1.log)(`Founded ${total} models`);
129
129
  let count = offset;
130
130
  let current = 0;
131
131
  for (const model of models.pagedCollection) {
132
- logs_1.log(`${++count} of ${models.totalCount}`);
132
+ (0, logs_1.log)(`${++count} of ${models.totalCount}`);
133
133
  const topicModel = await importModel(model);
134
134
  await createOrUpdatePage(topicModel);
135
135
  await updateComponentModelOfSubFamilyPages(topicModel);
@@ -139,12 +139,12 @@ const importModels = async (offset = 0, limit = 40) => {
139
139
  logs_1.serverUtils.updateProgress(progress);
140
140
  }
141
141
  if (count % 2 === 0 && count < models.totalCount) {
142
- await utils_1.sleep(1000);
142
+ await (0, utils_1.sleep)(1000);
143
143
  }
144
144
  }
145
145
  }
146
146
  else {
147
- logs_1.log(`No models found`);
147
+ (0, logs_1.log)(`No models found`);
148
148
  }
149
149
  const nextOffset = Number(offset) + Number(limit);
150
150
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/pim/methods/models.ts"],"names":[],"mappings":";;;AAAA,4CAAmD;AACnD,sDAS+B;AAC/B,0CAAmD;AASnD,uCAKqB;AAErB,+CAAyE;AACzE,yCAAkD;AAElD,MAAM,gBAAgB,GAAG,KAAK,EAC5B,KAA4B,EAC5B,KAA4B,EAC5B,MAAc,EACd,UAAiB,EACjB,cAAqB,EACM,EAAE;IAC7B,MAAM,gBAAgB,GAAG,MAAM,4CAA+B,EAAE,CAAC;IACjE,MAAM,QAAQ,GAAqB;QACjC,MAAM,EAAE,cAAc,EAAE,MAAM,IAAI,EAAE;KACrC,CAAC;IAEF,QAAQ,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC;IAE7B,QAAQ,CAAC,MAAM,GAAG,MAAM,0BAAa,CAAC,QAAQ,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;IACxE,QAAQ,CAAC,MAAM,GAAG,MAAM,0BAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;IAGxE,QAAQ,CAAC,MAAM,GAAG,MAAM,gCAAmB,CACzC,QAAQ,EACR,OAAO,EACP,UAAU,CAAC,GAAG,CAAC,EAAE,CAClB,CAAC;IAEF,MAAM,YAAY,GAChB,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;IAC7D,QAAQ,CAAC,MAAM,GAAG,MAAM,+BAAoB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAErE,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAQF,MAAM,kBAAkB,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B,CAAC,CAAC;KACxB;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAElD,OAAO;QACL,MAAM,EAAE,UAAU;QAClB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;QACpB,SAAS,EAAE,UAAU,IAAI,MAAM,CAAC,UAAU;QAC1C,KAAK,EAAE,MAAM,CAAC,UAAU;KACzB,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,YAAY,gBAiDvB"}
@@ -5,24 +5,24 @@ const contentful_1 = require("../../../libs/contentful");
5
5
  const catalogs_1 = require("../catalogs");
6
6
  const logs_1 = require("../../../libs/logs");
7
7
  const createOrUpdateCatalogPages = async () => {
8
- const allTopicCatalgs = await contentful_1.getAllEntries("topicCatalog");
8
+ const allTopicCatalgs = await (0, contentful_1.getAllEntries)("topicCatalog");
9
9
  if (allTopicCatalgs) {
10
10
  for (const topicCatalog of allTopicCatalgs) {
11
- await catalogs_1.importCatalogPage(topicCatalog);
11
+ await (0, catalogs_1.importCatalogPage)(topicCatalog);
12
12
  }
13
13
  }
14
14
  else {
15
- logs_1.log(`No topicCatalog not found`, "WARN");
15
+ (0, logs_1.log)(`No topicCatalog not found`, "WARN");
16
16
  }
17
17
  };
18
18
  exports.createOrUpdateCatalogPages = createOrUpdateCatalogPages;
19
19
  const createOrUpdateCatalogPageByCode = async (catalogCode) => {
20
- const topicCatalog = await contentful_1.getEntryByID(catalogCode, "topicCatalog");
20
+ const topicCatalog = await (0, contentful_1.getEntryByID)(catalogCode, "topicCatalog");
21
21
  if (topicCatalog) {
22
- await catalogs_1.importCatalogPage(topicCatalog);
22
+ await (0, catalogs_1.importCatalogPage)(topicCatalog);
23
23
  }
24
24
  else {
25
- logs_1.log(`topicCatalog ${catalogCode} not found`, "WARN");
25
+ (0, logs_1.log)(`topicCatalog ${catalogCode} not found`, "WARN");
26
26
  }
27
27
  };
28
28
  exports.createOrUpdateCatalogPageByCode = createOrUpdateCatalogPageByCode;
@@ -1 +1 @@
1
- {"version":3,"file":"catalogs.js","sourceRoot":"","sources":["../../../../src/pim/methods/pages/catalogs.ts"],"names":[],"mappings":";;;AAAA,yDAAuE;AACvE,0CAAgD;AAEhD,6CAAyC;AAElC,MAAM,0BAA0B,GAAG,KAAK,IAAI,EAAE;IACnD,MAAM,eAAe,GAAG,MAAM,0BAAa,CAAC,cAAc,CAAC,CAAC;IAE5D,IAAI,eAAe,EAAE;QACnB,KAAK,MAAM,YAAY,IAAI,eAAe,EAAE;YAC1C,MAAM,4BAAiB,CAAC,YAAY,CAAC,CAAC;SACvC;KACF;SAAM;QACL,UAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;KAC1C;AACH,CAAC,CAAC;AAVW,QAAA,0BAA0B,8BAUrC;AAEK,MAAM,+BAA+B,GAAG,KAAK,EAClD,WAA8B,EAC9B,EAAE;IACF,MAAM,YAAY,GAAG,MAAM,yBAAY,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAErE,IAAI,YAAY,EAAE;QAChB,MAAM,4BAAiB,CAAC,YAAY,CAAC,CAAC;KACvC;SAAM;QACL,UAAG,CAAC,gBAAgB,WAAW,YAAY,EAAE,MAAM,CAAC,CAAC;KACtD;AACH,CAAC,CAAC;AAVW,QAAA,+BAA+B,mCAU1C"}
1
+ {"version":3,"file":"catalogs.js","sourceRoot":"","sources":["../../../../src/pim/methods/pages/catalogs.ts"],"names":[],"mappings":";;;AAAA,yDAAuE;AACvE,0CAAgD;AAEhD,6CAAyC;AAElC,MAAM,0BAA0B,GAAG,KAAK,IAAI,EAAE;IACnD,MAAM,eAAe,GAAG,MAAM,IAAA,0BAAa,EAAC,cAAc,CAAC,CAAC;IAE5D,IAAI,eAAe,EAAE;QACnB,KAAK,MAAM,YAAY,IAAI,eAAe,EAAE;YAC1C,MAAM,IAAA,4BAAiB,EAAC,YAAY,CAAC,CAAC;SACvC;KACF;SAAM;QACL,IAAA,UAAG,EAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;KAC1C;AACH,CAAC,CAAC;AAVW,QAAA,0BAA0B,8BAUrC;AAEK,MAAM,+BAA+B,GAAG,KAAK,EAClD,WAA8B,EAC9B,EAAE;IACF,MAAM,YAAY,GAAG,MAAM,IAAA,yBAAY,EAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAErE,IAAI,YAAY,EAAE;QAChB,MAAM,IAAA,4BAAiB,EAAC,YAAY,CAAC,CAAC;KACvC;SAAM;QACL,IAAA,UAAG,EAAC,gBAAgB,WAAW,YAAY,EAAE,MAAM,CAAC,CAAC;KACtD;AACH,CAAC,CAAC;AAVW,QAAA,+BAA+B,mCAU1C"}
@@ -5,14 +5,14 @@ const contentful_1 = require("../../../libs/contentful");
5
5
  const families_1 = require("../families");
6
6
  const logs_1 = require("../../../libs/logs");
7
7
  const createOrUpdateFamilyPages = async (offset, limit = 10) => {
8
- const allTopics = await contentful_1.getAllEntries("topicFamily");
8
+ const allTopics = await (0, contentful_1.getAllEntries)("topicFamily");
9
9
  if (allTopics) {
10
10
  let count = 0;
11
11
  const total = allTopics.length;
12
12
  for (const topic of allTopics) {
13
13
  if (offset <= count || limit === -1) {
14
- logs_1.log(`${count + 1} of ${total}`);
15
- await families_1.createOrUpdatePage(topic);
14
+ (0, logs_1.log)(`${count + 1} of ${total}`);
15
+ await (0, families_1.createOrUpdatePage)(topic);
16
16
  if (limit !== -1 && count + 1 - offset >= limit) {
17
17
  break;
18
18
  }
@@ -27,7 +27,7 @@ const createOrUpdateFamilyPages = async (offset, limit = 10) => {
27
27
  };
28
28
  }
29
29
  else {
30
- logs_1.log(`No topicFamily not found`, "WARN");
30
+ (0, logs_1.log)(`No topicFamily not found`, "WARN");
31
31
  return {
32
32
  offset: Number(offset),
33
33
  limit: Number(limit),
@@ -37,12 +37,12 @@ const createOrUpdateFamilyPages = async (offset, limit = 10) => {
37
37
  };
38
38
  exports.createOrUpdateFamilyPages = createOrUpdateFamilyPages;
39
39
  const createOrUpdateFamilyPageByCode = async (familyCode) => {
40
- const topic = await contentful_1.getEntryByID(familyCode, "topicFamily");
40
+ const topic = await (0, contentful_1.getEntryByID)(familyCode, "topicFamily");
41
41
  if (topic) {
42
- await families_1.createOrUpdatePage(topic);
42
+ await (0, families_1.createOrUpdatePage)(topic);
43
43
  }
44
44
  else {
45
- logs_1.log(`topicFamily ${familyCode} not found`, "WARN");
45
+ (0, logs_1.log)(`topicFamily ${familyCode} not found`, "WARN");
46
46
  }
47
47
  };
48
48
  exports.createOrUpdateFamilyPageByCode = createOrUpdateFamilyPageByCode;
@@ -1 +1 @@
1
- {"version":3,"file":"families.js","sourceRoot":"","sources":["../../../../src/pim/methods/pages/families.ts"],"names":[],"mappings":";;;AAAA,yDAAuE;AACvE,0CAAiD;AACjD,6CAAyC;AAElC,MAAM,yBAAyB,GAAG,KAAK,EAC5C,MAAc,EACd,QAAgB,EAAE,EAClB,EAAE;IACF,MAAM,SAAS,GAAG,MAAM,0BAAa,CAAC,aAAa,CAAC,CAAC;IAErD,IAAI,SAAS,EAAE;QACb,IAAI,KAAK,GAAW,CAAC,CAAC;QACtB,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC;QAC/B,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE;YAC7B,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;gBACnC,UAAG,CAAC,GAAG,KAAK,GAAG,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC;gBAChC,MAAM,6BAAkB,CAAC,KAAK,CAAC,CAAC;gBAChC,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE;oBAC/C,MAAM;iBACP;aACF;YACD,KAAK,EAAE,CAAC;SACT;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAElD,OAAO;YACL,MAAM,EAAE,UAAU;YAClB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;YACpB,SAAS,EAAE,UAAU,IAAI,KAAK;SAC/B,CAAC;KACH;SAAM;QACL,UAAG,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;QACxC,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;YACtB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;YACpB,SAAS,EAAE,IAAI;SAChB,CAAC;KACH;AACH,CAAC,CAAC;AAnCW,QAAA,yBAAyB,6BAmCpC;AAEK,MAAM,8BAA8B,GAAG,KAAK,EAAE,UAAkB,EAAE,EAAE;IACzE,MAAM,KAAK,GAAG,MAAM,yBAAY,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAE5D,IAAI,KAAK,EAAE;QACT,MAAM,6BAAkB,CAAC,KAAK,CAAC,CAAC;KACjC;SAAM;QACL,UAAG,CAAC,eAAe,UAAU,YAAY,EAAE,MAAM,CAAC,CAAC;KACpD;AACH,CAAC,CAAC;AARW,QAAA,8BAA8B,kCAQzC"}
1
+ {"version":3,"file":"families.js","sourceRoot":"","sources":["../../../../src/pim/methods/pages/families.ts"],"names":[],"mappings":";;;AAAA,yDAAuE;AACvE,0CAAiD;AACjD,6CAAyC;AAElC,MAAM,yBAAyB,GAAG,KAAK,EAC5C,MAAc,EACd,QAAgB,EAAE,EAClB,EAAE;IACF,MAAM,SAAS,GAAG,MAAM,IAAA,0BAAa,EAAC,aAAa,CAAC,CAAC;IAErD,IAAI,SAAS,EAAE;QACb,IAAI,KAAK,GAAW,CAAC,CAAC;QACtB,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC;QAC/B,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE;YAC7B,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;gBACnC,IAAA,UAAG,EAAC,GAAG,KAAK,GAAG,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC;gBAChC,MAAM,IAAA,6BAAkB,EAAC,KAAK,CAAC,CAAC;gBAChC,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,MAAM,IAAI,KAAK,EAAE;oBAC/C,MAAM;iBACP;aACF;YACD,KAAK,EAAE,CAAC;SACT;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAElD,OAAO;YACL,MAAM,EAAE,UAAU;YAClB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;YACpB,SAAS,EAAE,UAAU,IAAI,KAAK;SAC/B,CAAC;KACH;SAAM;QACL,IAAA,UAAG,EAAC,0BAA0B,EAAE,MAAM,CAAC,CAAC;QACxC,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;YACtB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;YACpB,SAAS,EAAE,IAAI;SAChB,CAAC;KACH;AACH,CAAC,CAAC;AAnCW,QAAA,yBAAyB,6BAmCpC;AAEK,MAAM,8BAA8B,GAAG,KAAK,EAAE,UAAkB,EAAE,EAAE;IACzE,MAAM,KAAK,GAAG,MAAM,IAAA,yBAAY,EAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAE5D,IAAI,KAAK,EAAE;QACT,MAAM,IAAA,6BAAkB,EAAC,KAAK,CAAC,CAAC;KACjC;SAAM;QACL,IAAA,UAAG,EAAC,eAAe,UAAU,YAAY,EAAE,MAAM,CAAC,CAAC;KACpD;AACH,CAAC,CAAC;AARW,QAAA,8BAA8B,kCAQzC"}
@@ -5,14 +5,14 @@ const contentful_1 = require("../../../libs/contentful");
5
5
  const subfamilies_1 = require("../subfamilies");
6
6
  const logs_1 = require("../../../libs/logs");
7
7
  const createOrUpdateSubFamilyPages = async (offset, limit = 10) => {
8
- const allTopics = await contentful_1.getAllEntries("topicSubFamily");
8
+ const allTopics = await (0, contentful_1.getAllEntries)("topicSubFamily");
9
9
  if (allTopics) {
10
10
  let count = 0;
11
11
  const total = allTopics.length;
12
12
  for (const topic of allTopics) {
13
13
  if (offset <= count || limit === -1) {
14
- logs_1.log(`${count + 1} of ${total}`);
15
- await subfamilies_1.createOrUpdatePage(topic);
14
+ (0, logs_1.log)(`${count + 1} of ${total}`);
15
+ await (0, subfamilies_1.createOrUpdatePage)(topic);
16
16
  if (limit !== -1 && count + 1 - offset >= limit) {
17
17
  break;
18
18
  }
@@ -27,7 +27,7 @@ const createOrUpdateSubFamilyPages = async (offset, limit = 10) => {
27
27
  };
28
28
  }
29
29
  else {
30
- logs_1.log(`No topicSubFamily not found`, "WARN");
30
+ (0, logs_1.log)(`No topicSubFamily not found`, "WARN");
31
31
  return {
32
32
  offset: Number(offset),
33
33
  limit: Number(limit),
@@ -37,24 +37,24 @@ const createOrUpdateSubFamilyPages = async (offset, limit = 10) => {
37
37
  };
38
38
  exports.createOrUpdateSubFamilyPages = createOrUpdateSubFamilyPages;
39
39
  const createOrUpdateSubFamilyPageByCode = async (subfamilyCode) => {
40
- const topic = await contentful_1.getEntryByID(subfamilyCode, "topicSubFamily");
40
+ const topic = await (0, contentful_1.getEntryByID)(subfamilyCode, "topicSubFamily");
41
41
  if (topic) {
42
- await subfamilies_1.createOrUpdatePage(topic);
42
+ await (0, subfamilies_1.createOrUpdatePage)(topic);
43
43
  }
44
44
  else {
45
- logs_1.log(`topicSubFamily ${subfamilyCode} not found`, "WARN");
45
+ (0, logs_1.log)(`topicSubFamily ${subfamilyCode} not found`, "WARN");
46
46
  }
47
47
  };
48
48
  exports.createOrUpdateSubFamilyPageByCode = createOrUpdateSubFamilyPageByCode;
49
49
  const createOrUpdateSubFamilyPagesByCatalog = async (catalogCode, offset, limit = 10) => {
50
- const allTopics = await contentful_1.getAllEntries("topicSubFamily", "", "fields.catalog.sys.id", catalogCode);
50
+ const allTopics = await (0, contentful_1.getAllEntries)("topicSubFamily", "", "fields.catalog.sys.id", catalogCode);
51
51
  if (allTopics) {
52
52
  let count = 0;
53
53
  const total = allTopics.length;
54
54
  for (const topic of allTopics) {
55
55
  if (offset <= count || limit === -1) {
56
- logs_1.log(`${count + 1} of ${total}`);
57
- await subfamilies_1.createOrUpdatePage(topic);
56
+ (0, logs_1.log)(`${count + 1} of ${total}`);
57
+ await (0, subfamilies_1.createOrUpdatePage)(topic);
58
58
  if (limit !== -1 && count + 1 - offset >= limit) {
59
59
  break;
60
60
  }
@@ -69,7 +69,7 @@ const createOrUpdateSubFamilyPagesByCatalog = async (catalogCode, offset, limit
69
69
  };
70
70
  }
71
71
  else {
72
- logs_1.log(`No topicSubFamily not found on catalog ${catalogCode}`, "WARN");
72
+ (0, logs_1.log)(`No topicSubFamily not found on catalog ${catalogCode}`, "WARN");
73
73
  return {
74
74
  offset: Number(offset),
75
75
  limit: Number(limit),