@moonbase.sh/storefront-api 0.4.1 → 0.4.3

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
@@ -862,7 +862,15 @@ var OrderEndpoints = class {
862
862
  this.api = api;
863
863
  }
864
864
  async get(orderId, options) {
865
- const response = await this.api.fetch(`/api/customer/orders/${orderId}${(options == null ? void 0 : options.finalize) ? "?finalize=true" : ""}`, orderSchema, {
865
+ const query = new URLSearchParams();
866
+ if (options == null ? void 0 : options.finalize) {
867
+ query.append("finalize", "true");
868
+ }
869
+ if (options == null ? void 0 : options.checkout) {
870
+ query.append("checkout", "true");
871
+ query.append("returnUrl", options.checkout.returnUrl);
872
+ }
873
+ const response = await this.api.fetch(`/api/customer/orders/${orderId}?${query.toString()}`, orderSchema, {
866
874
  abort: options == null ? void 0 : options.abort
867
875
  });
868
876
  return response.data;
package/dist/index.d.cts CHANGED
@@ -17806,6 +17806,9 @@ declare class OrderEndpoints {
17806
17806
  get(orderId: string, options?: {
17807
17807
  abort?: AbortSignal;
17808
17808
  finalize?: boolean;
17809
+ checkout?: {
17810
+ returnUrl: string;
17811
+ };
17809
17812
  }): Promise<{
17810
17813
  id: string;
17811
17814
  status: OrderStatus.Completed;
package/dist/index.d.ts CHANGED
@@ -17806,6 +17806,9 @@ declare class OrderEndpoints {
17806
17806
  get(orderId: string, options?: {
17807
17807
  abort?: AbortSignal;
17808
17808
  finalize?: boolean;
17809
+ checkout?: {
17810
+ returnUrl: string;
17811
+ };
17809
17812
  }): Promise<{
17810
17813
  id: string;
17811
17814
  status: OrderStatus.Completed;
package/dist/index.js CHANGED
@@ -812,7 +812,15 @@ var OrderEndpoints = class {
812
812
  this.api = api;
813
813
  }
814
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, {
815
+ const query = new URLSearchParams();
816
+ if (options == null ? void 0 : options.finalize) {
817
+ query.append("finalize", "true");
818
+ }
819
+ if (options == null ? void 0 : options.checkout) {
820
+ query.append("checkout", "true");
821
+ query.append("returnUrl", options.checkout.returnUrl);
822
+ }
823
+ const response = await this.api.fetch(`/api/customer/orders/${orderId}?${query.toString()}`, orderSchema, {
816
824
  abort: options == null ? void 0 : options.abort
817
825
  });
818
826
  return response.data;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/storefront-api",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.4.3",
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",