@moonbase.sh/vue 0.2.133 → 0.2.135
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 +16 -6
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -7
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -407,7 +407,7 @@ function useActivationRequest(token, context) {
|
|
|
407
407
|
console.warn("No token given to `useActivationRequest`");
|
|
408
408
|
}
|
|
409
409
|
} catch (err) {
|
|
410
|
-
error.value = err;
|
|
410
|
+
error.value = err.message;
|
|
411
411
|
loading.value = false;
|
|
412
412
|
}
|
|
413
413
|
}, { immediate: true });
|
|
@@ -428,7 +428,7 @@ function useActivationRequest(token, context) {
|
|
|
428
428
|
checkCompletion();
|
|
429
429
|
}
|
|
430
430
|
} catch (e) {
|
|
431
|
-
error.value = e;
|
|
431
|
+
error.value = e.message;
|
|
432
432
|
}
|
|
433
433
|
loading.value = false;
|
|
434
434
|
});
|
|
@@ -451,10 +451,20 @@ function useActivationRequest(token, context) {
|
|
|
451
451
|
},
|
|
452
452
|
fulfillTrial: async () => {
|
|
453
453
|
fulfilling.value = true;
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
454
|
+
try {
|
|
455
|
+
activationRequest.value = await storefront.client.activationRequests.fulfillTrial(activationRequest.value.id);
|
|
456
|
+
fulfilling.value = false;
|
|
457
|
+
completing.value = true;
|
|
458
|
+
const _ = checkCompletion();
|
|
459
|
+
} catch (err) {
|
|
460
|
+
console.warn("Could not fulfill trial: ", err);
|
|
461
|
+
if (err instanceof import_storefront_api3.NotAuthenticatedError) {
|
|
462
|
+
error.value = "You need to be signed in to do this";
|
|
463
|
+
} else {
|
|
464
|
+
error.value = err.message;
|
|
465
|
+
}
|
|
466
|
+
fulfilling.value = false;
|
|
467
|
+
}
|
|
458
468
|
},
|
|
459
469
|
cancel: async () => {
|
|
460
470
|
if (!activationRequest.value || activationRequest.value.status === import_storefront_api3.ActivationRequestStatus.Cancelled)
|
package/dist/index.d.cts
CHANGED
|
@@ -43,7 +43,7 @@ interface ActivationRequestComposable {
|
|
|
43
43
|
loading: Ref<boolean>;
|
|
44
44
|
fulfilling: Ref<boolean>;
|
|
45
45
|
completing: Ref<boolean>;
|
|
46
|
-
error: Ref<null |
|
|
46
|
+
error: Ref<null | string>;
|
|
47
47
|
isInstalled: Ref<boolean>;
|
|
48
48
|
fulfillLicense: () => Promise<void>;
|
|
49
49
|
fulfillTrial: () => Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ interface ActivationRequestComposable {
|
|
|
43
43
|
loading: Ref<boolean>;
|
|
44
44
|
fulfilling: Ref<boolean>;
|
|
45
45
|
completing: Ref<boolean>;
|
|
46
|
-
error: Ref<null |
|
|
46
|
+
error: Ref<null | string>;
|
|
47
47
|
isInstalled: Ref<boolean>;
|
|
48
48
|
fulfillLicense: () => Promise<void>;
|
|
49
49
|
fulfillTrial: () => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -339,7 +339,7 @@ _StorefrontContextImpl.utmKey = "moonbase_utm";
|
|
|
339
339
|
var StorefrontContextImpl = _StorefrontContextImpl;
|
|
340
340
|
|
|
341
341
|
// src/composables/useActivationRequest.ts
|
|
342
|
-
import { ActivationRequestStatus } from "@moonbase.sh/storefront-api";
|
|
342
|
+
import { ActivationRequestStatus, NotAuthenticatedError as NotAuthenticatedError2 } from "@moonbase.sh/storefront-api";
|
|
343
343
|
import { computed, inject, onBeforeUnmount, toValue, watch as watch2 } from "vue";
|
|
344
344
|
function useActivationRequest(token, context) {
|
|
345
345
|
const storefront = context != null ? context : inject(storefrontKey);
|
|
@@ -375,7 +375,7 @@ function useActivationRequest(token, context) {
|
|
|
375
375
|
console.warn("No token given to `useActivationRequest`");
|
|
376
376
|
}
|
|
377
377
|
} catch (err) {
|
|
378
|
-
error.value = err;
|
|
378
|
+
error.value = err.message;
|
|
379
379
|
loading.value = false;
|
|
380
380
|
}
|
|
381
381
|
}, { immediate: true });
|
|
@@ -396,7 +396,7 @@ function useActivationRequest(token, context) {
|
|
|
396
396
|
checkCompletion();
|
|
397
397
|
}
|
|
398
398
|
} catch (e) {
|
|
399
|
-
error.value = e;
|
|
399
|
+
error.value = e.message;
|
|
400
400
|
}
|
|
401
401
|
loading.value = false;
|
|
402
402
|
});
|
|
@@ -419,10 +419,20 @@ function useActivationRequest(token, context) {
|
|
|
419
419
|
},
|
|
420
420
|
fulfillTrial: async () => {
|
|
421
421
|
fulfilling.value = true;
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
422
|
+
try {
|
|
423
|
+
activationRequest.value = await storefront.client.activationRequests.fulfillTrial(activationRequest.value.id);
|
|
424
|
+
fulfilling.value = false;
|
|
425
|
+
completing.value = true;
|
|
426
|
+
const _ = checkCompletion();
|
|
427
|
+
} catch (err) {
|
|
428
|
+
console.warn("Could not fulfill trial: ", err);
|
|
429
|
+
if (err instanceof NotAuthenticatedError2) {
|
|
430
|
+
error.value = "You need to be signed in to do this";
|
|
431
|
+
} else {
|
|
432
|
+
error.value = err.message;
|
|
433
|
+
}
|
|
434
|
+
fulfilling.value = false;
|
|
435
|
+
}
|
|
426
436
|
},
|
|
427
437
|
cancel: async () => {
|
|
428
438
|
if (!activationRequest.value || activationRequest.value.status === ActivationRequestStatus.Cancelled)
|
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.135",
|
|
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.135"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/uuid": "^9.0.8",
|