@wix/auto_sdk_benefit-programs_programs 1.0.48 → 1.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // index.ts
@@ -391,6 +401,849 @@ function getProgramByExternalIdAndNamespace(payload) {
391
401
 
392
402
  // src/benefit-programs-v1-program-programs.universal.ts
393
403
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
404
+
405
+ // src/benefit-programs-v1-program-programs.schemas.ts
406
+ var z = __toESM(require("zod"));
407
+ var ProvisionProgramRequest = z.object({
408
+ poolDefinitionLookupId: z.intersection(
409
+ z.object({}),
410
+ z.xor([
411
+ z.object({
412
+ poolDefinitionId: z.never().optional(),
413
+ programDefinitionId: z.never().optional()
414
+ }),
415
+ z.object({
416
+ programDefinitionId: z.never().optional(),
417
+ poolDefinitionId: z.string().describe("Pool definition ID.").regex(
418
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
419
+ "Must be a valid GUID"
420
+ )
421
+ }),
422
+ z.object({
423
+ poolDefinitionId: z.never().optional(),
424
+ programDefinitionId: z.string().describe("Program definition ID.").regex(
425
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
426
+ "Must be a valid GUID"
427
+ )
428
+ })
429
+ ])
430
+ ).describe(
431
+ "The program definition or pool definition to use to provision the program."
432
+ ),
433
+ options: z.object({
434
+ beneficiary: z.intersection(
435
+ z.object({}),
436
+ z.xor([
437
+ z.object({
438
+ anonymousVisitorId: z.never().optional(),
439
+ memberId: z.never().optional(),
440
+ wixUserId: z.never().optional()
441
+ }),
442
+ z.object({
443
+ memberId: z.never().optional(),
444
+ wixUserId: z.never().optional(),
445
+ anonymousVisitorId: z.string().describe(
446
+ "ID of a site visitor that hasn't logged in to the site."
447
+ ).regex(
448
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
449
+ "Must be a valid GUID"
450
+ )
451
+ }),
452
+ z.object({
453
+ anonymousVisitorId: z.never().optional(),
454
+ wixUserId: z.never().optional(),
455
+ memberId: z.string().describe("ID of a site member.").regex(
456
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
457
+ "Must be a valid GUID"
458
+ )
459
+ }),
460
+ z.object({
461
+ anonymousVisitorId: z.never().optional(),
462
+ memberId: z.never().optional(),
463
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
464
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
465
+ "Must be a valid GUID"
466
+ )
467
+ })
468
+ ])
469
+ ).describe("Program beneficiary."),
470
+ programStatus: z.enum(["ACTIVE", "PAUSED"]).optional(),
471
+ namespace: z.string().describe(
472
+ "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."
473
+ ).min(1).max(20),
474
+ displayName: z.string().describe(
475
+ "Program name.\n\nIf you're provisioning the program from a program definition, you may want to use the same name that was used for the program definition."
476
+ ).max(64).optional().nullable(),
477
+ externalProgramId: z.string().describe(
478
+ "ID for the program defined by you. You can use `externalId` to filter queries."
479
+ ).regex(
480
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
481
+ "Must be a valid GUID"
482
+ )
483
+ })
484
+ });
485
+ var ProvisionProgramResponse = z.object({
486
+ jobId: z.string().describe(
487
+ "Job ID of the provisioning of the program. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
488
+ ).regex(
489
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
490
+ "Must be a valid GUID"
491
+ ).optional(),
492
+ program: z.object({
493
+ _id: z.string().describe("Program ID.").regex(
494
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
495
+ "Must be a valid GUID"
496
+ ).optional().nullable(),
497
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
498
+ "Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current revision must be specified when updating the program.\n\nIgnored when creating a program."
499
+ ).optional().nullable(),
500
+ _createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
501
+ _updatedDate: z.date().describe("Date and time the program was updated.").optional().nullable(),
502
+ programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
503
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
504
+ "Must be a valid GUID"
505
+ ).optional().nullable(),
506
+ status: z.enum([
507
+ "ACTIVE",
508
+ "PAUSED",
509
+ "ENDED",
510
+ "PROVISIONING",
511
+ "PAUSING",
512
+ "RESUMING",
513
+ "ENDING"
514
+ ]).describe("Program status.").optional(),
515
+ beneficiary: z.intersection(
516
+ z.object({}),
517
+ z.xor([
518
+ z.object({
519
+ anonymousVisitorId: z.never().optional(),
520
+ memberId: z.never().optional(),
521
+ wixUserId: z.never().optional()
522
+ }),
523
+ z.object({
524
+ memberId: z.never().optional(),
525
+ wixUserId: z.never().optional(),
526
+ anonymousVisitorId: z.string().describe(
527
+ "ID of a site visitor that hasn't logged in to the site."
528
+ ).regex(
529
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
530
+ "Must be a valid GUID"
531
+ )
532
+ }),
533
+ z.object({
534
+ anonymousVisitorId: z.never().optional(),
535
+ wixUserId: z.never().optional(),
536
+ memberId: z.string().describe("ID of a site member.").regex(
537
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
538
+ "Must be a valid GUID"
539
+ )
540
+ }),
541
+ z.object({
542
+ anonymousVisitorId: z.never().optional(),
543
+ memberId: z.never().optional(),
544
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
545
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
546
+ "Must be a valid GUID"
547
+ )
548
+ })
549
+ ])
550
+ ).describe("Program beneficiary.").optional(),
551
+ displayName: z.string().describe(
552
+ "Program name.\n\nYou may want to use the same name that's used in the associated program definition, if it exists."
553
+ ).max(64).optional().nullable(),
554
+ namespace: z.string().describe(
555
+ "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."
556
+ ).min(1).max(20).optional().nullable(),
557
+ extendedFields: z.object({
558
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
559
+ "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)."
560
+ ).optional()
561
+ }).describe(
562
+ "Custom field data for the program 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."
563
+ ).optional(),
564
+ externalId: z.string().describe(
565
+ "ID for the program defined by you. You can use `externalId` to filter queries."
566
+ ).regex(
567
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
568
+ "Must be a valid GUID"
569
+ ).optional().nullable(),
570
+ programDefinition: z.object({
571
+ _id: z.string().describe("Program definition ID.").regex(
572
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
573
+ "Must be a valid GUID"
574
+ ).optional(),
575
+ externalId: z.string().describe("Program definition external ID.").regex(
576
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
577
+ "Must be a valid GUID"
578
+ ).optional().nullable()
579
+ }).describe("Associated program definition information.").optional()
580
+ }).describe("Provisioned program.").optional()
581
+ });
582
+ var RenewProgramRequest = z.object({
583
+ programId: z.string().describe("ID of the program to renew.").regex(
584
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
585
+ "Must be a valid GUID"
586
+ ),
587
+ options: z.object({
588
+ idempotencyKey: z.string().describe(
589
+ "Idempotency key to ensure that the request is processed only once."
590
+ ).max(64)
591
+ })
592
+ });
593
+ var RenewProgramResponse = z.object({
594
+ jobId: z.string().describe(
595
+ "Job ID of the program renewal. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
596
+ ).regex(
597
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
598
+ "Must be a valid GUID"
599
+ ).optional()
600
+ });
601
+ var PauseProgramRequest = z.object({
602
+ programId: z.string().describe("ID of the program to pause.").regex(
603
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
604
+ "Must be a valid GUID"
605
+ ),
606
+ options: z.object({
607
+ idempotencyKey: z.string().describe(
608
+ "Idempotency key to ensure that the request is processed only once."
609
+ ).max(64)
610
+ })
611
+ });
612
+ var PauseProgramResponse = z.object({
613
+ jobId: z.string().describe(
614
+ "Job ID of the pausing of the program. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
615
+ ).regex(
616
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
617
+ "Must be a valid GUID"
618
+ ).optional()
619
+ });
620
+ var ResumeProgramRequest = z.object({
621
+ programId: z.string().describe("ID of program to resume.").regex(
622
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
623
+ "Must be a valid GUID"
624
+ ),
625
+ options: z.object({
626
+ idempotencyKey: z.string().describe(
627
+ "Idempotency key to ensure that the request is processed only once."
628
+ ).max(64)
629
+ })
630
+ });
631
+ var ResumeProgramResponse = z.object({
632
+ jobId: z.string().describe(
633
+ "Job ID of the resuming of the program. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
634
+ ).regex(
635
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
636
+ "Must be a valid GUID"
637
+ ).optional()
638
+ });
639
+ var EndProgramRequest = z.object({
640
+ programId: z.string().describe("ID of the program to end.").regex(
641
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
642
+ "Must be a valid GUID"
643
+ )
644
+ });
645
+ var EndProgramResponse = z.object({
646
+ jobId: z.string().describe(
647
+ "Job ID of the ending of the program. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
648
+ ).regex(
649
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
650
+ "Must be a valid GUID"
651
+ ).optional()
652
+ });
653
+ var UpdateProgramRequest = z.object({
654
+ _id: z.string().describe("Program ID.").regex(
655
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
656
+ "Must be a valid GUID"
657
+ ),
658
+ program: z.object({
659
+ _id: z.string().describe("Program ID.").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
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
664
+ "Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current revision must be specified when updating the program.\n\nIgnored when creating a program."
665
+ ),
666
+ _createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
667
+ _updatedDate: z.date().describe("Date and time the program was updated.").optional().nullable(),
668
+ programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
669
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
670
+ "Must be a valid GUID"
671
+ ).optional().nullable(),
672
+ status: z.enum([
673
+ "ACTIVE",
674
+ "PAUSED",
675
+ "ENDED",
676
+ "PROVISIONING",
677
+ "PAUSING",
678
+ "RESUMING",
679
+ "ENDING"
680
+ ]).optional(),
681
+ beneficiary: z.intersection(
682
+ z.object({}),
683
+ z.xor([
684
+ z.object({
685
+ anonymousVisitorId: z.never().optional(),
686
+ memberId: z.never().optional(),
687
+ wixUserId: z.never().optional()
688
+ }),
689
+ z.object({
690
+ memberId: z.never().optional(),
691
+ wixUserId: z.never().optional(),
692
+ anonymousVisitorId: z.string().describe(
693
+ "ID of a site visitor that hasn't logged in to the site."
694
+ ).regex(
695
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
696
+ "Must be a valid GUID"
697
+ )
698
+ }),
699
+ z.object({
700
+ anonymousVisitorId: z.never().optional(),
701
+ wixUserId: z.never().optional(),
702
+ memberId: z.string().describe("ID of a site member.").regex(
703
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
704
+ "Must be a valid GUID"
705
+ )
706
+ }),
707
+ z.object({
708
+ anonymousVisitorId: z.never().optional(),
709
+ memberId: z.never().optional(),
710
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
711
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
712
+ "Must be a valid GUID"
713
+ )
714
+ })
715
+ ])
716
+ ).describe("Program beneficiary.").optional(),
717
+ displayName: z.string().describe(
718
+ "Program name.\n\nYou may want to use the same name that's used in the associated program definition, if it exists."
719
+ ).max(64).optional().nullable(),
720
+ namespace: z.string().describe(
721
+ "Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
722
+ ).min(1).max(20).optional().nullable(),
723
+ extendedFields: z.object({
724
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
725
+ "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)."
726
+ ).optional()
727
+ }).describe(
728
+ "Custom field data for the program 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."
729
+ ).optional(),
730
+ externalId: z.string().describe(
731
+ "ID for the program defined by you. You can use `externalId` to filter queries."
732
+ ).regex(
733
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
734
+ "Must be a valid GUID"
735
+ ).optional().nullable(),
736
+ programDefinition: z.object({
737
+ _id: z.string().describe("Program definition ID.").regex(
738
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
739
+ "Must be a valid GUID"
740
+ ).optional(),
741
+ externalId: z.string().describe("Program definition external ID.").regex(
742
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
743
+ "Must be a valid GUID"
744
+ ).optional().nullable()
745
+ }).describe("Associated program definition information.").optional()
746
+ }).describe("Program to update.")
747
+ });
748
+ var UpdateProgramResponse = z.object({
749
+ _id: z.string().describe("Program ID.").regex(
750
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
751
+ "Must be a valid GUID"
752
+ ).optional().nullable(),
753
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
754
+ "Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current revision must be specified when updating the program.\n\nIgnored when creating a program."
755
+ ).optional().nullable(),
756
+ _createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
757
+ _updatedDate: z.date().describe("Date and time the program was updated.").optional().nullable(),
758
+ programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
759
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
760
+ "Must be a valid GUID"
761
+ ).optional().nullable(),
762
+ status: z.enum([
763
+ "ACTIVE",
764
+ "PAUSED",
765
+ "ENDED",
766
+ "PROVISIONING",
767
+ "PAUSING",
768
+ "RESUMING",
769
+ "ENDING"
770
+ ]).describe("Program status.").optional(),
771
+ beneficiary: z.intersection(
772
+ z.object({}),
773
+ z.xor([
774
+ z.object({
775
+ anonymousVisitorId: z.never().optional(),
776
+ memberId: z.never().optional(),
777
+ wixUserId: z.never().optional()
778
+ }),
779
+ z.object({
780
+ memberId: z.never().optional(),
781
+ wixUserId: z.never().optional(),
782
+ anonymousVisitorId: z.string().describe("ID of a site visitor that hasn't logged in to the site.").regex(
783
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
784
+ "Must be a valid GUID"
785
+ )
786
+ }),
787
+ z.object({
788
+ anonymousVisitorId: z.never().optional(),
789
+ wixUserId: z.never().optional(),
790
+ memberId: z.string().describe("ID of a site member.").regex(
791
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
792
+ "Must be a valid GUID"
793
+ )
794
+ }),
795
+ z.object({
796
+ anonymousVisitorId: z.never().optional(),
797
+ memberId: z.never().optional(),
798
+ wixUserId: z.string().describe("ID of a Wix user.").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
+ )
802
+ })
803
+ ])
804
+ ).describe("Program beneficiary.").optional(),
805
+ displayName: z.string().describe(
806
+ "Program name.\n\nYou may want to use the same name that's used in the associated program definition, if it exists."
807
+ ).max(64).optional().nullable(),
808
+ namespace: z.string().describe(
809
+ "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."
810
+ ).min(1).max(20).optional().nullable(),
811
+ extendedFields: z.object({
812
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
813
+ "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)."
814
+ ).optional()
815
+ }).describe(
816
+ "Custom field data for the program 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."
817
+ ).optional(),
818
+ externalId: z.string().describe(
819
+ "ID for the program defined by you. You can use `externalId` to filter queries."
820
+ ).regex(
821
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
822
+ "Must be a valid GUID"
823
+ ).optional().nullable(),
824
+ programDefinition: z.object({
825
+ _id: z.string().describe("Program definition ID.").regex(
826
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
827
+ "Must be a valid GUID"
828
+ ).optional(),
829
+ externalId: z.string().describe("Program definition external ID.").regex(
830
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
831
+ "Must be a valid GUID"
832
+ ).optional().nullable()
833
+ }).describe("Associated program definition information.").optional()
834
+ });
835
+ var GetProgramRequest = z.object({
836
+ programId: z.string().describe("ID of the program to retrieve.").regex(
837
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
838
+ "Must be a valid GUID"
839
+ )
840
+ });
841
+ var GetProgramResponse = z.object({
842
+ _id: z.string().describe("Program ID.").regex(
843
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
844
+ "Must be a valid GUID"
845
+ ).optional().nullable(),
846
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
847
+ "Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current revision must be specified when updating the program.\n\nIgnored when creating a program."
848
+ ).optional().nullable(),
849
+ _createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
850
+ _updatedDate: z.date().describe("Date and time the program was updated.").optional().nullable(),
851
+ programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
852
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
853
+ "Must be a valid GUID"
854
+ ).optional().nullable(),
855
+ status: z.enum([
856
+ "ACTIVE",
857
+ "PAUSED",
858
+ "ENDED",
859
+ "PROVISIONING",
860
+ "PAUSING",
861
+ "RESUMING",
862
+ "ENDING"
863
+ ]).describe("Program status.").optional(),
864
+ beneficiary: z.intersection(
865
+ z.object({}),
866
+ z.xor([
867
+ z.object({
868
+ anonymousVisitorId: z.never().optional(),
869
+ memberId: z.never().optional(),
870
+ wixUserId: z.never().optional()
871
+ }),
872
+ z.object({
873
+ memberId: z.never().optional(),
874
+ wixUserId: z.never().optional(),
875
+ anonymousVisitorId: z.string().describe("ID of a site visitor that hasn't logged in to the site.").regex(
876
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
877
+ "Must be a valid GUID"
878
+ )
879
+ }),
880
+ z.object({
881
+ anonymousVisitorId: z.never().optional(),
882
+ wixUserId: z.never().optional(),
883
+ memberId: z.string().describe("ID of a site member.").regex(
884
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
885
+ "Must be a valid GUID"
886
+ )
887
+ }),
888
+ z.object({
889
+ anonymousVisitorId: z.never().optional(),
890
+ memberId: z.never().optional(),
891
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
892
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
893
+ "Must be a valid GUID"
894
+ )
895
+ })
896
+ ])
897
+ ).describe("Program beneficiary.").optional(),
898
+ displayName: z.string().describe(
899
+ "Program name.\n\nYou may want to use the same name that's used in the associated program definition, if it exists."
900
+ ).max(64).optional().nullable(),
901
+ namespace: z.string().describe(
902
+ "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."
903
+ ).min(1).max(20).optional().nullable(),
904
+ extendedFields: z.object({
905
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
906
+ "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)."
907
+ ).optional()
908
+ }).describe(
909
+ "Custom field data for the program 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."
910
+ ).optional(),
911
+ externalId: z.string().describe(
912
+ "ID for the program defined by you. You can use `externalId` to filter queries."
913
+ ).regex(
914
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
915
+ "Must be a valid GUID"
916
+ ).optional().nullable(),
917
+ programDefinition: z.object({
918
+ _id: z.string().describe("Program definition ID.").regex(
919
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
920
+ "Must be a valid GUID"
921
+ ).optional(),
922
+ externalId: z.string().describe("Program definition external ID.").regex(
923
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
924
+ "Must be a valid GUID"
925
+ ).optional().nullable()
926
+ }).describe("Associated program definition information.").optional()
927
+ });
928
+ var QueryProgramsRequest = z.object({
929
+ query: z.object({
930
+ filter: z.object({
931
+ _id: z.object({
932
+ $eq: z.string(),
933
+ $exists: z.boolean(),
934
+ $gt: z.string(),
935
+ $gte: z.string(),
936
+ $hasAll: z.array(z.string()),
937
+ $hasSome: z.array(z.string()),
938
+ $in: z.array(z.string()),
939
+ $lt: z.string(),
940
+ $lte: z.string(),
941
+ $ne: z.string(),
942
+ $nin: z.array(z.string()),
943
+ $startsWith: z.string()
944
+ }).partial().strict().optional(),
945
+ namespace: z.object({
946
+ $eq: z.string(),
947
+ $exists: z.boolean(),
948
+ $gt: z.string(),
949
+ $gte: z.string(),
950
+ $hasAll: z.array(z.string()),
951
+ $hasSome: z.array(z.string()),
952
+ $in: z.array(z.string()),
953
+ $lt: z.string(),
954
+ $lte: z.string(),
955
+ $ne: z.string(),
956
+ $nin: z.array(z.string()),
957
+ $startsWith: z.string()
958
+ }).partial().strict().optional(),
959
+ externalId: z.object({
960
+ $eq: z.string(),
961
+ $exists: z.boolean(),
962
+ $gt: z.string(),
963
+ $gte: z.string(),
964
+ $hasAll: z.array(z.string()),
965
+ $hasSome: z.array(z.string()),
966
+ $in: z.array(z.string()),
967
+ $lt: z.string(),
968
+ $lte: z.string(),
969
+ $ne: z.string(),
970
+ $nin: z.array(z.string()),
971
+ $startsWith: z.string()
972
+ }).partial().strict().optional(),
973
+ programDefinitionId: z.object({
974
+ $eq: z.string(),
975
+ $exists: z.boolean(),
976
+ $gt: z.string(),
977
+ $gte: z.string(),
978
+ $hasAll: z.array(z.string()),
979
+ $hasSome: z.array(z.string()),
980
+ $in: z.array(z.string()),
981
+ $lt: z.string(),
982
+ $lte: z.string(),
983
+ $ne: z.string(),
984
+ $nin: z.array(z.string()),
985
+ $startsWith: z.string()
986
+ }).partial().strict().optional(),
987
+ status: z.object({
988
+ $eq: z.string(),
989
+ $exists: z.boolean(),
990
+ $gt: z.string(),
991
+ $gte: z.string(),
992
+ $hasAll: z.array(z.string()),
993
+ $hasSome: z.array(z.string()),
994
+ $in: z.array(z.string()),
995
+ $lt: z.string(),
996
+ $lte: z.string(),
997
+ $ne: z.string(),
998
+ $nin: z.array(z.string()),
999
+ $startsWith: z.string()
1000
+ }).partial().strict().optional(),
1001
+ _createdDate: z.object({
1002
+ $eq: z.string(),
1003
+ $exists: z.boolean(),
1004
+ $gt: z.string(),
1005
+ $gte: z.string(),
1006
+ $hasAll: z.array(z.string()),
1007
+ $hasSome: z.array(z.string()),
1008
+ $in: z.array(z.string()),
1009
+ $lt: z.string(),
1010
+ $lte: z.string(),
1011
+ $ne: z.string(),
1012
+ $nin: z.array(z.string()),
1013
+ $startsWith: z.string()
1014
+ }).partial().strict().optional(),
1015
+ $and: z.array(z.any()).optional(),
1016
+ $or: z.array(z.any()).optional(),
1017
+ $not: z.any().optional()
1018
+ }).strict().optional(),
1019
+ sort: z.array(
1020
+ z.object({
1021
+ fieldName: z.enum([
1022
+ "_id",
1023
+ "namespace",
1024
+ "externalId",
1025
+ "programDefinitionId",
1026
+ "status",
1027
+ "_createdDate"
1028
+ ]).optional(),
1029
+ order: z.enum(["ASC", "DESC"]).optional()
1030
+ })
1031
+ ).optional()
1032
+ }).catchall(z.any()).describe("Filter, sort, and paging to apply to the query.")
1033
+ });
1034
+ var QueryProgramsResponse = z.object({
1035
+ programs: z.array(
1036
+ z.object({
1037
+ _id: z.string().describe("Program ID.").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
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1042
+ "Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current revision must be specified when updating the program.\n\nIgnored when creating a program."
1043
+ ).optional().nullable(),
1044
+ _createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
1045
+ _updatedDate: z.date().describe("Date and time the program was updated.").optional().nullable(),
1046
+ programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
1047
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1048
+ "Must be a valid GUID"
1049
+ ).optional().nullable(),
1050
+ status: z.enum([
1051
+ "ACTIVE",
1052
+ "PAUSED",
1053
+ "ENDED",
1054
+ "PROVISIONING",
1055
+ "PAUSING",
1056
+ "RESUMING",
1057
+ "ENDING"
1058
+ ]).describe("Program status.").optional(),
1059
+ beneficiary: z.intersection(
1060
+ z.object({}),
1061
+ z.xor([
1062
+ z.object({
1063
+ anonymousVisitorId: z.never().optional(),
1064
+ memberId: z.never().optional(),
1065
+ wixUserId: z.never().optional()
1066
+ }),
1067
+ z.object({
1068
+ memberId: z.never().optional(),
1069
+ wixUserId: z.never().optional(),
1070
+ anonymousVisitorId: z.string().describe(
1071
+ "ID of a site visitor that hasn't logged in to the site."
1072
+ ).regex(
1073
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1074
+ "Must be a valid GUID"
1075
+ )
1076
+ }),
1077
+ z.object({
1078
+ anonymousVisitorId: z.never().optional(),
1079
+ wixUserId: z.never().optional(),
1080
+ memberId: z.string().describe("ID of a site member.").regex(
1081
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1082
+ "Must be a valid GUID"
1083
+ )
1084
+ }),
1085
+ z.object({
1086
+ anonymousVisitorId: z.never().optional(),
1087
+ memberId: z.never().optional(),
1088
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
1089
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1090
+ "Must be a valid GUID"
1091
+ )
1092
+ })
1093
+ ])
1094
+ ).describe("Program beneficiary.").optional(),
1095
+ displayName: z.string().describe(
1096
+ "Program name.\n\nYou may want to use the same name that's used in the associated program definition, if it exists."
1097
+ ).max(64).optional().nullable(),
1098
+ namespace: z.string().describe(
1099
+ "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."
1100
+ ).min(1).max(20).optional().nullable(),
1101
+ extendedFields: z.object({
1102
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1103
+ "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)."
1104
+ ).optional()
1105
+ }).describe(
1106
+ "Custom field data for the program 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."
1107
+ ).optional(),
1108
+ externalId: z.string().describe(
1109
+ "ID for the program defined by you. You can use `externalId` to filter queries."
1110
+ ).regex(
1111
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1112
+ "Must be a valid GUID"
1113
+ ).optional().nullable(),
1114
+ programDefinition: z.object({
1115
+ _id: z.string().describe("Program definition ID.").regex(
1116
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1117
+ "Must be a valid GUID"
1118
+ ).optional(),
1119
+ externalId: z.string().describe("Program definition external ID.").regex(
1120
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1121
+ "Must be a valid GUID"
1122
+ ).optional().nullable()
1123
+ }).describe("Associated program definition information.").optional()
1124
+ })
1125
+ ).optional(),
1126
+ metadata: z.object({
1127
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
1128
+ cursors: z.object({
1129
+ next: z.string().describe(
1130
+ "Cursor string pointing to the next page in the list of results."
1131
+ ).max(16e3).optional().nullable(),
1132
+ prev: z.string().describe(
1133
+ "Cursor pointing to the previous page in the list of results."
1134
+ ).max(16e3).optional().nullable()
1135
+ }).describe(
1136
+ "Cursor strings that point to the next page, previous page, or both."
1137
+ ).optional(),
1138
+ hasNext: z.boolean().describe(
1139
+ "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."
1140
+ ).optional().nullable()
1141
+ }).describe("Metadata for the paginated results.").optional()
1142
+ });
1143
+ var GetProgramByExternalIdAndNamespaceRequest = z.object({
1144
+ namespace: z.string().describe(
1145
+ "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."
1146
+ ).min(1).max(20),
1147
+ options: z.object({
1148
+ externalId: z.string().describe("Program's external ID.").regex(
1149
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1150
+ "Must be a valid GUID"
1151
+ )
1152
+ })
1153
+ });
1154
+ var GetProgramByExternalIdAndNamespaceResponse = z.object({
1155
+ program: z.object({
1156
+ _id: z.string().describe("Program ID.").regex(
1157
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1158
+ "Must be a valid GUID"
1159
+ ).optional().nullable(),
1160
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
1161
+ "Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current revision must be specified when updating the program.\n\nIgnored when creating a program."
1162
+ ).optional().nullable(),
1163
+ _createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
1164
+ _updatedDate: z.date().describe("Date and time the program was updated.").optional().nullable(),
1165
+ programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
1166
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1167
+ "Must be a valid GUID"
1168
+ ).optional().nullable(),
1169
+ status: z.enum([
1170
+ "ACTIVE",
1171
+ "PAUSED",
1172
+ "ENDED",
1173
+ "PROVISIONING",
1174
+ "PAUSING",
1175
+ "RESUMING",
1176
+ "ENDING"
1177
+ ]).describe("Program status.").optional(),
1178
+ beneficiary: z.intersection(
1179
+ z.object({}),
1180
+ z.xor([
1181
+ z.object({
1182
+ anonymousVisitorId: z.never().optional(),
1183
+ memberId: z.never().optional(),
1184
+ wixUserId: z.never().optional()
1185
+ }),
1186
+ z.object({
1187
+ memberId: z.never().optional(),
1188
+ wixUserId: z.never().optional(),
1189
+ anonymousVisitorId: z.string().describe(
1190
+ "ID of a site visitor that hasn't logged in to the site."
1191
+ ).regex(
1192
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1193
+ "Must be a valid GUID"
1194
+ )
1195
+ }),
1196
+ z.object({
1197
+ anonymousVisitorId: z.never().optional(),
1198
+ wixUserId: z.never().optional(),
1199
+ memberId: z.string().describe("ID of a site member.").regex(
1200
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1201
+ "Must be a valid GUID"
1202
+ )
1203
+ }),
1204
+ z.object({
1205
+ anonymousVisitorId: z.never().optional(),
1206
+ memberId: z.never().optional(),
1207
+ wixUserId: z.string().describe("ID of a Wix user.").regex(
1208
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1209
+ "Must be a valid GUID"
1210
+ )
1211
+ })
1212
+ ])
1213
+ ).describe("Program beneficiary.").optional(),
1214
+ displayName: z.string().describe(
1215
+ "Program name.\n\nYou may want to use the same name that's used in the associated program definition, if it exists."
1216
+ ).max(64).optional().nullable(),
1217
+ namespace: z.string().describe(
1218
+ "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."
1219
+ ).min(1).max(20).optional().nullable(),
1220
+ extendedFields: z.object({
1221
+ namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
1222
+ "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)."
1223
+ ).optional()
1224
+ }).describe(
1225
+ "Custom field data for the program 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."
1226
+ ).optional(),
1227
+ externalId: z.string().describe(
1228
+ "ID for the program defined by you. You can use `externalId` to filter queries."
1229
+ ).regex(
1230
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1231
+ "Must be a valid GUID"
1232
+ ).optional().nullable(),
1233
+ programDefinition: z.object({
1234
+ _id: z.string().describe("Program definition ID.").regex(
1235
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1236
+ "Must be a valid GUID"
1237
+ ).optional(),
1238
+ externalId: z.string().describe("Program definition external ID.").regex(
1239
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
1240
+ "Must be a valid GUID"
1241
+ ).optional().nullable()
1242
+ }).describe("Associated program definition information.").optional()
1243
+ }).describe("Retrieved program.").optional()
1244
+ });
1245
+
1246
+ // src/benefit-programs-v1-program-programs.universal.ts
394
1247
  var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
395
1248
  var ProgramStatus = /* @__PURE__ */ ((ProgramStatus2) => {
396
1249
  ProgramStatus2["ACTIVE"] = "ACTIVE";
@@ -435,7 +1288,10 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
435
1288
  return WebhookIdentityType2;
436
1289
  })(WebhookIdentityType || {});
437
1290
  async function provisionProgram2(poolDefinitionLookupId, options) {
438
- const { httpClient, sideEffects } = arguments[2];
1291
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1292
+ if (validateRequestSchema) {
1293
+ ProvisionProgramRequest.parse({ poolDefinitionLookupId, options });
1294
+ }
439
1295
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
440
1296
  poolDefinitionLookupId,
441
1297
  beneficiary: options?.beneficiary,
@@ -472,7 +1328,10 @@ async function provisionProgram2(poolDefinitionLookupId, options) {
472
1328
  }
473
1329
  }
474
1330
  async function renewProgram2(programId, options) {
475
- const { httpClient, sideEffects } = arguments[2];
1331
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1332
+ if (validateRequestSchema) {
1333
+ RenewProgramRequest.parse({ programId, options });
1334
+ }
476
1335
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
477
1336
  programId,
478
1337
  idempotencyKey: options?.idempotencyKey
@@ -501,7 +1360,10 @@ async function renewProgram2(programId, options) {
501
1360
  }
502
1361
  }
503
1362
  async function pauseProgram2(programId, options) {
504
- const { httpClient, sideEffects } = arguments[2];
1363
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1364
+ if (validateRequestSchema) {
1365
+ PauseProgramRequest.parse({ programId, options });
1366
+ }
505
1367
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
506
1368
  programId,
507
1369
  idempotencyKey: options?.idempotencyKey
@@ -530,7 +1392,10 @@ async function pauseProgram2(programId, options) {
530
1392
  }
531
1393
  }
532
1394
  async function resumeProgram2(programId, options) {
533
- const { httpClient, sideEffects } = arguments[2];
1395
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1396
+ if (validateRequestSchema) {
1397
+ ResumeProgramRequest.parse({ programId, options });
1398
+ }
534
1399
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
535
1400
  programId,
536
1401
  idempotencyKey: options?.idempotencyKey
@@ -559,7 +1424,10 @@ async function resumeProgram2(programId, options) {
559
1424
  }
560
1425
  }
561
1426
  async function endProgram2(programId) {
562
- const { httpClient, sideEffects } = arguments[1];
1427
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1428
+ if (validateRequestSchema) {
1429
+ EndProgramRequest.parse({ programId });
1430
+ }
563
1431
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
564
1432
  programId
565
1433
  });
@@ -584,7 +1452,10 @@ async function endProgram2(programId) {
584
1452
  }
585
1453
  }
586
1454
  async function updateProgram2(_id, program) {
587
- const { httpClient, sideEffects } = arguments[2];
1455
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1456
+ if (validateRequestSchema) {
1457
+ UpdateProgramRequest.parse({ _id, program });
1458
+ }
588
1459
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
589
1460
  program: { ...program, id: _id }
590
1461
  });
@@ -609,7 +1480,10 @@ async function updateProgram2(_id, program) {
609
1480
  }
610
1481
  }
611
1482
  async function getProgram2(programId) {
612
- const { httpClient, sideEffects } = arguments[1];
1483
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1484
+ if (validateRequestSchema) {
1485
+ GetProgramRequest.parse({ programId });
1486
+ }
613
1487
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
614
1488
  programId
615
1489
  });
@@ -677,7 +1551,10 @@ function queryPrograms2() {
677
1551
  });
678
1552
  }
679
1553
  async function typedQueryPrograms(query) {
680
- const { httpClient, sideEffects } = arguments[1];
1554
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1555
+ if (validateRequestSchema) {
1556
+ QueryProgramsRequest.parse({ query });
1557
+ }
681
1558
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
682
1559
  const reqOpts = queryPrograms(payload);
683
1560
  sideEffects?.onSiteCall?.();
@@ -705,7 +1582,13 @@ var utils = {
705
1582
  }
706
1583
  };
707
1584
  async function getProgramByExternalIdAndNamespace2(namespace, options) {
708
- const { httpClient, sideEffects } = arguments[2];
1585
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1586
+ if (validateRequestSchema) {
1587
+ GetProgramByExternalIdAndNamespaceRequest.parse({
1588
+ namespace,
1589
+ options
1590
+ });
1591
+ }
709
1592
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
710
1593
  namespace,
711
1594
  externalId: options?.externalId
@@ -737,79 +1620,79 @@ async function getProgramByExternalIdAndNamespace2(namespace, options) {
737
1620
  }
738
1621
 
739
1622
  // src/benefit-programs-v1-program-programs.public.ts
740
- function provisionProgram3(httpClient) {
1623
+ function provisionProgram3(httpClient, __options) {
741
1624
  return (poolDefinitionLookupId, options) => provisionProgram2(
742
1625
  poolDefinitionLookupId,
743
1626
  options,
744
1627
  // @ts-ignore
745
- { httpClient }
1628
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
746
1629
  );
747
1630
  }
748
- function renewProgram3(httpClient) {
1631
+ function renewProgram3(httpClient, __options) {
749
1632
  return (programId, options) => renewProgram2(
750
1633
  programId,
751
1634
  options,
752
1635
  // @ts-ignore
753
- { httpClient }
1636
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
754
1637
  );
755
1638
  }
756
- function pauseProgram3(httpClient) {
1639
+ function pauseProgram3(httpClient, __options) {
757
1640
  return (programId, options) => pauseProgram2(
758
1641
  programId,
759
1642
  options,
760
1643
  // @ts-ignore
761
- { httpClient }
1644
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
762
1645
  );
763
1646
  }
764
- function resumeProgram3(httpClient) {
1647
+ function resumeProgram3(httpClient, __options) {
765
1648
  return (programId, options) => resumeProgram2(
766
1649
  programId,
767
1650
  options,
768
1651
  // @ts-ignore
769
- { httpClient }
1652
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
770
1653
  );
771
1654
  }
772
- function endProgram3(httpClient) {
1655
+ function endProgram3(httpClient, __options) {
773
1656
  return (programId) => endProgram2(
774
1657
  programId,
775
1658
  // @ts-ignore
776
- { httpClient }
1659
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
777
1660
  );
778
1661
  }
779
- function updateProgram3(httpClient) {
1662
+ function updateProgram3(httpClient, __options) {
780
1663
  return (_id, program) => updateProgram2(
781
1664
  _id,
782
1665
  program,
783
1666
  // @ts-ignore
784
- { httpClient }
1667
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
785
1668
  );
786
1669
  }
787
- function getProgram3(httpClient) {
1670
+ function getProgram3(httpClient, __options) {
788
1671
  return (programId) => getProgram2(
789
1672
  programId,
790
1673
  // @ts-ignore
791
- { httpClient }
1674
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
792
1675
  );
793
1676
  }
794
- function queryPrograms3(httpClient) {
1677
+ function queryPrograms3(httpClient, __options) {
795
1678
  return () => queryPrograms2(
796
1679
  // @ts-ignore
797
- { httpClient }
1680
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
798
1681
  );
799
1682
  }
800
- function typedQueryPrograms2(httpClient) {
1683
+ function typedQueryPrograms2(httpClient, __options) {
801
1684
  return (query) => typedQueryPrograms(
802
1685
  query,
803
1686
  // @ts-ignore
804
- { httpClient }
1687
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
805
1688
  );
806
1689
  }
807
- function getProgramByExternalIdAndNamespace3(httpClient) {
1690
+ function getProgramByExternalIdAndNamespace3(httpClient, __options) {
808
1691
  return (namespace, options) => getProgramByExternalIdAndNamespace2(
809
1692
  namespace,
810
1693
  options,
811
1694
  // @ts-ignore
812
- { httpClient }
1695
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
813
1696
  );
814
1697
  }
815
1698