@wix/categories 1.0.24 → 1.0.26

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 (61) hide show
  1. package/build/cjs/context.d.ts +1 -1
  2. package/build/cjs/context.js +1 -1
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +1 -1
  5. package/build/cjs/index.js +1 -1
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +1 -1
  8. package/build/cjs/meta.js +1 -1
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +1 -1
  11. package/build/es/context.js +1 -1
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +1 -1
  14. package/build/es/index.js +1 -1
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +1 -1
  17. package/build/es/meta.js +1 -1
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +11 -9
  20. package/build/cjs/index.typings.d.ts +0 -1
  21. package/build/cjs/index.typings.js +0 -28
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/categories-v1-category.context.d.ts +0 -20
  24. package/build/cjs/src/categories-v1-category.context.js +0 -203
  25. package/build/cjs/src/categories-v1-category.context.js.map +0 -1
  26. package/build/cjs/src/categories-v1-category.http.d.ts +0 -56
  27. package/build/cjs/src/categories-v1-category.http.js +0 -1029
  28. package/build/cjs/src/categories-v1-category.http.js.map +0 -1
  29. package/build/cjs/src/categories-v1-category.meta.d.ts +0 -50
  30. package/build/cjs/src/categories-v1-category.meta.js +0 -370
  31. package/build/cjs/src/categories-v1-category.meta.js.map +0 -1
  32. package/build/cjs/src/categories-v1-category.public.d.ts +0 -1454
  33. package/build/cjs/src/categories-v1-category.public.js +0 -164
  34. package/build/cjs/src/categories-v1-category.public.js.map +0 -1
  35. package/build/cjs/src/categories-v1-category.types.d.ts +0 -5763
  36. package/build/cjs/src/categories-v1-category.types.js +0 -402
  37. package/build/cjs/src/categories-v1-category.types.js.map +0 -1
  38. package/build/cjs/src/categories-v1-category.universal.d.ts +0 -6181
  39. package/build/cjs/src/categories-v1-category.universal.js +0 -1794
  40. package/build/cjs/src/categories-v1-category.universal.js.map +0 -1
  41. package/build/es/index.typings.d.ts +0 -1
  42. package/build/es/index.typings.js +0 -2
  43. package/build/es/index.typings.js.map +0 -1
  44. package/build/es/src/categories-v1-category.context.d.ts +0 -20
  45. package/build/es/src/categories-v1-category.context.js +0 -182
  46. package/build/es/src/categories-v1-category.context.js.map +0 -1
  47. package/build/es/src/categories-v1-category.http.d.ts +0 -56
  48. package/build/es/src/categories-v1-category.http.js +0 -1008
  49. package/build/es/src/categories-v1-category.http.js.map +0 -1
  50. package/build/es/src/categories-v1-category.meta.d.ts +0 -50
  51. package/build/es/src/categories-v1-category.meta.js +0 -326
  52. package/build/es/src/categories-v1-category.meta.js.map +0 -1
  53. package/build/es/src/categories-v1-category.public.d.ts +0 -1454
  54. package/build/es/src/categories-v1-category.public.js +0 -95
  55. package/build/es/src/categories-v1-category.public.js.map +0 -1
  56. package/build/es/src/categories-v1-category.types.d.ts +0 -5763
  57. package/build/es/src/categories-v1-category.types.js +0 -399
  58. package/build/es/src/categories-v1-category.types.js.map +0 -1
  59. package/build/es/src/categories-v1-category.universal.d.ts +0 -6181
  60. package/build/es/src/categories-v1-category.universal.js +0 -1749
  61. package/build/es/src/categories-v1-category.universal.js.map +0 -1
@@ -1,1029 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getArrangedItems = exports.setArrangedItems = exports.moveItemInCategory = exports.listCategoriesForItem = exports.listItemsInCategory = exports.bulkRemoveItemFromCategories = exports.bulkRemoveItemsFromCategory = exports.bulkAddItemToCategories = exports.bulkAddItemsToCategory = exports.updateCategoryVisibility = exports.bulkUpdateCategories = exports.moveCategory = exports.countCategories = exports.searchCategories = exports.deleteCategory = exports.updateCategory = exports.getCategory = exports.createCategory = void 0;
4
- const metro_runtime_1 = require("@wix/metro-runtime");
5
- const float_1 = require("@wix/sdk-runtime/transformations/float");
6
- const float_2 = require("@wix/sdk-runtime/transformations/float");
7
- const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
8
- const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
9
- const field_mask_1 = require("@wix/sdk-runtime/transformations/field-mask");
10
- const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
11
- const metro_runtime_2 = require("@wix/metro-runtime");
12
- function resolveComWixCategoriesApiV1CategoriesServiceUrl(opts) {
13
- const domainToMappings = {
14
- '*.dev.wix-code.com': [
15
- {
16
- srcPath: '/_api/categories',
17
- destPath: '',
18
- },
19
- ],
20
- 'www.wixapis.com': [
21
- {
22
- srcPath: '/categories/v1/bulk/categories',
23
- destPath: '/v1/bulk/categories',
24
- },
25
- {
26
- srcPath: '/categories/v1/categories',
27
- destPath: '/v1/categories',
28
- },
29
- ],
30
- 'manage._base_domain_': [
31
- {
32
- srcPath: '/_api/categories',
33
- destPath: '',
34
- },
35
- ],
36
- };
37
- return (0, metro_runtime_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
38
- }
39
- /** Creates a new Category. */
40
- function createCategory(payload) {
41
- function __createCategory({ host }) {
42
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
43
- {
44
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
45
- paths: [
46
- { path: 'category.createdDate' },
47
- { path: 'category.updatedDate' },
48
- { path: 'category.image.urlExpirationDate' },
49
- { path: 'category.richContentDescription.metadata.createdTimestamp' },
50
- { path: 'category.richContentDescription.metadata.updatedTimestamp' },
51
- ],
52
- },
53
- {
54
- transformFn: float_1.transformSDKFloatToRESTFloat,
55
- paths: [
56
- {
57
- path: 'category.richContentDescription.nodes.galleryData.items.image.media.duration',
58
- },
59
- {
60
- path: 'category.richContentDescription.nodes.galleryData.items.video.media.duration',
61
- },
62
- {
63
- path: 'category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration',
64
- },
65
- {
66
- path: 'category.richContentDescription.nodes.galleryData.options.item.ratio',
67
- },
68
- {
69
- path: 'category.richContentDescription.nodes.imageData.image.duration',
70
- },
71
- {
72
- path: 'category.richContentDescription.nodes.mapData.mapSettings.lat',
73
- },
74
- {
75
- path: 'category.richContentDescription.nodes.mapData.mapSettings.lng',
76
- },
77
- {
78
- path: 'category.richContentDescription.nodes.pollData.poll.image.duration',
79
- },
80
- {
81
- path: 'category.richContentDescription.nodes.pollData.poll.options.image.duration',
82
- },
83
- {
84
- path: 'category.richContentDescription.nodes.pollData.design.poll.background.image.duration',
85
- },
86
- {
87
- path: 'category.richContentDescription.nodes.appEmbedData.image.duration',
88
- },
89
- {
90
- path: 'category.richContentDescription.nodes.videoData.video.duration',
91
- },
92
- {
93
- path: 'category.richContentDescription.nodes.videoData.thumbnail.duration',
94
- },
95
- {
96
- path: 'category.richContentDescription.nodes.audioData.audio.duration',
97
- },
98
- {
99
- path: 'category.richContentDescription.nodes.audioData.coverImage.duration',
100
- },
101
- ],
102
- },
103
- ]);
104
- const metadata = {
105
- entityFqdn: 'wix.categories.v1.category',
106
- method: 'POST',
107
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.CreateCategory',
108
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
109
- protoPath: '/v1/categories',
110
- data: serializedData,
111
- host,
112
- }),
113
- data: serializedData,
114
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
115
- {
116
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
117
- paths: [
118
- { path: 'category.createdDate' },
119
- { path: 'category.updatedDate' },
120
- { path: 'category.image.urlExpirationDate' },
121
- {
122
- path: 'category.richContentDescription.metadata.createdTimestamp',
123
- },
124
- {
125
- path: 'category.richContentDescription.metadata.updatedTimestamp',
126
- },
127
- ],
128
- },
129
- {
130
- transformFn: float_2.transformRESTFloatToSDKFloat,
131
- paths: [
132
- {
133
- path: 'category.richContentDescription.nodes.galleryData.items.image.media.duration',
134
- },
135
- {
136
- path: 'category.richContentDescription.nodes.galleryData.items.video.media.duration',
137
- },
138
- {
139
- path: 'category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration',
140
- },
141
- {
142
- path: 'category.richContentDescription.nodes.galleryData.options.item.ratio',
143
- },
144
- {
145
- path: 'category.richContentDescription.nodes.imageData.image.duration',
146
- },
147
- {
148
- path: 'category.richContentDescription.nodes.mapData.mapSettings.lat',
149
- },
150
- {
151
- path: 'category.richContentDescription.nodes.mapData.mapSettings.lng',
152
- },
153
- {
154
- path: 'category.richContentDescription.nodes.pollData.poll.image.duration',
155
- },
156
- {
157
- path: 'category.richContentDescription.nodes.pollData.poll.options.image.duration',
158
- },
159
- {
160
- path: 'category.richContentDescription.nodes.pollData.design.poll.background.image.duration',
161
- },
162
- {
163
- path: 'category.richContentDescription.nodes.appEmbedData.image.duration',
164
- },
165
- {
166
- path: 'category.richContentDescription.nodes.videoData.video.duration',
167
- },
168
- {
169
- path: 'category.richContentDescription.nodes.videoData.thumbnail.duration',
170
- },
171
- {
172
- path: 'category.richContentDescription.nodes.audioData.audio.duration',
173
- },
174
- {
175
- path: 'category.richContentDescription.nodes.audioData.coverImage.duration',
176
- },
177
- ],
178
- },
179
- ]),
180
- };
181
- return metadata;
182
- }
183
- return __createCategory;
184
- }
185
- exports.createCategory = createCategory;
186
- /** Retrieves a category with the provided ID. */
187
- function getCategory(payload) {
188
- function __getCategory({ host }) {
189
- const metadata = {
190
- entityFqdn: 'wix.categories.v1.category',
191
- method: 'GET',
192
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.GetCategory',
193
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
194
- protoPath: '/v1/categories/{categoryId}',
195
- data: payload,
196
- host,
197
- }),
198
- params: (0, metro_runtime_1.toURLSearchParams)(payload),
199
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
200
- {
201
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
202
- paths: [
203
- { path: 'category.createdDate' },
204
- { path: 'category.updatedDate' },
205
- { path: 'category.image.urlExpirationDate' },
206
- {
207
- path: 'category.richContentDescription.metadata.createdTimestamp',
208
- },
209
- {
210
- path: 'category.richContentDescription.metadata.updatedTimestamp',
211
- },
212
- ],
213
- },
214
- {
215
- transformFn: float_2.transformRESTFloatToSDKFloat,
216
- paths: [
217
- {
218
- path: 'category.richContentDescription.nodes.galleryData.items.image.media.duration',
219
- },
220
- {
221
- path: 'category.richContentDescription.nodes.galleryData.items.video.media.duration',
222
- },
223
- {
224
- path: 'category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration',
225
- },
226
- {
227
- path: 'category.richContentDescription.nodes.galleryData.options.item.ratio',
228
- },
229
- {
230
- path: 'category.richContentDescription.nodes.imageData.image.duration',
231
- },
232
- {
233
- path: 'category.richContentDescription.nodes.mapData.mapSettings.lat',
234
- },
235
- {
236
- path: 'category.richContentDescription.nodes.mapData.mapSettings.lng',
237
- },
238
- {
239
- path: 'category.richContentDescription.nodes.pollData.poll.image.duration',
240
- },
241
- {
242
- path: 'category.richContentDescription.nodes.pollData.poll.options.image.duration',
243
- },
244
- {
245
- path: 'category.richContentDescription.nodes.pollData.design.poll.background.image.duration',
246
- },
247
- {
248
- path: 'category.richContentDescription.nodes.appEmbedData.image.duration',
249
- },
250
- {
251
- path: 'category.richContentDescription.nodes.videoData.video.duration',
252
- },
253
- {
254
- path: 'category.richContentDescription.nodes.videoData.thumbnail.duration',
255
- },
256
- {
257
- path: 'category.richContentDescription.nodes.audioData.audio.duration',
258
- },
259
- {
260
- path: 'category.richContentDescription.nodes.audioData.coverImage.duration',
261
- },
262
- ],
263
- },
264
- ]),
265
- };
266
- return metadata;
267
- }
268
- return __getCategory;
269
- }
270
- exports.getCategory = getCategory;
271
- /**
272
- * Update a Category, supports partial update.
273
- * Pass the latest `revision` for a successful update.
274
- * Each time the category is updated, `revision` increments by 1.
275
- */
276
- function updateCategory(payload) {
277
- function __updateCategory({ host }) {
278
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
279
- {
280
- transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
281
- paths: [{ path: 'fieldMask' }],
282
- },
283
- {
284
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
285
- paths: [
286
- { path: 'category.createdDate' },
287
- { path: 'category.updatedDate' },
288
- { path: 'category.image.urlExpirationDate' },
289
- { path: 'category.richContentDescription.metadata.createdTimestamp' },
290
- { path: 'category.richContentDescription.metadata.updatedTimestamp' },
291
- ],
292
- },
293
- {
294
- transformFn: float_1.transformSDKFloatToRESTFloat,
295
- paths: [
296
- {
297
- path: 'category.richContentDescription.nodes.galleryData.items.image.media.duration',
298
- },
299
- {
300
- path: 'category.richContentDescription.nodes.galleryData.items.video.media.duration',
301
- },
302
- {
303
- path: 'category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration',
304
- },
305
- {
306
- path: 'category.richContentDescription.nodes.galleryData.options.item.ratio',
307
- },
308
- {
309
- path: 'category.richContentDescription.nodes.imageData.image.duration',
310
- },
311
- {
312
- path: 'category.richContentDescription.nodes.mapData.mapSettings.lat',
313
- },
314
- {
315
- path: 'category.richContentDescription.nodes.mapData.mapSettings.lng',
316
- },
317
- {
318
- path: 'category.richContentDescription.nodes.pollData.poll.image.duration',
319
- },
320
- {
321
- path: 'category.richContentDescription.nodes.pollData.poll.options.image.duration',
322
- },
323
- {
324
- path: 'category.richContentDescription.nodes.pollData.design.poll.background.image.duration',
325
- },
326
- {
327
- path: 'category.richContentDescription.nodes.appEmbedData.image.duration',
328
- },
329
- {
330
- path: 'category.richContentDescription.nodes.videoData.video.duration',
331
- },
332
- {
333
- path: 'category.richContentDescription.nodes.videoData.thumbnail.duration',
334
- },
335
- {
336
- path: 'category.richContentDescription.nodes.audioData.audio.duration',
337
- },
338
- {
339
- path: 'category.richContentDescription.nodes.audioData.coverImage.duration',
340
- },
341
- ],
342
- },
343
- ]);
344
- const metadata = {
345
- entityFqdn: 'wix.categories.v1.category',
346
- method: 'PATCH',
347
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.UpdateCategory',
348
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
349
- protoPath: '/v1/categories/{category.id}',
350
- data: serializedData,
351
- host,
352
- }),
353
- data: serializedData,
354
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
355
- {
356
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
357
- paths: [
358
- { path: 'category.createdDate' },
359
- { path: 'category.updatedDate' },
360
- { path: 'category.image.urlExpirationDate' },
361
- {
362
- path: 'category.richContentDescription.metadata.createdTimestamp',
363
- },
364
- {
365
- path: 'category.richContentDescription.metadata.updatedTimestamp',
366
- },
367
- ],
368
- },
369
- {
370
- transformFn: float_2.transformRESTFloatToSDKFloat,
371
- paths: [
372
- {
373
- path: 'category.richContentDescription.nodes.galleryData.items.image.media.duration',
374
- },
375
- {
376
- path: 'category.richContentDescription.nodes.galleryData.items.video.media.duration',
377
- },
378
- {
379
- path: 'category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration',
380
- },
381
- {
382
- path: 'category.richContentDescription.nodes.galleryData.options.item.ratio',
383
- },
384
- {
385
- path: 'category.richContentDescription.nodes.imageData.image.duration',
386
- },
387
- {
388
- path: 'category.richContentDescription.nodes.mapData.mapSettings.lat',
389
- },
390
- {
391
- path: 'category.richContentDescription.nodes.mapData.mapSettings.lng',
392
- },
393
- {
394
- path: 'category.richContentDescription.nodes.pollData.poll.image.duration',
395
- },
396
- {
397
- path: 'category.richContentDescription.nodes.pollData.poll.options.image.duration',
398
- },
399
- {
400
- path: 'category.richContentDescription.nodes.pollData.design.poll.background.image.duration',
401
- },
402
- {
403
- path: 'category.richContentDescription.nodes.appEmbedData.image.duration',
404
- },
405
- {
406
- path: 'category.richContentDescription.nodes.videoData.video.duration',
407
- },
408
- {
409
- path: 'category.richContentDescription.nodes.videoData.thumbnail.duration',
410
- },
411
- {
412
- path: 'category.richContentDescription.nodes.audioData.audio.duration',
413
- },
414
- {
415
- path: 'category.richContentDescription.nodes.audioData.coverImage.duration',
416
- },
417
- ],
418
- },
419
- ]),
420
- };
421
- return metadata;
422
- }
423
- return __updateCategory;
424
- }
425
- exports.updateCategory = updateCategory;
426
- /** Deletes a Category. */
427
- function deleteCategory(payload) {
428
- function __deleteCategory({ host }) {
429
- const metadata = {
430
- entityFqdn: 'wix.categories.v1.category',
431
- method: 'DELETE',
432
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.DeleteCategory',
433
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
434
- protoPath: '/v1/categories/{categoryId}',
435
- data: payload,
436
- host,
437
- }),
438
- params: (0, metro_runtime_1.toURLSearchParams)(payload),
439
- };
440
- return metadata;
441
- }
442
- return __deleteCategory;
443
- }
444
- exports.deleteCategory = deleteCategory;
445
- /** Search Categories using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) */
446
- function searchCategories(payload) {
447
- function __searchCategories({ host }) {
448
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
449
- {
450
- transformFn: float_1.transformSDKFloatToRESTFloat,
451
- paths: [
452
- { path: 'search.aggregations.range.buckets.from' },
453
- { path: 'search.aggregations.range.buckets.to' },
454
- {
455
- path: 'search.aggregations.nested.nestedAggregations.range.buckets.from',
456
- },
457
- {
458
- path: 'search.aggregations.nested.nestedAggregations.range.buckets.to',
459
- },
460
- ],
461
- },
462
- ]);
463
- const metadata = {
464
- entityFqdn: 'wix.categories.v1.category',
465
- method: 'POST',
466
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.SearchCategories',
467
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
468
- protoPath: '/v1/categories/search',
469
- data: serializedData,
470
- host,
471
- }),
472
- data: serializedData,
473
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
474
- {
475
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
476
- paths: [
477
- { path: 'categories.createdDate' },
478
- { path: 'categories.updatedDate' },
479
- { path: 'categories.image.urlExpirationDate' },
480
- {
481
- path: 'categories.richContentDescription.metadata.createdTimestamp',
482
- },
483
- {
484
- path: 'categories.richContentDescription.metadata.updatedTimestamp',
485
- },
486
- ],
487
- },
488
- {
489
- transformFn: float_2.transformRESTFloatToSDKFloat,
490
- paths: [
491
- {
492
- path: 'categories.richContentDescription.nodes.galleryData.items.image.media.duration',
493
- },
494
- {
495
- path: 'categories.richContentDescription.nodes.galleryData.items.video.media.duration',
496
- },
497
- {
498
- path: 'categories.richContentDescription.nodes.galleryData.items.video.thumbnail.duration',
499
- },
500
- {
501
- path: 'categories.richContentDescription.nodes.galleryData.options.item.ratio',
502
- },
503
- {
504
- path: 'categories.richContentDescription.nodes.imageData.image.duration',
505
- },
506
- {
507
- path: 'categories.richContentDescription.nodes.mapData.mapSettings.lat',
508
- },
509
- {
510
- path: 'categories.richContentDescription.nodes.mapData.mapSettings.lng',
511
- },
512
- {
513
- path: 'categories.richContentDescription.nodes.pollData.poll.image.duration',
514
- },
515
- {
516
- path: 'categories.richContentDescription.nodes.pollData.poll.options.image.duration',
517
- },
518
- {
519
- path: 'categories.richContentDescription.nodes.pollData.design.poll.background.image.duration',
520
- },
521
- {
522
- path: 'categories.richContentDescription.nodes.appEmbedData.image.duration',
523
- },
524
- {
525
- path: 'categories.richContentDescription.nodes.videoData.video.duration',
526
- },
527
- {
528
- path: 'categories.richContentDescription.nodes.videoData.thumbnail.duration',
529
- },
530
- {
531
- path: 'categories.richContentDescription.nodes.audioData.audio.duration',
532
- },
533
- {
534
- path: 'categories.richContentDescription.nodes.audioData.coverImage.duration',
535
- },
536
- { path: 'aggregationData.results.ranges.results.from' },
537
- { path: 'aggregationData.results.ranges.results.to' },
538
- {
539
- path: 'aggregationData.results.groupedByValue.results.nestedResults.ranges.results.from',
540
- },
541
- {
542
- path: 'aggregationData.results.groupedByValue.results.nestedResults.ranges.results.to',
543
- },
544
- {
545
- path: 'aggregationData.results.nested.results.results.range.from',
546
- },
547
- {
548
- path: 'aggregationData.results.nested.results.results.range.to',
549
- },
550
- { path: 'aggregationData.results.scalar.value' },
551
- {
552
- path: 'aggregationData.results.groupedByValue.results.nestedResults.scalar.value',
553
- },
554
- {
555
- path: 'aggregationData.results.nested.results.results.scalar.value',
556
- },
557
- ],
558
- },
559
- ]),
560
- };
561
- return metadata;
562
- }
563
- return __searchCategories;
564
- }
565
- exports.searchCategories = searchCategories;
566
- /** Returns total count of categories satisfying filter and/or search */
567
- function countCategories(payload) {
568
- function __countCategories({ host }) {
569
- const metadata = {
570
- entityFqdn: 'wix.categories.v1.category',
571
- method: 'POST',
572
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.CountCategories',
573
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
574
- protoPath: '/v1/categories/count',
575
- data: payload,
576
- host,
577
- }),
578
- data: payload,
579
- };
580
- return metadata;
581
- }
582
- return __countCategories;
583
- }
584
- exports.countCategories = countCategories;
585
- /**
586
- * Moves a category.
587
- * This operation updates `parentCategory` (`id` and `index`) for category with `categoryId`.
588
- * This endpoint can be used to move category to different parent in the same tree or to change it's position in current parent.
589
- */
590
- function moveCategory(payload) {
591
- function __moveCategory({ host }) {
592
- const metadata = {
593
- entityFqdn: 'wix.categories.v1.category',
594
- method: 'POST',
595
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.MoveCategory',
596
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
597
- protoPath: '/v1/categories/{categoryId}/move',
598
- data: payload,
599
- host,
600
- }),
601
- data: payload,
602
- };
603
- return metadata;
604
- }
605
- return __moveCategory;
606
- }
607
- exports.moveCategory = moveCategory;
608
- /**
609
- * Update multiple Categories, supports partial update.
610
- * Pass the latest `revision` for a successful update.
611
- * To update visibility, call the BulkUpdateCategoryVisibility endpoint.
612
- */
613
- function bulkUpdateCategories(payload) {
614
- function __bulkUpdateCategories({ host }) {
615
- const serializedData = (0, transform_paths_1.transformPaths)(payload, [
616
- {
617
- transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
618
- paths: [{ path: 'categories.fieldMask' }],
619
- },
620
- {
621
- transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
622
- paths: [
623
- { path: 'categories.category.createdDate' },
624
- { path: 'categories.category.updatedDate' },
625
- { path: 'categories.category.image.urlExpirationDate' },
626
- {
627
- path: 'categories.category.richContentDescription.metadata.createdTimestamp',
628
- },
629
- {
630
- path: 'categories.category.richContentDescription.metadata.updatedTimestamp',
631
- },
632
- ],
633
- },
634
- {
635
- transformFn: float_1.transformSDKFloatToRESTFloat,
636
- paths: [
637
- {
638
- path: 'categories.category.richContentDescription.nodes.galleryData.items.image.media.duration',
639
- },
640
- {
641
- path: 'categories.category.richContentDescription.nodes.galleryData.items.video.media.duration',
642
- },
643
- {
644
- path: 'categories.category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration',
645
- },
646
- {
647
- path: 'categories.category.richContentDescription.nodes.galleryData.options.item.ratio',
648
- },
649
- {
650
- path: 'categories.category.richContentDescription.nodes.imageData.image.duration',
651
- },
652
- {
653
- path: 'categories.category.richContentDescription.nodes.mapData.mapSettings.lat',
654
- },
655
- {
656
- path: 'categories.category.richContentDescription.nodes.mapData.mapSettings.lng',
657
- },
658
- {
659
- path: 'categories.category.richContentDescription.nodes.pollData.poll.image.duration',
660
- },
661
- {
662
- path: 'categories.category.richContentDescription.nodes.pollData.poll.options.image.duration',
663
- },
664
- {
665
- path: 'categories.category.richContentDescription.nodes.pollData.design.poll.background.image.duration',
666
- },
667
- {
668
- path: 'categories.category.richContentDescription.nodes.appEmbedData.image.duration',
669
- },
670
- {
671
- path: 'categories.category.richContentDescription.nodes.videoData.video.duration',
672
- },
673
- {
674
- path: 'categories.category.richContentDescription.nodes.videoData.thumbnail.duration',
675
- },
676
- {
677
- path: 'categories.category.richContentDescription.nodes.audioData.audio.duration',
678
- },
679
- {
680
- path: 'categories.category.richContentDescription.nodes.audioData.coverImage.duration',
681
- },
682
- ],
683
- },
684
- ]);
685
- const metadata = {
686
- entityFqdn: 'wix.categories.v1.category',
687
- method: 'POST',
688
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.BulkUpdateCategories',
689
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
690
- protoPath: '/v1/bulk/categories/update',
691
- data: serializedData,
692
- host,
693
- }),
694
- data: serializedData,
695
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
696
- {
697
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
698
- paths: [
699
- { path: 'results.category.createdDate' },
700
- { path: 'results.category.updatedDate' },
701
- { path: 'results.category.image.urlExpirationDate' },
702
- {
703
- path: 'results.category.richContentDescription.metadata.createdTimestamp',
704
- },
705
- {
706
- path: 'results.category.richContentDescription.metadata.updatedTimestamp',
707
- },
708
- ],
709
- },
710
- {
711
- transformFn: float_2.transformRESTFloatToSDKFloat,
712
- paths: [
713
- {
714
- path: 'results.category.richContentDescription.nodes.galleryData.items.image.media.duration',
715
- },
716
- {
717
- path: 'results.category.richContentDescription.nodes.galleryData.items.video.media.duration',
718
- },
719
- {
720
- path: 'results.category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration',
721
- },
722
- {
723
- path: 'results.category.richContentDescription.nodes.galleryData.options.item.ratio',
724
- },
725
- {
726
- path: 'results.category.richContentDescription.nodes.imageData.image.duration',
727
- },
728
- {
729
- path: 'results.category.richContentDescription.nodes.mapData.mapSettings.lat',
730
- },
731
- {
732
- path: 'results.category.richContentDescription.nodes.mapData.mapSettings.lng',
733
- },
734
- {
735
- path: 'results.category.richContentDescription.nodes.pollData.poll.image.duration',
736
- },
737
- {
738
- path: 'results.category.richContentDescription.nodes.pollData.poll.options.image.duration',
739
- },
740
- {
741
- path: 'results.category.richContentDescription.nodes.pollData.design.poll.background.image.duration',
742
- },
743
- {
744
- path: 'results.category.richContentDescription.nodes.appEmbedData.image.duration',
745
- },
746
- {
747
- path: 'results.category.richContentDescription.nodes.videoData.video.duration',
748
- },
749
- {
750
- path: 'results.category.richContentDescription.nodes.videoData.thumbnail.duration',
751
- },
752
- {
753
- path: 'results.category.richContentDescription.nodes.audioData.audio.duration',
754
- },
755
- {
756
- path: 'results.category.richContentDescription.nodes.audioData.coverImage.duration',
757
- },
758
- ],
759
- },
760
- ]),
761
- };
762
- return metadata;
763
- }
764
- return __bulkUpdateCategories;
765
- }
766
- exports.bulkUpdateCategories = bulkUpdateCategories;
767
- /** Update `visible` field. If visible is set to false, all subcategories will be set to `visible=false` */
768
- function updateCategoryVisibility(payload) {
769
- function __updateCategoryVisibility({ host }) {
770
- const metadata = {
771
- entityFqdn: 'wix.categories.v1.category',
772
- method: 'PATCH',
773
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.UpdateCategoryVisibility',
774
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
775
- protoPath: '/v1/categories/visibility',
776
- data: payload,
777
- host,
778
- }),
779
- data: payload,
780
- transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
781
- {
782
- transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
783
- paths: [
784
- { path: 'category.createdDate' },
785
- { path: 'category.updatedDate' },
786
- { path: 'category.image.urlExpirationDate' },
787
- {
788
- path: 'category.richContentDescription.metadata.createdTimestamp',
789
- },
790
- {
791
- path: 'category.richContentDescription.metadata.updatedTimestamp',
792
- },
793
- ],
794
- },
795
- {
796
- transformFn: float_2.transformRESTFloatToSDKFloat,
797
- paths: [
798
- {
799
- path: 'category.richContentDescription.nodes.galleryData.items.image.media.duration',
800
- },
801
- {
802
- path: 'category.richContentDescription.nodes.galleryData.items.video.media.duration',
803
- },
804
- {
805
- path: 'category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration',
806
- },
807
- {
808
- path: 'category.richContentDescription.nodes.galleryData.options.item.ratio',
809
- },
810
- {
811
- path: 'category.richContentDescription.nodes.imageData.image.duration',
812
- },
813
- {
814
- path: 'category.richContentDescription.nodes.mapData.mapSettings.lat',
815
- },
816
- {
817
- path: 'category.richContentDescription.nodes.mapData.mapSettings.lng',
818
- },
819
- {
820
- path: 'category.richContentDescription.nodes.pollData.poll.image.duration',
821
- },
822
- {
823
- path: 'category.richContentDescription.nodes.pollData.poll.options.image.duration',
824
- },
825
- {
826
- path: 'category.richContentDescription.nodes.pollData.design.poll.background.image.duration',
827
- },
828
- {
829
- path: 'category.richContentDescription.nodes.appEmbedData.image.duration',
830
- },
831
- {
832
- path: 'category.richContentDescription.nodes.videoData.video.duration',
833
- },
834
- {
835
- path: 'category.richContentDescription.nodes.videoData.thumbnail.duration',
836
- },
837
- {
838
- path: 'category.richContentDescription.nodes.audioData.audio.duration',
839
- },
840
- {
841
- path: 'category.richContentDescription.nodes.audioData.coverImage.duration',
842
- },
843
- ],
844
- },
845
- ]),
846
- };
847
- return metadata;
848
- }
849
- return __updateCategoryVisibility;
850
- }
851
- exports.updateCategoryVisibility = updateCategoryVisibility;
852
- /** Adds multiple items to single category, fires as many domain events as many items successfully added. */
853
- function bulkAddItemsToCategory(payload) {
854
- function __bulkAddItemsToCategory({ host }) {
855
- const metadata = {
856
- entityFqdn: 'wix.categories.v1.category',
857
- method: 'POST',
858
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.BulkAddItemsToCategory',
859
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
860
- protoPath: '/v1/bulk/categories/{categoryId}/add-items',
861
- data: payload,
862
- host,
863
- }),
864
- data: payload,
865
- };
866
- return metadata;
867
- }
868
- return __bulkAddItemsToCategory;
869
- }
870
- exports.bulkAddItemsToCategory = bulkAddItemsToCategory;
871
- /** Adds single item to multiple categories, fires as many domain events as many categories were successfully added. */
872
- function bulkAddItemToCategories(payload) {
873
- function __bulkAddItemToCategories({ host }) {
874
- const metadata = {
875
- entityFqdn: 'wix.categories.v1.category',
876
- method: 'POST',
877
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.BulkAddItemToCategories',
878
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
879
- protoPath: '/v1/bulk/categories/add-item-to-categories',
880
- data: payload,
881
- host,
882
- }),
883
- data: payload,
884
- };
885
- return metadata;
886
- }
887
- return __bulkAddItemToCategories;
888
- }
889
- exports.bulkAddItemToCategories = bulkAddItemToCategories;
890
- /** Removed multiple items from single category, fires as many domain events as many items successfully removed. */
891
- function bulkRemoveItemsFromCategory(payload) {
892
- function __bulkRemoveItemsFromCategory({ host }) {
893
- const metadata = {
894
- entityFqdn: 'wix.categories.v1.category',
895
- method: 'POST',
896
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.BulkRemoveItemsFromCategory',
897
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
898
- protoPath: '/v1/bulk/categories/{categoryId}/remove-items',
899
- data: payload,
900
- host,
901
- }),
902
- data: payload,
903
- };
904
- return metadata;
905
- }
906
- return __bulkRemoveItemsFromCategory;
907
- }
908
- exports.bulkRemoveItemsFromCategory = bulkRemoveItemsFromCategory;
909
- /** Removes single item from multiple categories, fires as many domain events as many categories were successfully removed. */
910
- function bulkRemoveItemFromCategories(payload) {
911
- function __bulkRemoveItemFromCategories({ host }) {
912
- const metadata = {
913
- entityFqdn: 'wix.categories.v1.category',
914
- method: 'POST',
915
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.BulkRemoveItemFromCategories',
916
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
917
- protoPath: '/v1/bulk/categories/remove-item-from-categories',
918
- data: payload,
919
- host,
920
- }),
921
- data: payload,
922
- };
923
- return metadata;
924
- }
925
- return __bulkRemoveItemFromCategories;
926
- }
927
- exports.bulkRemoveItemFromCategories = bulkRemoveItemFromCategories;
928
- /**
929
- * Returns up to 100 items related to requested `category_id` sorted by time when item added to category, descending.
930
- * When items added to category in bulk they considered as added at exactly same time so order will be random but always the same.
931
- */
932
- function listItemsInCategory(payload) {
933
- function __listItemsInCategory({ host }) {
934
- const metadata = {
935
- entityFqdn: 'wix.categories.v1.category',
936
- method: 'GET',
937
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.ListItemsInCategory',
938
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
939
- protoPath: '/v1/categories/{categoryId}/list-items',
940
- data: payload,
941
- host,
942
- }),
943
- params: (0, metro_runtime_1.toURLSearchParams)(payload),
944
- };
945
- return metadata;
946
- }
947
- return __listItemsInCategory;
948
- }
949
- exports.listItemsInCategory = listItemsInCategory;
950
- /** Returns all category IDs that contain the item and their parent category IDs. */
951
- function listCategoriesForItem(payload) {
952
- function __listCategoriesForItem({ host }) {
953
- const metadata = {
954
- entityFqdn: 'wix.categories.v1.category',
955
- method: 'GET',
956
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.ListCategoriesForItem',
957
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
958
- protoPath: '/v1/categories/list-categories-for-item',
959
- data: payload,
960
- host,
961
- }),
962
- params: (0, metro_runtime_1.toURLSearchParams)(payload),
963
- };
964
- return metadata;
965
- }
966
- return __listCategoriesForItem;
967
- }
968
- exports.listCategoriesForItem = listCategoriesForItem;
969
- /** Changes position of `item` in category. Will be used when sort items by manual arrangement */
970
- function moveItemInCategory(payload) {
971
- function __moveItemInCategory({ host }) {
972
- const metadata = {
973
- entityFqdn: 'wix.categories.v1.category',
974
- method: 'POST',
975
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.MoveItemInCategory',
976
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
977
- protoPath: '/v1/categories/{categoryId}/move-item',
978
- data: payload,
979
- host,
980
- }),
981
- data: payload,
982
- };
983
- return metadata;
984
- }
985
- return __moveItemInCategory;
986
- }
987
- exports.moveItemInCategory = moveItemInCategory;
988
- /**
989
- * Set arranged items in category. Will be used when sort items by manual arrangement.
990
- * Calling this endpoint overrides existing list of arranged items in category.
991
- */
992
- function setArrangedItems(payload) {
993
- function __setArrangedItems({ host }) {
994
- const metadata = {
995
- entityFqdn: 'wix.categories.v1.category',
996
- method: 'POST',
997
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.SetArrangedItems',
998
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
999
- protoPath: '/v1/categories/{categoryId}/set-arranged-items',
1000
- data: payload,
1001
- host,
1002
- }),
1003
- data: payload,
1004
- };
1005
- return metadata;
1006
- }
1007
- return __setArrangedItems;
1008
- }
1009
- exports.setArrangedItems = setArrangedItems;
1010
- /** Returns arranged items in category */
1011
- function getArrangedItems(payload) {
1012
- function __getArrangedItems({ host }) {
1013
- const metadata = {
1014
- entityFqdn: 'wix.categories.v1.category',
1015
- method: 'GET',
1016
- methodFqn: 'com.wix.categories.api.v1.CategoriesService.GetArrangedItems',
1017
- url: resolveComWixCategoriesApiV1CategoriesServiceUrl({
1018
- protoPath: '/v1/categories/{categoryId}/arranged-items',
1019
- data: payload,
1020
- host,
1021
- }),
1022
- params: (0, metro_runtime_1.toURLSearchParams)(payload),
1023
- };
1024
- return metadata;
1025
- }
1026
- return __getArrangedItems;
1027
- }
1028
- exports.getArrangedItems = getArrangedItems;
1029
- //# sourceMappingURL=categories-v1-category.http.js.map