@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.
@@ -496,1659 +496,6 @@ function checkEligibilityByFilter(payload) {
496
496
 
497
497
  // src/benefit-programs-v1-pool-pools.universal.ts
498
498
  import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
499
-
500
- // src/benefit-programs-v1-pool-pools.schemas.ts
501
- import * as z from "zod";
502
- var GetPoolRequest = z.object({
503
- poolId: z.string().describe("ID of the pool to retrieve.").regex(
504
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
505
- "Must be a valid GUID"
506
- )
507
- });
508
- var GetPoolResponse = z.object({
509
- _id: z.string().describe("Pool ID.").regex(
510
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
511
- "Must be a valid GUID"
512
- ).optional().nullable(),
513
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
514
- "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."
515
- ).optional().nullable(),
516
- _createdDate: z.date().describe("Date and time the pool was created.").optional().nullable(),
517
- _updatedDate: z.date().describe("Date and time the pool was updated.").optional().nullable(),
518
- poolDefinitionId: z.string().describe("ID of the associated pool definition.").regex(
519
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
520
- "Must be a valid GUID"
521
- ).optional().nullable(),
522
- programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
523
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
524
- "Must be a valid GUID"
525
- ).optional().nullable(),
526
- programId: z.string().describe("ID of the program that contains this pool.").regex(
527
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
528
- "Must be a valid GUID"
529
- ).optional().nullable(),
530
- status: z.enum(["ACTIVE", "PAUSED", "ENDED", "PROVISIONING", "RENEWING", "PENDING"]).describe("Pool status.").optional(),
531
- beneficiary: z.intersection(
532
- z.object({}),
533
- z.xor([
534
- z.object({
535
- anonymousVisitorId: z.never().optional(),
536
- memberId: z.never().optional(),
537
- wixUserId: z.never().optional()
538
- }),
539
- z.object({
540
- memberId: z.never().optional(),
541
- wixUserId: z.never().optional(),
542
- anonymousVisitorId: z.string().describe("ID of a site visitor that hasn't logged in to the site.").regex(
543
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
544
- "Must be a valid GUID"
545
- )
546
- }),
547
- z.object({
548
- anonymousVisitorId: z.never().optional(),
549
- wixUserId: z.never().optional(),
550
- memberId: z.string().describe("ID of a site member.").regex(
551
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
552
- "Must be a valid GUID"
553
- )
554
- }),
555
- z.object({
556
- anonymousVisitorId: z.never().optional(),
557
- memberId: z.never().optional(),
558
- wixUserId: z.string().describe("ID of a Wix user.").regex(
559
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
560
- "Must be a valid GUID"
561
- )
562
- })
563
- ])
564
- ).describe("Pool beneficiary.").optional(),
565
- details: z.object({
566
- benefits: z.array(
567
- z.object({
568
- benefitKey: z.string().describe(
569
- "Unique identifier for this benefit.\n\nThis key is consistent across the pool definition and all associated pools that contain this benefit."
570
- ).max(64).optional(),
571
- itemSetId: z.string().describe(
572
- "ID that is used to associated items with this benefit."
573
- ).regex(
574
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
575
- "Must be a valid GUID"
576
- ).optional().nullable(),
577
- price: z.string().describe(
578
- "Price of the benefit in credits. The price is the same for all of this benefit's items."
579
- ).optional().nullable(),
580
- additionalData: z.record(z.string(), z.any()).describe("Additional information for this benefit.").optional().nullable(),
581
- providerAppId: z.string().describe("ID of the app providing the benefit items.").regex(
582
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
583
- "Must be a valid GUID"
584
- ).optional().nullable(),
585
- displayName: z.string().describe("Benefit name.").max(40).optional().nullable(),
586
- description: z.string().describe("Benefit description.").max(255).optional().nullable()
587
- })
588
- ).max(10).optional(),
589
- creditConfiguration: z.object({
590
- amount: z.string().describe("Initial available amount for associated balances.").optional(),
591
- rolloverConfiguration: z.object({
592
- enabled: z.boolean().describe(
593
- "Whether unused credits roll over to a new cycle when a program renews."
594
- ).optional().nullable(),
595
- balanceCap: z.string().describe(
596
- "Maximum number of credits that can roll over to the next cycle when a program renews."
597
- ).optional().nullable()
598
- }).describe("Rollover settings.").optional(),
599
- unitDisplayName: z.string().describe("Credit unit display name.").max(32).optional().nullable()
600
- }).describe(
601
- "Credit settings.\n\nIf this object is empty, you can't set a price for the benefit."
602
- ).optional(),
603
- additionalData: z.record(z.string(), z.any()).describe("Additional information relating to this object.").optional().nullable()
604
- }).describe("Pool benefits and settings.").optional(),
605
- displayName: z.string().describe(
606
- "Pool name.\n\nYou may want to use the same name that's used in the associated pool definition."
607
- ).max(64).optional(),
608
- namespace: z.string().describe(
609
- "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."
610
- ).min(1).max(20).optional().nullable(),
611
- extendedFields: z.object({
612
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
613
- "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)."
614
- ).optional()
615
- }).describe(
616
- "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."
617
- ).optional(),
618
- programDefinition: z.object({
619
- _id: z.string().describe("Program definition ID.").regex(
620
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
621
- "Must be a valid GUID"
622
- ).optional(),
623
- externalId: z.string().describe("Program definition external ID.").regex(
624
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
625
- "Must be a valid GUID"
626
- ).optional().nullable(),
627
- displayName: z.string().describe("Display name of the program definition.").max(64).optional().nullable(),
628
- description: z.string().describe("Description of the program definition.").max(450).optional().nullable()
629
- }).describe("Associated program definition information.").optional(),
630
- program: z.object({
631
- _id: z.string().describe("Program ID.").regex(
632
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
633
- "Must be a valid GUID"
634
- ).optional(),
635
- externalId: z.string().describe("Program external ID.").regex(
636
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
637
- "Must be a valid GUID"
638
- ).optional().nullable(),
639
- displayName: z.string().describe("Display name of the program.").max(64).optional().nullable()
640
- }).describe("Information about the program containing the pool.").optional(),
641
- 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(),
642
- renewalCount: z.number().int().describe("Number of times this pool has been renewed.").optional().nullable()
643
- });
644
- var UpdatePoolRequest = z.object({
645
- _id: z.string().describe("Pool ID.").regex(
646
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
647
- "Must be a valid GUID"
648
- ),
649
- pool: z.object({
650
- _id: z.string().describe("Pool ID.").regex(
651
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
652
- "Must be a valid GUID"
653
- ).optional().nullable(),
654
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
655
- "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."
656
- ),
657
- _createdDate: z.date().describe("Date and time the pool was created.").optional().nullable(),
658
- _updatedDate: z.date().describe("Date and time the pool was updated.").optional().nullable(),
659
- poolDefinitionId: z.string().describe("ID of the associated pool definition.").regex(
660
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
661
- "Must be a valid GUID"
662
- ).optional().nullable(),
663
- programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
664
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
665
- "Must be a valid GUID"
666
- ).optional().nullable(),
667
- programId: z.string().describe("ID of the program that contains this pool.").regex(
668
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
669
- "Must be a valid GUID"
670
- ).optional().nullable(),
671
- status: z.enum([
672
- "ACTIVE",
673
- "PAUSED",
674
- "ENDED",
675
- "PROVISIONING",
676
- "RENEWING",
677
- "PENDING"
678
- ]).optional(),
679
- beneficiary: z.intersection(
680
- z.object({}),
681
- z.xor([
682
- z.object({
683
- anonymousVisitorId: z.never().optional(),
684
- memberId: z.never().optional(),
685
- wixUserId: z.never().optional()
686
- }),
687
- z.object({
688
- memberId: z.never().optional(),
689
- wixUserId: z.never().optional(),
690
- anonymousVisitorId: z.string().describe(
691
- "ID of a site visitor that hasn't logged in to the site."
692
- ).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
- )
696
- }),
697
- z.object({
698
- anonymousVisitorId: z.never().optional(),
699
- wixUserId: z.never().optional(),
700
- memberId: z.string().describe("ID of a site member.").regex(
701
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
702
- "Must be a valid GUID"
703
- )
704
- }),
705
- z.object({
706
- anonymousVisitorId: z.never().optional(),
707
- memberId: z.never().optional(),
708
- wixUserId: z.string().describe("ID of a Wix user.").regex(
709
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
710
- "Must be a valid GUID"
711
- )
712
- })
713
- ])
714
- ).describe("Pool beneficiary.").optional(),
715
- details: z.object({
716
- benefits: z.array(
717
- z.object({
718
- benefitKey: z.string().describe(
719
- "Unique identifier for this benefit.\n\nThis key is consistent across the pool definition and all associated pools that contain this benefit."
720
- ).max(64).optional(),
721
- itemSetId: z.string().describe(
722
- "ID that is used to associated items with this benefit."
723
- ).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
- price: z.string().describe(
728
- "Price of the benefit in credits. The price is the same for all of this benefit's items."
729
- ).optional().nullable(),
730
- additionalData: z.record(z.string(), z.any()).describe("Additional information for this benefit.").optional().nullable(),
731
- providerAppId: z.string().describe("ID of the app providing the benefit items.").regex(
732
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
733
- "Must be a valid GUID"
734
- ).optional().nullable(),
735
- displayName: z.string().describe("Benefit name.").max(40).optional().nullable(),
736
- description: z.string().describe("Benefit description.").max(255).optional().nullable()
737
- })
738
- ).max(10).optional(),
739
- creditConfiguration: z.object({
740
- amount: z.string().describe("Initial available amount for associated balances.").optional(),
741
- rolloverConfiguration: z.object({
742
- enabled: z.boolean().describe(
743
- "Whether unused credits roll over to a new cycle when a program renews."
744
- ).optional().nullable(),
745
- balanceCap: z.string().describe(
746
- "Maximum number of credits that can roll over to the next cycle when a program renews."
747
- ).optional().nullable()
748
- }).describe("Rollover settings.").optional(),
749
- unitDisplayName: z.string().describe("Credit unit display name.").max(32).optional().nullable()
750
- }).describe(
751
- "Credit settings.\n\nIf this object is empty, you can't set a price for the benefit."
752
- ).optional(),
753
- additionalData: z.record(z.string(), z.any()).describe("Additional information relating to this object.").optional().nullable()
754
- }).describe("Pool benefits and settings.").optional(),
755
- displayName: z.string().describe(
756
- "Pool name.\n\nYou may want to use the same name that's used in the associated pool definition."
757
- ).max(64).optional(),
758
- namespace: z.string().describe(
759
- "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."
760
- ).min(1).max(20).optional().nullable(),
761
- extendedFields: z.object({
762
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
763
- "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)."
764
- ).optional()
765
- }).describe(
766
- "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."
767
- ).optional(),
768
- programDefinition: z.object({
769
- _id: z.string().describe("Program definition ID.").regex(
770
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
771
- "Must be a valid GUID"
772
- ).optional(),
773
- externalId: z.string().describe("Program definition external ID.").regex(
774
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
775
- "Must be a valid GUID"
776
- ).optional().nullable(),
777
- displayName: z.string().describe("Display name of the program definition.").max(64).optional().nullable(),
778
- description: z.string().describe("Description of the program definition.").max(450).optional().nullable()
779
- }).describe("Associated program definition information.").optional(),
780
- program: z.object({
781
- _id: z.string().describe("Program ID.").regex(
782
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
783
- "Must be a valid GUID"
784
- ).optional(),
785
- externalId: z.string().describe("Program external ID.").regex(
786
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
787
- "Must be a valid GUID"
788
- ).optional().nullable(),
789
- displayName: z.string().describe("Display name of the program.").max(64).optional().nullable()
790
- }).describe("Information about the program containing the pool.").optional(),
791
- poolDefinitionRevision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
792
- "Version of the pool definition that this pool was created from."
793
- ).optional().nullable(),
794
- renewalCount: z.number().int().describe("Number of times this pool has been renewed.").optional().nullable()
795
- }).describe("Pool to update.")
796
- });
797
- var UpdatePoolResponse = z.object({
798
- _id: z.string().describe("Pool ID.").regex(
799
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
800
- "Must be a valid GUID"
801
- ).optional().nullable(),
802
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
803
- "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."
804
- ).optional().nullable(),
805
- _createdDate: z.date().describe("Date and time the pool was created.").optional().nullable(),
806
- _updatedDate: z.date().describe("Date and time the pool was updated.").optional().nullable(),
807
- poolDefinitionId: z.string().describe("ID of the associated pool definition.").regex(
808
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
809
- "Must be a valid GUID"
810
- ).optional().nullable(),
811
- programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
812
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
813
- "Must be a valid GUID"
814
- ).optional().nullable(),
815
- programId: z.string().describe("ID of the program that contains this pool.").regex(
816
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
817
- "Must be a valid GUID"
818
- ).optional().nullable(),
819
- status: z.enum(["ACTIVE", "PAUSED", "ENDED", "PROVISIONING", "RENEWING", "PENDING"]).describe("Pool status.").optional(),
820
- beneficiary: z.intersection(
821
- z.object({}),
822
- z.xor([
823
- z.object({
824
- anonymousVisitorId: z.never().optional(),
825
- memberId: z.never().optional(),
826
- wixUserId: z.never().optional()
827
- }),
828
- z.object({
829
- memberId: z.never().optional(),
830
- wixUserId: z.never().optional(),
831
- anonymousVisitorId: z.string().describe("ID of a site visitor that hasn't logged in to the site.").regex(
832
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
833
- "Must be a valid GUID"
834
- )
835
- }),
836
- z.object({
837
- anonymousVisitorId: z.never().optional(),
838
- wixUserId: z.never().optional(),
839
- memberId: z.string().describe("ID of a site member.").regex(
840
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
841
- "Must be a valid GUID"
842
- )
843
- }),
844
- z.object({
845
- anonymousVisitorId: z.never().optional(),
846
- memberId: z.never().optional(),
847
- wixUserId: z.string().describe("ID of a Wix user.").regex(
848
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
849
- "Must be a valid GUID"
850
- )
851
- })
852
- ])
853
- ).describe("Pool beneficiary.").optional(),
854
- details: z.object({
855
- benefits: z.array(
856
- z.object({
857
- benefitKey: z.string().describe(
858
- "Unique identifier for this benefit.\n\nThis key is consistent across the pool definition and all associated pools that contain this benefit."
859
- ).max(64).optional(),
860
- itemSetId: z.string().describe(
861
- "ID that is used to associated items with this benefit."
862
- ).regex(
863
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
864
- "Must be a valid GUID"
865
- ).optional().nullable(),
866
- price: z.string().describe(
867
- "Price of the benefit in credits. The price is the same for all of this benefit's items."
868
- ).optional().nullable(),
869
- additionalData: z.record(z.string(), z.any()).describe("Additional information for this benefit.").optional().nullable(),
870
- providerAppId: z.string().describe("ID of the app providing the benefit items.").regex(
871
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
872
- "Must be a valid GUID"
873
- ).optional().nullable(),
874
- displayName: z.string().describe("Benefit name.").max(40).optional().nullable(),
875
- description: z.string().describe("Benefit description.").max(255).optional().nullable()
876
- })
877
- ).max(10).optional(),
878
- creditConfiguration: z.object({
879
- amount: z.string().describe("Initial available amount for associated balances.").optional(),
880
- rolloverConfiguration: z.object({
881
- enabled: z.boolean().describe(
882
- "Whether unused credits roll over to a new cycle when a program renews."
883
- ).optional().nullable(),
884
- balanceCap: z.string().describe(
885
- "Maximum number of credits that can roll over to the next cycle when a program renews."
886
- ).optional().nullable()
887
- }).describe("Rollover settings.").optional(),
888
- unitDisplayName: z.string().describe("Credit unit display name.").max(32).optional().nullable()
889
- }).describe(
890
- "Credit settings.\n\nIf this object is empty, you can't set a price for the benefit."
891
- ).optional(),
892
- additionalData: z.record(z.string(), z.any()).describe("Additional information relating to this object.").optional().nullable()
893
- }).describe("Pool benefits and settings.").optional(),
894
- displayName: z.string().describe(
895
- "Pool name.\n\nYou may want to use the same name that's used in the associated pool definition."
896
- ).max(64).optional(),
897
- namespace: z.string().describe(
898
- "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."
899
- ).min(1).max(20).optional().nullable(),
900
- extendedFields: z.object({
901
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
902
- "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)."
903
- ).optional()
904
- }).describe(
905
- "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."
906
- ).optional(),
907
- programDefinition: z.object({
908
- _id: z.string().describe("Program definition ID.").regex(
909
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
910
- "Must be a valid GUID"
911
- ).optional(),
912
- externalId: z.string().describe("Program definition external ID.").regex(
913
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
914
- "Must be a valid GUID"
915
- ).optional().nullable(),
916
- displayName: z.string().describe("Display name of the program definition.").max(64).optional().nullable(),
917
- description: z.string().describe("Description of the program definition.").max(450).optional().nullable()
918
- }).describe("Associated program definition information.").optional(),
919
- program: z.object({
920
- _id: z.string().describe("Program ID.").regex(
921
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
922
- "Must be a valid GUID"
923
- ).optional(),
924
- externalId: z.string().describe("Program external ID.").regex(
925
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
926
- "Must be a valid GUID"
927
- ).optional().nullable(),
928
- displayName: z.string().describe("Display name of the program.").max(64).optional().nullable()
929
- }).describe("Information about the program containing the pool.").optional(),
930
- 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(),
931
- renewalCount: z.number().int().describe("Number of times this pool has been renewed.").optional().nullable()
932
- });
933
- var QueryPoolsRequest = z.object({
934
- query: z.intersection(
935
- z.object({
936
- filter: z.record(z.string(), z.any()).describe(
937
- "Filter object.\nSee [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)\nfor more information."
938
- ).optional().nullable(),
939
- sort: z.array(
940
- z.object({
941
- fieldName: z.string().describe("Field to sort by.").max(512).optional(),
942
- order: z.enum(["ASC", "DESC"]).optional()
943
- })
944
- ).max(5).optional()
945
- }),
946
- z.xor([
947
- z.object({ cursorPaging: z.never().optional() }),
948
- z.object({
949
- cursorPaging: z.object({
950
- limit: z.number().int().describe("Maximum number of items to return.").min(0).max(100).optional().nullable(),
951
- cursor: z.string().describe(
952
- "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."
953
- ).max(16e3).optional().nullable()
954
- }).describe(
955
- "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`."
956
- )
957
- })
958
- ])
959
- ).describe("Filter, sort, and paging to apply to the query.")
960
- });
961
- var QueryPoolsResponse = z.object({
962
- pools: z.array(
963
- z.object({
964
- _id: z.string().describe("Pool 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().nullable(),
968
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
969
- "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."
970
- ).optional().nullable(),
971
- _createdDate: z.date().describe("Date and time the pool was created.").optional().nullable(),
972
- _updatedDate: z.date().describe("Date and time the pool was updated.").optional().nullable(),
973
- poolDefinitionId: z.string().describe("ID of the associated pool definition.").regex(
974
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
975
- "Must be a valid GUID"
976
- ).optional().nullable(),
977
- programDefinitionId: z.string().describe("ID of the associated program definition.").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().nullable(),
981
- programId: z.string().describe("ID of the program that contains this pool.").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
- status: z.enum([
986
- "ACTIVE",
987
- "PAUSED",
988
- "ENDED",
989
- "PROVISIONING",
990
- "RENEWING",
991
- "PENDING"
992
- ]).describe("Pool status.").optional(),
993
- beneficiary: z.intersection(
994
- z.object({}),
995
- z.xor([
996
- z.object({
997
- anonymousVisitorId: z.never().optional(),
998
- memberId: z.never().optional(),
999
- wixUserId: z.never().optional()
1000
- }),
1001
- z.object({
1002
- memberId: z.never().optional(),
1003
- wixUserId: z.never().optional(),
1004
- anonymousVisitorId: z.string().describe(
1005
- "ID of a site visitor that hasn't logged in to the site."
1006
- ).regex(
1007
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1008
- "Must be a valid GUID"
1009
- )
1010
- }),
1011
- z.object({
1012
- anonymousVisitorId: z.never().optional(),
1013
- wixUserId: z.never().optional(),
1014
- memberId: z.string().describe("ID of a site member.").regex(
1015
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1016
- "Must be a valid GUID"
1017
- )
1018
- }),
1019
- z.object({
1020
- anonymousVisitorId: z.never().optional(),
1021
- memberId: z.never().optional(),
1022
- wixUserId: z.string().describe("ID of a Wix user.").regex(
1023
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1024
- "Must be a valid GUID"
1025
- )
1026
- })
1027
- ])
1028
- ).describe("Pool beneficiary.").optional(),
1029
- details: z.object({
1030
- benefits: z.array(
1031
- z.object({
1032
- benefitKey: z.string().describe(
1033
- "Unique identifier for this benefit.\n\nThis key is consistent across the pool definition and all associated pools that contain this benefit."
1034
- ).max(64).optional(),
1035
- itemSetId: z.string().describe(
1036
- "ID that is used to associated items with this benefit."
1037
- ).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
- price: z.string().describe(
1042
- "Price of the benefit in credits. The price is the same for all of this benefit's items."
1043
- ).optional().nullable(),
1044
- additionalData: z.record(z.string(), z.any()).describe("Additional information for this benefit.").optional().nullable(),
1045
- providerAppId: z.string().describe("ID of the app providing the benefit items.").regex(
1046
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1047
- "Must be a valid GUID"
1048
- ).optional().nullable(),
1049
- displayName: z.string().describe("Benefit name.").max(40).optional().nullable(),
1050
- description: z.string().describe("Benefit description.").max(255).optional().nullable()
1051
- })
1052
- ).max(10).optional(),
1053
- creditConfiguration: z.object({
1054
- amount: z.string().describe("Initial available amount for associated balances.").optional(),
1055
- rolloverConfiguration: z.object({
1056
- enabled: z.boolean().describe(
1057
- "Whether unused credits roll over to a new cycle when a program renews."
1058
- ).optional().nullable(),
1059
- balanceCap: z.string().describe(
1060
- "Maximum number of credits that can roll over to the next cycle when a program renews."
1061
- ).optional().nullable()
1062
- }).describe("Rollover settings.").optional(),
1063
- unitDisplayName: z.string().describe("Credit unit display name.").max(32).optional().nullable()
1064
- }).describe(
1065
- "Credit settings.\n\nIf this object is empty, you can't set a price for the benefit."
1066
- ).optional(),
1067
- additionalData: z.record(z.string(), z.any()).describe("Additional information relating to this object.").optional().nullable()
1068
- }).describe("Pool benefits and settings.").optional(),
1069
- displayName: z.string().describe(
1070
- "Pool name.\n\nYou may want to use the same name that's used in the associated pool definition."
1071
- ).max(64).optional(),
1072
- namespace: z.string().describe(
1073
- "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."
1074
- ).min(1).max(20).optional().nullable(),
1075
- extendedFields: z.object({
1076
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1077
- "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)."
1078
- ).optional()
1079
- }).describe(
1080
- "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."
1081
- ).optional(),
1082
- programDefinition: z.object({
1083
- _id: z.string().describe("Program definition ID.").regex(
1084
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1085
- "Must be a valid GUID"
1086
- ).optional(),
1087
- externalId: z.string().describe("Program definition external ID.").regex(
1088
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1089
- "Must be a valid GUID"
1090
- ).optional().nullable(),
1091
- displayName: z.string().describe("Display name of the program definition.").max(64).optional().nullable(),
1092
- description: z.string().describe("Description of the program definition.").max(450).optional().nullable()
1093
- }).describe("Associated program definition information.").optional(),
1094
- program: z.object({
1095
- _id: z.string().describe("Program ID.").regex(
1096
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1097
- "Must be a valid GUID"
1098
- ).optional(),
1099
- externalId: z.string().describe("Program external ID.").regex(
1100
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1101
- "Must be a valid GUID"
1102
- ).optional().nullable(),
1103
- displayName: z.string().describe("Display name of the program.").max(64).optional().nullable()
1104
- }).describe("Information about the program containing the pool.").optional(),
1105
- poolDefinitionRevision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1106
- "Version of the pool definition that this pool was created from."
1107
- ).optional().nullable(),
1108
- renewalCount: z.number().int().describe("Number of times this pool has been renewed.").optional().nullable()
1109
- })
1110
- ).optional(),
1111
- metadata: z.object({
1112
- count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
1113
- cursors: z.object({
1114
- next: z.string().describe(
1115
- "Cursor string pointing to the next page in the list of results."
1116
- ).max(16e3).optional().nullable(),
1117
- prev: z.string().describe(
1118
- "Cursor pointing to the previous page in the list of results."
1119
- ).max(16e3).optional().nullable()
1120
- }).describe(
1121
- "Cursor strings that point to the next page, previous page, or both."
1122
- ).optional(),
1123
- hasNext: z.boolean().describe(
1124
- "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."
1125
- ).optional().nullable()
1126
- }).describe("Metadata for the paginated results.").optional()
1127
- });
1128
- var RedeemBenefitRequest = z.object({
1129
- poolId: z.string().describe("ID of the pool that contains the benefit to redeem.").regex(
1130
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1131
- "Must be a valid GUID"
1132
- ),
1133
- options: z.object({
1134
- itemReference: z.object({
1135
- externalId: z.string().describe("External ID of the item.").regex(
1136
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1137
- "Must be a valid GUID"
1138
- ),
1139
- category: z.string().describe("Item category.").max(20).optional(),
1140
- providerAppId: z.string().describe("ID of the app providing the item.").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
- )
1144
- }).describe("Information about the item to redeem."),
1145
- benefitKey: z.string().describe("Key of the benefit to redeem.").max(64),
1146
- count: z.number().int().describe("Amount of items to redeem.").min(1).optional(),
1147
- targetDate: z.date().describe(
1148
- "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."
1149
- ).optional().nullable(),
1150
- idempotencyKey: z.string().describe(
1151
- "Unique identifier, generated by the client.\nUsed to recognize repeated attempts to make the same request."
1152
- ).max(200),
1153
- additionalData: z.record(z.string(), z.any()).describe("Additional information.").optional().nullable(),
1154
- beneficiary: z.intersection(
1155
- z.object({}),
1156
- z.xor([
1157
- z.object({
1158
- anonymousVisitorId: z.never().optional(),
1159
- memberId: z.never().optional(),
1160
- wixUserId: z.never().optional()
1161
- }),
1162
- z.object({
1163
- memberId: z.never().optional(),
1164
- wixUserId: z.never().optional(),
1165
- anonymousVisitorId: z.string().describe(
1166
- "ID of a site visitor that hasn't logged in to the site."
1167
- ).regex(
1168
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1169
- "Must be a valid GUID"
1170
- )
1171
- }),
1172
- z.object({
1173
- anonymousVisitorId: z.never().optional(),
1174
- wixUserId: z.never().optional(),
1175
- memberId: z.string().describe("ID of a site member.").regex(
1176
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1177
- "Must be a valid GUID"
1178
- )
1179
- }),
1180
- z.object({
1181
- anonymousVisitorId: z.never().optional(),
1182
- memberId: z.never().optional(),
1183
- wixUserId: z.string().describe("ID of a Wix user.").regex(
1184
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1185
- "Must be a valid GUID"
1186
- )
1187
- })
1188
- ])
1189
- ).describe("Beneficiary of the pool containing the benefit to redeem.").optional(),
1190
- namespace: z.string().describe(
1191
- "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."
1192
- ).min(1).max(20)
1193
- })
1194
- });
1195
- var RedeemBenefitResponse = z.object({
1196
- transactionId: z.string().describe(
1197
- "ID of the transaction recording the associated change in balance."
1198
- ).regex(
1199
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1200
- "Must be a valid GUID"
1201
- ).optional()
1202
- });
1203
- var CheckBenefitEligibilityRequest = z.object({
1204
- poolId: z.string().describe("ID of the pool that the benefit to check belongs to.").regex(
1205
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1206
- "Must be a valid GUID"
1207
- ),
1208
- options: z.object({
1209
- benefitKey: z.string().describe("Key of the benefit to check.").max(64).optional().nullable(),
1210
- itemReference: z.object({
1211
- externalId: z.string().describe("External ID of the item.").regex(
1212
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1213
- "Must be a valid GUID"
1214
- ),
1215
- category: z.string().describe("Item category.").max(20).optional(),
1216
- providerAppId: z.string().describe("ID of the app providing the item.").regex(
1217
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1218
- "Must be a valid GUID"
1219
- )
1220
- }).describe("Information about the item to check."),
1221
- count: z.number().int().describe(
1222
- "Amount of items to check.\n\nEnsures the balance is high enough to redeem this many items."
1223
- ).min(1).optional(),
1224
- targetDate: z.date().describe(
1225
- "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."
1226
- ).optional().nullable(),
1227
- additionalData: z.record(z.string(), z.any()).describe("Additional information.").optional().nullable(),
1228
- beneficiary: z.intersection(
1229
- z.object({}),
1230
- z.xor([
1231
- z.object({
1232
- anonymousVisitorId: z.never().optional(),
1233
- memberId: z.never().optional(),
1234
- wixUserId: z.never().optional()
1235
- }),
1236
- z.object({
1237
- memberId: z.never().optional(),
1238
- wixUserId: z.never().optional(),
1239
- anonymousVisitorId: z.string().describe(
1240
- "ID of a site visitor that hasn't logged in to the site."
1241
- ).regex(
1242
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1243
- "Must be a valid GUID"
1244
- )
1245
- }),
1246
- z.object({
1247
- anonymousVisitorId: z.never().optional(),
1248
- wixUserId: z.never().optional(),
1249
- memberId: z.string().describe("ID of a site member.").regex(
1250
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1251
- "Must be a valid GUID"
1252
- )
1253
- }),
1254
- z.object({
1255
- anonymousVisitorId: z.never().optional(),
1256
- memberId: z.never().optional(),
1257
- wixUserId: z.string().describe("ID of a Wix user.").regex(
1258
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1259
- "Must be a valid GUID"
1260
- )
1261
- })
1262
- ])
1263
- ).describe("Beneficiary of the pool containing the benefit to check.").optional(),
1264
- namespace: z.string().describe(
1265
- "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."
1266
- ).min(1).max(20)
1267
- })
1268
- });
1269
- var CheckBenefitEligibilityResponse = z.object({
1270
- result: z.object({
1271
- benefitResults: z.array(
1272
- z.intersection(
1273
- z.object({
1274
- type: z.enum([
1275
- "ELIGIBLE_BENEFIT",
1276
- "NOT_ENOUGH_BALANCE",
1277
- "POOL_NOT_ACTIVE",
1278
- "BENEFIT_NOT_FOUND",
1279
- "POOL_NOT_FOUND"
1280
- ]).describe("Eligibility status.").optional()
1281
- }),
1282
- z.xor([
1283
- z.object({
1284
- eligibleBenefitOptions: z.never().optional(),
1285
- notEnoughBalanceOptions: z.never().optional(),
1286
- policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1287
- poolNotActiveOptions: z.never().optional(),
1288
- benefitNotFoundOptions: z.never().optional(),
1289
- poolNotFoundOptions: z.never().optional()
1290
- }),
1291
- z.object({
1292
- notEnoughBalanceOptions: z.never().optional(),
1293
- policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1294
- poolNotActiveOptions: z.never().optional(),
1295
- benefitNotFoundOptions: z.never().optional(),
1296
- poolNotFoundOptions: z.never().optional(),
1297
- eligibleBenefitOptions: z.object({
1298
- poolId: z.string().describe("Pool ID.").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
- ).optional(),
1302
- benefitKey: z.string().describe("Benefit key.").max(64).optional(),
1303
- itemReference: z.object({
1304
- externalId: z.string().describe("External ID of the item.").regex(
1305
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1306
- "Must be a valid GUID"
1307
- ).optional(),
1308
- category: z.string().describe("Item category.").max(20).optional(),
1309
- providerAppId: z.string().describe("ID of the app providing the item.").regex(
1310
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1311
- "Must be a valid GUID"
1312
- ).optional()
1313
- }).describe("Item reference.").optional(),
1314
- price: z.string().describe("Price of the benefit in credits.").optional().nullable()
1315
- }).describe("Returned when item is eligible to be redeemed.")
1316
- }),
1317
- z.object({
1318
- eligibleBenefitOptions: z.never().optional(),
1319
- policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1320
- poolNotActiveOptions: z.never().optional(),
1321
- benefitNotFoundOptions: z.never().optional(),
1322
- poolNotFoundOptions: z.never().optional(),
1323
- notEnoughBalanceOptions: z.object({
1324
- poolId: z.string().describe("Pool ID.").regex(
1325
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1326
- "Must be a valid GUID"
1327
- ).optional(),
1328
- itemReference: z.object({
1329
- externalId: z.string().describe("External ID of the item.").regex(
1330
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1331
- "Must be a valid GUID"
1332
- ).optional(),
1333
- category: z.string().describe("Item category.").max(20).optional(),
1334
- providerAppId: z.string().describe("ID of the app providing the item.").regex(
1335
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1336
- "Must be a valid GUID"
1337
- ).optional()
1338
- }).describe("Item reference.").optional(),
1339
- availableBalance: z.string().describe("Pool's associated balance amount in credits.").optional(),
1340
- requestedBalance: z.string().describe("Price of the item in credits.").optional()
1341
- }).describe(
1342
- "Returned when the pool's associated balance is lower than the cost of redeeming the items."
1343
- )
1344
- }),
1345
- z.object({
1346
- eligibleBenefitOptions: z.never().optional(),
1347
- notEnoughBalanceOptions: z.never().optional(),
1348
- poolNotActiveOptions: z.never().optional(),
1349
- benefitNotFoundOptions: z.never().optional(),
1350
- poolNotFoundOptions: z.never().optional(),
1351
- policyExpressionEvaluatedToFalseOptions: z.object({
1352
- poolId: z.string().describe("Pool ID.").regex(
1353
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1354
- "Must be a valid GUID"
1355
- ).optional(),
1356
- itemReference: z.object({
1357
- externalId: z.string().describe("External ID of the item.").regex(
1358
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1359
- "Must be a valid GUID"
1360
- ).optional(),
1361
- category: z.string().describe("Item category.").max(20).optional(),
1362
- providerAppId: z.string().describe("ID of the app providing the item.").regex(
1363
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1364
- "Must be a valid GUID"
1365
- ).optional()
1366
- }).describe("Item reference.").optional(),
1367
- failureDetails: z.array(
1368
- z.object({
1369
- code: z.string().describe("Failure code").min(1).max(64).optional(),
1370
- message: z.string().describe("Failure message").max(256).optional().nullable(),
1371
- policyId: z.string().describe("Policy id").regex(
1372
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1373
- "Must be a valid GUID"
1374
- ).optional().nullable(),
1375
- appId: z.string().describe("App that owns the policy").regex(
1376
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1377
- "Must be a valid GUID"
1378
- ).optional().nullable(),
1379
- errorData: z.record(z.string(), z.any()).describe("Information provided by the policy").optional().nullable()
1380
- })
1381
- ).max(10).optional()
1382
- }).describe("Returned when the policy is false.")
1383
- }),
1384
- z.object({
1385
- eligibleBenefitOptions: z.never().optional(),
1386
- notEnoughBalanceOptions: z.never().optional(),
1387
- policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1388
- benefitNotFoundOptions: z.never().optional(),
1389
- poolNotFoundOptions: z.never().optional(),
1390
- poolNotActiveOptions: z.object({
1391
- poolId: z.string().describe("Pool ID.").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
- poolStatus: z.enum([
1396
- "ACTIVE",
1397
- "PAUSED",
1398
- "ENDED",
1399
- "PROVISIONING",
1400
- "RENEWING",
1401
- "PENDING"
1402
- ]).describe("Pool status.").optional()
1403
- }).describe("Returned when the pool isn't active.")
1404
- }),
1405
- z.object({
1406
- eligibleBenefitOptions: z.never().optional(),
1407
- notEnoughBalanceOptions: z.never().optional(),
1408
- policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1409
- poolNotActiveOptions: z.never().optional(),
1410
- poolNotFoundOptions: z.never().optional(),
1411
- benefitNotFoundOptions: z.object({
1412
- poolId: z.string().describe("Pool ID.").regex(
1413
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1414
- "Must be a valid GUID"
1415
- ).optional(),
1416
- benefitKey: z.string().describe("Specified benefit key.").max(64).optional().nullable()
1417
- }).describe(
1418
- "Returned when invalid benefit details are provided."
1419
- )
1420
- }),
1421
- z.object({
1422
- eligibleBenefitOptions: z.never().optional(),
1423
- notEnoughBalanceOptions: z.never().optional(),
1424
- policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1425
- poolNotActiveOptions: z.never().optional(),
1426
- benefitNotFoundOptions: z.never().optional(),
1427
- poolNotFoundOptions: z.object({
1428
- poolId: z.string().describe("Pool 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()
1432
- }).describe("Returned when invalid pool details are provided.")
1433
- })
1434
- ])
1435
- )
1436
- ).max(10).optional()
1437
- }).describe("Result of the eligibility check.").optional()
1438
- });
1439
- var BulkCheckBenefitEligibilityRequest = z.object({
1440
- options: z.object({
1441
- benefitSelectors: z.array(
1442
- z.object({
1443
- poolId: z.string().describe("ID of the pool that the benefit to check belongs to.").regex(
1444
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1445
- "Must be a valid GUID"
1446
- ),
1447
- benefitKey: z.string().describe("Key of the benefit to check.").max(64).optional().nullable(),
1448
- itemReference: z.object({
1449
- externalId: z.string().describe("External ID of the item.").regex(
1450
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1451
- "Must be a valid GUID"
1452
- ),
1453
- category: z.string().describe("Item category.").max(20).optional(),
1454
- providerAppId: z.string().describe("ID of the app providing the item.").regex(
1455
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1456
- "Must be a valid GUID"
1457
- )
1458
- }).describe("Information about the item to check."),
1459
- count: z.number().int().describe(
1460
- "Amount of items to check.\n\nEnsures the balance is high enough to redeem this many items."
1461
- ).min(1).optional(),
1462
- targetDate: z.date().describe(
1463
- "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."
1464
- ).optional().nullable(),
1465
- additionalData: z.record(z.string(), z.any()).describe("Additional information.").optional().nullable()
1466
- })
1467
- ).min(1).max(100).optional(),
1468
- namespace: z.string().describe(
1469
- "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."
1470
- ).min(1).max(20),
1471
- beneficiary: z.intersection(
1472
- z.object({}),
1473
- z.xor([
1474
- z.object({
1475
- anonymousVisitorId: z.never().optional(),
1476
- memberId: z.never().optional(),
1477
- wixUserId: z.never().optional()
1478
- }),
1479
- z.object({
1480
- memberId: z.never().optional(),
1481
- wixUserId: z.never().optional(),
1482
- anonymousVisitorId: z.string().describe(
1483
- "ID of a site visitor that hasn't logged in to the site."
1484
- ).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
- )
1488
- }),
1489
- z.object({
1490
- anonymousVisitorId: z.never().optional(),
1491
- wixUserId: z.never().optional(),
1492
- memberId: z.string().describe("ID of a site member.").regex(
1493
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1494
- "Must be a valid GUID"
1495
- )
1496
- }),
1497
- z.object({
1498
- anonymousVisitorId: z.never().optional(),
1499
- memberId: z.never().optional(),
1500
- wixUserId: z.string().describe("ID of a Wix user.").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
- })
1505
- ])
1506
- ).describe("Pool beneficiary.").optional()
1507
- })
1508
- });
1509
- var BulkCheckBenefitEligibilityResponse = z.object({
1510
- results: z.array(
1511
- z.object({
1512
- benefitSelector: z.object({
1513
- poolId: z.string().describe("ID of the pool that the benefit to check belongs to.").regex(
1514
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1515
- "Must be a valid GUID"
1516
- ).optional(),
1517
- benefitKey: z.string().describe("Key of the benefit to check.").max(64).optional().nullable(),
1518
- itemReference: z.object({
1519
- externalId: z.string().describe("External ID of the item.").regex(
1520
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1521
- "Must be a valid GUID"
1522
- ).optional(),
1523
- category: z.string().describe("Item category.").max(20).optional(),
1524
- providerAppId: z.string().describe("ID of the app providing the item.").regex(
1525
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1526
- "Must be a valid GUID"
1527
- ).optional()
1528
- }).describe("Information about the item to check.").optional(),
1529
- count: z.number().int().describe(
1530
- "Amount of items to check.\n\nEnsures the balance is high enough to redeem this many items."
1531
- ).min(1).optional(),
1532
- targetDate: z.date().describe(
1533
- "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."
1534
- ).optional().nullable(),
1535
- additionalData: z.record(z.string(), z.any()).describe("Additional information.").optional().nullable()
1536
- }).describe("Benefit information specified in API call.").optional(),
1537
- result: z.object({
1538
- benefitResults: z.array(
1539
- z.intersection(
1540
- z.object({
1541
- type: z.enum([
1542
- "ELIGIBLE_BENEFIT",
1543
- "NOT_ENOUGH_BALANCE",
1544
- "POOL_NOT_ACTIVE",
1545
- "BENEFIT_NOT_FOUND",
1546
- "POOL_NOT_FOUND"
1547
- ]).describe("Eligibility status.").optional()
1548
- }),
1549
- z.xor([
1550
- z.object({
1551
- eligibleBenefitOptions: z.never().optional(),
1552
- notEnoughBalanceOptions: z.never().optional(),
1553
- policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1554
- poolNotActiveOptions: z.never().optional(),
1555
- benefitNotFoundOptions: z.never().optional(),
1556
- poolNotFoundOptions: z.never().optional()
1557
- }),
1558
- z.object({
1559
- notEnoughBalanceOptions: z.never().optional(),
1560
- policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1561
- poolNotActiveOptions: z.never().optional(),
1562
- benefitNotFoundOptions: z.never().optional(),
1563
- poolNotFoundOptions: z.never().optional(),
1564
- eligibleBenefitOptions: z.object({
1565
- poolId: z.string().describe("Pool ID.").regex(
1566
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1567
- "Must be a valid GUID"
1568
- ).optional(),
1569
- benefitKey: z.string().describe("Benefit key.").max(64).optional(),
1570
- itemReference: z.object({
1571
- externalId: z.string().describe("External ID of the item.").regex(
1572
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1573
- "Must be a valid GUID"
1574
- ).optional(),
1575
- category: z.string().describe("Item category.").max(20).optional(),
1576
- providerAppId: z.string().describe("ID of the app providing 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
- }).describe("Item reference.").optional(),
1581
- price: z.string().describe("Price of the benefit in credits.").optional().nullable()
1582
- }).describe(
1583
- "Returned when item is eligible to be redeemed."
1584
- )
1585
- }),
1586
- z.object({
1587
- eligibleBenefitOptions: z.never().optional(),
1588
- policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1589
- poolNotActiveOptions: z.never().optional(),
1590
- benefitNotFoundOptions: z.never().optional(),
1591
- poolNotFoundOptions: z.never().optional(),
1592
- notEnoughBalanceOptions: z.object({
1593
- poolId: z.string().describe("Pool ID.").regex(
1594
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1595
- "Must be a valid GUID"
1596
- ).optional(),
1597
- itemReference: z.object({
1598
- externalId: z.string().describe("External ID of the item.").regex(
1599
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1600
- "Must be a valid GUID"
1601
- ).optional(),
1602
- category: z.string().describe("Item category.").max(20).optional(),
1603
- providerAppId: z.string().describe("ID of the app providing the item.").regex(
1604
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1605
- "Must be a valid GUID"
1606
- ).optional()
1607
- }).describe("Item reference.").optional(),
1608
- availableBalance: z.string().describe(
1609
- "Pool's associated balance amount in credits."
1610
- ).optional(),
1611
- requestedBalance: z.string().describe("Price of the item in credits.").optional()
1612
- }).describe(
1613
- "Returned when the pool's associated balance is lower than the cost of redeeming the items."
1614
- )
1615
- }),
1616
- z.object({
1617
- eligibleBenefitOptions: z.never().optional(),
1618
- notEnoughBalanceOptions: z.never().optional(),
1619
- poolNotActiveOptions: z.never().optional(),
1620
- benefitNotFoundOptions: z.never().optional(),
1621
- poolNotFoundOptions: z.never().optional(),
1622
- policyExpressionEvaluatedToFalseOptions: z.object({
1623
- poolId: z.string().describe("Pool ID.").regex(
1624
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1625
- "Must be a valid GUID"
1626
- ).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
- failureDetails: z.array(
1639
- z.object({
1640
- code: z.string().describe("Failure code").min(1).max(64).optional(),
1641
- message: z.string().describe("Failure message").max(256).optional().nullable(),
1642
- policyId: z.string().describe("Policy id").regex(
1643
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1644
- "Must be a valid GUID"
1645
- ).optional().nullable(),
1646
- appId: z.string().describe("App that owns the policy").regex(
1647
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1648
- "Must be a valid GUID"
1649
- ).optional().nullable(),
1650
- errorData: z.record(z.string(), z.any()).describe(
1651
- "Information provided by the policy"
1652
- ).optional().nullable()
1653
- })
1654
- ).max(10).optional()
1655
- }).describe("Returned when the policy is false.")
1656
- }),
1657
- z.object({
1658
- eligibleBenefitOptions: z.never().optional(),
1659
- notEnoughBalanceOptions: z.never().optional(),
1660
- policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1661
- benefitNotFoundOptions: z.never().optional(),
1662
- poolNotFoundOptions: z.never().optional(),
1663
- poolNotActiveOptions: z.object({
1664
- poolId: z.string().describe("Pool ID.").regex(
1665
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1666
- "Must be a valid GUID"
1667
- ).optional(),
1668
- poolStatus: z.enum([
1669
- "ACTIVE",
1670
- "PAUSED",
1671
- "ENDED",
1672
- "PROVISIONING",
1673
- "RENEWING",
1674
- "PENDING"
1675
- ]).describe("Pool status.").optional()
1676
- }).describe("Returned when the pool isn't active.")
1677
- }),
1678
- z.object({
1679
- eligibleBenefitOptions: z.never().optional(),
1680
- notEnoughBalanceOptions: z.never().optional(),
1681
- policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1682
- poolNotActiveOptions: z.never().optional(),
1683
- poolNotFoundOptions: z.never().optional(),
1684
- benefitNotFoundOptions: z.object({
1685
- poolId: z.string().describe("Pool ID.").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
- benefitKey: z.string().describe("Specified benefit key.").max(64).optional().nullable()
1690
- }).describe(
1691
- "Returned when invalid benefit details are provided."
1692
- )
1693
- }),
1694
- z.object({
1695
- eligibleBenefitOptions: z.never().optional(),
1696
- notEnoughBalanceOptions: z.never().optional(),
1697
- policyExpressionEvaluatedToFalseOptions: z.never().optional(),
1698
- poolNotActiveOptions: z.never().optional(),
1699
- benefitNotFoundOptions: z.never().optional(),
1700
- poolNotFoundOptions: z.object({
1701
- poolId: z.string().describe("Pool ID.").regex(
1702
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1703
- "Must be a valid GUID"
1704
- ).optional()
1705
- }).describe(
1706
- "Returned when invalid pool details are provided."
1707
- )
1708
- })
1709
- ])
1710
- )
1711
- ).max(10).optional()
1712
- }).describe("Result of the eligibility check.").optional()
1713
- })
1714
- ).min(1).max(100).optional()
1715
- });
1716
- var GetEligibleBenefitsRequest = z.object({
1717
- itemReference: z.object({
1718
- externalId: z.string().describe("External ID of the item.").regex(
1719
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1720
- "Must be a valid GUID"
1721
- ),
1722
- category: z.string().describe("Item category.").max(20).optional(),
1723
- providerAppId: z.string().describe("ID of the app providing the item.").regex(
1724
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1725
- "Must be a valid GUID"
1726
- )
1727
- }).describe("Item reference."),
1728
- options: z.object({
1729
- count: z.number().int().describe(
1730
- "Amount of items to check. This ensures the balance is high enough to redeem this many items."
1731
- ).min(1).optional(),
1732
- targetDate: z.date().describe(
1733
- "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."
1734
- ).optional().nullable(),
1735
- additionalData: z.record(z.string(), z.any()).describe("Additional information.").optional().nullable(),
1736
- beneficiary: z.intersection(
1737
- z.object({}),
1738
- z.xor([
1739
- z.object({
1740
- anonymousVisitorId: z.never().optional(),
1741
- memberId: z.never().optional(),
1742
- wixUserId: z.never().optional()
1743
- }),
1744
- z.object({
1745
- memberId: z.never().optional(),
1746
- wixUserId: z.never().optional(),
1747
- anonymousVisitorId: z.string().describe(
1748
- "ID of a site visitor that hasn't logged in to the site."
1749
- ).regex(
1750
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1751
- "Must be a valid GUID"
1752
- )
1753
- }),
1754
- z.object({
1755
- anonymousVisitorId: z.never().optional(),
1756
- wixUserId: z.never().optional(),
1757
- memberId: z.string().describe("ID of a site member.").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
- )
1761
- }),
1762
- z.object({
1763
- anonymousVisitorId: z.never().optional(),
1764
- memberId: z.never().optional(),
1765
- wixUserId: z.string().describe("ID of a Wix user.").regex(
1766
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1767
- "Must be a valid GUID"
1768
- )
1769
- })
1770
- ])
1771
- ).describe("Filter request by beneficiary.").optional(),
1772
- namespace: z.string().describe(
1773
- "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."
1774
- ).min(1).max(20)
1775
- })
1776
- });
1777
- var GetEligibleBenefitsResponse = z.object({
1778
- eligibleBenefits: z.array(
1779
- z.object({
1780
- poolId: z.string().describe("Pool ID.").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
- ).optional(),
1784
- benefitKey: z.string().describe("Benefit key.").max(64).optional(),
1785
- itemReference: z.object({
1786
- externalId: z.string().describe("External ID of the item.").regex(
1787
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1788
- "Must be a valid GUID"
1789
- ).optional(),
1790
- category: z.string().describe("Item category.").max(20).optional(),
1791
- providerAppId: z.string().describe("ID of the app providing the item.").regex(
1792
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1793
- "Must be a valid GUID"
1794
- ).optional()
1795
- }).describe("Item reference.").optional(),
1796
- price: z.string().describe("Price of the benefit in credits.").optional().nullable()
1797
- })
1798
- ).optional()
1799
- });
1800
- var BulkUpdatePoolsRequest = z.object({
1801
- options: z.object({
1802
- pools: z.array(
1803
- z.object({
1804
- pool: z.object({
1805
- _id: z.string().describe("Pool ID.").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
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1810
- "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."
1811
- ),
1812
- _createdDate: z.date().describe("Date and time the pool was created.").optional().nullable(),
1813
- _updatedDate: z.date().describe("Date and time the pool was updated.").optional().nullable(),
1814
- poolDefinitionId: z.string().describe("ID of the associated pool definition.").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
- ).optional().nullable(),
1818
- programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
1819
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1820
- "Must be a valid GUID"
1821
- ).optional().nullable(),
1822
- programId: z.string().describe("ID of the program that contains this pool.").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
- ).optional().nullable(),
1826
- status: z.enum([
1827
- "ACTIVE",
1828
- "PAUSED",
1829
- "ENDED",
1830
- "PROVISIONING",
1831
- "RENEWING",
1832
- "PENDING"
1833
- ]).optional(),
1834
- beneficiary: z.intersection(
1835
- z.object({}),
1836
- z.xor([
1837
- z.object({
1838
- anonymousVisitorId: z.never().optional(),
1839
- memberId: z.never().optional(),
1840
- wixUserId: z.never().optional()
1841
- }),
1842
- z.object({
1843
- memberId: z.never().optional(),
1844
- wixUserId: z.never().optional(),
1845
- anonymousVisitorId: z.string().describe(
1846
- "ID of a site visitor that hasn't logged in to the site."
1847
- ).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
- )
1851
- }),
1852
- z.object({
1853
- anonymousVisitorId: z.never().optional(),
1854
- wixUserId: z.never().optional(),
1855
- memberId: z.string().describe("ID of a site member.").regex(
1856
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1857
- "Must be a valid GUID"
1858
- )
1859
- }),
1860
- z.object({
1861
- anonymousVisitorId: z.never().optional(),
1862
- memberId: z.never().optional(),
1863
- wixUserId: z.string().describe("ID of a Wix user.").regex(
1864
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1865
- "Must be a valid GUID"
1866
- )
1867
- })
1868
- ])
1869
- ).describe("Pool beneficiary.").optional(),
1870
- details: z.object({
1871
- benefits: z.array(
1872
- z.object({
1873
- benefitKey: z.string().describe(
1874
- "Unique identifier for this benefit.\n\nThis key is consistent across the pool definition and all associated pools that contain this benefit."
1875
- ).max(64).optional(),
1876
- itemSetId: z.string().describe(
1877
- "ID that is used to associated items with this benefit."
1878
- ).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
- price: z.string().describe(
1883
- "Price of the benefit in credits. The price is the same for all of this benefit's items."
1884
- ).optional().nullable(),
1885
- additionalData: z.record(z.string(), z.any()).describe(
1886
- "Additional information for this benefit."
1887
- ).optional().nullable(),
1888
- providerAppId: z.string().describe(
1889
- "ID of the app providing the benefit items."
1890
- ).regex(
1891
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1892
- "Must be a valid GUID"
1893
- ).optional().nullable(),
1894
- displayName: z.string().describe("Benefit name.").max(40).optional().nullable(),
1895
- description: z.string().describe("Benefit description.").max(255).optional().nullable()
1896
- })
1897
- ).max(10).optional(),
1898
- creditConfiguration: z.object({
1899
- amount: z.string().describe(
1900
- "Initial available amount for associated balances."
1901
- ).optional(),
1902
- rolloverConfiguration: z.object({
1903
- enabled: z.boolean().describe(
1904
- "Whether unused credits roll over to a new cycle when a program renews."
1905
- ).optional().nullable(),
1906
- balanceCap: z.string().describe(
1907
- "Maximum number of credits that can roll over to the next cycle when a program renews."
1908
- ).optional().nullable()
1909
- }).describe("Rollover settings.").optional(),
1910
- unitDisplayName: z.string().describe("Credit unit display name.").max(32).optional().nullable()
1911
- }).describe(
1912
- "Credit settings.\n\nIf this object is empty, you can't set a price for the benefit."
1913
- ).optional(),
1914
- additionalData: z.record(z.string(), z.any()).describe(
1915
- "Additional information relating to this object."
1916
- ).optional().nullable()
1917
- }).describe("Pool benefits and settings.").optional(),
1918
- displayName: z.string().describe(
1919
- "Pool name.\n\nYou may want to use the same name that's used in the associated pool definition."
1920
- ).max(64).optional(),
1921
- namespace: z.string().describe(
1922
- "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."
1923
- ).min(1).max(20).optional().nullable(),
1924
- extendedFields: z.object({
1925
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1926
- "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)."
1927
- ).optional()
1928
- }).describe(
1929
- "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."
1930
- ).optional(),
1931
- programDefinition: z.object({
1932
- _id: z.string().describe("Program definition ID.").regex(
1933
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1934
- "Must be a valid GUID"
1935
- ).optional(),
1936
- externalId: z.string().describe("Program definition external ID.").regex(
1937
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1938
- "Must be a valid GUID"
1939
- ).optional().nullable(),
1940
- displayName: z.string().describe("Display name of the program definition.").max(64).optional().nullable(),
1941
- description: z.string().describe("Description of the program definition.").max(450).optional().nullable()
1942
- }).describe("Associated program definition information.").optional(),
1943
- program: z.object({
1944
- _id: z.string().describe("Program ID.").regex(
1945
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1946
- "Must be a valid GUID"
1947
- ).optional(),
1948
- externalId: z.string().describe("Program external ID.").regex(
1949
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1950
- "Must be a valid GUID"
1951
- ).optional().nullable(),
1952
- displayName: z.string().describe("Display name of the program.").max(64).optional().nullable()
1953
- }).describe(
1954
- "Information about the program containing the pool."
1955
- ).optional(),
1956
- poolDefinitionRevision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1957
- "Version of the pool definition that this pool was created from."
1958
- ).optional().nullable(),
1959
- renewalCount: z.number().int().describe("Number of times this pool has been renewed.").optional().nullable()
1960
- }).describe("Pool to update."),
1961
- fieldMask: z.array(z.string()).optional()
1962
- })
1963
- ).min(1).max(100).optional(),
1964
- returnEntity: z.boolean().describe(
1965
- "Whether to return the full pool definition entities.\n\nDefault: `false`"
1966
- ).optional()
1967
- }).optional()
1968
- });
1969
- var BulkUpdatePoolsResponse = z.object({
1970
- results: z.array(
1971
- z.object({
1972
- itemMetadata: z.object({
1973
- _id: z.string().describe(
1974
- "Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
1975
- ).regex(
1976
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1977
- "Must be a valid GUID"
1978
- ).optional().nullable(),
1979
- originalIndex: z.number().int().describe(
1980
- "Index of the item within the request array. Allows for correlation between request and response items."
1981
- ).optional(),
1982
- success: z.boolean().describe(
1983
- "Whether the requested action was successful for this item. When `false`, the `error` field is populated."
1984
- ).optional(),
1985
- error: z.object({
1986
- code: z.string().describe("Error code.").optional(),
1987
- description: z.string().describe("Description of the error.").optional(),
1988
- data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
1989
- }).describe("Details about the error in case of failure.").optional()
1990
- }).describe("Item metadata.").optional(),
1991
- item: z.object({
1992
- _id: z.string().describe("Pool 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
- revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1997
- "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."
1998
- ).optional().nullable(),
1999
- _createdDate: z.date().describe("Date and time the pool was created.").optional().nullable(),
2000
- _updatedDate: z.date().describe("Date and time the pool was updated.").optional().nullable(),
2001
- poolDefinitionId: z.string().describe("ID of the associated pool definition.").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().nullable(),
2005
- programDefinitionId: z.string().describe("ID of the associated program definition.").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
- programId: z.string().describe("ID of the program that contains this pool.").regex(
2010
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2011
- "Must be a valid GUID"
2012
- ).optional().nullable(),
2013
- status: z.enum([
2014
- "ACTIVE",
2015
- "PAUSED",
2016
- "ENDED",
2017
- "PROVISIONING",
2018
- "RENEWING",
2019
- "PENDING"
2020
- ]).describe("Pool status.").optional(),
2021
- beneficiary: z.intersection(
2022
- z.object({}),
2023
- z.xor([
2024
- z.object({
2025
- anonymousVisitorId: z.never().optional(),
2026
- memberId: z.never().optional(),
2027
- wixUserId: z.never().optional()
2028
- }),
2029
- z.object({
2030
- memberId: z.never().optional(),
2031
- wixUserId: z.never().optional(),
2032
- anonymousVisitorId: z.string().describe(
2033
- "ID of a site visitor that hasn't logged in to the site."
2034
- ).regex(
2035
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2036
- "Must be a valid GUID"
2037
- )
2038
- }),
2039
- z.object({
2040
- anonymousVisitorId: z.never().optional(),
2041
- wixUserId: z.never().optional(),
2042
- memberId: z.string().describe("ID of a site member.").regex(
2043
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2044
- "Must be a valid GUID"
2045
- )
2046
- }),
2047
- z.object({
2048
- anonymousVisitorId: z.never().optional(),
2049
- memberId: z.never().optional(),
2050
- wixUserId: z.string().describe("ID of a Wix user.").regex(
2051
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2052
- "Must be a valid GUID"
2053
- )
2054
- })
2055
- ])
2056
- ).describe("Pool beneficiary.").optional(),
2057
- details: z.object({
2058
- benefits: z.array(
2059
- z.object({
2060
- benefitKey: z.string().describe(
2061
- "Unique identifier for this benefit.\n\nThis key is consistent across the pool definition and all associated pools that contain this benefit."
2062
- ).max(64).optional(),
2063
- itemSetId: z.string().describe(
2064
- "ID that is used to associated items with this benefit."
2065
- ).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
- price: z.string().describe(
2070
- "Price of the benefit in credits. The price is the same for all of this benefit's items."
2071
- ).optional().nullable(),
2072
- additionalData: z.record(z.string(), z.any()).describe("Additional information for this benefit.").optional().nullable(),
2073
- providerAppId: z.string().describe("ID of the app providing the benefit items.").regex(
2074
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2075
- "Must be a valid GUID"
2076
- ).optional().nullable(),
2077
- displayName: z.string().describe("Benefit name.").max(40).optional().nullable(),
2078
- description: z.string().describe("Benefit description.").max(255).optional().nullable()
2079
- })
2080
- ).max(10).optional(),
2081
- creditConfiguration: z.object({
2082
- amount: z.string().describe(
2083
- "Initial available amount for associated balances."
2084
- ).optional(),
2085
- rolloverConfiguration: z.object({
2086
- enabled: z.boolean().describe(
2087
- "Whether unused credits roll over to a new cycle when a program renews."
2088
- ).optional().nullable(),
2089
- balanceCap: z.string().describe(
2090
- "Maximum number of credits that can roll over to the next cycle when a program renews."
2091
- ).optional().nullable()
2092
- }).describe("Rollover settings.").optional(),
2093
- unitDisplayName: z.string().describe("Credit unit display name.").max(32).optional().nullable()
2094
- }).describe(
2095
- "Credit settings.\n\nIf this object is empty, you can't set a price for the benefit."
2096
- ).optional(),
2097
- additionalData: z.record(z.string(), z.any()).describe("Additional information relating to this object.").optional().nullable()
2098
- }).describe("Pool benefits and settings.").optional(),
2099
- displayName: z.string().describe(
2100
- "Pool name.\n\nYou may want to use the same name that's used in the associated pool definition."
2101
- ).max(64).optional(),
2102
- namespace: z.string().describe(
2103
- "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."
2104
- ).min(1).max(20).optional().nullable(),
2105
- extendedFields: z.object({
2106
- namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
2107
- "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)."
2108
- ).optional()
2109
- }).describe(
2110
- "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."
2111
- ).optional(),
2112
- programDefinition: z.object({
2113
- _id: z.string().describe("Program definition ID.").regex(
2114
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2115
- "Must be a valid GUID"
2116
- ).optional(),
2117
- externalId: z.string().describe("Program definition external ID.").regex(
2118
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2119
- "Must be a valid GUID"
2120
- ).optional().nullable(),
2121
- displayName: z.string().describe("Display name of the program definition.").max(64).optional().nullable(),
2122
- description: z.string().describe("Description of the program definition.").max(450).optional().nullable()
2123
- }).describe("Associated program definition information.").optional(),
2124
- program: z.object({
2125
- _id: z.string().describe("Program ID.").regex(
2126
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
2127
- "Must be a valid GUID"
2128
- ).optional(),
2129
- externalId: z.string().describe("Program external ID.").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("Display name of the program.").max(64).optional().nullable()
2134
- }).describe("Information about the program containing the pool.").optional(),
2135
- poolDefinitionRevision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
2136
- "Version of the pool definition that this pool was created from."
2137
- ).optional().nullable(),
2138
- renewalCount: z.number().int().describe("Number of times this pool has been renewed.").optional().nullable()
2139
- }).describe("Pool data.").optional()
2140
- })
2141
- ).min(1).max(100).optional(),
2142
- bulkActionMetadata: z.object({
2143
- totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
2144
- totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
2145
- undetailedFailures: z.number().int().describe(
2146
- "Number of failures without details because detailed failure threshold was exceeded."
2147
- ).optional()
2148
- }).describe("Bulk action metadata.").optional()
2149
- });
2150
-
2151
- // src/benefit-programs-v1-pool-pools.universal.ts
2152
499
  import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
2153
500
  var PoolStatus = /* @__PURE__ */ ((PoolStatus2) => {
2154
501
  PoolStatus2["ACTIVE"] = "ACTIVE";
@@ -2241,10 +588,7 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
2241
588
  return WebhookIdentityType2;
2242
589
  })(WebhookIdentityType || {});
2243
590
  async function getPool2(poolId) {
2244
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
2245
- if (validateRequestSchema) {
2246
- GetPoolRequest.parse({ poolId });
2247
- }
591
+ const { httpClient, sideEffects } = arguments[1];
2248
592
  const payload = renameKeysFromSDKRequestToRESTRequest({ poolId });
2249
593
  const reqOpts = getPool(payload);
2250
594
  sideEffects?.onSiteCall?.();
@@ -2267,10 +611,7 @@ async function getPool2(poolId) {
2267
611
  }
2268
612
  }
2269
613
  async function updatePool2(_id, pool) {
2270
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
2271
- if (validateRequestSchema) {
2272
- UpdatePoolRequest.parse({ _id, pool });
2273
- }
614
+ const { httpClient, sideEffects } = arguments[2];
2274
615
  const payload = renameKeysFromSDKRequestToRESTRequest({
2275
616
  pool: { ...pool, id: _id }
2276
617
  });
@@ -2341,10 +682,7 @@ function queryPools2(options) {
2341
682
  });
2342
683
  }
2343
684
  async function typedQueryPools(query, options) {
2344
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
2345
- if (validateRequestSchema) {
2346
- QueryPoolsRequest.parse({ query, options });
2347
- }
685
+ const { httpClient, sideEffects } = arguments[2];
2348
686
  const payload = renameKeysFromSDKRequestToRESTRequest({
2349
687
  query,
2350
688
  ...options
@@ -2375,10 +713,7 @@ var utils = {
2375
713
  }
2376
714
  };
2377
715
  async function redeemBenefit2(poolId, options) {
2378
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
2379
- if (validateRequestSchema) {
2380
- RedeemBenefitRequest.parse({ poolId, options });
2381
- }
716
+ const { httpClient, sideEffects } = arguments[2];
2382
717
  const payload = renameKeysFromSDKRequestToRESTRequest({
2383
718
  poolId,
2384
719
  itemReference: options?.itemReference,
@@ -2421,10 +756,7 @@ async function redeemBenefit2(poolId, options) {
2421
756
  }
2422
757
  }
2423
758
  async function checkBenefitEligibility2(poolId, options) {
2424
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
2425
- if (validateRequestSchema) {
2426
- CheckBenefitEligibilityRequest.parse({ poolId, options });
2427
- }
759
+ const { httpClient, sideEffects } = arguments[2];
2428
760
  const payload = renameKeysFromSDKRequestToRESTRequest({
2429
761
  poolId,
2430
762
  benefitKey: options?.benefitKey,
@@ -2465,10 +797,7 @@ async function checkBenefitEligibility2(poolId, options) {
2465
797
  }
2466
798
  }
2467
799
  async function bulkCheckBenefitEligibility2(options) {
2468
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
2469
- if (validateRequestSchema) {
2470
- BulkCheckBenefitEligibilityRequest.parse({ options });
2471
- }
800
+ const { httpClient, sideEffects } = arguments[1];
2472
801
  const payload = renameKeysFromSDKRequestToRESTRequest({
2473
802
  benefitSelectors: options?.benefitSelectors,
2474
803
  namespace: options?.namespace,
@@ -2499,10 +828,7 @@ async function bulkCheckBenefitEligibility2(options) {
2499
828
  }
2500
829
  }
2501
830
  async function getEligibleBenefits2(itemReference, options) {
2502
- const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
2503
- if (validateRequestSchema) {
2504
- GetEligibleBenefitsRequest.parse({ itemReference, options });
2505
- }
831
+ const { httpClient, sideEffects } = arguments[2];
2506
832
  const payload = renameKeysFromSDKRequestToRESTRequest({
2507
833
  itemReference,
2508
834
  count: options?.count,
@@ -2539,10 +865,7 @@ async function getEligibleBenefits2(itemReference, options) {
2539
865
  }
2540
866
  }
2541
867
  async function bulkUpdatePools2(options) {
2542
- const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
2543
- if (validateRequestSchema) {
2544
- BulkUpdatePoolsRequest.parse({ options });
2545
- }
868
+ const { httpClient, sideEffects } = arguments[1];
2546
869
  const payload = renameKeysFromSDKRequestToRESTRequest({
2547
870
  pools: options?.pools,
2548
871
  returnEntity: options?.returnEntity
@@ -2611,79 +934,79 @@ async function checkEligibilityByFilter2(options) {
2611
934
  }
2612
935
 
2613
936
  // src/benefit-programs-v1-pool-pools.public.ts
2614
- function getPool3(httpClient, __options) {
937
+ function getPool3(httpClient) {
2615
938
  return (poolId) => getPool2(
2616
939
  poolId,
2617
940
  // @ts-ignore
2618
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
941
+ { httpClient }
2619
942
  );
2620
943
  }
2621
- function updatePool3(httpClient, __options) {
944
+ function updatePool3(httpClient) {
2622
945
  return (_id, pool) => updatePool2(
2623
946
  _id,
2624
947
  pool,
2625
948
  // @ts-ignore
2626
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
949
+ { httpClient }
2627
950
  );
2628
951
  }
2629
- function queryPools3(httpClient, __options) {
952
+ function queryPools3(httpClient) {
2630
953
  return (options) => queryPools2(
2631
954
  options,
2632
955
  // @ts-ignore
2633
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
956
+ { httpClient }
2634
957
  );
2635
958
  }
2636
- function typedQueryPools2(httpClient, __options) {
959
+ function typedQueryPools2(httpClient) {
2637
960
  return (query, options) => typedQueryPools(
2638
961
  query,
2639
962
  options,
2640
963
  // @ts-ignore
2641
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
964
+ { httpClient }
2642
965
  );
2643
966
  }
2644
- function redeemBenefit3(httpClient, __options) {
967
+ function redeemBenefit3(httpClient) {
2645
968
  return (poolId, options) => redeemBenefit2(
2646
969
  poolId,
2647
970
  options,
2648
971
  // @ts-ignore
2649
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
972
+ { httpClient }
2650
973
  );
2651
974
  }
2652
- function checkBenefitEligibility3(httpClient, __options) {
975
+ function checkBenefitEligibility3(httpClient) {
2653
976
  return (poolId, options) => checkBenefitEligibility2(
2654
977
  poolId,
2655
978
  options,
2656
979
  // @ts-ignore
2657
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
980
+ { httpClient }
2658
981
  );
2659
982
  }
2660
- function bulkCheckBenefitEligibility3(httpClient, __options) {
983
+ function bulkCheckBenefitEligibility3(httpClient) {
2661
984
  return (options) => bulkCheckBenefitEligibility2(
2662
985
  options,
2663
986
  // @ts-ignore
2664
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
987
+ { httpClient }
2665
988
  );
2666
989
  }
2667
- function getEligibleBenefits3(httpClient, __options) {
990
+ function getEligibleBenefits3(httpClient) {
2668
991
  return (itemReference, options) => getEligibleBenefits2(
2669
992
  itemReference,
2670
993
  options,
2671
994
  // @ts-ignore
2672
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
995
+ { httpClient }
2673
996
  );
2674
997
  }
2675
- function bulkUpdatePools3(httpClient, __options) {
998
+ function bulkUpdatePools3(httpClient) {
2676
999
  return (options) => bulkUpdatePools2(
2677
1000
  options,
2678
1001
  // @ts-ignore
2679
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
1002
+ { httpClient }
2680
1003
  );
2681
1004
  }
2682
- function checkEligibilityByFilter3(httpClient, __options) {
1005
+ function checkEligibilityByFilter3(httpClient) {
2683
1006
  return (options) => checkEligibilityByFilter2(
2684
1007
  options,
2685
1008
  // @ts-ignore
2686
- { httpClient, validateRequestSchema: __options?.validateRequestSchema }
1009
+ { httpClient }
2687
1010
  );
2688
1011
  }
2689
1012