@moonbase.sh/storefront-api 1.0.29 → 1.0.31
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/README.md +3 -2
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,8 +51,9 @@ const order = await client.orders.pushContent(
|
|
|
51
51
|
},
|
|
52
52
|
)
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
const redirectUrl = order.hostedCheckoutUrl ?? order.checkoutUrl
|
|
55
|
+
if (redirectUrl)
|
|
56
|
+
window.location.href = redirectUrl
|
|
56
57
|
```
|
|
57
58
|
|
|
58
59
|
### Sign in a customer
|
package/dist/index.cjs
CHANGED
|
@@ -1021,6 +1021,7 @@ var openOrderSchema = import_zod11.z.object({
|
|
|
1021
1021
|
items: openOrderLineItem.array(),
|
|
1022
1022
|
couponsApplied: couponSchema.array(),
|
|
1023
1023
|
checkoutUrl: import_zod11.z.string().optional(),
|
|
1024
|
+
hostedCheckoutUrl: import_zod11.z.string().optional(),
|
|
1024
1025
|
embeddedCheckoutUrl: import_zod11.z.string().optional()
|
|
1025
1026
|
});
|
|
1026
1027
|
var customerSnapshotSchema = import_zod11.z.object({
|
package/dist/index.d.cts
CHANGED
|
@@ -8755,6 +8755,7 @@ declare const openOrderSchema: z.ZodObject<{
|
|
|
8755
8755
|
description: string;
|
|
8756
8756
|
}>, "many">;
|
|
8757
8757
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
8758
|
+
hostedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
8758
8759
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
8759
8760
|
}, "strip", z.ZodTypeAny, {
|
|
8760
8761
|
id: string;
|
|
@@ -8966,6 +8967,7 @@ declare const openOrderSchema: z.ZodObject<{
|
|
|
8966
8967
|
};
|
|
8967
8968
|
} | null | undefined;
|
|
8968
8969
|
checkoutUrl?: string | undefined;
|
|
8970
|
+
hostedCheckoutUrl?: string | undefined;
|
|
8969
8971
|
embeddedCheckoutUrl?: string | undefined;
|
|
8970
8972
|
}, {
|
|
8971
8973
|
id: string;
|
|
@@ -9177,6 +9179,7 @@ declare const openOrderSchema: z.ZodObject<{
|
|
|
9177
9179
|
};
|
|
9178
9180
|
} | null | undefined;
|
|
9179
9181
|
checkoutUrl?: string | undefined;
|
|
9182
|
+
hostedCheckoutUrl?: string | undefined;
|
|
9180
9183
|
embeddedCheckoutUrl?: string | undefined;
|
|
9181
9184
|
}>;
|
|
9182
9185
|
declare const completedOrderSchema: z.ZodObject<{
|
|
@@ -11887,6 +11890,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
11887
11890
|
description: string;
|
|
11888
11891
|
}>, "many">;
|
|
11889
11892
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
11893
|
+
hostedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
11890
11894
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
11891
11895
|
}, {
|
|
11892
11896
|
status: z.ZodLiteral<OrderStatus.Open>;
|
|
@@ -12101,6 +12105,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
12101
12105
|
};
|
|
12102
12106
|
} | null | undefined;
|
|
12103
12107
|
checkoutUrl?: string | undefined;
|
|
12108
|
+
hostedCheckoutUrl?: string | undefined;
|
|
12104
12109
|
embeddedCheckoutUrl?: string | undefined;
|
|
12105
12110
|
}, {
|
|
12106
12111
|
id: string;
|
|
@@ -12313,6 +12318,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
12313
12318
|
};
|
|
12314
12319
|
} | null | undefined;
|
|
12315
12320
|
checkoutUrl?: string | undefined;
|
|
12321
|
+
hostedCheckoutUrl?: string | undefined;
|
|
12316
12322
|
embeddedCheckoutUrl?: string | undefined;
|
|
12317
12323
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
12318
12324
|
id: z.ZodString;
|
|
@@ -13414,6 +13420,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
13414
13420
|
description: string;
|
|
13415
13421
|
}>, "many">;
|
|
13416
13422
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
13423
|
+
hostedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
13417
13424
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
13418
13425
|
}, {
|
|
13419
13426
|
status: z.ZodLiteral<OrderStatus.PaymentProcessing>;
|
|
@@ -13628,6 +13635,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
13628
13635
|
};
|
|
13629
13636
|
} | null | undefined;
|
|
13630
13637
|
checkoutUrl?: string | undefined;
|
|
13638
|
+
hostedCheckoutUrl?: string | undefined;
|
|
13631
13639
|
embeddedCheckoutUrl?: string | undefined;
|
|
13632
13640
|
}, {
|
|
13633
13641
|
id: string;
|
|
@@ -13840,6 +13848,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
13840
13848
|
};
|
|
13841
13849
|
} | null | undefined;
|
|
13842
13850
|
checkoutUrl?: string | undefined;
|
|
13851
|
+
hostedCheckoutUrl?: string | undefined;
|
|
13843
13852
|
embeddedCheckoutUrl?: string | undefined;
|
|
13844
13853
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
13845
13854
|
id: z.ZodString;
|
|
@@ -14941,6 +14950,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
14941
14950
|
description: string;
|
|
14942
14951
|
}>, "many">;
|
|
14943
14952
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
14953
|
+
hostedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
14944
14954
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
14945
14955
|
}, {
|
|
14946
14956
|
status: z.ZodLiteral<OrderStatus.Paid>;
|
|
@@ -15155,6 +15165,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
15155
15165
|
};
|
|
15156
15166
|
} | null | undefined;
|
|
15157
15167
|
checkoutUrl?: string | undefined;
|
|
15168
|
+
hostedCheckoutUrl?: string | undefined;
|
|
15158
15169
|
embeddedCheckoutUrl?: string | undefined;
|
|
15159
15170
|
}, {
|
|
15160
15171
|
id: string;
|
|
@@ -15367,6 +15378,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
15367
15378
|
};
|
|
15368
15379
|
} | null | undefined;
|
|
15369
15380
|
checkoutUrl?: string | undefined;
|
|
15381
|
+
hostedCheckoutUrl?: string | undefined;
|
|
15370
15382
|
embeddedCheckoutUrl?: string | undefined;
|
|
15371
15383
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
15372
15384
|
id: z.ZodString;
|
|
@@ -16468,6 +16480,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
16468
16480
|
description: string;
|
|
16469
16481
|
}>, "many">;
|
|
16470
16482
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
16483
|
+
hostedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
16471
16484
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
16472
16485
|
}, {
|
|
16473
16486
|
status: z.ZodLiteral<OrderStatus.Failed>;
|
|
@@ -16682,6 +16695,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
16682
16695
|
};
|
|
16683
16696
|
} | null | undefined;
|
|
16684
16697
|
checkoutUrl?: string | undefined;
|
|
16698
|
+
hostedCheckoutUrl?: string | undefined;
|
|
16685
16699
|
embeddedCheckoutUrl?: string | undefined;
|
|
16686
16700
|
}, {
|
|
16687
16701
|
id: string;
|
|
@@ -16894,6 +16908,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
16894
16908
|
};
|
|
16895
16909
|
} | null | undefined;
|
|
16896
16910
|
checkoutUrl?: string | undefined;
|
|
16911
|
+
hostedCheckoutUrl?: string | undefined;
|
|
16897
16912
|
embeddedCheckoutUrl?: string | undefined;
|
|
16898
16913
|
}>, z.ZodObject<{
|
|
16899
16914
|
id: z.ZodString;
|
|
@@ -18974,6 +18989,7 @@ declare class OrderEndpoints {
|
|
|
18974
18989
|
};
|
|
18975
18990
|
} | null | undefined;
|
|
18976
18991
|
checkoutUrl?: string | undefined;
|
|
18992
|
+
hostedCheckoutUrl?: string | undefined;
|
|
18977
18993
|
embeddedCheckoutUrl?: string | undefined;
|
|
18978
18994
|
} | {
|
|
18979
18995
|
id: string;
|
|
@@ -19186,6 +19202,7 @@ declare class OrderEndpoints {
|
|
|
19186
19202
|
};
|
|
19187
19203
|
} | null | undefined;
|
|
19188
19204
|
checkoutUrl?: string | undefined;
|
|
19205
|
+
hostedCheckoutUrl?: string | undefined;
|
|
19189
19206
|
embeddedCheckoutUrl?: string | undefined;
|
|
19190
19207
|
} | {
|
|
19191
19208
|
id: string;
|
|
@@ -19398,6 +19415,7 @@ declare class OrderEndpoints {
|
|
|
19398
19415
|
};
|
|
19399
19416
|
} | null | undefined;
|
|
19400
19417
|
checkoutUrl?: string | undefined;
|
|
19418
|
+
hostedCheckoutUrl?: string | undefined;
|
|
19401
19419
|
embeddedCheckoutUrl?: string | undefined;
|
|
19402
19420
|
} | {
|
|
19403
19421
|
id: string;
|
|
@@ -19610,6 +19628,7 @@ declare class OrderEndpoints {
|
|
|
19610
19628
|
};
|
|
19611
19629
|
} | null | undefined;
|
|
19612
19630
|
checkoutUrl?: string | undefined;
|
|
19631
|
+
hostedCheckoutUrl?: string | undefined;
|
|
19613
19632
|
embeddedCheckoutUrl?: string | undefined;
|
|
19614
19633
|
}>;
|
|
19615
19634
|
pushContent(order: {
|
package/dist/index.d.ts
CHANGED
|
@@ -8755,6 +8755,7 @@ declare const openOrderSchema: z.ZodObject<{
|
|
|
8755
8755
|
description: string;
|
|
8756
8756
|
}>, "many">;
|
|
8757
8757
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
8758
|
+
hostedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
8758
8759
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
8759
8760
|
}, "strip", z.ZodTypeAny, {
|
|
8760
8761
|
id: string;
|
|
@@ -8966,6 +8967,7 @@ declare const openOrderSchema: z.ZodObject<{
|
|
|
8966
8967
|
};
|
|
8967
8968
|
} | null | undefined;
|
|
8968
8969
|
checkoutUrl?: string | undefined;
|
|
8970
|
+
hostedCheckoutUrl?: string | undefined;
|
|
8969
8971
|
embeddedCheckoutUrl?: string | undefined;
|
|
8970
8972
|
}, {
|
|
8971
8973
|
id: string;
|
|
@@ -9177,6 +9179,7 @@ declare const openOrderSchema: z.ZodObject<{
|
|
|
9177
9179
|
};
|
|
9178
9180
|
} | null | undefined;
|
|
9179
9181
|
checkoutUrl?: string | undefined;
|
|
9182
|
+
hostedCheckoutUrl?: string | undefined;
|
|
9180
9183
|
embeddedCheckoutUrl?: string | undefined;
|
|
9181
9184
|
}>;
|
|
9182
9185
|
declare const completedOrderSchema: z.ZodObject<{
|
|
@@ -11887,6 +11890,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
11887
11890
|
description: string;
|
|
11888
11891
|
}>, "many">;
|
|
11889
11892
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
11893
|
+
hostedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
11890
11894
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
11891
11895
|
}, {
|
|
11892
11896
|
status: z.ZodLiteral<OrderStatus.Open>;
|
|
@@ -12101,6 +12105,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
12101
12105
|
};
|
|
12102
12106
|
} | null | undefined;
|
|
12103
12107
|
checkoutUrl?: string | undefined;
|
|
12108
|
+
hostedCheckoutUrl?: string | undefined;
|
|
12104
12109
|
embeddedCheckoutUrl?: string | undefined;
|
|
12105
12110
|
}, {
|
|
12106
12111
|
id: string;
|
|
@@ -12313,6 +12318,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
12313
12318
|
};
|
|
12314
12319
|
} | null | undefined;
|
|
12315
12320
|
checkoutUrl?: string | undefined;
|
|
12321
|
+
hostedCheckoutUrl?: string | undefined;
|
|
12316
12322
|
embeddedCheckoutUrl?: string | undefined;
|
|
12317
12323
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
12318
12324
|
id: z.ZodString;
|
|
@@ -13414,6 +13420,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
13414
13420
|
description: string;
|
|
13415
13421
|
}>, "many">;
|
|
13416
13422
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
13423
|
+
hostedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
13417
13424
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
13418
13425
|
}, {
|
|
13419
13426
|
status: z.ZodLiteral<OrderStatus.PaymentProcessing>;
|
|
@@ -13628,6 +13635,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
13628
13635
|
};
|
|
13629
13636
|
} | null | undefined;
|
|
13630
13637
|
checkoutUrl?: string | undefined;
|
|
13638
|
+
hostedCheckoutUrl?: string | undefined;
|
|
13631
13639
|
embeddedCheckoutUrl?: string | undefined;
|
|
13632
13640
|
}, {
|
|
13633
13641
|
id: string;
|
|
@@ -13840,6 +13848,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
13840
13848
|
};
|
|
13841
13849
|
} | null | undefined;
|
|
13842
13850
|
checkoutUrl?: string | undefined;
|
|
13851
|
+
hostedCheckoutUrl?: string | undefined;
|
|
13843
13852
|
embeddedCheckoutUrl?: string | undefined;
|
|
13844
13853
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
13845
13854
|
id: z.ZodString;
|
|
@@ -14941,6 +14950,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
14941
14950
|
description: string;
|
|
14942
14951
|
}>, "many">;
|
|
14943
14952
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
14953
|
+
hostedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
14944
14954
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
14945
14955
|
}, {
|
|
14946
14956
|
status: z.ZodLiteral<OrderStatus.Paid>;
|
|
@@ -15155,6 +15165,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
15155
15165
|
};
|
|
15156
15166
|
} | null | undefined;
|
|
15157
15167
|
checkoutUrl?: string | undefined;
|
|
15168
|
+
hostedCheckoutUrl?: string | undefined;
|
|
15158
15169
|
embeddedCheckoutUrl?: string | undefined;
|
|
15159
15170
|
}, {
|
|
15160
15171
|
id: string;
|
|
@@ -15367,6 +15378,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
15367
15378
|
};
|
|
15368
15379
|
} | null | undefined;
|
|
15369
15380
|
checkoutUrl?: string | undefined;
|
|
15381
|
+
hostedCheckoutUrl?: string | undefined;
|
|
15370
15382
|
embeddedCheckoutUrl?: string | undefined;
|
|
15371
15383
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
15372
15384
|
id: z.ZodString;
|
|
@@ -16468,6 +16480,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
16468
16480
|
description: string;
|
|
16469
16481
|
}>, "many">;
|
|
16470
16482
|
checkoutUrl: z.ZodOptional<z.ZodString>;
|
|
16483
|
+
hostedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
16471
16484
|
embeddedCheckoutUrl: z.ZodOptional<z.ZodString>;
|
|
16472
16485
|
}, {
|
|
16473
16486
|
status: z.ZodLiteral<OrderStatus.Failed>;
|
|
@@ -16682,6 +16695,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
16682
16695
|
};
|
|
16683
16696
|
} | null | undefined;
|
|
16684
16697
|
checkoutUrl?: string | undefined;
|
|
16698
|
+
hostedCheckoutUrl?: string | undefined;
|
|
16685
16699
|
embeddedCheckoutUrl?: string | undefined;
|
|
16686
16700
|
}, {
|
|
16687
16701
|
id: string;
|
|
@@ -16894,6 +16908,7 @@ declare const orderSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<z.obje
|
|
|
16894
16908
|
};
|
|
16895
16909
|
} | null | undefined;
|
|
16896
16910
|
checkoutUrl?: string | undefined;
|
|
16911
|
+
hostedCheckoutUrl?: string | undefined;
|
|
16897
16912
|
embeddedCheckoutUrl?: string | undefined;
|
|
16898
16913
|
}>, z.ZodObject<{
|
|
16899
16914
|
id: z.ZodString;
|
|
@@ -18974,6 +18989,7 @@ declare class OrderEndpoints {
|
|
|
18974
18989
|
};
|
|
18975
18990
|
} | null | undefined;
|
|
18976
18991
|
checkoutUrl?: string | undefined;
|
|
18992
|
+
hostedCheckoutUrl?: string | undefined;
|
|
18977
18993
|
embeddedCheckoutUrl?: string | undefined;
|
|
18978
18994
|
} | {
|
|
18979
18995
|
id: string;
|
|
@@ -19186,6 +19202,7 @@ declare class OrderEndpoints {
|
|
|
19186
19202
|
};
|
|
19187
19203
|
} | null | undefined;
|
|
19188
19204
|
checkoutUrl?: string | undefined;
|
|
19205
|
+
hostedCheckoutUrl?: string | undefined;
|
|
19189
19206
|
embeddedCheckoutUrl?: string | undefined;
|
|
19190
19207
|
} | {
|
|
19191
19208
|
id: string;
|
|
@@ -19398,6 +19415,7 @@ declare class OrderEndpoints {
|
|
|
19398
19415
|
};
|
|
19399
19416
|
} | null | undefined;
|
|
19400
19417
|
checkoutUrl?: string | undefined;
|
|
19418
|
+
hostedCheckoutUrl?: string | undefined;
|
|
19401
19419
|
embeddedCheckoutUrl?: string | undefined;
|
|
19402
19420
|
} | {
|
|
19403
19421
|
id: string;
|
|
@@ -19610,6 +19628,7 @@ declare class OrderEndpoints {
|
|
|
19610
19628
|
};
|
|
19611
19629
|
} | null | undefined;
|
|
19612
19630
|
checkoutUrl?: string | undefined;
|
|
19631
|
+
hostedCheckoutUrl?: string | undefined;
|
|
19613
19632
|
embeddedCheckoutUrl?: string | undefined;
|
|
19614
19633
|
}>;
|
|
19615
19634
|
pushContent(order: {
|
package/dist/index.js
CHANGED
|
@@ -973,6 +973,7 @@ var openOrderSchema = z11.object({
|
|
|
973
973
|
items: openOrderLineItem.array(),
|
|
974
974
|
couponsApplied: couponSchema.array(),
|
|
975
975
|
checkoutUrl: z11.string().optional(),
|
|
976
|
+
hostedCheckoutUrl: z11.string().optional(),
|
|
976
977
|
embeddedCheckoutUrl: z11.string().optional()
|
|
977
978
|
});
|
|
978
979
|
var customerSnapshotSchema = z11.object({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/storefront-api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.31",
|
|
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",
|