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