@robelest/convex-auth 0.0.4-preview.35 → 0.0.4-preview.36
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/component/_generated/component.d.ts +6 -0
- package/dist/component/convex.config.d.ts +2 -2
- package/dist/component/convex.config.js +2 -0
- package/dist/component/migrations.js +36 -0
- package/dist/component/model.d.ts +144 -142
- package/dist/component/model.js +1 -0
- package/dist/component/modules.js +1 -0
- package/dist/component/schema.d.ts +303 -301
- package/dist/component/schema.js +1 -0
- package/dist/model.js +1 -0
- package/dist/server/mounts.d.ts +4 -4
- package/dist/server/runtime.d.ts +2 -2
- package/dist/server/validators.d.ts +21 -13
- package/package.json +2 -1
|
@@ -1408,6 +1408,7 @@ type ComponentApi<Name extends string | undefined = string | undefined> = {
|
|
|
1408
1408
|
email?: string;
|
|
1409
1409
|
emailVerificationTime?: number;
|
|
1410
1410
|
extend?: any;
|
|
1411
|
+
hasTotp?: boolean;
|
|
1411
1412
|
image?: string;
|
|
1412
1413
|
isAnonymous?: boolean;
|
|
1413
1414
|
lastActiveGroup?: string;
|
|
@@ -1454,6 +1455,7 @@ type ComponentApi<Name extends string | undefined = string | undefined> = {
|
|
|
1454
1455
|
email?: string;
|
|
1455
1456
|
emailVerificationTime?: number;
|
|
1456
1457
|
extend?: any;
|
|
1458
|
+
hasTotp?: boolean;
|
|
1457
1459
|
image?: string;
|
|
1458
1460
|
isAnonymous?: boolean;
|
|
1459
1461
|
lastActiveGroup?: string;
|
|
@@ -2593,6 +2595,7 @@ type ComponentApi<Name extends string | undefined = string | undefined> = {
|
|
|
2593
2595
|
email?: string;
|
|
2594
2596
|
emailVerificationTime?: number;
|
|
2595
2597
|
extend?: any;
|
|
2598
|
+
hasTotp?: boolean;
|
|
2596
2599
|
image?: string;
|
|
2597
2600
|
isAnonymous?: boolean;
|
|
2598
2601
|
lastActiveGroup?: string;
|
|
@@ -2626,6 +2629,7 @@ type ComponentApi<Name extends string | undefined = string | undefined> = {
|
|
|
2626
2629
|
email?: string;
|
|
2627
2630
|
emailVerificationTime?: number;
|
|
2628
2631
|
extend?: any;
|
|
2632
|
+
hasTotp?: boolean;
|
|
2629
2633
|
image?: string;
|
|
2630
2634
|
isAnonymous?: boolean;
|
|
2631
2635
|
lastActiveGroup?: string;
|
|
@@ -2638,6 +2642,7 @@ type ComponentApi<Name extends string | undefined = string | undefined> = {
|
|
|
2638
2642
|
email?: string;
|
|
2639
2643
|
emailVerificationTime?: number;
|
|
2640
2644
|
extend?: any;
|
|
2645
|
+
hasTotp?: boolean;
|
|
2641
2646
|
image?: string;
|
|
2642
2647
|
isAnonymous?: boolean;
|
|
2643
2648
|
lastActiveGroup?: string;
|
|
@@ -2771,6 +2776,7 @@ type ComponentApi<Name extends string | undefined = string | undefined> = {
|
|
|
2771
2776
|
email?: string;
|
|
2772
2777
|
emailVerificationTime?: number;
|
|
2773
2778
|
extend?: any;
|
|
2779
|
+
hasTotp?: boolean;
|
|
2774
2780
|
image?: string;
|
|
2775
2781
|
isAnonymous?: boolean;
|
|
2776
2782
|
lastActiveGroup?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as convex_server12 from "convex/server";
|
|
2
2
|
|
|
3
3
|
//#region src/component/convex.config.d.ts
|
|
4
|
-
declare const component:
|
|
4
|
+
declare const component: convex_server12.ComponentDefinition<any>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { component as default };
|
|
7
7
|
//# sourceMappingURL=convex.config.d.ts.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { defineComponent } from "convex/server";
|
|
2
|
+
import migrations from "@convex-dev/migrations/convex.config";
|
|
2
3
|
|
|
3
4
|
//#region src/component/convex.config.ts
|
|
4
5
|
const component = defineComponent("auth");
|
|
6
|
+
component.use(migrations);
|
|
5
7
|
var convex_config_default = component;
|
|
6
8
|
|
|
7
9
|
//#endregion
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { components, internal } from "./_generated/api.js";
|
|
2
|
+
import { internalMutation } from "./_generated/server.js";
|
|
3
|
+
import { Migrations } from "@convex-dev/migrations";
|
|
4
|
+
|
|
5
|
+
//#region src/component/migrations.ts
|
|
6
|
+
/**
|
|
7
|
+
* Component-internal data migrations, run via the `@convex-dev/migrations`
|
|
8
|
+
* component mounted in `convex.config.ts`.
|
|
9
|
+
*
|
|
10
|
+
* The auth component owns its own tables, so migrations over them must run
|
|
11
|
+
* *inside* the component. Consumers trigger a migration after upgrading:
|
|
12
|
+
*
|
|
13
|
+
* ```sh
|
|
14
|
+
* npx convex run auth/migrations:runDropHasTotp '{}'
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
19
|
+
const migrations = new Migrations(components.migrations, { internalMutation });
|
|
20
|
+
/**
|
|
21
|
+
* Strip the deprecated denormalized `User.hasTotp` cache from every row.
|
|
22
|
+
*
|
|
23
|
+
* The field was removed from the typed surface; this clears it from
|
|
24
|
+
* pre-existing data so it can eventually be dropped from the schema.
|
|
25
|
+
* Idempotent — rows without the field are skipped.
|
|
26
|
+
*/
|
|
27
|
+
const dropHasTotp = migrations.define({
|
|
28
|
+
table: "User",
|
|
29
|
+
migrateOne: (_ctx, doc) => doc.hasTotp === void 0 ? void 0 : { hasTotp: void 0 }
|
|
30
|
+
});
|
|
31
|
+
/** CLI/dashboard runner: `npx convex run auth/migrations:runDropHasTotp`. */
|
|
32
|
+
const runDropHasTotp = migrations.runner(internal.migrations.dropHasTotp);
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { dropHasTotp, migrations, runDropHasTotp };
|
|
36
|
+
//# sourceMappingURL=migrations.js.map
|
|
@@ -1,68 +1,70 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as convex_values530 from "convex/values";
|
|
2
2
|
import { Validator } from "convex/values";
|
|
3
3
|
|
|
4
4
|
//#region src/component/model.d.ts
|
|
5
|
-
declare const vPaginated: <V extends Validator<any, any, any>>(item: V) =>
|
|
5
|
+
declare const vPaginated: <V extends Validator<any, any, any>>(item: V) => convex_values530.VObject<{
|
|
6
6
|
items: V["type"][];
|
|
7
7
|
nextCursor: string | null;
|
|
8
8
|
}, {
|
|
9
|
-
items:
|
|
10
|
-
nextCursor:
|
|
9
|
+
items: convex_values530.VArray<V["type"][], V, "required">;
|
|
10
|
+
nextCursor: convex_values530.VUnion<string | null, [convex_values530.VString<string, "required">, convex_values530.VNull<null, "required">], "required", never>;
|
|
11
11
|
}, "required", "items" | "nextCursor">;
|
|
12
|
-
declare const vUserDoc:
|
|
12
|
+
declare const vUserDoc: convex_values530.VObject<{
|
|
13
13
|
name?: string | undefined;
|
|
14
14
|
email?: string | undefined;
|
|
15
|
-
image?: string | undefined;
|
|
16
15
|
phone?: string | undefined;
|
|
16
|
+
image?: string | undefined;
|
|
17
17
|
emailVerificationTime?: number | undefined;
|
|
18
18
|
phoneVerificationTime?: number | undefined;
|
|
19
19
|
isAnonymous?: boolean | undefined;
|
|
20
|
-
lastActiveGroup?:
|
|
20
|
+
lastActiveGroup?: convex_values530.GenericId<"Group"> | undefined;
|
|
21
|
+
hasTotp?: boolean | undefined;
|
|
21
22
|
extend?: any;
|
|
22
23
|
_creationTime: number;
|
|
23
|
-
_id:
|
|
24
|
+
_id: convex_values530.GenericId<"User">;
|
|
24
25
|
}, {
|
|
25
|
-
name:
|
|
26
|
-
image:
|
|
27
|
-
email:
|
|
28
|
-
emailVerificationTime:
|
|
29
|
-
phone:
|
|
30
|
-
phoneVerificationTime:
|
|
31
|
-
isAnonymous:
|
|
32
|
-
lastActiveGroup:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
name: convex_values530.VString<string | undefined, "optional">;
|
|
27
|
+
image: convex_values530.VString<string | undefined, "optional">;
|
|
28
|
+
email: convex_values530.VString<string | undefined, "optional">;
|
|
29
|
+
emailVerificationTime: convex_values530.VFloat64<number | undefined, "optional">;
|
|
30
|
+
phone: convex_values530.VString<string | undefined, "optional">;
|
|
31
|
+
phoneVerificationTime: convex_values530.VFloat64<number | undefined, "optional">;
|
|
32
|
+
isAnonymous: convex_values530.VBoolean<boolean | undefined, "optional">;
|
|
33
|
+
lastActiveGroup: convex_values530.VId<convex_values530.GenericId<"Group"> | undefined, "optional">;
|
|
34
|
+
hasTotp: convex_values530.VBoolean<boolean | undefined, "optional">;
|
|
35
|
+
extend: convex_values530.VAny<any, "optional", string>;
|
|
36
|
+
_id: convex_values530.VId<convex_values530.GenericId<"User">, "required">;
|
|
37
|
+
_creationTime: convex_values530.VFloat64<number, "required">;
|
|
38
|
+
}, "required", "_creationTime" | "name" | "email" | "phone" | "image" | "emailVerificationTime" | "phoneVerificationTime" | "isAnonymous" | "lastActiveGroup" | "hasTotp" | "extend" | `extend.${string}` | "_id">;
|
|
39
|
+
declare const vUserEmailDoc: convex_values530.VObject<{
|
|
38
40
|
verificationTime?: number | undefined;
|
|
39
|
-
accountId?:
|
|
41
|
+
accountId?: convex_values530.GenericId<"Account"> | undefined;
|
|
40
42
|
provider?: string | undefined;
|
|
41
|
-
connectionId?:
|
|
42
|
-
email: string;
|
|
43
|
+
connectionId?: convex_values530.GenericId<"GroupConnection"> | undefined;
|
|
43
44
|
_creationTime: number;
|
|
44
|
-
|
|
45
|
+
email: string;
|
|
46
|
+
userId: convex_values530.GenericId<"User">;
|
|
45
47
|
isPrimary: boolean;
|
|
46
48
|
source: "password" | "oauth" | "oidc" | "saml" | "scim";
|
|
47
|
-
_id:
|
|
49
|
+
_id: convex_values530.GenericId<"UserEmail">;
|
|
48
50
|
}, {
|
|
49
|
-
userId:
|
|
50
|
-
email:
|
|
51
|
-
verificationTime:
|
|
52
|
-
isPrimary:
|
|
53
|
-
source:
|
|
54
|
-
accountId:
|
|
55
|
-
provider:
|
|
56
|
-
connectionId:
|
|
57
|
-
_id:
|
|
58
|
-
_creationTime:
|
|
59
|
-
}, "required", "
|
|
60
|
-
declare const vGroupDoc:
|
|
51
|
+
userId: convex_values530.VId<convex_values530.GenericId<"User">, "required">;
|
|
52
|
+
email: convex_values530.VString<string, "required">;
|
|
53
|
+
verificationTime: convex_values530.VFloat64<number | undefined, "optional">;
|
|
54
|
+
isPrimary: convex_values530.VBoolean<boolean, "required">;
|
|
55
|
+
source: convex_values530.VUnion<"password" | "oauth" | "oidc" | "saml" | "scim", [convex_values530.VLiteral<"password", "required">, convex_values530.VLiteral<"oauth", "required">, convex_values530.VLiteral<"oidc", "required">, convex_values530.VLiteral<"saml", "required">, convex_values530.VLiteral<"scim", "required">], "required", never>;
|
|
56
|
+
accountId: convex_values530.VId<convex_values530.GenericId<"Account"> | undefined, "optional">;
|
|
57
|
+
provider: convex_values530.VString<string | undefined, "optional">;
|
|
58
|
+
connectionId: convex_values530.VId<convex_values530.GenericId<"GroupConnection"> | undefined, "optional">;
|
|
59
|
+
_id: convex_values530.VId<convex_values530.GenericId<"UserEmail">, "required">;
|
|
60
|
+
_creationTime: convex_values530.VFloat64<number, "required">;
|
|
61
|
+
}, "required", "_creationTime" | "email" | "userId" | "verificationTime" | "isPrimary" | "source" | "accountId" | "provider" | "connectionId" | "_id">;
|
|
62
|
+
declare const vGroupDoc: convex_values530.VObject<{
|
|
61
63
|
extend?: any;
|
|
62
64
|
type?: string | undefined;
|
|
63
65
|
slug?: string | undefined;
|
|
64
|
-
parentGroupId?:
|
|
65
|
-
rootGroupId?:
|
|
66
|
+
parentGroupId?: convex_values530.GenericId<"Group"> | undefined;
|
|
67
|
+
rootGroupId?: convex_values530.GenericId<"Group"> | undefined;
|
|
66
68
|
isRoot?: boolean | undefined;
|
|
67
69
|
tags?: {
|
|
68
70
|
key: string;
|
|
@@ -107,27 +109,27 @@ declare const vGroupDoc: convex_values519.VObject<{
|
|
|
107
109
|
};
|
|
108
110
|
};
|
|
109
111
|
} | undefined;
|
|
110
|
-
name: string;
|
|
111
112
|
_creationTime: number;
|
|
112
|
-
|
|
113
|
+
name: string;
|
|
114
|
+
_id: convex_values530.GenericId<"Group">;
|
|
113
115
|
}, {
|
|
114
|
-
name:
|
|
115
|
-
slug:
|
|
116
|
-
type:
|
|
117
|
-
parentGroupId:
|
|
118
|
-
rootGroupId:
|
|
119
|
-
isRoot:
|
|
120
|
-
tags:
|
|
116
|
+
name: convex_values530.VString<string, "required">;
|
|
117
|
+
slug: convex_values530.VString<string | undefined, "optional">;
|
|
118
|
+
type: convex_values530.VString<string | undefined, "optional">;
|
|
119
|
+
parentGroupId: convex_values530.VId<convex_values530.GenericId<"Group"> | undefined, "optional">;
|
|
120
|
+
rootGroupId: convex_values530.VId<convex_values530.GenericId<"Group"> | undefined, "optional">;
|
|
121
|
+
isRoot: convex_values530.VBoolean<boolean | undefined, "optional">;
|
|
122
|
+
tags: convex_values530.VArray<{
|
|
121
123
|
key: string;
|
|
122
124
|
value: string;
|
|
123
|
-
}[] | undefined,
|
|
125
|
+
}[] | undefined, convex_values530.VObject<{
|
|
124
126
|
key: string;
|
|
125
127
|
value: string;
|
|
126
128
|
}, {
|
|
127
|
-
key:
|
|
128
|
-
value:
|
|
129
|
+
key: convex_values530.VString<string, "required">;
|
|
130
|
+
value: convex_values530.VString<string, "required">;
|
|
129
131
|
}, "required", "key" | "value">, "optional">;
|
|
130
|
-
policy:
|
|
132
|
+
policy: convex_values530.VObject<{
|
|
131
133
|
extend?: any;
|
|
132
134
|
version: 1;
|
|
133
135
|
identity: {
|
|
@@ -166,22 +168,22 @@ declare const vGroupDoc: convex_values519.VObject<{
|
|
|
166
168
|
};
|
|
167
169
|
};
|
|
168
170
|
} | undefined, {
|
|
169
|
-
version:
|
|
170
|
-
identity:
|
|
171
|
+
version: convex_values530.VLiteral<1, "required">;
|
|
172
|
+
identity: convex_values530.VObject<{
|
|
171
173
|
accountLinking: {
|
|
172
174
|
oidc: "verifiedEmail" | "none" | "sameConnection";
|
|
173
175
|
saml: "verifiedEmail" | "none" | "sameConnection";
|
|
174
176
|
};
|
|
175
177
|
}, {
|
|
176
|
-
accountLinking:
|
|
178
|
+
accountLinking: convex_values530.VObject<{
|
|
177
179
|
oidc: "verifiedEmail" | "none" | "sameConnection";
|
|
178
180
|
saml: "verifiedEmail" | "none" | "sameConnection";
|
|
179
181
|
}, {
|
|
180
|
-
oidc:
|
|
181
|
-
saml:
|
|
182
|
+
oidc: convex_values530.VUnion<"verifiedEmail" | "none" | "sameConnection", [convex_values530.VLiteral<"verifiedEmail", "required">, convex_values530.VLiteral<"none", "required">, convex_values530.VLiteral<"sameConnection", "required">], "required", never>;
|
|
183
|
+
saml: convex_values530.VUnion<"verifiedEmail" | "none" | "sameConnection", [convex_values530.VLiteral<"verifiedEmail", "required">, convex_values530.VLiteral<"none", "required">, convex_values530.VLiteral<"sameConnection", "required">], "required", never>;
|
|
182
184
|
}, "required", "oidc" | "saml">;
|
|
183
185
|
}, "required", "accountLinking" | "accountLinking.oidc" | "accountLinking.saml">;
|
|
184
|
-
provisioning:
|
|
186
|
+
provisioning: convex_values530.VObject<{
|
|
185
187
|
user: {
|
|
186
188
|
createOnSignIn: boolean;
|
|
187
189
|
updateProfileOnLogin: "never" | "missing" | "always";
|
|
@@ -210,110 +212,110 @@ declare const vGroupDoc: convex_values519.VObject<{
|
|
|
210
212
|
mode: "map" | "ignore";
|
|
211
213
|
};
|
|
212
214
|
}, {
|
|
213
|
-
user:
|
|
215
|
+
user: convex_values530.VObject<{
|
|
214
216
|
createOnSignIn: boolean;
|
|
215
217
|
updateProfileOnLogin: "never" | "missing" | "always";
|
|
216
218
|
updateProfileFromScim: "never" | "missing" | "always";
|
|
217
219
|
authority: "scim" | "app" | "sso";
|
|
218
220
|
}, {
|
|
219
|
-
createOnSignIn:
|
|
220
|
-
updateProfileOnLogin:
|
|
221
|
-
updateProfileFromScim:
|
|
222
|
-
authority:
|
|
221
|
+
createOnSignIn: convex_values530.VBoolean<boolean, "required">;
|
|
222
|
+
updateProfileOnLogin: convex_values530.VUnion<"never" | "missing" | "always", [convex_values530.VLiteral<"never", "required">, convex_values530.VLiteral<"missing", "required">, convex_values530.VLiteral<"always", "required">], "required", never>;
|
|
223
|
+
updateProfileFromScim: convex_values530.VUnion<"never" | "missing" | "always", [convex_values530.VLiteral<"never", "required">, convex_values530.VLiteral<"missing", "required">, convex_values530.VLiteral<"always", "required">], "required", never>;
|
|
224
|
+
authority: convex_values530.VUnion<"scim" | "app" | "sso", [convex_values530.VLiteral<"app", "required">, convex_values530.VLiteral<"sso", "required">, convex_values530.VLiteral<"scim", "required">], "required", never>;
|
|
223
225
|
}, "required", "createOnSignIn" | "updateProfileOnLogin" | "updateProfileFromScim" | "authority">;
|
|
224
|
-
scimReuse:
|
|
226
|
+
scimReuse: convex_values530.VObject<{
|
|
225
227
|
user: "none" | "externalId";
|
|
226
228
|
}, {
|
|
227
|
-
user:
|
|
229
|
+
user: convex_values530.VUnion<"none" | "externalId", [convex_values530.VLiteral<"externalId", "required">, convex_values530.VLiteral<"none", "required">], "required", never>;
|
|
228
230
|
}, "required", "user">;
|
|
229
|
-
jit:
|
|
231
|
+
jit: convex_values530.VObject<{
|
|
230
232
|
defaultRole?: string | undefined;
|
|
231
233
|
defaultRoleIds?: string[] | undefined;
|
|
232
234
|
mode: "off" | "createUser" | "createUserAndMembership";
|
|
233
235
|
}, {
|
|
234
|
-
mode:
|
|
235
|
-
defaultRole:
|
|
236
|
-
defaultRoleIds:
|
|
236
|
+
mode: convex_values530.VUnion<"off" | "createUser" | "createUserAndMembership", [convex_values530.VLiteral<"off", "required">, convex_values530.VLiteral<"createUser", "required">, convex_values530.VLiteral<"createUserAndMembership", "required">], "required", never>;
|
|
237
|
+
defaultRole: convex_values530.VString<string | undefined, "optional">;
|
|
238
|
+
defaultRoleIds: convex_values530.VArray<string[] | undefined, convex_values530.VString<string, "required">, "optional">;
|
|
237
239
|
}, "required", "mode" | "defaultRole" | "defaultRoleIds">;
|
|
238
|
-
deprovision:
|
|
240
|
+
deprovision: convex_values530.VObject<{
|
|
239
241
|
mode: "soft" | "hard";
|
|
240
242
|
}, {
|
|
241
|
-
mode:
|
|
243
|
+
mode: convex_values530.VUnion<"soft" | "hard", [convex_values530.VLiteral<"soft", "required">, convex_values530.VLiteral<"hard", "required">], "required", never>;
|
|
242
244
|
}, "required", "mode">;
|
|
243
|
-
groups:
|
|
245
|
+
groups: convex_values530.VObject<{
|
|
244
246
|
mapping?: Record<string, string[]> | undefined;
|
|
245
247
|
source: "protocol";
|
|
246
248
|
mode: "ignore" | "sync";
|
|
247
249
|
}, {
|
|
248
|
-
mode:
|
|
249
|
-
source:
|
|
250
|
-
mapping:
|
|
250
|
+
mode: convex_values530.VUnion<"ignore" | "sync", [convex_values530.VLiteral<"ignore", "required">, convex_values530.VLiteral<"sync", "required">], "required", never>;
|
|
251
|
+
source: convex_values530.VLiteral<"protocol", "required">;
|
|
252
|
+
mapping: convex_values530.VRecord<Record<string, string[]> | undefined, convex_values530.VString<string, "required">, convex_values530.VArray<string[], convex_values530.VString<string, "required">, "required">, "optional", string>;
|
|
251
253
|
}, "required", "source" | "mode" | "mapping" | `mapping.${string}`>;
|
|
252
|
-
roles:
|
|
254
|
+
roles: convex_values530.VObject<{
|
|
253
255
|
mapping?: Record<string, string[]> | undefined;
|
|
254
256
|
source: "protocol";
|
|
255
257
|
mode: "map" | "ignore";
|
|
256
258
|
}, {
|
|
257
|
-
mode:
|
|
258
|
-
source:
|
|
259
|
-
mapping:
|
|
259
|
+
mode: convex_values530.VUnion<"map" | "ignore", [convex_values530.VLiteral<"ignore", "required">, convex_values530.VLiteral<"map", "required">], "required", never>;
|
|
260
|
+
source: convex_values530.VLiteral<"protocol", "required">;
|
|
261
|
+
mapping: convex_values530.VRecord<Record<string, string[]> | undefined, convex_values530.VString<string, "required">, convex_values530.VArray<string[], convex_values530.VString<string, "required">, "required">, "optional", string>;
|
|
260
262
|
}, "required", "source" | "mode" | "mapping" | `mapping.${string}`>;
|
|
261
263
|
}, "required", "user" | "scimReuse" | "jit" | "deprovision" | "groups" | "roles" | "user.createOnSignIn" | "user.updateProfileOnLogin" | "user.updateProfileFromScim" | "user.authority" | "scimReuse.user" | "jit.mode" | "jit.defaultRole" | "jit.defaultRoleIds" | "deprovision.mode" | "groups.source" | "groups.mode" | "groups.mapping" | `groups.mapping.${string}` | "roles.source" | "roles.mode" | "roles.mapping" | `roles.mapping.${string}`>;
|
|
262
|
-
extend:
|
|
264
|
+
extend: convex_values530.VAny<any, "optional", string>;
|
|
263
265
|
}, "optional", "extend" | `extend.${string}` | "version" | "identity" | "provisioning" | "identity.accountLinking" | "identity.accountLinking.oidc" | "identity.accountLinking.saml" | "provisioning.user" | "provisioning.scimReuse" | "provisioning.jit" | "provisioning.deprovision" | "provisioning.groups" | "provisioning.roles" | "provisioning.user.createOnSignIn" | "provisioning.user.updateProfileOnLogin" | "provisioning.user.updateProfileFromScim" | "provisioning.user.authority" | "provisioning.scimReuse.user" | "provisioning.jit.mode" | "provisioning.jit.defaultRole" | "provisioning.jit.defaultRoleIds" | "provisioning.deprovision.mode" | "provisioning.groups.source" | "provisioning.groups.mode" | "provisioning.groups.mapping" | `provisioning.groups.mapping.${string}` | "provisioning.roles.source" | "provisioning.roles.mode" | "provisioning.roles.mapping" | `provisioning.roles.mapping.${string}`>;
|
|
264
|
-
extend:
|
|
265
|
-
_id:
|
|
266
|
-
_creationTime:
|
|
267
|
-
}, "required", "
|
|
268
|
-
declare const vGroupMemberDoc:
|
|
266
|
+
extend: convex_values530.VAny<any, "optional", string>;
|
|
267
|
+
_id: convex_values530.VId<convex_values530.GenericId<"Group">, "required">;
|
|
268
|
+
_creationTime: convex_values530.VFloat64<number, "required">;
|
|
269
|
+
}, "required", "_creationTime" | "name" | "extend" | "type" | `extend.${string}` | "slug" | "parentGroupId" | "rootGroupId" | "isRoot" | "tags" | "policy" | "policy.extend" | `policy.extend.${string}` | "policy.version" | "policy.identity" | "policy.provisioning" | "policy.identity.accountLinking" | "policy.identity.accountLinking.oidc" | "policy.identity.accountLinking.saml" | "policy.provisioning.user" | "policy.provisioning.scimReuse" | "policy.provisioning.jit" | "policy.provisioning.deprovision" | "policy.provisioning.groups" | "policy.provisioning.roles" | "policy.provisioning.user.createOnSignIn" | "policy.provisioning.user.updateProfileOnLogin" | "policy.provisioning.user.updateProfileFromScim" | "policy.provisioning.user.authority" | "policy.provisioning.scimReuse.user" | "policy.provisioning.jit.mode" | "policy.provisioning.jit.defaultRole" | "policy.provisioning.jit.defaultRoleIds" | "policy.provisioning.deprovision.mode" | "policy.provisioning.groups.source" | "policy.provisioning.groups.mode" | "policy.provisioning.groups.mapping" | `policy.provisioning.groups.mapping.${string}` | "policy.provisioning.roles.source" | "policy.provisioning.roles.mode" | "policy.provisioning.roles.mapping" | `policy.provisioning.roles.mapping.${string}` | "_id">;
|
|
270
|
+
declare const vGroupMemberDoc: convex_values530.VObject<{
|
|
269
271
|
extend?: any;
|
|
270
272
|
status?: string | undefined;
|
|
271
273
|
role?: string | undefined;
|
|
272
274
|
roleIds?: string[] | undefined;
|
|
273
275
|
_creationTime: number;
|
|
274
|
-
userId:
|
|
275
|
-
groupId:
|
|
276
|
-
_id:
|
|
276
|
+
userId: convex_values530.GenericId<"User">;
|
|
277
|
+
groupId: convex_values530.GenericId<"Group">;
|
|
278
|
+
_id: convex_values530.GenericId<"GroupMember">;
|
|
277
279
|
}, {
|
|
278
|
-
groupId:
|
|
279
|
-
userId:
|
|
280
|
-
role:
|
|
281
|
-
roleIds:
|
|
282
|
-
status:
|
|
283
|
-
extend:
|
|
284
|
-
_id:
|
|
285
|
-
_creationTime:
|
|
280
|
+
groupId: convex_values530.VId<convex_values530.GenericId<"Group">, "required">;
|
|
281
|
+
userId: convex_values530.VId<convex_values530.GenericId<"User">, "required">;
|
|
282
|
+
role: convex_values530.VString<string | undefined, "optional">;
|
|
283
|
+
roleIds: convex_values530.VArray<string[] | undefined, convex_values530.VString<string, "required">, "optional">;
|
|
284
|
+
status: convex_values530.VString<string | undefined, "optional">;
|
|
285
|
+
extend: convex_values530.VAny<any, "optional", string>;
|
|
286
|
+
_id: convex_values530.VId<convex_values530.GenericId<"GroupMember">, "required">;
|
|
287
|
+
_creationTime: convex_values530.VFloat64<number, "required">;
|
|
286
288
|
}, "required", "_creationTime" | "extend" | `extend.${string}` | "userId" | "status" | "groupId" | "role" | "roleIds" | "_id">;
|
|
287
|
-
declare const vGroupInviteDoc:
|
|
289
|
+
declare const vGroupInviteDoc: convex_values530.VObject<{
|
|
288
290
|
email?: string | undefined;
|
|
289
291
|
extend?: any;
|
|
290
|
-
groupId?:
|
|
292
|
+
groupId?: convex_values530.GenericId<"Group"> | undefined;
|
|
291
293
|
role?: string | undefined;
|
|
292
294
|
roleIds?: string[] | undefined;
|
|
293
|
-
invitedByUserId?:
|
|
295
|
+
invitedByUserId?: convex_values530.GenericId<"User"> | undefined;
|
|
294
296
|
expiresTime?: number | undefined;
|
|
295
|
-
acceptedByUserId?:
|
|
297
|
+
acceptedByUserId?: convex_values530.GenericId<"User"> | undefined;
|
|
296
298
|
acceptedTime?: number | undefined;
|
|
297
299
|
_creationTime: number;
|
|
298
300
|
status: "pending" | "accepted" | "revoked" | "expired";
|
|
299
301
|
tokenHash: string;
|
|
300
|
-
_id:
|
|
302
|
+
_id: convex_values530.GenericId<"GroupInvite">;
|
|
301
303
|
}, {
|
|
302
|
-
groupId:
|
|
303
|
-
invitedByUserId:
|
|
304
|
-
email:
|
|
305
|
-
tokenHash:
|
|
306
|
-
role:
|
|
307
|
-
roleIds:
|
|
308
|
-
status:
|
|
309
|
-
expiresTime:
|
|
310
|
-
acceptedByUserId:
|
|
311
|
-
acceptedTime:
|
|
312
|
-
extend:
|
|
313
|
-
_id:
|
|
314
|
-
_creationTime:
|
|
315
|
-
}, "required", "
|
|
316
|
-
declare const vApiKeyDoc:
|
|
304
|
+
groupId: convex_values530.VId<convex_values530.GenericId<"Group"> | undefined, "optional">;
|
|
305
|
+
invitedByUserId: convex_values530.VId<convex_values530.GenericId<"User"> | undefined, "optional">;
|
|
306
|
+
email: convex_values530.VString<string | undefined, "optional">;
|
|
307
|
+
tokenHash: convex_values530.VString<string, "required">;
|
|
308
|
+
role: convex_values530.VString<string | undefined, "optional">;
|
|
309
|
+
roleIds: convex_values530.VArray<string[] | undefined, convex_values530.VString<string, "required">, "optional">;
|
|
310
|
+
status: convex_values530.VUnion<"pending" | "accepted" | "revoked" | "expired", [convex_values530.VLiteral<"pending", "required">, convex_values530.VLiteral<"accepted", "required">, convex_values530.VLiteral<"revoked", "required">, convex_values530.VLiteral<"expired", "required">], "required", never>;
|
|
311
|
+
expiresTime: convex_values530.VFloat64<number | undefined, "optional">;
|
|
312
|
+
acceptedByUserId: convex_values530.VId<convex_values530.GenericId<"User"> | undefined, "optional">;
|
|
313
|
+
acceptedTime: convex_values530.VFloat64<number | undefined, "optional">;
|
|
314
|
+
extend: convex_values530.VAny<any, "optional", string>;
|
|
315
|
+
_id: convex_values530.VId<convex_values530.GenericId<"GroupInvite">, "required">;
|
|
316
|
+
_creationTime: convex_values530.VFloat64<number, "required">;
|
|
317
|
+
}, "required", "_creationTime" | "email" | "extend" | `extend.${string}` | "status" | "groupId" | "role" | "roleIds" | "invitedByUserId" | "tokenHash" | "expiresTime" | "acceptedByUserId" | "acceptedTime" | "_id">;
|
|
318
|
+
declare const vApiKeyDoc: convex_values530.VObject<{
|
|
317
319
|
lastUsedAt?: number | undefined;
|
|
318
320
|
expiresAt?: number | undefined;
|
|
319
321
|
metadata?: any;
|
|
@@ -325,9 +327,9 @@ declare const vApiKeyDoc: convex_values519.VObject<{
|
|
|
325
327
|
attemptsLeft: number;
|
|
326
328
|
lastAttemptTime: number;
|
|
327
329
|
} | undefined;
|
|
328
|
-
name: string;
|
|
329
330
|
_creationTime: number;
|
|
330
|
-
|
|
331
|
+
name: string;
|
|
332
|
+
userId: convex_values530.GenericId<"User">;
|
|
331
333
|
createdAt: number;
|
|
332
334
|
revoked: boolean;
|
|
333
335
|
prefix: string;
|
|
@@ -336,44 +338,44 @@ declare const vApiKeyDoc: convex_values519.VObject<{
|
|
|
336
338
|
resource: string;
|
|
337
339
|
actions: string[];
|
|
338
340
|
}[];
|
|
339
|
-
_id:
|
|
341
|
+
_id: convex_values530.GenericId<"ApiKey">;
|
|
340
342
|
}, {
|
|
341
|
-
userId:
|
|
342
|
-
prefix:
|
|
343
|
-
hashedKey:
|
|
344
|
-
name:
|
|
345
|
-
scopes:
|
|
343
|
+
userId: convex_values530.VId<convex_values530.GenericId<"User">, "required">;
|
|
344
|
+
prefix: convex_values530.VString<string, "required">;
|
|
345
|
+
hashedKey: convex_values530.VString<string, "required">;
|
|
346
|
+
name: convex_values530.VString<string, "required">;
|
|
347
|
+
scopes: convex_values530.VArray<{
|
|
346
348
|
resource: string;
|
|
347
349
|
actions: string[];
|
|
348
|
-
}[],
|
|
350
|
+
}[], convex_values530.VObject<{
|
|
349
351
|
resource: string;
|
|
350
352
|
actions: string[];
|
|
351
353
|
}, {
|
|
352
|
-
resource:
|
|
353
|
-
actions:
|
|
354
|
+
resource: convex_values530.VString<string, "required">;
|
|
355
|
+
actions: convex_values530.VArray<string[], convex_values530.VString<string, "required">, "required">;
|
|
354
356
|
}, "required", "resource" | "actions">, "required">;
|
|
355
|
-
rateLimit:
|
|
357
|
+
rateLimit: convex_values530.VObject<{
|
|
356
358
|
maxRequests: number;
|
|
357
359
|
windowMs: number;
|
|
358
360
|
} | undefined, {
|
|
359
|
-
maxRequests:
|
|
360
|
-
windowMs:
|
|
361
|
+
maxRequests: convex_values530.VFloat64<number, "required">;
|
|
362
|
+
windowMs: convex_values530.VFloat64<number, "required">;
|
|
361
363
|
}, "optional", "maxRequests" | "windowMs">;
|
|
362
|
-
rateLimitState:
|
|
364
|
+
rateLimitState: convex_values530.VObject<{
|
|
363
365
|
attemptsLeft: number;
|
|
364
366
|
lastAttemptTime: number;
|
|
365
367
|
} | undefined, {
|
|
366
|
-
attemptsLeft:
|
|
367
|
-
lastAttemptTime:
|
|
368
|
+
attemptsLeft: convex_values530.VFloat64<number, "required">;
|
|
369
|
+
lastAttemptTime: convex_values530.VFloat64<number, "required">;
|
|
368
370
|
}, "optional", "attemptsLeft" | "lastAttemptTime">;
|
|
369
|
-
expiresAt:
|
|
370
|
-
lastUsedAt:
|
|
371
|
-
createdAt:
|
|
372
|
-
revoked:
|
|
373
|
-
metadata:
|
|
374
|
-
_id:
|
|
375
|
-
_creationTime:
|
|
376
|
-
}, "required", "
|
|
371
|
+
expiresAt: convex_values530.VFloat64<number | undefined, "optional">;
|
|
372
|
+
lastUsedAt: convex_values530.VFloat64<number | undefined, "optional">;
|
|
373
|
+
createdAt: convex_values530.VFloat64<number, "required">;
|
|
374
|
+
revoked: convex_values530.VBoolean<boolean, "required">;
|
|
375
|
+
metadata: convex_values530.VAny<any, "optional", string>;
|
|
376
|
+
_id: convex_values530.VId<convex_values530.GenericId<"ApiKey">, "required">;
|
|
377
|
+
_creationTime: convex_values530.VFloat64<number, "required">;
|
|
378
|
+
}, "required", "_creationTime" | "name" | "userId" | "createdAt" | "lastUsedAt" | "expiresAt" | "revoked" | "metadata" | `metadata.${string}` | "prefix" | "hashedKey" | "scopes" | "rateLimit" | "rateLimitState" | "rateLimit.maxRequests" | "rateLimit.windowMs" | "rateLimitState.attemptsLeft" | "rateLimitState.lastAttemptTime" | "_id">;
|
|
377
379
|
//#endregion
|
|
378
380
|
export { vApiKeyDoc, vGroupDoc, vGroupInviteDoc, vGroupMemberDoc, vPaginated, vUserDoc, vUserEmailDoc };
|
|
379
381
|
//# sourceMappingURL=model.d.ts.map
|
package/dist/component/model.js
CHANGED
|
@@ -118,6 +118,7 @@ const vUserDoc = v.object({
|
|
|
118
118
|
phoneVerificationTime: v.optional(v.number()),
|
|
119
119
|
isAnonymous: v.optional(v.boolean()),
|
|
120
120
|
lastActiveGroup: v.optional(v.id(TABLES.Group)),
|
|
121
|
+
hasTotp: v.optional(v.boolean()),
|
|
121
122
|
extend: v.optional(v.any())
|
|
122
123
|
});
|
|
123
124
|
const vUserEmailSource = v.union(v.literal("password"), v.literal("oauth"), v.literal("oidc"), v.literal("saml"), v.literal("scim"));
|
|
@@ -8,6 +8,7 @@ const modules = {
|
|
|
8
8
|
"./component/functions.ts": () => import("./functions.js"),
|
|
9
9
|
"./component/http.ts": () => import("./http.js"),
|
|
10
10
|
"./component/index.ts": () => import("./index.js"),
|
|
11
|
+
"./component/migrations.ts": () => import("./migrations.js"),
|
|
11
12
|
"./component/model.ts": () => import("./model.js"),
|
|
12
13
|
"./component/group.ts": () => import("./group.js"),
|
|
13
14
|
"./component/group/member.ts": () => import("./group/member.js"),
|