@moonbase.sh/vue 0.2.45 → 0.2.46
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 -0
- package/dist/index.js +7 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -313,6 +313,9 @@ var _StorefrontContextImpl = class _StorefrontContextImpl {
|
|
|
313
313
|
try {
|
|
314
314
|
await this.client.orders.removeBillingDetails(this.currentOrder.value.id);
|
|
315
315
|
} catch (err) {
|
|
316
|
+
if (err instanceof import_storefront_api2.NotFoundError) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
316
319
|
console.warn("Could not surrender order:", err);
|
|
317
320
|
}
|
|
318
321
|
}
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { ref as ref2 } from "vue";
|
|
|
5
5
|
// src/context.ts
|
|
6
6
|
import { v4 as uuidv4 } from "uuid";
|
|
7
7
|
import { computed, ref, watch } from "vue";
|
|
8
|
-
import { NotAuthenticatedError, OrderStatus } from "@moonbase.sh/storefront-api";
|
|
8
|
+
import { NotAuthenticatedError, NotFoundError, OrderStatus } from "@moonbase.sh/storefront-api";
|
|
9
9
|
|
|
10
10
|
// src/symbols.ts
|
|
11
11
|
var storefrontKey = Symbol("storefront");
|
|
@@ -278,6 +278,9 @@ var _StorefrontContextImpl = class _StorefrontContextImpl {
|
|
|
278
278
|
try {
|
|
279
279
|
await this.client.orders.removeBillingDetails(this.currentOrder.value.id);
|
|
280
280
|
} catch (err) {
|
|
281
|
+
if (err instanceof NotFoundError) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
281
284
|
console.warn("Could not surrender order:", err);
|
|
282
285
|
}
|
|
283
286
|
}
|
|
@@ -460,7 +463,7 @@ function useActivationRequest(token, context) {
|
|
|
460
463
|
}
|
|
461
464
|
|
|
462
465
|
// src/composables/useVoucher.ts
|
|
463
|
-
import { NotFoundError } from "@moonbase.sh/storefront-api";
|
|
466
|
+
import { NotFoundError as NotFoundError2 } from "@moonbase.sh/storefront-api";
|
|
464
467
|
import { inject as inject7 } from "vue";
|
|
465
468
|
function useVoucher(context) {
|
|
466
469
|
const storefront = context != null ? context : inject7(storefrontKey);
|
|
@@ -471,7 +474,7 @@ function useVoucher(context) {
|
|
|
471
474
|
try {
|
|
472
475
|
return await storefront.client.vouchers.peek(code);
|
|
473
476
|
} catch (e) {
|
|
474
|
-
if (e instanceof
|
|
477
|
+
if (e instanceof NotFoundError2)
|
|
475
478
|
throw new Error("Voucher code invalid");
|
|
476
479
|
throw e;
|
|
477
480
|
}
|
|
@@ -480,7 +483,7 @@ function useVoucher(context) {
|
|
|
480
483
|
try {
|
|
481
484
|
return await storefront.client.vouchers.redeem(code);
|
|
482
485
|
} catch (e) {
|
|
483
|
-
if (e instanceof
|
|
486
|
+
if (e instanceof NotFoundError2)
|
|
484
487
|
throw new Error("Voucher code invalid");
|
|
485
488
|
throw e;
|
|
486
489
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.46",
|
|
5
5
|
"description": "Package to let you build vue.js storefronts with Moonbase.sh as payment and delivery provider",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@vue/devtools-api": "^6.6.3",
|
|
20
20
|
"uuid": "^9.0.1",
|
|
21
21
|
"zod": "^3.23.8",
|
|
22
|
-
"@moonbase.sh/storefront-api": "0.2.
|
|
22
|
+
"@moonbase.sh/storefront-api": "0.2.46"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/uuid": "^9.0.8",
|