@moonbase.sh/api 0.4.47 → 0.4.49

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
@@ -830,8 +830,12 @@ var OrderEndpoints = class {
830
830
  const response = await this.api.fetch(`/api/orders/${id}`);
831
831
  return orderSchema.parse(response.data);
832
832
  }
833
- async prepare(request, returnUrl) {
834
- const response = await this.api.fetch("/api/orders/prepare" + (returnUrl ? `?returnUrl=${encodeURIComponent(returnUrl)}` : ""), "POST", request);
833
+ async prepare(request, returnUrl, finalize) {
834
+ const query = objectToQuery({
835
+ returnUrl,
836
+ finalize: finalize ? "true" : void 0
837
+ });
838
+ const response = await this.api.fetch("/api/orders/prepare?" + query, "POST", request);
835
839
  return orderSchema.parse(response.data);
836
840
  }
837
841
  };
package/dist/index.d.cts CHANGED
@@ -10719,6 +10719,12 @@ type PrepareOrderRequest = {
10719
10719
  * Use with care, as you will be responsible for all communications with the customer.
10720
10720
  */
10721
10721
  communicationsDisabled?: boolean;
10722
+ /**
10723
+ * Optional IP address of the customer requesting this operation.
10724
+ * Will be used when calculating taxes for the order if finalizing pricing,
10725
+ * and if there is not billing address supplied for the customer.
10726
+ */
10727
+ actorIPAddress?: string;
10722
10728
  };
10723
10729
 
10724
10730
  declare class OrderEndpoints {
@@ -10732,7 +10738,7 @@ declare class OrderEndpoints {
10732
10738
  pageSize?: number;
10733
10739
  }): Promise<Page<Order>>;
10734
10740
  get(id: string): Promise<Order>;
10735
- prepare(request: PrepareOrderRequest, returnUrl?: string): Promise<Order>;
10741
+ prepare(request: PrepareOrderRequest, returnUrl?: string, finalize?: boolean): Promise<Order>;
10736
10742
  }
10737
10743
 
10738
10744
  declare const productSchema: z.ZodObject<{
package/dist/index.d.ts CHANGED
@@ -10719,6 +10719,12 @@ type PrepareOrderRequest = {
10719
10719
  * Use with care, as you will be responsible for all communications with the customer.
10720
10720
  */
10721
10721
  communicationsDisabled?: boolean;
10722
+ /**
10723
+ * Optional IP address of the customer requesting this operation.
10724
+ * Will be used when calculating taxes for the order if finalizing pricing,
10725
+ * and if there is not billing address supplied for the customer.
10726
+ */
10727
+ actorIPAddress?: string;
10722
10728
  };
10723
10729
 
10724
10730
  declare class OrderEndpoints {
@@ -10732,7 +10738,7 @@ declare class OrderEndpoints {
10732
10738
  pageSize?: number;
10733
10739
  }): Promise<Page<Order>>;
10734
10740
  get(id: string): Promise<Order>;
10735
- prepare(request: PrepareOrderRequest, returnUrl?: string): Promise<Order>;
10741
+ prepare(request: PrepareOrderRequest, returnUrl?: string, finalize?: boolean): Promise<Order>;
10736
10742
  }
10737
10743
 
10738
10744
  declare const productSchema: z.ZodObject<{
package/dist/index.js CHANGED
@@ -782,8 +782,12 @@ var OrderEndpoints = class {
782
782
  const response = await this.api.fetch(`/api/orders/${id}`);
783
783
  return orderSchema.parse(response.data);
784
784
  }
785
- async prepare(request, returnUrl) {
786
- const response = await this.api.fetch("/api/orders/prepare" + (returnUrl ? `?returnUrl=${encodeURIComponent(returnUrl)}` : ""), "POST", request);
785
+ async prepare(request, returnUrl, finalize) {
786
+ const query = objectToQuery({
787
+ returnUrl,
788
+ finalize: finalize ? "true" : void 0
789
+ });
790
+ const response = await this.api.fetch("/api/orders/prepare?" + query, "POST", request);
787
791
  return orderSchema.parse(response.data);
788
792
  }
789
793
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/api",
3
3
  "type": "module",
4
- "version": "0.4.47",
4
+ "version": "0.4.49",
5
5
  "description": "Package to let you integrate backends with Moonbase.sh as payment and delivery provider",
6
6
  "author": "Tobias Lønnerød Madsen <m@dsen.tv>",
7
7
  "license": "MIT",