@moonbase.sh/storefront-api 0.3.38 → 0.4.1

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
@@ -650,6 +650,12 @@ var lineItemProductSchema = z11.object({
650
650
  tagline: z11.string(),
651
651
  iconUrl: z11.string().nullable()
652
652
  });
653
+ var lineItemTotalSchema = z11.object({
654
+ original: moneySchema,
655
+ discount: moneySchema,
656
+ subtotal: moneySchema,
657
+ due: moneySchema
658
+ });
653
659
  var openProductLineItem = z11.object({
654
660
  id: z11.string(),
655
661
  type: z11.literal("Product"),
@@ -660,6 +666,7 @@ var openProductLineItem = z11.object({
660
666
  isSubcriptionPayment: z11.boolean().nullish(),
661
667
  price: priceCollectionSchema.optional(),
662
668
  variation: pricingVariationSchema.optional(),
669
+ total: lineItemTotalSchema.nullish(),
663
670
  product: lineItemProductSchema.optional(),
664
671
  appliedDiscount: discountSchema.optional()
665
672
  });
@@ -683,6 +690,7 @@ var openBundleLineItem = z11.object({
683
690
  isSubcriptionPayment: z11.boolean().nullish(),
684
691
  price: priceCollectionSchema.optional(),
685
692
  variation: pricingVariationSchema.optional(),
693
+ total: lineItemTotalSchema.nullish(),
686
694
  bundle: lineItemBundleSchema.optional(),
687
695
  appliedDiscount: discountSchema.optional()
688
696
  });
@@ -690,21 +698,22 @@ var openOrderLineItem = z11.discriminatedUnion("type", [
690
698
  openProductLineItem,
691
699
  openBundleLineItem
692
700
  ]);
701
+ var orderTotalSchema = z11.object({
702
+ original: moneySchema,
703
+ discount: moneySchema,
704
+ subtotal: moneySchema,
705
+ taxes: moneySchema,
706
+ due: moneySchema
707
+ });
693
708
  var openOrderSchema = z11.object({
694
709
  id: z11.string(),
695
710
  currency: z11.string(),
711
+ total: orderTotalSchema.nullish(),
696
712
  items: openOrderLineItem.array(),
697
713
  couponsApplied: couponSchema.array(),
698
714
  checkoutUrl: z11.string().optional(),
699
715
  embeddedCheckoutUrl: z11.string().optional()
700
716
  });
701
- var orderTotalSchema = z11.object({
702
- original: moneySchema,
703
- discount: moneySchema,
704
- subtotal: moneySchema,
705
- taxes: moneySchema,
706
- due: moneySchema
707
- });
708
717
  var customerSnapshotSchema = z11.object({
709
718
  name: z11.string().nullable(),
710
719
  businessName: z11.string().nullable(),
@@ -802,9 +811,9 @@ var OrderEndpoints = class {
802
811
  constructor(api) {
803
812
  this.api = api;
804
813
  }
805
- async get(orderId, abort) {
806
- const response = await this.api.fetch(`/api/customer/orders/${orderId}`, orderSchema, {
807
- abort
814
+ async get(orderId, options) {
815
+ const response = await this.api.fetch(`/api/customer/orders/${orderId}${(options == null ? void 0 : options.finalize) ? "?finalize=true" : ""}`, orderSchema, {
816
+ abort: options == null ? void 0 : options.abort
808
817
  });
809
818
  return response.data;
810
819
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/storefront-api",
3
3
  "type": "module",
4
- "version": "0.3.38",
4
+ "version": "0.4.1",
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",