@wix/auto_sdk_stores_subscription-options 1.0.60 → 1.0.61

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
@@ -451,6 +461,407 @@ function getOneTimePurchasesStatus(payload) {
451
461
  return __getOneTimePurchasesStatus;
452
462
  }
453
463
 
464
+ // src/stores-v1-subscription-option-subscription-options.schemas.ts
465
+ var z = __toESM(require("zod"));
466
+ var CreateSubscriptionOptionRequest = z.object({
467
+ subscriptionOption: z.object({
468
+ _id: z.string().describe(
469
+ "Subscription option ID (auto-generated upon subscription option creation)."
470
+ ).regex(
471
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
472
+ "Must be a valid GUID"
473
+ ).optional().nullable(),
474
+ title: z.string().describe("Subscription option title.").min(1).max(20),
475
+ description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
476
+ subscriptionSettings: z.object({
477
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).optional(),
478
+ autoRenewal: z.boolean().describe(
479
+ "Whether subscription is renewed automatically at the end of each period."
480
+ ).optional(),
481
+ billingCycles: z.number().int().describe(
482
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
483
+ ).min(2).max(999).optional().nullable()
484
+ }).describe(
485
+ "Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
486
+ ),
487
+ discount: z.object({
488
+ type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).optional(),
489
+ value: z.number().describe("Discount value.").min(0).optional()
490
+ }).describe(
491
+ "Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
492
+ ).optional()
493
+ }).describe("Subscription option info.")
494
+ });
495
+ var CreateSubscriptionOptionResponse = z.object({
496
+ _id: z.string().describe(
497
+ "Subscription option ID (auto-generated upon subscription option creation)."
498
+ ).regex(
499
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
500
+ "Must be a valid GUID"
501
+ ).optional().nullable(),
502
+ title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
503
+ description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
504
+ subscriptionSettings: z.object({
505
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
506
+ autoRenewal: z.boolean().describe(
507
+ "Whether subscription is renewed automatically at the end of each period."
508
+ ).optional(),
509
+ billingCycles: z.number().int().describe(
510
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
511
+ ).min(2).max(999).optional().nullable()
512
+ }).describe(
513
+ "Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
514
+ ).optional(),
515
+ discount: z.object({
516
+ type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).describe("Discount type.").optional(),
517
+ value: z.number().describe("Discount value.").min(0).optional()
518
+ }).describe(
519
+ "Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
520
+ ).optional()
521
+ });
522
+ var UpdateSubscriptionOptionRequest = z.object({
523
+ _id: z.string().describe(
524
+ "Subscription option ID (auto-generated upon subscription option creation)."
525
+ ).regex(
526
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
527
+ "Must be a valid GUID"
528
+ ),
529
+ subscriptionOption: z.object({
530
+ _id: z.string().describe(
531
+ "Subscription option ID (auto-generated upon subscription option creation)."
532
+ ).regex(
533
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
534
+ "Must be a valid GUID"
535
+ ).optional().nullable(),
536
+ title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
537
+ description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
538
+ subscriptionSettings: z.object({
539
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).optional(),
540
+ autoRenewal: z.boolean().describe(
541
+ "Whether subscription is renewed automatically at the end of each period."
542
+ ).optional(),
543
+ billingCycles: z.number().int().describe(
544
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
545
+ ).min(2).max(999).optional().nullable()
546
+ }).describe(
547
+ "Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
548
+ ).optional(),
549
+ discount: z.object({
550
+ type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).optional(),
551
+ value: z.number().describe("Discount value.").min(0).optional()
552
+ }).describe(
553
+ "Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
554
+ ).optional()
555
+ }).describe("Subscription option update options.")
556
+ });
557
+ var UpdateSubscriptionOptionResponse = z.object({
558
+ _id: z.string().describe(
559
+ "Subscription option ID (auto-generated upon subscription option creation)."
560
+ ).regex(
561
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
562
+ "Must be a valid GUID"
563
+ ).optional().nullable(),
564
+ title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
565
+ description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
566
+ subscriptionSettings: z.object({
567
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
568
+ autoRenewal: z.boolean().describe(
569
+ "Whether subscription is renewed automatically at the end of each period."
570
+ ).optional(),
571
+ billingCycles: z.number().int().describe(
572
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
573
+ ).min(2).max(999).optional().nullable()
574
+ }).describe(
575
+ "Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
576
+ ).optional(),
577
+ discount: z.object({
578
+ type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).describe("Discount type.").optional(),
579
+ value: z.number().describe("Discount value.").min(0).optional()
580
+ }).describe(
581
+ "Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
582
+ ).optional()
583
+ });
584
+ var DeleteSubscriptionOptionRequest = z.object({
585
+ _id: z.string().describe("ID of the subscription option to delete.").min(1).regex(
586
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
587
+ "Must be a valid GUID"
588
+ )
589
+ });
590
+ var DeleteSubscriptionOptionResponse = z.object({});
591
+ var BulkCreateSubscriptionOptionsRequest = z.object({
592
+ subscriptionOptions: z.array(
593
+ z.object({
594
+ _id: z.string().describe(
595
+ "Subscription option ID (auto-generated upon subscription option creation)."
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().nullable(),
600
+ title: z.string().describe("Subscription option title.").min(1).max(20),
601
+ description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
602
+ subscriptionSettings: z.object({
603
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).optional(),
604
+ autoRenewal: z.boolean().describe(
605
+ "Whether subscription is renewed automatically at the end of each period."
606
+ ).optional(),
607
+ billingCycles: z.number().int().describe(
608
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
609
+ ).min(2).max(999).optional().nullable()
610
+ }).describe(
611
+ "Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
612
+ ),
613
+ discount: z.object({
614
+ type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).optional(),
615
+ value: z.number().describe("Discount value.").min(0).optional()
616
+ }).describe(
617
+ "Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
618
+ ).optional()
619
+ })
620
+ ).max(100)
621
+ });
622
+ var BulkCreateSubscriptionOptionsResponse = z.object({
623
+ subscriptionOptions: z.array(
624
+ z.object({
625
+ _id: z.string().describe(
626
+ "Subscription option ID (auto-generated upon subscription option creation)."
627
+ ).regex(
628
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
629
+ "Must be a valid GUID"
630
+ ).optional().nullable(),
631
+ title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
632
+ description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
633
+ subscriptionSettings: z.object({
634
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
635
+ autoRenewal: z.boolean().describe(
636
+ "Whether subscription is renewed automatically at the end of each period."
637
+ ).optional(),
638
+ billingCycles: z.number().int().describe(
639
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
640
+ ).min(2).max(999).optional().nullable()
641
+ }).describe(
642
+ "Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
643
+ ).optional(),
644
+ discount: z.object({
645
+ type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).describe("Discount type.").optional(),
646
+ value: z.number().describe("Discount value.").min(0).optional()
647
+ }).describe(
648
+ "Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
649
+ ).optional()
650
+ })
651
+ ).optional()
652
+ });
653
+ var BulkUpdateSubscriptionOptionsRequest = z.object({
654
+ subscriptionOptions: z.array(
655
+ z.object({
656
+ _id: z.string().describe(
657
+ "Subscription option ID (auto-generated upon subscription option creation)."
658
+ ).regex(
659
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
660
+ "Must be a valid GUID"
661
+ ),
662
+ title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
663
+ description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
664
+ subscriptionSettings: z.object({
665
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).optional(),
666
+ autoRenewal: z.boolean().describe(
667
+ "Whether subscription is renewed automatically at the end of each period."
668
+ ).optional(),
669
+ billingCycles: z.number().int().describe(
670
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
671
+ ).min(2).max(999).optional().nullable()
672
+ }).describe(
673
+ "Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
674
+ ).optional(),
675
+ discount: z.object({
676
+ type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).optional(),
677
+ value: z.number().describe("Discount value.").min(0).optional()
678
+ }).describe(
679
+ "Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
680
+ ).optional()
681
+ })
682
+ ).max(100)
683
+ });
684
+ var BulkUpdateSubscriptionOptionsResponse = z.object({
685
+ subscriptionOptions: z.array(
686
+ z.object({
687
+ _id: z.string().describe(
688
+ "Subscription option ID (auto-generated upon subscription option creation)."
689
+ ).regex(
690
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
691
+ "Must be a valid GUID"
692
+ ).optional().nullable(),
693
+ title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
694
+ description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
695
+ subscriptionSettings: z.object({
696
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
697
+ autoRenewal: z.boolean().describe(
698
+ "Whether subscription is renewed automatically at the end of each period."
699
+ ).optional(),
700
+ billingCycles: z.number().int().describe(
701
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
702
+ ).min(2).max(999).optional().nullable()
703
+ }).describe(
704
+ "Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
705
+ ).optional(),
706
+ discount: z.object({
707
+ type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).describe("Discount type.").optional(),
708
+ value: z.number().describe("Discount value.").min(0).optional()
709
+ }).describe(
710
+ "Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
711
+ ).optional()
712
+ })
713
+ ).optional()
714
+ });
715
+ var BulkDeleteSubscriptionOptionsRequest = z.object({
716
+ ids: z.array(z.string()).max(100)
717
+ });
718
+ var BulkDeleteSubscriptionOptionsResponse = z.object({});
719
+ var AssignSubscriptionOptionsToProductRequest = z.object({
720
+ productId: z.string().describe("Product ID.").min(1),
721
+ options: z.object({
722
+ assignedSubscriptionOptions: z.array(
723
+ z.object({
724
+ _id: z.string().describe("Subscription option ID.").regex(
725
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
726
+ "Must be a valid GUID"
727
+ ).optional(),
728
+ hidden: z.boolean().describe(
729
+ "Whether the subscription option is hidden for the product (the default is false)."
730
+ ).optional(),
731
+ title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
732
+ description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
733
+ subscriptionSettings: z.object({
734
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).optional(),
735
+ autoRenewal: z.boolean().describe(
736
+ "Whether subscription is renewed automatically at the end of each period."
737
+ ).optional(),
738
+ billingCycles: z.number().int().describe(
739
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
740
+ ).min(2).max(999).optional().nullable()
741
+ }).describe(
742
+ "Subscription payment settings. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
743
+ ).optional(),
744
+ discount: z.object({
745
+ type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).optional(),
746
+ value: z.number().describe("Discount value.").min(0).optional()
747
+ }).describe("Discount info (optional).").optional()
748
+ })
749
+ ).max(6).optional()
750
+ }).describe("Subscription option assignment options.").optional()
751
+ });
752
+ var AssignSubscriptionOptionsToProductResponse = z.object({});
753
+ var AllowOneTimePurchasesRequest = z.object({
754
+ productId: z.string().describe("Product ID.").min(1),
755
+ allowed: z.boolean().describe(
756
+ "Pass `true` to offer product by subscription and as one-time purchase. Pass `false` to offer product as subscription only."
757
+ )
758
+ });
759
+ var AllowOneTimePurchasesResponse = z.object({});
760
+ var GetSubscriptionOptionRequest = z.object({
761
+ _id: z.string().describe("Subscription option ID.").min(1).regex(
762
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
763
+ "Must be a valid GUID"
764
+ )
765
+ });
766
+ var GetSubscriptionOptionResponse = z.object({
767
+ _id: z.string().describe(
768
+ "Subscription option ID (auto-generated upon subscription option creation)."
769
+ ).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().nullable(),
773
+ title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
774
+ description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
775
+ subscriptionSettings: z.object({
776
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
777
+ autoRenewal: z.boolean().describe(
778
+ "Whether subscription is renewed automatically at the end of each period."
779
+ ).optional(),
780
+ billingCycles: z.number().int().describe(
781
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
782
+ ).min(2).max(999).optional().nullable()
783
+ }).describe(
784
+ "Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
785
+ ).optional(),
786
+ discount: z.object({
787
+ type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).describe("Discount type.").optional(),
788
+ value: z.number().describe("Discount value.").min(0).optional()
789
+ }).describe(
790
+ "Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
791
+ ).optional()
792
+ });
793
+ var GetSubscriptionOptionsForProductRequest = z.object({
794
+ productId: z.string().describe("Product ID.").min(1),
795
+ options: z.object({
796
+ includeHiddenSubscriptionOptions: z.boolean().describe(
797
+ "Whether to include hidden subscription options in the results."
798
+ ).optional()
799
+ }).describe("Options.").optional()
800
+ });
801
+ var GetSubscriptionOptionsForProductResponse = z.object({
802
+ subscriptionOptions: z.array(
803
+ z.object({
804
+ _id: z.string().describe("Subscription option ID.").regex(
805
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
806
+ "Must be a valid GUID"
807
+ ).optional(),
808
+ hidden: z.boolean().describe(
809
+ "Whether the subscription option is hidden for the product (the default is false)."
810
+ ).optional(),
811
+ title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
812
+ description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
813
+ subscriptionSettings: z.object({
814
+ frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
815
+ autoRenewal: z.boolean().describe(
816
+ "Whether subscription is renewed automatically at the end of each period."
817
+ ).optional(),
818
+ billingCycles: z.number().int().describe(
819
+ "Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
820
+ ).min(2).max(999).optional().nullable()
821
+ }).describe(
822
+ "Subscription payment settings. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
823
+ ).optional(),
824
+ discount: z.object({
825
+ type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).describe("Discount type.").optional(),
826
+ value: z.number().describe("Discount value.").min(0).optional()
827
+ }).describe("Discount info (optional).").optional()
828
+ })
829
+ ).optional()
830
+ });
831
+ var GetProductIdsForSubscriptionOptionRequest = z.object({
832
+ _id: z.string().describe("Subscription option ID.").min(1).regex(
833
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
834
+ "Must be a valid GUID"
835
+ ),
836
+ options: z.object({
837
+ includeHiddenProducts: z.boolean().describe("Whether to include hidden products in the returned results.").optional(),
838
+ paging: z.object({
839
+ limit: z.number().int().describe("Amount of items to load per page.").min(0).max(100).optional().nullable(),
840
+ offset: z.number().int().describe(
841
+ "Number of items to skip in the display (relevant for all pages after the first)."
842
+ ).min(0).optional().nullable()
843
+ }).describe("Optional pagination parameters").optional()
844
+ }).describe("Paging and other options.").optional()
845
+ });
846
+ var GetProductIdsForSubscriptionOptionResponse = z.object({
847
+ productIds: z.array(z.string()).optional(),
848
+ metadata: z.object({
849
+ items: z.number().int().describe("Amount of items to load per page.").optional(),
850
+ offset: z.number().int().describe(
851
+ "Number of items to skip in the display (relevant for all pages after the first)."
852
+ ).optional()
853
+ }).describe("Paging metadata.").optional(),
854
+ totalResults: z.number().int().describe("Number of total results.").optional()
855
+ });
856
+ var GetOneTimePurchasesStatusRequest = z.object({
857
+ productId: z.string().describe("Product ID.").min(1)
858
+ });
859
+ var GetOneTimePurchasesStatusResponse = z.object({
860
+ allowed: z.boolean().describe(
861
+ "Whether the specified product is available for one-time purchase"
862
+ ).optional()
863
+ });
864
+
454
865
  // src/stores-v1-subscription-option-subscription-options.universal.ts
455
866
  var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
456
867
  SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
@@ -467,7 +878,10 @@ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
467
878
  return DiscountType2;
468
879
  })(DiscountType || {});
469
880
  async function createSubscriptionOption2(subscriptionOption) {
470
- const { httpClient, sideEffects } = arguments[1];
881
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
882
+ if (validateRequestSchema) {
883
+ CreateSubscriptionOptionRequest.parse({ subscriptionOption });
884
+ }
471
885
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
472
886
  subscriptionOption
473
887
  });
@@ -492,7 +906,10 @@ async function createSubscriptionOption2(subscriptionOption) {
492
906
  }
493
907
  }
494
908
  async function updateSubscriptionOption2(_id, subscriptionOption) {
495
- const { httpClient, sideEffects } = arguments[2];
909
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
910
+ if (validateRequestSchema) {
911
+ UpdateSubscriptionOptionRequest.parse({ _id, subscriptionOption });
912
+ }
496
913
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
497
914
  subscriptionOption: { ...subscriptionOption, id: _id }
498
915
  });
@@ -517,7 +934,10 @@ async function updateSubscriptionOption2(_id, subscriptionOption) {
517
934
  }
518
935
  }
519
936
  async function deleteSubscriptionOption2(_id) {
520
- const { httpClient, sideEffects } = arguments[1];
937
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
938
+ if (validateRequestSchema) {
939
+ DeleteSubscriptionOptionRequest.parse({ _id });
940
+ }
521
941
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
522
942
  const reqOpts = deleteSubscriptionOption(payload);
523
943
  sideEffects?.onSiteCall?.();
@@ -539,7 +959,10 @@ async function deleteSubscriptionOption2(_id) {
539
959
  }
540
960
  }
541
961
  async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
542
- const { httpClient, sideEffects } = arguments[1];
962
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
963
+ if (validateRequestSchema) {
964
+ BulkCreateSubscriptionOptionsRequest.parse({ subscriptionOptions });
965
+ }
543
966
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
544
967
  subscriptionOptions
545
968
  });
@@ -566,7 +989,10 @@ async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
566
989
  }
567
990
  }
568
991
  async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
569
- const { httpClient, sideEffects } = arguments[1];
992
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
993
+ if (validateRequestSchema) {
994
+ BulkUpdateSubscriptionOptionsRequest.parse({ subscriptionOptions });
995
+ }
570
996
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
571
997
  subscriptionOptions
572
998
  });
@@ -593,7 +1019,10 @@ async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
593
1019
  }
594
1020
  }
595
1021
  async function bulkDeleteSubscriptionOptions2(ids) {
596
- const { httpClient, sideEffects } = arguments[1];
1022
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1023
+ if (validateRequestSchema) {
1024
+ BulkDeleteSubscriptionOptionsRequest.parse({ ids });
1025
+ }
597
1026
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ ids });
598
1027
  const reqOpts = bulkDeleteSubscriptionOptions(
599
1028
  payload
@@ -617,7 +1046,13 @@ async function bulkDeleteSubscriptionOptions2(ids) {
617
1046
  }
618
1047
  }
619
1048
  async function assignSubscriptionOptionsToProduct2(productId, options) {
620
- const { httpClient, sideEffects } = arguments[2];
1049
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1050
+ if (validateRequestSchema) {
1051
+ AssignSubscriptionOptionsToProductRequest.parse({
1052
+ productId,
1053
+ options
1054
+ });
1055
+ }
621
1056
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
622
1057
  productId,
623
1058
  assignedSubscriptionOptions: options?.assignedSubscriptionOptions
@@ -647,7 +1082,10 @@ async function assignSubscriptionOptionsToProduct2(productId, options) {
647
1082
  }
648
1083
  }
649
1084
  async function allowOneTimePurchases2(productId, allowed) {
650
- const { httpClient, sideEffects } = arguments[2];
1085
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1086
+ if (validateRequestSchema) {
1087
+ AllowOneTimePurchasesRequest.parse({ productId, allowed });
1088
+ }
651
1089
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
652
1090
  productId,
653
1091
  allowed
@@ -672,7 +1110,10 @@ async function allowOneTimePurchases2(productId, allowed) {
672
1110
  }
673
1111
  }
674
1112
  async function getSubscriptionOption2(_id) {
675
- const { httpClient, sideEffects } = arguments[1];
1113
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1114
+ if (validateRequestSchema) {
1115
+ GetSubscriptionOptionRequest.parse({ _id });
1116
+ }
676
1117
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
677
1118
  const reqOpts = getSubscriptionOption(payload);
678
1119
  sideEffects?.onSiteCall?.();
@@ -695,7 +1136,10 @@ async function getSubscriptionOption2(_id) {
695
1136
  }
696
1137
  }
697
1138
  async function getSubscriptionOptionsForProduct2(productId, options) {
698
- const { httpClient, sideEffects } = arguments[2];
1139
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1140
+ if (validateRequestSchema) {
1141
+ GetSubscriptionOptionsForProductRequest.parse({ productId, options });
1142
+ }
699
1143
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
700
1144
  productId,
701
1145
  includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
@@ -726,7 +1170,10 @@ async function getSubscriptionOptionsForProduct2(productId, options) {
726
1170
  }
727
1171
  }
728
1172
  async function getProductIdsForSubscriptionOption2(_id, options) {
729
- const { httpClient, sideEffects } = arguments[2];
1173
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
1174
+ if (validateRequestSchema) {
1175
+ GetProductIdsForSubscriptionOptionRequest.parse({ _id, options });
1176
+ }
730
1177
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
731
1178
  id: _id,
732
1179
  includeHiddenProducts: options?.includeHiddenProducts,
@@ -759,7 +1206,10 @@ async function getProductIdsForSubscriptionOption2(_id, options) {
759
1206
  }
760
1207
  }
761
1208
  async function getOneTimePurchasesStatus2(productId) {
762
- const { httpClient, sideEffects } = arguments[1];
1209
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
1210
+ if (validateRequestSchema) {
1211
+ GetOneTimePurchasesStatusRequest.parse({ productId });
1212
+ }
763
1213
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
764
1214
  productId
765
1215
  });
@@ -785,93 +1235,93 @@ async function getOneTimePurchasesStatus2(productId) {
785
1235
  }
786
1236
 
787
1237
  // src/stores-v1-subscription-option-subscription-options.public.ts
788
- function createSubscriptionOption3(httpClient) {
1238
+ function createSubscriptionOption3(httpClient, __options) {
789
1239
  return (subscriptionOption) => createSubscriptionOption2(
790
1240
  subscriptionOption,
791
1241
  // @ts-ignore
792
- { httpClient }
1242
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
793
1243
  );
794
1244
  }
795
- function updateSubscriptionOption3(httpClient) {
1245
+ function updateSubscriptionOption3(httpClient, __options) {
796
1246
  return (_id, subscriptionOption) => updateSubscriptionOption2(
797
1247
  _id,
798
1248
  subscriptionOption,
799
1249
  // @ts-ignore
800
- { httpClient }
1250
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
801
1251
  );
802
1252
  }
803
- function deleteSubscriptionOption3(httpClient) {
1253
+ function deleteSubscriptionOption3(httpClient, __options) {
804
1254
  return (_id) => deleteSubscriptionOption2(
805
1255
  _id,
806
1256
  // @ts-ignore
807
- { httpClient }
1257
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
808
1258
  );
809
1259
  }
810
- function bulkCreateSubscriptionOptions3(httpClient) {
1260
+ function bulkCreateSubscriptionOptions3(httpClient, __options) {
811
1261
  return (subscriptionOptions) => bulkCreateSubscriptionOptions2(
812
1262
  subscriptionOptions,
813
1263
  // @ts-ignore
814
- { httpClient }
1264
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
815
1265
  );
816
1266
  }
817
- function bulkUpdateSubscriptionOptions3(httpClient) {
1267
+ function bulkUpdateSubscriptionOptions3(httpClient, __options) {
818
1268
  return (subscriptionOptions) => bulkUpdateSubscriptionOptions2(
819
1269
  subscriptionOptions,
820
1270
  // @ts-ignore
821
- { httpClient }
1271
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
822
1272
  );
823
1273
  }
824
- function bulkDeleteSubscriptionOptions3(httpClient) {
1274
+ function bulkDeleteSubscriptionOptions3(httpClient, __options) {
825
1275
  return (ids) => bulkDeleteSubscriptionOptions2(
826
1276
  ids,
827
1277
  // @ts-ignore
828
- { httpClient }
1278
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
829
1279
  );
830
1280
  }
831
- function assignSubscriptionOptionsToProduct3(httpClient) {
1281
+ function assignSubscriptionOptionsToProduct3(httpClient, __options) {
832
1282
  return (productId, options) => assignSubscriptionOptionsToProduct2(
833
1283
  productId,
834
1284
  options,
835
1285
  // @ts-ignore
836
- { httpClient }
1286
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
837
1287
  );
838
1288
  }
839
- function allowOneTimePurchases3(httpClient) {
1289
+ function allowOneTimePurchases3(httpClient, __options) {
840
1290
  return (productId, allowed) => allowOneTimePurchases2(
841
1291
  productId,
842
1292
  allowed,
843
1293
  // @ts-ignore
844
- { httpClient }
1294
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
845
1295
  );
846
1296
  }
847
- function getSubscriptionOption3(httpClient) {
1297
+ function getSubscriptionOption3(httpClient, __options) {
848
1298
  return (_id) => getSubscriptionOption2(
849
1299
  _id,
850
1300
  // @ts-ignore
851
- { httpClient }
1301
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
852
1302
  );
853
1303
  }
854
- function getSubscriptionOptionsForProduct3(httpClient) {
1304
+ function getSubscriptionOptionsForProduct3(httpClient, __options) {
855
1305
  return (productId, options) => getSubscriptionOptionsForProduct2(
856
1306
  productId,
857
1307
  options,
858
1308
  // @ts-ignore
859
- { httpClient }
1309
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
860
1310
  );
861
1311
  }
862
- function getProductIdsForSubscriptionOption3(httpClient) {
1312
+ function getProductIdsForSubscriptionOption3(httpClient, __options) {
863
1313
  return (_id, options) => getProductIdsForSubscriptionOption2(
864
1314
  _id,
865
1315
  options,
866
1316
  // @ts-ignore
867
- { httpClient }
1317
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
868
1318
  );
869
1319
  }
870
- function getOneTimePurchasesStatus3(httpClient) {
1320
+ function getOneTimePurchasesStatus3(httpClient, __options) {
871
1321
  return (productId) => getOneTimePurchasesStatus2(
872
1322
  productId,
873
1323
  // @ts-ignore
874
- { httpClient }
1324
+ { httpClient, validateRequestSchema: __options?.validateRequestSchema }
875
1325
  );
876
1326
  }
877
1327