@moonbase.sh/storefront-api 0.2.116 → 0.2.119

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
@@ -702,8 +702,10 @@ var OrderEndpoints = class {
702
702
  constructor(api) {
703
703
  this.api = api;
704
704
  }
705
- async get(orderId) {
706
- const response = await this.api.fetch(`/api/customer/orders/${orderId}`, orderSchema);
705
+ async get(orderId, abort) {
706
+ const response = await this.api.fetch(`/api/customer/orders/${orderId}`, orderSchema, {
707
+ abort
708
+ });
707
709
  return response.data;
708
710
  }
709
711
  async pushContent(order, checkout, utm) {
@@ -791,7 +793,8 @@ var MoonbaseApi = class {
791
793
  // Force CORS on all calls
792
794
  "x-mb-cors": "1"
793
795
  },
794
- body: (options == null ? void 0 : options.body) ? contentType !== "application/json" ? options.body : JSON.stringify(options.body) : void 0
796
+ body: (options == null ? void 0 : options.body) ? contentType !== "application/json" ? options.body : JSON.stringify(options.body) : void 0,
797
+ signal: options == null ? void 0 : options.abort
795
798
  });
796
799
  if (response.status >= 400)
797
800
  await handleResponseProblem(response);
package/dist/index.d.cts CHANGED
@@ -225,6 +225,7 @@ interface FetchOptions {
225
225
  method?: HttpMethods;
226
226
  body?: any;
227
227
  contentType?: string;
228
+ abort?: AbortSignal;
228
229
  }
229
230
  declare class MoonbaseApi {
230
231
  baseUrl: string;
@@ -6296,7 +6297,7 @@ type BundleLineItem = z.infer<typeof openBundleLineItem>;
6296
6297
  declare class OrderEndpoints {
6297
6298
  private api;
6298
6299
  constructor(api: MoonbaseApi);
6299
- get(orderId: string): Promise<{
6300
+ get(orderId: string, abort?: AbortSignal): Promise<{
6300
6301
  status: OrderStatus.Open;
6301
6302
  id: string;
6302
6303
  items: ({
@@ -6565,7 +6566,11 @@ declare class OrderEndpoints {
6565
6566
  taxId: string | null;
6566
6567
  };
6567
6568
  }>;
6568
- pushContent(order: Order, checkout?: {
6569
+ pushContent(order: {
6570
+ id: string;
6571
+ currency: string;
6572
+ items: LineItem[];
6573
+ }, checkout?: {
6569
6574
  returnUrl: string;
6570
6575
  }, utm?: UrchinTrackingModule): Promise<OpenOrder>;
6571
6576
  removeBillingDetails(orderId: string): Promise<OpenOrder>;
package/dist/index.d.ts CHANGED
@@ -225,6 +225,7 @@ interface FetchOptions {
225
225
  method?: HttpMethods;
226
226
  body?: any;
227
227
  contentType?: string;
228
+ abort?: AbortSignal;
228
229
  }
229
230
  declare class MoonbaseApi {
230
231
  baseUrl: string;
@@ -6296,7 +6297,7 @@ type BundleLineItem = z.infer<typeof openBundleLineItem>;
6296
6297
  declare class OrderEndpoints {
6297
6298
  private api;
6298
6299
  constructor(api: MoonbaseApi);
6299
- get(orderId: string): Promise<{
6300
+ get(orderId: string, abort?: AbortSignal): Promise<{
6300
6301
  status: OrderStatus.Open;
6301
6302
  id: string;
6302
6303
  items: ({
@@ -6565,7 +6566,11 @@ declare class OrderEndpoints {
6565
6566
  taxId: string | null;
6566
6567
  };
6567
6568
  }>;
6568
- pushContent(order: Order, checkout?: {
6569
+ pushContent(order: {
6570
+ id: string;
6571
+ currency: string;
6572
+ items: LineItem[];
6573
+ }, checkout?: {
6569
6574
  returnUrl: string;
6570
6575
  }, utm?: UrchinTrackingModule): Promise<OpenOrder>;
6571
6576
  removeBillingDetails(orderId: string): Promise<OpenOrder>;
package/dist/index.js CHANGED
@@ -659,8 +659,10 @@ var OrderEndpoints = class {
659
659
  constructor(api) {
660
660
  this.api = api;
661
661
  }
662
- async get(orderId) {
663
- const response = await this.api.fetch(`/api/customer/orders/${orderId}`, orderSchema);
662
+ async get(orderId, abort) {
663
+ const response = await this.api.fetch(`/api/customer/orders/${orderId}`, orderSchema, {
664
+ abort
665
+ });
664
666
  return response.data;
665
667
  }
666
668
  async pushContent(order, checkout, utm) {
@@ -748,7 +750,8 @@ var MoonbaseApi = class {
748
750
  // Force CORS on all calls
749
751
  "x-mb-cors": "1"
750
752
  },
751
- body: (options == null ? void 0 : options.body) ? contentType !== "application/json" ? options.body : JSON.stringify(options.body) : void 0
753
+ body: (options == null ? void 0 : options.body) ? contentType !== "application/json" ? options.body : JSON.stringify(options.body) : void 0,
754
+ signal: options == null ? void 0 : options.abort
752
755
  });
753
756
  if (response.status >= 400)
754
757
  await handleResponseProblem(response);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/storefront-api",
3
3
  "type": "module",
4
- "version": "0.2.116",
4
+ "version": "0.2.119",
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",