@wix/auto_sdk_stores_subscription-options 1.0.61 → 1.0.62
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 +12 -36
- package/build/cjs/index.js +36 -486
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +12 -462
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +12 -36
- package/build/es/index.mjs +36 -476
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.mjs +12 -452
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +12 -36
- package/build/internal/cjs/index.js +36 -486
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.js +12 -462
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.d.mts +12 -36
- package/build/internal/es/index.mjs +36 -476
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.mjs +12 -452
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +2 -2
package/build/es/index.mjs
CHANGED
|
@@ -415,407 +415,6 @@ function getOneTimePurchasesStatus(payload) {
|
|
|
415
415
|
return __getOneTimePurchasesStatus;
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
-
// src/stores-v1-subscription-option-subscription-options.schemas.ts
|
|
419
|
-
import * as z from "zod";
|
|
420
|
-
var CreateSubscriptionOptionRequest = z.object({
|
|
421
|
-
subscriptionOption: z.object({
|
|
422
|
-
_id: z.string().describe(
|
|
423
|
-
"Subscription option ID (auto-generated upon subscription option creation)."
|
|
424
|
-
).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
|
-
).optional().nullable(),
|
|
428
|
-
title: z.string().describe("Subscription option title.").min(1).max(20),
|
|
429
|
-
description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
|
|
430
|
-
subscriptionSettings: z.object({
|
|
431
|
-
frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).optional(),
|
|
432
|
-
autoRenewal: z.boolean().describe(
|
|
433
|
-
"Whether subscription is renewed automatically at the end of each period."
|
|
434
|
-
).optional(),
|
|
435
|
-
billingCycles: z.number().int().describe(
|
|
436
|
-
"Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
|
|
437
|
-
).min(2).max(999).optional().nullable()
|
|
438
|
-
}).describe(
|
|
439
|
-
"Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
|
|
440
|
-
),
|
|
441
|
-
discount: z.object({
|
|
442
|
-
type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).optional(),
|
|
443
|
-
value: z.number().describe("Discount value.").min(0).optional()
|
|
444
|
-
}).describe(
|
|
445
|
-
"Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
|
|
446
|
-
).optional()
|
|
447
|
-
}).describe("Subscription option info.")
|
|
448
|
-
});
|
|
449
|
-
var CreateSubscriptionOptionResponse = z.object({
|
|
450
|
-
_id: z.string().describe(
|
|
451
|
-
"Subscription option ID (auto-generated upon subscription option creation)."
|
|
452
|
-
).regex(
|
|
453
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
454
|
-
"Must be a valid GUID"
|
|
455
|
-
).optional().nullable(),
|
|
456
|
-
title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
|
|
457
|
-
description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
|
|
458
|
-
subscriptionSettings: z.object({
|
|
459
|
-
frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
|
|
460
|
-
autoRenewal: z.boolean().describe(
|
|
461
|
-
"Whether subscription is renewed automatically at the end of each period."
|
|
462
|
-
).optional(),
|
|
463
|
-
billingCycles: z.number().int().describe(
|
|
464
|
-
"Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
|
|
465
|
-
).min(2).max(999).optional().nullable()
|
|
466
|
-
}).describe(
|
|
467
|
-
"Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
|
|
468
|
-
).optional(),
|
|
469
|
-
discount: z.object({
|
|
470
|
-
type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).describe("Discount type.").optional(),
|
|
471
|
-
value: z.number().describe("Discount value.").min(0).optional()
|
|
472
|
-
}).describe(
|
|
473
|
-
"Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
|
|
474
|
-
).optional()
|
|
475
|
-
});
|
|
476
|
-
var UpdateSubscriptionOptionRequest = z.object({
|
|
477
|
-
_id: z.string().describe(
|
|
478
|
-
"Subscription option ID (auto-generated upon subscription option creation)."
|
|
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
|
-
subscriptionOption: z.object({
|
|
484
|
-
_id: z.string().describe(
|
|
485
|
-
"Subscription option ID (auto-generated upon subscription option creation)."
|
|
486
|
-
).regex(
|
|
487
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
488
|
-
"Must be a valid GUID"
|
|
489
|
-
).optional().nullable(),
|
|
490
|
-
title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
|
|
491
|
-
description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
|
|
492
|
-
subscriptionSettings: z.object({
|
|
493
|
-
frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).optional(),
|
|
494
|
-
autoRenewal: z.boolean().describe(
|
|
495
|
-
"Whether subscription is renewed automatically at the end of each period."
|
|
496
|
-
).optional(),
|
|
497
|
-
billingCycles: z.number().int().describe(
|
|
498
|
-
"Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
|
|
499
|
-
).min(2).max(999).optional().nullable()
|
|
500
|
-
}).describe(
|
|
501
|
-
"Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
|
|
502
|
-
).optional(),
|
|
503
|
-
discount: z.object({
|
|
504
|
-
type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).optional(),
|
|
505
|
-
value: z.number().describe("Discount value.").min(0).optional()
|
|
506
|
-
}).describe(
|
|
507
|
-
"Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
|
|
508
|
-
).optional()
|
|
509
|
-
}).describe("Subscription option update options.")
|
|
510
|
-
});
|
|
511
|
-
var UpdateSubscriptionOptionResponse = z.object({
|
|
512
|
-
_id: z.string().describe(
|
|
513
|
-
"Subscription option ID (auto-generated upon subscription option creation)."
|
|
514
|
-
).regex(
|
|
515
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
516
|
-
"Must be a valid GUID"
|
|
517
|
-
).optional().nullable(),
|
|
518
|
-
title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
|
|
519
|
-
description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
|
|
520
|
-
subscriptionSettings: z.object({
|
|
521
|
-
frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
|
|
522
|
-
autoRenewal: z.boolean().describe(
|
|
523
|
-
"Whether subscription is renewed automatically at the end of each period."
|
|
524
|
-
).optional(),
|
|
525
|
-
billingCycles: z.number().int().describe(
|
|
526
|
-
"Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
|
|
527
|
-
).min(2).max(999).optional().nullable()
|
|
528
|
-
}).describe(
|
|
529
|
-
"Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
|
|
530
|
-
).optional(),
|
|
531
|
-
discount: z.object({
|
|
532
|
-
type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).describe("Discount type.").optional(),
|
|
533
|
-
value: z.number().describe("Discount value.").min(0).optional()
|
|
534
|
-
}).describe(
|
|
535
|
-
"Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
|
|
536
|
-
).optional()
|
|
537
|
-
});
|
|
538
|
-
var DeleteSubscriptionOptionRequest = z.object({
|
|
539
|
-
_id: z.string().describe("ID of the subscription option to delete.").min(1).regex(
|
|
540
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
541
|
-
"Must be a valid GUID"
|
|
542
|
-
)
|
|
543
|
-
});
|
|
544
|
-
var DeleteSubscriptionOptionResponse = z.object({});
|
|
545
|
-
var BulkCreateSubscriptionOptionsRequest = z.object({
|
|
546
|
-
subscriptionOptions: z.array(
|
|
547
|
-
z.object({
|
|
548
|
-
_id: z.string().describe(
|
|
549
|
-
"Subscription option ID (auto-generated upon subscription option creation)."
|
|
550
|
-
).regex(
|
|
551
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
552
|
-
"Must be a valid GUID"
|
|
553
|
-
).optional().nullable(),
|
|
554
|
-
title: z.string().describe("Subscription option title.").min(1).max(20),
|
|
555
|
-
description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
|
|
556
|
-
subscriptionSettings: z.object({
|
|
557
|
-
frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).optional(),
|
|
558
|
-
autoRenewal: z.boolean().describe(
|
|
559
|
-
"Whether subscription is renewed automatically at the end of each period."
|
|
560
|
-
).optional(),
|
|
561
|
-
billingCycles: z.number().int().describe(
|
|
562
|
-
"Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
|
|
563
|
-
).min(2).max(999).optional().nullable()
|
|
564
|
-
}).describe(
|
|
565
|
-
"Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
|
|
566
|
-
),
|
|
567
|
-
discount: z.object({
|
|
568
|
-
type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).optional(),
|
|
569
|
-
value: z.number().describe("Discount value.").min(0).optional()
|
|
570
|
-
}).describe(
|
|
571
|
-
"Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
|
|
572
|
-
).optional()
|
|
573
|
-
})
|
|
574
|
-
).max(100)
|
|
575
|
-
});
|
|
576
|
-
var BulkCreateSubscriptionOptionsResponse = z.object({
|
|
577
|
-
subscriptionOptions: z.array(
|
|
578
|
-
z.object({
|
|
579
|
-
_id: z.string().describe(
|
|
580
|
-
"Subscription option ID (auto-generated upon subscription option creation)."
|
|
581
|
-
).regex(
|
|
582
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
583
|
-
"Must be a valid GUID"
|
|
584
|
-
).optional().nullable(),
|
|
585
|
-
title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
|
|
586
|
-
description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
|
|
587
|
-
subscriptionSettings: z.object({
|
|
588
|
-
frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
|
|
589
|
-
autoRenewal: z.boolean().describe(
|
|
590
|
-
"Whether subscription is renewed automatically at the end of each period."
|
|
591
|
-
).optional(),
|
|
592
|
-
billingCycles: z.number().int().describe(
|
|
593
|
-
"Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
|
|
594
|
-
).min(2).max(999).optional().nullable()
|
|
595
|
-
}).describe(
|
|
596
|
-
"Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
|
|
597
|
-
).optional(),
|
|
598
|
-
discount: z.object({
|
|
599
|
-
type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).describe("Discount type.").optional(),
|
|
600
|
-
value: z.number().describe("Discount value.").min(0).optional()
|
|
601
|
-
}).describe(
|
|
602
|
-
"Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
|
|
603
|
-
).optional()
|
|
604
|
-
})
|
|
605
|
-
).optional()
|
|
606
|
-
});
|
|
607
|
-
var BulkUpdateSubscriptionOptionsRequest = z.object({
|
|
608
|
-
subscriptionOptions: z.array(
|
|
609
|
-
z.object({
|
|
610
|
-
_id: z.string().describe(
|
|
611
|
-
"Subscription option ID (auto-generated upon subscription option creation)."
|
|
612
|
-
).regex(
|
|
613
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
614
|
-
"Must be a valid GUID"
|
|
615
|
-
),
|
|
616
|
-
title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
|
|
617
|
-
description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
|
|
618
|
-
subscriptionSettings: z.object({
|
|
619
|
-
frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).optional(),
|
|
620
|
-
autoRenewal: z.boolean().describe(
|
|
621
|
-
"Whether subscription is renewed automatically at the end of each period."
|
|
622
|
-
).optional(),
|
|
623
|
-
billingCycles: z.number().int().describe(
|
|
624
|
-
"Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
|
|
625
|
-
).min(2).max(999).optional().nullable()
|
|
626
|
-
}).describe(
|
|
627
|
-
"Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
|
|
628
|
-
).optional(),
|
|
629
|
-
discount: z.object({
|
|
630
|
-
type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).optional(),
|
|
631
|
-
value: z.number().describe("Discount value.").min(0).optional()
|
|
632
|
-
}).describe(
|
|
633
|
-
"Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
|
|
634
|
-
).optional()
|
|
635
|
-
})
|
|
636
|
-
).max(100)
|
|
637
|
-
});
|
|
638
|
-
var BulkUpdateSubscriptionOptionsResponse = z.object({
|
|
639
|
-
subscriptionOptions: z.array(
|
|
640
|
-
z.object({
|
|
641
|
-
_id: z.string().describe(
|
|
642
|
-
"Subscription option ID (auto-generated upon subscription option creation)."
|
|
643
|
-
).regex(
|
|
644
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
645
|
-
"Must be a valid GUID"
|
|
646
|
-
).optional().nullable(),
|
|
647
|
-
title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
|
|
648
|
-
description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
|
|
649
|
-
subscriptionSettings: z.object({
|
|
650
|
-
frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
|
|
651
|
-
autoRenewal: z.boolean().describe(
|
|
652
|
-
"Whether subscription is renewed automatically at the end of each period."
|
|
653
|
-
).optional(),
|
|
654
|
-
billingCycles: z.number().int().describe(
|
|
655
|
-
"Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
|
|
656
|
-
).min(2).max(999).optional().nullable()
|
|
657
|
-
}).describe(
|
|
658
|
-
"Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
|
|
659
|
-
).optional(),
|
|
660
|
-
discount: z.object({
|
|
661
|
-
type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).describe("Discount type.").optional(),
|
|
662
|
-
value: z.number().describe("Discount value.").min(0).optional()
|
|
663
|
-
}).describe(
|
|
664
|
-
"Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
|
|
665
|
-
).optional()
|
|
666
|
-
})
|
|
667
|
-
).optional()
|
|
668
|
-
});
|
|
669
|
-
var BulkDeleteSubscriptionOptionsRequest = z.object({
|
|
670
|
-
ids: z.array(z.string()).max(100)
|
|
671
|
-
});
|
|
672
|
-
var BulkDeleteSubscriptionOptionsResponse = z.object({});
|
|
673
|
-
var AssignSubscriptionOptionsToProductRequest = z.object({
|
|
674
|
-
productId: z.string().describe("Product ID.").min(1),
|
|
675
|
-
options: z.object({
|
|
676
|
-
assignedSubscriptionOptions: z.array(
|
|
677
|
-
z.object({
|
|
678
|
-
_id: z.string().describe("Subscription option ID.").regex(
|
|
679
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
680
|
-
"Must be a valid GUID"
|
|
681
|
-
).optional(),
|
|
682
|
-
hidden: z.boolean().describe(
|
|
683
|
-
"Whether the subscription option is hidden for the product (the default is false)."
|
|
684
|
-
).optional(),
|
|
685
|
-
title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
|
|
686
|
-
description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
|
|
687
|
-
subscriptionSettings: z.object({
|
|
688
|
-
frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).optional(),
|
|
689
|
-
autoRenewal: z.boolean().describe(
|
|
690
|
-
"Whether subscription is renewed automatically at the end of each period."
|
|
691
|
-
).optional(),
|
|
692
|
-
billingCycles: z.number().int().describe(
|
|
693
|
-
"Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
|
|
694
|
-
).min(2).max(999).optional().nullable()
|
|
695
|
-
}).describe(
|
|
696
|
-
"Subscription payment settings. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
|
|
697
|
-
).optional(),
|
|
698
|
-
discount: z.object({
|
|
699
|
-
type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).optional(),
|
|
700
|
-
value: z.number().describe("Discount value.").min(0).optional()
|
|
701
|
-
}).describe("Discount info (optional).").optional()
|
|
702
|
-
})
|
|
703
|
-
).max(6).optional()
|
|
704
|
-
}).describe("Subscription option assignment options.").optional()
|
|
705
|
-
});
|
|
706
|
-
var AssignSubscriptionOptionsToProductResponse = z.object({});
|
|
707
|
-
var AllowOneTimePurchasesRequest = z.object({
|
|
708
|
-
productId: z.string().describe("Product ID.").min(1),
|
|
709
|
-
allowed: z.boolean().describe(
|
|
710
|
-
"Pass `true` to offer product by subscription and as one-time purchase. Pass `false` to offer product as subscription only."
|
|
711
|
-
)
|
|
712
|
-
});
|
|
713
|
-
var AllowOneTimePurchasesResponse = z.object({});
|
|
714
|
-
var GetSubscriptionOptionRequest = z.object({
|
|
715
|
-
_id: z.string().describe("Subscription option ID.").min(1).regex(
|
|
716
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
717
|
-
"Must be a valid GUID"
|
|
718
|
-
)
|
|
719
|
-
});
|
|
720
|
-
var GetSubscriptionOptionResponse = z.object({
|
|
721
|
-
_id: z.string().describe(
|
|
722
|
-
"Subscription option ID (auto-generated upon subscription option creation)."
|
|
723
|
-
).regex(
|
|
724
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
725
|
-
"Must be a valid GUID"
|
|
726
|
-
).optional().nullable(),
|
|
727
|
-
title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
|
|
728
|
-
description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
|
|
729
|
-
subscriptionSettings: z.object({
|
|
730
|
-
frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
|
|
731
|
-
autoRenewal: z.boolean().describe(
|
|
732
|
-
"Whether subscription is renewed automatically at the end of each period."
|
|
733
|
-
).optional(),
|
|
734
|
-
billingCycles: z.number().int().describe(
|
|
735
|
-
"Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
|
|
736
|
-
).min(2).max(999).optional().nullable()
|
|
737
|
-
}).describe(
|
|
738
|
-
"Subscription charge times. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
|
|
739
|
-
).optional(),
|
|
740
|
-
discount: z.object({
|
|
741
|
-
type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).describe("Discount type.").optional(),
|
|
742
|
-
value: z.number().describe("Discount value.").min(0).optional()
|
|
743
|
-
}).describe(
|
|
744
|
-
"Discount info (optional).\nFor example, a $20 discount would be `value: 20`, `type: AMOUNT`."
|
|
745
|
-
).optional()
|
|
746
|
-
});
|
|
747
|
-
var GetSubscriptionOptionsForProductRequest = z.object({
|
|
748
|
-
productId: z.string().describe("Product ID.").min(1),
|
|
749
|
-
options: z.object({
|
|
750
|
-
includeHiddenSubscriptionOptions: z.boolean().describe(
|
|
751
|
-
"Whether to include hidden subscription options in the results."
|
|
752
|
-
).optional()
|
|
753
|
-
}).describe("Options.").optional()
|
|
754
|
-
});
|
|
755
|
-
var GetSubscriptionOptionsForProductResponse = z.object({
|
|
756
|
-
subscriptionOptions: z.array(
|
|
757
|
-
z.object({
|
|
758
|
-
_id: z.string().describe("Subscription option ID.").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(),
|
|
762
|
-
hidden: z.boolean().describe(
|
|
763
|
-
"Whether the subscription option is hidden for the product (the default is false)."
|
|
764
|
-
).optional(),
|
|
765
|
-
title: z.string().describe("Subscription option title.").min(1).max(20).optional().nullable(),
|
|
766
|
-
description: z.string().describe("Subscription option description (optional).").max(60).optional().nullable(),
|
|
767
|
-
subscriptionSettings: z.object({
|
|
768
|
-
frequency: z.enum(["UNDEFINED", "DAY", "WEEK", "MONTH", "YEAR"]).describe("Frequency of recurring payment.").optional(),
|
|
769
|
-
autoRenewal: z.boolean().describe(
|
|
770
|
-
"Whether subscription is renewed automatically at the end of each period."
|
|
771
|
-
).optional(),
|
|
772
|
-
billingCycles: z.number().int().describe(
|
|
773
|
-
"Number of billing cycles before subscription ends. Ignored if `autoRenewal: true`."
|
|
774
|
-
).min(2).max(999).optional().nullable()
|
|
775
|
-
}).describe(
|
|
776
|
-
"Subscription payment settings. For example, if `frequency: MONTH` and `billingCycles: 6`; payment will be made monthly for 6 months."
|
|
777
|
-
).optional(),
|
|
778
|
-
discount: z.object({
|
|
779
|
-
type: z.enum(["UNDEFINED", "AMOUNT", "PERCENT"]).describe("Discount type.").optional(),
|
|
780
|
-
value: z.number().describe("Discount value.").min(0).optional()
|
|
781
|
-
}).describe("Discount info (optional).").optional()
|
|
782
|
-
})
|
|
783
|
-
).optional()
|
|
784
|
-
});
|
|
785
|
-
var GetProductIdsForSubscriptionOptionRequest = z.object({
|
|
786
|
-
_id: z.string().describe("Subscription option ID.").min(1).regex(
|
|
787
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
788
|
-
"Must be a valid GUID"
|
|
789
|
-
),
|
|
790
|
-
options: z.object({
|
|
791
|
-
includeHiddenProducts: z.boolean().describe("Whether to include hidden products in the returned results.").optional(),
|
|
792
|
-
paging: z.object({
|
|
793
|
-
limit: z.number().int().describe("Amount of items to load per page.").min(0).max(100).optional().nullable(),
|
|
794
|
-
offset: z.number().int().describe(
|
|
795
|
-
"Number of items to skip in the display (relevant for all pages after the first)."
|
|
796
|
-
).min(0).optional().nullable()
|
|
797
|
-
}).describe("Optional pagination parameters").optional()
|
|
798
|
-
}).describe("Paging and other options.").optional()
|
|
799
|
-
});
|
|
800
|
-
var GetProductIdsForSubscriptionOptionResponse = z.object({
|
|
801
|
-
productIds: z.array(z.string()).optional(),
|
|
802
|
-
metadata: z.object({
|
|
803
|
-
items: z.number().int().describe("Amount of items to load per page.").optional(),
|
|
804
|
-
offset: z.number().int().describe(
|
|
805
|
-
"Number of items to skip in the display (relevant for all pages after the first)."
|
|
806
|
-
).optional()
|
|
807
|
-
}).describe("Paging metadata.").optional(),
|
|
808
|
-
totalResults: z.number().int().describe("Number of total results.").optional()
|
|
809
|
-
});
|
|
810
|
-
var GetOneTimePurchasesStatusRequest = z.object({
|
|
811
|
-
productId: z.string().describe("Product ID.").min(1)
|
|
812
|
-
});
|
|
813
|
-
var GetOneTimePurchasesStatusResponse = z.object({
|
|
814
|
-
allowed: z.boolean().describe(
|
|
815
|
-
"Whether the specified product is available for one-time purchase"
|
|
816
|
-
).optional()
|
|
817
|
-
});
|
|
818
|
-
|
|
819
418
|
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
820
419
|
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
821
420
|
SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
|
|
@@ -832,10 +431,7 @@ var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
|
|
|
832
431
|
return DiscountType2;
|
|
833
432
|
})(DiscountType || {});
|
|
834
433
|
async function createSubscriptionOption2(subscriptionOption) {
|
|
835
|
-
const { httpClient, sideEffects
|
|
836
|
-
if (validateRequestSchema) {
|
|
837
|
-
CreateSubscriptionOptionRequest.parse({ subscriptionOption });
|
|
838
|
-
}
|
|
434
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
839
435
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
840
436
|
subscriptionOption
|
|
841
437
|
});
|
|
@@ -860,10 +456,7 @@ async function createSubscriptionOption2(subscriptionOption) {
|
|
|
860
456
|
}
|
|
861
457
|
}
|
|
862
458
|
async function updateSubscriptionOption2(_id, subscriptionOption) {
|
|
863
|
-
const { httpClient, sideEffects
|
|
864
|
-
if (validateRequestSchema) {
|
|
865
|
-
UpdateSubscriptionOptionRequest.parse({ _id, subscriptionOption });
|
|
866
|
-
}
|
|
459
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
867
460
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
868
461
|
subscriptionOption: { ...subscriptionOption, id: _id }
|
|
869
462
|
});
|
|
@@ -888,10 +481,7 @@ async function updateSubscriptionOption2(_id, subscriptionOption) {
|
|
|
888
481
|
}
|
|
889
482
|
}
|
|
890
483
|
async function deleteSubscriptionOption2(_id) {
|
|
891
|
-
const { httpClient, sideEffects
|
|
892
|
-
if (validateRequestSchema) {
|
|
893
|
-
DeleteSubscriptionOptionRequest.parse({ _id });
|
|
894
|
-
}
|
|
484
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
895
485
|
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
896
486
|
const reqOpts = deleteSubscriptionOption(payload);
|
|
897
487
|
sideEffects?.onSiteCall?.();
|
|
@@ -913,10 +503,7 @@ async function deleteSubscriptionOption2(_id) {
|
|
|
913
503
|
}
|
|
914
504
|
}
|
|
915
505
|
async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
|
|
916
|
-
const { httpClient, sideEffects
|
|
917
|
-
if (validateRequestSchema) {
|
|
918
|
-
BulkCreateSubscriptionOptionsRequest.parse({ subscriptionOptions });
|
|
919
|
-
}
|
|
506
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
920
507
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
921
508
|
subscriptionOptions
|
|
922
509
|
});
|
|
@@ -943,10 +530,7 @@ async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
|
|
|
943
530
|
}
|
|
944
531
|
}
|
|
945
532
|
async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
|
|
946
|
-
const { httpClient, sideEffects
|
|
947
|
-
if (validateRequestSchema) {
|
|
948
|
-
BulkUpdateSubscriptionOptionsRequest.parse({ subscriptionOptions });
|
|
949
|
-
}
|
|
533
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
950
534
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
951
535
|
subscriptionOptions
|
|
952
536
|
});
|
|
@@ -973,10 +557,7 @@ async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
|
|
|
973
557
|
}
|
|
974
558
|
}
|
|
975
559
|
async function bulkDeleteSubscriptionOptions2(ids) {
|
|
976
|
-
const { httpClient, sideEffects
|
|
977
|
-
if (validateRequestSchema) {
|
|
978
|
-
BulkDeleteSubscriptionOptionsRequest.parse({ ids });
|
|
979
|
-
}
|
|
560
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
980
561
|
const payload = renameKeysFromSDKRequestToRESTRequest({ ids });
|
|
981
562
|
const reqOpts = bulkDeleteSubscriptionOptions(
|
|
982
563
|
payload
|
|
@@ -1000,13 +581,7 @@ async function bulkDeleteSubscriptionOptions2(ids) {
|
|
|
1000
581
|
}
|
|
1001
582
|
}
|
|
1002
583
|
async function assignSubscriptionOptionsToProduct2(productId, options) {
|
|
1003
|
-
const { httpClient, sideEffects
|
|
1004
|
-
if (validateRequestSchema) {
|
|
1005
|
-
AssignSubscriptionOptionsToProductRequest.parse({
|
|
1006
|
-
productId,
|
|
1007
|
-
options
|
|
1008
|
-
});
|
|
1009
|
-
}
|
|
584
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1010
585
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1011
586
|
productId,
|
|
1012
587
|
assignedSubscriptionOptions: options?.assignedSubscriptionOptions
|
|
@@ -1036,10 +611,7 @@ async function assignSubscriptionOptionsToProduct2(productId, options) {
|
|
|
1036
611
|
}
|
|
1037
612
|
}
|
|
1038
613
|
async function allowOneTimePurchases2(productId, allowed) {
|
|
1039
|
-
const { httpClient, sideEffects
|
|
1040
|
-
if (validateRequestSchema) {
|
|
1041
|
-
AllowOneTimePurchasesRequest.parse({ productId, allowed });
|
|
1042
|
-
}
|
|
614
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1043
615
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1044
616
|
productId,
|
|
1045
617
|
allowed
|
|
@@ -1064,10 +636,7 @@ async function allowOneTimePurchases2(productId, allowed) {
|
|
|
1064
636
|
}
|
|
1065
637
|
}
|
|
1066
638
|
async function getSubscriptionOption2(_id) {
|
|
1067
|
-
const { httpClient, sideEffects
|
|
1068
|
-
if (validateRequestSchema) {
|
|
1069
|
-
GetSubscriptionOptionRequest.parse({ _id });
|
|
1070
|
-
}
|
|
639
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1071
640
|
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
1072
641
|
const reqOpts = getSubscriptionOption(payload);
|
|
1073
642
|
sideEffects?.onSiteCall?.();
|
|
@@ -1090,10 +659,7 @@ async function getSubscriptionOption2(_id) {
|
|
|
1090
659
|
}
|
|
1091
660
|
}
|
|
1092
661
|
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
1093
|
-
const { httpClient, sideEffects
|
|
1094
|
-
if (validateRequestSchema) {
|
|
1095
|
-
GetSubscriptionOptionsForProductRequest.parse({ productId, options });
|
|
1096
|
-
}
|
|
662
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1097
663
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1098
664
|
productId,
|
|
1099
665
|
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
@@ -1124,10 +690,7 @@ async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
|
1124
690
|
}
|
|
1125
691
|
}
|
|
1126
692
|
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
1127
|
-
const { httpClient, sideEffects
|
|
1128
|
-
if (validateRequestSchema) {
|
|
1129
|
-
GetProductIdsForSubscriptionOptionRequest.parse({ _id, options });
|
|
1130
|
-
}
|
|
693
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1131
694
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1132
695
|
id: _id,
|
|
1133
696
|
includeHiddenProducts: options?.includeHiddenProducts,
|
|
@@ -1160,10 +723,7 @@ async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
|
1160
723
|
}
|
|
1161
724
|
}
|
|
1162
725
|
async function getOneTimePurchasesStatus2(productId) {
|
|
1163
|
-
const { httpClient, sideEffects
|
|
1164
|
-
if (validateRequestSchema) {
|
|
1165
|
-
GetOneTimePurchasesStatusRequest.parse({ productId });
|
|
1166
|
-
}
|
|
726
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1167
727
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1168
728
|
productId
|
|
1169
729
|
});
|
|
@@ -1189,93 +749,93 @@ async function getOneTimePurchasesStatus2(productId) {
|
|
|
1189
749
|
}
|
|
1190
750
|
|
|
1191
751
|
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
1192
|
-
function createSubscriptionOption3(httpClient
|
|
752
|
+
function createSubscriptionOption3(httpClient) {
|
|
1193
753
|
return (subscriptionOption) => createSubscriptionOption2(
|
|
1194
754
|
subscriptionOption,
|
|
1195
755
|
// @ts-ignore
|
|
1196
|
-
{ httpClient
|
|
756
|
+
{ httpClient }
|
|
1197
757
|
);
|
|
1198
758
|
}
|
|
1199
|
-
function updateSubscriptionOption3(httpClient
|
|
759
|
+
function updateSubscriptionOption3(httpClient) {
|
|
1200
760
|
return (_id, subscriptionOption) => updateSubscriptionOption2(
|
|
1201
761
|
_id,
|
|
1202
762
|
subscriptionOption,
|
|
1203
763
|
// @ts-ignore
|
|
1204
|
-
{ httpClient
|
|
764
|
+
{ httpClient }
|
|
1205
765
|
);
|
|
1206
766
|
}
|
|
1207
|
-
function deleteSubscriptionOption3(httpClient
|
|
767
|
+
function deleteSubscriptionOption3(httpClient) {
|
|
1208
768
|
return (_id) => deleteSubscriptionOption2(
|
|
1209
769
|
_id,
|
|
1210
770
|
// @ts-ignore
|
|
1211
|
-
{ httpClient
|
|
771
|
+
{ httpClient }
|
|
1212
772
|
);
|
|
1213
773
|
}
|
|
1214
|
-
function bulkCreateSubscriptionOptions3(httpClient
|
|
774
|
+
function bulkCreateSubscriptionOptions3(httpClient) {
|
|
1215
775
|
return (subscriptionOptions) => bulkCreateSubscriptionOptions2(
|
|
1216
776
|
subscriptionOptions,
|
|
1217
777
|
// @ts-ignore
|
|
1218
|
-
{ httpClient
|
|
778
|
+
{ httpClient }
|
|
1219
779
|
);
|
|
1220
780
|
}
|
|
1221
|
-
function bulkUpdateSubscriptionOptions3(httpClient
|
|
781
|
+
function bulkUpdateSubscriptionOptions3(httpClient) {
|
|
1222
782
|
return (subscriptionOptions) => bulkUpdateSubscriptionOptions2(
|
|
1223
783
|
subscriptionOptions,
|
|
1224
784
|
// @ts-ignore
|
|
1225
|
-
{ httpClient
|
|
785
|
+
{ httpClient }
|
|
1226
786
|
);
|
|
1227
787
|
}
|
|
1228
|
-
function bulkDeleteSubscriptionOptions3(httpClient
|
|
788
|
+
function bulkDeleteSubscriptionOptions3(httpClient) {
|
|
1229
789
|
return (ids) => bulkDeleteSubscriptionOptions2(
|
|
1230
790
|
ids,
|
|
1231
791
|
// @ts-ignore
|
|
1232
|
-
{ httpClient
|
|
792
|
+
{ httpClient }
|
|
1233
793
|
);
|
|
1234
794
|
}
|
|
1235
|
-
function assignSubscriptionOptionsToProduct3(httpClient
|
|
795
|
+
function assignSubscriptionOptionsToProduct3(httpClient) {
|
|
1236
796
|
return (productId, options) => assignSubscriptionOptionsToProduct2(
|
|
1237
797
|
productId,
|
|
1238
798
|
options,
|
|
1239
799
|
// @ts-ignore
|
|
1240
|
-
{ httpClient
|
|
800
|
+
{ httpClient }
|
|
1241
801
|
);
|
|
1242
802
|
}
|
|
1243
|
-
function allowOneTimePurchases3(httpClient
|
|
803
|
+
function allowOneTimePurchases3(httpClient) {
|
|
1244
804
|
return (productId, allowed) => allowOneTimePurchases2(
|
|
1245
805
|
productId,
|
|
1246
806
|
allowed,
|
|
1247
807
|
// @ts-ignore
|
|
1248
|
-
{ httpClient
|
|
808
|
+
{ httpClient }
|
|
1249
809
|
);
|
|
1250
810
|
}
|
|
1251
|
-
function getSubscriptionOption3(httpClient
|
|
811
|
+
function getSubscriptionOption3(httpClient) {
|
|
1252
812
|
return (_id) => getSubscriptionOption2(
|
|
1253
813
|
_id,
|
|
1254
814
|
// @ts-ignore
|
|
1255
|
-
{ httpClient
|
|
815
|
+
{ httpClient }
|
|
1256
816
|
);
|
|
1257
817
|
}
|
|
1258
|
-
function getSubscriptionOptionsForProduct3(httpClient
|
|
818
|
+
function getSubscriptionOptionsForProduct3(httpClient) {
|
|
1259
819
|
return (productId, options) => getSubscriptionOptionsForProduct2(
|
|
1260
820
|
productId,
|
|
1261
821
|
options,
|
|
1262
822
|
// @ts-ignore
|
|
1263
|
-
{ httpClient
|
|
823
|
+
{ httpClient }
|
|
1264
824
|
);
|
|
1265
825
|
}
|
|
1266
|
-
function getProductIdsForSubscriptionOption3(httpClient
|
|
826
|
+
function getProductIdsForSubscriptionOption3(httpClient) {
|
|
1267
827
|
return (_id, options) => getProductIdsForSubscriptionOption2(
|
|
1268
828
|
_id,
|
|
1269
829
|
options,
|
|
1270
830
|
// @ts-ignore
|
|
1271
|
-
{ httpClient
|
|
831
|
+
{ httpClient }
|
|
1272
832
|
);
|
|
1273
833
|
}
|
|
1274
|
-
function getOneTimePurchasesStatus3(httpClient
|
|
834
|
+
function getOneTimePurchasesStatus3(httpClient) {
|
|
1275
835
|
return (productId) => getOneTimePurchasesStatus2(
|
|
1276
836
|
productId,
|
|
1277
837
|
// @ts-ignore
|
|
1278
|
-
{ httpClient
|
|
838
|
+
{ httpClient }
|
|
1279
839
|
);
|
|
1280
840
|
}
|
|
1281
841
|
|