@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.
- package/build/cjs/index.d.ts +36 -12
- package/build/cjs/index.js +486 -36
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +462 -12
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +36 -12
- package/build/es/index.mjs +476 -36
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.mjs +452 -12
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +36 -12
- package/build/internal/cjs/index.js +486 -36
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.js +462 -12
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.d.mts +36 -12
- package/build/internal/es/index.mjs +476 -36
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.mjs +452 -12
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -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.typings.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
|
});
|