@wix/auto_sdk_stores_collections 1.0.36 → 1.0.38

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.
@@ -168,6 +168,507 @@ function getCollectionBySlug(payload) {
168
168
 
169
169
  // src/stores-catalog-v1-collection-collections.universal.ts
170
170
  import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
171
+
172
+ // src/stores-catalog-v1-collection-collections.schemas.ts
173
+ import * as z from "zod";
174
+ var QueryCollectionsRequest = z.object({
175
+ query: z.intersection(
176
+ z.object({
177
+ filter: z.record(z.string(), z.any()).describe("Filter object.").optional().nullable(),
178
+ sort: z.array(
179
+ z.object({
180
+ fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
181
+ order: z.enum(["ASC", "DESC"]).optional()
182
+ })
183
+ ).optional()
184
+ }),
185
+ z.xor([
186
+ z.object({
187
+ paging: z.never().optional(),
188
+ cursorPaging: z.never().optional()
189
+ }),
190
+ z.object({
191
+ cursorPaging: z.never().optional(),
192
+ paging: z.object({
193
+ limit: z.number().int().describe("Number of items to load.").min(0).max(100).optional().nullable(),
194
+ offset: z.number().int().describe("Number of items to skip in the current sort order.").min(0).optional().nullable()
195
+ }).describe(
196
+ "Pointer to page of results using offset. Cannot be used together with `cursorPaging`."
197
+ )
198
+ }),
199
+ z.object({
200
+ paging: z.never().optional(),
201
+ cursorPaging: z.object({
202
+ limit: z.number().int().describe("Maximum number of items to return in the results.").min(0).max(100).optional().nullable(),
203
+ cursor: z.string().describe(
204
+ "Pointer to the next or previous page in the list of results.\n\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
205
+ ).max(16e3).optional().nullable()
206
+ }).describe(
207
+ "Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`."
208
+ )
209
+ })
210
+ ])
211
+ )
212
+ });
213
+ var QueryCollectionsResponse = z.object({
214
+ collections: z.array(
215
+ z.object({
216
+ _id: z.string().describe("Collection ID (generated automatically by the catalog).").min(35).max(36).optional().nullable(),
217
+ name: z.string().describe("Collection name.").min(1).max(50).optional().nullable(),
218
+ media: z.object({
219
+ mainMedia: z.intersection(
220
+ z.object({
221
+ thumbnail: z.object({
222
+ url: z.string().describe("Media item URL.").url().optional(),
223
+ width: z.number().int().describe("Media item width.").min(0).optional(),
224
+ height: z.number().int().describe("Media item height.").min(0).optional(),
225
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
226
+ altText: z.string().describe(
227
+ "Alt text. This text will be shown in case the image is not available."
228
+ ).optional().nullable()
229
+ }).describe("Media item thumbnail details.").optional(),
230
+ mediaType: z.enum([
231
+ "unspecified_media_item_type",
232
+ "image",
233
+ "video",
234
+ "audio",
235
+ "document",
236
+ "zip"
237
+ ]).describe("Media item type (image, video, etc.).").optional(),
238
+ title: z.string().describe("Media item title.").optional(),
239
+ _id: z.string().describe(
240
+ 'Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).'
241
+ ).optional()
242
+ }),
243
+ z.xor([
244
+ z.object({
245
+ image: z.never().optional(),
246
+ video: z.never().optional()
247
+ }),
248
+ z.object({
249
+ video: z.never().optional(),
250
+ image: z.object({
251
+ url: z.string().describe("Media item URL.").url().optional(),
252
+ width: z.number().int().describe("Media item width.").min(0).optional(),
253
+ height: z.number().int().describe("Media item height.").min(0).optional(),
254
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
255
+ altText: z.string().describe(
256
+ "Alt text. This text will be shown in case the image is not available."
257
+ ).optional().nullable()
258
+ }).describe("Image data (URL, size).")
259
+ }),
260
+ z.object({
261
+ image: z.never().optional(),
262
+ video: z.object({
263
+ files: z.array(
264
+ z.object({
265
+ url: z.string().describe("Media item URL.").url().optional(),
266
+ width: z.number().int().describe("Media item width.").min(0).optional(),
267
+ height: z.number().int().describe("Media item height.").min(0).optional(),
268
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
269
+ altText: z.string().describe(
270
+ "Alt text. This text will be shown in case the image is not available."
271
+ ).optional().nullable()
272
+ })
273
+ ).optional(),
274
+ stillFrameMediaId: z.string().describe(
275
+ 'ID of an image taken from the video. Used primarily for Wix Search indexing. For example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`.'
276
+ ).optional()
277
+ }).describe("Video data (URL, size).")
278
+ })
279
+ ])
280
+ ).describe(
281
+ "Primary media (image, video etc) associated with this product."
282
+ ).optional(),
283
+ items: z.array(
284
+ z.intersection(
285
+ z.object({
286
+ thumbnail: z.object({
287
+ url: z.string().describe("Media item URL.").url().optional(),
288
+ width: z.number().int().describe("Media item width.").min(0).optional(),
289
+ height: z.number().int().describe("Media item height.").min(0).optional(),
290
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
291
+ altText: z.string().describe(
292
+ "Alt text. This text will be shown in case the image is not available."
293
+ ).optional().nullable()
294
+ }).describe("Media item thumbnail details.").optional(),
295
+ mediaType: z.enum([
296
+ "unspecified_media_item_type",
297
+ "image",
298
+ "video",
299
+ "audio",
300
+ "document",
301
+ "zip"
302
+ ]).describe("Media item type (image, video, etc.).").optional(),
303
+ title: z.string().describe("Media item title.").optional(),
304
+ _id: z.string().describe(
305
+ 'Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).'
306
+ ).optional()
307
+ }),
308
+ z.xor([
309
+ z.object({
310
+ image: z.never().optional(),
311
+ video: z.never().optional()
312
+ }),
313
+ z.object({
314
+ video: z.never().optional(),
315
+ image: z.object({
316
+ url: z.string().describe("Media item URL.").url().optional(),
317
+ width: z.number().int().describe("Media item width.").min(0).optional(),
318
+ height: z.number().int().describe("Media item height.").min(0).optional(),
319
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
320
+ altText: z.string().describe(
321
+ "Alt text. This text will be shown in case the image is not available."
322
+ ).optional().nullable()
323
+ }).describe("Image data (URL, size).")
324
+ }),
325
+ z.object({
326
+ image: z.never().optional(),
327
+ video: z.object({
328
+ files: z.array(
329
+ z.object({
330
+ url: z.string().describe("Media item URL.").url().optional(),
331
+ width: z.number().int().describe("Media item width.").min(0).optional(),
332
+ height: z.number().int().describe("Media item height.").min(0).optional(),
333
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
334
+ altText: z.string().describe(
335
+ "Alt text. This text will be shown in case the image is not available."
336
+ ).optional().nullable()
337
+ })
338
+ ).optional(),
339
+ stillFrameMediaId: z.string().describe(
340
+ 'ID of an image taken from the video. Used primarily for Wix Search indexing. For example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`.'
341
+ ).optional()
342
+ }).describe("Video data (URL, size).")
343
+ })
344
+ ])
345
+ )
346
+ ).optional()
347
+ }).describe(
348
+ "Media items (images, videos etc) associated with this collection. Read only."
349
+ ).optional(),
350
+ numberOfProducts: z.number().int().describe("Number of products in the collection. Read only.").optional(),
351
+ description: z.string().describe("Collection description.").min(0).max(600).optional().nullable(),
352
+ slug: z.string().describe("Collection slug.").min(1).max(100).optional().nullable(),
353
+ visible: z.boolean().describe(
354
+ "Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`."
355
+ ).optional().nullable()
356
+ })
357
+ ).max(100).optional(),
358
+ metadata: z.object({
359
+ count: z.number().int().describe("The number of items returned in this response.").optional().nullable(),
360
+ offset: z.number().int().describe(
361
+ "The offset which was requested. Returned if offset paging was used."
362
+ ).optional().nullable(),
363
+ total: z.number().int().describe(
364
+ "The total number of items that match the query. Returned if offset paging was used."
365
+ ).optional().nullable(),
366
+ cursors: z.object({
367
+ next: z.string().describe(
368
+ "Cursor string pointing to the next page in the list of results."
369
+ ).max(16e3).optional().nullable(),
370
+ prev: z.string().describe(
371
+ "Cursor pointing to the previous page in the list of results."
372
+ ).max(16e3).optional().nullable()
373
+ }).describe(
374
+ "Cursors to navigate through result pages. Returned if cursor paging was used."
375
+ ).optional()
376
+ }).optional()
377
+ });
378
+ var GetCollectionRequest = z.object({
379
+ _id: z.string().describe("Requested collection ID.")
380
+ });
381
+ var GetCollectionResponse = z.object({
382
+ _id: z.string().describe("Collection ID (generated automatically by the catalog).").min(35).max(36).optional().nullable(),
383
+ name: z.string().describe("Collection name.").min(1).max(50).optional().nullable(),
384
+ media: z.object({
385
+ mainMedia: z.intersection(
386
+ z.object({
387
+ thumbnail: z.object({
388
+ url: z.string().describe("Media item URL.").url().optional(),
389
+ width: z.number().int().describe("Media item width.").min(0).optional(),
390
+ height: z.number().int().describe("Media item height.").min(0).optional(),
391
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
392
+ altText: z.string().describe(
393
+ "Alt text. This text will be shown in case the image is not available."
394
+ ).optional().nullable()
395
+ }).describe("Media item thumbnail details.").optional(),
396
+ mediaType: z.enum([
397
+ "unspecified_media_item_type",
398
+ "image",
399
+ "video",
400
+ "audio",
401
+ "document",
402
+ "zip"
403
+ ]).describe("Media item type (image, video, etc.).").optional(),
404
+ title: z.string().describe("Media item title.").optional(),
405
+ _id: z.string().describe(
406
+ 'Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).'
407
+ ).optional()
408
+ }),
409
+ z.xor([
410
+ z.object({
411
+ image: z.never().optional(),
412
+ video: z.never().optional()
413
+ }),
414
+ z.object({
415
+ video: z.never().optional(),
416
+ image: z.object({
417
+ url: z.string().describe("Media item URL.").url().optional(),
418
+ width: z.number().int().describe("Media item width.").min(0).optional(),
419
+ height: z.number().int().describe("Media item height.").min(0).optional(),
420
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
421
+ altText: z.string().describe(
422
+ "Alt text. This text will be shown in case the image is not available."
423
+ ).optional().nullable()
424
+ }).describe("Image data (URL, size).")
425
+ }),
426
+ z.object({
427
+ image: z.never().optional(),
428
+ video: z.object({
429
+ files: z.array(
430
+ z.object({
431
+ url: z.string().describe("Media item URL.").url().optional(),
432
+ width: z.number().int().describe("Media item width.").min(0).optional(),
433
+ height: z.number().int().describe("Media item height.").min(0).optional(),
434
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
435
+ altText: z.string().describe(
436
+ "Alt text. This text will be shown in case the image is not available."
437
+ ).optional().nullable()
438
+ })
439
+ ).optional(),
440
+ stillFrameMediaId: z.string().describe(
441
+ 'ID of an image taken from the video. Used primarily for Wix Search indexing. For example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`.'
442
+ ).optional()
443
+ }).describe("Video data (URL, size).")
444
+ })
445
+ ])
446
+ ).describe(
447
+ "Primary media (image, video etc) associated with this product."
448
+ ).optional(),
449
+ items: z.array(
450
+ z.intersection(
451
+ z.object({
452
+ thumbnail: z.object({
453
+ url: z.string().describe("Media item URL.").url().optional(),
454
+ width: z.number().int().describe("Media item width.").min(0).optional(),
455
+ height: z.number().int().describe("Media item height.").min(0).optional(),
456
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
457
+ altText: z.string().describe(
458
+ "Alt text. This text will be shown in case the image is not available."
459
+ ).optional().nullable()
460
+ }).describe("Media item thumbnail details.").optional(),
461
+ mediaType: z.enum([
462
+ "unspecified_media_item_type",
463
+ "image",
464
+ "video",
465
+ "audio",
466
+ "document",
467
+ "zip"
468
+ ]).describe("Media item type (image, video, etc.).").optional(),
469
+ title: z.string().describe("Media item title.").optional(),
470
+ _id: z.string().describe(
471
+ 'Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).'
472
+ ).optional()
473
+ }),
474
+ z.xor([
475
+ z.object({
476
+ image: z.never().optional(),
477
+ video: z.never().optional()
478
+ }),
479
+ z.object({
480
+ video: z.never().optional(),
481
+ image: z.object({
482
+ url: z.string().describe("Media item URL.").url().optional(),
483
+ width: z.number().int().describe("Media item width.").min(0).optional(),
484
+ height: z.number().int().describe("Media item height.").min(0).optional(),
485
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
486
+ altText: z.string().describe(
487
+ "Alt text. This text will be shown in case the image is not available."
488
+ ).optional().nullable()
489
+ }).describe("Image data (URL, size).")
490
+ }),
491
+ z.object({
492
+ image: z.never().optional(),
493
+ video: z.object({
494
+ files: z.array(
495
+ z.object({
496
+ url: z.string().describe("Media item URL.").url().optional(),
497
+ width: z.number().int().describe("Media item width.").min(0).optional(),
498
+ height: z.number().int().describe("Media item height.").min(0).optional(),
499
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
500
+ altText: z.string().describe(
501
+ "Alt text. This text will be shown in case the image is not available."
502
+ ).optional().nullable()
503
+ })
504
+ ).optional(),
505
+ stillFrameMediaId: z.string().describe(
506
+ 'ID of an image taken from the video. Used primarily for Wix Search indexing. For example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`.'
507
+ ).optional()
508
+ }).describe("Video data (URL, size).")
509
+ })
510
+ ])
511
+ )
512
+ ).optional()
513
+ }).describe(
514
+ "Media items (images, videos etc) associated with this collection. Read only."
515
+ ).optional(),
516
+ numberOfProducts: z.number().int().describe("Number of products in the collection. Read only.").optional(),
517
+ description: z.string().describe("Collection description.").min(0).max(600).optional().nullable(),
518
+ slug: z.string().describe("Collection slug.").min(1).max(100).optional().nullable(),
519
+ visible: z.boolean().describe(
520
+ "Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`."
521
+ ).optional().nullable()
522
+ });
523
+ var GetCollectionBySlugRequest = z.object({
524
+ slug: z.string().describe("Slug of the collection to retrieve.").min(1).max(100)
525
+ });
526
+ var GetCollectionBySlugResponse = z.object({
527
+ collection: z.object({
528
+ _id: z.string().describe("Collection ID (generated automatically by the catalog).").min(35).max(36).optional().nullable(),
529
+ name: z.string().describe("Collection name.").min(1).max(50).optional().nullable(),
530
+ media: z.object({
531
+ mainMedia: z.intersection(
532
+ z.object({
533
+ thumbnail: z.object({
534
+ url: z.string().describe("Media item URL.").url().optional(),
535
+ width: z.number().int().describe("Media item width.").min(0).optional(),
536
+ height: z.number().int().describe("Media item height.").min(0).optional(),
537
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
538
+ altText: z.string().describe(
539
+ "Alt text. This text will be shown in case the image is not available."
540
+ ).optional().nullable()
541
+ }).describe("Media item thumbnail details.").optional(),
542
+ mediaType: z.enum([
543
+ "unspecified_media_item_type",
544
+ "image",
545
+ "video",
546
+ "audio",
547
+ "document",
548
+ "zip"
549
+ ]).describe("Media item type (image, video, etc.).").optional(),
550
+ title: z.string().describe("Media item title.").optional(),
551
+ _id: z.string().describe(
552
+ 'Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).'
553
+ ).optional()
554
+ }),
555
+ z.xor([
556
+ z.object({
557
+ image: z.never().optional(),
558
+ video: z.never().optional()
559
+ }),
560
+ z.object({
561
+ video: z.never().optional(),
562
+ image: z.object({
563
+ url: z.string().describe("Media item URL.").url().optional(),
564
+ width: z.number().int().describe("Media item width.").min(0).optional(),
565
+ height: z.number().int().describe("Media item height.").min(0).optional(),
566
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
567
+ altText: z.string().describe(
568
+ "Alt text. This text will be shown in case the image is not available."
569
+ ).optional().nullable()
570
+ }).describe("Image data (URL, size).")
571
+ }),
572
+ z.object({
573
+ image: z.never().optional(),
574
+ video: z.object({
575
+ files: z.array(
576
+ z.object({
577
+ url: z.string().describe("Media item URL.").url().optional(),
578
+ width: z.number().int().describe("Media item width.").min(0).optional(),
579
+ height: z.number().int().describe("Media item height.").min(0).optional(),
580
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
581
+ altText: z.string().describe(
582
+ "Alt text. This text will be shown in case the image is not available."
583
+ ).optional().nullable()
584
+ })
585
+ ).optional(),
586
+ stillFrameMediaId: z.string().describe(
587
+ 'ID of an image taken from the video. Used primarily for Wix Search indexing. For example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`.'
588
+ ).optional()
589
+ }).describe("Video data (URL, size).")
590
+ })
591
+ ])
592
+ ).describe(
593
+ "Primary media (image, video etc) associated with this product."
594
+ ).optional(),
595
+ items: z.array(
596
+ z.intersection(
597
+ z.object({
598
+ thumbnail: z.object({
599
+ url: z.string().describe("Media item URL.").url().optional(),
600
+ width: z.number().int().describe("Media item width.").min(0).optional(),
601
+ height: z.number().int().describe("Media item height.").min(0).optional(),
602
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
603
+ altText: z.string().describe(
604
+ "Alt text. This text will be shown in case the image is not available."
605
+ ).optional().nullable()
606
+ }).describe("Media item thumbnail details.").optional(),
607
+ mediaType: z.enum([
608
+ "unspecified_media_item_type",
609
+ "image",
610
+ "video",
611
+ "audio",
612
+ "document",
613
+ "zip"
614
+ ]).describe("Media item type (image, video, etc.).").optional(),
615
+ title: z.string().describe("Media item title.").optional(),
616
+ _id: z.string().describe(
617
+ 'Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).'
618
+ ).optional()
619
+ }),
620
+ z.xor([
621
+ z.object({
622
+ image: z.never().optional(),
623
+ video: z.never().optional()
624
+ }),
625
+ z.object({
626
+ video: z.never().optional(),
627
+ image: z.object({
628
+ url: z.string().describe("Media item URL.").url().optional(),
629
+ width: z.number().int().describe("Media item width.").min(0).optional(),
630
+ height: z.number().int().describe("Media item height.").min(0).optional(),
631
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
632
+ altText: z.string().describe(
633
+ "Alt text. This text will be shown in case the image is not available."
634
+ ).optional().nullable()
635
+ }).describe("Image data (URL, size).")
636
+ }),
637
+ z.object({
638
+ image: z.never().optional(),
639
+ video: z.object({
640
+ files: z.array(
641
+ z.object({
642
+ url: z.string().describe("Media item URL.").url().optional(),
643
+ width: z.number().int().describe("Media item width.").min(0).optional(),
644
+ height: z.number().int().describe("Media item height.").min(0).optional(),
645
+ format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
646
+ altText: z.string().describe(
647
+ "Alt text. This text will be shown in case the image is not available."
648
+ ).optional().nullable()
649
+ })
650
+ ).optional(),
651
+ stillFrameMediaId: z.string().describe(
652
+ 'ID of an image taken from the video. Used primarily for Wix Search indexing. For example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`.'
653
+ ).optional()
654
+ }).describe("Video data (URL, size).")
655
+ })
656
+ ])
657
+ )
658
+ ).optional()
659
+ }).describe(
660
+ "Media items (images, videos etc) associated with this collection. Read only."
661
+ ).optional(),
662
+ numberOfProducts: z.number().int().describe("Number of products in the collection. Read only.").optional(),
663
+ description: z.string().describe("Collection description.").min(0).max(600).optional().nullable(),
664
+ slug: z.string().describe("Collection slug.").min(1).max(100).optional().nullable(),
665
+ visible: z.boolean().describe(
666
+ "Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`."
667
+ ).optional().nullable()
668
+ }).describe("The requested collection.").optional()
669
+ });
670
+
671
+ // src/stores-catalog-v1-collection-collections.universal.ts
171
672
  import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
172
673
  var MediaItemType = /* @__PURE__ */ ((MediaItemType2) => {
173
674
  MediaItemType2["unspecified_media_item_type"] = "unspecified_media_item_type";
@@ -227,7 +728,10 @@ function queryCollections2() {
227
728
  });
228
729
  }
229
730
  async function typedQueryCollections(query) {
230
- const { httpClient, sideEffects } = arguments[1];
731
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
732
+ if (validateRequestSchema) {
733
+ QueryCollectionsRequest.parse({ query });
734
+ }
231
735
  const payload = renameKeysFromSDKRequestToRESTRequest({ query });
232
736
  const reqOpts = queryCollections(payload);
233
737
  sideEffects?.onSiteCall?.();
@@ -255,7 +759,10 @@ var utils = {
255
759
  }
256
760
  };
257
761
  async function getCollection2(_id) {
258
- const { httpClient, sideEffects } = arguments[1];
762
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
763
+ if (validateRequestSchema) {
764
+ GetCollectionRequest.parse({ _id });
765
+ }
259
766
  const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
260
767
  const reqOpts = getCollection(payload);
261
768
  sideEffects?.onSiteCall?.();
@@ -278,7 +785,10 @@ async function getCollection2(_id) {
278
785
  }
279
786
  }
280
787
  async function getCollectionBySlug2(slug) {
281
- const { httpClient, sideEffects } = arguments[1];
788
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
789
+ if (validateRequestSchema) {
790
+ GetCollectionBySlugRequest.parse({ slug });
791
+ }
282
792
  const payload = renameKeysFromSDKRequestToRESTRequest({ slug });
283
793
  const reqOpts = getCollectionBySlug(payload);
284
794
  sideEffects?.onSiteCall?.();