@moonbase.sh/storefront-api 0.3.37 → 0.4.0
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 +3 -3
- package/dist/index.d.cts +16 -13
- package/dist/index.d.ts +16 -13
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -852,9 +852,9 @@ var OrderEndpoints = class {
|
|
|
852
852
|
constructor(api) {
|
|
853
853
|
this.api = api;
|
|
854
854
|
}
|
|
855
|
-
async get(orderId,
|
|
856
|
-
const response = await this.api.fetch(`/api/customer/orders/${orderId}`, orderSchema, {
|
|
857
|
-
abort
|
|
855
|
+
async get(orderId, options) {
|
|
856
|
+
const response = await this.api.fetch(`/api/customer/orders/${orderId}${(options == null ? void 0 : options.finalize) ? "?finalize=true" : ""}`, orderSchema, {
|
|
857
|
+
abort: options == null ? void 0 : options.abort
|
|
858
858
|
});
|
|
859
859
|
return response.data;
|
|
860
860
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -8960,7 +8960,7 @@ declare const completedOrderSchema: z.ZodObject<{
|
|
|
8960
8960
|
taxId: string | null;
|
|
8961
8961
|
};
|
|
8962
8962
|
}>;
|
|
8963
|
-
declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<
|
|
8963
|
+
declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
8964
8964
|
id: z.ZodString;
|
|
8965
8965
|
currency: z.ZodString;
|
|
8966
8966
|
items: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -9734,9 +9734,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
9734
9734
|
}>, "many">;
|
|
9735
9735
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
9736
9736
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
9737
|
-
}
|
|
9737
|
+
} & {
|
|
9738
9738
|
status: z.ZodLiteral<OrderStatus.Open>;
|
|
9739
|
-
}
|
|
9739
|
+
}, "strip", z.ZodTypeAny, {
|
|
9740
9740
|
id: string;
|
|
9741
9741
|
status: OrderStatus.Open;
|
|
9742
9742
|
currency: string;
|
|
@@ -10038,7 +10038,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
10038
10038
|
}[];
|
|
10039
10039
|
checkoutUrl?: string | undefined;
|
|
10040
10040
|
embeddedCheckoutUrl?: string | undefined;
|
|
10041
|
-
}>, z.ZodObject<
|
|
10041
|
+
}>, z.ZodObject<{
|
|
10042
10042
|
id: z.ZodString;
|
|
10043
10043
|
currency: z.ZodString;
|
|
10044
10044
|
items: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -10812,9 +10812,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
10812
10812
|
}>, "many">;
|
|
10813
10813
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
10814
10814
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
10815
|
-
}
|
|
10815
|
+
} & {
|
|
10816
10816
|
status: z.ZodLiteral<OrderStatus.PaymentProcessing>;
|
|
10817
|
-
}
|
|
10817
|
+
}, "strip", z.ZodTypeAny, {
|
|
10818
10818
|
id: string;
|
|
10819
10819
|
status: OrderStatus.PaymentProcessing;
|
|
10820
10820
|
currency: string;
|
|
@@ -11116,7 +11116,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
11116
11116
|
}[];
|
|
11117
11117
|
checkoutUrl?: string | undefined;
|
|
11118
11118
|
embeddedCheckoutUrl?: string | undefined;
|
|
11119
|
-
}>, z.ZodObject<
|
|
11119
|
+
}>, z.ZodObject<{
|
|
11120
11120
|
id: z.ZodString;
|
|
11121
11121
|
currency: z.ZodString;
|
|
11122
11122
|
items: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -11890,9 +11890,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
11890
11890
|
}>, "many">;
|
|
11891
11891
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
11892
11892
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
11893
|
-
}
|
|
11893
|
+
} & {
|
|
11894
11894
|
status: z.ZodLiteral<OrderStatus.Paid>;
|
|
11895
|
-
}
|
|
11895
|
+
}, "strip", z.ZodTypeAny, {
|
|
11896
11896
|
id: string;
|
|
11897
11897
|
status: OrderStatus.Paid;
|
|
11898
11898
|
currency: string;
|
|
@@ -12194,7 +12194,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
12194
12194
|
}[];
|
|
12195
12195
|
checkoutUrl?: string | undefined;
|
|
12196
12196
|
embeddedCheckoutUrl?: string | undefined;
|
|
12197
|
-
}>, z.ZodObject<
|
|
12197
|
+
}>, z.ZodObject<{
|
|
12198
12198
|
id: z.ZodString;
|
|
12199
12199
|
currency: z.ZodString;
|
|
12200
12200
|
items: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -12968,9 +12968,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
12968
12968
|
}>, "many">;
|
|
12969
12969
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
12970
12970
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
12971
|
-
}
|
|
12971
|
+
} & {
|
|
12972
12972
|
status: z.ZodLiteral<OrderStatus.Failed>;
|
|
12973
|
-
}
|
|
12973
|
+
}, "strip", z.ZodTypeAny, {
|
|
12974
12974
|
id: string;
|
|
12975
12975
|
status: OrderStatus.Failed;
|
|
12976
12976
|
currency: string;
|
|
@@ -14593,7 +14593,10 @@ type BundleLineItem = z.infer<typeof openBundleLineItem>;
|
|
|
14593
14593
|
declare class OrderEndpoints {
|
|
14594
14594
|
private api;
|
|
14595
14595
|
constructor(api: MoonbaseApi);
|
|
14596
|
-
get(orderId: string,
|
|
14596
|
+
get(orderId: string, options?: {
|
|
14597
|
+
abort?: AbortSignal;
|
|
14598
|
+
finalize?: boolean;
|
|
14599
|
+
}): Promise<{
|
|
14597
14600
|
id: string;
|
|
14598
14601
|
status: OrderStatus.Completed;
|
|
14599
14602
|
total: {
|
package/dist/index.d.ts
CHANGED
|
@@ -8960,7 +8960,7 @@ declare const completedOrderSchema: z.ZodObject<{
|
|
|
8960
8960
|
taxId: string | null;
|
|
8961
8961
|
};
|
|
8962
8962
|
}>;
|
|
8963
|
-
declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<
|
|
8963
|
+
declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
|
|
8964
8964
|
id: z.ZodString;
|
|
8965
8965
|
currency: z.ZodString;
|
|
8966
8966
|
items: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -9734,9 +9734,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
9734
9734
|
}>, "many">;
|
|
9735
9735
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
9736
9736
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
9737
|
-
}
|
|
9737
|
+
} & {
|
|
9738
9738
|
status: z.ZodLiteral<OrderStatus.Open>;
|
|
9739
|
-
}
|
|
9739
|
+
}, "strip", z.ZodTypeAny, {
|
|
9740
9740
|
id: string;
|
|
9741
9741
|
status: OrderStatus.Open;
|
|
9742
9742
|
currency: string;
|
|
@@ -10038,7 +10038,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
10038
10038
|
}[];
|
|
10039
10039
|
checkoutUrl?: string | undefined;
|
|
10040
10040
|
embeddedCheckoutUrl?: string | undefined;
|
|
10041
|
-
}>, z.ZodObject<
|
|
10041
|
+
}>, z.ZodObject<{
|
|
10042
10042
|
id: z.ZodString;
|
|
10043
10043
|
currency: z.ZodString;
|
|
10044
10044
|
items: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -10812,9 +10812,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
10812
10812
|
}>, "many">;
|
|
10813
10813
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
10814
10814
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
10815
|
-
}
|
|
10815
|
+
} & {
|
|
10816
10816
|
status: z.ZodLiteral<OrderStatus.PaymentProcessing>;
|
|
10817
|
-
}
|
|
10817
|
+
}, "strip", z.ZodTypeAny, {
|
|
10818
10818
|
id: string;
|
|
10819
10819
|
status: OrderStatus.PaymentProcessing;
|
|
10820
10820
|
currency: string;
|
|
@@ -11116,7 +11116,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
11116
11116
|
}[];
|
|
11117
11117
|
checkoutUrl?: string | undefined;
|
|
11118
11118
|
embeddedCheckoutUrl?: string | undefined;
|
|
11119
|
-
}>, z.ZodObject<
|
|
11119
|
+
}>, z.ZodObject<{
|
|
11120
11120
|
id: z.ZodString;
|
|
11121
11121
|
currency: z.ZodString;
|
|
11122
11122
|
items: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -11890,9 +11890,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
11890
11890
|
}>, "many">;
|
|
11891
11891
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
11892
11892
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
11893
|
-
}
|
|
11893
|
+
} & {
|
|
11894
11894
|
status: z.ZodLiteral<OrderStatus.Paid>;
|
|
11895
|
-
}
|
|
11895
|
+
}, "strip", z.ZodTypeAny, {
|
|
11896
11896
|
id: string;
|
|
11897
11897
|
status: OrderStatus.Paid;
|
|
11898
11898
|
currency: string;
|
|
@@ -12194,7 +12194,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
12194
12194
|
}[];
|
|
12195
12195
|
checkoutUrl?: string | undefined;
|
|
12196
12196
|
embeddedCheckoutUrl?: string | undefined;
|
|
12197
|
-
}>, z.ZodObject<
|
|
12197
|
+
}>, z.ZodObject<{
|
|
12198
12198
|
id: z.ZodString;
|
|
12199
12199
|
currency: z.ZodString;
|
|
12200
12200
|
items: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -12968,9 +12968,9 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
12968
12968
|
}>, "many">;
|
|
12969
12969
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
12970
12970
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
12971
|
-
}
|
|
12971
|
+
} & {
|
|
12972
12972
|
status: z.ZodLiteral<OrderStatus.Failed>;
|
|
12973
|
-
}
|
|
12973
|
+
}, "strip", z.ZodTypeAny, {
|
|
12974
12974
|
id: string;
|
|
12975
12975
|
status: OrderStatus.Failed;
|
|
12976
12976
|
currency: string;
|
|
@@ -14593,7 +14593,10 @@ type BundleLineItem = z.infer<typeof openBundleLineItem>;
|
|
|
14593
14593
|
declare class OrderEndpoints {
|
|
14594
14594
|
private api;
|
|
14595
14595
|
constructor(api: MoonbaseApi);
|
|
14596
|
-
get(orderId: string,
|
|
14596
|
+
get(orderId: string, options?: {
|
|
14597
|
+
abort?: AbortSignal;
|
|
14598
|
+
finalize?: boolean;
|
|
14599
|
+
}): Promise<{
|
|
14597
14600
|
id: string;
|
|
14598
14601
|
status: OrderStatus.Completed;
|
|
14599
14602
|
total: {
|
package/dist/index.js
CHANGED
|
@@ -802,9 +802,9 @@ var OrderEndpoints = class {
|
|
|
802
802
|
constructor(api) {
|
|
803
803
|
this.api = api;
|
|
804
804
|
}
|
|
805
|
-
async get(orderId,
|
|
806
|
-
const response = await this.api.fetch(`/api/customer/orders/${orderId}`, orderSchema, {
|
|
807
|
-
abort
|
|
805
|
+
async get(orderId, options) {
|
|
806
|
+
const response = await this.api.fetch(`/api/customer/orders/${orderId}${(options == null ? void 0 : options.finalize) ? "?finalize=true" : ""}`, orderSchema, {
|
|
807
|
+
abort: options == null ? void 0 : options.abort
|
|
808
808
|
});
|
|
809
809
|
return response.data;
|
|
810
810
|
}
|
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
|
+
"version": "0.4.0",
|
|
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",
|