@wix/auto_sdk_stores_product-groups-v-3 1.0.0
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.
- package/build/cjs/index.d.ts +11 -0
- package/build/cjs/index.js +1279 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +7 -0
- package/build/cjs/index.typings.js +1141 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1393 -0
- package/build/cjs/meta.js +939 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/stores-catalog-v3-product-group-product-groups-v-3.universal-BSxpFEZE.d.ts +1824 -0
- package/build/es/index.d.mts +11 -0
- package/build/es/index.mjs +1226 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +7 -0
- package/build/es/index.typings.mjs +1087 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +1393 -0
- package/build/es/meta.mjs +884 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/stores-catalog-v3-product-group-product-groups-v-3.universal-BSxpFEZE.d.mts +1824 -0
- package/build/internal/cjs/index.d.ts +162 -0
- package/build/internal/cjs/index.js +1279 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +21 -0
- package/build/internal/cjs/index.typings.js +1141 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1393 -0
- package/build/internal/cjs/meta.js +939 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/stores-catalog-v3-product-group-product-groups-v-3.universal-4XnTTWRs.d.ts +1986 -0
- package/build/internal/es/index.d.mts +162 -0
- package/build/internal/es/index.mjs +1226 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +21 -0
- package/build/internal/es/index.typings.mjs +1087 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +1393 -0
- package/build/internal/es/meta.mjs +884 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/build/internal/es/stores-catalog-v3-product-group-product-groups-v-3.universal-4XnTTWRs.d.mts +1986 -0
- package/meta/package.json +3 -0
- package/package.json +55 -0
|
@@ -0,0 +1,1087 @@
|
|
|
1
|
+
// src/stores-catalog-v3-product-group-product-groups-v-3.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import { queryBuilder } from "@wix/sdk-runtime/query-builder";
|
|
4
|
+
import {
|
|
5
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
6
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
7
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
8
|
+
|
|
9
|
+
// src/stores-catalog-v3-product-group-product-groups-v-3.http.ts
|
|
10
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
11
|
+
import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
|
|
12
|
+
import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
|
|
13
|
+
import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
14
|
+
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
15
|
+
import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
|
|
16
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
17
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
18
|
+
function resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl(opts) {
|
|
19
|
+
const domainToMappings = {
|
|
20
|
+
"api._api_base_domain_": [
|
|
21
|
+
{
|
|
22
|
+
srcPath: "/product-group",
|
|
23
|
+
destPath: ""
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"editor._base_domain_": [
|
|
27
|
+
{
|
|
28
|
+
srcPath: "/_api/product-group",
|
|
29
|
+
destPath: ""
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"blocks._base_domain_": [
|
|
33
|
+
{
|
|
34
|
+
srcPath: "/_api/product-group",
|
|
35
|
+
destPath: ""
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"create.editorx": [
|
|
39
|
+
{
|
|
40
|
+
srcPath: "/_api/product-group",
|
|
41
|
+
destPath: ""
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
_: [
|
|
45
|
+
{
|
|
46
|
+
srcPath: "/_api/product-group",
|
|
47
|
+
destPath: ""
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"manage._base_domain_": [
|
|
51
|
+
{
|
|
52
|
+
srcPath: "/_api/product-group",
|
|
53
|
+
destPath: ""
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"www.wixapis.com": [
|
|
57
|
+
{
|
|
58
|
+
srcPath: "/stores/v3/product-groups",
|
|
59
|
+
destPath: "/v3/product-groups"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
srcPath: "/stores/v3/bulk/product-groups",
|
|
63
|
+
destPath: "/v3/bulk/product-groups"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"*.dev.wix-code.com": [
|
|
67
|
+
{
|
|
68
|
+
srcPath: "/_api/product-group",
|
|
69
|
+
destPath: ""
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
};
|
|
73
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
74
|
+
}
|
|
75
|
+
var PACKAGE_NAME = "@wix/auto_sdk_stores_product-groups-v-3";
|
|
76
|
+
function createProductGroup(payload) {
|
|
77
|
+
function __createProductGroup({ host }) {
|
|
78
|
+
const serializedData = transformPaths(payload, [
|
|
79
|
+
{
|
|
80
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
81
|
+
paths: [
|
|
82
|
+
{ path: "productGroup.createdDate" },
|
|
83
|
+
{ path: "productGroup.updatedDate" }
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
]);
|
|
87
|
+
const metadata = {
|
|
88
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
89
|
+
method: "POST",
|
|
90
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.CreateProductGroup",
|
|
91
|
+
packageName: PACKAGE_NAME,
|
|
92
|
+
migrationOptions: {
|
|
93
|
+
optInTransformResponse: true
|
|
94
|
+
},
|
|
95
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
96
|
+
protoPath: "/v3/product-groups",
|
|
97
|
+
data: serializedData,
|
|
98
|
+
host
|
|
99
|
+
}),
|
|
100
|
+
data: serializedData,
|
|
101
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
102
|
+
{
|
|
103
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
104
|
+
paths: [
|
|
105
|
+
{ path: "productGroup.createdDate" },
|
|
106
|
+
{ path: "productGroup.updatedDate" }
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
])
|
|
110
|
+
};
|
|
111
|
+
return metadata;
|
|
112
|
+
}
|
|
113
|
+
return __createProductGroup;
|
|
114
|
+
}
|
|
115
|
+
function updateProductGroup(payload) {
|
|
116
|
+
function __updateProductGroup({ host }) {
|
|
117
|
+
const serializedData = transformPaths(payload, [
|
|
118
|
+
{
|
|
119
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
120
|
+
paths: [{ path: "fieldMask" }]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
124
|
+
paths: [
|
|
125
|
+
{ path: "productGroup.createdDate" },
|
|
126
|
+
{ path: "productGroup.updatedDate" }
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
]);
|
|
130
|
+
const metadata = {
|
|
131
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
132
|
+
method: "PATCH",
|
|
133
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.UpdateProductGroup",
|
|
134
|
+
packageName: PACKAGE_NAME,
|
|
135
|
+
migrationOptions: {
|
|
136
|
+
optInTransformResponse: true
|
|
137
|
+
},
|
|
138
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
139
|
+
protoPath: "/v3/product-groups/{productGroup.id}",
|
|
140
|
+
data: serializedData,
|
|
141
|
+
host
|
|
142
|
+
}),
|
|
143
|
+
data: serializedData,
|
|
144
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
145
|
+
{
|
|
146
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
147
|
+
paths: [
|
|
148
|
+
{ path: "productGroup.createdDate" },
|
|
149
|
+
{ path: "productGroup.updatedDate" }
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
])
|
|
153
|
+
};
|
|
154
|
+
return metadata;
|
|
155
|
+
}
|
|
156
|
+
return __updateProductGroup;
|
|
157
|
+
}
|
|
158
|
+
function deleteProductGroup(payload) {
|
|
159
|
+
function __deleteProductGroup({ host }) {
|
|
160
|
+
const metadata = {
|
|
161
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
162
|
+
method: "DELETE",
|
|
163
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.DeleteProductGroup",
|
|
164
|
+
packageName: PACKAGE_NAME,
|
|
165
|
+
migrationOptions: {
|
|
166
|
+
optInTransformResponse: true
|
|
167
|
+
},
|
|
168
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
169
|
+
protoPath: "/v3/product-groups/{productGroupId}",
|
|
170
|
+
data: payload,
|
|
171
|
+
host
|
|
172
|
+
}),
|
|
173
|
+
params: toURLSearchParams(payload)
|
|
174
|
+
};
|
|
175
|
+
return metadata;
|
|
176
|
+
}
|
|
177
|
+
return __deleteProductGroup;
|
|
178
|
+
}
|
|
179
|
+
function getProductGroup(payload) {
|
|
180
|
+
function __getProductGroup({ host }) {
|
|
181
|
+
const metadata = {
|
|
182
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
183
|
+
method: "GET",
|
|
184
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.GetProductGroup",
|
|
185
|
+
packageName: PACKAGE_NAME,
|
|
186
|
+
migrationOptions: {
|
|
187
|
+
optInTransformResponse: true
|
|
188
|
+
},
|
|
189
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
190
|
+
protoPath: "/v3/product-groups/{productGroupId}",
|
|
191
|
+
data: payload,
|
|
192
|
+
host
|
|
193
|
+
}),
|
|
194
|
+
params: toURLSearchParams(payload),
|
|
195
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
196
|
+
{
|
|
197
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
198
|
+
paths: [
|
|
199
|
+
{ path: "productGroup.createdDate" },
|
|
200
|
+
{ path: "productGroup.updatedDate" }
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
])
|
|
204
|
+
};
|
|
205
|
+
return metadata;
|
|
206
|
+
}
|
|
207
|
+
return __getProductGroup;
|
|
208
|
+
}
|
|
209
|
+
function queryProductGroups(payload) {
|
|
210
|
+
function __queryProductGroups({ host }) {
|
|
211
|
+
const metadata = {
|
|
212
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
213
|
+
method: "GET",
|
|
214
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.QueryProductGroups",
|
|
215
|
+
packageName: PACKAGE_NAME,
|
|
216
|
+
migrationOptions: {
|
|
217
|
+
optInTransformResponse: true
|
|
218
|
+
},
|
|
219
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
220
|
+
protoPath: "/v3/product-groups/query",
|
|
221
|
+
data: payload,
|
|
222
|
+
host
|
|
223
|
+
}),
|
|
224
|
+
params: toURLSearchParams(payload, true),
|
|
225
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
226
|
+
{
|
|
227
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
228
|
+
paths: [
|
|
229
|
+
{ path: "productGroups.createdDate" },
|
|
230
|
+
{ path: "productGroups.updatedDate" }
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
]),
|
|
234
|
+
fallback: [
|
|
235
|
+
{
|
|
236
|
+
method: "POST",
|
|
237
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
238
|
+
protoPath: "/v3/product-groups/query",
|
|
239
|
+
data: payload,
|
|
240
|
+
host
|
|
241
|
+
}),
|
|
242
|
+
data: payload
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
};
|
|
246
|
+
return metadata;
|
|
247
|
+
}
|
|
248
|
+
return __queryProductGroups;
|
|
249
|
+
}
|
|
250
|
+
function searchProductGroups(payload) {
|
|
251
|
+
function __searchProductGroups({ host }) {
|
|
252
|
+
const serializedData = transformPaths(payload, [
|
|
253
|
+
{
|
|
254
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
255
|
+
paths: [
|
|
256
|
+
{ path: "search.aggregations.range.buckets.from" },
|
|
257
|
+
{ path: "search.aggregations.range.buckets.to" },
|
|
258
|
+
{
|
|
259
|
+
path: "search.aggregations.nested.nestedAggregations.range.buckets.from"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
path: "search.aggregations.nested.nestedAggregations.range.buckets.to"
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
]);
|
|
267
|
+
const metadata = {
|
|
268
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
269
|
+
method: "GET",
|
|
270
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.SearchProductGroups",
|
|
271
|
+
packageName: PACKAGE_NAME,
|
|
272
|
+
migrationOptions: {
|
|
273
|
+
optInTransformResponse: true
|
|
274
|
+
},
|
|
275
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
276
|
+
protoPath: "/v3/product-groups/search",
|
|
277
|
+
data: serializedData,
|
|
278
|
+
host
|
|
279
|
+
}),
|
|
280
|
+
params: toURLSearchParams(serializedData, true),
|
|
281
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
282
|
+
{
|
|
283
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
284
|
+
paths: [
|
|
285
|
+
{ path: "productGroups.createdDate" },
|
|
286
|
+
{ path: "productGroups.updatedDate" }
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
291
|
+
paths: [
|
|
292
|
+
{ path: "aggregationData.results.ranges.results.from" },
|
|
293
|
+
{ path: "aggregationData.results.ranges.results.to" },
|
|
294
|
+
{
|
|
295
|
+
path: "aggregationData.results.groupedByValue.results.nestedResults.ranges.results.from"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
path: "aggregationData.results.groupedByValue.results.nestedResults.ranges.results.to"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
path: "aggregationData.results.nested.results.results.*.range.from"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
path: "aggregationData.results.nested.results.results.*.range.to"
|
|
305
|
+
},
|
|
306
|
+
{ path: "aggregationData.results.scalar.value" },
|
|
307
|
+
{
|
|
308
|
+
path: "aggregationData.results.groupedByValue.results.nestedResults.scalar.value"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
path: "aggregationData.results.nested.results.results.*.scalar.value"
|
|
312
|
+
}
|
|
313
|
+
]
|
|
314
|
+
}
|
|
315
|
+
]),
|
|
316
|
+
fallback: [
|
|
317
|
+
{
|
|
318
|
+
method: "POST",
|
|
319
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
320
|
+
protoPath: "/v3/product-groups/search",
|
|
321
|
+
data: serializedData,
|
|
322
|
+
host
|
|
323
|
+
}),
|
|
324
|
+
data: serializedData
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
};
|
|
328
|
+
return metadata;
|
|
329
|
+
}
|
|
330
|
+
return __searchProductGroups;
|
|
331
|
+
}
|
|
332
|
+
function bulkCreateProductGroups(payload) {
|
|
333
|
+
function __bulkCreateProductGroups({ host }) {
|
|
334
|
+
const serializedData = transformPaths(payload, [
|
|
335
|
+
{
|
|
336
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
337
|
+
paths: [
|
|
338
|
+
{ path: "productGroups.createdDate" },
|
|
339
|
+
{ path: "productGroups.updatedDate" }
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
]);
|
|
343
|
+
const metadata = {
|
|
344
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
345
|
+
method: "POST",
|
|
346
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.BulkCreateProductGroups",
|
|
347
|
+
packageName: PACKAGE_NAME,
|
|
348
|
+
migrationOptions: {
|
|
349
|
+
optInTransformResponse: true
|
|
350
|
+
},
|
|
351
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
352
|
+
protoPath: "/v3/bulk/product-groups/create",
|
|
353
|
+
data: serializedData,
|
|
354
|
+
host
|
|
355
|
+
}),
|
|
356
|
+
data: serializedData,
|
|
357
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
358
|
+
{
|
|
359
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
360
|
+
paths: [
|
|
361
|
+
{ path: "results.item.createdDate" },
|
|
362
|
+
{ path: "results.item.updatedDate" }
|
|
363
|
+
]
|
|
364
|
+
}
|
|
365
|
+
])
|
|
366
|
+
};
|
|
367
|
+
return metadata;
|
|
368
|
+
}
|
|
369
|
+
return __bulkCreateProductGroups;
|
|
370
|
+
}
|
|
371
|
+
function bulkUpdateProductGroups(payload) {
|
|
372
|
+
function __bulkUpdateProductGroups({ host }) {
|
|
373
|
+
const serializedData = transformPaths(payload, [
|
|
374
|
+
{
|
|
375
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
376
|
+
paths: [{ path: "productGroups.fieldMask" }]
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
380
|
+
paths: [
|
|
381
|
+
{ path: "productGroups.productGroup.createdDate" },
|
|
382
|
+
{ path: "productGroups.productGroup.updatedDate" }
|
|
383
|
+
]
|
|
384
|
+
}
|
|
385
|
+
]);
|
|
386
|
+
const metadata = {
|
|
387
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
388
|
+
method: "POST",
|
|
389
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.BulkUpdateProductGroups",
|
|
390
|
+
packageName: PACKAGE_NAME,
|
|
391
|
+
migrationOptions: {
|
|
392
|
+
optInTransformResponse: true
|
|
393
|
+
},
|
|
394
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
395
|
+
protoPath: "/v3/bulk/product-groups/update",
|
|
396
|
+
data: serializedData,
|
|
397
|
+
host
|
|
398
|
+
}),
|
|
399
|
+
data: serializedData,
|
|
400
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
401
|
+
{
|
|
402
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
403
|
+
paths: [
|
|
404
|
+
{ path: "results.item.createdDate" },
|
|
405
|
+
{ path: "results.item.updatedDate" }
|
|
406
|
+
]
|
|
407
|
+
}
|
|
408
|
+
])
|
|
409
|
+
};
|
|
410
|
+
return metadata;
|
|
411
|
+
}
|
|
412
|
+
return __bulkUpdateProductGroups;
|
|
413
|
+
}
|
|
414
|
+
function assignProductsToProductGroup(payload) {
|
|
415
|
+
function __assignProductsToProductGroup({ host }) {
|
|
416
|
+
const metadata = {
|
|
417
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
418
|
+
method: "POST",
|
|
419
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.AssignProductsToProductGroup",
|
|
420
|
+
packageName: PACKAGE_NAME,
|
|
421
|
+
migrationOptions: {
|
|
422
|
+
optInTransformResponse: true
|
|
423
|
+
},
|
|
424
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
425
|
+
protoPath: "/v3/product-groups/assign-products",
|
|
426
|
+
data: payload,
|
|
427
|
+
host
|
|
428
|
+
}),
|
|
429
|
+
data: payload
|
|
430
|
+
};
|
|
431
|
+
return metadata;
|
|
432
|
+
}
|
|
433
|
+
return __assignProductsToProductGroup;
|
|
434
|
+
}
|
|
435
|
+
function unassignProductsFromProductGroup(payload) {
|
|
436
|
+
function __unassignProductsFromProductGroup({ host }) {
|
|
437
|
+
const metadata = {
|
|
438
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
439
|
+
method: "POST",
|
|
440
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.UnassignProductsFromProductGroup",
|
|
441
|
+
packageName: PACKAGE_NAME,
|
|
442
|
+
migrationOptions: {
|
|
443
|
+
optInTransformResponse: true
|
|
444
|
+
},
|
|
445
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
446
|
+
protoPath: "/v3/product-groups/unassign-products",
|
|
447
|
+
data: payload,
|
|
448
|
+
host
|
|
449
|
+
}),
|
|
450
|
+
data: payload
|
|
451
|
+
};
|
|
452
|
+
return metadata;
|
|
453
|
+
}
|
|
454
|
+
return __unassignProductsFromProductGroup;
|
|
455
|
+
}
|
|
456
|
+
function bulkDeleteProductGroups(payload) {
|
|
457
|
+
function __bulkDeleteProductGroups({ host }) {
|
|
458
|
+
const metadata = {
|
|
459
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
460
|
+
method: "POST",
|
|
461
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.BulkDeleteProductGroups",
|
|
462
|
+
packageName: PACKAGE_NAME,
|
|
463
|
+
migrationOptions: {
|
|
464
|
+
optInTransformResponse: true
|
|
465
|
+
},
|
|
466
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
467
|
+
protoPath: "/v3/bulk/product-groups/delete",
|
|
468
|
+
data: payload,
|
|
469
|
+
host
|
|
470
|
+
}),
|
|
471
|
+
data: payload
|
|
472
|
+
};
|
|
473
|
+
return metadata;
|
|
474
|
+
}
|
|
475
|
+
return __bulkDeleteProductGroups;
|
|
476
|
+
}
|
|
477
|
+
function bulkUpdateProductGroupTags(payload) {
|
|
478
|
+
function __bulkUpdateProductGroupTags({ host }) {
|
|
479
|
+
const metadata = {
|
|
480
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
481
|
+
method: "POST",
|
|
482
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.BulkUpdateProductGroupTags",
|
|
483
|
+
packageName: PACKAGE_NAME,
|
|
484
|
+
migrationOptions: {
|
|
485
|
+
optInTransformResponse: true
|
|
486
|
+
},
|
|
487
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
488
|
+
protoPath: "/v3/bulk/product-groups/update-tags",
|
|
489
|
+
data: payload,
|
|
490
|
+
host
|
|
491
|
+
}),
|
|
492
|
+
data: payload
|
|
493
|
+
};
|
|
494
|
+
return metadata;
|
|
495
|
+
}
|
|
496
|
+
return __bulkUpdateProductGroupTags;
|
|
497
|
+
}
|
|
498
|
+
function bulkUpdateProductGroupTagsByFilter(payload) {
|
|
499
|
+
function __bulkUpdateProductGroupTagsByFilter({ host }) {
|
|
500
|
+
const metadata = {
|
|
501
|
+
entityFqdn: "wix.stores.catalog.v3.product_group",
|
|
502
|
+
method: "POST",
|
|
503
|
+
methodFqn: "wix.stores.catalog.product_group.v3.ProductGroupService.BulkUpdateProductGroupTagsByFilter",
|
|
504
|
+
packageName: PACKAGE_NAME,
|
|
505
|
+
migrationOptions: {
|
|
506
|
+
optInTransformResponse: true
|
|
507
|
+
},
|
|
508
|
+
url: resolveWixStoresCatalogProductGroupV3ProductGroupServiceUrl({
|
|
509
|
+
protoPath: "/v3/bulk/product-groups/update-tags-by-filter",
|
|
510
|
+
data: payload,
|
|
511
|
+
host
|
|
512
|
+
}),
|
|
513
|
+
data: payload
|
|
514
|
+
};
|
|
515
|
+
return metadata;
|
|
516
|
+
}
|
|
517
|
+
return __bulkUpdateProductGroupTagsByFilter;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// src/stores-catalog-v3-product-group-product-groups-v-3.universal.ts
|
|
521
|
+
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
522
|
+
import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
|
|
523
|
+
import { createSearchUtils } from "@wix/sdk-runtime/search-builder-utils";
|
|
524
|
+
var ChoiceType = /* @__PURE__ */ ((ChoiceType2) => {
|
|
525
|
+
ChoiceType2["CHOICE_TEXT"] = "CHOICE_TEXT";
|
|
526
|
+
ChoiceType2["ONE_COLOR"] = "ONE_COLOR";
|
|
527
|
+
return ChoiceType2;
|
|
528
|
+
})(ChoiceType || {});
|
|
529
|
+
var AvailabilityStatus = /* @__PURE__ */ ((AvailabilityStatus2) => {
|
|
530
|
+
AvailabilityStatus2["IN_STOCK"] = "IN_STOCK";
|
|
531
|
+
AvailabilityStatus2["OUT_OF_STOCK"] = "OUT_OF_STOCK";
|
|
532
|
+
AvailabilityStatus2["PARTIALLY_OUT_OF_STOCK"] = "PARTIALLY_OUT_OF_STOCK";
|
|
533
|
+
return AvailabilityStatus2;
|
|
534
|
+
})(AvailabilityStatus || {});
|
|
535
|
+
var MembershipStatus = /* @__PURE__ */ ((MembershipStatus2) => {
|
|
536
|
+
MembershipStatus2["ACTIVE"] = "ACTIVE";
|
|
537
|
+
MembershipStatus2["HIDDEN"] = "HIDDEN";
|
|
538
|
+
MembershipStatus2["OUT_OF_SYNC"] = "OUT_OF_SYNC";
|
|
539
|
+
return MembershipStatus2;
|
|
540
|
+
})(MembershipStatus || {});
|
|
541
|
+
var CustomizationType = /* @__PURE__ */ ((CustomizationType2) => {
|
|
542
|
+
CustomizationType2["PRODUCT_OPTION"] = "PRODUCT_OPTION";
|
|
543
|
+
CustomizationType2["MODIFIER"] = "MODIFIER";
|
|
544
|
+
return CustomizationType2;
|
|
545
|
+
})(CustomizationType || {});
|
|
546
|
+
var CustomizationRenderType = /* @__PURE__ */ ((CustomizationRenderType2) => {
|
|
547
|
+
CustomizationRenderType2["FREE_TEXT"] = "FREE_TEXT";
|
|
548
|
+
CustomizationRenderType2["TEXT_CHOICES"] = "TEXT_CHOICES";
|
|
549
|
+
CustomizationRenderType2["SWATCH_CHOICES"] = "SWATCH_CHOICES";
|
|
550
|
+
return CustomizationRenderType2;
|
|
551
|
+
})(CustomizationRenderType || {});
|
|
552
|
+
var ProductGroupRequestedFields = /* @__PURE__ */ ((ProductGroupRequestedFields2) => {
|
|
553
|
+
ProductGroupRequestedFields2["GROUPING_CUSTOMIZATION"] = "GROUPING_CUSTOMIZATION";
|
|
554
|
+
return ProductGroupRequestedFields2;
|
|
555
|
+
})(ProductGroupRequestedFields || {});
|
|
556
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
557
|
+
SortOrder2["ASC"] = "ASC";
|
|
558
|
+
SortOrder2["DESC"] = "DESC";
|
|
559
|
+
return SortOrder2;
|
|
560
|
+
})(SortOrder || {});
|
|
561
|
+
var SortType = /* @__PURE__ */ ((SortType2) => {
|
|
562
|
+
SortType2["COUNT"] = "COUNT";
|
|
563
|
+
SortType2["VALUE"] = "VALUE";
|
|
564
|
+
return SortType2;
|
|
565
|
+
})(SortType || {});
|
|
566
|
+
var SortDirection = /* @__PURE__ */ ((SortDirection2) => {
|
|
567
|
+
SortDirection2["DESC"] = "DESC";
|
|
568
|
+
SortDirection2["ASC"] = "ASC";
|
|
569
|
+
return SortDirection2;
|
|
570
|
+
})(SortDirection || {});
|
|
571
|
+
var MissingValues = /* @__PURE__ */ ((MissingValues2) => {
|
|
572
|
+
MissingValues2["EXCLUDE"] = "EXCLUDE";
|
|
573
|
+
MissingValues2["INCLUDE"] = "INCLUDE";
|
|
574
|
+
return MissingValues2;
|
|
575
|
+
})(MissingValues || {});
|
|
576
|
+
var ScalarType = /* @__PURE__ */ ((ScalarType2) => {
|
|
577
|
+
ScalarType2["COUNT_DISTINCT"] = "COUNT_DISTINCT";
|
|
578
|
+
ScalarType2["MIN"] = "MIN";
|
|
579
|
+
ScalarType2["MAX"] = "MAX";
|
|
580
|
+
return ScalarType2;
|
|
581
|
+
})(ScalarType || {});
|
|
582
|
+
var NestedAggregationType = /* @__PURE__ */ ((NestedAggregationType2) => {
|
|
583
|
+
NestedAggregationType2["VALUE"] = "VALUE";
|
|
584
|
+
NestedAggregationType2["RANGE"] = "RANGE";
|
|
585
|
+
NestedAggregationType2["SCALAR"] = "SCALAR";
|
|
586
|
+
NestedAggregationType2["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
587
|
+
return NestedAggregationType2;
|
|
588
|
+
})(NestedAggregationType || {});
|
|
589
|
+
var Interval = /* @__PURE__ */ ((Interval2) => {
|
|
590
|
+
Interval2["YEAR"] = "YEAR";
|
|
591
|
+
Interval2["MONTH"] = "MONTH";
|
|
592
|
+
Interval2["WEEK"] = "WEEK";
|
|
593
|
+
Interval2["DAY"] = "DAY";
|
|
594
|
+
Interval2["HOUR"] = "HOUR";
|
|
595
|
+
Interval2["MINUTE"] = "MINUTE";
|
|
596
|
+
Interval2["SECOND"] = "SECOND";
|
|
597
|
+
return Interval2;
|
|
598
|
+
})(Interval || {});
|
|
599
|
+
var AggregationType = /* @__PURE__ */ ((AggregationType2) => {
|
|
600
|
+
AggregationType2["VALUE"] = "VALUE";
|
|
601
|
+
AggregationType2["RANGE"] = "RANGE";
|
|
602
|
+
AggregationType2["SCALAR"] = "SCALAR";
|
|
603
|
+
AggregationType2["DATE_HISTOGRAM"] = "DATE_HISTOGRAM";
|
|
604
|
+
AggregationType2["NESTED"] = "NESTED";
|
|
605
|
+
return AggregationType2;
|
|
606
|
+
})(AggregationType || {});
|
|
607
|
+
var Mode = /* @__PURE__ */ ((Mode2) => {
|
|
608
|
+
Mode2["OR"] = "OR";
|
|
609
|
+
Mode2["AND"] = "AND";
|
|
610
|
+
return Mode2;
|
|
611
|
+
})(Mode || {});
|
|
612
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
613
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
614
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
615
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
616
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
617
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
618
|
+
return WebhookIdentityType2;
|
|
619
|
+
})(WebhookIdentityType || {});
|
|
620
|
+
async function createProductGroup2(productGroup, options) {
|
|
621
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
622
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
623
|
+
productGroup,
|
|
624
|
+
fields: options?.fields
|
|
625
|
+
});
|
|
626
|
+
const reqOpts = createProductGroup(payload);
|
|
627
|
+
sideEffects?.onSiteCall?.();
|
|
628
|
+
try {
|
|
629
|
+
const result = await httpClient.request(reqOpts);
|
|
630
|
+
sideEffects?.onSuccess?.(result);
|
|
631
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.productGroup;
|
|
632
|
+
} catch (err) {
|
|
633
|
+
const transformedError = sdkTransformError(
|
|
634
|
+
err,
|
|
635
|
+
{
|
|
636
|
+
spreadPathsToArguments: {},
|
|
637
|
+
explicitPathsToArguments: {
|
|
638
|
+
productGroup: "$[0]",
|
|
639
|
+
fields: "$[1].fields"
|
|
640
|
+
},
|
|
641
|
+
singleArgumentUnchanged: false
|
|
642
|
+
},
|
|
643
|
+
["productGroup", "options"]
|
|
644
|
+
);
|
|
645
|
+
sideEffects?.onError?.(err);
|
|
646
|
+
throw transformedError;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
async function updateProductGroup2(_id, productGroup, options) {
|
|
650
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
651
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
652
|
+
productGroup: { ...productGroup, id: _id },
|
|
653
|
+
fields: options?.fields
|
|
654
|
+
});
|
|
655
|
+
const reqOpts = updateProductGroup(payload);
|
|
656
|
+
sideEffects?.onSiteCall?.();
|
|
657
|
+
try {
|
|
658
|
+
const result = await httpClient.request(reqOpts);
|
|
659
|
+
sideEffects?.onSuccess?.(result);
|
|
660
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.productGroup;
|
|
661
|
+
} catch (err) {
|
|
662
|
+
const transformedError = sdkTransformError(
|
|
663
|
+
err,
|
|
664
|
+
{
|
|
665
|
+
spreadPathsToArguments: { productGroup: "$[1]" },
|
|
666
|
+
explicitPathsToArguments: {
|
|
667
|
+
"productGroup.id": "$[0]",
|
|
668
|
+
fields: "$[2].fields"
|
|
669
|
+
},
|
|
670
|
+
singleArgumentUnchanged: false
|
|
671
|
+
},
|
|
672
|
+
["_id", "productGroup", "options"]
|
|
673
|
+
);
|
|
674
|
+
sideEffects?.onError?.(err);
|
|
675
|
+
throw transformedError;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
async function deleteProductGroup2(productGroupId) {
|
|
679
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
680
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
681
|
+
productGroupId
|
|
682
|
+
});
|
|
683
|
+
const reqOpts = deleteProductGroup(payload);
|
|
684
|
+
sideEffects?.onSiteCall?.();
|
|
685
|
+
try {
|
|
686
|
+
const result = await httpClient.request(reqOpts);
|
|
687
|
+
sideEffects?.onSuccess?.(result);
|
|
688
|
+
} catch (err) {
|
|
689
|
+
const transformedError = sdkTransformError(
|
|
690
|
+
err,
|
|
691
|
+
{
|
|
692
|
+
spreadPathsToArguments: {},
|
|
693
|
+
explicitPathsToArguments: { productGroupId: "$[0]" },
|
|
694
|
+
singleArgumentUnchanged: false
|
|
695
|
+
},
|
|
696
|
+
["productGroupId"]
|
|
697
|
+
);
|
|
698
|
+
sideEffects?.onError?.(err);
|
|
699
|
+
throw transformedError;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
async function getProductGroup2(productGroupId, options) {
|
|
703
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
704
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
705
|
+
productGroupId,
|
|
706
|
+
fields: options?.fields
|
|
707
|
+
});
|
|
708
|
+
const reqOpts = getProductGroup(payload);
|
|
709
|
+
sideEffects?.onSiteCall?.();
|
|
710
|
+
try {
|
|
711
|
+
const result = await httpClient.request(reqOpts);
|
|
712
|
+
sideEffects?.onSuccess?.(result);
|
|
713
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.productGroup;
|
|
714
|
+
} catch (err) {
|
|
715
|
+
const transformedError = sdkTransformError(
|
|
716
|
+
err,
|
|
717
|
+
{
|
|
718
|
+
spreadPathsToArguments: {},
|
|
719
|
+
explicitPathsToArguments: {
|
|
720
|
+
productGroupId: "$[0]",
|
|
721
|
+
fields: "$[1].fields"
|
|
722
|
+
},
|
|
723
|
+
singleArgumentUnchanged: false
|
|
724
|
+
},
|
|
725
|
+
["productGroupId", "options"]
|
|
726
|
+
);
|
|
727
|
+
sideEffects?.onError?.(err);
|
|
728
|
+
throw transformedError;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
function queryProductGroups2(options) {
|
|
732
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
733
|
+
return queryBuilder({
|
|
734
|
+
func: async (payload) => {
|
|
735
|
+
const reqOpts = queryProductGroups({
|
|
736
|
+
...payload,
|
|
737
|
+
...options ?? {}
|
|
738
|
+
});
|
|
739
|
+
sideEffects?.onSiteCall?.();
|
|
740
|
+
try {
|
|
741
|
+
const result = await httpClient.request(reqOpts);
|
|
742
|
+
sideEffects?.onSuccess?.(result);
|
|
743
|
+
return result;
|
|
744
|
+
} catch (err) {
|
|
745
|
+
sideEffects?.onError?.(err);
|
|
746
|
+
throw err;
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
requestTransformer: (query) => {
|
|
750
|
+
const args = [query, options];
|
|
751
|
+
return renameKeysFromSDKRequestToRESTRequest({
|
|
752
|
+
...args?.[1],
|
|
753
|
+
query: args?.[0]
|
|
754
|
+
});
|
|
755
|
+
},
|
|
756
|
+
responseTransformer: ({
|
|
757
|
+
data
|
|
758
|
+
}) => {
|
|
759
|
+
const transformedData = renameKeysFromRESTResponseToSDKResponse(
|
|
760
|
+
transformPaths2(data, [])
|
|
761
|
+
);
|
|
762
|
+
return {
|
|
763
|
+
items: transformedData?.productGroups,
|
|
764
|
+
pagingMetadata: transformedData?.pagingMetadata
|
|
765
|
+
};
|
|
766
|
+
},
|
|
767
|
+
errorTransformer: (err) => {
|
|
768
|
+
const transformedError = sdkTransformError(err, {
|
|
769
|
+
spreadPathsToArguments: {},
|
|
770
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
771
|
+
singleArgumentUnchanged: false
|
|
772
|
+
});
|
|
773
|
+
throw transformedError;
|
|
774
|
+
},
|
|
775
|
+
pagingMethod: "CURSOR",
|
|
776
|
+
transformationPaths: {}
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
async function typedQueryProductGroups(query, options) {
|
|
780
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
781
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
782
|
+
query,
|
|
783
|
+
...options
|
|
784
|
+
});
|
|
785
|
+
const reqOpts = queryProductGroups(payload);
|
|
786
|
+
sideEffects?.onSiteCall?.();
|
|
787
|
+
try {
|
|
788
|
+
const result = await httpClient.request(reqOpts);
|
|
789
|
+
sideEffects?.onSuccess?.(result);
|
|
790
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
791
|
+
} catch (err) {
|
|
792
|
+
const transformedError = sdkTransformError(
|
|
793
|
+
err,
|
|
794
|
+
{
|
|
795
|
+
spreadPathsToArguments: {},
|
|
796
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
797
|
+
singleArgumentUnchanged: false
|
|
798
|
+
},
|
|
799
|
+
["query", "options"]
|
|
800
|
+
);
|
|
801
|
+
sideEffects?.onError?.(err);
|
|
802
|
+
throw transformedError;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
var utils = {
|
|
806
|
+
query: {
|
|
807
|
+
...createQueryUtils()
|
|
808
|
+
},
|
|
809
|
+
search: {
|
|
810
|
+
...createSearchUtils()
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
async function searchProductGroups2(search, options) {
|
|
814
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
815
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
816
|
+
search,
|
|
817
|
+
fields: options?.fields
|
|
818
|
+
});
|
|
819
|
+
const reqOpts = searchProductGroups(payload);
|
|
820
|
+
sideEffects?.onSiteCall?.();
|
|
821
|
+
try {
|
|
822
|
+
const result = await httpClient.request(reqOpts);
|
|
823
|
+
sideEffects?.onSuccess?.(result);
|
|
824
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
825
|
+
} catch (err) {
|
|
826
|
+
const transformedError = sdkTransformError(
|
|
827
|
+
err,
|
|
828
|
+
{
|
|
829
|
+
spreadPathsToArguments: {},
|
|
830
|
+
explicitPathsToArguments: { search: "$[0]", fields: "$[1].fields" },
|
|
831
|
+
singleArgumentUnchanged: false
|
|
832
|
+
},
|
|
833
|
+
["search", "options"]
|
|
834
|
+
);
|
|
835
|
+
sideEffects?.onError?.(err);
|
|
836
|
+
throw transformedError;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
async function bulkCreateProductGroups2(productGroups, options) {
|
|
840
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
841
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
842
|
+
productGroups,
|
|
843
|
+
returnEntity: options?.returnEntity,
|
|
844
|
+
fields: options?.fields
|
|
845
|
+
});
|
|
846
|
+
const reqOpts = bulkCreateProductGroups(payload);
|
|
847
|
+
sideEffects?.onSiteCall?.();
|
|
848
|
+
try {
|
|
849
|
+
const result = await httpClient.request(reqOpts);
|
|
850
|
+
sideEffects?.onSuccess?.(result);
|
|
851
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
852
|
+
} catch (err) {
|
|
853
|
+
const transformedError = sdkTransformError(
|
|
854
|
+
err,
|
|
855
|
+
{
|
|
856
|
+
spreadPathsToArguments: {},
|
|
857
|
+
explicitPathsToArguments: {
|
|
858
|
+
productGroups: "$[0]",
|
|
859
|
+
returnEntity: "$[1].returnEntity",
|
|
860
|
+
fields: "$[1].fields"
|
|
861
|
+
},
|
|
862
|
+
singleArgumentUnchanged: false
|
|
863
|
+
},
|
|
864
|
+
["productGroups", "options"]
|
|
865
|
+
);
|
|
866
|
+
sideEffects?.onError?.(err);
|
|
867
|
+
throw transformedError;
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
async function bulkUpdateProductGroups2(productGroups, options) {
|
|
871
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
872
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
873
|
+
productGroups,
|
|
874
|
+
returnEntity: options?.returnEntity,
|
|
875
|
+
fields: options?.fields
|
|
876
|
+
});
|
|
877
|
+
const reqOpts = bulkUpdateProductGroups(payload);
|
|
878
|
+
sideEffects?.onSiteCall?.();
|
|
879
|
+
try {
|
|
880
|
+
const result = await httpClient.request(reqOpts);
|
|
881
|
+
sideEffects?.onSuccess?.(result);
|
|
882
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
883
|
+
} catch (err) {
|
|
884
|
+
const transformedError = sdkTransformError(
|
|
885
|
+
err,
|
|
886
|
+
{
|
|
887
|
+
spreadPathsToArguments: {},
|
|
888
|
+
explicitPathsToArguments: {
|
|
889
|
+
productGroups: "$[0]",
|
|
890
|
+
returnEntity: "$[1].returnEntity",
|
|
891
|
+
fields: "$[1].fields"
|
|
892
|
+
},
|
|
893
|
+
singleArgumentUnchanged: false
|
|
894
|
+
},
|
|
895
|
+
["productGroups", "options"]
|
|
896
|
+
);
|
|
897
|
+
sideEffects?.onError?.(err);
|
|
898
|
+
throw transformedError;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
async function assignProductsToProductGroup2(productGroupId, options) {
|
|
902
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
903
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
904
|
+
productGroupId,
|
|
905
|
+
productIds: options?.productIds
|
|
906
|
+
});
|
|
907
|
+
const reqOpts = assignProductsToProductGroup(
|
|
908
|
+
payload
|
|
909
|
+
);
|
|
910
|
+
sideEffects?.onSiteCall?.();
|
|
911
|
+
try {
|
|
912
|
+
const result = await httpClient.request(reqOpts);
|
|
913
|
+
sideEffects?.onSuccess?.(result);
|
|
914
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
915
|
+
} catch (err) {
|
|
916
|
+
const transformedError = sdkTransformError(
|
|
917
|
+
err,
|
|
918
|
+
{
|
|
919
|
+
spreadPathsToArguments: {},
|
|
920
|
+
explicitPathsToArguments: {
|
|
921
|
+
productGroupId: "$[0]",
|
|
922
|
+
productIds: "$[1].productIds"
|
|
923
|
+
},
|
|
924
|
+
singleArgumentUnchanged: false
|
|
925
|
+
},
|
|
926
|
+
["productGroupId", "options"]
|
|
927
|
+
);
|
|
928
|
+
sideEffects?.onError?.(err);
|
|
929
|
+
throw transformedError;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
async function unassignProductsFromProductGroup2(productGroupId, options) {
|
|
933
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
934
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
935
|
+
productGroupId,
|
|
936
|
+
productIds: options?.productIds
|
|
937
|
+
});
|
|
938
|
+
const reqOpts = unassignProductsFromProductGroup(
|
|
939
|
+
payload
|
|
940
|
+
);
|
|
941
|
+
sideEffects?.onSiteCall?.();
|
|
942
|
+
try {
|
|
943
|
+
const result = await httpClient.request(reqOpts);
|
|
944
|
+
sideEffects?.onSuccess?.(result);
|
|
945
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
946
|
+
} catch (err) {
|
|
947
|
+
const transformedError = sdkTransformError(
|
|
948
|
+
err,
|
|
949
|
+
{
|
|
950
|
+
spreadPathsToArguments: {},
|
|
951
|
+
explicitPathsToArguments: {
|
|
952
|
+
productGroupId: "$[0]",
|
|
953
|
+
productIds: "$[1].productIds"
|
|
954
|
+
},
|
|
955
|
+
singleArgumentUnchanged: false
|
|
956
|
+
},
|
|
957
|
+
["productGroupId", "options"]
|
|
958
|
+
);
|
|
959
|
+
sideEffects?.onError?.(err);
|
|
960
|
+
throw transformedError;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
async function bulkDeleteProductGroups2(productGroupIds) {
|
|
964
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
965
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
966
|
+
productGroupIds
|
|
967
|
+
});
|
|
968
|
+
const reqOpts = bulkDeleteProductGroups(payload);
|
|
969
|
+
sideEffects?.onSiteCall?.();
|
|
970
|
+
try {
|
|
971
|
+
const result = await httpClient.request(reqOpts);
|
|
972
|
+
sideEffects?.onSuccess?.(result);
|
|
973
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
974
|
+
} catch (err) {
|
|
975
|
+
const transformedError = sdkTransformError(
|
|
976
|
+
err,
|
|
977
|
+
{
|
|
978
|
+
spreadPathsToArguments: {},
|
|
979
|
+
explicitPathsToArguments: { productGroupIds: "$[0]" },
|
|
980
|
+
singleArgumentUnchanged: false
|
|
981
|
+
},
|
|
982
|
+
["productGroupIds"]
|
|
983
|
+
);
|
|
984
|
+
sideEffects?.onError?.(err);
|
|
985
|
+
throw transformedError;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
async function bulkUpdateProductGroupTags2(productGroupIds, options) {
|
|
989
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
990
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
991
|
+
productGroupIds,
|
|
992
|
+
assignTags: options?.assignTags,
|
|
993
|
+
unassignTags: options?.unassignTags
|
|
994
|
+
});
|
|
995
|
+
const reqOpts = bulkUpdateProductGroupTags(
|
|
996
|
+
payload
|
|
997
|
+
);
|
|
998
|
+
sideEffects?.onSiteCall?.();
|
|
999
|
+
try {
|
|
1000
|
+
const result = await httpClient.request(reqOpts);
|
|
1001
|
+
sideEffects?.onSuccess?.(result);
|
|
1002
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1003
|
+
} catch (err) {
|
|
1004
|
+
const transformedError = sdkTransformError(
|
|
1005
|
+
err,
|
|
1006
|
+
{
|
|
1007
|
+
spreadPathsToArguments: {},
|
|
1008
|
+
explicitPathsToArguments: {
|
|
1009
|
+
productGroupIds: "$[0]",
|
|
1010
|
+
assignTags: "$[1].assignTags",
|
|
1011
|
+
unassignTags: "$[1].unassignTags"
|
|
1012
|
+
},
|
|
1013
|
+
singleArgumentUnchanged: false
|
|
1014
|
+
},
|
|
1015
|
+
["productGroupIds", "options"]
|
|
1016
|
+
);
|
|
1017
|
+
sideEffects?.onError?.(err);
|
|
1018
|
+
throw transformedError;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
async function bulkUpdateProductGroupTagsByFilter2(filter, options) {
|
|
1022
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1023
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1024
|
+
filter,
|
|
1025
|
+
assignTags: options?.assignTags,
|
|
1026
|
+
unassignTags: options?.unassignTags
|
|
1027
|
+
});
|
|
1028
|
+
const reqOpts = bulkUpdateProductGroupTagsByFilter(
|
|
1029
|
+
payload
|
|
1030
|
+
);
|
|
1031
|
+
sideEffects?.onSiteCall?.();
|
|
1032
|
+
try {
|
|
1033
|
+
const result = await httpClient.request(reqOpts);
|
|
1034
|
+
sideEffects?.onSuccess?.(result);
|
|
1035
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1036
|
+
} catch (err) {
|
|
1037
|
+
const transformedError = sdkTransformError(
|
|
1038
|
+
err,
|
|
1039
|
+
{
|
|
1040
|
+
spreadPathsToArguments: {},
|
|
1041
|
+
explicitPathsToArguments: {
|
|
1042
|
+
filter: "$[0]",
|
|
1043
|
+
assignTags: "$[1].assignTags",
|
|
1044
|
+
unassignTags: "$[1].unassignTags"
|
|
1045
|
+
},
|
|
1046
|
+
singleArgumentUnchanged: false
|
|
1047
|
+
},
|
|
1048
|
+
["filter", "options"]
|
|
1049
|
+
);
|
|
1050
|
+
sideEffects?.onError?.(err);
|
|
1051
|
+
throw transformedError;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
export {
|
|
1055
|
+
AggregationType,
|
|
1056
|
+
AvailabilityStatus,
|
|
1057
|
+
ChoiceType,
|
|
1058
|
+
CustomizationRenderType,
|
|
1059
|
+
CustomizationType,
|
|
1060
|
+
Interval,
|
|
1061
|
+
MembershipStatus,
|
|
1062
|
+
MissingValues,
|
|
1063
|
+
Mode,
|
|
1064
|
+
NestedAggregationType,
|
|
1065
|
+
ProductGroupRequestedFields,
|
|
1066
|
+
ScalarType,
|
|
1067
|
+
SortDirection,
|
|
1068
|
+
SortOrder,
|
|
1069
|
+
SortType,
|
|
1070
|
+
WebhookIdentityType,
|
|
1071
|
+
assignProductsToProductGroup2 as assignProductsToProductGroup,
|
|
1072
|
+
bulkCreateProductGroups2 as bulkCreateProductGroups,
|
|
1073
|
+
bulkDeleteProductGroups2 as bulkDeleteProductGroups,
|
|
1074
|
+
bulkUpdateProductGroupTags2 as bulkUpdateProductGroupTags,
|
|
1075
|
+
bulkUpdateProductGroupTagsByFilter2 as bulkUpdateProductGroupTagsByFilter,
|
|
1076
|
+
bulkUpdateProductGroups2 as bulkUpdateProductGroups,
|
|
1077
|
+
createProductGroup2 as createProductGroup,
|
|
1078
|
+
deleteProductGroup2 as deleteProductGroup,
|
|
1079
|
+
getProductGroup2 as getProductGroup,
|
|
1080
|
+
queryProductGroups2 as queryProductGroups,
|
|
1081
|
+
searchProductGroups2 as searchProductGroups,
|
|
1082
|
+
typedQueryProductGroups,
|
|
1083
|
+
unassignProductsFromProductGroup2 as unassignProductsFromProductGroup,
|
|
1084
|
+
updateProductGroup2 as updateProductGroup,
|
|
1085
|
+
utils
|
|
1086
|
+
};
|
|
1087
|
+
//# sourceMappingURL=index.typings.mjs.map
|