@moonbase.sh/storefront-api 1.0.17 → 1.0.20

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.js CHANGED
@@ -21,7 +21,8 @@ __export(schemas_exports2, {
21
21
  storefrontBundleSchema: () => storefrontBundleSchema,
22
22
  storefrontOfferSchema: () => storefrontOfferSchema,
23
23
  storefrontProductSchema: () => storefrontProductSchema,
24
- storefrontSchema: () => storefrontSchema
24
+ storefrontSchema: () => storefrontSchema,
25
+ taxEstimateSchema: () => taxEstimateSchema
25
26
  });
26
27
  import { z as z3 } from "zod";
27
28
 
@@ -103,6 +104,9 @@ var pricingVariationSchema = z.object({
103
104
  recurrence: recurrenceSchema,
104
105
  pricingTiers: z.array(pricingTierSchema).nullish()
105
106
  });
107
+ var rawPropertyValueSchema = z.lazy(
108
+ () => z.union([z.string(), z.number(), z.boolean(), z.record(rawPropertyValueSchema)])
109
+ );
106
110
  function paged(itemSchema) {
107
111
  return z.object({
108
112
  items: z.array(itemSchema),
@@ -191,6 +195,7 @@ var storefrontProductSchema = z3.object({
191
195
  downloads: downloadSchema.array().optional(),
192
196
  defaultVariation: pricingVariationSchema.optional(),
193
197
  variations: pricingVariationSchema.array().optional(),
198
+ properties: z3.record(rawPropertyValueSchema).nullish(),
194
199
  type: z3.string().optional().default("Product").pipe(z3.literal("Product"))
195
200
  });
196
201
  var storefrontBundleSchema = z3.object({
@@ -206,6 +211,7 @@ var storefrontBundleSchema = z3.object({
206
211
  })).array(),
207
212
  defaultVariation: pricingVariationSchema.optional(),
208
213
  variations: pricingVariationSchema.array().optional(),
214
+ properties: z3.record(rawPropertyValueSchema).nullish(),
209
215
  type: z3.string().optional().default("Bundle").pipe(z3.literal("Bundle"))
210
216
  });
211
217
  var cartContainsItemsConditionSchema = z3.object({
@@ -221,6 +227,12 @@ var storefrontOfferSchema = z3.object({
221
227
  condition: offerConditionSchema,
222
228
  discount: discountSchema
223
229
  });
230
+ var taxEstimateSchema = z3.object({
231
+ rate: z3.number(),
232
+ mode: z3.enum(["Exclusive", "Inclusive"]),
233
+ countryCode: z3.string(),
234
+ region: z3.string().optional()
235
+ });
224
236
  var storefrontSchema = z3.object({
225
237
  suggestedCurrency: z3.string(),
226
238
  // Enabled currencies need to be optional since we may still have old, cached representations in browsers
@@ -228,7 +240,9 @@ var storefrontSchema = z3.object({
228
240
  products: storefrontProductSchema.array(),
229
241
  bundles: storefrontBundleSchema.array(),
230
242
  // Offers need to be optional since we may still have old, cached representations in browsers
231
- offers: storefrontOfferSchema.array().optional()
243
+ offers: storefrontOfferSchema.array().optional(),
244
+ // Depending on circumstances, we may have a tax estimate available
245
+ estimatedTax: taxEstimateSchema.optional()
232
246
  });
233
247
 
234
248
  // src/activationRequests/models.ts
@@ -390,7 +404,7 @@ import { z as z7 } from "zod";
390
404
 
391
405
  // src/identity/models.ts
392
406
  var ConnectableAccountProvider = /* @__PURE__ */ ((ConnectableAccountProvider2) => {
393
- ConnectableAccountProvider2["ILok"] = "ILok";
407
+ ConnectableAccountProvider2["iLok"] = "iLok";
394
408
  return ConnectableAccountProvider2;
395
409
  })(ConnectableAccountProvider || {});
396
410
 
@@ -408,7 +422,7 @@ var communicationPreferencesSchema = z7.object({
408
422
  // productUpdatesOptIn: z.boolean(), // TODO: Enable when relevant
409
423
  });
410
424
  var ilokConnectedAccountSchema = z7.object({
411
- provider: z7.literal("ILok" /* ILok */),
425
+ provider: z7.literal("iLok" /* iLok */),
412
426
  isConnected: z7.boolean(),
413
427
  pendingLicenseFulfillments: z7.boolean(),
414
428
  accountId: z7.string().nullish()
@@ -625,6 +639,7 @@ var licenseSchema = z8.object({
625
639
  externalFulfillment: externalLicenseContent.optional(),
626
640
  requiredConnectedAccount: z8.nativeEnum(ConnectableAccountProvider).nullish(),
627
641
  fulfillmentMessage: z8.string().optional(),
642
+ properties: z8.record(rawPropertyValueSchema).nullish(),
628
643
  expiresAt: z8.coerce.date().optional(),
629
644
  createdAt: z8.coerce.date()
630
645
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/storefront-api",
3
3
  "type": "module",
4
- "version": "1.0.17",
4
+ "version": "1.0.20",
5
5
  "description": "Package to let you build storefronts with Moonbase.sh as payment and delivery provider",
6
6
  "author": "Tobias Lønnerød Madsen <m@dsen.tv>",
7
7
  "license": "MIT",