@wix/auto_sdk_benefit-programs_pools 1.0.64 → 1.0.65

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