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