@wix/categories 1.0.22 → 1.0.24

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