@wix/auto_sdk_benefit-programs_items 1.0.55 → 1.0.56

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.
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // index.ts
@@ -512,6 +522,802 @@ function countItems(payload) {
512
522
 
513
523
  // src/benefit-programs-v1-item-items.universal.ts
514
524
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
525
+
526
+ // src/benefit-programs-v1-item-items.schemas.ts
527
+ var z = __toESM(require("zod"));
528
+ var CreateItemRequest = z.object({
529
+ item: z.object({
530
+ _id: z.string().describe("Benefit item ID.").regex(
531
+ /^[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}$/,
532
+ "Must be a valid GUID"
533
+ ).optional().nullable(),
534
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
535
+ "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."
536
+ ).optional().nullable(),
537
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
538
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
539
+ externalId: z.string().describe(
540
+ "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`."
541
+ ).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
+ ),
545
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
546
+ itemSetId: z.string().describe(
547
+ "Item set ID of the benefit that this benefit item is a part of."
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
+ ),
552
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
553
+ providerAppId: z.string().describe(
554
+ "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`."
555
+ ).regex(
556
+ /^[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}$/,
557
+ "Must be a valid GUID"
558
+ ),
559
+ extendedFields: z.object({
560
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
561
+ "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)."
562
+ ).optional()
563
+ }).describe(
564
+ "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."
565
+ ).optional(),
566
+ namespace: z.string().describe(
567
+ "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."
568
+ ).min(1).max(20)
569
+ }).describe("Item to create.")
570
+ });
571
+ var CreateItemResponse = z.object({
572
+ _id: z.string().describe("Benefit item ID.").regex(
573
+ /^[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}$/,
574
+ "Must be a valid GUID"
575
+ ).optional().nullable(),
576
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
577
+ "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."
578
+ ).optional().nullable(),
579
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
580
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
581
+ externalId: z.string().describe(
582
+ "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`."
583
+ ).regex(
584
+ /^[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}$/,
585
+ "Must be a valid GUID"
586
+ ).optional().nullable(),
587
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
588
+ itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
589
+ /^[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}$/,
590
+ "Must be a valid GUID"
591
+ ).optional().nullable(),
592
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
593
+ providerAppId: z.string().describe(
594
+ "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`."
595
+ ).regex(
596
+ /^[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}$/,
597
+ "Must be a valid GUID"
598
+ ).optional().nullable(),
599
+ extendedFields: z.object({
600
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
601
+ "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)."
602
+ ).optional()
603
+ }).describe(
604
+ "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."
605
+ ).optional(),
606
+ namespace: z.string().describe(
607
+ "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."
608
+ ).min(1).max(20).optional().nullable()
609
+ });
610
+ var BulkCreateItemsRequest = z.object({
611
+ items: z.array(
612
+ z.object({
613
+ _id: z.string().describe("Benefit item ID.").regex(
614
+ /^[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}$/,
615
+ "Must be a valid GUID"
616
+ ).optional().nullable(),
617
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
618
+ "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."
619
+ ).optional().nullable(),
620
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
621
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
622
+ externalId: z.string().describe(
623
+ "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`."
624
+ ).regex(
625
+ /^[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}$/,
626
+ "Must be a valid GUID"
627
+ ),
628
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
629
+ itemSetId: z.string().describe(
630
+ "Item set ID of the benefit that this benefit item is a part of."
631
+ ).regex(
632
+ /^[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}$/,
633
+ "Must be a valid GUID"
634
+ ),
635
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
636
+ providerAppId: z.string().describe(
637
+ "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`."
638
+ ).regex(
639
+ /^[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}$/,
640
+ "Must be a valid GUID"
641
+ ),
642
+ extendedFields: z.object({
643
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
644
+ "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)."
645
+ ).optional()
646
+ }).describe(
647
+ "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."
648
+ ).optional(),
649
+ namespace: z.string().describe(
650
+ "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."
651
+ ).min(1).max(20)
652
+ })
653
+ ).min(1).max(100),
654
+ options: z.object({
655
+ returnEntity: z.boolean().describe(
656
+ "Whether to return the full item entities.\n\nDefault: `false`"
657
+ ).optional()
658
+ }).optional()
659
+ });
660
+ var BulkCreateItemsResponse = z.object({
661
+ results: z.array(
662
+ z.object({
663
+ itemMetadata: z.object({
664
+ _id: z.string().describe(
665
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
666
+ ).regex(
667
+ /^[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}$/,
668
+ "Must be a valid GUID"
669
+ ).optional().nullable(),
670
+ originalIndex: z.number().int().describe(
671
+ "Index of the item within the request array. Allows for correlation between request and response items."
672
+ ).optional(),
673
+ success: z.boolean().describe(
674
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
675
+ ).optional(),
676
+ error: z.object({
677
+ code: z.string().describe("Error code.").optional(),
678
+ description: z.string().describe("Description of the error.").optional(),
679
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
680
+ }).describe("Details about the error in case of failure.").optional()
681
+ }).describe("Item metadata.").optional(),
682
+ item: z.object({
683
+ _id: z.string().describe("Benefit item ID.").regex(
684
+ /^[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}$/,
685
+ "Must be a valid GUID"
686
+ ).optional().nullable(),
687
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
688
+ "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."
689
+ ).optional().nullable(),
690
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
691
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
692
+ externalId: z.string().describe(
693
+ "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`."
694
+ ).regex(
695
+ /^[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}$/,
696
+ "Must be a valid GUID"
697
+ ).optional().nullable(),
698
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
699
+ itemSetId: z.string().describe(
700
+ "Item set ID of the benefit that this benefit item is a part of."
701
+ ).regex(
702
+ /^[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}$/,
703
+ "Must be a valid GUID"
704
+ ).optional().nullable(),
705
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
706
+ providerAppId: z.string().describe(
707
+ "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`."
708
+ ).regex(
709
+ /^[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}$/,
710
+ "Must be a valid GUID"
711
+ ).optional().nullable(),
712
+ extendedFields: z.object({
713
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
714
+ "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)."
715
+ ).optional()
716
+ }).describe(
717
+ "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."
718
+ ).optional(),
719
+ namespace: z.string().describe(
720
+ "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."
721
+ ).min(1).max(20).optional().nullable()
722
+ }).describe("Item.").optional()
723
+ })
724
+ ).min(1).max(100).optional(),
725
+ bulkActionMetadata: z.object({
726
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
727
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
728
+ undetailedFailures: z.number().int().describe(
729
+ "Number of failures without details because detailed failure threshold was exceeded."
730
+ ).optional()
731
+ }).describe("Bulk action metadata.").optional()
732
+ });
733
+ var DeleteItemRequest = z.object({
734
+ itemId: z.string().describe("Item ID.").regex(
735
+ /^[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}$/,
736
+ "Must be a valid GUID"
737
+ )
738
+ });
739
+ var DeleteItemResponse = z.object({});
740
+ var BulkDeleteItemsRequest = z.object({
741
+ itemIds: z.array(z.string()).min(1).max(100)
742
+ });
743
+ var BulkDeleteItemsResponse = z.object({
744
+ results: z.array(
745
+ z.object({
746
+ itemMetadata: z.object({
747
+ _id: z.string().describe(
748
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
749
+ ).regex(
750
+ /^[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}$/,
751
+ "Must be a valid GUID"
752
+ ).optional().nullable(),
753
+ originalIndex: z.number().int().describe(
754
+ "Index of the item within the request array. Allows for correlation between request and response items."
755
+ ).optional(),
756
+ success: z.boolean().describe(
757
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
758
+ ).optional(),
759
+ error: z.object({
760
+ code: z.string().describe("Error code.").optional(),
761
+ description: z.string().describe("Description of the error.").optional(),
762
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
763
+ }).describe("Details about the error in case of failure.").optional()
764
+ }).describe("Item metadata.").optional(),
765
+ item: z.object({
766
+ _id: z.string().describe("Benefit item ID.").regex(
767
+ /^[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}$/,
768
+ "Must be a valid GUID"
769
+ ).optional().nullable(),
770
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
771
+ "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."
772
+ ).optional().nullable(),
773
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
774
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
775
+ externalId: z.string().describe(
776
+ "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`."
777
+ ).regex(
778
+ /^[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}$/,
779
+ "Must be a valid GUID"
780
+ ).optional().nullable(),
781
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
782
+ itemSetId: z.string().describe(
783
+ "Item set ID of the benefit that this benefit item is a part of."
784
+ ).regex(
785
+ /^[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}$/,
786
+ "Must be a valid GUID"
787
+ ).optional().nullable(),
788
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
789
+ providerAppId: z.string().describe(
790
+ "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`."
791
+ ).regex(
792
+ /^[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}$/,
793
+ "Must be a valid GUID"
794
+ ).optional().nullable(),
795
+ extendedFields: z.object({
796
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
797
+ "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)."
798
+ ).optional()
799
+ }).describe(
800
+ "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."
801
+ ).optional(),
802
+ namespace: z.string().describe(
803
+ "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."
804
+ ).min(1).max(20).optional().nullable()
805
+ }).describe("Item.").optional()
806
+ })
807
+ ).min(1).max(100).optional(),
808
+ bulkActionMetadata: z.object({
809
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
810
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
811
+ undetailedFailures: z.number().int().describe(
812
+ "Number of failures without details because detailed failure threshold was exceeded."
813
+ ).optional()
814
+ }).describe("Bulk action metadata.").optional()
815
+ });
816
+ var BulkDeleteItemsByFilterRequest = z.object({
817
+ namespace: z.string().describe(
818
+ "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."
819
+ ).min(1).max(20),
820
+ options: z.object({
821
+ filter: z.record(z.string(), z.any()).describe(
822
+ "Filter options. To learn more, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)."
823
+ ).optional().nullable()
824
+ }).optional()
825
+ });
826
+ var BulkDeleteItemsByFilterResponse = z.object({
827
+ jobId: z.string().describe(
828
+ "Job ID for item deletion. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
829
+ ).regex(
830
+ /^[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}$/,
831
+ "Must be a valid GUID"
832
+ ).optional()
833
+ });
834
+ var UpdateItemRequest = 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
+ ),
839
+ item: z.object({
840
+ _id: z.string().describe("Benefit item ID.").regex(
841
+ /^[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}$/,
842
+ "Must be a valid GUID"
843
+ ).optional().nullable(),
844
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
845
+ "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."
846
+ ),
847
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
848
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
849
+ externalId: z.string().describe(
850
+ "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`."
851
+ ).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
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
856
+ itemSetId: z.string().describe(
857
+ "Item set ID of the benefit that this benefit item is a part of."
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
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
863
+ providerAppId: z.string().describe(
864
+ "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`."
865
+ ).regex(
866
+ /^[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}$/,
867
+ "Must be a valid GUID"
868
+ ).optional().nullable(),
869
+ extendedFields: z.object({
870
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
871
+ "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)."
872
+ ).optional()
873
+ }).describe(
874
+ "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."
875
+ ).optional(),
876
+ namespace: z.string().describe(
877
+ "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."
878
+ ).min(1).max(20).optional().nullable()
879
+ }).describe("Item to update.")
880
+ });
881
+ var UpdateItemResponse = z.object({
882
+ _id: z.string().describe("Benefit item ID.").regex(
883
+ /^[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}$/,
884
+ "Must be a valid GUID"
885
+ ).optional().nullable(),
886
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
887
+ "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."
888
+ ).optional().nullable(),
889
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
890
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
891
+ externalId: z.string().describe(
892
+ "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`."
893
+ ).regex(
894
+ /^[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}$/,
895
+ "Must be a valid GUID"
896
+ ).optional().nullable(),
897
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
898
+ itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
899
+ /^[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}$/,
900
+ "Must be a valid GUID"
901
+ ).optional().nullable(),
902
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
903
+ providerAppId: z.string().describe(
904
+ "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`."
905
+ ).regex(
906
+ /^[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}$/,
907
+ "Must be a valid GUID"
908
+ ).optional().nullable(),
909
+ extendedFields: z.object({
910
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
911
+ "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)."
912
+ ).optional()
913
+ }).describe(
914
+ "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."
915
+ ).optional(),
916
+ namespace: z.string().describe(
917
+ "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."
918
+ ).min(1).max(20).optional().nullable()
919
+ });
920
+ var BulkUpdateItemsRequest = z.object({
921
+ options: z.object({
922
+ items: z.array(
923
+ z.object({
924
+ item: z.object({
925
+ _id: z.string().describe("Benefit item ID.").regex(
926
+ /^[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}$/,
927
+ "Must be a valid GUID"
928
+ ),
929
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
930
+ "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."
931
+ ),
932
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
933
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
934
+ externalId: z.string().describe(
935
+ "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`."
936
+ ).regex(
937
+ /^[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}$/,
938
+ "Must be a valid GUID"
939
+ ).optional().nullable(),
940
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
941
+ itemSetId: z.string().describe(
942
+ "Item set ID of the benefit that this benefit item is a part of."
943
+ ).regex(
944
+ /^[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}$/,
945
+ "Must be a valid GUID"
946
+ ).optional().nullable(),
947
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
948
+ providerAppId: z.string().describe(
949
+ "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`."
950
+ ).regex(
951
+ /^[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}$/,
952
+ "Must be a valid GUID"
953
+ ).optional().nullable(),
954
+ extendedFields: z.object({
955
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
956
+ "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)."
957
+ ).optional()
958
+ }).describe(
959
+ "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."
960
+ ).optional(),
961
+ namespace: z.string().describe(
962
+ "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."
963
+ ).min(1).max(20).optional().nullable()
964
+ }).describe("Item to update."),
965
+ fieldMask: z.array(z.string()).optional()
966
+ })
967
+ ).min(1).max(100).optional(),
968
+ returnEntity: z.boolean().describe(
969
+ "Whether to return the full item entities.\n\nDefault: `false`"
970
+ ).optional()
971
+ }).optional()
972
+ });
973
+ var BulkUpdateItemsResponse = z.object({
974
+ results: z.array(
975
+ z.object({
976
+ itemMetadata: z.object({
977
+ _id: z.string().describe(
978
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
979
+ ).regex(
980
+ /^[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}$/,
981
+ "Must be a valid GUID"
982
+ ).optional().nullable(),
983
+ originalIndex: z.number().int().describe(
984
+ "Index of the item within the request array. Allows for correlation between request and response items."
985
+ ).optional(),
986
+ success: z.boolean().describe(
987
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
988
+ ).optional(),
989
+ error: z.object({
990
+ code: z.string().describe("Error code.").optional(),
991
+ description: z.string().describe("Description of the error.").optional(),
992
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
993
+ }).describe("Details about the error in case of failure.").optional()
994
+ }).describe("Item metadata.").optional(),
995
+ item: z.object({
996
+ _id: z.string().describe("Benefit item ID.").regex(
997
+ /^[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}$/,
998
+ "Must be a valid GUID"
999
+ ).optional().nullable(),
1000
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1001
+ "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."
1002
+ ).optional().nullable(),
1003
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
1004
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
1005
+ externalId: z.string().describe(
1006
+ "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`."
1007
+ ).regex(
1008
+ /^[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}$/,
1009
+ "Must be a valid GUID"
1010
+ ).optional().nullable(),
1011
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
1012
+ itemSetId: z.string().describe(
1013
+ "Item set ID of the benefit that this benefit item is a part of."
1014
+ ).regex(
1015
+ /^[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}$/,
1016
+ "Must be a valid GUID"
1017
+ ).optional().nullable(),
1018
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
1019
+ providerAppId: z.string().describe(
1020
+ "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`."
1021
+ ).regex(
1022
+ /^[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}$/,
1023
+ "Must be a valid GUID"
1024
+ ).optional().nullable(),
1025
+ extendedFields: z.object({
1026
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1027
+ "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)."
1028
+ ).optional()
1029
+ }).describe(
1030
+ "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."
1031
+ ).optional(),
1032
+ namespace: z.string().describe(
1033
+ "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."
1034
+ ).min(1).max(20).optional().nullable()
1035
+ }).describe("Item.").optional()
1036
+ })
1037
+ ).min(1).max(100).optional(),
1038
+ bulkActionMetadata: z.object({
1039
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
1040
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
1041
+ undetailedFailures: z.number().int().describe(
1042
+ "Number of failures without details because detailed failure threshold was exceeded."
1043
+ ).optional()
1044
+ }).describe("Bulk action metadata.").optional()
1045
+ });
1046
+ var GetItemRequest = z.object({
1047
+ itemId: z.string().describe("ID of the item to retrieve.").regex(
1048
+ /^[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}$/,
1049
+ "Must be a valid GUID"
1050
+ )
1051
+ });
1052
+ var GetItemResponse = z.object({
1053
+ _id: z.string().describe("Benefit item ID.").regex(
1054
+ /^[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}$/,
1055
+ "Must be a valid GUID"
1056
+ ).optional().nullable(),
1057
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1058
+ "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."
1059
+ ).optional().nullable(),
1060
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
1061
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
1062
+ externalId: z.string().describe(
1063
+ "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`."
1064
+ ).regex(
1065
+ /^[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}$/,
1066
+ "Must be a valid GUID"
1067
+ ).optional().nullable(),
1068
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
1069
+ itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
1070
+ /^[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}$/,
1071
+ "Must be a valid GUID"
1072
+ ).optional().nullable(),
1073
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
1074
+ providerAppId: z.string().describe(
1075
+ "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`."
1076
+ ).regex(
1077
+ /^[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}$/,
1078
+ "Must be a valid GUID"
1079
+ ).optional().nullable(),
1080
+ extendedFields: z.object({
1081
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1082
+ "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)."
1083
+ ).optional()
1084
+ }).describe(
1085
+ "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."
1086
+ ).optional(),
1087
+ namespace: z.string().describe(
1088
+ "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."
1089
+ ).min(1).max(20).optional().nullable()
1090
+ });
1091
+ var ListItemsRequest = z.object({
1092
+ options: z.object({
1093
+ filter: z.intersection(
1094
+ z.object({
1095
+ type: z.enum(["BY_ITEM_SET_ID_AND_REFERENCE", "BY_REFERENCE"]).optional(),
1096
+ namespace: z.string().describe("Filter by namespace.").min(1).max(20).optional()
1097
+ }),
1098
+ z.xor([
1099
+ z.object({
1100
+ byItemSetIdAndReferenceOptions: z.never().optional(),
1101
+ byReferenceOptions: z.never().optional()
1102
+ }),
1103
+ z.object({
1104
+ byReferenceOptions: z.never().optional(),
1105
+ byItemSetIdAndReferenceOptions: z.object({
1106
+ filters: z.array(
1107
+ z.object({
1108
+ itemSetId: z.string().describe("ID set ID.").regex(
1109
+ /^[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}$/,
1110
+ "Must be a valid GUID"
1111
+ ).optional(),
1112
+ externalId: z.string().describe("External item ID.").regex(
1113
+ /^[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}$/,
1114
+ "Must be a valid GUID"
1115
+ ).optional(),
1116
+ category: z.string().describe("Item category.").max(20).optional(),
1117
+ providerAppId: z.string().describe(
1118
+ "*Required**. ID of the app providing the item."
1119
+ ).regex(
1120
+ /^[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}$/,
1121
+ "Must be a valid GUID"
1122
+ ).optional()
1123
+ })
1124
+ ).min(1).max(100).optional()
1125
+ }).describe(
1126
+ "Filter the request by `itemSetId` and item reference."
1127
+ )
1128
+ }),
1129
+ z.object({
1130
+ byItemSetIdAndReferenceOptions: z.never().optional(),
1131
+ byReferenceOptions: z.object({
1132
+ filters: z.array(
1133
+ z.object({
1134
+ externalId: z.string().describe("External item ID.").regex(
1135
+ /^[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}$/,
1136
+ "Must be a valid GUID"
1137
+ ).optional(),
1138
+ category: z.string().describe("Item category.").max(20).optional(),
1139
+ providerAppId: z.string().describe(
1140
+ "*Required**. ID of the app providing the item."
1141
+ ).regex(
1142
+ /^[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}$/,
1143
+ "Must be a valid GUID"
1144
+ ).optional()
1145
+ })
1146
+ ).min(1).max(100).optional()
1147
+ }).describe("Filter the request item reference.")
1148
+ })
1149
+ ])
1150
+ ).describe("Filter.").optional(),
1151
+ cursorPaging: z.object({
1152
+ limit: z.number().int().describe("Maximum number of items to return.").min(0).max(1e3).optional().nullable(),
1153
+ cursor: z.string().describe(
1154
+ "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."
1155
+ ).max(16e3).optional().nullable()
1156
+ }).describe("Cursor paging").optional()
1157
+ }).optional()
1158
+ });
1159
+ var ListItemsResponse = z.object({
1160
+ items: z.array(
1161
+ z.object({
1162
+ _id: z.string().describe("Benefit item ID.").regex(
1163
+ /^[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}$/,
1164
+ "Must be a valid GUID"
1165
+ ).optional().nullable(),
1166
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1167
+ "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."
1168
+ ).optional().nullable(),
1169
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
1170
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
1171
+ externalId: z.string().describe(
1172
+ "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`."
1173
+ ).regex(
1174
+ /^[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}$/,
1175
+ "Must be a valid GUID"
1176
+ ).optional().nullable(),
1177
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
1178
+ itemSetId: z.string().describe(
1179
+ "Item set ID of the benefit that this benefit item is a part of."
1180
+ ).regex(
1181
+ /^[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}$/,
1182
+ "Must be a valid GUID"
1183
+ ).optional().nullable(),
1184
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
1185
+ providerAppId: z.string().describe(
1186
+ "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`."
1187
+ ).regex(
1188
+ /^[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}$/,
1189
+ "Must be a valid GUID"
1190
+ ).optional().nullable(),
1191
+ extendedFields: z.object({
1192
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1193
+ "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)."
1194
+ ).optional()
1195
+ }).describe(
1196
+ "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."
1197
+ ).optional(),
1198
+ namespace: z.string().describe(
1199
+ "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."
1200
+ ).min(1).max(20).optional().nullable()
1201
+ })
1202
+ ).optional(),
1203
+ metadata: z.object({
1204
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
1205
+ cursors: z.object({
1206
+ next: z.string().describe(
1207
+ "Cursor string pointing to the next page in the list of results."
1208
+ ).max(16e3).optional().nullable(),
1209
+ prev: z.string().describe(
1210
+ "Cursor pointing to the previous page in the list of results."
1211
+ ).max(16e3).optional().nullable()
1212
+ }).describe(
1213
+ "Cursor strings that point to the next page, previous page, or both."
1214
+ ).optional(),
1215
+ hasNext: z.boolean().describe(
1216
+ "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."
1217
+ ).optional().nullable()
1218
+ }).describe("Metadata for paginated results.").optional()
1219
+ });
1220
+ var QueryItemsRequest = z.object({
1221
+ query: z.intersection(
1222
+ z.object({
1223
+ filter: z.record(z.string(), z.any()).describe(
1224
+ '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`'
1225
+ ).optional().nullable(),
1226
+ sort: z.array(
1227
+ z.object({
1228
+ fieldName: z.string().describe("Field to sort by.").max(512).optional(),
1229
+ order: z.enum(["ASC", "DESC"]).optional()
1230
+ })
1231
+ ).max(5).optional()
1232
+ }),
1233
+ z.xor([
1234
+ z.object({ cursorPaging: z.never().optional() }),
1235
+ z.object({
1236
+ cursorPaging: z.object({
1237
+ limit: z.number().int().describe("Maximum number of items to return.").min(0).max(1e3).optional().nullable(),
1238
+ cursor: z.string().describe(
1239
+ "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."
1240
+ ).max(16e3).optional().nullable()
1241
+ }).describe(
1242
+ "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`."
1243
+ )
1244
+ })
1245
+ ])
1246
+ ).describe("Filter, sort, and paging to apply to the query.")
1247
+ });
1248
+ var QueryItemsResponse = z.object({
1249
+ items: z.array(
1250
+ z.object({
1251
+ _id: z.string().describe("Benefit item ID.").regex(
1252
+ /^[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}$/,
1253
+ "Must be a valid GUID"
1254
+ ).optional().nullable(),
1255
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1256
+ "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."
1257
+ ).optional().nullable(),
1258
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
1259
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
1260
+ externalId: z.string().describe(
1261
+ "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`."
1262
+ ).regex(
1263
+ /^[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}$/,
1264
+ "Must be a valid GUID"
1265
+ ).optional().nullable(),
1266
+ category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
1267
+ itemSetId: z.string().describe(
1268
+ "Item set ID of the benefit that this benefit item is a part of."
1269
+ ).regex(
1270
+ /^[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}$/,
1271
+ "Must be a valid GUID"
1272
+ ).optional().nullable(),
1273
+ displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
1274
+ providerAppId: z.string().describe(
1275
+ "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`."
1276
+ ).regex(
1277
+ /^[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}$/,
1278
+ "Must be a valid GUID"
1279
+ ).optional().nullable(),
1280
+ extendedFields: z.object({
1281
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1282
+ "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)."
1283
+ ).optional()
1284
+ }).describe(
1285
+ "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."
1286
+ ).optional(),
1287
+ namespace: z.string().describe(
1288
+ "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."
1289
+ ).min(1).max(20).optional().nullable()
1290
+ })
1291
+ ).optional(),
1292
+ metadata: z.object({
1293
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
1294
+ cursors: z.object({
1295
+ next: z.string().describe(
1296
+ "Cursor string pointing to the next page in the list of results."
1297
+ ).max(16e3).optional().nullable(),
1298
+ prev: z.string().describe(
1299
+ "Cursor pointing to the previous page in the list of results."
1300
+ ).max(16e3).optional().nullable()
1301
+ }).describe(
1302
+ "Cursor strings that point to the next page, previous page, or both."
1303
+ ).optional(),
1304
+ hasNext: z.boolean().describe(
1305
+ "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."
1306
+ ).optional().nullable()
1307
+ }).describe("Metadata for paginated results.").optional()
1308
+ });
1309
+ var CountItemsRequest = z.object({
1310
+ options: z.object({
1311
+ filter: z.record(z.string(), z.any()).describe(
1312
+ "Items to count.\n\nFilter options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)."
1313
+ ).optional().nullable()
1314
+ }).optional()
1315
+ });
1316
+ var CountItemsResponse = z.object({
1317
+ count: z.number().int().describe("Number of items fulfilling the specified filter conditions.").optional()
1318
+ });
1319
+
1320
+ // src/benefit-programs-v1-item-items.universal.ts
515
1321
  var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
516
1322
  var Type = /* @__PURE__ */ ((Type2) => {
517
1323
  Type2["BY_ITEM_SET_ID_AND_REFERENCE"] = "BY_ITEM_SET_ID_AND_REFERENCE";
@@ -532,7 +1338,10 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
532
1338
  return WebhookIdentityType2;
533
1339
  })(WebhookIdentityType || {});
534
1340
  async function createItem2(item) {
535
- const { httpClient, sideEffects } = arguments[1];
1341
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1342
+ if (validateRequestSchema) {
1343
+ CreateItemRequest.parse({ item });
1344
+ }
536
1345
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ item });
537
1346
  const reqOpts = createItem(payload);
538
1347
  sideEffects?.onSiteCall?.();
@@ -555,7 +1364,10 @@ async function createItem2(item) {
555
1364
  }
556
1365
  }
557
1366
  async function bulkCreateItems2(items, options) {
558
- const { httpClient, sideEffects } = arguments[2];
1367
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1368
+ if (validateRequestSchema) {
1369
+ BulkCreateItemsRequest.parse({ items, options });
1370
+ }
559
1371
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
560
1372
  items,
561
1373
  returnEntity: options?.returnEntity
@@ -584,7 +1396,10 @@ async function bulkCreateItems2(items, options) {
584
1396
  }
585
1397
  }
586
1398
  async function deleteItem2(itemId) {
587
- const { httpClient, sideEffects } = arguments[1];
1399
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1400
+ if (validateRequestSchema) {
1401
+ DeleteItemRequest.parse({ itemId });
1402
+ }
588
1403
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ itemId });
589
1404
  const reqOpts = deleteItem(payload);
590
1405
  sideEffects?.onSiteCall?.();
@@ -606,7 +1421,10 @@ async function deleteItem2(itemId) {
606
1421
  }
607
1422
  }
608
1423
  async function bulkDeleteItems2(itemIds) {
609
- const { httpClient, sideEffects } = arguments[1];
1424
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1425
+ if (validateRequestSchema) {
1426
+ BulkDeleteItemsRequest.parse({ itemIds });
1427
+ }
610
1428
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ itemIds });
611
1429
  const reqOpts = bulkDeleteItems(payload);
612
1430
  sideEffects?.onSiteCall?.();
@@ -629,7 +1447,10 @@ async function bulkDeleteItems2(itemIds) {
629
1447
  }
630
1448
  }
631
1449
  async function bulkDeleteItemsByFilter2(namespace, options) {
632
- const { httpClient, sideEffects } = arguments[2];
1450
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1451
+ if (validateRequestSchema) {
1452
+ BulkDeleteItemsByFilterRequest.parse({ namespace, options });
1453
+ }
633
1454
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
634
1455
  namespace,
635
1456
  filter: options?.filter
@@ -655,7 +1476,10 @@ async function bulkDeleteItemsByFilter2(namespace, options) {
655
1476
  }
656
1477
  }
657
1478
  async function updateItem2(_id, item) {
658
- const { httpClient, sideEffects } = arguments[2];
1479
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1480
+ if (validateRequestSchema) {
1481
+ UpdateItemRequest.parse({ _id, item });
1482
+ }
659
1483
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
660
1484
  item: { ...item, id: _id }
661
1485
  });
@@ -680,7 +1504,10 @@ async function updateItem2(_id, item) {
680
1504
  }
681
1505
  }
682
1506
  async function bulkUpdateItems2(options) {
683
- const { httpClient, sideEffects } = arguments[1];
1507
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1508
+ if (validateRequestSchema) {
1509
+ BulkUpdateItemsRequest.parse({ options });
1510
+ }
684
1511
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
685
1512
  items: options?.items,
686
1513
  returnEntity: options?.returnEntity
@@ -709,7 +1536,10 @@ async function bulkUpdateItems2(options) {
709
1536
  }
710
1537
  }
711
1538
  async function getItem2(itemId) {
712
- const { httpClient, sideEffects } = arguments[1];
1539
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1540
+ if (validateRequestSchema) {
1541
+ GetItemRequest.parse({ itemId });
1542
+ }
713
1543
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ itemId });
714
1544
  const reqOpts = getItem(payload);
715
1545
  sideEffects?.onSiteCall?.();
@@ -732,7 +1562,10 @@ async function getItem2(itemId) {
732
1562
  }
733
1563
  }
734
1564
  async function listItems2(options) {
735
- const { httpClient, sideEffects } = arguments[1];
1565
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1566
+ if (validateRequestSchema) {
1567
+ ListItemsRequest.parse({ options });
1568
+ }
736
1569
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
737
1570
  filter: options?.filter,
738
1571
  cursorPaging: options?.cursorPaging
@@ -807,7 +1640,10 @@ function queryItems2(options) {
807
1640
  });
808
1641
  }
809
1642
  async function typedQueryItems(query, options) {
810
- const { httpClient, sideEffects } = arguments[2];
1643
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1644
+ if (validateRequestSchema) {
1645
+ QueryItemsRequest.parse({ query, options });
1646
+ }
811
1647
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
812
1648
  query,
813
1649
  ...options
@@ -838,7 +1674,10 @@ var utils = {
838
1674
  }
839
1675
  };
840
1676
  async function countItems2(options) {
841
- const { httpClient, sideEffects } = arguments[1];
1677
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1678
+ if (validateRequestSchema) {
1679
+ CountItemsRequest.parse({ options });
1680
+ }
842
1681
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
843
1682
  filter: options?.filter
844
1683
  });
@@ -864,92 +1703,92 @@ async function countItems2(options) {
864
1703
  }
865
1704
 
866
1705
  // src/benefit-programs-v1-item-items.public.ts
867
- function createItem3(httpClient) {
1706
+ function createItem3(httpClient, __options) {
868
1707
  return (item) => createItem2(
869
1708
  item,
870
1709
  // @ts-ignore
871
- { httpClient }
1710
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
872
1711
  );
873
1712
  }
874
- function bulkCreateItems3(httpClient) {
1713
+ function bulkCreateItems3(httpClient, __options) {
875
1714
  return (items, options) => bulkCreateItems2(
876
1715
  items,
877
1716
  options,
878
1717
  // @ts-ignore
879
- { httpClient }
1718
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
880
1719
  );
881
1720
  }
882
- function deleteItem3(httpClient) {
1721
+ function deleteItem3(httpClient, __options) {
883
1722
  return (itemId) => deleteItem2(
884
1723
  itemId,
885
1724
  // @ts-ignore
886
- { httpClient }
1725
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
887
1726
  );
888
1727
  }
889
- function bulkDeleteItems3(httpClient) {
1728
+ function bulkDeleteItems3(httpClient, __options) {
890
1729
  return (itemIds) => bulkDeleteItems2(
891
1730
  itemIds,
892
1731
  // @ts-ignore
893
- { httpClient }
1732
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
894
1733
  );
895
1734
  }
896
- function bulkDeleteItemsByFilter3(httpClient) {
1735
+ function bulkDeleteItemsByFilter3(httpClient, __options) {
897
1736
  return (namespace, options) => bulkDeleteItemsByFilter2(
898
1737
  namespace,
899
1738
  options,
900
1739
  // @ts-ignore
901
- { httpClient }
1740
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
902
1741
  );
903
1742
  }
904
- function updateItem3(httpClient) {
1743
+ function updateItem3(httpClient, __options) {
905
1744
  return (_id, item) => updateItem2(
906
1745
  _id,
907
1746
  item,
908
1747
  // @ts-ignore
909
- { httpClient }
1748
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
910
1749
  );
911
1750
  }
912
- function bulkUpdateItems3(httpClient) {
1751
+ function bulkUpdateItems3(httpClient, __options) {
913
1752
  return (options) => bulkUpdateItems2(
914
1753
  options,
915
1754
  // @ts-ignore
916
- { httpClient }
1755
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
917
1756
  );
918
1757
  }
919
- function getItem3(httpClient) {
1758
+ function getItem3(httpClient, __options) {
920
1759
  return (itemId) => getItem2(
921
1760
  itemId,
922
1761
  // @ts-ignore
923
- { httpClient }
1762
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
924
1763
  );
925
1764
  }
926
- function listItems3(httpClient) {
1765
+ function listItems3(httpClient, __options) {
927
1766
  return (options) => listItems2(
928
1767
  options,
929
1768
  // @ts-ignore
930
- { httpClient }
1769
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
931
1770
  );
932
1771
  }
933
- function queryItems3(httpClient) {
1772
+ function queryItems3(httpClient, __options) {
934
1773
  return (options) => queryItems2(
935
1774
  options,
936
1775
  // @ts-ignore
937
- { httpClient }
1776
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
938
1777
  );
939
1778
  }
940
- function typedQueryItems2(httpClient) {
1779
+ function typedQueryItems2(httpClient, __options) {
941
1780
  return (query, options) => typedQueryItems(
942
1781
  query,
943
1782
  options,
944
1783
  // @ts-ignore
945
- { httpClient }
1784
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
946
1785
  );
947
1786
  }
948
- function countItems3(httpClient) {
1787
+ function countItems3(httpClient, __options) {
949
1788
  return (options) => countItems2(
950
1789
  options,
951
1790
  // @ts-ignore
952
- { httpClient }
1791
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
953
1792
  );
954
1793
  }
955
1794