pim-import 4.25.0 → 4.25.1

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.
@@ -16,109 +16,8 @@ const publishEntry = async (entryId, type) => {
16
16
  }
17
17
  };
18
18
  const publishTopicProduct = async (productEntry) => {
19
- const defEnvLocaleCode = await contentful_1.getEnvironmentDefaultLocaleCode();
20
19
  const pageId = products_1.getProductPageIdByCode(productEntry.sys.id);
21
20
  await publishEntry(pageId, "page");
22
- if (productEntry?.fields?.catalogs?.[defEnvLocaleCode].length) {
23
- for (const catalog of productEntry.fields.catalogs[defEnvLocaleCode]) {
24
- await publishEntry(catalog.sys.id, "topicCatalog");
25
- await publishEntry(`${catalog.sys.id}_PAGE`, "page");
26
- }
27
- }
28
- if (productEntry?.fields?.thumbnailImgix?.[defEnvLocaleCode]) {
29
- const thumbnailImgix = productEntry?.fields?.thumbnailImgix?.[defEnvLocaleCode];
30
- if (thumbnailImgix) {
31
- await publishEntry(thumbnailImgix.sys.id, "wrapperImgix");
32
- }
33
- }
34
- if (productEntry?.fields?.designers?.[defEnvLocaleCode].length) {
35
- for (const designer of productEntry.fields.designers[defEnvLocaleCode]) {
36
- await publishEntry(designer.sys.id, "topicDesigner");
37
- }
38
- }
39
- if (productEntry?.fields?.categoriesArchitectural?.[defEnvLocaleCode].length) {
40
- for (const category of productEntry.fields.categoriesArchitectural[defEnvLocaleCode]) {
41
- await publishEntry(category.sys.id, "topicCategory");
42
- await publishEntry(`${category.sys.id}_PAGE`, "page");
43
- }
44
- }
45
- if (productEntry?.fields?.categoriesOutdoor?.[defEnvLocaleCode].length) {
46
- for (const category of productEntry.fields.categoriesOutdoor[defEnvLocaleCode]) {
47
- await publishEntry(category.sys.id, "topicCategory");
48
- await publishEntry(`${category.sys.id}_PAGE`, "page");
49
- }
50
- }
51
- if (productEntry?.fields?.categoriesDecorative?.[defEnvLocaleCode].length) {
52
- for (const category of productEntry.fields.categoriesDecorative[defEnvLocaleCode]) {
53
- await publishEntry(category.sys.id, "topicCategory");
54
- await publishEntry(`${category.sys.id}_PAGE`, "page");
55
- }
56
- }
57
- if (productEntry?.fields?.families?.[defEnvLocaleCode].length) {
58
- for (const family of productEntry.fields.families[defEnvLocaleCode]) {
59
- await publishEntry(family.sys.id, "topicFamily");
60
- await publishEntry(`${family.sys.id}_PAGE`, "page");
61
- }
62
- }
63
- if (productEntry?.fields?.subFamiliesArchitectural?.[defEnvLocaleCode].length) {
64
- for (const subFamily of productEntry.fields.subFamiliesArchitectural[defEnvLocaleCode]) {
65
- await publishEntry(subFamily.sys.id, "topicSubFamily");
66
- await publishEntry(`${subFamily.sys.id}_PAGE`, "page");
67
- }
68
- }
69
- if (productEntry?.fields?.subFamiliesOutdoor?.[defEnvLocaleCode].length) {
70
- for (const subFamily of productEntry.fields.subFamiliesOutdoor[defEnvLocaleCode]) {
71
- await publishEntry(subFamily.sys.id, "topicSubFamily");
72
- await publishEntry(`${subFamily.sys.id}_PAGE`, "page");
73
- }
74
- }
75
- if (productEntry?.fields?.subFamiliesDecorative?.[defEnvLocaleCode].length) {
76
- for (const subFamily of productEntry.fields.subFamiliesDecorative[defEnvLocaleCode]) {
77
- await publishEntry(subFamily.sys.id, "topicSubFamily");
78
- await publishEntry(`${subFamily.sys.id}_PAGE`, "page");
79
- }
80
- }
81
- if (productEntry?.fields?.modelsArchitectural?.[defEnvLocaleCode].length) {
82
- for (const model of productEntry.fields.modelsArchitectural[defEnvLocaleCode]) {
83
- await publishEntry(model.sys.id, "topicModel");
84
- await publishEntry(`${model.sys.id}_PAGE`, "page");
85
- }
86
- }
87
- if (productEntry?.fields?.modelsOutdoor?.[defEnvLocaleCode].length) {
88
- for (const model of productEntry.fields.modelsOutdoor[defEnvLocaleCode]) {
89
- await publishEntry(model.sys.id, "topicModel");
90
- await publishEntry(`${model.sys.id}_PAGE`, "page");
91
- }
92
- }
93
- if (productEntry?.fields?.modelsDecorative?.[defEnvLocaleCode].length) {
94
- for (const model of productEntry.fields.modelsDecorative[defEnvLocaleCode]) {
95
- await publishEntry(model.sys.id, "topicModel");
96
- await publishEntry(`${model.sys.id}_PAGE`, "page");
97
- }
98
- }
99
- if (productEntry?.fields?.subModelsArchitectural?.[defEnvLocaleCode].length) {
100
- for (const subModel of productEntry.fields.subModelsArchitectural[defEnvLocaleCode]) {
101
- await publishEntry(subModel.sys.id, "topicSubModel");
102
- }
103
- }
104
- if (productEntry?.fields?.subModelsOutdoor?.[defEnvLocaleCode].length) {
105
- for (const subModel of productEntry.fields.subModelsOutdoor[defEnvLocaleCode]) {
106
- await publishEntry(subModel.sys.id, "topicSubModel");
107
- }
108
- }
109
- if (productEntry?.fields?.subModelsDecorative?.[defEnvLocaleCode].length) {
110
- for (const subModel of productEntry.fields.subModelsDecorative[defEnvLocaleCode]) {
111
- await publishEntry(subModel.sys.id, "topicSubModel");
112
- }
113
- }
114
- if (productEntry?.fields?.productLine?.[defEnvLocaleCode]) {
115
- const productLine = productEntry?.fields?.productLine?.[defEnvLocaleCode];
116
- await publishEntry(productLine.sys.id, "topicProductLine");
117
- }
118
- if (productEntry?.fields?.productSubLine?.[defEnvLocaleCode]) {
119
- const productSubLine = productEntry?.fields?.productSubLine?.[defEnvLocaleCode];
120
- await publishEntry(productSubLine.sys.id, "topicProductSubLine");
121
- }
122
21
  await productEntry.publish();
123
22
  };
124
23
  exports.publishTopicProduct = publishTopicProduct;
@@ -1 +1 @@
1
- {"version":3,"file":"bulkPublish.js","sourceRoot":"","sources":["../../../src/pim/methods/bulkPublish.ts"],"names":[],"mappings":";;;AAEA,sDAI+B;AAC/B,0CAAmD;AACnD,yCAAoD;AACpD,qDAAwD;AAExD,MAAM,YAAY,GAAG,KAAK,EAAE,OAAe,EAAE,IAAY,EAAE,EAAE;IAC3D,MAAM,KAAK,GAAG,MAAM,yBAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAChD,IAAI,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE;QAC5B,UAAG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AC,IAAI,CAAC,CAAC;gBAChC,MAAM,GAAG,oBAAoB,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBAC3C,IAAI,kBAAW,EAAE;oBACf,kBAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;iBACzB;gBACD,MAAM,yBAAc,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;gBAExC,IAAI,kBAAW,EAAE;oBACf,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC;oBAC1D,kBAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;iBACtC;aACF;YAAC,OAAO,GAAG,EAAE;gBACZ,MAAM,GAAG,iBAAiB,IAAI,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;gBAC/C,IAAI,kBAAW,EAAE;oBACf,kBAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;iBACzB;aACF;SACF;KACF;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;IACzC,OAAO;QACL,SAAS;QACT,KAAK;KACN,CAAC;AACJ,CAAC,CAAC;AArEW,QAAA,uBAAuB,2BAqElC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pim-import",
3
- "version": "4.25.0",
3
+ "version": "4.25.1",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "types/index.d.ts",
@@ -20,175 +20,175 @@ const publishEntry = async (entryId: string, type: string) => {
20
20
  };
21
21
 
22
22
  export const publishTopicProduct = async (productEntry: Entry) => {
23
- const defEnvLocaleCode = await getEnvironmentDefaultLocaleCode();
23
+ // const defEnvLocaleCode = await getEnvironmentDefaultLocaleCode();
24
24
 
25
25
  // page
26
26
  const pageId = getProductPageIdByCode(productEntry.sys.id);
27
27
  await publishEntry(pageId, "page");
28
28
 
29
- // catalogs
30
- if (productEntry?.fields?.catalogs?.[defEnvLocaleCode].length) {
31
- for (const catalog of productEntry.fields.catalogs[defEnvLocaleCode]) {
32
- await publishEntry(catalog.sys.id, "topicCatalog");
33
- await publishEntry(`${catalog.sys.id}_PAGE`, "page");
34
- }
35
- }
29
+ // // catalogs
30
+ // if (productEntry?.fields?.catalogs?.[defEnvLocaleCode].length) {
31
+ // for (const catalog of productEntry.fields.catalogs[defEnvLocaleCode]) {
32
+ // await publishEntry(catalog.sys.id, "topicCatalog");
33
+ // await publishEntry(`${catalog.sys.id}_PAGE`, "page");
34
+ // }
35
+ // }
36
36
 
37
- // Thumbnail Imgix
38
- if (productEntry?.fields?.thumbnailImgix?.[defEnvLocaleCode]) {
39
- const thumbnailImgix =
40
- productEntry?.fields?.thumbnailImgix?.[defEnvLocaleCode];
41
- if (thumbnailImgix) {
42
- await publishEntry(thumbnailImgix.sys.id, "wrapperImgix");
43
- }
44
- }
37
+ // // Thumbnail Imgix
38
+ // if (productEntry?.fields?.thumbnailImgix?.[defEnvLocaleCode]) {
39
+ // const thumbnailImgix =
40
+ // productEntry?.fields?.thumbnailImgix?.[defEnvLocaleCode];
41
+ // if (thumbnailImgix) {
42
+ // await publishEntry(thumbnailImgix.sys.id, "wrapperImgix");
43
+ // }
44
+ // }
45
45
 
46
- // Designers
47
- if (productEntry?.fields?.designers?.[defEnvLocaleCode].length) {
48
- for (const designer of productEntry.fields.designers[defEnvLocaleCode]) {
49
- await publishEntry(designer.sys.id, "topicDesigner");
50
- }
51
- }
46
+ // // Designers
47
+ // if (productEntry?.fields?.designers?.[defEnvLocaleCode].length) {
48
+ // for (const designer of productEntry.fields.designers[defEnvLocaleCode]) {
49
+ // await publishEntry(designer.sys.id, "topicDesigner");
50
+ // }
51
+ // }
52
52
 
53
- // categoriesArchitectural
54
- if (
55
- productEntry?.fields?.categoriesArchitectural?.[defEnvLocaleCode].length
56
- ) {
57
- for (const category of productEntry.fields.categoriesArchitectural[
58
- defEnvLocaleCode
59
- ]) {
60
- await publishEntry(category.sys.id, "topicCategory");
61
- await publishEntry(`${category.sys.id}_PAGE`, "page");
62
- }
63
- }
53
+ // // categoriesArchitectural
54
+ // if (
55
+ // productEntry?.fields?.categoriesArchitectural?.[defEnvLocaleCode].length
56
+ // ) {
57
+ // for (const category of productEntry.fields.categoriesArchitectural[
58
+ // defEnvLocaleCode
59
+ // ]) {
60
+ // await publishEntry(category.sys.id, "topicCategory");
61
+ // await publishEntry(`${category.sys.id}_PAGE`, "page");
62
+ // }
63
+ // }
64
64
 
65
- // categoriesOutdoor
66
- if (productEntry?.fields?.categoriesOutdoor?.[defEnvLocaleCode].length) {
67
- for (const category of productEntry.fields.categoriesOutdoor[
68
- defEnvLocaleCode
69
- ]) {
70
- await publishEntry(category.sys.id, "topicCategory");
71
- await publishEntry(`${category.sys.id}_PAGE`, "page");
72
- }
73
- }
65
+ // // categoriesOutdoor
66
+ // if (productEntry?.fields?.categoriesOutdoor?.[defEnvLocaleCode].length) {
67
+ // for (const category of productEntry.fields.categoriesOutdoor[
68
+ // defEnvLocaleCode
69
+ // ]) {
70
+ // await publishEntry(category.sys.id, "topicCategory");
71
+ // await publishEntry(`${category.sys.id}_PAGE`, "page");
72
+ // }
73
+ // }
74
74
 
75
- // categoriesDecorative
76
- if (productEntry?.fields?.categoriesDecorative?.[defEnvLocaleCode].length) {
77
- for (const category of productEntry.fields.categoriesDecorative[
78
- defEnvLocaleCode
79
- ]) {
80
- await publishEntry(category.sys.id, "topicCategory");
81
- await publishEntry(`${category.sys.id}_PAGE`, "page");
82
- }
83
- }
75
+ // // categoriesDecorative
76
+ // if (productEntry?.fields?.categoriesDecorative?.[defEnvLocaleCode].length) {
77
+ // for (const category of productEntry.fields.categoriesDecorative[
78
+ // defEnvLocaleCode
79
+ // ]) {
80
+ // await publishEntry(category.sys.id, "topicCategory");
81
+ // await publishEntry(`${category.sys.id}_PAGE`, "page");
82
+ // }
83
+ // }
84
84
 
85
- // categoriesDecorative
86
- if (productEntry?.fields?.families?.[defEnvLocaleCode].length) {
87
- for (const family of productEntry.fields.families[defEnvLocaleCode]) {
88
- await publishEntry(family.sys.id, "topicFamily");
89
- await publishEntry(`${family.sys.id}_PAGE`, "page");
90
- }
91
- }
85
+ // // categoriesDecorative
86
+ // if (productEntry?.fields?.families?.[defEnvLocaleCode].length) {
87
+ // for (const family of productEntry.fields.families[defEnvLocaleCode]) {
88
+ // await publishEntry(family.sys.id, "topicFamily");
89
+ // await publishEntry(`${family.sys.id}_PAGE`, "page");
90
+ // }
91
+ // }
92
92
 
93
- // subFamiliesArchitectural
94
- if (
95
- productEntry?.fields?.subFamiliesArchitectural?.[defEnvLocaleCode].length
96
- ) {
97
- for (const subFamily of productEntry.fields.subFamiliesArchitectural[
98
- defEnvLocaleCode
99
- ]) {
100
- await publishEntry(subFamily.sys.id, "topicSubFamily");
101
- await publishEntry(`${subFamily.sys.id}_PAGE`, "page");
102
- }
103
- }
93
+ // // subFamiliesArchitectural
94
+ // if (
95
+ // productEntry?.fields?.subFamiliesArchitectural?.[defEnvLocaleCode].length
96
+ // ) {
97
+ // for (const subFamily of productEntry.fields.subFamiliesArchitectural[
98
+ // defEnvLocaleCode
99
+ // ]) {
100
+ // await publishEntry(subFamily.sys.id, "topicSubFamily");
101
+ // await publishEntry(`${subFamily.sys.id}_PAGE`, "page");
102
+ // }
103
+ // }
104
104
 
105
- // subFamiliesOutdoor
106
- if (productEntry?.fields?.subFamiliesOutdoor?.[defEnvLocaleCode].length) {
107
- for (const subFamily of productEntry.fields.subFamiliesOutdoor[
108
- defEnvLocaleCode
109
- ]) {
110
- await publishEntry(subFamily.sys.id, "topicSubFamily");
111
- await publishEntry(`${subFamily.sys.id}_PAGE`, "page");
112
- }
113
- }
105
+ // // subFamiliesOutdoor
106
+ // if (productEntry?.fields?.subFamiliesOutdoor?.[defEnvLocaleCode].length) {
107
+ // for (const subFamily of productEntry.fields.subFamiliesOutdoor[
108
+ // defEnvLocaleCode
109
+ // ]) {
110
+ // await publishEntry(subFamily.sys.id, "topicSubFamily");
111
+ // await publishEntry(`${subFamily.sys.id}_PAGE`, "page");
112
+ // }
113
+ // }
114
114
 
115
- // subFamiliesDecorative
116
- if (productEntry?.fields?.subFamiliesDecorative?.[defEnvLocaleCode].length) {
117
- for (const subFamily of productEntry.fields.subFamiliesDecorative[
118
- defEnvLocaleCode
119
- ]) {
120
- await publishEntry(subFamily.sys.id, "topicSubFamily");
121
- await publishEntry(`${subFamily.sys.id}_PAGE`, "page");
122
- }
123
- }
115
+ // // subFamiliesDecorative
116
+ // if (productEntry?.fields?.subFamiliesDecorative?.[defEnvLocaleCode].length) {
117
+ // for (const subFamily of productEntry.fields.subFamiliesDecorative[
118
+ // defEnvLocaleCode
119
+ // ]) {
120
+ // await publishEntry(subFamily.sys.id, "topicSubFamily");
121
+ // await publishEntry(`${subFamily.sys.id}_PAGE`, "page");
122
+ // }
123
+ // }
124
124
 
125
- // modelsArchitectural
126
- if (productEntry?.fields?.modelsArchitectural?.[defEnvLocaleCode].length) {
127
- for (const model of productEntry.fields.modelsArchitectural[
128
- defEnvLocaleCode
129
- ]) {
130
- await publishEntry(model.sys.id, "topicModel");
131
- await publishEntry(`${model.sys.id}_PAGE`, "page");
132
- }
133
- }
125
+ // // modelsArchitectural
126
+ // if (productEntry?.fields?.modelsArchitectural?.[defEnvLocaleCode].length) {
127
+ // for (const model of productEntry.fields.modelsArchitectural[
128
+ // defEnvLocaleCode
129
+ // ]) {
130
+ // await publishEntry(model.sys.id, "topicModel");
131
+ // await publishEntry(`${model.sys.id}_PAGE`, "page");
132
+ // }
133
+ // }
134
134
 
135
- // modelsOutdoor
136
- if (productEntry?.fields?.modelsOutdoor?.[defEnvLocaleCode].length) {
137
- for (const model of productEntry.fields.modelsOutdoor[defEnvLocaleCode]) {
138
- await publishEntry(model.sys.id, "topicModel");
139
- await publishEntry(`${model.sys.id}_PAGE`, "page");
140
- }
141
- }
135
+ // // modelsOutdoor
136
+ // if (productEntry?.fields?.modelsOutdoor?.[defEnvLocaleCode].length) {
137
+ // for (const model of productEntry.fields.modelsOutdoor[defEnvLocaleCode]) {
138
+ // await publishEntry(model.sys.id, "topicModel");
139
+ // await publishEntry(`${model.sys.id}_PAGE`, "page");
140
+ // }
141
+ // }
142
142
 
143
- // modelsDecorative
144
- if (productEntry?.fields?.modelsDecorative?.[defEnvLocaleCode].length) {
145
- for (const model of productEntry.fields.modelsDecorative[
146
- defEnvLocaleCode
147
- ]) {
148
- await publishEntry(model.sys.id, "topicModel");
149
- await publishEntry(`${model.sys.id}_PAGE`, "page");
150
- }
151
- }
143
+ // // modelsDecorative
144
+ // if (productEntry?.fields?.modelsDecorative?.[defEnvLocaleCode].length) {
145
+ // for (const model of productEntry.fields.modelsDecorative[
146
+ // defEnvLocaleCode
147
+ // ]) {
148
+ // await publishEntry(model.sys.id, "topicModel");
149
+ // await publishEntry(`${model.sys.id}_PAGE`, "page");
150
+ // }
151
+ // }
152
152
 
153
- // subModelsArchitectural
154
- if (productEntry?.fields?.subModelsArchitectural?.[defEnvLocaleCode].length) {
155
- for (const subModel of productEntry.fields.subModelsArchitectural[
156
- defEnvLocaleCode
157
- ]) {
158
- await publishEntry(subModel.sys.id, "topicSubModel");
159
- }
160
- }
153
+ // // subModelsArchitectural
154
+ // if (productEntry?.fields?.subModelsArchitectural?.[defEnvLocaleCode].length) {
155
+ // for (const subModel of productEntry.fields.subModelsArchitectural[
156
+ // defEnvLocaleCode
157
+ // ]) {
158
+ // await publishEntry(subModel.sys.id, "topicSubModel");
159
+ // }
160
+ // }
161
161
 
162
- // subModelsOutdoor
163
- if (productEntry?.fields?.subModelsOutdoor?.[defEnvLocaleCode].length) {
164
- for (const subModel of productEntry.fields.subModelsOutdoor[
165
- defEnvLocaleCode
166
- ]) {
167
- await publishEntry(subModel.sys.id, "topicSubModel");
168
- }
169
- }
162
+ // // subModelsOutdoor
163
+ // if (productEntry?.fields?.subModelsOutdoor?.[defEnvLocaleCode].length) {
164
+ // for (const subModel of productEntry.fields.subModelsOutdoor[
165
+ // defEnvLocaleCode
166
+ // ]) {
167
+ // await publishEntry(subModel.sys.id, "topicSubModel");
168
+ // }
169
+ // }
170
170
 
171
- // subModelsDecorative
172
- if (productEntry?.fields?.subModelsDecorative?.[defEnvLocaleCode].length) {
173
- for (const subModel of productEntry.fields.subModelsDecorative[
174
- defEnvLocaleCode
175
- ]) {
176
- await publishEntry(subModel.sys.id, "topicSubModel");
177
- }
178
- }
171
+ // // subModelsDecorative
172
+ // if (productEntry?.fields?.subModelsDecorative?.[defEnvLocaleCode].length) {
173
+ // for (const subModel of productEntry.fields.subModelsDecorative[
174
+ // defEnvLocaleCode
175
+ // ]) {
176
+ // await publishEntry(subModel.sys.id, "topicSubModel");
177
+ // }
178
+ // }
179
179
 
180
- // productLine
181
- if (productEntry?.fields?.productLine?.[defEnvLocaleCode]) {
182
- const productLine = productEntry?.fields?.productLine?.[defEnvLocaleCode];
183
- await publishEntry(productLine.sys.id, "topicProductLine");
184
- }
180
+ // // productLine
181
+ // if (productEntry?.fields?.productLine?.[defEnvLocaleCode]) {
182
+ // const productLine = productEntry?.fields?.productLine?.[defEnvLocaleCode];
183
+ // await publishEntry(productLine.sys.id, "topicProductLine");
184
+ // }
185
185
 
186
- // productSubLine
187
- if (productEntry?.fields?.productSubLine?.[defEnvLocaleCode]) {
188
- const productSubLine =
189
- productEntry?.fields?.productSubLine?.[defEnvLocaleCode];
190
- await publishEntry(productSubLine.sys.id, "topicProductSubLine");
191
- }
186
+ // // productSubLine
187
+ // if (productEntry?.fields?.productSubLine?.[defEnvLocaleCode]) {
188
+ // const productSubLine =
189
+ // productEntry?.fields?.productSubLine?.[defEnvLocaleCode];
190
+ // await publishEntry(productSubLine.sys.id, "topicProductSubLine");
191
+ // }
192
192
 
193
193
  // product
194
194
  await productEntry.publish();