@wix/auto_sdk_benefit-programs_items 1.0.56 → 1.0.57

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.
@@ -475,802 +475,6 @@ function countItems(payload) {
475
475
 
476
476
  // src/benefit-programs-v1-item-items.universal.ts
477
477
  import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
478
-
479
- // src/benefit-programs-v1-item-items.schemas.ts
480
- import * as z from "zod";
481
- var CreateItemRequest = z.object({
482
- item: z.object({
483
- _id: z.string().describe("Benefit item ID.").regex(
484
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
485
- "Must be a valid GUID"
486
- ).optional().nullable(),
487
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
488
- "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
489
- ).optional().nullable(),
490
- _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
491
- _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
492
- externalId: z.string().describe(
493
- "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
494
- ).regex(
495
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
496
- "Must be a valid GUID"
497
- ),
498
- category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
499
- itemSetId: z.string().describe(
500
- "Item set ID of the benefit that this benefit item is a part of."
501
- ).regex(
502
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
503
- "Must be a valid GUID"
504
- ),
505
- displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
506
- providerAppId: z.string().describe(
507
- "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
508
- ).regex(
509
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
510
- "Must be a valid GUID"
511
- ),
512
- extendedFields: z.object({
513
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
514
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
515
- ).optional()
516
- }).describe(
517
- "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
518
- ).optional(),
519
- namespace: z.string().describe(
520
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
521
- ).min(1).max(20)
522
- }).describe("Item to create.")
523
- });
524
- var CreateItemResponse = z.object({
525
- _id: z.string().describe("Benefit item ID.").regex(
526
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
527
- "Must be a valid GUID"
528
- ).optional().nullable(),
529
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
530
- "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
531
- ).optional().nullable(),
532
- _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
533
- _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
534
- externalId: z.string().describe(
535
- "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
536
- ).regex(
537
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
538
- "Must be a valid GUID"
539
- ).optional().nullable(),
540
- category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
541
- itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
542
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
543
- "Must be a valid GUID"
544
- ).optional().nullable(),
545
- displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
546
- providerAppId: z.string().describe(
547
- "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
548
- ).regex(
549
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
550
- "Must be a valid GUID"
551
- ).optional().nullable(),
552
- extendedFields: z.object({
553
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
554
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
555
- ).optional()
556
- }).describe(
557
- "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
558
- ).optional(),
559
- namespace: z.string().describe(
560
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
561
- ).min(1).max(20).optional().nullable()
562
- });
563
- var BulkCreateItemsRequest = z.object({
564
- items: z.array(
565
- z.object({
566
- _id: z.string().describe("Benefit item ID.").regex(
567
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
568
- "Must be a valid GUID"
569
- ).optional().nullable(),
570
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
571
- "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
572
- ).optional().nullable(),
573
- _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
574
- _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
575
- externalId: z.string().describe(
576
- "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
577
- ).regex(
578
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
579
- "Must be a valid GUID"
580
- ),
581
- category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
582
- itemSetId: z.string().describe(
583
- "Item set ID of the benefit that this benefit item is a part of."
584
- ).regex(
585
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
586
- "Must be a valid GUID"
587
- ),
588
- displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
589
- providerAppId: z.string().describe(
590
- "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
591
- ).regex(
592
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
593
- "Must be a valid GUID"
594
- ),
595
- extendedFields: z.object({
596
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
597
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
598
- ).optional()
599
- }).describe(
600
- "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
601
- ).optional(),
602
- namespace: z.string().describe(
603
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
604
- ).min(1).max(20)
605
- })
606
- ).min(1).max(100),
607
- options: z.object({
608
- returnEntity: z.boolean().describe(
609
- "Whether to return the full item entities.\n\nDefault: `false`"
610
- ).optional()
611
- }).optional()
612
- });
613
- var BulkCreateItemsResponse = z.object({
614
- results: z.array(
615
- z.object({
616
- itemMetadata: z.object({
617
- _id: z.string().describe(
618
- "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
619
- ).regex(
620
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
621
- "Must be a valid GUID"
622
- ).optional().nullable(),
623
- originalIndex: z.number().int().describe(
624
- "Index of the item within the request array. Allows for correlation between request and response items."
625
- ).optional(),
626
- success: z.boolean().describe(
627
- "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
628
- ).optional(),
629
- error: z.object({
630
- code: z.string().describe("Error code.").optional(),
631
- description: z.string().describe("Description of the error.").optional(),
632
- data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
633
- }).describe("Details about the error in case of failure.").optional()
634
- }).describe("Item metadata.").optional(),
635
- item: z.object({
636
- _id: z.string().describe("Benefit item ID.").regex(
637
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
638
- "Must be a valid GUID"
639
- ).optional().nullable(),
640
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
641
- "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
642
- ).optional().nullable(),
643
- _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
644
- _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
645
- externalId: z.string().describe(
646
- "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
647
- ).regex(
648
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
649
- "Must be a valid GUID"
650
- ).optional().nullable(),
651
- category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
652
- itemSetId: z.string().describe(
653
- "Item set ID of the benefit that this benefit item is a part of."
654
- ).regex(
655
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
656
- "Must be a valid GUID"
657
- ).optional().nullable(),
658
- displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
659
- providerAppId: z.string().describe(
660
- "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
661
- ).regex(
662
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
663
- "Must be a valid GUID"
664
- ).optional().nullable(),
665
- extendedFields: z.object({
666
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
667
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
668
- ).optional()
669
- }).describe(
670
- "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
671
- ).optional(),
672
- namespace: z.string().describe(
673
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
674
- ).min(1).max(20).optional().nullable()
675
- }).describe("Item.").optional()
676
- })
677
- ).min(1).max(100).optional(),
678
- bulkActionMetadata: z.object({
679
- totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
680
- totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
681
- undetailedFailures: z.number().int().describe(
682
- "Number of failures without details because detailed failure threshold was exceeded."
683
- ).optional()
684
- }).describe("Bulk action metadata.").optional()
685
- });
686
- var DeleteItemRequest = z.object({
687
- itemId: z.string().describe("Item ID.").regex(
688
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
689
- "Must be a valid GUID"
690
- )
691
- });
692
- var DeleteItemResponse = z.object({});
693
- var BulkDeleteItemsRequest = z.object({
694
- itemIds: z.array(z.string()).min(1).max(100)
695
- });
696
- var BulkDeleteItemsResponse = z.object({
697
- results: z.array(
698
- z.object({
699
- itemMetadata: z.object({
700
- _id: z.string().describe(
701
- "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
702
- ).regex(
703
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
704
- "Must be a valid GUID"
705
- ).optional().nullable(),
706
- originalIndex: z.number().int().describe(
707
- "Index of the item within the request array. Allows for correlation between request and response items."
708
- ).optional(),
709
- success: z.boolean().describe(
710
- "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
711
- ).optional(),
712
- error: z.object({
713
- code: z.string().describe("Error code.").optional(),
714
- description: z.string().describe("Description of the error.").optional(),
715
- data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
716
- }).describe("Details about the error in case of failure.").optional()
717
- }).describe("Item metadata.").optional(),
718
- item: z.object({
719
- _id: z.string().describe("Benefit item ID.").regex(
720
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
721
- "Must be a valid GUID"
722
- ).optional().nullable(),
723
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
724
- "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
725
- ).optional().nullable(),
726
- _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
727
- _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
728
- externalId: z.string().describe(
729
- "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
730
- ).regex(
731
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
732
- "Must be a valid GUID"
733
- ).optional().nullable(),
734
- category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
735
- itemSetId: z.string().describe(
736
- "Item set ID of the benefit that this benefit item is a part of."
737
- ).regex(
738
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
739
- "Must be a valid GUID"
740
- ).optional().nullable(),
741
- displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
742
- providerAppId: z.string().describe(
743
- "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
744
- ).regex(
745
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
746
- "Must be a valid GUID"
747
- ).optional().nullable(),
748
- extendedFields: z.object({
749
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
750
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
751
- ).optional()
752
- }).describe(
753
- "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
754
- ).optional(),
755
- namespace: z.string().describe(
756
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
757
- ).min(1).max(20).optional().nullable()
758
- }).describe("Item.").optional()
759
- })
760
- ).min(1).max(100).optional(),
761
- bulkActionMetadata: z.object({
762
- totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
763
- totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
764
- undetailedFailures: z.number().int().describe(
765
- "Number of failures without details because detailed failure threshold was exceeded."
766
- ).optional()
767
- }).describe("Bulk action metadata.").optional()
768
- });
769
- var BulkDeleteItemsByFilterRequest = z.object({
770
- namespace: z.string().describe(
771
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
772
- ).min(1).max(20),
773
- options: z.object({
774
- filter: z.record(z.string(), z.any()).describe(
775
- "Filter options. To learn more, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)."
776
- ).optional().nullable()
777
- }).optional()
778
- });
779
- var BulkDeleteItemsByFilterResponse = z.object({
780
- jobId: z.string().describe(
781
- "Job ID for item deletion. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
782
- ).regex(
783
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
784
- "Must be a valid GUID"
785
- ).optional()
786
- });
787
- var UpdateItemRequest = z.object({
788
- _id: z.string().describe("Benefit item ID.").regex(
789
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
790
- "Must be a valid GUID"
791
- ),
792
- item: z.object({
793
- _id: z.string().describe("Benefit item ID.").regex(
794
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
795
- "Must be a valid GUID"
796
- ).optional().nullable(),
797
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
798
- "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
799
- ),
800
- _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
801
- _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
802
- externalId: z.string().describe(
803
- "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
804
- ).regex(
805
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
806
- "Must be a valid GUID"
807
- ).optional().nullable(),
808
- category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
809
- itemSetId: z.string().describe(
810
- "Item set ID of the benefit that this benefit item is a part of."
811
- ).regex(
812
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
813
- "Must be a valid GUID"
814
- ).optional().nullable(),
815
- displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
816
- providerAppId: z.string().describe(
817
- "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
818
- ).regex(
819
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
820
- "Must be a valid GUID"
821
- ).optional().nullable(),
822
- extendedFields: z.object({
823
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
824
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
825
- ).optional()
826
- }).describe(
827
- "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
828
- ).optional(),
829
- namespace: z.string().describe(
830
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
831
- ).min(1).max(20).optional().nullable()
832
- }).describe("Item to update.")
833
- });
834
- var UpdateItemResponse = z.object({
835
- _id: z.string().describe("Benefit item ID.").regex(
836
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
837
- "Must be a valid GUID"
838
- ).optional().nullable(),
839
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
840
- "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
841
- ).optional().nullable(),
842
- _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
843
- _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
844
- externalId: z.string().describe(
845
- "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
846
- ).regex(
847
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
848
- "Must be a valid GUID"
849
- ).optional().nullable(),
850
- category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
851
- itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
852
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
853
- "Must be a valid GUID"
854
- ).optional().nullable(),
855
- displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
856
- providerAppId: z.string().describe(
857
- "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
858
- ).regex(
859
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
860
- "Must be a valid GUID"
861
- ).optional().nullable(),
862
- extendedFields: z.object({
863
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
864
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
865
- ).optional()
866
- }).describe(
867
- "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
868
- ).optional(),
869
- namespace: z.string().describe(
870
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
871
- ).min(1).max(20).optional().nullable()
872
- });
873
- var BulkUpdateItemsRequest = z.object({
874
- options: z.object({
875
- items: z.array(
876
- z.object({
877
- item: z.object({
878
- _id: z.string().describe("Benefit item ID.").regex(
879
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
880
- "Must be a valid GUID"
881
- ),
882
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
883
- "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
884
- ),
885
- _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
886
- _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
887
- externalId: z.string().describe(
888
- "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
889
- ).regex(
890
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
891
- "Must be a valid GUID"
892
- ).optional().nullable(),
893
- category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
894
- itemSetId: z.string().describe(
895
- "Item set ID of the benefit that this benefit item is a part of."
896
- ).regex(
897
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
898
- "Must be a valid GUID"
899
- ).optional().nullable(),
900
- displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
901
- providerAppId: z.string().describe(
902
- "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
903
- ).regex(
904
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
905
- "Must be a valid GUID"
906
- ).optional().nullable(),
907
- extendedFields: z.object({
908
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
909
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
910
- ).optional()
911
- }).describe(
912
- "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
913
- ).optional(),
914
- namespace: z.string().describe(
915
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
916
- ).min(1).max(20).optional().nullable()
917
- }).describe("Item to update."),
918
- fieldMask: z.array(z.string()).optional()
919
- })
920
- ).min(1).max(100).optional(),
921
- returnEntity: z.boolean().describe(
922
- "Whether to return the full item entities.\n\nDefault: `false`"
923
- ).optional()
924
- }).optional()
925
- });
926
- var BulkUpdateItemsResponse = z.object({
927
- results: z.array(
928
- z.object({
929
- itemMetadata: z.object({
930
- _id: z.string().describe(
931
- "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
932
- ).regex(
933
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
934
- "Must be a valid GUID"
935
- ).optional().nullable(),
936
- originalIndex: z.number().int().describe(
937
- "Index of the item within the request array. Allows for correlation between request and response items."
938
- ).optional(),
939
- success: z.boolean().describe(
940
- "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
941
- ).optional(),
942
- error: z.object({
943
- code: z.string().describe("Error code.").optional(),
944
- description: z.string().describe("Description of the error.").optional(),
945
- data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
946
- }).describe("Details about the error in case of failure.").optional()
947
- }).describe("Item metadata.").optional(),
948
- item: z.object({
949
- _id: z.string().describe("Benefit item ID.").regex(
950
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
951
- "Must be a valid GUID"
952
- ).optional().nullable(),
953
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
954
- "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
955
- ).optional().nullable(),
956
- _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
957
- _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
958
- externalId: z.string().describe(
959
- "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
960
- ).regex(
961
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
962
- "Must be a valid GUID"
963
- ).optional().nullable(),
964
- category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
965
- itemSetId: z.string().describe(
966
- "Item set ID of the benefit that this benefit item is a part of."
967
- ).regex(
968
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
969
- "Must be a valid GUID"
970
- ).optional().nullable(),
971
- displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
972
- providerAppId: z.string().describe(
973
- "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
974
- ).regex(
975
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
976
- "Must be a valid GUID"
977
- ).optional().nullable(),
978
- extendedFields: z.object({
979
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
980
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
981
- ).optional()
982
- }).describe(
983
- "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
984
- ).optional(),
985
- namespace: z.string().describe(
986
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
987
- ).min(1).max(20).optional().nullable()
988
- }).describe("Item.").optional()
989
- })
990
- ).min(1).max(100).optional(),
991
- bulkActionMetadata: z.object({
992
- totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
993
- totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
994
- undetailedFailures: z.number().int().describe(
995
- "Number of failures without details because detailed failure threshold was exceeded."
996
- ).optional()
997
- }).describe("Bulk action metadata.").optional()
998
- });
999
- var GetItemRequest = z.object({
1000
- itemId: z.string().describe("ID of the item to retrieve.").regex(
1001
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1002
- "Must be a valid GUID"
1003
- )
1004
- });
1005
- var GetItemResponse = z.object({
1006
- _id: z.string().describe("Benefit item ID.").regex(
1007
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1008
- "Must be a valid GUID"
1009
- ).optional().nullable(),
1010
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1011
- "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
1012
- ).optional().nullable(),
1013
- _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
1014
- _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
1015
- externalId: z.string().describe(
1016
- "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
1017
- ).regex(
1018
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1019
- "Must be a valid GUID"
1020
- ).optional().nullable(),
1021
- category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
1022
- itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
1023
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1024
- "Must be a valid GUID"
1025
- ).optional().nullable(),
1026
- displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
1027
- providerAppId: z.string().describe(
1028
- "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
1029
- ).regex(
1030
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1031
- "Must be a valid GUID"
1032
- ).optional().nullable(),
1033
- extendedFields: z.object({
1034
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1035
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
1036
- ).optional()
1037
- }).describe(
1038
- "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
1039
- ).optional(),
1040
- namespace: z.string().describe(
1041
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
1042
- ).min(1).max(20).optional().nullable()
1043
- });
1044
- var ListItemsRequest = z.object({
1045
- options: z.object({
1046
- filter: z.intersection(
1047
- z.object({
1048
- type: z.enum(["BY_ITEM_SET_ID_AND_REFERENCE", "BY_REFERENCE"]).optional(),
1049
- namespace: z.string().describe("Filter by namespace.").min(1).max(20).optional()
1050
- }),
1051
- z.xor([
1052
- z.object({
1053
- byItemSetIdAndReferenceOptions: z.never().optional(),
1054
- byReferenceOptions: z.never().optional()
1055
- }),
1056
- z.object({
1057
- byReferenceOptions: z.never().optional(),
1058
- byItemSetIdAndReferenceOptions: z.object({
1059
- filters: z.array(
1060
- z.object({
1061
- itemSetId: z.string().describe("ID set ID.").regex(
1062
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1063
- "Must be a valid GUID"
1064
- ).optional(),
1065
- externalId: z.string().describe("External item ID.").regex(
1066
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1067
- "Must be a valid GUID"
1068
- ).optional(),
1069
- category: z.string().describe("Item category.").max(20).optional(),
1070
- providerAppId: z.string().describe(
1071
- "*Required**. ID of the app providing the item."
1072
- ).regex(
1073
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1074
- "Must be a valid GUID"
1075
- ).optional()
1076
- })
1077
- ).min(1).max(100).optional()
1078
- }).describe(
1079
- "Filter the request by `itemSetId` and item reference."
1080
- )
1081
- }),
1082
- z.object({
1083
- byItemSetIdAndReferenceOptions: z.never().optional(),
1084
- byReferenceOptions: z.object({
1085
- filters: z.array(
1086
- z.object({
1087
- externalId: z.string().describe("External item ID.").regex(
1088
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1089
- "Must be a valid GUID"
1090
- ).optional(),
1091
- category: z.string().describe("Item category.").max(20).optional(),
1092
- providerAppId: z.string().describe(
1093
- "*Required**. ID of the app providing the item."
1094
- ).regex(
1095
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1096
- "Must be a valid GUID"
1097
- ).optional()
1098
- })
1099
- ).min(1).max(100).optional()
1100
- }).describe("Filter the request item reference.")
1101
- })
1102
- ])
1103
- ).describe("Filter.").optional(),
1104
- cursorPaging: z.object({
1105
- limit: z.number().int().describe("Maximum number of items to return.").min(0).max(1e3).optional().nullable(),
1106
- cursor: z.string().describe(
1107
- "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."
1108
- ).max(16e3).optional().nullable()
1109
- }).describe("Cursor paging").optional()
1110
- }).optional()
1111
- });
1112
- var ListItemsResponse = z.object({
1113
- items: z.array(
1114
- z.object({
1115
- _id: z.string().describe("Benefit item ID.").regex(
1116
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1117
- "Must be a valid GUID"
1118
- ).optional().nullable(),
1119
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1120
- "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
1121
- ).optional().nullable(),
1122
- _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
1123
- _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
1124
- externalId: z.string().describe(
1125
- "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
1126
- ).regex(
1127
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1128
- "Must be a valid GUID"
1129
- ).optional().nullable(),
1130
- category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
1131
- itemSetId: z.string().describe(
1132
- "Item set ID of the benefit that this benefit item is a part of."
1133
- ).regex(
1134
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1135
- "Must be a valid GUID"
1136
- ).optional().nullable(),
1137
- displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
1138
- providerAppId: z.string().describe(
1139
- "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
1140
- ).regex(
1141
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1142
- "Must be a valid GUID"
1143
- ).optional().nullable(),
1144
- extendedFields: z.object({
1145
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1146
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
1147
- ).optional()
1148
- }).describe(
1149
- "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
1150
- ).optional(),
1151
- namespace: z.string().describe(
1152
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
1153
- ).min(1).max(20).optional().nullable()
1154
- })
1155
- ).optional(),
1156
- metadata: z.object({
1157
- count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
1158
- cursors: z.object({
1159
- next: z.string().describe(
1160
- "Cursor string pointing to the next page in the list of results."
1161
- ).max(16e3).optional().nullable(),
1162
- prev: z.string().describe(
1163
- "Cursor pointing to the previous page in the list of results."
1164
- ).max(16e3).optional().nullable()
1165
- }).describe(
1166
- "Cursor strings that point to the next page, previous page, or both."
1167
- ).optional(),
1168
- hasNext: z.boolean().describe(
1169
- "Whether there are more pages to retrieve following the current page.\n\n+ `true`: Another page of results can be retrieved.\n+ `false`: This is the last page."
1170
- ).optional().nullable()
1171
- }).describe("Metadata for paginated results.").optional()
1172
- });
1173
- var QueryItemsRequest = z.object({
1174
- query: z.intersection(
1175
- z.object({
1176
- filter: z.record(z.string(), z.any()).describe(
1177
- 'Filter object in the following format:\n`"filter" : {\n"fieldName1": "value1",\n"fieldName2":{"$operator":"value2"}\n}`\nExample of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`'
1178
- ).optional().nullable(),
1179
- sort: z.array(
1180
- z.object({
1181
- fieldName: z.string().describe("Field to sort by.").max(512).optional(),
1182
- order: z.enum(["ASC", "DESC"]).optional()
1183
- })
1184
- ).max(5).optional()
1185
- }),
1186
- z.xor([
1187
- z.object({ cursorPaging: z.never().optional() }),
1188
- z.object({
1189
- cursorPaging: z.object({
1190
- limit: z.number().int().describe("Maximum number of items to return.").min(0).max(1e3).optional().nullable(),
1191
- cursor: z.string().describe(
1192
- "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."
1193
- ).max(16e3).optional().nullable()
1194
- }).describe(
1195
- "Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`."
1196
- )
1197
- })
1198
- ])
1199
- ).describe("Filter, sort, and paging to apply to the query.")
1200
- });
1201
- var QueryItemsResponse = z.object({
1202
- items: z.array(
1203
- z.object({
1204
- _id: z.string().describe("Benefit item ID.").regex(
1205
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1206
- "Must be a valid GUID"
1207
- ).optional().nullable(),
1208
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1209
- "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
1210
- ).optional().nullable(),
1211
- _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
1212
- _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
1213
- externalId: z.string().describe(
1214
- "ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
1215
- ).regex(
1216
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1217
- "Must be a valid GUID"
1218
- ).optional().nullable(),
1219
- category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
1220
- itemSetId: z.string().describe(
1221
- "Item set ID of the benefit that this benefit item is a part of."
1222
- ).regex(
1223
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1224
- "Must be a valid GUID"
1225
- ).optional().nullable(),
1226
- displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
1227
- providerAppId: z.string().describe(
1228
- "ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
1229
- ).regex(
1230
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1231
- "Must be a valid GUID"
1232
- ).optional().nullable(),
1233
- extendedFields: z.object({
1234
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1235
- "Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
1236
- ).optional()
1237
- }).describe(
1238
- "Custom field data for the benefit item object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
1239
- ).optional(),
1240
- namespace: z.string().describe(
1241
- "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
1242
- ).min(1).max(20).optional().nullable()
1243
- })
1244
- ).optional(),
1245
- metadata: z.object({
1246
- count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
1247
- cursors: z.object({
1248
- next: z.string().describe(
1249
- "Cursor string pointing to the next page in the list of results."
1250
- ).max(16e3).optional().nullable(),
1251
- prev: z.string().describe(
1252
- "Cursor pointing to the previous page in the list of results."
1253
- ).max(16e3).optional().nullable()
1254
- }).describe(
1255
- "Cursor strings that point to the next page, previous page, or both."
1256
- ).optional(),
1257
- hasNext: z.boolean().describe(
1258
- "Whether there are more pages to retrieve following the current page.\n\n+ `true`: Another page of results can be retrieved.\n+ `false`: This is the last page."
1259
- ).optional().nullable()
1260
- }).describe("Metadata for paginated results.").optional()
1261
- });
1262
- var CountItemsRequest = z.object({
1263
- options: z.object({
1264
- filter: z.record(z.string(), z.any()).describe(
1265
- "Items to count.\n\nFilter options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)."
1266
- ).optional().nullable()
1267
- }).optional()
1268
- });
1269
- var CountItemsResponse = z.object({
1270
- count: z.number().int().describe("Number of items fulfilling the specified filter conditions.").optional()
1271
- });
1272
-
1273
- // src/benefit-programs-v1-item-items.universal.ts
1274
478
  import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
1275
479
  var Type = /* @__PURE__ */ ((Type2) => {
1276
480
  Type2["BY_ITEM_SET_ID_AND_REFERENCE"] = "BY_ITEM_SET_ID_AND_REFERENCE";
@@ -1291,10 +495,7 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
1291
495
  return WebhookIdentityType2;
1292
496
  })(WebhookIdentityType || {});
1293
497
  async function createItem2(item) {
1294
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1295
- if (validateRequestSchema) {
1296
- CreateItemRequest.parse({ item });
1297
- }
498
+ const { httpClient, sideEffects } = arguments[1];
1298
499
  const payload = renameKeysFromSDKRequestToRESTRequest({ item });
1299
500
  const reqOpts = createItem(payload);
1300
501
  sideEffects?.onSiteCall?.();
@@ -1317,10 +518,7 @@ async function createItem2(item) {
1317
518
  }
1318
519
  }
1319
520
  async function bulkCreateItems2(items, options) {
1320
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1321
- if (validateRequestSchema) {
1322
- BulkCreateItemsRequest.parse({ items, options });
1323
- }
521
+ const { httpClient, sideEffects } = arguments[2];
1324
522
  const payload = renameKeysFromSDKRequestToRESTRequest({
1325
523
  items,
1326
524
  returnEntity: options?.returnEntity
@@ -1349,10 +547,7 @@ async function bulkCreateItems2(items, options) {
1349
547
  }
1350
548
  }
1351
549
  async function deleteItem2(itemId) {
1352
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1353
- if (validateRequestSchema) {
1354
- DeleteItemRequest.parse({ itemId });
1355
- }
550
+ const { httpClient, sideEffects } = arguments[1];
1356
551
  const payload = renameKeysFromSDKRequestToRESTRequest({ itemId });
1357
552
  const reqOpts = deleteItem(payload);
1358
553
  sideEffects?.onSiteCall?.();
@@ -1374,10 +569,7 @@ async function deleteItem2(itemId) {
1374
569
  }
1375
570
  }
1376
571
  async function bulkDeleteItems2(itemIds) {
1377
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1378
- if (validateRequestSchema) {
1379
- BulkDeleteItemsRequest.parse({ itemIds });
1380
- }
572
+ const { httpClient, sideEffects } = arguments[1];
1381
573
  const payload = renameKeysFromSDKRequestToRESTRequest({ itemIds });
1382
574
  const reqOpts = bulkDeleteItems(payload);
1383
575
  sideEffects?.onSiteCall?.();
@@ -1400,10 +592,7 @@ async function bulkDeleteItems2(itemIds) {
1400
592
  }
1401
593
  }
1402
594
  async function bulkDeleteItemsByFilter2(namespace, options) {
1403
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1404
- if (validateRequestSchema) {
1405
- BulkDeleteItemsByFilterRequest.parse({ namespace, options });
1406
- }
595
+ const { httpClient, sideEffects } = arguments[2];
1407
596
  const payload = renameKeysFromSDKRequestToRESTRequest({
1408
597
  namespace,
1409
598
  filter: options?.filter
@@ -1429,10 +618,7 @@ async function bulkDeleteItemsByFilter2(namespace, options) {
1429
618
  }
1430
619
  }
1431
620
  async function updateItem2(_id, item) {
1432
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1433
- if (validateRequestSchema) {
1434
- UpdateItemRequest.parse({ _id, item });
1435
- }
621
+ const { httpClient, sideEffects } = arguments[2];
1436
622
  const payload = renameKeysFromSDKRequestToRESTRequest({
1437
623
  item: { ...item, id: _id }
1438
624
  });
@@ -1457,10 +643,7 @@ async function updateItem2(_id, item) {
1457
643
  }
1458
644
  }
1459
645
  async function bulkUpdateItems2(options) {
1460
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1461
- if (validateRequestSchema) {
1462
- BulkUpdateItemsRequest.parse({ options });
1463
- }
646
+ const { httpClient, sideEffects } = arguments[1];
1464
647
  const payload = renameKeysFromSDKRequestToRESTRequest({
1465
648
  items: options?.items,
1466
649
  returnEntity: options?.returnEntity
@@ -1489,10 +672,7 @@ async function bulkUpdateItems2(options) {
1489
672
  }
1490
673
  }
1491
674
  async function getItem2(itemId) {
1492
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1493
- if (validateRequestSchema) {
1494
- GetItemRequest.parse({ itemId });
1495
- }
675
+ const { httpClient, sideEffects } = arguments[1];
1496
676
  const payload = renameKeysFromSDKRequestToRESTRequest({ itemId });
1497
677
  const reqOpts = getItem(payload);
1498
678
  sideEffects?.onSiteCall?.();
@@ -1515,10 +695,7 @@ async function getItem2(itemId) {
1515
695
  }
1516
696
  }
1517
697
  async function listItems2(options) {
1518
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1519
- if (validateRequestSchema) {
1520
- ListItemsRequest.parse({ options });
1521
- }
698
+ const { httpClient, sideEffects } = arguments[1];
1522
699
  const payload = renameKeysFromSDKRequestToRESTRequest({
1523
700
  filter: options?.filter,
1524
701
  cursorPaging: options?.cursorPaging
@@ -1593,10 +770,7 @@ function queryItems2(options) {
1593
770
  });
1594
771
  }
1595
772
  async function typedQueryItems(query, options) {
1596
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1597
- if (validateRequestSchema) {
1598
- QueryItemsRequest.parse({ query, options });
1599
- }
773
+ const { httpClient, sideEffects } = arguments[2];
1600
774
  const payload = renameKeysFromSDKRequestToRESTRequest({
1601
775
  query,
1602
776
  ...options
@@ -1627,10 +801,7 @@ var utils = {
1627
801
  }
1628
802
  };
1629
803
  async function countItems2(options) {
1630
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1631
- if (validateRequestSchema) {
1632
- CountItemsRequest.parse({ options });
1633
- }
804
+ const { httpClient, sideEffects } = arguments[1];
1634
805
  const payload = renameKeysFromSDKRequestToRESTRequest({
1635
806
  filter: options?.filter
1636
807
  });
@@ -1656,92 +827,92 @@ async function countItems2(options) {
1656
827
  }
1657
828
 
1658
829
  // src/benefit-programs-v1-item-items.public.ts
1659
- function createItem3(httpClient, __options) {
830
+ function createItem3(httpClient) {
1660
831
  return (item) => createItem2(
1661
832
  item,
1662
833
  // @ts-ignore
1663
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
834
+ { httpClient }
1664
835
  );
1665
836
  }
1666
- function bulkCreateItems3(httpClient, __options) {
837
+ function bulkCreateItems3(httpClient) {
1667
838
  return (items, options) => bulkCreateItems2(
1668
839
  items,
1669
840
  options,
1670
841
  // @ts-ignore
1671
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
842
+ { httpClient }
1672
843
  );
1673
844
  }
1674
- function deleteItem3(httpClient, __options) {
845
+ function deleteItem3(httpClient) {
1675
846
  return (itemId) => deleteItem2(
1676
847
  itemId,
1677
848
  // @ts-ignore
1678
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
849
+ { httpClient }
1679
850
  );
1680
851
  }
1681
- function bulkDeleteItems3(httpClient, __options) {
852
+ function bulkDeleteItems3(httpClient) {
1682
853
  return (itemIds) => bulkDeleteItems2(
1683
854
  itemIds,
1684
855
  // @ts-ignore
1685
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
856
+ { httpClient }
1686
857
  );
1687
858
  }
1688
- function bulkDeleteItemsByFilter3(httpClient, __options) {
859
+ function bulkDeleteItemsByFilter3(httpClient) {
1689
860
  return (namespace, options) => bulkDeleteItemsByFilter2(
1690
861
  namespace,
1691
862
  options,
1692
863
  // @ts-ignore
1693
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
864
+ { httpClient }
1694
865
  );
1695
866
  }
1696
- function updateItem3(httpClient, __options) {
867
+ function updateItem3(httpClient) {
1697
868
  return (_id, item) => updateItem2(
1698
869
  _id,
1699
870
  item,
1700
871
  // @ts-ignore
1701
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
872
+ { httpClient }
1702
873
  );
1703
874
  }
1704
- function bulkUpdateItems3(httpClient, __options) {
875
+ function bulkUpdateItems3(httpClient) {
1705
876
  return (options) => bulkUpdateItems2(
1706
877
  options,
1707
878
  // @ts-ignore
1708
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
879
+ { httpClient }
1709
880
  );
1710
881
  }
1711
- function getItem3(httpClient, __options) {
882
+ function getItem3(httpClient) {
1712
883
  return (itemId) => getItem2(
1713
884
  itemId,
1714
885
  // @ts-ignore
1715
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
886
+ { httpClient }
1716
887
  );
1717
888
  }
1718
- function listItems3(httpClient, __options) {
889
+ function listItems3(httpClient) {
1719
890
  return (options) => listItems2(
1720
891
  options,
1721
892
  // @ts-ignore
1722
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
893
+ { httpClient }
1723
894
  );
1724
895
  }
1725
- function queryItems3(httpClient, __options) {
896
+ function queryItems3(httpClient) {
1726
897
  return (options) => queryItems2(
1727
898
  options,
1728
899
  // @ts-ignore
1729
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
900
+ { httpClient }
1730
901
  );
1731
902
  }
1732
- function typedQueryItems2(httpClient, __options) {
903
+ function typedQueryItems2(httpClient) {
1733
904
  return (query, options) => typedQueryItems(
1734
905
  query,
1735
906
  options,
1736
907
  // @ts-ignore
1737
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
908
+ { httpClient }
1738
909
  );
1739
910
  }
1740
- function countItems3(httpClient, __options) {
911
+ function countItems3(httpClient) {
1741
912
  return (options) => countItems2(
1742
913
  options,
1743
914
  // @ts-ignore
1744
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
915
+ { httpClient }
1745
916
  );
1746
917
  }
1747
918