@appweaver/core 1.2.0 → 1.3.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.
Files changed (61) hide show
  1. package/app/load-providers.js +1 -0
  2. package/factory/create-service.js +5 -5
  3. package/package.json +2 -2
  4. package/prisma/client/browser.d.ts +5 -0
  5. package/prisma/client/client.d.ts +5 -0
  6. package/prisma/client/internal/class.d.ts +11 -0
  7. package/prisma/client/internal/class.js +4 -4
  8. package/prisma/client/internal/prismaNamespace.d.ts +87 -1
  9. package/prisma/client/internal/prismaNamespace.js +11 -1
  10. package/prisma/client/internal/prismaNamespaceBrowser.d.ts +11 -0
  11. package/prisma/client/internal/prismaNamespaceBrowser.js +11 -1
  12. package/prisma/client/models/ConnectedAccount.d.ts +1089 -0
  13. package/prisma/client/models/ConnectedAccount.js +2 -0
  14. package/prisma/client/models.d.ts +1 -0
  15. package/resources.d.ts +2 -0
  16. package/resources.js +15 -11
  17. package/security/auth-routes.js +2 -2
  18. package/security/auth-schema.d.ts +2 -0
  19. package/security/auth-schema.js +5 -1
  20. package/security/auth-service.d.ts +7 -19
  21. package/security/auth-service.js +37 -32
  22. package/security/auth.js +15 -2
  23. package/security/create-auth-resources.js +15 -0
  24. package/security/helper.d.ts +8 -0
  25. package/security/helper.js +13 -0
  26. package/security/index.d.ts +2 -0
  27. package/security/index.js +2 -0
  28. package/security/oauth2/create-oauth2-plugin.d.ts +19 -4
  29. package/security/oauth2/create-oauth2-plugin.js +66 -23
  30. package/security/oauth2/index.d.ts +6 -0
  31. package/security/oauth2/index.js +6 -0
  32. package/security/oauth2/oauth2-apple.d.ts +10 -0
  33. package/security/oauth2/oauth2-apple.js +56 -0
  34. package/security/oauth2/oauth2-custom.d.ts +6 -4
  35. package/security/oauth2/oauth2-custom.js +6 -8
  36. package/security/oauth2/oauth2-facebook.d.ts +3 -1
  37. package/security/oauth2/oauth2-facebook.js +5 -11
  38. package/security/oauth2/oauth2-github.d.ts +3 -0
  39. package/security/oauth2/oauth2-github.js +47 -0
  40. package/security/oauth2/oauth2-gitlab.d.ts +3 -0
  41. package/security/oauth2/oauth2-gitlab.js +33 -0
  42. package/security/oauth2/oauth2-google.d.ts +3 -1
  43. package/security/oauth2/oauth2-google.js +6 -11
  44. package/security/oauth2/oauth2-linkedin.d.ts +3 -0
  45. package/security/oauth2/oauth2-linkedin.js +28 -0
  46. package/security/oauth2/oauth2-microsoft.d.ts +3 -0
  47. package/security/oauth2/oauth2-microsoft.js +36 -0
  48. package/security/oauth2/oauth2-schema.d.ts +9 -2
  49. package/security/oauth2/oauth2-schema.js +20 -6
  50. package/security/oauth2/oauth2-service.d.ts +58 -0
  51. package/security/oauth2/oauth2-service.js +142 -0
  52. package/security/oauth2/oauth2-util.d.ts +60 -0
  53. package/security/oauth2/oauth2-util.js +206 -0
  54. package/security/oauth2/oauth2-x.d.ts +3 -0
  55. package/security/oauth2/oauth2-x.js +33 -0
  56. package/security/resources/connected-account/model.d.ts +2 -0
  57. package/security/resources/connected-account/model.js +53 -0
  58. package/security/resources/connected-account/service.d.ts +2 -0
  59. package/security/resources/connected-account/service.js +7 -0
  60. package/types/auth.d.ts +23 -5
  61. package/types/generated.d.ts +62 -0
@@ -0,0 +1,60 @@
1
+ import { AvatarFile } from '../../types';
2
+ /**
3
+ * Calls an OAuth2 provider's user info endpoint with the access token and returns the parsed JSON body.
4
+ *
5
+ * @param {string} providerName - Provider name used in the error message.
6
+ * @param {string} url - The user info endpoint to call.
7
+ * @param {string} accessToken - The access token obtained from the authorization code flow.
8
+ * @param {Record<string, string>} [headers] - Extra request headers required by the provider.
9
+ * @return {Promise<T>} A promise resolving to the parsed response body.
10
+ * @throws {HttpError} If the provider responds with a non-2xx status.
11
+ */
12
+ export declare function fetchUserInfo<T>(providerName: string, url: string, accessToken: string, headers?: Record<string, string>): Promise<T>;
13
+ /**
14
+ * Downloads an avatar image that is only reachable with the provider's access token, so it cannot be resolved later
15
+ * from a plain URL. Fetching is best-effort and returns `undefined` on any failure.
16
+ *
17
+ * @param {string} url - The avatar endpoint to call.
18
+ * @param {string} accessToken - The access token obtained from the authorization code flow.
19
+ * @param {string} id - The provider's user identifier, used to name the file.
20
+ * @return {Promise<AvatarFile | undefined>} A promise resolving to the downloaded avatar, or `undefined`.
21
+ */
22
+ export declare function fetchAuthenticatedAvatar(url: string, accessToken: string, id: string): Promise<AvatarFile | undefined>;
23
+ /**
24
+ * Splits a provider's single display name field into a first and last name. Everything after the first whitespace
25
+ * separated word becomes the last name, so multipart surnames are kept intact.
26
+ *
27
+ * @param {string} [fullName] - The full name reported by the provider.
28
+ * @return {{ firstName: string; lastName: string }} The split name parts, empty strings when no name is available.
29
+ */
30
+ export declare function splitFullName(fullName?: string): {
31
+ firstName: string;
32
+ lastName: string;
33
+ };
34
+ /**
35
+ * Asserts that the provider returned an email address, which the framework needs to match or register the user.
36
+ *
37
+ * @param {string} providerName - Provider name used in the error message.
38
+ * @param {string} [email] - The email address reported by the provider.
39
+ * @return {string} The email address.
40
+ * @throws {HttpError} If the provider did not return an email address.
41
+ */
42
+ export declare function requireEmail(providerName: string, email?: string): string;
43
+ /**
44
+ * Decodes the payload of a JWT without verifying its signature. Only safe for tokens received directly from a
45
+ * provider's token endpoint over TLS, which OpenID Connect Core 3.1.3.7 explicitly allows.
46
+ *
47
+ * @param {string} providerName - Provider name used in the error message.
48
+ * @param {string} [token] - The JWT to decode.
49
+ * @return {T} The decoded payload.
50
+ * @throws {HttpError} If the token is missing or is not a well-formed JWT.
51
+ */
52
+ export declare function decodeJwtPayload<T>(providerName: string, token?: string): T;
53
+ /**
54
+ * Builds the client secret Apple expects: a short-lived ES256 JWT signed with the team's `.p8` key. A literally
55
+ * configured `SECURITY_OAUTH2_APPLE_CLIENT_SECRET` is used as-is and takes precedence.
56
+ *
57
+ * @return {string} The Apple client secret.
58
+ * @throws {Error} If neither a literal secret nor a complete signing key configuration is available.
59
+ */
60
+ export declare function createAppleClientSecret(): string;
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.fetchUserInfo = fetchUserInfo;
37
+ exports.fetchAuthenticatedAvatar = fetchAuthenticatedAvatar;
38
+ exports.splitFullName = splitFullName;
39
+ exports.requireEmail = requireEmail;
40
+ exports.decodeJwtPayload = decodeJwtPayload;
41
+ exports.createAppleClientSecret = createAppleClientSecret;
42
+ const fs = __importStar(require("node:fs"));
43
+ const crypto = __importStar(require("node:crypto"));
44
+ const common_1 = require("@appweaver/common");
45
+ const errors_1 = require("../../errors");
46
+ const APPLE_TOKEN_AUDIENCE = 'https://appleid.apple.com';
47
+ /**
48
+ * Calls an OAuth2 provider's user info endpoint with the access token and returns the parsed JSON body.
49
+ *
50
+ * @param {string} providerName - Provider name used in the error message.
51
+ * @param {string} url - The user info endpoint to call.
52
+ * @param {string} accessToken - The access token obtained from the authorization code flow.
53
+ * @param {Record<string, string>} [headers] - Extra request headers required by the provider.
54
+ * @return {Promise<T>} A promise resolving to the parsed response body.
55
+ * @throws {HttpError} If the provider responds with a non-2xx status.
56
+ */
57
+ async function fetchUserInfo(providerName, url, accessToken, headers = {}) {
58
+ const resp = await fetch(url, {
59
+ method: 'GET',
60
+ headers: { authorization: `Bearer ${accessToken}`, ...headers }
61
+ });
62
+ if (!resp.ok) {
63
+ throw new errors_1.HttpError(`${providerName} API error: ${resp.status} ${resp.statusText}`, 500);
64
+ }
65
+ return resp.json();
66
+ }
67
+ /**
68
+ * Downloads an avatar image that is only reachable with the provider's access token, so it cannot be resolved later
69
+ * from a plain URL. Fetching is best-effort and returns `undefined` on any failure.
70
+ *
71
+ * @param {string} url - The avatar endpoint to call.
72
+ * @param {string} accessToken - The access token obtained from the authorization code flow.
73
+ * @param {string} id - The provider's user identifier, used to name the file.
74
+ * @return {Promise<AvatarFile | undefined>} A promise resolving to the downloaded avatar, or `undefined`.
75
+ */
76
+ async function fetchAuthenticatedAvatar(url, accessToken, id) {
77
+ if (!common_1.config.SECURITY_OAUTH2_FETCH_AVATAR_ENABLED) {
78
+ return undefined;
79
+ }
80
+ try {
81
+ const resp = await fetch(url, {
82
+ method: 'GET',
83
+ headers: { authorization: `Bearer ${accessToken}` }
84
+ });
85
+ if (!resp.ok) {
86
+ return undefined;
87
+ }
88
+ const mimeType = resp.headers.get('content-type') ?? 'image/jpeg';
89
+ const data = Buffer.from(await resp.arrayBuffer());
90
+ const extension = mimeType.split('/')[1]?.split(';')[0] ?? 'jpg';
91
+ return {
92
+ name: `avatar-${id}.${extension}`,
93
+ mimeType,
94
+ size: data.length,
95
+ data
96
+ };
97
+ }
98
+ catch {
99
+ return undefined;
100
+ }
101
+ }
102
+ /**
103
+ * Splits a provider's single display name field into a first and last name. Everything after the first whitespace
104
+ * separated word becomes the last name, so multipart surnames are kept intact.
105
+ *
106
+ * @param {string} [fullName] - The full name reported by the provider.
107
+ * @return {{ firstName: string; lastName: string }} The split name parts, empty strings when no name is available.
108
+ */
109
+ function splitFullName(fullName) {
110
+ const [firstName = '', ...rest] = (fullName ?? '').trim().split(/\s+/);
111
+ return { firstName, lastName: rest.join(' ') };
112
+ }
113
+ /**
114
+ * Asserts that the provider returned an email address, which the framework needs to match or register the user.
115
+ *
116
+ * @param {string} providerName - Provider name used in the error message.
117
+ * @param {string} [email] - The email address reported by the provider.
118
+ * @return {string} The email address.
119
+ * @throws {HttpError} If the provider did not return an email address.
120
+ */
121
+ function requireEmail(providerName, email) {
122
+ if (!email) {
123
+ throw new errors_1.HttpError(`${providerName} account has no email address available`, 403);
124
+ }
125
+ return email;
126
+ }
127
+ /**
128
+ * Decodes the payload of a JWT without verifying its signature. Only safe for tokens received directly from a
129
+ * provider's token endpoint over TLS, which OpenID Connect Core 3.1.3.7 explicitly allows.
130
+ *
131
+ * @param {string} providerName - Provider name used in the error message.
132
+ * @param {string} [token] - The JWT to decode.
133
+ * @return {T} The decoded payload.
134
+ * @throws {HttpError} If the token is missing or is not a well-formed JWT.
135
+ */
136
+ function decodeJwtPayload(providerName, token) {
137
+ const payload = token?.split('.')[1];
138
+ if (!payload) {
139
+ throw new errors_1.HttpError(`${providerName} identity token is missing`, 500);
140
+ }
141
+ try {
142
+ return JSON.parse(Buffer.from(payload, 'base64url').toString('utf8'));
143
+ }
144
+ catch (e) {
145
+ throw new errors_1.HttpError(`${providerName} identity token is malformed`, 500, e);
146
+ }
147
+ }
148
+ /**
149
+ * Builds the client secret Apple expects: a short-lived ES256 JWT signed with the team's `.p8` key. A literally
150
+ * configured `SECURITY_OAUTH2_APPLE_CLIENT_SECRET` is used as-is and takes precedence.
151
+ *
152
+ * @return {string} The Apple client secret.
153
+ * @throws {Error} If neither a literal secret nor a complete signing key configuration is available.
154
+ */
155
+ function createAppleClientSecret() {
156
+ if (common_1.config.SECURITY_OAUTH2_APPLE_CLIENT_SECRET) {
157
+ return common_1.config.SECURITY_OAUTH2_APPLE_CLIENT_SECRET;
158
+ }
159
+ const clientId = common_1.config.SECURITY_OAUTH2_APPLE_CLIENT_ID;
160
+ const teamId = common_1.config.SECURITY_OAUTH2_APPLE_TEAM_ID;
161
+ const keyId = common_1.config.SECURITY_OAUTH2_APPLE_KEY_ID;
162
+ const privateKey = readApplePrivateKey();
163
+ if (!clientId || !teamId || !keyId || !privateKey) {
164
+ throw Error('Apple OAuth2 requires either a client secret, or a client ID, team ID, key ID and private key to generate one');
165
+ }
166
+ const issuedAt = Math.floor(Date.now() / 1000);
167
+ return signES256Jwt({ alg: 'ES256', kid: keyId, typ: 'JWT' }, {
168
+ iss: teamId,
169
+ iat: issuedAt,
170
+ exp: issuedAt + common_1.config.SECURITY_OAUTH2_APPLE_CLIENT_SECRET_EXPIRES_IN,
171
+ aud: APPLE_TOKEN_AUDIENCE,
172
+ sub: clientId
173
+ }, privateKey);
174
+ }
175
+ /**
176
+ * Reads the Apple `.p8` private key from its inline configuration value or from the configured file path.
177
+ *
178
+ * @return {string | undefined} The PEM encoded private key, or `undefined` when none is configured.
179
+ */
180
+ function readApplePrivateKey() {
181
+ // Escaped newlines survive the trip through an environment variable, so restore them.
182
+ const inlineKey = common_1.config.SECURITY_OAUTH2_APPLE_PRIVATE_KEY?.replace(/\\n/g, '\n');
183
+ if (inlineKey) {
184
+ return inlineKey;
185
+ }
186
+ const keyPath = common_1.config.SECURITY_OAUTH2_APPLE_PRIVATE_KEY_PATH;
187
+ return keyPath ? fs.readFileSync(keyPath, 'utf8') : undefined;
188
+ }
189
+ /**
190
+ * Signs a JWT with the ES256 algorithm.
191
+ *
192
+ * @param {Record<string, unknown>} header - The JOSE header.
193
+ * @param {Record<string, unknown>} payload - The token claims.
194
+ * @param {string} privateKey - The PEM encoded EC private key.
195
+ * @return {string} The signed compact JWT.
196
+ */
197
+ function signES256Jwt(header, payload, privateKey) {
198
+ const encode = (value) => Buffer.from(JSON.stringify(value)).toString('base64url');
199
+ const signingInput = `${encode(header)}.${encode(payload)}`;
200
+ // JOSE expects the raw R||S signature, not the DER encoding Node produces by default.
201
+ const signature = crypto.sign('sha256', Buffer.from(signingInput), {
202
+ key: privateKey,
203
+ dsaEncoding: 'ieee-p1363'
204
+ });
205
+ return `${signingInput}.${signature.toString('base64url')}`;
206
+ }
@@ -0,0 +1,3 @@
1
+ import { UserInfo } from '../../types';
2
+ export declare const oauth2X: (server: import("../../types").Server) => Promise<void>;
3
+ export declare function fetchXUser(accessToken: string): Promise<UserInfo>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oauth2X = void 0;
4
+ exports.fetchXUser = fetchXUser;
5
+ const common_1 = require("@appweaver/common");
6
+ const errors_1 = require("../../errors");
7
+ const create_oauth2_plugin_1 = require("./create-oauth2-plugin");
8
+ const oauth2_util_1 = require("./oauth2-util");
9
+ exports.oauth2X = (0, create_oauth2_plugin_1.createOAuth2Plugin)(common_1.AuthSource.OAuth2X, {
10
+ enabled: common_1.config.SECURITY_OAUTH2_X_ENABLED,
11
+ clientId: common_1.config.SECURITY_OAUTH2_X_CLIENT_ID,
12
+ clientSecret: common_1.config.SECURITY_OAUTH2_X_CLIENT_SECRET,
13
+ scope: ['users.read', 'tweet.read'],
14
+ // X only issues tokens for authorization requests using the PKCE extension.
15
+ pkce: 'S256',
16
+ extractUserInfo: (accessToken) => fetchXUser(accessToken)
17
+ });
18
+ async function fetchXUser(accessToken) {
19
+ const params = new URLSearchParams();
20
+ params.append('user.fields', 'name,username,profile_image_url,confirmed_email');
21
+ // Only apps granted the email permission may read `confirmed_email`; for the rest X rejects the request outright.
22
+ const { data } = await (0, oauth2_util_1.fetchUserInfo)('X', `${common_1.config.SECURITY_OAUTH2_X_USER_INFO_URL}?${params}`, accessToken);
23
+ if (!data.confirmed_email) {
24
+ throw new errors_1.HttpError('X did not return an email address. Enable the email permission for the app in the X developer portal', 403);
25
+ }
26
+ return {
27
+ id: data.id,
28
+ email: data.confirmed_email,
29
+ ...(0, oauth2_util_1.splitFullName)(data.name),
30
+ // The profile image URL points at the 48px variant; ask for the largest one X keeps.
31
+ avatarUrl: data.profile_image_url?.replace('_normal.', '_400x400.')
32
+ };
33
+ }
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@appweaver/common").ResourceModel | undefined;
2
+ export default _default;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const common_1 = require("@appweaver/common");
4
+ const factory_1 = require("../../../factory");
5
+ const helper_1 = require("../../helper");
6
+ const authModel = (0, helper_1.resourceAuthModel)();
7
+ const shouldCreateModel = (0, helper_1.isOAuth2Enabled)() ||
8
+ common_1.config.SECURITY_OAUTH2_CONNECTED_ACCOUNTS_KEEP_DATABASE_TABLE;
9
+ exports.default = shouldCreateModel
10
+ ? (0, factory_1.createModel)({
11
+ name: 'ConnectedAccount',
12
+ audit: {
13
+ createdById: false
14
+ },
15
+ scalars: {
16
+ provider: {
17
+ type: 'string',
18
+ maxLength: 255
19
+ },
20
+ providerAccountId: {
21
+ type: 'string',
22
+ maxLength: 255
23
+ },
24
+ scope: {
25
+ type: 'string',
26
+ required: false
27
+ },
28
+ lastLoginAt: {
29
+ type: 'dateTime'
30
+ }
31
+ },
32
+ ...(authModel
33
+ ? {
34
+ relations: {
35
+ [(0, common_1.uncapitalize)(authModel.name)]: {
36
+ model: authModel.name,
37
+ type: 'oneToMany',
38
+ mappedBy: 'connectedAccounts',
39
+ owner: true,
40
+ input: {
41
+ type: 'none'
42
+ },
43
+ output: {
44
+ type: 'none'
45
+ }
46
+ }
47
+ }
48
+ }
49
+ : {}),
50
+ // A provider account may only ever be linked to a single user
51
+ index: [['provider', 'providerAccountId']]
52
+ })
53
+ : undefined;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@appweaver/common").Ctor<import("../../..").ResourceService<any, any, any, any, import("@appweaver/common").QueryFilter<any>>> | undefined;
2
+ export default _default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const factory_1 = require("../../../factory");
4
+ const helper_1 = require("../../helper");
5
+ exports.default = (0, helper_1.isOAuth2Enabled)()
6
+ ? (0, factory_1.createService)({ modelName: 'ConnectedAccount' })
7
+ : undefined;
package/types/auth.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { FastifyRequest } from 'fastify';
1
2
  import { AuthScope, AuthSource, AuthUser } from '@appweaver/common';
2
3
  export type JwtPayload = {
3
4
  scope: AuthScope;
@@ -15,6 +16,9 @@ export type AuthTokens = {
15
16
  export type AuthOTTData = {
16
17
  authUserId: number;
17
18
  authSource: AuthSource;
19
+ providerAccountId?: string;
20
+ scope?: string;
21
+ passwordRequired?: boolean;
18
22
  };
19
23
  export type TwoFactorAuthData = {
20
24
  authUserId: number;
@@ -24,18 +28,32 @@ export type TwoFactorAuthData = {
24
28
  export type OAuth2StateData = {
25
29
  redirectToUrl: string;
26
30
  };
31
+ export type AvatarFile = {
32
+ name: string;
33
+ mimeType: string;
34
+ size: number;
35
+ data: Buffer;
36
+ };
27
37
  export type UserInfo = {
28
38
  id: string;
29
39
  email: string;
30
40
  firstName: string;
31
41
  lastName: string;
32
42
  avatarUrl?: string;
43
+ avatarFile?: AvatarFile;
33
44
  };
34
- export type AvatarFile = {
35
- name: string;
36
- mimeType: string;
37
- size: number;
38
- data: Buffer;
45
+ export type OAuth2TokenSet = {
46
+ access_token: string;
47
+ token_type?: string;
48
+ id_token?: string;
49
+ refresh_token?: string;
50
+ expires_in?: number;
51
+ scope?: string;
52
+ [key: string]: unknown;
53
+ };
54
+ export type OAuth2UserInfoContext = {
55
+ token: OAuth2TokenSet;
56
+ request: FastifyRequest;
39
57
  };
40
58
  export type UserAdditionalData = {
41
59
  firstName: string;
@@ -66,6 +66,68 @@ export type ApiKeyRelationInput = {
66
66
  export type ApiKeyQuery = QueryFilter<ApiKey>;
67
67
  export type ApiKeySort = QuerySort<ApiKeyMultiple>;
68
68
  export type ApiKeyAggregate = AggregateSelect<ApiKey>;
69
+ export type ConnectedAccount = {
70
+ id: number;
71
+ provider: string;
72
+ providerAccountId: string;
73
+ scope?: string | null;
74
+ lastLoginAt: Date;
75
+ updatedAt: Date;
76
+ createdAt: Date;
77
+ };
78
+ export type ConnectedAccountSingle = {
79
+ id: number;
80
+ provider: string;
81
+ providerAccountId: string;
82
+ scope?: string | null;
83
+ lastLoginAt: Date;
84
+ updatedAt: Date;
85
+ createdAt: Date;
86
+ };
87
+ export type ConnectedAccountMultiple = {
88
+ id: number;
89
+ provider: string;
90
+ providerAccountId: string;
91
+ scope?: string | null;
92
+ lastLoginAt: Date;
93
+ updatedAt: Date;
94
+ createdAt: Date;
95
+ };
96
+ export type ConnectedAccountCreate = {
97
+ provider: string;
98
+ providerAccountId: string;
99
+ scope?: string | null;
100
+ lastLoginAt: Date;
101
+ };
102
+ export type ConnectedAccountUpdate = {
103
+ provider?: string;
104
+ providerAccountId?: string;
105
+ scope?: string | null;
106
+ lastLoginAt?: Date;
107
+ };
108
+ export type ConnectedAccountRelationCreate = {
109
+ provider: string;
110
+ providerAccountId: string;
111
+ scope?: string | null;
112
+ lastLoginAt: Date;
113
+ };
114
+ export type ConnectedAccountRelationUpdate = {
115
+ id: number;
116
+ provider?: string;
117
+ providerAccountId?: string;
118
+ scope?: string | null;
119
+ lastLoginAt?: Date;
120
+ };
121
+ export type ConnectedAccountRelationInput = {
122
+ id?: number;
123
+ provider?: string;
124
+ providerAccountId?: string;
125
+ scope?: string | null;
126
+ lastLoginAt?: Date;
127
+ };
128
+ export type ConnectedAccountQuery = QueryFilter<ConnectedAccount>;
129
+ export type ConnectedAccountSort = QuerySort<ConnectedAccountMultiple>;
130
+ export type ConnectedAccountAggregate = AggregateSelect<ConnectedAccount>;
69
131
  export type OneTimeToken = {
70
132
  id: number;
71
133
  tokenHash: string;