@moonbase.sh/storefront-api 0.2.144 → 0.3.0

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/dist/index.cjs CHANGED
@@ -34,6 +34,7 @@ __export(index_exports, {
34
34
  ActivationRequestFulfillmentType: () => ActivationRequestFulfillmentType,
35
35
  ActivationRequestStatus: () => ActivationRequestStatus,
36
36
  ActivationStatus: () => ActivationStatus,
37
+ CycleLength: () => CycleLength,
37
38
  LicenseStatus: () => LicenseStatus,
38
39
  MoonbaseClient: () => MoonbaseClient,
39
40
  MoonbaseError: () => MoonbaseError,
@@ -58,6 +59,31 @@ var import_zod3 = require("zod");
58
59
 
59
60
  // src/globalSchemas.ts
60
61
  var import_zod = require("zod");
62
+
63
+ // src/globalModels.ts
64
+ var CycleLength = /* @__PURE__ */ ((CycleLength2) => {
65
+ CycleLength2["Daily"] = "Daily";
66
+ CycleLength2["Weekly"] = "Weekly";
67
+ CycleLength2["Monthly"] = "Monthly";
68
+ CycleLength2["Quarterly"] = "Quarterly";
69
+ CycleLength2["Yearly"] = "Yearly";
70
+ return CycleLength2;
71
+ })(CycleLength || {});
72
+ function utmToObject(utm) {
73
+ return Object.entries({
74
+ utm_source: utm == null ? void 0 : utm.source,
75
+ utm_medium: utm == null ? void 0 : utm.medium,
76
+ utm_campaign: utm == null ? void 0 : utm.campaign,
77
+ utm_term: utm == null ? void 0 : utm.term,
78
+ utm_content: utm == null ? void 0 : utm.content,
79
+ utm_referrer: utm == null ? void 0 : utm.referrer
80
+ }).filter(([_, value]) => value !== void 0).reduce((obj, [key, value]) => ({
81
+ ...obj,
82
+ [key]: value
83
+ }), {});
84
+ }
85
+
86
+ // src/globalSchemas.ts
61
87
  var priceCollectionSchema = import_zod.z.record(import_zod.z.number());
62
88
  var percentageOffDiscountSchema = import_zod.z.object({
63
89
  type: import_zod.z.literal("PercentageOffDiscount"),
@@ -78,6 +104,10 @@ var discountSchema = import_zod.z.discriminatedUnion("type", [
78
104
  percentageOffDiscountSchema,
79
105
  flatAmountOffDiscountSchema
80
106
  ]);
107
+ var recurrenceSchema = import_zod.z.discriminatedUnion("type", [
108
+ import_zod.z.object({ type: import_zod.z.literal("OneOff") }),
109
+ import_zod.z.object({ type: import_zod.z.literal("Recurring"), cycleLength: import_zod.z.nativeEnum(CycleLength) })
110
+ ]);
81
111
  var pricingTierSchema = import_zod.z.object({
82
112
  minQuantity: import_zod.z.number(),
83
113
  originalPrice: priceCollectionSchema,
@@ -90,6 +120,7 @@ var pricingVariationSchema = import_zod.z.object({
90
120
  price: priceCollectionSchema,
91
121
  hasDiscount: import_zod.z.boolean(),
92
122
  discount: discountSchema.optional(),
123
+ recurrence: recurrenceSchema,
93
124
  pricingTiers: import_zod.z.array(pricingTierSchema).nullish()
94
125
  });
95
126
  function paged(itemSchema) {
@@ -509,6 +540,7 @@ var activationSchema = import_zod8.z.object({
509
540
  name: import_zod8.z.string(),
510
541
  status: import_zod8.z.nativeEnum(ActivationStatus),
511
542
  activationMethod: import_zod8.z.nativeEnum(ActivationMethod),
543
+ firstValidatedAt: import_zod8.z.coerce.date(),
512
544
  lastValidatedAt: import_zod8.z.coerce.date().nullable()
513
545
  });
514
546
 
@@ -635,6 +667,8 @@ var openProductLineItem = import_zod11.z.object({
635
667
  productId: import_zod11.z.string(),
636
668
  quantity: import_zod11.z.number(),
637
669
  variationId: import_zod11.z.string(),
670
+ isDefaultVariation: import_zod11.z.boolean().nullish(),
671
+ isSubcriptionPayment: import_zod11.z.boolean().nullish(),
638
672
  price: priceCollectionSchema.optional(),
639
673
  variation: pricingVariationSchema.optional(),
640
674
  product: lineItemProductSchema.optional(),
@@ -656,6 +690,8 @@ var openBundleLineItem = import_zod11.z.object({
656
690
  quantity: import_zod11.z.number(),
657
691
  variationId: import_zod11.z.string(),
658
692
  partial: import_zod11.z.boolean().optional(),
693
+ isDefaultVariation: import_zod11.z.boolean().nullish(),
694
+ isSubcriptionPayment: import_zod11.z.boolean().nullish(),
659
695
  price: priceCollectionSchema.optional(),
660
696
  variation: pricingVariationSchema.optional(),
661
697
  bundle: lineItemBundleSchema.optional(),
@@ -754,21 +790,6 @@ var OrderEndpoints = class {
754
790
  }
755
791
  };
756
792
 
757
- // src/globalModels.ts
758
- function utmToObject(utm) {
759
- return Object.entries({
760
- utm_source: utm == null ? void 0 : utm.source,
761
- utm_medium: utm == null ? void 0 : utm.medium,
762
- utm_campaign: utm == null ? void 0 : utm.campaign,
763
- utm_term: utm == null ? void 0 : utm.term,
764
- utm_content: utm == null ? void 0 : utm.content,
765
- utm_referrer: utm == null ? void 0 : utm.referrer
766
- }).filter(([_, value]) => value !== void 0).reduce((obj, [key, value]) => ({
767
- ...obj,
768
- [key]: value
769
- }), {});
770
- }
771
-
772
793
  // src/storefront/endpoints.ts
773
794
  var StorefrontEndpoints = class {
774
795
  constructor(api, configuration) {
@@ -1021,6 +1042,7 @@ var MoonbaseClient = class {
1021
1042
  ActivationRequestFulfillmentType,
1022
1043
  ActivationRequestStatus,
1023
1044
  ActivationStatus,
1045
+ CycleLength,
1024
1046
  LicenseStatus,
1025
1047
  MoonbaseClient,
1026
1048
  MoonbaseError,