@m5kdev/backend 0.8.9 → 0.8.10
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/src/modules/auth/auth.dto.d.cts +5 -5
- package/dist/src/modules/auth/auth.dto.d.mts +5 -5
- package/dist/src/modules/auth/auth.lib.d.cts +4 -4
- package/dist/src/modules/auth/auth.lib.d.mts +4 -4
- package/dist/src/modules/auth/auth.trpc.d.cts +12 -12
- package/dist/src/modules/auth/auth.trpc.d.mts +12 -12
- package/dist/src/modules/base/base.repository.cjs +1 -1
- package/dist/src/modules/base/base.repository.mjs +1 -1
- package/dist/src/modules/billing/billing.repository.d.cts +11 -11
- package/dist/src/modules/billing/billing.service.d.cts +7 -7
- package/dist/src/modules/connect/connect.dto.d.cts +10 -10
- package/dist/src/modules/connect/connect.dto.d.mts +10 -10
- package/dist/src/modules/connect/connect.repository.d.cts +7 -7
- package/dist/src/modules/connect/connect.repository.d.mts +7 -7
- package/dist/src/modules/connect/connect.service.d.cts +14 -14
- package/dist/src/modules/connect/connect.service.d.mts +14 -14
- package/dist/src/modules/connect/connect.trpc.d.cts +5 -5
- package/dist/src/modules/connect/connect.trpc.d.mts +5 -5
- package/dist/src/modules/recurrence/recurrence.service.d.cts +3 -3
- package/dist/src/modules/recurrence/recurrence.service.d.mts +3 -3
- package/dist/src/modules/recurrence/recurrence.trpc.d.cts +2 -2
- package/dist/src/modules/recurrence/recurrence.trpc.d.mts +2 -2
- package/dist/src/modules/tag/tag.trpc.d.cts +4 -4
- package/dist/src/modules/tag/tag.trpc.d.mts +4 -4
- package/dist/src/modules/utils/getConditionsFromFilters.cjs +32 -0
- package/dist/src/modules/utils/getConditionsFromFilters.cjs.map +1 -1
- package/dist/src/modules/utils/getConditionsFromFilters.mjs +33 -1
- package/dist/src/modules/utils/getConditionsFromFilters.mjs.map +1 -1
- package/dist/src/types.d.cts +12 -12
- package/dist/src/types.d.mts +12 -12
- package/package.json +3 -3
|
@@ -14,9 +14,9 @@ declare const waitlistSchema: z.ZodObject<{
|
|
|
14
14
|
declare const waitlistOutputSchema: z.ZodObject<{
|
|
15
15
|
id: z.ZodString;
|
|
16
16
|
name: z.ZodNullable<z.ZodString>;
|
|
17
|
-
email: z.ZodNullable<z.ZodString>;
|
|
18
17
|
createdAt: z.ZodDate;
|
|
19
18
|
updatedAt: z.ZodNullable<z.ZodDate>;
|
|
19
|
+
email: z.ZodNullable<z.ZodString>;
|
|
20
20
|
status: z.ZodString;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
22
|
type WaitlistOutput = z.infer<typeof waitlistOutputSchema>;
|
|
@@ -34,9 +34,9 @@ declare const accountClaimSchema: z.ZodObject<{
|
|
|
34
34
|
}, z.core.$strip>;
|
|
35
35
|
declare const accountClaimOutputSchema: z.ZodObject<{
|
|
36
36
|
id: z.ZodString;
|
|
37
|
+
expiresAt: z.ZodNullable<z.ZodDate>;
|
|
37
38
|
createdAt: z.ZodDate;
|
|
38
39
|
updatedAt: z.ZodNullable<z.ZodDate>;
|
|
39
|
-
expiresAt: z.ZodNullable<z.ZodDate>;
|
|
40
40
|
status: z.ZodString;
|
|
41
41
|
claimUserId: z.ZodNullable<z.ZodString>;
|
|
42
42
|
claimedAt: z.ZodNullable<z.ZodDate>;
|
|
@@ -56,10 +56,10 @@ declare const accountClaimMagicLinkSchema: z.ZodObject<{
|
|
|
56
56
|
}, z.core.$strip>;
|
|
57
57
|
declare const accountClaimMagicLinkOutputSchema: z.ZodObject<{
|
|
58
58
|
id: z.ZodString;
|
|
59
|
-
email: z.ZodString;
|
|
60
|
-
createdAt: z.ZodDate;
|
|
61
|
-
expiresAt: z.ZodNullable<z.ZodDate>;
|
|
62
59
|
userId: z.ZodString;
|
|
60
|
+
expiresAt: z.ZodNullable<z.ZodDate>;
|
|
61
|
+
createdAt: z.ZodDate;
|
|
62
|
+
email: z.ZodString;
|
|
63
63
|
claimId: z.ZodString;
|
|
64
64
|
url: z.ZodString;
|
|
65
65
|
}, z.core.$strip>;
|
|
@@ -14,9 +14,9 @@ declare const waitlistSchema: z.ZodObject<{
|
|
|
14
14
|
declare const waitlistOutputSchema: z.ZodObject<{
|
|
15
15
|
id: z.ZodString;
|
|
16
16
|
name: z.ZodNullable<z.ZodString>;
|
|
17
|
-
email: z.ZodNullable<z.ZodString>;
|
|
18
17
|
createdAt: z.ZodDate;
|
|
19
18
|
updatedAt: z.ZodNullable<z.ZodDate>;
|
|
19
|
+
email: z.ZodNullable<z.ZodString>;
|
|
20
20
|
status: z.ZodString;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
22
|
type WaitlistOutput = z.infer<typeof waitlistOutputSchema>;
|
|
@@ -34,9 +34,9 @@ declare const accountClaimSchema: z.ZodObject<{
|
|
|
34
34
|
}, z.core.$strip>;
|
|
35
35
|
declare const accountClaimOutputSchema: z.ZodObject<{
|
|
36
36
|
id: z.ZodString;
|
|
37
|
+
expiresAt: z.ZodNullable<z.ZodDate>;
|
|
37
38
|
createdAt: z.ZodDate;
|
|
38
39
|
updatedAt: z.ZodNullable<z.ZodDate>;
|
|
39
|
-
expiresAt: z.ZodNullable<z.ZodDate>;
|
|
40
40
|
status: z.ZodString;
|
|
41
41
|
claimUserId: z.ZodNullable<z.ZodString>;
|
|
42
42
|
claimedAt: z.ZodNullable<z.ZodDate>;
|
|
@@ -56,10 +56,10 @@ declare const accountClaimMagicLinkSchema: z.ZodObject<{
|
|
|
56
56
|
}, z.core.$strip>;
|
|
57
57
|
declare const accountClaimMagicLinkOutputSchema: z.ZodObject<{
|
|
58
58
|
id: z.ZodString;
|
|
59
|
-
email: z.ZodString;
|
|
60
|
-
createdAt: z.ZodDate;
|
|
61
|
-
expiresAt: z.ZodNullable<z.ZodDate>;
|
|
62
59
|
userId: z.ZodString;
|
|
60
|
+
expiresAt: z.ZodNullable<z.ZodDate>;
|
|
61
|
+
createdAt: z.ZodDate;
|
|
62
|
+
email: z.ZodString;
|
|
63
63
|
claimId: z.ZodString;
|
|
64
64
|
url: z.ZodString;
|
|
65
65
|
}, z.core.$strip>;
|
|
@@ -3279,13 +3279,13 @@ declare function createBetterAuth<O extends Orm, S extends Schema, E extends Ema
|
|
|
3279
3279
|
$Infer: {
|
|
3280
3280
|
body: ({
|
|
3281
3281
|
permission: {
|
|
3282
|
-
readonly user?: ("set-role" | "create" | "update" | "delete" | "list" | "
|
|
3282
|
+
readonly user?: ("get" | "set-role" | "create" | "update" | "delete" | "list" | "ban" | "impersonate" | "set-password")[] | undefined;
|
|
3283
3283
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
3284
3284
|
};
|
|
3285
3285
|
permissions?: never | undefined;
|
|
3286
3286
|
} | {
|
|
3287
3287
|
permissions: {
|
|
3288
|
-
readonly user?: ("set-role" | "create" | "update" | "delete" | "list" | "
|
|
3288
|
+
readonly user?: ("get" | "set-role" | "create" | "update" | "delete" | "list" | "ban" | "impersonate" | "set-password")[] | undefined;
|
|
3289
3289
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
3290
3290
|
};
|
|
3291
3291
|
permission?: never | undefined;
|
|
@@ -4810,7 +4810,7 @@ declare function createBetterAuth<O extends Orm, S extends Schema, E extends Ema
|
|
|
4810
4810
|
socialProviders?: _$better_auth0.SocialProviders | undefined;
|
|
4811
4811
|
account?: {
|
|
4812
4812
|
modelName?: string;
|
|
4813
|
-
fields?: Partial<Record<"
|
|
4813
|
+
fields?: Partial<Record<"userId" | "accessToken" | "refreshToken" | "scope" | "createdAt" | "updatedAt" | "accountId" | "providerId" | "idToken" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "password", string>>;
|
|
4814
4814
|
additionalFields?: {
|
|
4815
4815
|
[key: string]: _$better_auth0.DBFieldAttribute;
|
|
4816
4816
|
};
|
|
@@ -4830,7 +4830,7 @@ declare function createBetterAuth<O extends Orm, S extends Schema, E extends Ema
|
|
|
4830
4830
|
} | undefined;
|
|
4831
4831
|
verification?: {
|
|
4832
4832
|
modelName?: string;
|
|
4833
|
-
fields?: Partial<Record<"
|
|
4833
|
+
fields?: Partial<Record<"expiresAt" | "createdAt" | "updatedAt" | "identifier" | "value", string>>;
|
|
4834
4834
|
additionalFields?: {
|
|
4835
4835
|
[key: string]: _$better_auth0.DBFieldAttribute;
|
|
4836
4836
|
};
|
|
@@ -3279,13 +3279,13 @@ declare function createBetterAuth<O extends Orm, S extends Schema, E extends Ema
|
|
|
3279
3279
|
$Infer: {
|
|
3280
3280
|
body: ({
|
|
3281
3281
|
permission: {
|
|
3282
|
-
readonly user?: ("set-role" | "create" | "update" | "delete" | "list" | "
|
|
3282
|
+
readonly user?: ("get" | "set-role" | "create" | "update" | "delete" | "list" | "ban" | "impersonate" | "set-password")[] | undefined;
|
|
3283
3283
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
3284
3284
|
};
|
|
3285
3285
|
permissions?: never | undefined;
|
|
3286
3286
|
} | {
|
|
3287
3287
|
permissions: {
|
|
3288
|
-
readonly user?: ("set-role" | "create" | "update" | "delete" | "list" | "
|
|
3288
|
+
readonly user?: ("get" | "set-role" | "create" | "update" | "delete" | "list" | "ban" | "impersonate" | "set-password")[] | undefined;
|
|
3289
3289
|
readonly session?: ("delete" | "list" | "revoke")[] | undefined;
|
|
3290
3290
|
};
|
|
3291
3291
|
permission?: never | undefined;
|
|
@@ -4810,7 +4810,7 @@ declare function createBetterAuth<O extends Orm, S extends Schema, E extends Ema
|
|
|
4810
4810
|
socialProviders?: _$better_auth0.SocialProviders | undefined;
|
|
4811
4811
|
account?: {
|
|
4812
4812
|
modelName?: string;
|
|
4813
|
-
fields?: Partial<Record<"
|
|
4813
|
+
fields?: Partial<Record<"userId" | "accessToken" | "refreshToken" | "scope" | "createdAt" | "updatedAt" | "accountId" | "providerId" | "idToken" | "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "password", string>>;
|
|
4814
4814
|
additionalFields?: {
|
|
4815
4815
|
[key: string]: _$better_auth0.DBFieldAttribute;
|
|
4816
4816
|
};
|
|
@@ -4830,7 +4830,7 @@ declare function createBetterAuth<O extends Orm, S extends Schema, E extends Ema
|
|
|
4830
4830
|
} | undefined;
|
|
4831
4831
|
verification?: {
|
|
4832
4832
|
modelName?: string;
|
|
4833
|
-
fields?: Partial<Record<"
|
|
4833
|
+
fields?: Partial<Record<"expiresAt" | "createdAt" | "updatedAt" | "identifier" | "value", string>>;
|
|
4834
4834
|
additionalFields?: {
|
|
4835
4835
|
[key: string]: _$better_auth0.DBFieldAttribute;
|
|
4836
4836
|
};
|
|
@@ -57,9 +57,9 @@ declare function createAuthTRPC({
|
|
|
57
57
|
input: void;
|
|
58
58
|
output: {
|
|
59
59
|
id: string;
|
|
60
|
+
expiresAt: Date | null;
|
|
60
61
|
createdAt: Date;
|
|
61
62
|
updatedAt: Date | null;
|
|
62
|
-
expiresAt: Date | null;
|
|
63
63
|
status: string;
|
|
64
64
|
claimUserId: string | null;
|
|
65
65
|
claimedAt: Date | null;
|
|
@@ -74,10 +74,10 @@ declare function createAuthTRPC({
|
|
|
74
74
|
};
|
|
75
75
|
output: {
|
|
76
76
|
id: string;
|
|
77
|
-
email: string;
|
|
78
|
-
createdAt: Date;
|
|
79
|
-
expiresAt: Date | null;
|
|
80
77
|
userId: string;
|
|
78
|
+
expiresAt: Date | null;
|
|
79
|
+
createdAt: Date;
|
|
80
|
+
email: string;
|
|
81
81
|
claimId: string;
|
|
82
82
|
url: string;
|
|
83
83
|
};
|
|
@@ -89,10 +89,10 @@ declare function createAuthTRPC({
|
|
|
89
89
|
};
|
|
90
90
|
output: {
|
|
91
91
|
id: string;
|
|
92
|
-
email: string;
|
|
93
|
-
createdAt: Date;
|
|
94
|
-
expiresAt: Date | null;
|
|
95
92
|
userId: string;
|
|
93
|
+
expiresAt: Date | null;
|
|
94
|
+
createdAt: Date;
|
|
95
|
+
email: string;
|
|
96
96
|
claimId: string;
|
|
97
97
|
url: string;
|
|
98
98
|
}[];
|
|
@@ -148,9 +148,9 @@ declare function createAuthTRPC({
|
|
|
148
148
|
output: {
|
|
149
149
|
id: string;
|
|
150
150
|
name: string | null;
|
|
151
|
-
email: string | null;
|
|
152
151
|
createdAt: Date;
|
|
153
152
|
updatedAt: Date | null;
|
|
153
|
+
email: string | null;
|
|
154
154
|
status: string;
|
|
155
155
|
}[];
|
|
156
156
|
meta: any;
|
|
@@ -162,9 +162,9 @@ declare function createAuthTRPC({
|
|
|
162
162
|
output: {
|
|
163
163
|
id: string;
|
|
164
164
|
name: string | null;
|
|
165
|
-
email: string | null;
|
|
166
165
|
createdAt: Date;
|
|
167
166
|
updatedAt: Date | null;
|
|
167
|
+
email: string | null;
|
|
168
168
|
status: string;
|
|
169
169
|
};
|
|
170
170
|
meta: any;
|
|
@@ -193,9 +193,9 @@ declare function createAuthTRPC({
|
|
|
193
193
|
output: {
|
|
194
194
|
id: string;
|
|
195
195
|
name: string | null;
|
|
196
|
-
email: string | null;
|
|
197
196
|
createdAt: Date;
|
|
198
197
|
updatedAt: Date | null;
|
|
198
|
+
email: string | null;
|
|
199
199
|
status: string;
|
|
200
200
|
};
|
|
201
201
|
meta: any;
|
|
@@ -207,9 +207,9 @@ declare function createAuthTRPC({
|
|
|
207
207
|
output: {
|
|
208
208
|
id: string;
|
|
209
209
|
name: string | null;
|
|
210
|
-
email: string | null;
|
|
211
210
|
createdAt: Date;
|
|
212
211
|
updatedAt: Date | null;
|
|
212
|
+
email: string | null;
|
|
213
213
|
status: string;
|
|
214
214
|
};
|
|
215
215
|
meta: any;
|
|
@@ -221,9 +221,9 @@ declare function createAuthTRPC({
|
|
|
221
221
|
output: {
|
|
222
222
|
id: string;
|
|
223
223
|
name: string | null;
|
|
224
|
-
email: string | null;
|
|
225
224
|
createdAt: Date;
|
|
226
225
|
updatedAt: Date | null;
|
|
226
|
+
email: string | null;
|
|
227
227
|
status: string;
|
|
228
228
|
};
|
|
229
229
|
meta: any;
|
|
@@ -57,9 +57,9 @@ declare function createAuthTRPC({
|
|
|
57
57
|
input: void;
|
|
58
58
|
output: {
|
|
59
59
|
id: string;
|
|
60
|
+
expiresAt: Date | null;
|
|
60
61
|
createdAt: Date;
|
|
61
62
|
updatedAt: Date | null;
|
|
62
|
-
expiresAt: Date | null;
|
|
63
63
|
status: string;
|
|
64
64
|
claimUserId: string | null;
|
|
65
65
|
claimedAt: Date | null;
|
|
@@ -74,10 +74,10 @@ declare function createAuthTRPC({
|
|
|
74
74
|
};
|
|
75
75
|
output: {
|
|
76
76
|
id: string;
|
|
77
|
-
email: string;
|
|
78
|
-
createdAt: Date;
|
|
79
|
-
expiresAt: Date | null;
|
|
80
77
|
userId: string;
|
|
78
|
+
expiresAt: Date | null;
|
|
79
|
+
createdAt: Date;
|
|
80
|
+
email: string;
|
|
81
81
|
claimId: string;
|
|
82
82
|
url: string;
|
|
83
83
|
};
|
|
@@ -89,10 +89,10 @@ declare function createAuthTRPC({
|
|
|
89
89
|
};
|
|
90
90
|
output: {
|
|
91
91
|
id: string;
|
|
92
|
-
email: string;
|
|
93
|
-
createdAt: Date;
|
|
94
|
-
expiresAt: Date | null;
|
|
95
92
|
userId: string;
|
|
93
|
+
expiresAt: Date | null;
|
|
94
|
+
createdAt: Date;
|
|
95
|
+
email: string;
|
|
96
96
|
claimId: string;
|
|
97
97
|
url: string;
|
|
98
98
|
}[];
|
|
@@ -148,9 +148,9 @@ declare function createAuthTRPC({
|
|
|
148
148
|
output: {
|
|
149
149
|
id: string;
|
|
150
150
|
name: string | null;
|
|
151
|
-
email: string | null;
|
|
152
151
|
createdAt: Date;
|
|
153
152
|
updatedAt: Date | null;
|
|
153
|
+
email: string | null;
|
|
154
154
|
status: string;
|
|
155
155
|
}[];
|
|
156
156
|
meta: any;
|
|
@@ -162,9 +162,9 @@ declare function createAuthTRPC({
|
|
|
162
162
|
output: {
|
|
163
163
|
id: string;
|
|
164
164
|
name: string | null;
|
|
165
|
-
email: string | null;
|
|
166
165
|
createdAt: Date;
|
|
167
166
|
updatedAt: Date | null;
|
|
167
|
+
email: string | null;
|
|
168
168
|
status: string;
|
|
169
169
|
};
|
|
170
170
|
meta: any;
|
|
@@ -193,9 +193,9 @@ declare function createAuthTRPC({
|
|
|
193
193
|
output: {
|
|
194
194
|
id: string;
|
|
195
195
|
name: string | null;
|
|
196
|
-
email: string | null;
|
|
197
196
|
createdAt: Date;
|
|
198
197
|
updatedAt: Date | null;
|
|
198
|
+
email: string | null;
|
|
199
199
|
status: string;
|
|
200
200
|
};
|
|
201
201
|
meta: any;
|
|
@@ -207,9 +207,9 @@ declare function createAuthTRPC({
|
|
|
207
207
|
output: {
|
|
208
208
|
id: string;
|
|
209
209
|
name: string | null;
|
|
210
|
-
email: string | null;
|
|
211
210
|
createdAt: Date;
|
|
212
211
|
updatedAt: Date | null;
|
|
212
|
+
email: string | null;
|
|
213
213
|
status: string;
|
|
214
214
|
};
|
|
215
215
|
meta: any;
|
|
@@ -221,9 +221,9 @@ declare function createAuthTRPC({
|
|
|
221
221
|
output: {
|
|
222
222
|
id: string;
|
|
223
223
|
name: string | null;
|
|
224
|
-
email: string | null;
|
|
225
224
|
createdAt: Date;
|
|
226
225
|
updatedAt: Date | null;
|
|
226
|
+
email: string | null;
|
|
227
227
|
status: string;
|
|
228
228
|
};
|
|
229
229
|
meta: any;
|
|
@@ -3,8 +3,8 @@ require("../../../_virtual/_rolldown/runtime.cjs");
|
|
|
3
3
|
const require_src_utils_errors = require("../../utils/errors.cjs");
|
|
4
4
|
const require_src_modules_utils_applyPagination = require("../utils/applyPagination.cjs");
|
|
5
5
|
const require_src_modules_utils_applySorting = require("../utils/applySorting.cjs");
|
|
6
|
-
const require_src_modules_utils_getConditionsFromFilters = require("../utils/getConditionsFromFilters.cjs");
|
|
7
6
|
const require_src_modules_utils_getGlobalSearchCondition = require("../utils/getGlobalSearchCondition.cjs");
|
|
7
|
+
const require_src_modules_utils_getConditionsFromFilters = require("../utils/getConditionsFromFilters.cjs");
|
|
8
8
|
const require_src_modules_base_base_abstract = require("./base.abstract.cjs");
|
|
9
9
|
const require_src_modules_base_base_dto = require("./base.dto.cjs");
|
|
10
10
|
let drizzle_orm = require("drizzle-orm");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ServerError } from "../../utils/errors.mjs";
|
|
2
2
|
import { applyPagination } from "../utils/applyPagination.mjs";
|
|
3
3
|
import { applySorting } from "../utils/applySorting.mjs";
|
|
4
|
-
import { getConditionsFromFilters } from "../utils/getConditionsFromFilters.mjs";
|
|
5
4
|
import { pushGlobalSearch } from "../utils/getGlobalSearchCondition.mjs";
|
|
5
|
+
import { getConditionsFromFilters } from "../utils/getConditionsFromFilters.mjs";
|
|
6
6
|
import { Base } from "./base.abstract.mjs";
|
|
7
7
|
import { pickColumns } from "./base.dto.mjs";
|
|
8
8
|
import { and, count, eq, inArray, like, or } from "drizzle-orm";
|
|
@@ -4,7 +4,7 @@ import * as _$drizzle_orm_sqlite_core0 from "drizzle-orm/sqlite-core";
|
|
|
4
4
|
import { LibSQLDatabase } from "drizzle-orm/libsql";
|
|
5
5
|
import { InferSelectModel } from "drizzle-orm";
|
|
6
6
|
import { BillingSchema } from "@m5kdev/commons/modules/billing/billing.schema";
|
|
7
|
-
import { Stripe
|
|
7
|
+
import { Stripe } from "stripe";
|
|
8
8
|
import { StripePlan } from "@m5kdev/commons/modules/billing/billing.types";
|
|
9
9
|
|
|
10
10
|
//#region src/modules/billing/billing.repository.d.ts
|
|
@@ -2713,7 +2713,7 @@ declare const schema: {
|
|
|
2713
2713
|
type Schema = typeof schema;
|
|
2714
2714
|
type Orm = LibSQLDatabase<Schema>;
|
|
2715
2715
|
declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<string, never>, Schema["subscriptions"]> {
|
|
2716
|
-
stripe: Stripe
|
|
2716
|
+
stripe: Stripe;
|
|
2717
2717
|
plans: StripePlan[];
|
|
2718
2718
|
trial?: StripePlan;
|
|
2719
2719
|
constructor(options: {
|
|
@@ -2721,7 +2721,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2721
2721
|
schema: Schema;
|
|
2722
2722
|
table: Schema["subscriptions"];
|
|
2723
2723
|
libs: {
|
|
2724
|
-
stripe: Stripe
|
|
2724
|
+
stripe: Stripe;
|
|
2725
2725
|
};
|
|
2726
2726
|
config: {
|
|
2727
2727
|
trial?: StripePlan;
|
|
@@ -2730,7 +2730,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2730
2730
|
});
|
|
2731
2731
|
hasTrial(): boolean;
|
|
2732
2732
|
getPlanByPriceId(priceId: string): StripePlan | undefined;
|
|
2733
|
-
getCustomerByEmail(email: string): ServerResultAsync<Stripe
|
|
2733
|
+
getCustomerByEmail(email: string): ServerResultAsync<Stripe.Customer | null>;
|
|
2734
2734
|
getUserByCustomerId(customerId: string): ServerResultAsync<InferSelectModel<Schema["users"]> | null>;
|
|
2735
2735
|
createCustomer({
|
|
2736
2736
|
email,
|
|
@@ -2740,8 +2740,8 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2740
2740
|
email: string;
|
|
2741
2741
|
name?: string;
|
|
2742
2742
|
userId: string;
|
|
2743
|
-
}): ServerResultAsync<Stripe
|
|
2744
|
-
createTrialSubscription(customerId: string): ServerResultAsync<Stripe
|
|
2743
|
+
}): ServerResultAsync<Stripe.Customer>;
|
|
2744
|
+
createTrialSubscription(customerId: string): ServerResultAsync<Stripe.Subscription>;
|
|
2745
2745
|
createSubscription({
|
|
2746
2746
|
customerId,
|
|
2747
2747
|
priceId,
|
|
@@ -2752,7 +2752,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2752
2752
|
priceId: string;
|
|
2753
2753
|
quantity?: number;
|
|
2754
2754
|
trialDays?: number;
|
|
2755
|
-
}): ServerResultAsync<Stripe
|
|
2755
|
+
}): ServerResultAsync<Stripe.Subscription>;
|
|
2756
2756
|
updateUserCustomerId({
|
|
2757
2757
|
userId,
|
|
2758
2758
|
customerId
|
|
@@ -2762,7 +2762,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2762
2762
|
}): ServerResultAsync<InferSelectModel<Schema["users"]>>;
|
|
2763
2763
|
getLatestSubscription(referenceId: string): ServerResultAsync<BillingSchema | null>;
|
|
2764
2764
|
getActiveSubscription(referenceId: string): ServerResultAsync<BillingSchema | null>;
|
|
2765
|
-
listInvoices(customerId: string): ServerResultAsync<Stripe
|
|
2765
|
+
listInvoices(customerId: string): ServerResultAsync<Stripe.Invoice[]>;
|
|
2766
2766
|
createCheckoutSession({
|
|
2767
2767
|
customerId,
|
|
2768
2768
|
priceId,
|
|
@@ -2771,8 +2771,8 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2771
2771
|
customerId: string;
|
|
2772
2772
|
priceId: string;
|
|
2773
2773
|
userId: string;
|
|
2774
|
-
}): ServerResultAsync<Stripe
|
|
2775
|
-
createBillingPortalSession(customerId: string): ServerResultAsync<Stripe
|
|
2774
|
+
}): ServerResultAsync<Stripe.Checkout.Session>;
|
|
2775
|
+
createBillingPortalSession(customerId: string): ServerResultAsync<Stripe.BillingPortal.Session>;
|
|
2776
2776
|
syncStripeData({
|
|
2777
2777
|
customerId,
|
|
2778
2778
|
userId
|
|
@@ -2780,7 +2780,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2780
2780
|
customerId: string;
|
|
2781
2781
|
userId: string;
|
|
2782
2782
|
}): ServerResultAsync<boolean>;
|
|
2783
|
-
constructEvent(body: Buffer | string, signature: string, secret: string): ServerResult<Stripe
|
|
2783
|
+
constructEvent(body: Buffer | string, signature: string, secret: string): ServerResult<Stripe.Event>;
|
|
2784
2784
|
}
|
|
2785
2785
|
//#endregion
|
|
2786
2786
|
export { BillingRepository };
|
|
@@ -4,7 +4,7 @@ import { BillingRepository } from "./billing.repository.cjs";
|
|
|
4
4
|
import { User } from "../auth/auth.lib.cjs";
|
|
5
5
|
import { BaseService } from "../base/base.service.cjs";
|
|
6
6
|
import { BillingSchema } from "@m5kdev/commons/modules/billing/billing.schema";
|
|
7
|
-
import Stripe from "stripe";
|
|
7
|
+
import Stripe$1 from "stripe";
|
|
8
8
|
|
|
9
9
|
//#region src/modules/billing/billing.service.d.ts
|
|
10
10
|
declare class BillingService extends BaseService<{
|
|
@@ -18,7 +18,7 @@ declare class BillingService extends BaseService<{
|
|
|
18
18
|
email: string;
|
|
19
19
|
name?: string;
|
|
20
20
|
};
|
|
21
|
-
}): ServerResultAsync<Stripe.Customer>;
|
|
21
|
+
}): ServerResultAsync<Stripe$1.Customer>;
|
|
22
22
|
createUserHook({
|
|
23
23
|
user
|
|
24
24
|
}: {
|
|
@@ -29,7 +29,7 @@ declare class BillingService extends BaseService<{
|
|
|
29
29
|
};
|
|
30
30
|
}): ServerResultAsync<boolean>;
|
|
31
31
|
getActiveSubscription(ctx: Context): ServerResultAsync<BillingSchema | null>;
|
|
32
|
-
listInvoices(ctx: Context): ServerResultAsync<Stripe.Invoice[]>;
|
|
32
|
+
listInvoices(ctx: Context): ServerResultAsync<Stripe$1.Invoice[]>;
|
|
33
33
|
createCheckoutSession({
|
|
34
34
|
priceId
|
|
35
35
|
}: {
|
|
@@ -38,15 +38,15 @@ declare class BillingService extends BaseService<{
|
|
|
38
38
|
user
|
|
39
39
|
}: {
|
|
40
40
|
user: User;
|
|
41
|
-
}): ServerResultAsync<Stripe.Checkout.Session>;
|
|
41
|
+
}): ServerResultAsync<Stripe$1.Checkout.Session>;
|
|
42
42
|
createBillingPortalSession({
|
|
43
43
|
user
|
|
44
44
|
}: {
|
|
45
45
|
user: User;
|
|
46
|
-
}): ServerResultAsync<Stripe.BillingPortal.Session>;
|
|
47
|
-
constructEvent(body: Buffer | string, signature: string): ServerResult<Stripe.Event>;
|
|
46
|
+
}): ServerResultAsync<Stripe$1.BillingPortal.Session>;
|
|
47
|
+
constructEvent(body: Buffer | string, signature: string): ServerResult<Stripe$1.Event>;
|
|
48
48
|
syncStripeData(customerId: string, eventType?: string): ServerResultAsync<boolean>;
|
|
49
|
-
processEvent(event: Stripe.Event): ServerResultAsync<boolean>;
|
|
49
|
+
processEvent(event: Stripe$1.Event): ServerResultAsync<boolean>;
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
52
|
export { BillingService };
|
|
@@ -25,22 +25,22 @@ declare const connectSelectSchema: z.ZodObject<{
|
|
|
25
25
|
type ConnectSelectSchema = z.infer<typeof connectSelectSchema>;
|
|
26
26
|
declare const connectSelectOutputSchema: z.ZodObject<{
|
|
27
27
|
id: z.ZodString;
|
|
28
|
-
createdAt: z.ZodDate;
|
|
29
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
30
|
-
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
31
28
|
userId: z.ZodString;
|
|
32
|
-
scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
29
|
provider: z.ZodString;
|
|
34
|
-
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
30
|
accountType: z.ZodString;
|
|
36
31
|
providerAccountId: z.ZodString;
|
|
37
32
|
handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
33
|
displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
34
|
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
35
|
tokenType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
38
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
39
|
metadataJson: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
42
40
|
revokedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
43
41
|
lastRefreshedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
42
|
+
createdAt: z.ZodDate;
|
|
43
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
44
44
|
}, z.core.$strip>;
|
|
45
45
|
declare const connectListInputSchema: z.ZodObject<{
|
|
46
46
|
providers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -49,22 +49,22 @@ declare const connectListInputSchema: z.ZodObject<{
|
|
|
49
49
|
type ConnectListInputSchema = z.infer<typeof connectListInputSchema>;
|
|
50
50
|
declare const connectListOutputSchema: z.ZodArray<z.ZodObject<{
|
|
51
51
|
id: z.ZodString;
|
|
52
|
-
createdAt: z.ZodDate;
|
|
53
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
54
|
-
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
55
52
|
userId: z.ZodString;
|
|
56
|
-
scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
57
53
|
provider: z.ZodString;
|
|
58
|
-
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
54
|
accountType: z.ZodString;
|
|
60
55
|
providerAccountId: z.ZodString;
|
|
61
56
|
handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
62
57
|
displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
58
|
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
59
|
tokenType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
62
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
65
63
|
metadataJson: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
66
64
|
revokedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
67
65
|
lastRefreshedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
66
|
+
createdAt: z.ZodDate;
|
|
67
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
68
68
|
}, z.core.$strip>>;
|
|
69
69
|
declare const connectDeleteInputSchema: z.ZodObject<{
|
|
70
70
|
id: z.ZodString;
|
|
@@ -25,22 +25,22 @@ declare const connectSelectSchema: z.ZodObject<{
|
|
|
25
25
|
type ConnectSelectSchema = z.infer<typeof connectSelectSchema>;
|
|
26
26
|
declare const connectSelectOutputSchema: z.ZodObject<{
|
|
27
27
|
id: z.ZodString;
|
|
28
|
-
createdAt: z.ZodDate;
|
|
29
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
30
|
-
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
31
28
|
userId: z.ZodString;
|
|
32
|
-
scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
29
|
provider: z.ZodString;
|
|
34
|
-
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
35
30
|
accountType: z.ZodString;
|
|
36
31
|
providerAccountId: z.ZodString;
|
|
37
32
|
handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
38
33
|
displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
34
|
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
35
|
tokenType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
38
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
39
|
metadataJson: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
42
40
|
revokedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
43
41
|
lastRefreshedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
42
|
+
createdAt: z.ZodDate;
|
|
43
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
44
44
|
}, z.core.$strip>;
|
|
45
45
|
declare const connectListInputSchema: z.ZodObject<{
|
|
46
46
|
providers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -49,22 +49,22 @@ declare const connectListInputSchema: z.ZodObject<{
|
|
|
49
49
|
type ConnectListInputSchema = z.infer<typeof connectListInputSchema>;
|
|
50
50
|
declare const connectListOutputSchema: z.ZodArray<z.ZodObject<{
|
|
51
51
|
id: z.ZodString;
|
|
52
|
-
createdAt: z.ZodDate;
|
|
53
|
-
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
54
|
-
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
55
52
|
userId: z.ZodString;
|
|
56
|
-
scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
57
53
|
provider: z.ZodString;
|
|
58
|
-
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
54
|
accountType: z.ZodString;
|
|
60
55
|
providerAccountId: z.ZodString;
|
|
61
56
|
handle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
62
57
|
displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
58
|
avatarUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
59
|
tokenType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
62
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
65
63
|
metadataJson: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
66
64
|
revokedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
67
65
|
lastRefreshedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
66
|
+
createdAt: z.ZodDate;
|
|
67
|
+
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
68
68
|
}, z.core.$strip>>;
|
|
69
69
|
declare const connectDeleteInputSchema: z.ZodObject<{
|
|
70
70
|
id: z.ZodString;
|
|
@@ -394,24 +394,24 @@ declare class ConnectRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
394
394
|
}[]>>;
|
|
395
395
|
upsert(data: ConnectInsert, tx?: Orm): Promise<ServerResult<{
|
|
396
396
|
id: string;
|
|
397
|
-
createdAt: Date;
|
|
398
|
-
updatedAt: Date | null;
|
|
399
|
-
expiresAt: Date | null;
|
|
400
397
|
userId: string;
|
|
401
|
-
accessToken: string;
|
|
402
|
-
refreshToken: string | null;
|
|
403
|
-
scope: string | null;
|
|
404
398
|
provider: string;
|
|
405
|
-
parentId: string | null;
|
|
406
399
|
accountType: string;
|
|
407
400
|
providerAccountId: string;
|
|
408
401
|
handle: string | null;
|
|
409
402
|
displayName: string | null;
|
|
410
403
|
avatarUrl: string | null;
|
|
404
|
+
accessToken: string;
|
|
405
|
+
refreshToken: string | null;
|
|
411
406
|
tokenType: string | null;
|
|
407
|
+
scope: string | null;
|
|
408
|
+
expiresAt: Date | null;
|
|
409
|
+
parentId: string | null;
|
|
412
410
|
metadataJson: unknown;
|
|
413
411
|
revokedAt: Date | null;
|
|
414
412
|
lastRefreshedAt: Date | null;
|
|
413
|
+
createdAt: Date;
|
|
414
|
+
updatedAt: Date | null;
|
|
415
415
|
}>>;
|
|
416
416
|
}
|
|
417
417
|
//#endregion
|
|
@@ -394,24 +394,24 @@ declare class ConnectRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
394
394
|
}[]>>;
|
|
395
395
|
upsert(data: ConnectInsert, tx?: Orm): Promise<ServerResult<{
|
|
396
396
|
id: string;
|
|
397
|
-
createdAt: Date;
|
|
398
|
-
updatedAt: Date | null;
|
|
399
|
-
expiresAt: Date | null;
|
|
400
397
|
userId: string;
|
|
401
|
-
accessToken: string;
|
|
402
|
-
refreshToken: string | null;
|
|
403
|
-
scope: string | null;
|
|
404
398
|
provider: string;
|
|
405
|
-
parentId: string | null;
|
|
406
399
|
accountType: string;
|
|
407
400
|
providerAccountId: string;
|
|
408
401
|
handle: string | null;
|
|
409
402
|
displayName: string | null;
|
|
410
403
|
avatarUrl: string | null;
|
|
404
|
+
accessToken: string;
|
|
405
|
+
refreshToken: string | null;
|
|
411
406
|
tokenType: string | null;
|
|
407
|
+
scope: string | null;
|
|
408
|
+
expiresAt: Date | null;
|
|
409
|
+
parentId: string | null;
|
|
412
410
|
metadataJson: unknown;
|
|
413
411
|
revokedAt: Date | null;
|
|
414
412
|
lastRefreshedAt: Date | null;
|
|
413
|
+
createdAt: Date;
|
|
414
|
+
updatedAt: Date | null;
|
|
415
415
|
}>>;
|
|
416
416
|
}
|
|
417
417
|
//#endregion
|