@wix/auto_sdk_benefit-programs_items 1.0.56 → 1.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
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
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
 
30
20
  // index.ts
@@ -522,802 +512,6 @@ function countItems(payload) {
522
512
 
523
513
  // src/benefit-programs-v1-item-items.universal.ts
524
514
  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
1321
515
  var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
1322
516
  var Type = /* @__PURE__ */ ((Type2) => {
1323
517
  Type2["BY_ITEM_SET_ID_AND_REFERENCE"] = "BY_ITEM_SET_ID_AND_REFERENCE";
@@ -1338,10 +532,7 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
1338
532
  return WebhookIdentityType2;
1339
533
  })(WebhookIdentityType || {});
1340
534
  async function createItem2(item) {
1341
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1342
- if (validateRequestSchema) {
1343
- CreateItemRequest.parse({ item });
1344
- }
535
+ const { httpClient, sideEffects } = arguments[1];
1345
536
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ item });
1346
537
  const reqOpts = createItem(payload);
1347
538
  sideEffects?.onSiteCall?.();
@@ -1364,10 +555,7 @@ async function createItem2(item) {
1364
555
  }
1365
556
  }
1366
557
  async function bulkCreateItems2(items, options) {
1367
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1368
- if (validateRequestSchema) {
1369
- BulkCreateItemsRequest.parse({ items, options });
1370
- }
558
+ const { httpClient, sideEffects } = arguments[2];
1371
559
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1372
560
  items,
1373
561
  returnEntity: options?.returnEntity
@@ -1396,10 +584,7 @@ async function bulkCreateItems2(items, options) {
1396
584
  }
1397
585
  }
1398
586
  async function deleteItem2(itemId) {
1399
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1400
- if (validateRequestSchema) {
1401
- DeleteItemRequest.parse({ itemId });
1402
- }
587
+ const { httpClient, sideEffects } = arguments[1];
1403
588
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ itemId });
1404
589
  const reqOpts = deleteItem(payload);
1405
590
  sideEffects?.onSiteCall?.();
@@ -1421,10 +606,7 @@ async function deleteItem2(itemId) {
1421
606
  }
1422
607
  }
1423
608
  async function bulkDeleteItems2(itemIds) {
1424
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1425
- if (validateRequestSchema) {
1426
- BulkDeleteItemsRequest.parse({ itemIds });
1427
- }
609
+ const { httpClient, sideEffects } = arguments[1];
1428
610
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ itemIds });
1429
611
  const reqOpts = bulkDeleteItems(payload);
1430
612
  sideEffects?.onSiteCall?.();
@@ -1447,10 +629,7 @@ async function bulkDeleteItems2(itemIds) {
1447
629
  }
1448
630
  }
1449
631
  async function bulkDeleteItemsByFilter2(namespace, options) {
1450
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1451
- if (validateRequestSchema) {
1452
- BulkDeleteItemsByFilterRequest.parse({ namespace, options });
1453
- }
632
+ const { httpClient, sideEffects } = arguments[2];
1454
633
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1455
634
  namespace,
1456
635
  filter: options?.filter
@@ -1476,10 +655,7 @@ async function bulkDeleteItemsByFilter2(namespace, options) {
1476
655
  }
1477
656
  }
1478
657
  async function updateItem2(_id, item) {
1479
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1480
- if (validateRequestSchema) {
1481
- UpdateItemRequest.parse({ _id, item });
1482
- }
658
+ const { httpClient, sideEffects } = arguments[2];
1483
659
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1484
660
  item: { ...item, id: _id }
1485
661
  });
@@ -1504,10 +680,7 @@ async function updateItem2(_id, item) {
1504
680
  }
1505
681
  }
1506
682
  async function bulkUpdateItems2(options) {
1507
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1508
- if (validateRequestSchema) {
1509
- BulkUpdateItemsRequest.parse({ options });
1510
- }
683
+ const { httpClient, sideEffects } = arguments[1];
1511
684
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1512
685
  items: options?.items,
1513
686
  returnEntity: options?.returnEntity
@@ -1536,10 +709,7 @@ async function bulkUpdateItems2(options) {
1536
709
  }
1537
710
  }
1538
711
  async function getItem2(itemId) {
1539
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1540
- if (validateRequestSchema) {
1541
- GetItemRequest.parse({ itemId });
1542
- }
712
+ const { httpClient, sideEffects } = arguments[1];
1543
713
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ itemId });
1544
714
  const reqOpts = getItem(payload);
1545
715
  sideEffects?.onSiteCall?.();
@@ -1562,10 +732,7 @@ async function getItem2(itemId) {
1562
732
  }
1563
733
  }
1564
734
  async function listItems2(options) {
1565
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1566
- if (validateRequestSchema) {
1567
- ListItemsRequest.parse({ options });
1568
- }
735
+ const { httpClient, sideEffects } = arguments[1];
1569
736
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1570
737
  filter: options?.filter,
1571
738
  cursorPaging: options?.cursorPaging
@@ -1640,10 +807,7 @@ function queryItems2(options) {
1640
807
  });
1641
808
  }
1642
809
  async function typedQueryItems(query, options) {
1643
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1644
- if (validateRequestSchema) {
1645
- QueryItemsRequest.parse({ query, options });
1646
- }
810
+ const { httpClient, sideEffects } = arguments[2];
1647
811
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1648
812
  query,
1649
813
  ...options
@@ -1674,10 +838,7 @@ var utils = {
1674
838
  }
1675
839
  };
1676
840
  async function countItems2(options) {
1677
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1678
- if (validateRequestSchema) {
1679
- CountItemsRequest.parse({ options });
1680
- }
841
+ const { httpClient, sideEffects } = arguments[1];
1681
842
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1682
843
  filter: options?.filter
1683
844
  });
@@ -1703,92 +864,92 @@ async function countItems2(options) {
1703
864
  }
1704
865
 
1705
866
  // src/benefit-programs-v1-item-items.public.ts
1706
- function createItem3(httpClient, __options) {
867
+ function createItem3(httpClient) {
1707
868
  return (item) => createItem2(
1708
869
  item,
1709
870
  // @ts-ignore
1710
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
871
+ { httpClient }
1711
872
  );
1712
873
  }
1713
- function bulkCreateItems3(httpClient, __options) {
874
+ function bulkCreateItems3(httpClient) {
1714
875
  return (items, options) => bulkCreateItems2(
1715
876
  items,
1716
877
  options,
1717
878
  // @ts-ignore
1718
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
879
+ { httpClient }
1719
880
  );
1720
881
  }
1721
- function deleteItem3(httpClient, __options) {
882
+ function deleteItem3(httpClient) {
1722
883
  return (itemId) => deleteItem2(
1723
884
  itemId,
1724
885
  // @ts-ignore
1725
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
886
+ { httpClient }
1726
887
  );
1727
888
  }
1728
- function bulkDeleteItems3(httpClient, __options) {
889
+ function bulkDeleteItems3(httpClient) {
1729
890
  return (itemIds) => bulkDeleteItems2(
1730
891
  itemIds,
1731
892
  // @ts-ignore
1732
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
893
+ { httpClient }
1733
894
  );
1734
895
  }
1735
- function bulkDeleteItemsByFilter3(httpClient, __options) {
896
+ function bulkDeleteItemsByFilter3(httpClient) {
1736
897
  return (namespace, options) => bulkDeleteItemsByFilter2(
1737
898
  namespace,
1738
899
  options,
1739
900
  // @ts-ignore
1740
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
901
+ { httpClient }
1741
902
  );
1742
903
  }
1743
- function updateItem3(httpClient, __options) {
904
+ function updateItem3(httpClient) {
1744
905
  return (_id, item) => updateItem2(
1745
906
  _id,
1746
907
  item,
1747
908
  // @ts-ignore
1748
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
909
+ { httpClient }
1749
910
  );
1750
911
  }
1751
- function bulkUpdateItems3(httpClient, __options) {
912
+ function bulkUpdateItems3(httpClient) {
1752
913
  return (options) => bulkUpdateItems2(
1753
914
  options,
1754
915
  // @ts-ignore
1755
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
916
+ { httpClient }
1756
917
  );
1757
918
  }
1758
- function getItem3(httpClient, __options) {
919
+ function getItem3(httpClient) {
1759
920
  return (itemId) => getItem2(
1760
921
  itemId,
1761
922
  // @ts-ignore
1762
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
923
+ { httpClient }
1763
924
  );
1764
925
  }
1765
- function listItems3(httpClient, __options) {
926
+ function listItems3(httpClient) {
1766
927
  return (options) => listItems2(
1767
928
  options,
1768
929
  // @ts-ignore
1769
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
930
+ { httpClient }
1770
931
  );
1771
932
  }
1772
- function queryItems3(httpClient, __options) {
933
+ function queryItems3(httpClient) {
1773
934
  return (options) => queryItems2(
1774
935
  options,
1775
936
  // @ts-ignore
1776
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
937
+ { httpClient }
1777
938
  );
1778
939
  }
1779
- function typedQueryItems2(httpClient, __options) {
940
+ function typedQueryItems2(httpClient) {
1780
941
  return (query, options) => typedQueryItems(
1781
942
  query,
1782
943
  options,
1783
944
  // @ts-ignore
1784
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
945
+ { httpClient }
1785
946
  );
1786
947
  }
1787
- function countItems3(httpClient, __options) {
948
+ function countItems3(httpClient) {
1788
949
  return (options) => countItems2(
1789
950
  options,
1790
951
  // @ts-ignore
1791
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
952
+ { httpClient }
1792
953
  );
1793
954
  }
1794
955