@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@frigear-nu/subscriptions",
3
3
  "configKey": "subscriptions",
4
- "version": "0.1.3",
4
+ "version": "0.2.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.3",
7
7
  "unbuild": "unknown"
@@ -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: any;
38
- price: any;
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: any;
41
- price: any;
42
- confirm: () => any;
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: any;
38
- price: any;
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: any;
41
- price: any;
42
- confirm: () => any;
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: any;
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: any;
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 { computed, useCachedFetch } from "#imports";
2
3
  export const PLANS_CLIENT_CACHE_MS = 5 * 60 * 1e3;
3
4
  export const PLANS_KEY = "subscriptions:plans";
4
5
  export const usePlans = () => {
@@ -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: any;
1
+ declare const _default: import("nuxt/app").RouteMiddleware;
2
2
  export default _default;
@@ -1,3 +1,4 @@
1
+ import { defineNuxtRouteMiddleware, navigateTo, useRuntimeConfig, useSubscription } from "#imports";
1
2
  export default defineNuxtRouteMiddleware(async (to) => {
2
3
  const meta = to.meta.subscription;
3
4
  const config = useRuntimeConfig().public.subscriptions;
@@ -1,4 +1,5 @@
1
1
  <script setup>
2
+ import { computed, useLocaleLink, useModuleT, useRuntimeConfig } from "#imports";
2
3
  defineOptions({ name: "SubscriptionCancelPage" });
3
4
  const t = useModuleT("subscriptions.cancel");
4
5
  const { localize } = useLocaleLink();
@@ -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,4 +1,5 @@
1
1
  <script setup>
2
+ import { useModuleT } from "#imports";
2
3
  defineOptions({ name: "UsersAdminCurrentSubscription" });
3
4
  defineProps({
4
5
  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");
@@ -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.1.3",
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.1.4",
39
- "@frigear-nu/mcp": "0.1.3",
40
- "@frigear-nu/module-kit": "1.1.3",
41
- "@frigear-nu/notify": "0.1.3",
42
- "@frigear-nu/stripe": "0.1.3",
43
- "@frigear-nu/ui": "0.1.3",
44
- "@frigear-nu/users": "1.1.4",
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.1.3",
58
- "@frigear-nu/widget": "0.1.3",
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.1.3",
79
- "@frigear-nu/widget": "0.1.3",
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",