@wix/auto_sdk_benefit-programs_pools 1.0.62 → 1.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // index.ts
@@ -542,6 +552,1659 @@ function checkEligibilityByFilter(payload) {
542
552
 
543
553
  // src/benefit-programs-v1-pool-pools.universal.ts
544
554
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
555
+
556
+ // src/benefit-programs-v1-pool-pools.schemas.ts
557
+ var z = __toESM(require("zod"));
558
+ var GetPoolRequest = z.object({
559
+ poolId: z.string().describe("ID of the pool to retrieve.").regex(
560
+ /^[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}$/,
561
+ "Must be a valid GUID"
562
+ )
563
+ });
564
+ var GetPoolResponse = z.object({
565
+ _id: z.string().describe("Pool ID.").regex(
566
+ /^[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}$/,
567
+ "Must be a valid GUID"
568
+ ).optional().nullable(),
569
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
570
+ "Revision number, which increments by 1 each time the pool is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the pool.\n\nIgnored when creating a pool."
571
+ ).optional().nullable(),
572
+ _createdDate: z.date().describe("Date and time the pool was created.").optional().nullable(),
573
+ _updatedDate: z.date().describe("Date and time the pool was updated.").optional().nullable(),
574
+ poolDefinitionId: z.string().describe("ID of the associated pool definition.").regex(
575
+ /^[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}$/,
576
+ "Must be a valid GUID"
577
+ ).optional().nullable(),
578
+ programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
579
+ /^[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}$/,
580
+ "Must be a valid GUID"
581
+ ).optional().nullable(),
582
+ programId: z.string().describe("ID of the program that contains this pool.").regex(
583
+ /^[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}$/,
584
+ "Must be a valid GUID"
585
+ ).optional().nullable(),
586
+ status: z.enum(["ACTIVE", "PAUSED", "ENDED", "PROVISIONING", "RENEWING", "PENDING"]).describe("Pool status.").optional(),
587
+ beneficiary: z.intersection(
588
+ z.object({}),
589
+ z.xor([
590
+ z.object({
591
+ anonymousVisitorId: z.never().optional(),
592
+ memberId: z.never().optional(),
593
+ wixUserId: z.never().optional()
594
+ }),
595
+ z.object({
596
+ memberId: z.never().optional(),
597
+ wixUserId: z.never().optional(),
598
+ anonymousVisitorId: z.string().describe("ID of a site visitor that hasn't logged in to the site.").regex(
599
+ /^[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}$/,
600
+ "Must be a valid GUID"
601
+ )
602
+ }),
603
+ z.object({
604
+ anonymousVisitorId: z.never().optional(),
605
+ wixUserId: z.never().optional(),
606
+ memberId: z.string().describe("ID of a site member.").regex(
607
+ /^[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}$/,
608
+ "Must be a valid GUID"
609
+ )
610
+ }),
611
+ z.object({
612
+ anonymousVisitorId: z.never().optional(),
613
+ memberId: z.never().optional(),
614
+ wixUserId: z.string().describe("ID of a Wix user.").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
+ )
618
+ })
619
+ ])
620
+ ).describe("Pool beneficiary.").optional(),
621
+ details: z.object({
622
+ benefits: z.array(
623
+ z.object({
624
+ benefitKey: z.string().describe(
625
+ "Unique identifier for this benefit.\n\nThis key is consistent across the pool definition and all associated pools that contain this benefit."
626
+ ).max(64).optional(),
627
+ itemSetId: z.string().describe(
628
+ "ID that is used to associated items with this benefit."
629
+ ).regex(
630
+ /^[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}$/,
631
+ "Must be a valid GUID"
632
+ ).optional().nullable(),
633
+ price: z.string().describe(
634
+ "Price of the benefit in credits. The price is the same for all of this benefit's items."
635
+ ).optional().nullable(),
636
+ additionalData: z.record(z.string(), z.any()).describe("Additional information for this benefit.").optional().nullable(),
637
+ providerAppId: z.string().describe("ID of the app providing the benefit items.").regex(
638
+ /^[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}$/,
639
+ "Must be a valid GUID"
640
+ ).optional().nullable(),
641
+ displayName: z.string().describe("Benefit name.").max(40).optional().nullable(),
642
+ description: z.string().describe("Benefit description.").max(255).optional().nullable()
643
+ })
644
+ ).max(10).optional(),
645
+ creditConfiguration: z.object({
646
+ amount: z.string().describe("Initial available amount for associated balances.").optional(),
647
+ rolloverConfiguration: z.object({
648
+ enabled: z.boolean().describe(
649
+ "Whether unused credits roll over to a new cycle when a program renews."
650
+ ).optional().nullable(),
651
+ balanceCap: z.string().describe(
652
+ "Maximum number of credits that can roll over to the next cycle when a program renews."
653
+ ).optional().nullable()
654
+ }).describe("Rollover settings.").optional(),
655
+ unitDisplayName: z.string().describe("Credit unit display name.").max(32).optional().nullable()
656
+ }).describe(
657
+ "Credit settings.\n\nIf this object is empty, you can't set a price for the benefit."
658
+ ).optional(),
659
+ additionalData: z.record(z.string(), z.any()).describe("Additional information relating to this object.").optional().nullable()
660
+ }).describe("Pool benefits and settings.").optional(),
661
+ displayName: z.string().describe(
662
+ "Pool name.\n\nYou may want to use the same name that's used in the associated pool definition."
663
+ ).max(64).optional(),
664
+ namespace: z.string().describe(
665
+ "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."
666
+ ).min(1).max(20).optional().nullable(),
667
+ extendedFields: z.object({
668
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
669
+ "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)."
670
+ ).optional()
671
+ }).describe(
672
+ "Custom field data for the pool object.\n\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."
673
+ ).optional(),
674
+ programDefinition: z.object({
675
+ _id: z.string().describe("Program definition ID.").regex(
676
+ /^[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}$/,
677
+ "Must be a valid GUID"
678
+ ).optional(),
679
+ externalId: z.string().describe("Program definition external ID.").regex(
680
+ /^[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}$/,
681
+ "Must be a valid GUID"
682
+ ).optional().nullable(),
683
+ displayName: z.string().describe("Display name of the program definition.").max(64).optional().nullable(),
684
+ description: z.string().describe("Description of the program definition.").max(450).optional().nullable()
685
+ }).describe("Associated program definition information.").optional(),
686
+ program: z.object({
687
+ _id: z.string().describe("Program ID.").regex(
688
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
689
+ "Must be a valid GUID"
690
+ ).optional(),
691
+ externalId: z.string().describe("Program external ID.").regex(
692
+ /^[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}$/,
693
+ "Must be a valid GUID"
694
+ ).optional().nullable(),
695
+ displayName: z.string().describe("Display name of the program.").max(64).optional().nullable()
696
+ }).describe("Information about the program containing the pool.").optional(),
697
+ poolDefinitionRevision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Version of the pool definition that this pool was created from.").optional().nullable(),
698
+ renewalCount: z.number().int().describe("Number of times this pool has been renewed.").optional().nullable()
699
+ });
700
+ var UpdatePoolRequest = z.object({
701
+ _id: z.string().describe("Pool ID.").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
+ ),
705
+ pool: z.object({
706
+ _id: z.string().describe("Pool ID.").regex(
707
+ /^[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}$/,
708
+ "Must be a valid GUID"
709
+ ).optional().nullable(),
710
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
711
+ "Revision number, which increments by 1 each time the pool is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the pool.\n\nIgnored when creating a pool."
712
+ ),
713
+ _createdDate: z.date().describe("Date and time the pool was created.").optional().nullable(),
714
+ _updatedDate: z.date().describe("Date and time the pool was updated.").optional().nullable(),
715
+ poolDefinitionId: z.string().describe("ID of the associated pool definition.").regex(
716
+ /^[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}$/,
717
+ "Must be a valid GUID"
718
+ ).optional().nullable(),
719
+ programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
720
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
721
+ "Must be a valid GUID"
722
+ ).optional().nullable(),
723
+ programId: z.string().describe("ID of the program that contains this pool.").regex(
724
+ /^[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}$/,
725
+ "Must be a valid GUID"
726
+ ).optional().nullable(),
727
+ status: z.enum([
728
+ "ACTIVE",
729
+ "PAUSED",
730
+ "ENDED",
731
+ "PROVISIONING",
732
+ "RENEWING",
733
+ "PENDING"
734
+ ]).optional(),
735
+ beneficiary: z.intersection(
736
+ z.object({}),
737
+ z.xor([
738
+ z.object({
739
+ anonymousVisitorId: z.never().optional(),
740
+ memberId: z.never().optional(),
741
+ wixUserId: z.never().optional()
742
+ }),
743
+ z.object({
744
+ memberId: z.never().optional(),
745
+ wixUserId: z.never().optional(),
746
+ anonymousVisitorId: z.string().describe(
747
+ "ID of a site visitor that hasn't logged in to the site."
748
+ ).regex(
749
+ /^[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}$/,
750
+ "Must be a valid GUID"
751
+ )
752
+ }),
753
+ z.object({
754
+ anonymousVisitorId: z.never().optional(),
755
+ wixUserId: z.never().optional(),
756
+ memberId: z.string().describe("ID of a site member.").regex(
757
+ /^[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}$/,
758
+ "Must be a valid GUID"
759
+ )
760
+ }),
761
+ z.object({
762
+ anonymousVisitorId: z.never().optional(),
763
+ memberId: z.never().optional(),
764
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
765
+ /^[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}$/,
766
+ "Must be a valid GUID"
767
+ )
768
+ })
769
+ ])
770
+ ).describe("Pool beneficiary.").optional(),
771
+ details: z.object({
772
+ benefits: z.array(
773
+ z.object({
774
+ benefitKey: z.string().describe(
775
+ "Unique identifier for this benefit.\n\nThis key is consistent across the pool definition and all associated pools that contain this benefit."
776
+ ).max(64).optional(),
777
+ itemSetId: z.string().describe(
778
+ "ID that is used to associated items with this benefit."
779
+ ).regex(
780
+ /^[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}$/,
781
+ "Must be a valid GUID"
782
+ ).optional().nullable(),
783
+ price: z.string().describe(
784
+ "Price of the benefit in credits. The price is the same for all of this benefit's items."
785
+ ).optional().nullable(),
786
+ additionalData: z.record(z.string(), z.any()).describe("Additional information for this benefit.").optional().nullable(),
787
+ providerAppId: z.string().describe("ID of the app providing the benefit items.").regex(
788
+ /^[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}$/,
789
+ "Must be a valid GUID"
790
+ ).optional().nullable(),
791
+ displayName: z.string().describe("Benefit name.").max(40).optional().nullable(),
792
+ description: z.string().describe("Benefit description.").max(255).optional().nullable()
793
+ })
794
+ ).max(10).optional(),
795
+ creditConfiguration: z.object({
796
+ amount: z.string().describe("Initial available amount for associated balances.").optional(),
797
+ rolloverConfiguration: z.object({
798
+ enabled: z.boolean().describe(
799
+ "Whether unused credits roll over to a new cycle when a program renews."
800
+ ).optional().nullable(),
801
+ balanceCap: z.string().describe(
802
+ "Maximum number of credits that can roll over to the next cycle when a program renews."
803
+ ).optional().nullable()
804
+ }).describe("Rollover settings.").optional(),
805
+ unitDisplayName: z.string().describe("Credit unit display name.").max(32).optional().nullable()
806
+ }).describe(
807
+ "Credit settings.\n\nIf this object is empty, you can't set a price for the benefit."
808
+ ).optional(),
809
+ additionalData: z.record(z.string(), z.any()).describe("Additional information relating to this object.").optional().nullable()
810
+ }).describe("Pool benefits and settings.").optional(),
811
+ displayName: z.string().describe(
812
+ "Pool name.\n\nYou may want to use the same name that's used in the associated pool definition."
813
+ ).max(64).optional(),
814
+ namespace: z.string().describe(
815
+ "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."
816
+ ).min(1).max(20).optional().nullable(),
817
+ extendedFields: z.object({
818
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
819
+ "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)."
820
+ ).optional()
821
+ }).describe(
822
+ "Custom field data for the pool object.\n\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."
823
+ ).optional(),
824
+ programDefinition: z.object({
825
+ _id: z.string().describe("Program definition ID.").regex(
826
+ /^[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}$/,
827
+ "Must be a valid GUID"
828
+ ).optional(),
829
+ externalId: z.string().describe("Program definition external ID.").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().nullable(),
833
+ displayName: z.string().describe("Display name of the program definition.").max(64).optional().nullable(),
834
+ description: z.string().describe("Description of the program definition.").max(450).optional().nullable()
835
+ }).describe("Associated program definition information.").optional(),
836
+ program: z.object({
837
+ _id: z.string().describe("Program ID.").regex(
838
+ /^[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}$/,
839
+ "Must be a valid GUID"
840
+ ).optional(),
841
+ externalId: z.string().describe("Program external 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
+ displayName: z.string().describe("Display name of the program.").max(64).optional().nullable()
846
+ }).describe("Information about the program containing the pool.").optional(),
847
+ poolDefinitionRevision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
848
+ "Version of the pool definition that this pool was created from."
849
+ ).optional().nullable(),
850
+ renewalCount: z.number().int().describe("Number of times this pool has been renewed.").optional().nullable()
851
+ }).describe("Pool to update.")
852
+ });
853
+ var UpdatePoolResponse = z.object({
854
+ _id: z.string().describe("Pool ID.").regex(
855
+ /^[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}$/,
856
+ "Must be a valid GUID"
857
+ ).optional().nullable(),
858
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
859
+ "Revision number, which increments by 1 each time the pool is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the pool.\n\nIgnored when creating a pool."
860
+ ).optional().nullable(),
861
+ _createdDate: z.date().describe("Date and time the pool was created.").optional().nullable(),
862
+ _updatedDate: z.date().describe("Date and time the pool was updated.").optional().nullable(),
863
+ poolDefinitionId: z.string().describe("ID of the associated pool definition.").regex(
864
+ /^[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}$/,
865
+ "Must be a valid GUID"
866
+ ).optional().nullable(),
867
+ programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
868
+ /^[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}$/,
869
+ "Must be a valid GUID"
870
+ ).optional().nullable(),
871
+ programId: z.string().describe("ID of the program that contains this pool.").regex(
872
+ /^[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}$/,
873
+ "Must be a valid GUID"
874
+ ).optional().nullable(),
875
+ status: z.enum(["ACTIVE", "PAUSED", "ENDED", "PROVISIONING", "RENEWING", "PENDING"]).describe("Pool status.").optional(),
876
+ beneficiary: z.intersection(
877
+ z.object({}),
878
+ z.xor([
879
+ z.object({
880
+ anonymousVisitorId: z.never().optional(),
881
+ memberId: z.never().optional(),
882
+ wixUserId: z.never().optional()
883
+ }),
884
+ z.object({
885
+ memberId: z.never().optional(),
886
+ wixUserId: z.never().optional(),
887
+ anonymousVisitorId: z.string().describe("ID of a site visitor that hasn't logged in to the site.").regex(
888
+ /^[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}$/,
889
+ "Must be a valid GUID"
890
+ )
891
+ }),
892
+ z.object({
893
+ anonymousVisitorId: z.never().optional(),
894
+ wixUserId: z.never().optional(),
895
+ memberId: z.string().describe("ID of a site member.").regex(
896
+ /^[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}$/,
897
+ "Must be a valid GUID"
898
+ )
899
+ }),
900
+ z.object({
901
+ anonymousVisitorId: z.never().optional(),
902
+ memberId: z.never().optional(),
903
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
904
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
905
+ "Must be a valid GUID"
906
+ )
907
+ })
908
+ ])
909
+ ).describe("Pool beneficiary.").optional(),
910
+ details: z.object({
911
+ benefits: z.array(
912
+ z.object({
913
+ benefitKey: z.string().describe(
914
+ "Unique identifier for this benefit.\n\nThis key is consistent across the pool definition and all associated pools that contain this benefit."
915
+ ).max(64).optional(),
916
+ itemSetId: z.string().describe(
917
+ "ID that is used to associated items with this benefit."
918
+ ).regex(
919
+ /^[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}$/,
920
+ "Must be a valid GUID"
921
+ ).optional().nullable(),
922
+ price: z.string().describe(
923
+ "Price of the benefit in credits. The price is the same for all of this benefit's items."
924
+ ).optional().nullable(),
925
+ additionalData: z.record(z.string(), z.any()).describe("Additional information for this benefit.").optional().nullable(),
926
+ providerAppId: z.string().describe("ID of the app providing the benefit items.").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
+ ).optional().nullable(),
930
+ displayName: z.string().describe("Benefit name.").max(40).optional().nullable(),
931
+ description: z.string().describe("Benefit description.").max(255).optional().nullable()
932
+ })
933
+ ).max(10).optional(),
934
+ creditConfiguration: z.object({
935
+ amount: z.string().describe("Initial available amount for associated balances.").optional(),
936
+ rolloverConfiguration: z.object({
937
+ enabled: z.boolean().describe(
938
+ "Whether unused credits roll over to a new cycle when a program renews."
939
+ ).optional().nullable(),
940
+ balanceCap: z.string().describe(
941
+ "Maximum number of credits that can roll over to the next cycle when a program renews."
942
+ ).optional().nullable()
943
+ }).describe("Rollover settings.").optional(),
944
+ unitDisplayName: z.string().describe("Credit unit display name.").max(32).optional().nullable()
945
+ }).describe(
946
+ "Credit settings.\n\nIf this object is empty, you can't set a price for the benefit."
947
+ ).optional(),
948
+ additionalData: z.record(z.string(), z.any()).describe("Additional information relating to this object.").optional().nullable()
949
+ }).describe("Pool benefits and settings.").optional(),
950
+ displayName: z.string().describe(
951
+ "Pool name.\n\nYou may want to use the same name that's used in the associated pool definition."
952
+ ).max(64).optional(),
953
+ namespace: z.string().describe(
954
+ "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."
955
+ ).min(1).max(20).optional().nullable(),
956
+ extendedFields: z.object({
957
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
958
+ "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)."
959
+ ).optional()
960
+ }).describe(
961
+ "Custom field data for the pool object.\n\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."
962
+ ).optional(),
963
+ programDefinition: z.object({
964
+ _id: z.string().describe("Program definition ID.").regex(
965
+ /^[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}$/,
966
+ "Must be a valid GUID"
967
+ ).optional(),
968
+ externalId: z.string().describe("Program definition external ID.").regex(
969
+ /^[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}$/,
970
+ "Must be a valid GUID"
971
+ ).optional().nullable(),
972
+ displayName: z.string().describe("Display name of the program definition.").max(64).optional().nullable(),
973
+ description: z.string().describe("Description of the program definition.").max(450).optional().nullable()
974
+ }).describe("Associated program definition information.").optional(),
975
+ program: z.object({
976
+ _id: z.string().describe("Program ID.").regex(
977
+ /^[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}$/,
978
+ "Must be a valid GUID"
979
+ ).optional(),
980
+ externalId: z.string().describe("Program external ID.").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
+ displayName: z.string().describe("Display name of the program.").max(64).optional().nullable()
985
+ }).describe("Information about the program containing the pool.").optional(),
986
+ poolDefinitionRevision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Version of the pool definition that this pool was created from.").optional().nullable(),
987
+ renewalCount: z.number().int().describe("Number of times this pool has been renewed.").optional().nullable()
988
+ });
989
+ var QueryPoolsRequest = z.object({
990
+ query: z.intersection(
991
+ z.object({
992
+ filter: z.record(z.string(), z.any()).describe(
993
+ "Filter object.\nSee [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)\nfor more information."
994
+ ).optional().nullable(),
995
+ sort: z.array(
996
+ z.object({
997
+ fieldName: z.string().describe("Field to sort by.").max(512).optional(),
998
+ order: z.enum(["ASC", "DESC"]).optional()
999
+ })
1000
+ ).max(5).optional()
1001
+ }),
1002
+ z.xor([
1003
+ z.object({ cursorPaging: z.never().optional() }),
1004
+ z.object({
1005
+ cursorPaging: z.object({
1006
+ limit: z.number().int().describe("Maximum number of items to return.").min(0).max(100).optional().nullable(),
1007
+ cursor: z.string().describe(
1008
+ "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."
1009
+ ).max(16e3).optional().nullable()
1010
+ }).describe(
1011
+ "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`."
1012
+ )
1013
+ })
1014
+ ])
1015
+ ).describe("Filter, sort, and paging to apply to the query.")
1016
+ });
1017
+ var QueryPoolsResponse = z.object({
1018
+ pools: z.array(
1019
+ z.object({
1020
+ _id: z.string().describe("Pool ID.").regex(
1021
+ /^[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}$/,
1022
+ "Must be a valid GUID"
1023
+ ).optional().nullable(),
1024
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1025
+ "Revision number, which increments by 1 each time the pool is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the pool.\n\nIgnored when creating a pool."
1026
+ ).optional().nullable(),
1027
+ _createdDate: z.date().describe("Date and time the pool was created.").optional().nullable(),
1028
+ _updatedDate: z.date().describe("Date and time the pool was updated.").optional().nullable(),
1029
+ poolDefinitionId: z.string().describe("ID of the associated pool definition.").regex(
1030
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1031
+ "Must be a valid GUID"
1032
+ ).optional().nullable(),
1033
+ programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
1034
+ /^[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}$/,
1035
+ "Must be a valid GUID"
1036
+ ).optional().nullable(),
1037
+ programId: z.string().describe("ID of the program that contains this pool.").regex(
1038
+ /^[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}$/,
1039
+ "Must be a valid GUID"
1040
+ ).optional().nullable(),
1041
+ status: z.enum([
1042
+ "ACTIVE",
1043
+ "PAUSED",
1044
+ "ENDED",
1045
+ "PROVISIONING",
1046
+ "RENEWING",
1047
+ "PENDING"
1048
+ ]).describe("Pool status.").optional(),
1049
+ beneficiary: z.intersection(
1050
+ z.object({}),
1051
+ z.xor([
1052
+ z.object({
1053
+ anonymousVisitorId: z.never().optional(),
1054
+ memberId: z.never().optional(),
1055
+ wixUserId: z.never().optional()
1056
+ }),
1057
+ z.object({
1058
+ memberId: z.never().optional(),
1059
+ wixUserId: z.never().optional(),
1060
+ anonymousVisitorId: z.string().describe(
1061
+ "ID of a site visitor that hasn't logged in to the site."
1062
+ ).regex(
1063
+ /^[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}$/,
1064
+ "Must be a valid GUID"
1065
+ )
1066
+ }),
1067
+ z.object({
1068
+ anonymousVisitorId: z.never().optional(),
1069
+ wixUserId: z.never().optional(),
1070
+ memberId: z.string().describe("ID of a site member.").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
+ )
1074
+ }),
1075
+ z.object({
1076
+ anonymousVisitorId: z.never().optional(),
1077
+ memberId: z.never().optional(),
1078
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
1079
+ /^[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}$/,
1080
+ "Must be a valid GUID"
1081
+ )
1082
+ })
1083
+ ])
1084
+ ).describe("Pool beneficiary.").optional(),
1085
+ details: z.object({
1086
+ benefits: z.array(
1087
+ z.object({
1088
+ benefitKey: z.string().describe(
1089
+ "Unique identifier for this benefit.\n\nThis key is consistent across the pool definition and all associated pools that contain this benefit."
1090
+ ).max(64).optional(),
1091
+ itemSetId: z.string().describe(
1092
+ "ID that is used to associated items with this benefit."
1093
+ ).regex(
1094
+ /^[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}$/,
1095
+ "Must be a valid GUID"
1096
+ ).optional().nullable(),
1097
+ price: z.string().describe(
1098
+ "Price of the benefit in credits. The price is the same for all of this benefit's items."
1099
+ ).optional().nullable(),
1100
+ additionalData: z.record(z.string(), z.any()).describe("Additional information for this benefit.").optional().nullable(),
1101
+ providerAppId: z.string().describe("ID of the app providing the benefit items.").regex(
1102
+ /^[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}$/,
1103
+ "Must be a valid GUID"
1104
+ ).optional().nullable(),
1105
+ displayName: z.string().describe("Benefit name.").max(40).optional().nullable(),
1106
+ description: z.string().describe("Benefit description.").max(255).optional().nullable()
1107
+ })
1108
+ ).max(10).optional(),
1109
+ creditConfiguration: z.object({
1110
+ amount: z.string().describe("Initial available amount for associated balances.").optional(),
1111
+ rolloverConfiguration: z.object({
1112
+ enabled: z.boolean().describe(
1113
+ "Whether unused credits roll over to a new cycle when a program renews."
1114
+ ).optional().nullable(),
1115
+ balanceCap: z.string().describe(
1116
+ "Maximum number of credits that can roll over to the next cycle when a program renews."
1117
+ ).optional().nullable()
1118
+ }).describe("Rollover settings.").optional(),
1119
+ unitDisplayName: z.string().describe("Credit unit display name.").max(32).optional().nullable()
1120
+ }).describe(
1121
+ "Credit settings.\n\nIf this object is empty, you can't set a price for the benefit."
1122
+ ).optional(),
1123
+ additionalData: z.record(z.string(), z.any()).describe("Additional information relating to this object.").optional().nullable()
1124
+ }).describe("Pool benefits and settings.").optional(),
1125
+ displayName: z.string().describe(
1126
+ "Pool name.\n\nYou may want to use the same name that's used in the associated pool definition."
1127
+ ).max(64).optional(),
1128
+ namespace: z.string().describe(
1129
+ "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."
1130
+ ).min(1).max(20).optional().nullable(),
1131
+ extendedFields: z.object({
1132
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1133
+ "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)."
1134
+ ).optional()
1135
+ }).describe(
1136
+ "Custom field data for the pool object.\n\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."
1137
+ ).optional(),
1138
+ programDefinition: z.object({
1139
+ _id: z.string().describe("Program definition ID.").regex(
1140
+ /^[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}$/,
1141
+ "Must be a valid GUID"
1142
+ ).optional(),
1143
+ externalId: z.string().describe("Program definition external ID.").regex(
1144
+ /^[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}$/,
1145
+ "Must be a valid GUID"
1146
+ ).optional().nullable(),
1147
+ displayName: z.string().describe("Display name of the program definition.").max(64).optional().nullable(),
1148
+ description: z.string().describe("Description of the program definition.").max(450).optional().nullable()
1149
+ }).describe("Associated program definition information.").optional(),
1150
+ program: z.object({
1151
+ _id: z.string().describe("Program ID.").regex(
1152
+ /^[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}$/,
1153
+ "Must be a valid GUID"
1154
+ ).optional(),
1155
+ externalId: z.string().describe("Program external ID.").regex(
1156
+ /^[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}$/,
1157
+ "Must be a valid GUID"
1158
+ ).optional().nullable(),
1159
+ displayName: z.string().describe("Display name of the program.").max(64).optional().nullable()
1160
+ }).describe("Information about the program containing the pool.").optional(),
1161
+ poolDefinitionRevision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1162
+ "Version of the pool definition that this pool was created from."
1163
+ ).optional().nullable(),
1164
+ renewalCount: z.number().int().describe("Number of times this pool has been renewed.").optional().nullable()
1165
+ })
1166
+ ).optional(),
1167
+ metadata: z.object({
1168
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
1169
+ cursors: z.object({
1170
+ next: z.string().describe(
1171
+ "Cursor string pointing to the next page in the list of results."
1172
+ ).max(16e3).optional().nullable(),
1173
+ prev: z.string().describe(
1174
+ "Cursor pointing to the previous page in the list of results."
1175
+ ).max(16e3).optional().nullable()
1176
+ }).describe(
1177
+ "Cursor strings that point to the next page, previous page, or both."
1178
+ ).optional(),
1179
+ hasNext: z.boolean().describe(
1180
+ "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."
1181
+ ).optional().nullable()
1182
+ }).describe("Metadata for the paginated results.").optional()
1183
+ });
1184
+ var RedeemBenefitRequest = z.object({
1185
+ poolId: z.string().describe("ID of the pool that contains the benefit to redeem.").regex(
1186
+ /^[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}$/,
1187
+ "Must be a valid GUID"
1188
+ ),
1189
+ options: z.object({
1190
+ itemReference: z.object({
1191
+ externalId: z.string().describe("External ID of the item.").regex(
1192
+ /^[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}$/,
1193
+ "Must be a valid GUID"
1194
+ ),
1195
+ category: z.string().describe("Item category.").max(20).optional(),
1196
+ providerAppId: z.string().describe("ID of the app providing the item.").regex(
1197
+ /^[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}$/,
1198
+ "Must be a valid GUID"
1199
+ )
1200
+ }).describe("Information about the item to redeem."),
1201
+ benefitKey: z.string().describe("Key of the benefit to redeem.").max(64),
1202
+ count: z.number().int().describe("Amount of items to redeem.").min(1).optional(),
1203
+ targetDate: z.date().describe(
1204
+ "Date that the item will be provided to the beneficiary.\n\nThe pool's associated balance will update immediately. This parameter should be used to manage the logistics of providing the item."
1205
+ ).optional().nullable(),
1206
+ idempotencyKey: z.string().describe(
1207
+ "Unique identifier, generated by the client.\nUsed to recognize repeated attempts to make the same request."
1208
+ ).max(200),
1209
+ additionalData: z.record(z.string(), z.any()).describe("Additional information.").optional().nullable(),
1210
+ beneficiary: z.intersection(
1211
+ z.object({}),
1212
+ z.xor([
1213
+ z.object({
1214
+ anonymousVisitorId: z.never().optional(),
1215
+ memberId: z.never().optional(),
1216
+ wixUserId: z.never().optional()
1217
+ }),
1218
+ z.object({
1219
+ memberId: z.never().optional(),
1220
+ wixUserId: z.never().optional(),
1221
+ anonymousVisitorId: z.string().describe(
1222
+ "ID of a site visitor that hasn't logged in to the site."
1223
+ ).regex(
1224
+ /^[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}$/,
1225
+ "Must be a valid GUID"
1226
+ )
1227
+ }),
1228
+ z.object({
1229
+ anonymousVisitorId: z.never().optional(),
1230
+ wixUserId: z.never().optional(),
1231
+ memberId: z.string().describe("ID of a site member.").regex(
1232
+ /^[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}$/,
1233
+ "Must be a valid GUID"
1234
+ )
1235
+ }),
1236
+ z.object({
1237
+ anonymousVisitorId: z.never().optional(),
1238
+ memberId: z.never().optional(),
1239
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
1240
+ /^[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}$/,
1241
+ "Must be a valid GUID"
1242
+ )
1243
+ })
1244
+ ])
1245
+ ).describe("Beneficiary of the pool containing the benefit to redeem.").optional(),
1246
+ namespace: z.string().describe(
1247
+ "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."
1248
+ ).min(1).max(20)
1249
+ })
1250
+ });
1251
+ var RedeemBenefitResponse = z.object({
1252
+ transactionId: z.string().describe(
1253
+ "ID of the transaction recording the associated change in balance."
1254
+ ).regex(
1255
+ /^[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}$/,
1256
+ "Must be a valid GUID"
1257
+ ).optional()
1258
+ });
1259
+ var CheckBenefitEligibilityRequest = z.object({
1260
+ poolId: z.string().describe("ID of the pool that the benefit to check belongs to.").regex(
1261
+ /^[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}$/,
1262
+ "Must be a valid GUID"
1263
+ ),
1264
+ options: z.object({
1265
+ benefitKey: z.string().describe("Key of the benefit to check.").max(64).optional().nullable(),
1266
+ itemReference: z.object({
1267
+ externalId: z.string().describe("External ID of the item.").regex(
1268
+ /^[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}$/,
1269
+ "Must be a valid GUID"
1270
+ ),
1271
+ category: z.string().describe("Item category.").max(20).optional(),
1272
+ providerAppId: z.string().describe("ID of the app providing the item.").regex(
1273
+ /^[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}$/,
1274
+ "Must be a valid GUID"
1275
+ )
1276
+ }).describe("Information about the item to check."),
1277
+ count: z.number().int().describe(
1278
+ "Amount of items to check.\n\nEnsures the balance is high enough to redeem this many items."
1279
+ ).min(1).optional(),
1280
+ targetDate: z.date().describe(
1281
+ "Date that the item will be provided to the beneficiary.\n\nThis parameter should be used to manage the potential logistics of providing the item."
1282
+ ).optional().nullable(),
1283
+ additionalData: z.record(z.string(), z.any()).describe("Additional information.").optional().nullable(),
1284
+ beneficiary: z.intersection(
1285
+ z.object({}),
1286
+ z.xor([
1287
+ z.object({
1288
+ anonymousVisitorId: z.never().optional(),
1289
+ memberId: z.never().optional(),
1290
+ wixUserId: z.never().optional()
1291
+ }),
1292
+ z.object({
1293
+ memberId: z.never().optional(),
1294
+ wixUserId: z.never().optional(),
1295
+ anonymousVisitorId: z.string().describe(
1296
+ "ID of a site visitor that hasn't logged in to the site."
1297
+ ).regex(
1298
+ /^[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}$/,
1299
+ "Must be a valid GUID"
1300
+ )
1301
+ }),
1302
+ z.object({
1303
+ anonymousVisitorId: z.never().optional(),
1304
+ wixUserId: z.never().optional(),
1305
+ memberId: z.string().describe("ID of a site member.").regex(
1306
+ /^[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}$/,
1307
+ "Must be a valid GUID"
1308
+ )
1309
+ }),
1310
+ z.object({
1311
+ anonymousVisitorId: z.never().optional(),
1312
+ memberId: z.never().optional(),
1313
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
1314
+ /^[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}$/,
1315
+ "Must be a valid GUID"
1316
+ )
1317
+ })
1318
+ ])
1319
+ ).describe("Beneficiary of the pool containing the benefit to check.").optional(),
1320
+ namespace: z.string().describe(
1321
+ "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."
1322
+ ).min(1).max(20)
1323
+ })
1324
+ });
1325
+ var CheckBenefitEligibilityResponse = z.object({
1326
+ result: z.object({
1327
+ benefitResults: z.array(
1328
+ z.intersection(
1329
+ z.object({
1330
+ type: z.enum([
1331
+ "ELIGIBLE_BENEFIT",
1332
+ "NOT_ENOUGH_BALANCE",
1333
+ "POOL_NOT_ACTIVE",
1334
+ "BENEFIT_NOT_FOUND",
1335
+ "POOL_NOT_FOUND"
1336
+ ]).describe("Eligibility status.").optional()
1337
+ }),
1338
+ z.xor([
1339
+ z.object({
1340
+ eligibleBenefitOptions: z.never().optional(),
1341
+ notEnoughBalanceOptions: z.never().optional(),
1342
+ policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1343
+ poolNotActiveOptions: z.never().optional(),
1344
+ benefitNotFoundOptions: z.never().optional(),
1345
+ poolNotFoundOptions: z.never().optional()
1346
+ }),
1347
+ z.object({
1348
+ notEnoughBalanceOptions: z.never().optional(),
1349
+ policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1350
+ poolNotActiveOptions: z.never().optional(),
1351
+ benefitNotFoundOptions: z.never().optional(),
1352
+ poolNotFoundOptions: z.never().optional(),
1353
+ eligibleBenefitOptions: z.object({
1354
+ poolId: z.string().describe("Pool ID.").regex(
1355
+ /^[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}$/,
1356
+ "Must be a valid GUID"
1357
+ ).optional(),
1358
+ benefitKey: z.string().describe("Benefit key.").max(64).optional(),
1359
+ itemReference: z.object({
1360
+ externalId: z.string().describe("External ID of the item.").regex(
1361
+ /^[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}$/,
1362
+ "Must be a valid GUID"
1363
+ ).optional(),
1364
+ category: z.string().describe("Item category.").max(20).optional(),
1365
+ providerAppId: z.string().describe("ID of the app providing the item.").regex(
1366
+ /^[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}$/,
1367
+ "Must be a valid GUID"
1368
+ ).optional()
1369
+ }).describe("Item reference.").optional(),
1370
+ price: z.string().describe("Price of the benefit in credits.").optional().nullable()
1371
+ }).describe("Returned when item is eligible to be redeemed.")
1372
+ }),
1373
+ z.object({
1374
+ eligibleBenefitOptions: z.never().optional(),
1375
+ policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1376
+ poolNotActiveOptions: z.never().optional(),
1377
+ benefitNotFoundOptions: z.never().optional(),
1378
+ poolNotFoundOptions: z.never().optional(),
1379
+ notEnoughBalanceOptions: z.object({
1380
+ poolId: z.string().describe("Pool ID.").regex(
1381
+ /^[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}$/,
1382
+ "Must be a valid GUID"
1383
+ ).optional(),
1384
+ itemReference: z.object({
1385
+ externalId: z.string().describe("External ID of the item.").regex(
1386
+ /^[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}$/,
1387
+ "Must be a valid GUID"
1388
+ ).optional(),
1389
+ category: z.string().describe("Item category.").max(20).optional(),
1390
+ providerAppId: z.string().describe("ID of the app providing the item.").regex(
1391
+ /^[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}$/,
1392
+ "Must be a valid GUID"
1393
+ ).optional()
1394
+ }).describe("Item reference.").optional(),
1395
+ availableBalance: z.string().describe("Pool's associated balance amount in credits.").optional(),
1396
+ requestedBalance: z.string().describe("Price of the item in credits.").optional()
1397
+ }).describe(
1398
+ "Returned when the pool's associated balance is lower than the cost of redeeming the items."
1399
+ )
1400
+ }),
1401
+ z.object({
1402
+ eligibleBenefitOptions: z.never().optional(),
1403
+ notEnoughBalanceOptions: z.never().optional(),
1404
+ poolNotActiveOptions: z.never().optional(),
1405
+ benefitNotFoundOptions: z.never().optional(),
1406
+ poolNotFoundOptions: z.never().optional(),
1407
+ policyExpressionEvaluatedToFalseOptions: z.object({
1408
+ poolId: z.string().describe("Pool ID.").regex(
1409
+ /^[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}$/,
1410
+ "Must be a valid GUID"
1411
+ ).optional(),
1412
+ itemReference: z.object({
1413
+ externalId: z.string().describe("External ID of the item.").regex(
1414
+ /^[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}$/,
1415
+ "Must be a valid GUID"
1416
+ ).optional(),
1417
+ category: z.string().describe("Item category.").max(20).optional(),
1418
+ providerAppId: z.string().describe("ID of the app providing the item.").regex(
1419
+ /^[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}$/,
1420
+ "Must be a valid GUID"
1421
+ ).optional()
1422
+ }).describe("Item reference.").optional(),
1423
+ failureDetails: z.array(
1424
+ z.object({
1425
+ code: z.string().describe("Failure code").min(1).max(64).optional(),
1426
+ message: z.string().describe("Failure message").max(256).optional().nullable(),
1427
+ policyId: z.string().describe("Policy id").regex(
1428
+ /^[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}$/,
1429
+ "Must be a valid GUID"
1430
+ ).optional().nullable(),
1431
+ appId: z.string().describe("App that owns the policy").regex(
1432
+ /^[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}$/,
1433
+ "Must be a valid GUID"
1434
+ ).optional().nullable(),
1435
+ errorData: z.record(z.string(), z.any()).describe("Information provided by the policy").optional().nullable()
1436
+ })
1437
+ ).max(10).optional()
1438
+ }).describe("Returned when the policy is false.")
1439
+ }),
1440
+ z.object({
1441
+ eligibleBenefitOptions: z.never().optional(),
1442
+ notEnoughBalanceOptions: z.never().optional(),
1443
+ policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1444
+ benefitNotFoundOptions: z.never().optional(),
1445
+ poolNotFoundOptions: z.never().optional(),
1446
+ poolNotActiveOptions: z.object({
1447
+ poolId: z.string().describe("Pool ID.").regex(
1448
+ /^[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}$/,
1449
+ "Must be a valid GUID"
1450
+ ).optional(),
1451
+ poolStatus: z.enum([
1452
+ "ACTIVE",
1453
+ "PAUSED",
1454
+ "ENDED",
1455
+ "PROVISIONING",
1456
+ "RENEWING",
1457
+ "PENDING"
1458
+ ]).describe("Pool status.").optional()
1459
+ }).describe("Returned when the pool isn't active.")
1460
+ }),
1461
+ z.object({
1462
+ eligibleBenefitOptions: z.never().optional(),
1463
+ notEnoughBalanceOptions: z.never().optional(),
1464
+ policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1465
+ poolNotActiveOptions: z.never().optional(),
1466
+ poolNotFoundOptions: z.never().optional(),
1467
+ benefitNotFoundOptions: z.object({
1468
+ poolId: z.string().describe("Pool ID.").regex(
1469
+ /^[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}$/,
1470
+ "Must be a valid GUID"
1471
+ ).optional(),
1472
+ benefitKey: z.string().describe("Specified benefit key.").max(64).optional().nullable()
1473
+ }).describe(
1474
+ "Returned when invalid benefit details are provided."
1475
+ )
1476
+ }),
1477
+ z.object({
1478
+ eligibleBenefitOptions: z.never().optional(),
1479
+ notEnoughBalanceOptions: z.never().optional(),
1480
+ policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1481
+ poolNotActiveOptions: z.never().optional(),
1482
+ benefitNotFoundOptions: z.never().optional(),
1483
+ poolNotFoundOptions: z.object({
1484
+ poolId: z.string().describe("Pool ID.").regex(
1485
+ /^[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}$/,
1486
+ "Must be a valid GUID"
1487
+ ).optional()
1488
+ }).describe("Returned when invalid pool details are provided.")
1489
+ })
1490
+ ])
1491
+ )
1492
+ ).max(10).optional()
1493
+ }).describe("Result of the eligibility check.").optional()
1494
+ });
1495
+ var BulkCheckBenefitEligibilityRequest = z.object({
1496
+ options: z.object({
1497
+ benefitSelectors: z.array(
1498
+ z.object({
1499
+ poolId: z.string().describe("ID of the pool that the benefit to check belongs to.").regex(
1500
+ /^[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}$/,
1501
+ "Must be a valid GUID"
1502
+ ),
1503
+ benefitKey: z.string().describe("Key of the benefit to check.").max(64).optional().nullable(),
1504
+ itemReference: z.object({
1505
+ externalId: z.string().describe("External ID of the item.").regex(
1506
+ /^[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}$/,
1507
+ "Must be a valid GUID"
1508
+ ),
1509
+ category: z.string().describe("Item category.").max(20).optional(),
1510
+ providerAppId: z.string().describe("ID of the app providing the item.").regex(
1511
+ /^[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}$/,
1512
+ "Must be a valid GUID"
1513
+ )
1514
+ }).describe("Information about the item to check."),
1515
+ count: z.number().int().describe(
1516
+ "Amount of items to check.\n\nEnsures the balance is high enough to redeem this many items."
1517
+ ).min(1).optional(),
1518
+ targetDate: z.date().describe(
1519
+ "Date that the item will be provided to the beneficiary.\n\nThis parameter should be used to manage the potential logistics of providing the item."
1520
+ ).optional().nullable(),
1521
+ additionalData: z.record(z.string(), z.any()).describe("Additional information.").optional().nullable()
1522
+ })
1523
+ ).min(1).max(100).optional(),
1524
+ namespace: z.string().describe(
1525
+ "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."
1526
+ ).min(1).max(20),
1527
+ beneficiary: z.intersection(
1528
+ z.object({}),
1529
+ z.xor([
1530
+ z.object({
1531
+ anonymousVisitorId: z.never().optional(),
1532
+ memberId: z.never().optional(),
1533
+ wixUserId: z.never().optional()
1534
+ }),
1535
+ z.object({
1536
+ memberId: z.never().optional(),
1537
+ wixUserId: z.never().optional(),
1538
+ anonymousVisitorId: z.string().describe(
1539
+ "ID of a site visitor that hasn't logged in to the site."
1540
+ ).regex(
1541
+ /^[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}$/,
1542
+ "Must be a valid GUID"
1543
+ )
1544
+ }),
1545
+ z.object({
1546
+ anonymousVisitorId: z.never().optional(),
1547
+ wixUserId: z.never().optional(),
1548
+ memberId: z.string().describe("ID of a site member.").regex(
1549
+ /^[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}$/,
1550
+ "Must be a valid GUID"
1551
+ )
1552
+ }),
1553
+ z.object({
1554
+ anonymousVisitorId: z.never().optional(),
1555
+ memberId: z.never().optional(),
1556
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
1557
+ /^[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}$/,
1558
+ "Must be a valid GUID"
1559
+ )
1560
+ })
1561
+ ])
1562
+ ).describe("Pool beneficiary.").optional()
1563
+ })
1564
+ });
1565
+ var BulkCheckBenefitEligibilityResponse = z.object({
1566
+ results: z.array(
1567
+ z.object({
1568
+ benefitSelector: z.object({
1569
+ poolId: z.string().describe("ID of the pool that the benefit to check belongs to.").regex(
1570
+ /^[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}$/,
1571
+ "Must be a valid GUID"
1572
+ ).optional(),
1573
+ benefitKey: z.string().describe("Key of the benefit to check.").max(64).optional().nullable(),
1574
+ itemReference: z.object({
1575
+ externalId: z.string().describe("External ID of the item.").regex(
1576
+ /^[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}$/,
1577
+ "Must be a valid GUID"
1578
+ ).optional(),
1579
+ category: z.string().describe("Item category.").max(20).optional(),
1580
+ providerAppId: z.string().describe("ID of the app providing the item.").regex(
1581
+ /^[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}$/,
1582
+ "Must be a valid GUID"
1583
+ ).optional()
1584
+ }).describe("Information about the item to check.").optional(),
1585
+ count: z.number().int().describe(
1586
+ "Amount of items to check.\n\nEnsures the balance is high enough to redeem this many items."
1587
+ ).min(1).optional(),
1588
+ targetDate: z.date().describe(
1589
+ "Date that the item will be provided to the beneficiary.\n\nThis parameter should be used to manage the potential logistics of providing the item."
1590
+ ).optional().nullable(),
1591
+ additionalData: z.record(z.string(), z.any()).describe("Additional information.").optional().nullable()
1592
+ }).describe("Benefit information specified in API call.").optional(),
1593
+ result: z.object({
1594
+ benefitResults: z.array(
1595
+ z.intersection(
1596
+ z.object({
1597
+ type: z.enum([
1598
+ "ELIGIBLE_BENEFIT",
1599
+ "NOT_ENOUGH_BALANCE",
1600
+ "POOL_NOT_ACTIVE",
1601
+ "BENEFIT_NOT_FOUND",
1602
+ "POOL_NOT_FOUND"
1603
+ ]).describe("Eligibility status.").optional()
1604
+ }),
1605
+ z.xor([
1606
+ z.object({
1607
+ eligibleBenefitOptions: z.never().optional(),
1608
+ notEnoughBalanceOptions: z.never().optional(),
1609
+ policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1610
+ poolNotActiveOptions: z.never().optional(),
1611
+ benefitNotFoundOptions: z.never().optional(),
1612
+ poolNotFoundOptions: z.never().optional()
1613
+ }),
1614
+ z.object({
1615
+ notEnoughBalanceOptions: z.never().optional(),
1616
+ policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1617
+ poolNotActiveOptions: z.never().optional(),
1618
+ benefitNotFoundOptions: z.never().optional(),
1619
+ poolNotFoundOptions: z.never().optional(),
1620
+ eligibleBenefitOptions: z.object({
1621
+ poolId: z.string().describe("Pool ID.").regex(
1622
+ /^[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}$/,
1623
+ "Must be a valid GUID"
1624
+ ).optional(),
1625
+ benefitKey: z.string().describe("Benefit key.").max(64).optional(),
1626
+ itemReference: z.object({
1627
+ externalId: z.string().describe("External ID of the item.").regex(
1628
+ /^[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}$/,
1629
+ "Must be a valid GUID"
1630
+ ).optional(),
1631
+ category: z.string().describe("Item category.").max(20).optional(),
1632
+ providerAppId: z.string().describe("ID of the app providing the item.").regex(
1633
+ /^[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}$/,
1634
+ "Must be a valid GUID"
1635
+ ).optional()
1636
+ }).describe("Item reference.").optional(),
1637
+ price: z.string().describe("Price of the benefit in credits.").optional().nullable()
1638
+ }).describe(
1639
+ "Returned when item is eligible to be redeemed."
1640
+ )
1641
+ }),
1642
+ z.object({
1643
+ eligibleBenefitOptions: z.never().optional(),
1644
+ policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1645
+ poolNotActiveOptions: z.never().optional(),
1646
+ benefitNotFoundOptions: z.never().optional(),
1647
+ poolNotFoundOptions: z.never().optional(),
1648
+ notEnoughBalanceOptions: z.object({
1649
+ poolId: z.string().describe("Pool ID.").regex(
1650
+ /^[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}$/,
1651
+ "Must be a valid GUID"
1652
+ ).optional(),
1653
+ itemReference: z.object({
1654
+ externalId: z.string().describe("External ID of the item.").regex(
1655
+ /^[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}$/,
1656
+ "Must be a valid GUID"
1657
+ ).optional(),
1658
+ category: z.string().describe("Item category.").max(20).optional(),
1659
+ providerAppId: z.string().describe("ID of the app providing the item.").regex(
1660
+ /^[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}$/,
1661
+ "Must be a valid GUID"
1662
+ ).optional()
1663
+ }).describe("Item reference.").optional(),
1664
+ availableBalance: z.string().describe(
1665
+ "Pool's associated balance amount in credits."
1666
+ ).optional(),
1667
+ requestedBalance: z.string().describe("Price of the item in credits.").optional()
1668
+ }).describe(
1669
+ "Returned when the pool's associated balance is lower than the cost of redeeming the items."
1670
+ )
1671
+ }),
1672
+ z.object({
1673
+ eligibleBenefitOptions: z.never().optional(),
1674
+ notEnoughBalanceOptions: z.never().optional(),
1675
+ poolNotActiveOptions: z.never().optional(),
1676
+ benefitNotFoundOptions: z.never().optional(),
1677
+ poolNotFoundOptions: z.never().optional(),
1678
+ policyExpressionEvaluatedToFalseOptions: z.object({
1679
+ poolId: z.string().describe("Pool ID.").regex(
1680
+ /^[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}$/,
1681
+ "Must be a valid GUID"
1682
+ ).optional(),
1683
+ itemReference: z.object({
1684
+ externalId: z.string().describe("External ID of the item.").regex(
1685
+ /^[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}$/,
1686
+ "Must be a valid GUID"
1687
+ ).optional(),
1688
+ category: z.string().describe("Item category.").max(20).optional(),
1689
+ providerAppId: z.string().describe("ID of the app providing the item.").regex(
1690
+ /^[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}$/,
1691
+ "Must be a valid GUID"
1692
+ ).optional()
1693
+ }).describe("Item reference.").optional(),
1694
+ failureDetails: z.array(
1695
+ z.object({
1696
+ code: z.string().describe("Failure code").min(1).max(64).optional(),
1697
+ message: z.string().describe("Failure message").max(256).optional().nullable(),
1698
+ policyId: z.string().describe("Policy id").regex(
1699
+ /^[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}$/,
1700
+ "Must be a valid GUID"
1701
+ ).optional().nullable(),
1702
+ appId: z.string().describe("App that owns the policy").regex(
1703
+ /^[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}$/,
1704
+ "Must be a valid GUID"
1705
+ ).optional().nullable(),
1706
+ errorData: z.record(z.string(), z.any()).describe(
1707
+ "Information provided by the policy"
1708
+ ).optional().nullable()
1709
+ })
1710
+ ).max(10).optional()
1711
+ }).describe("Returned when the policy is false.")
1712
+ }),
1713
+ z.object({
1714
+ eligibleBenefitOptions: z.never().optional(),
1715
+ notEnoughBalanceOptions: z.never().optional(),
1716
+ policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1717
+ benefitNotFoundOptions: z.never().optional(),
1718
+ poolNotFoundOptions: z.never().optional(),
1719
+ poolNotActiveOptions: z.object({
1720
+ poolId: z.string().describe("Pool ID.").regex(
1721
+ /^[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}$/,
1722
+ "Must be a valid GUID"
1723
+ ).optional(),
1724
+ poolStatus: z.enum([
1725
+ "ACTIVE",
1726
+ "PAUSED",
1727
+ "ENDED",
1728
+ "PROVISIONING",
1729
+ "RENEWING",
1730
+ "PENDING"
1731
+ ]).describe("Pool status.").optional()
1732
+ }).describe("Returned when the pool isn't active.")
1733
+ }),
1734
+ z.object({
1735
+ eligibleBenefitOptions: z.never().optional(),
1736
+ notEnoughBalanceOptions: z.never().optional(),
1737
+ policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1738
+ poolNotActiveOptions: z.never().optional(),
1739
+ poolNotFoundOptions: z.never().optional(),
1740
+ benefitNotFoundOptions: z.object({
1741
+ poolId: z.string().describe("Pool ID.").regex(
1742
+ /^[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}$/,
1743
+ "Must be a valid GUID"
1744
+ ).optional(),
1745
+ benefitKey: z.string().describe("Specified benefit key.").max(64).optional().nullable()
1746
+ }).describe(
1747
+ "Returned when invalid benefit details are provided."
1748
+ )
1749
+ }),
1750
+ z.object({
1751
+ eligibleBenefitOptions: z.never().optional(),
1752
+ notEnoughBalanceOptions: z.never().optional(),
1753
+ policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1754
+ poolNotActiveOptions: z.never().optional(),
1755
+ benefitNotFoundOptions: z.never().optional(),
1756
+ poolNotFoundOptions: z.object({
1757
+ poolId: z.string().describe("Pool ID.").regex(
1758
+ /^[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}$/,
1759
+ "Must be a valid GUID"
1760
+ ).optional()
1761
+ }).describe(
1762
+ "Returned when invalid pool details are provided."
1763
+ )
1764
+ })
1765
+ ])
1766
+ )
1767
+ ).max(10).optional()
1768
+ }).describe("Result of the eligibility check.").optional()
1769
+ })
1770
+ ).min(1).max(100).optional()
1771
+ });
1772
+ var GetEligibleBenefitsRequest = z.object({
1773
+ itemReference: z.object({
1774
+ externalId: z.string().describe("External ID of the item.").regex(
1775
+ /^[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}$/,
1776
+ "Must be a valid GUID"
1777
+ ),
1778
+ category: z.string().describe("Item category.").max(20).optional(),
1779
+ providerAppId: z.string().describe("ID of the app providing the item.").regex(
1780
+ /^[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}$/,
1781
+ "Must be a valid GUID"
1782
+ )
1783
+ }).describe("Item reference."),
1784
+ options: z.object({
1785
+ count: z.number().int().describe(
1786
+ "Amount of items to check. This ensures the balance is high enough to redeem this many items."
1787
+ ).min(1).optional(),
1788
+ targetDate: z.date().describe(
1789
+ "Date that the item will be provided to the beneficiary.\n\nThis parameter should be used to manage the potential logistics of providing the item."
1790
+ ).optional().nullable(),
1791
+ additionalData: z.record(z.string(), z.any()).describe("Additional information.").optional().nullable(),
1792
+ beneficiary: z.intersection(
1793
+ z.object({}),
1794
+ z.xor([
1795
+ z.object({
1796
+ anonymousVisitorId: z.never().optional(),
1797
+ memberId: z.never().optional(),
1798
+ wixUserId: z.never().optional()
1799
+ }),
1800
+ z.object({
1801
+ memberId: z.never().optional(),
1802
+ wixUserId: z.never().optional(),
1803
+ anonymousVisitorId: z.string().describe(
1804
+ "ID of a site visitor that hasn't logged in to the site."
1805
+ ).regex(
1806
+ /^[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}$/,
1807
+ "Must be a valid GUID"
1808
+ )
1809
+ }),
1810
+ z.object({
1811
+ anonymousVisitorId: z.never().optional(),
1812
+ wixUserId: z.never().optional(),
1813
+ memberId: z.string().describe("ID of a site member.").regex(
1814
+ /^[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}$/,
1815
+ "Must be a valid GUID"
1816
+ )
1817
+ }),
1818
+ z.object({
1819
+ anonymousVisitorId: z.never().optional(),
1820
+ memberId: z.never().optional(),
1821
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
1822
+ /^[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}$/,
1823
+ "Must be a valid GUID"
1824
+ )
1825
+ })
1826
+ ])
1827
+ ).describe("Filter request by beneficiary.").optional(),
1828
+ namespace: z.string().describe(
1829
+ "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."
1830
+ ).min(1).max(20)
1831
+ })
1832
+ });
1833
+ var GetEligibleBenefitsResponse = z.object({
1834
+ eligibleBenefits: z.array(
1835
+ z.object({
1836
+ poolId: z.string().describe("Pool ID.").regex(
1837
+ /^[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}$/,
1838
+ "Must be a valid GUID"
1839
+ ).optional(),
1840
+ benefitKey: z.string().describe("Benefit key.").max(64).optional(),
1841
+ itemReference: z.object({
1842
+ externalId: z.string().describe("External ID of the item.").regex(
1843
+ /^[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}$/,
1844
+ "Must be a valid GUID"
1845
+ ).optional(),
1846
+ category: z.string().describe("Item category.").max(20).optional(),
1847
+ providerAppId: z.string().describe("ID of the app providing the item.").regex(
1848
+ /^[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}$/,
1849
+ "Must be a valid GUID"
1850
+ ).optional()
1851
+ }).describe("Item reference.").optional(),
1852
+ price: z.string().describe("Price of the benefit in credits.").optional().nullable()
1853
+ })
1854
+ ).optional()
1855
+ });
1856
+ var BulkUpdatePoolsRequest = z.object({
1857
+ options: z.object({
1858
+ pools: z.array(
1859
+ z.object({
1860
+ pool: z.object({
1861
+ _id: z.string().describe("Pool ID.").regex(
1862
+ /^[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}$/,
1863
+ "Must be a valid GUID"
1864
+ ),
1865
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1866
+ "Revision number, which increments by 1 each time the pool is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the pool.\n\nIgnored when creating a pool."
1867
+ ),
1868
+ _createdDate: z.date().describe("Date and time the pool was created.").optional().nullable(),
1869
+ _updatedDate: z.date().describe("Date and time the pool was updated.").optional().nullable(),
1870
+ poolDefinitionId: z.string().describe("ID of the associated pool definition.").regex(
1871
+ /^[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}$/,
1872
+ "Must be a valid GUID"
1873
+ ).optional().nullable(),
1874
+ programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
1875
+ /^[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}$/,
1876
+ "Must be a valid GUID"
1877
+ ).optional().nullable(),
1878
+ programId: z.string().describe("ID of the program that contains this pool.").regex(
1879
+ /^[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}$/,
1880
+ "Must be a valid GUID"
1881
+ ).optional().nullable(),
1882
+ status: z.enum([
1883
+ "ACTIVE",
1884
+ "PAUSED",
1885
+ "ENDED",
1886
+ "PROVISIONING",
1887
+ "RENEWING",
1888
+ "PENDING"
1889
+ ]).optional(),
1890
+ beneficiary: z.intersection(
1891
+ z.object({}),
1892
+ z.xor([
1893
+ z.object({
1894
+ anonymousVisitorId: z.never().optional(),
1895
+ memberId: z.never().optional(),
1896
+ wixUserId: z.never().optional()
1897
+ }),
1898
+ z.object({
1899
+ memberId: z.never().optional(),
1900
+ wixUserId: z.never().optional(),
1901
+ anonymousVisitorId: z.string().describe(
1902
+ "ID of a site visitor that hasn't logged in to the site."
1903
+ ).regex(
1904
+ /^[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}$/,
1905
+ "Must be a valid GUID"
1906
+ )
1907
+ }),
1908
+ z.object({
1909
+ anonymousVisitorId: z.never().optional(),
1910
+ wixUserId: z.never().optional(),
1911
+ memberId: z.string().describe("ID of a site member.").regex(
1912
+ /^[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}$/,
1913
+ "Must be a valid GUID"
1914
+ )
1915
+ }),
1916
+ z.object({
1917
+ anonymousVisitorId: z.never().optional(),
1918
+ memberId: z.never().optional(),
1919
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
1920
+ /^[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}$/,
1921
+ "Must be a valid GUID"
1922
+ )
1923
+ })
1924
+ ])
1925
+ ).describe("Pool beneficiary.").optional(),
1926
+ details: z.object({
1927
+ benefits: z.array(
1928
+ z.object({
1929
+ benefitKey: z.string().describe(
1930
+ "Unique identifier for this benefit.\n\nThis key is consistent across the pool definition and all associated pools that contain this benefit."
1931
+ ).max(64).optional(),
1932
+ itemSetId: z.string().describe(
1933
+ "ID that is used to associated items with this benefit."
1934
+ ).regex(
1935
+ /^[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}$/,
1936
+ "Must be a valid GUID"
1937
+ ).optional().nullable(),
1938
+ price: z.string().describe(
1939
+ "Price of the benefit in credits. The price is the same for all of this benefit's items."
1940
+ ).optional().nullable(),
1941
+ additionalData: z.record(z.string(), z.any()).describe(
1942
+ "Additional information for this benefit."
1943
+ ).optional().nullable(),
1944
+ providerAppId: z.string().describe(
1945
+ "ID of the app providing the benefit items."
1946
+ ).regex(
1947
+ /^[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}$/,
1948
+ "Must be a valid GUID"
1949
+ ).optional().nullable(),
1950
+ displayName: z.string().describe("Benefit name.").max(40).optional().nullable(),
1951
+ description: z.string().describe("Benefit description.").max(255).optional().nullable()
1952
+ })
1953
+ ).max(10).optional(),
1954
+ creditConfiguration: z.object({
1955
+ amount: z.string().describe(
1956
+ "Initial available amount for associated balances."
1957
+ ).optional(),
1958
+ rolloverConfiguration: z.object({
1959
+ enabled: z.boolean().describe(
1960
+ "Whether unused credits roll over to a new cycle when a program renews."
1961
+ ).optional().nullable(),
1962
+ balanceCap: z.string().describe(
1963
+ "Maximum number of credits that can roll over to the next cycle when a program renews."
1964
+ ).optional().nullable()
1965
+ }).describe("Rollover settings.").optional(),
1966
+ unitDisplayName: z.string().describe("Credit unit display name.").max(32).optional().nullable()
1967
+ }).describe(
1968
+ "Credit settings.\n\nIf this object is empty, you can't set a price for the benefit."
1969
+ ).optional(),
1970
+ additionalData: z.record(z.string(), z.any()).describe(
1971
+ "Additional information relating to this object."
1972
+ ).optional().nullable()
1973
+ }).describe("Pool benefits and settings.").optional(),
1974
+ displayName: z.string().describe(
1975
+ "Pool name.\n\nYou may want to use the same name that's used in the associated pool definition."
1976
+ ).max(64).optional(),
1977
+ namespace: z.string().describe(
1978
+ "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."
1979
+ ).min(1).max(20).optional().nullable(),
1980
+ extendedFields: z.object({
1981
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1982
+ "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)."
1983
+ ).optional()
1984
+ }).describe(
1985
+ "Custom field data for the pool object.\n\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."
1986
+ ).optional(),
1987
+ programDefinition: z.object({
1988
+ _id: z.string().describe("Program definition ID.").regex(
1989
+ /^[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}$/,
1990
+ "Must be a valid GUID"
1991
+ ).optional(),
1992
+ externalId: z.string().describe("Program definition external ID.").regex(
1993
+ /^[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}$/,
1994
+ "Must be a valid GUID"
1995
+ ).optional().nullable(),
1996
+ displayName: z.string().describe("Display name of the program definition.").max(64).optional().nullable(),
1997
+ description: z.string().describe("Description of the program definition.").max(450).optional().nullable()
1998
+ }).describe("Associated program definition information.").optional(),
1999
+ program: z.object({
2000
+ _id: z.string().describe("Program ID.").regex(
2001
+ /^[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}$/,
2002
+ "Must be a valid GUID"
2003
+ ).optional(),
2004
+ externalId: z.string().describe("Program external ID.").regex(
2005
+ /^[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}$/,
2006
+ "Must be a valid GUID"
2007
+ ).optional().nullable(),
2008
+ displayName: z.string().describe("Display name of the program.").max(64).optional().nullable()
2009
+ }).describe(
2010
+ "Information about the program containing the pool."
2011
+ ).optional(),
2012
+ poolDefinitionRevision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
2013
+ "Version of the pool definition that this pool was created from."
2014
+ ).optional().nullable(),
2015
+ renewalCount: z.number().int().describe("Number of times this pool has been renewed.").optional().nullable()
2016
+ }).describe("Pool to update."),
2017
+ fieldMask: z.array(z.string()).optional()
2018
+ })
2019
+ ).min(1).max(100).optional(),
2020
+ returnEntity: z.boolean().describe(
2021
+ "Whether to return the full pool definition entities.\n\nDefault: `false`"
2022
+ ).optional()
2023
+ }).optional()
2024
+ });
2025
+ var BulkUpdatePoolsResponse = z.object({
2026
+ results: z.array(
2027
+ z.object({
2028
+ itemMetadata: z.object({
2029
+ _id: z.string().describe(
2030
+ "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
2031
+ ).regex(
2032
+ /^[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}$/,
2033
+ "Must be a valid GUID"
2034
+ ).optional().nullable(),
2035
+ originalIndex: z.number().int().describe(
2036
+ "Index of the item within the request array. Allows for correlation between request and response items."
2037
+ ).optional(),
2038
+ success: z.boolean().describe(
2039
+ "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
2040
+ ).optional(),
2041
+ error: z.object({
2042
+ code: z.string().describe("Error code.").optional(),
2043
+ description: z.string().describe("Description of the error.").optional(),
2044
+ data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
2045
+ }).describe("Details about the error in case of failure.").optional()
2046
+ }).describe("Item metadata.").optional(),
2047
+ item: z.object({
2048
+ _id: z.string().describe("Pool ID.").regex(
2049
+ /^[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}$/,
2050
+ "Must be a valid GUID"
2051
+ ).optional().nullable(),
2052
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
2053
+ "Revision number, which increments by 1 each time the pool is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the pool.\n\nIgnored when creating a pool."
2054
+ ).optional().nullable(),
2055
+ _createdDate: z.date().describe("Date and time the pool was created.").optional().nullable(),
2056
+ _updatedDate: z.date().describe("Date and time the pool was updated.").optional().nullable(),
2057
+ poolDefinitionId: z.string().describe("ID of the associated pool definition.").regex(
2058
+ /^[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}$/,
2059
+ "Must be a valid GUID"
2060
+ ).optional().nullable(),
2061
+ programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
2062
+ /^[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}$/,
2063
+ "Must be a valid GUID"
2064
+ ).optional().nullable(),
2065
+ programId: z.string().describe("ID of the program that contains this pool.").regex(
2066
+ /^[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}$/,
2067
+ "Must be a valid GUID"
2068
+ ).optional().nullable(),
2069
+ status: z.enum([
2070
+ "ACTIVE",
2071
+ "PAUSED",
2072
+ "ENDED",
2073
+ "PROVISIONING",
2074
+ "RENEWING",
2075
+ "PENDING"
2076
+ ]).describe("Pool status.").optional(),
2077
+ beneficiary: z.intersection(
2078
+ z.object({}),
2079
+ z.xor([
2080
+ z.object({
2081
+ anonymousVisitorId: z.never().optional(),
2082
+ memberId: z.never().optional(),
2083
+ wixUserId: z.never().optional()
2084
+ }),
2085
+ z.object({
2086
+ memberId: z.never().optional(),
2087
+ wixUserId: z.never().optional(),
2088
+ anonymousVisitorId: z.string().describe(
2089
+ "ID of a site visitor that hasn't logged in to the site."
2090
+ ).regex(
2091
+ /^[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}$/,
2092
+ "Must be a valid GUID"
2093
+ )
2094
+ }),
2095
+ z.object({
2096
+ anonymousVisitorId: z.never().optional(),
2097
+ wixUserId: z.never().optional(),
2098
+ memberId: z.string().describe("ID of a site member.").regex(
2099
+ /^[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}$/,
2100
+ "Must be a valid GUID"
2101
+ )
2102
+ }),
2103
+ z.object({
2104
+ anonymousVisitorId: z.never().optional(),
2105
+ memberId: z.never().optional(),
2106
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
2107
+ /^[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}$/,
2108
+ "Must be a valid GUID"
2109
+ )
2110
+ })
2111
+ ])
2112
+ ).describe("Pool beneficiary.").optional(),
2113
+ details: z.object({
2114
+ benefits: z.array(
2115
+ z.object({
2116
+ benefitKey: z.string().describe(
2117
+ "Unique identifier for this benefit.\n\nThis key is consistent across the pool definition and all associated pools that contain this benefit."
2118
+ ).max(64).optional(),
2119
+ itemSetId: z.string().describe(
2120
+ "ID that is used to associated items with this benefit."
2121
+ ).regex(
2122
+ /^[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}$/,
2123
+ "Must be a valid GUID"
2124
+ ).optional().nullable(),
2125
+ price: z.string().describe(
2126
+ "Price of the benefit in credits. The price is the same for all of this benefit's items."
2127
+ ).optional().nullable(),
2128
+ additionalData: z.record(z.string(), z.any()).describe("Additional information for this benefit.").optional().nullable(),
2129
+ providerAppId: z.string().describe("ID of the app providing the benefit items.").regex(
2130
+ /^[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}$/,
2131
+ "Must be a valid GUID"
2132
+ ).optional().nullable(),
2133
+ displayName: z.string().describe("Benefit name.").max(40).optional().nullable(),
2134
+ description: z.string().describe("Benefit description.").max(255).optional().nullable()
2135
+ })
2136
+ ).max(10).optional(),
2137
+ creditConfiguration: z.object({
2138
+ amount: z.string().describe(
2139
+ "Initial available amount for associated balances."
2140
+ ).optional(),
2141
+ rolloverConfiguration: z.object({
2142
+ enabled: z.boolean().describe(
2143
+ "Whether unused credits roll over to a new cycle when a program renews."
2144
+ ).optional().nullable(),
2145
+ balanceCap: z.string().describe(
2146
+ "Maximum number of credits that can roll over to the next cycle when a program renews."
2147
+ ).optional().nullable()
2148
+ }).describe("Rollover settings.").optional(),
2149
+ unitDisplayName: z.string().describe("Credit unit display name.").max(32).optional().nullable()
2150
+ }).describe(
2151
+ "Credit settings.\n\nIf this object is empty, you can't set a price for the benefit."
2152
+ ).optional(),
2153
+ additionalData: z.record(z.string(), z.any()).describe("Additional information relating to this object.").optional().nullable()
2154
+ }).describe("Pool benefits and settings.").optional(),
2155
+ displayName: z.string().describe(
2156
+ "Pool name.\n\nYou may want to use the same name that's used in the associated pool definition."
2157
+ ).max(64).optional(),
2158
+ namespace: z.string().describe(
2159
+ "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."
2160
+ ).min(1).max(20).optional().nullable(),
2161
+ extendedFields: z.object({
2162
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
2163
+ "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)."
2164
+ ).optional()
2165
+ }).describe(
2166
+ "Custom field data for the pool object.\n\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."
2167
+ ).optional(),
2168
+ programDefinition: z.object({
2169
+ _id: z.string().describe("Program definition ID.").regex(
2170
+ /^[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}$/,
2171
+ "Must be a valid GUID"
2172
+ ).optional(),
2173
+ externalId: z.string().describe("Program definition external ID.").regex(
2174
+ /^[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}$/,
2175
+ "Must be a valid GUID"
2176
+ ).optional().nullable(),
2177
+ displayName: z.string().describe("Display name of the program definition.").max(64).optional().nullable(),
2178
+ description: z.string().describe("Description of the program definition.").max(450).optional().nullable()
2179
+ }).describe("Associated program definition information.").optional(),
2180
+ program: z.object({
2181
+ _id: z.string().describe("Program ID.").regex(
2182
+ /^[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}$/,
2183
+ "Must be a valid GUID"
2184
+ ).optional(),
2185
+ externalId: z.string().describe("Program external ID.").regex(
2186
+ /^[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}$/,
2187
+ "Must be a valid GUID"
2188
+ ).optional().nullable(),
2189
+ displayName: z.string().describe("Display name of the program.").max(64).optional().nullable()
2190
+ }).describe("Information about the program containing the pool.").optional(),
2191
+ poolDefinitionRevision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
2192
+ "Version of the pool definition that this pool was created from."
2193
+ ).optional().nullable(),
2194
+ renewalCount: z.number().int().describe("Number of times this pool has been renewed.").optional().nullable()
2195
+ }).describe("Pool data.").optional()
2196
+ })
2197
+ ).min(1).max(100).optional(),
2198
+ bulkActionMetadata: z.object({
2199
+ totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
2200
+ totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
2201
+ undetailedFailures: z.number().int().describe(
2202
+ "Number of failures without details because detailed failure threshold was exceeded."
2203
+ ).optional()
2204
+ }).describe("Bulk action metadata.").optional()
2205
+ });
2206
+
2207
+ // src/benefit-programs-v1-pool-pools.universal.ts
545
2208
  var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
546
2209
  var PoolStatus = /* @__PURE__ */ ((PoolStatus2) => {
547
2210
  PoolStatus2["ACTIVE"] = "ACTIVE";
@@ -634,7 +2297,10 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
634
2297
  return WebhookIdentityType2;
635
2298
  })(WebhookIdentityType || {});
636
2299
  async function getPool2(poolId) {
637
- const { httpClient, sideEffects } = arguments[1];
2300
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
2301
+ if (validateRequestSchema) {
2302
+ GetPoolRequest.parse({ poolId });
2303
+ }
638
2304
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ poolId });
639
2305
  const reqOpts = getPool(payload);
640
2306
  sideEffects?.onSiteCall?.();
@@ -657,7 +2323,10 @@ async function getPool2(poolId) {
657
2323
  }
658
2324
  }
659
2325
  async function updatePool2(_id, pool) {
660
- const { httpClient, sideEffects } = arguments[2];
2326
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
2327
+ if (validateRequestSchema) {
2328
+ UpdatePoolRequest.parse({ _id, pool });
2329
+ }
661
2330
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
662
2331
  pool: { ...pool, id: _id }
663
2332
  });
@@ -728,7 +2397,10 @@ function queryPools2(options) {
728
2397
  });
729
2398
  }
730
2399
  async function typedQueryPools(query, options) {
731
- const { httpClient, sideEffects } = arguments[2];
2400
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
2401
+ if (validateRequestSchema) {
2402
+ QueryPoolsRequest.parse({ query, options });
2403
+ }
732
2404
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
733
2405
  query,
734
2406
  ...options
@@ -759,7 +2431,10 @@ var utils = {
759
2431
  }
760
2432
  };
761
2433
  async function redeemBenefit2(poolId, options) {
762
- const { httpClient, sideEffects } = arguments[2];
2434
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
2435
+ if (validateRequestSchema) {
2436
+ RedeemBenefitRequest.parse({ poolId, options });
2437
+ }
763
2438
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
764
2439
  poolId,
765
2440
  itemReference: options?.itemReference,
@@ -802,7 +2477,10 @@ async function redeemBenefit2(poolId, options) {
802
2477
  }
803
2478
  }
804
2479
  async function checkBenefitEligibility2(poolId, options) {
805
- const { httpClient, sideEffects } = arguments[2];
2480
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
2481
+ if (validateRequestSchema) {
2482
+ CheckBenefitEligibilityRequest.parse({ poolId, options });
2483
+ }
806
2484
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
807
2485
  poolId,
808
2486
  benefitKey: options?.benefitKey,
@@ -843,7 +2521,10 @@ async function checkBenefitEligibility2(poolId, options) {
843
2521
  }
844
2522
  }
845
2523
  async function bulkCheckBenefitEligibility2(options) {
846
- const { httpClient, sideEffects } = arguments[1];
2524
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
2525
+ if (validateRequestSchema) {
2526
+ BulkCheckBenefitEligibilityRequest.parse({ options });
2527
+ }
847
2528
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
848
2529
  benefitSelectors: options?.benefitSelectors,
849
2530
  namespace: options?.namespace,
@@ -874,7 +2555,10 @@ async function bulkCheckBenefitEligibility2(options) {
874
2555
  }
875
2556
  }
876
2557
  async function getEligibleBenefits2(itemReference, options) {
877
- const { httpClient, sideEffects } = arguments[2];
2558
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
2559
+ if (validateRequestSchema) {
2560
+ GetEligibleBenefitsRequest.parse({ itemReference, options });
2561
+ }
878
2562
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
879
2563
  itemReference,
880
2564
  count: options?.count,
@@ -911,7 +2595,10 @@ async function getEligibleBenefits2(itemReference, options) {
911
2595
  }
912
2596
  }
913
2597
  async function bulkUpdatePools2(options) {
914
- const { httpClient, sideEffects } = arguments[1];
2598
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
2599
+ if (validateRequestSchema) {
2600
+ BulkUpdatePoolsRequest.parse({ options });
2601
+ }
915
2602
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
916
2603
  pools: options?.pools,
917
2604
  returnEntity: options?.returnEntity
@@ -980,79 +2667,79 @@ async function checkEligibilityByFilter2(options) {
980
2667
  }
981
2668
 
982
2669
  // src/benefit-programs-v1-pool-pools.public.ts
983
- function getPool3(httpClient) {
2670
+ function getPool3(httpClient, __options) {
984
2671
  return (poolId) => getPool2(
985
2672
  poolId,
986
2673
  // @ts-ignore
987
- { httpClient }
2674
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
988
2675
  );
989
2676
  }
990
- function updatePool3(httpClient) {
2677
+ function updatePool3(httpClient, __options) {
991
2678
  return (_id, pool) => updatePool2(
992
2679
  _id,
993
2680
  pool,
994
2681
  // @ts-ignore
995
- { httpClient }
2682
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
996
2683
  );
997
2684
  }
998
- function queryPools3(httpClient) {
2685
+ function queryPools3(httpClient, __options) {
999
2686
  return (options) => queryPools2(
1000
2687
  options,
1001
2688
  // @ts-ignore
1002
- { httpClient }
2689
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
1003
2690
  );
1004
2691
  }
1005
- function typedQueryPools2(httpClient) {
2692
+ function typedQueryPools2(httpClient, __options) {
1006
2693
  return (query, options) => typedQueryPools(
1007
2694
  query,
1008
2695
  options,
1009
2696
  // @ts-ignore
1010
- { httpClient }
2697
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
1011
2698
  );
1012
2699
  }
1013
- function redeemBenefit3(httpClient) {
2700
+ function redeemBenefit3(httpClient, __options) {
1014
2701
  return (poolId, options) => redeemBenefit2(
1015
2702
  poolId,
1016
2703
  options,
1017
2704
  // @ts-ignore
1018
- { httpClient }
2705
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
1019
2706
  );
1020
2707
  }
1021
- function checkBenefitEligibility3(httpClient) {
2708
+ function checkBenefitEligibility3(httpClient, __options) {
1022
2709
  return (poolId, options) => checkBenefitEligibility2(
1023
2710
  poolId,
1024
2711
  options,
1025
2712
  // @ts-ignore
1026
- { httpClient }
2713
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
1027
2714
  );
1028
2715
  }
1029
- function bulkCheckBenefitEligibility3(httpClient) {
2716
+ function bulkCheckBenefitEligibility3(httpClient, __options) {
1030
2717
  return (options) => bulkCheckBenefitEligibility2(
1031
2718
  options,
1032
2719
  // @ts-ignore
1033
- { httpClient }
2720
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
1034
2721
  );
1035
2722
  }
1036
- function getEligibleBenefits3(httpClient) {
2723
+ function getEligibleBenefits3(httpClient, __options) {
1037
2724
  return (itemReference, options) => getEligibleBenefits2(
1038
2725
  itemReference,
1039
2726
  options,
1040
2727
  // @ts-ignore
1041
- { httpClient }
2728
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
1042
2729
  );
1043
2730
  }
1044
- function bulkUpdatePools3(httpClient) {
2731
+ function bulkUpdatePools3(httpClient, __options) {
1045
2732
  return (options) => bulkUpdatePools2(
1046
2733
  options,
1047
2734
  // @ts-ignore
1048
- { httpClient }
2735
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
1049
2736
  );
1050
2737
  }
1051
- function checkEligibilityByFilter3(httpClient) {
2738
+ function checkEligibilityByFilter3(httpClient, __options) {
1052
2739
  return (options) => checkEligibilityByFilter2(
1053
2740
  options,
1054
2741
  // @ts-ignore
1055
- { httpClient }
2742
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
1056
2743
  );
1057
2744
  }
1058
2745