@frigear-nu/subscriptions 0.1.3 → 0.2.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/module.json +1 -1
- package/dist/runtime/app/components/SubscriptionPlans.d.vue.ts +51 -5
- package/dist/runtime/app/components/SubscriptionPlans.vue +1 -0
- package/dist/runtime/app/components/SubscriptionPlans.vue.d.ts +51 -5
- package/dist/runtime/app/components/SubscriptionStatus.d.vue.ts +11 -1
- package/dist/runtime/app/components/SubscriptionStatus.vue +1 -0
- package/dist/runtime/app/components/SubscriptionStatus.vue.d.ts +11 -1
- package/dist/runtime/app/components/Users/Admin/Membership.vue +1 -0
- package/dist/runtime/app/composables/usePlans.js +1 -0
- package/dist/runtime/app/composables/useSubscription.js +1 -0
- package/dist/runtime/app/middleware/subscription.d.ts +1 -1
- package/dist/runtime/app/middleware/subscription.js +1 -0
- package/dist/runtime/app/pages/cancel.vue +1 -0
- package/dist/runtime/app/pages/membership.vue +1 -0
- package/dist/runtime/app/pages/success.vue +1 -0
- package/dist/runtime/app/tabs/Membership.vue +1 -0
- package/dist/runtime/app/widgets/AdminCurrentSubscription.vue +1 -0
- package/dist/runtime/app/widgets/MembershipSummary.vue +1 -0
- package/dist/runtime/menus.js +1 -0
- package/package.json +12 -12
package/dist/module.json
CHANGED
|
@@ -34,12 +34,58 @@ declare var __VLS_14: {
|
|
|
34
34
|
pending: any;
|
|
35
35
|
select: () => void;
|
|
36
36
|
}, __VLS_35: {}, __VLS_37: {}, __VLS_66: {
|
|
37
|
-
plan:
|
|
38
|
-
|
|
37
|
+
plan: {
|
|
38
|
+
key: string;
|
|
39
|
+
label: string;
|
|
40
|
+
description?: string | undefined;
|
|
41
|
+
rank: number;
|
|
42
|
+
features?: string[] | undefined;
|
|
43
|
+
prices: {
|
|
44
|
+
id: string;
|
|
45
|
+
amount: number | null;
|
|
46
|
+
currency: string;
|
|
47
|
+
interval: "day" | "week" | "month" | "year";
|
|
48
|
+
intervalCount: number;
|
|
49
|
+
trialPeriodDays: number | null;
|
|
50
|
+
lookupKey: string | null;
|
|
51
|
+
}[];
|
|
52
|
+
} | undefined;
|
|
53
|
+
price: {
|
|
54
|
+
id: string;
|
|
55
|
+
amount: number | null;
|
|
56
|
+
currency: string;
|
|
57
|
+
interval: "day" | "week" | "month" | "year";
|
|
58
|
+
intervalCount: number;
|
|
59
|
+
trialPeriodDays: number | null;
|
|
60
|
+
lookupKey: string | null;
|
|
61
|
+
} | undefined;
|
|
39
62
|
}, __VLS_74: {
|
|
40
|
-
plan:
|
|
41
|
-
|
|
42
|
-
|
|
63
|
+
plan: {
|
|
64
|
+
key: string;
|
|
65
|
+
label: string;
|
|
66
|
+
description?: string | undefined;
|
|
67
|
+
rank: number;
|
|
68
|
+
features?: string[] | undefined;
|
|
69
|
+
prices: {
|
|
70
|
+
id: string;
|
|
71
|
+
amount: number | null;
|
|
72
|
+
currency: string;
|
|
73
|
+
interval: "day" | "week" | "month" | "year";
|
|
74
|
+
intervalCount: number;
|
|
75
|
+
trialPeriodDays: number | null;
|
|
76
|
+
lookupKey: string | null;
|
|
77
|
+
}[];
|
|
78
|
+
} | undefined;
|
|
79
|
+
price: {
|
|
80
|
+
id: string;
|
|
81
|
+
amount: number | null;
|
|
82
|
+
currency: string;
|
|
83
|
+
interval: "day" | "week" | "month" | "year";
|
|
84
|
+
intervalCount: number;
|
|
85
|
+
trialPeriodDays: number | null;
|
|
86
|
+
lookupKey: string | null;
|
|
87
|
+
} | undefined;
|
|
88
|
+
confirm: () => Promise<void> | null;
|
|
43
89
|
};
|
|
44
90
|
type __VLS_Slots = {} & {
|
|
45
91
|
header?: (props: typeof __VLS_14) => any;
|
|
@@ -3,6 +3,7 @@ import { createReusableTemplate } from "@vueuse/core";
|
|
|
3
3
|
import { formatMoney } from "@frigear-nu/ui/money";
|
|
4
4
|
import { usePlans } from "../composables/usePlans";
|
|
5
5
|
import { useSubscription } from "../composables/useSubscription";
|
|
6
|
+
import { computed, navigateTo, ref, useAuthPages, useFormat, useModuleT, useRoute, useRuntimeConfig, useUserSession, watch, watchEffect } from "#imports";
|
|
6
7
|
defineOptions({ name: "SubscriptionPlans" });
|
|
7
8
|
const props = defineProps({
|
|
8
9
|
locale: { type: String, required: false },
|
|
@@ -34,12 +34,58 @@ declare var __VLS_14: {
|
|
|
34
34
|
pending: any;
|
|
35
35
|
select: () => void;
|
|
36
36
|
}, __VLS_35: {}, __VLS_37: {}, __VLS_66: {
|
|
37
|
-
plan:
|
|
38
|
-
|
|
37
|
+
plan: {
|
|
38
|
+
key: string;
|
|
39
|
+
label: string;
|
|
40
|
+
description?: string | undefined;
|
|
41
|
+
rank: number;
|
|
42
|
+
features?: string[] | undefined;
|
|
43
|
+
prices: {
|
|
44
|
+
id: string;
|
|
45
|
+
amount: number | null;
|
|
46
|
+
currency: string;
|
|
47
|
+
interval: "day" | "week" | "month" | "year";
|
|
48
|
+
intervalCount: number;
|
|
49
|
+
trialPeriodDays: number | null;
|
|
50
|
+
lookupKey: string | null;
|
|
51
|
+
}[];
|
|
52
|
+
} | undefined;
|
|
53
|
+
price: {
|
|
54
|
+
id: string;
|
|
55
|
+
amount: number | null;
|
|
56
|
+
currency: string;
|
|
57
|
+
interval: "day" | "week" | "month" | "year";
|
|
58
|
+
intervalCount: number;
|
|
59
|
+
trialPeriodDays: number | null;
|
|
60
|
+
lookupKey: string | null;
|
|
61
|
+
} | undefined;
|
|
39
62
|
}, __VLS_74: {
|
|
40
|
-
plan:
|
|
41
|
-
|
|
42
|
-
|
|
63
|
+
plan: {
|
|
64
|
+
key: string;
|
|
65
|
+
label: string;
|
|
66
|
+
description?: string | undefined;
|
|
67
|
+
rank: number;
|
|
68
|
+
features?: string[] | undefined;
|
|
69
|
+
prices: {
|
|
70
|
+
id: string;
|
|
71
|
+
amount: number | null;
|
|
72
|
+
currency: string;
|
|
73
|
+
interval: "day" | "week" | "month" | "year";
|
|
74
|
+
intervalCount: number;
|
|
75
|
+
trialPeriodDays: number | null;
|
|
76
|
+
lookupKey: string | null;
|
|
77
|
+
}[];
|
|
78
|
+
} | undefined;
|
|
79
|
+
price: {
|
|
80
|
+
id: string;
|
|
81
|
+
amount: number | null;
|
|
82
|
+
currency: string;
|
|
83
|
+
interval: "day" | "week" | "month" | "year";
|
|
84
|
+
intervalCount: number;
|
|
85
|
+
trialPeriodDays: number | null;
|
|
86
|
+
lookupKey: string | null;
|
|
87
|
+
} | undefined;
|
|
88
|
+
confirm: () => Promise<void> | null;
|
|
43
89
|
};
|
|
44
90
|
type __VLS_Slots = {} & {
|
|
45
91
|
header?: (props: typeof __VLS_14) => any;
|
|
@@ -7,7 +7,17 @@ declare var __VLS_9: {}, __VLS_11: {}, __VLS_13: {
|
|
|
7
7
|
subscription: any;
|
|
8
8
|
}, __VLS_15: {
|
|
9
9
|
subscription: any;
|
|
10
|
-
badge:
|
|
10
|
+
badge: {
|
|
11
|
+
status: any;
|
|
12
|
+
label: any;
|
|
13
|
+
color: any;
|
|
14
|
+
icon: string;
|
|
15
|
+
} | {
|
|
16
|
+
status: any;
|
|
17
|
+
label: any;
|
|
18
|
+
color: any;
|
|
19
|
+
icon: undefined;
|
|
20
|
+
};
|
|
11
21
|
}, __VLS_22: {
|
|
12
22
|
subscription: any;
|
|
13
23
|
cancelsAt: any;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { formatDate as formatDateValue } from "@frigear-nu/ui/utils";
|
|
3
3
|
import { usePlans } from "../composables/usePlans";
|
|
4
4
|
import { useSubscription } from "../composables/useSubscription";
|
|
5
|
+
import { computed, statusColor, useFormat, useModuleT } from "#imports";
|
|
5
6
|
defineOptions({ name: "SubscriptionStatus" });
|
|
6
7
|
const props = defineProps({
|
|
7
8
|
locale: { type: String, required: false }
|
|
@@ -7,7 +7,17 @@ declare var __VLS_9: {}, __VLS_11: {}, __VLS_13: {
|
|
|
7
7
|
subscription: any;
|
|
8
8
|
}, __VLS_15: {
|
|
9
9
|
subscription: any;
|
|
10
|
-
badge:
|
|
10
|
+
badge: {
|
|
11
|
+
status: any;
|
|
12
|
+
label: any;
|
|
13
|
+
color: any;
|
|
14
|
+
icon: string;
|
|
15
|
+
} | {
|
|
16
|
+
status: any;
|
|
17
|
+
label: any;
|
|
18
|
+
color: any;
|
|
19
|
+
icon: undefined;
|
|
20
|
+
};
|
|
11
21
|
}, __VLS_22: {
|
|
12
22
|
subscription: any;
|
|
13
23
|
cancelsAt: any;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { subscriptionsApi } from "../../../../utils/api";
|
|
3
|
+
import { $fetch, computed, ref, useAction, useConfirmDialog, useCopyToClipboard, useFormat, useLazyFetch, useModuleT, useToast, watchEffect } from "#imports";
|
|
3
4
|
defineOptions({ name: "UsersAdminMembership" });
|
|
4
5
|
const props = defineProps({
|
|
5
6
|
user: { type: Object, required: true }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { subscriptionsApi } from "../../utils/api.js";
|
|
2
|
+
import { $fetch, computed, navigateTo, ref, toValue, useCachedFetch, useModuleT, useRuntimeConfig, useUserSession, watch } from "#imports";
|
|
2
3
|
const ACTIVE_STATUSES = ["active", "trialing"];
|
|
3
4
|
const CLIENT_CACHE_MS = 60 * 1e3;
|
|
4
5
|
const ME_KEY = "subscriptions:me";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nuxt/app").RouteMiddleware;
|
|
2
2
|
export default _default;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import SubscriptionPlans from "../components/SubscriptionPlans.vue";
|
|
3
3
|
import SubscriptionStatus from "../components/SubscriptionStatus.vue";
|
|
4
4
|
import { useSubscription } from "../composables/useSubscription";
|
|
5
|
+
import { useModuleT, useUserSession } from "#imports";
|
|
5
6
|
defineOptions({ name: "SubscriptionMembershipPage" });
|
|
6
7
|
const t = useModuleT("subscriptions");
|
|
7
8
|
const tm = useModuleT("subscriptions.menu.membership");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useSubscription } from "../composables/useSubscription";
|
|
3
|
+
import { computed, onBeforeUnmount, onMounted, useLocaleLink, useModuleT, useRuntimeConfig } from "#imports";
|
|
3
4
|
defineOptions({ name: "SubscriptionSuccessPage" });
|
|
4
5
|
const t = useModuleT("subscriptions.success");
|
|
5
6
|
const { refresh, isActive } = await useSubscription();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { subscriptionsApi } from "../../utils/api";
|
|
3
|
+
import { computed, emptyCell, h, resolveComponent, useFormat, useLazyFetch, useModuleT } from "#imports";
|
|
3
4
|
defineOptions({ name: "UsersAdminMembershipTab" });
|
|
4
5
|
const props = defineProps({
|
|
5
6
|
user: { type: Object, required: true }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { usePlans } from "../composables/usePlans";
|
|
3
3
|
import { useSubscription } from "../composables/useSubscription";
|
|
4
|
+
import { computed, useFormat, useLocaleLink, useModuleT, useRuntimeConfig } from "#imports";
|
|
4
5
|
defineOptions({ name: "SubscriptionsMembershipSummary" });
|
|
5
6
|
const t = useModuleT("subscriptions.overview");
|
|
6
7
|
const ts = useModuleT("subscriptions.status");
|
package/dist/runtime/menus.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineMenuItem, defineMenuSource, extendMenuItem } from "@frigear-nu/menu/utils";
|
|
2
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
3
|
export default defineMenuSource(() => {
|
|
3
4
|
const config = useRuntimeConfig().public.subscriptions;
|
|
4
5
|
if (config?.pages?.membership) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frigear-nu/subscriptions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Recurring subscriptions (plans, checkout, upgrade/downgrade, billing portal and entitlements) for the frigear ecosystem, built on @frigear-nu/stripe.",
|
|
5
5
|
"homepage": "https://docs.frigear.dev/modules/subscriptions",
|
|
6
6
|
"repository": {
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"playground"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@frigear-nu/auth": "0.
|
|
39
|
-
"@frigear-nu/mcp": "0.
|
|
40
|
-
"@frigear-nu/module-kit": "1.
|
|
41
|
-
"@frigear-nu/notify": "0.
|
|
42
|
-
"@frigear-nu/stripe": "0.
|
|
43
|
-
"@frigear-nu/ui": "0.
|
|
44
|
-
"@frigear-nu/users": "1.
|
|
38
|
+
"@frigear-nu/auth": "0.2.0",
|
|
39
|
+
"@frigear-nu/mcp": "0.2.0",
|
|
40
|
+
"@frigear-nu/module-kit": "1.2.0",
|
|
41
|
+
"@frigear-nu/notify": "0.2.0",
|
|
42
|
+
"@frigear-nu/stripe": "0.2.0",
|
|
43
|
+
"@frigear-nu/ui": "0.2.0",
|
|
44
|
+
"@frigear-nu/users": "1.2.0",
|
|
45
45
|
"@libsql/client": "^0.18.0",
|
|
46
46
|
"@nuxt/kit": "^4.6.1",
|
|
47
47
|
"@vueuse/core": "^15.0.0",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@frigear-nu/email-templates": "0.1.0",
|
|
57
|
-
"@frigear-nu/menu": "0.
|
|
58
|
-
"@frigear-nu/widget": "0.
|
|
57
|
+
"@frigear-nu/menu": "0.2.0",
|
|
58
|
+
"@frigear-nu/widget": "0.2.0",
|
|
59
59
|
"@nuxt/ui": "^4.12.0",
|
|
60
60
|
"@nuxthub/core": "^0.10.8"
|
|
61
61
|
},
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@frigear-nu/email-templates": "0.1.0",
|
|
78
|
-
"@frigear-nu/menu": "0.
|
|
79
|
-
"@frigear-nu/widget": "0.
|
|
78
|
+
"@frigear-nu/menu": "0.2.0",
|
|
79
|
+
"@frigear-nu/widget": "0.2.0",
|
|
80
80
|
"@nuxt/devtools": "^3.4.2",
|
|
81
81
|
"@nuxt/eslint-config": "^1.17.0",
|
|
82
82
|
"@nuxt/module-builder": "^1.0.3",
|