@robelest/convex-auth 0.0.4-preview.35 → 0.0.4-preview.37

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.
@@ -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 convex_server0 from "convex/server";
1
+ import * as convex_server12 from "convex/server";
2
2
 
3
3
  //#region src/component/convex.config.d.ts
4
- declare const component: convex_server0.ComponentDefinition<any>;
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,15 +1,15 @@
1
- import * as convex_values519 from "convex/values";
1
+ import * as convex_values438 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) => convex_values519.VObject<{
5
+ declare const vPaginated: <V extends Validator<any, any, any>>(item: V) => convex_values438.VObject<{
6
6
  items: V["type"][];
7
7
  nextCursor: string | null;
8
8
  }, {
9
- items: convex_values519.VArray<V["type"][], V, "required">;
10
- nextCursor: convex_values519.VUnion<string | null, [convex_values519.VString<string, "required">, convex_values519.VNull<null, "required">], "required", never>;
9
+ items: convex_values438.VArray<V["type"][], V, "required">;
10
+ nextCursor: convex_values438.VUnion<string | null, [convex_values438.VString<string, "required">, convex_values438.VNull<null, "required">], "required", never>;
11
11
  }, "required", "items" | "nextCursor">;
12
- declare const vUserDoc: convex_values519.VObject<{
12
+ declare const vUserDoc: convex_values438.VObject<{
13
13
  name?: string | undefined;
14
14
  email?: string | undefined;
15
15
  image?: string | undefined;
@@ -17,52 +17,54 @@ declare const vUserDoc: convex_values519.VObject<{
17
17
  emailVerificationTime?: number | undefined;
18
18
  phoneVerificationTime?: number | undefined;
19
19
  isAnonymous?: boolean | undefined;
20
- lastActiveGroup?: convex_values519.GenericId<"Group"> | undefined;
20
+ lastActiveGroup?: convex_values438.GenericId<"Group"> | undefined;
21
+ hasTotp?: boolean | undefined;
21
22
  extend?: any;
22
23
  _creationTime: number;
23
- _id: convex_values519.GenericId<"User">;
24
+ _id: convex_values438.GenericId<"User">;
24
25
  }, {
25
- name: convex_values519.VString<string | undefined, "optional">;
26
- image: convex_values519.VString<string | undefined, "optional">;
27
- email: convex_values519.VString<string | undefined, "optional">;
28
- emailVerificationTime: convex_values519.VFloat64<number | undefined, "optional">;
29
- phone: convex_values519.VString<string | undefined, "optional">;
30
- phoneVerificationTime: convex_values519.VFloat64<number | undefined, "optional">;
31
- isAnonymous: convex_values519.VBoolean<boolean | undefined, "optional">;
32
- lastActiveGroup: convex_values519.VId<convex_values519.GenericId<"Group"> | undefined, "optional">;
33
- extend: convex_values519.VAny<any, "optional", string>;
34
- _id: convex_values519.VId<convex_values519.GenericId<"User">, "required">;
35
- _creationTime: convex_values519.VFloat64<number, "required">;
36
- }, "required", "name" | "email" | "image" | "_creationTime" | "phone" | "emailVerificationTime" | "phoneVerificationTime" | "isAnonymous" | "lastActiveGroup" | "extend" | `extend.${string}` | "_id">;
37
- declare const vUserEmailDoc: convex_values519.VObject<{
26
+ name: convex_values438.VString<string | undefined, "optional">;
27
+ image: convex_values438.VString<string | undefined, "optional">;
28
+ email: convex_values438.VString<string | undefined, "optional">;
29
+ emailVerificationTime: convex_values438.VFloat64<number | undefined, "optional">;
30
+ phone: convex_values438.VString<string | undefined, "optional">;
31
+ phoneVerificationTime: convex_values438.VFloat64<number | undefined, "optional">;
32
+ isAnonymous: convex_values438.VBoolean<boolean | undefined, "optional">;
33
+ lastActiveGroup: convex_values438.VId<convex_values438.GenericId<"Group"> | undefined, "optional">;
34
+ hasTotp: convex_values438.VBoolean<boolean | undefined, "optional">;
35
+ extend: convex_values438.VAny<any, "optional", string>;
36
+ _id: convex_values438.VId<convex_values438.GenericId<"User">, "required">;
37
+ _creationTime: convex_values438.VFloat64<number, "required">;
38
+ }, "required", "name" | "email" | "image" | "_creationTime" | "phone" | "emailVerificationTime" | "phoneVerificationTime" | "isAnonymous" | "lastActiveGroup" | "hasTotp" | "extend" | `extend.${string}` | "_id">;
39
+ declare const vUserEmailDoc: convex_values438.VObject<{
38
40
  verificationTime?: number | undefined;
39
- accountId?: convex_values519.GenericId<"Account"> | undefined;
41
+ accountId?: convex_values438.GenericId<"Account"> | undefined;
40
42
  provider?: string | undefined;
41
- connectionId?: convex_values519.GenericId<"GroupConnection"> | undefined;
43
+ connectionId?: convex_values438.GenericId<"GroupConnection"> | undefined;
42
44
  email: string;
43
45
  _creationTime: number;
44
- userId: convex_values519.GenericId<"User">;
46
+ userId: convex_values438.GenericId<"User">;
45
47
  isPrimary: boolean;
46
48
  source: "password" | "oauth" | "oidc" | "saml" | "scim";
47
- _id: convex_values519.GenericId<"UserEmail">;
49
+ _id: convex_values438.GenericId<"UserEmail">;
48
50
  }, {
49
- userId: convex_values519.VId<convex_values519.GenericId<"User">, "required">;
50
- email: convex_values519.VString<string, "required">;
51
- verificationTime: convex_values519.VFloat64<number | undefined, "optional">;
52
- isPrimary: convex_values519.VBoolean<boolean, "required">;
53
- source: convex_values519.VUnion<"password" | "oauth" | "oidc" | "saml" | "scim", [convex_values519.VLiteral<"password", "required">, convex_values519.VLiteral<"oauth", "required">, convex_values519.VLiteral<"oidc", "required">, convex_values519.VLiteral<"saml", "required">, convex_values519.VLiteral<"scim", "required">], "required", never>;
54
- accountId: convex_values519.VId<convex_values519.GenericId<"Account"> | undefined, "optional">;
55
- provider: convex_values519.VString<string | undefined, "optional">;
56
- connectionId: convex_values519.VId<convex_values519.GenericId<"GroupConnection"> | undefined, "optional">;
57
- _id: convex_values519.VId<convex_values519.GenericId<"UserEmail">, "required">;
58
- _creationTime: convex_values519.VFloat64<number, "required">;
51
+ userId: convex_values438.VId<convex_values438.GenericId<"User">, "required">;
52
+ email: convex_values438.VString<string, "required">;
53
+ verificationTime: convex_values438.VFloat64<number | undefined, "optional">;
54
+ isPrimary: convex_values438.VBoolean<boolean, "required">;
55
+ source: convex_values438.VUnion<"password" | "oauth" | "oidc" | "saml" | "scim", [convex_values438.VLiteral<"password", "required">, convex_values438.VLiteral<"oauth", "required">, convex_values438.VLiteral<"oidc", "required">, convex_values438.VLiteral<"saml", "required">, convex_values438.VLiteral<"scim", "required">], "required", never>;
56
+ accountId: convex_values438.VId<convex_values438.GenericId<"Account"> | undefined, "optional">;
57
+ provider: convex_values438.VString<string | undefined, "optional">;
58
+ connectionId: convex_values438.VId<convex_values438.GenericId<"GroupConnection"> | undefined, "optional">;
59
+ _id: convex_values438.VId<convex_values438.GenericId<"UserEmail">, "required">;
60
+ _creationTime: convex_values438.VFloat64<number, "required">;
59
61
  }, "required", "email" | "_creationTime" | "userId" | "verificationTime" | "isPrimary" | "source" | "accountId" | "provider" | "connectionId" | "_id">;
60
- declare const vGroupDoc: convex_values519.VObject<{
62
+ declare const vGroupDoc: convex_values438.VObject<{
61
63
  extend?: any;
62
64
  type?: string | undefined;
63
65
  slug?: string | undefined;
64
- parentGroupId?: convex_values519.GenericId<"Group"> | undefined;
65
- rootGroupId?: convex_values519.GenericId<"Group"> | undefined;
66
+ parentGroupId?: convex_values438.GenericId<"Group"> | undefined;
67
+ rootGroupId?: convex_values438.GenericId<"Group"> | undefined;
66
68
  isRoot?: boolean | undefined;
67
69
  tags?: {
68
70
  key: string;
@@ -109,25 +111,25 @@ declare const vGroupDoc: convex_values519.VObject<{
109
111
  } | undefined;
110
112
  name: string;
111
113
  _creationTime: number;
112
- _id: convex_values519.GenericId<"Group">;
114
+ _id: convex_values438.GenericId<"Group">;
113
115
  }, {
114
- name: convex_values519.VString<string, "required">;
115
- slug: convex_values519.VString<string | undefined, "optional">;
116
- type: convex_values519.VString<string | undefined, "optional">;
117
- parentGroupId: convex_values519.VId<convex_values519.GenericId<"Group"> | undefined, "optional">;
118
- rootGroupId: convex_values519.VId<convex_values519.GenericId<"Group"> | undefined, "optional">;
119
- isRoot: convex_values519.VBoolean<boolean | undefined, "optional">;
120
- tags: convex_values519.VArray<{
116
+ name: convex_values438.VString<string, "required">;
117
+ slug: convex_values438.VString<string | undefined, "optional">;
118
+ type: convex_values438.VString<string | undefined, "optional">;
119
+ parentGroupId: convex_values438.VId<convex_values438.GenericId<"Group"> | undefined, "optional">;
120
+ rootGroupId: convex_values438.VId<convex_values438.GenericId<"Group"> | undefined, "optional">;
121
+ isRoot: convex_values438.VBoolean<boolean | undefined, "optional">;
122
+ tags: convex_values438.VArray<{
121
123
  key: string;
122
124
  value: string;
123
- }[] | undefined, convex_values519.VObject<{
125
+ }[] | undefined, convex_values438.VObject<{
124
126
  key: string;
125
127
  value: string;
126
128
  }, {
127
- key: convex_values519.VString<string, "required">;
128
- value: convex_values519.VString<string, "required">;
129
+ key: convex_values438.VString<string, "required">;
130
+ value: convex_values438.VString<string, "required">;
129
131
  }, "required", "key" | "value">, "optional">;
130
- policy: convex_values519.VObject<{
132
+ policy: convex_values438.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: convex_values519.VLiteral<1, "required">;
170
- identity: convex_values519.VObject<{
171
+ version: convex_values438.VLiteral<1, "required">;
172
+ identity: convex_values438.VObject<{
171
173
  accountLinking: {
172
174
  oidc: "verifiedEmail" | "none" | "sameConnection";
173
175
  saml: "verifiedEmail" | "none" | "sameConnection";
174
176
  };
175
177
  }, {
176
- accountLinking: convex_values519.VObject<{
178
+ accountLinking: convex_values438.VObject<{
177
179
  oidc: "verifiedEmail" | "none" | "sameConnection";
178
180
  saml: "verifiedEmail" | "none" | "sameConnection";
179
181
  }, {
180
- oidc: convex_values519.VUnion<"verifiedEmail" | "none" | "sameConnection", [convex_values519.VLiteral<"verifiedEmail", "required">, convex_values519.VLiteral<"none", "required">, convex_values519.VLiteral<"sameConnection", "required">], "required", never>;
181
- saml: convex_values519.VUnion<"verifiedEmail" | "none" | "sameConnection", [convex_values519.VLiteral<"verifiedEmail", "required">, convex_values519.VLiteral<"none", "required">, convex_values519.VLiteral<"sameConnection", "required">], "required", never>;
182
+ oidc: convex_values438.VUnion<"verifiedEmail" | "none" | "sameConnection", [convex_values438.VLiteral<"verifiedEmail", "required">, convex_values438.VLiteral<"none", "required">, convex_values438.VLiteral<"sameConnection", "required">], "required", never>;
183
+ saml: convex_values438.VUnion<"verifiedEmail" | "none" | "sameConnection", [convex_values438.VLiteral<"verifiedEmail", "required">, convex_values438.VLiteral<"none", "required">, convex_values438.VLiteral<"sameConnection", "required">], "required", never>;
182
184
  }, "required", "oidc" | "saml">;
183
185
  }, "required", "accountLinking" | "accountLinking.oidc" | "accountLinking.saml">;
184
- provisioning: convex_values519.VObject<{
186
+ provisioning: convex_values438.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: convex_values519.VObject<{
215
+ user: convex_values438.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: convex_values519.VBoolean<boolean, "required">;
220
- updateProfileOnLogin: convex_values519.VUnion<"never" | "missing" | "always", [convex_values519.VLiteral<"never", "required">, convex_values519.VLiteral<"missing", "required">, convex_values519.VLiteral<"always", "required">], "required", never>;
221
- updateProfileFromScim: convex_values519.VUnion<"never" | "missing" | "always", [convex_values519.VLiteral<"never", "required">, convex_values519.VLiteral<"missing", "required">, convex_values519.VLiteral<"always", "required">], "required", never>;
222
- authority: convex_values519.VUnion<"scim" | "app" | "sso", [convex_values519.VLiteral<"app", "required">, convex_values519.VLiteral<"sso", "required">, convex_values519.VLiteral<"scim", "required">], "required", never>;
221
+ createOnSignIn: convex_values438.VBoolean<boolean, "required">;
222
+ updateProfileOnLogin: convex_values438.VUnion<"never" | "missing" | "always", [convex_values438.VLiteral<"never", "required">, convex_values438.VLiteral<"missing", "required">, convex_values438.VLiteral<"always", "required">], "required", never>;
223
+ updateProfileFromScim: convex_values438.VUnion<"never" | "missing" | "always", [convex_values438.VLiteral<"never", "required">, convex_values438.VLiteral<"missing", "required">, convex_values438.VLiteral<"always", "required">], "required", never>;
224
+ authority: convex_values438.VUnion<"scim" | "app" | "sso", [convex_values438.VLiteral<"app", "required">, convex_values438.VLiteral<"sso", "required">, convex_values438.VLiteral<"scim", "required">], "required", never>;
223
225
  }, "required", "createOnSignIn" | "updateProfileOnLogin" | "updateProfileFromScim" | "authority">;
224
- scimReuse: convex_values519.VObject<{
226
+ scimReuse: convex_values438.VObject<{
225
227
  user: "none" | "externalId";
226
228
  }, {
227
- user: convex_values519.VUnion<"none" | "externalId", [convex_values519.VLiteral<"externalId", "required">, convex_values519.VLiteral<"none", "required">], "required", never>;
229
+ user: convex_values438.VUnion<"none" | "externalId", [convex_values438.VLiteral<"externalId", "required">, convex_values438.VLiteral<"none", "required">], "required", never>;
228
230
  }, "required", "user">;
229
- jit: convex_values519.VObject<{
231
+ jit: convex_values438.VObject<{
230
232
  defaultRole?: string | undefined;
231
233
  defaultRoleIds?: string[] | undefined;
232
234
  mode: "off" | "createUser" | "createUserAndMembership";
233
235
  }, {
234
- mode: convex_values519.VUnion<"off" | "createUser" | "createUserAndMembership", [convex_values519.VLiteral<"off", "required">, convex_values519.VLiteral<"createUser", "required">, convex_values519.VLiteral<"createUserAndMembership", "required">], "required", never>;
235
- defaultRole: convex_values519.VString<string | undefined, "optional">;
236
- defaultRoleIds: convex_values519.VArray<string[] | undefined, convex_values519.VString<string, "required">, "optional">;
236
+ mode: convex_values438.VUnion<"off" | "createUser" | "createUserAndMembership", [convex_values438.VLiteral<"off", "required">, convex_values438.VLiteral<"createUser", "required">, convex_values438.VLiteral<"createUserAndMembership", "required">], "required", never>;
237
+ defaultRole: convex_values438.VString<string | undefined, "optional">;
238
+ defaultRoleIds: convex_values438.VArray<string[] | undefined, convex_values438.VString<string, "required">, "optional">;
237
239
  }, "required", "mode" | "defaultRole" | "defaultRoleIds">;
238
- deprovision: convex_values519.VObject<{
240
+ deprovision: convex_values438.VObject<{
239
241
  mode: "soft" | "hard";
240
242
  }, {
241
- mode: convex_values519.VUnion<"soft" | "hard", [convex_values519.VLiteral<"soft", "required">, convex_values519.VLiteral<"hard", "required">], "required", never>;
243
+ mode: convex_values438.VUnion<"soft" | "hard", [convex_values438.VLiteral<"soft", "required">, convex_values438.VLiteral<"hard", "required">], "required", never>;
242
244
  }, "required", "mode">;
243
- groups: convex_values519.VObject<{
245
+ groups: convex_values438.VObject<{
244
246
  mapping?: Record<string, string[]> | undefined;
245
247
  source: "protocol";
246
248
  mode: "ignore" | "sync";
247
249
  }, {
248
- mode: convex_values519.VUnion<"ignore" | "sync", [convex_values519.VLiteral<"ignore", "required">, convex_values519.VLiteral<"sync", "required">], "required", never>;
249
- source: convex_values519.VLiteral<"protocol", "required">;
250
- mapping: convex_values519.VRecord<Record<string, string[]> | undefined, convex_values519.VString<string, "required">, convex_values519.VArray<string[], convex_values519.VString<string, "required">, "required">, "optional", string>;
250
+ mode: convex_values438.VUnion<"ignore" | "sync", [convex_values438.VLiteral<"ignore", "required">, convex_values438.VLiteral<"sync", "required">], "required", never>;
251
+ source: convex_values438.VLiteral<"protocol", "required">;
252
+ mapping: convex_values438.VRecord<Record<string, string[]> | undefined, convex_values438.VString<string, "required">, convex_values438.VArray<string[], convex_values438.VString<string, "required">, "required">, "optional", string>;
251
253
  }, "required", "source" | "mode" | "mapping" | `mapping.${string}`>;
252
- roles: convex_values519.VObject<{
254
+ roles: convex_values438.VObject<{
253
255
  mapping?: Record<string, string[]> | undefined;
254
256
  source: "protocol";
255
257
  mode: "map" | "ignore";
256
258
  }, {
257
- mode: convex_values519.VUnion<"map" | "ignore", [convex_values519.VLiteral<"ignore", "required">, convex_values519.VLiteral<"map", "required">], "required", never>;
258
- source: convex_values519.VLiteral<"protocol", "required">;
259
- mapping: convex_values519.VRecord<Record<string, string[]> | undefined, convex_values519.VString<string, "required">, convex_values519.VArray<string[], convex_values519.VString<string, "required">, "required">, "optional", string>;
259
+ mode: convex_values438.VUnion<"map" | "ignore", [convex_values438.VLiteral<"ignore", "required">, convex_values438.VLiteral<"map", "required">], "required", never>;
260
+ source: convex_values438.VLiteral<"protocol", "required">;
261
+ mapping: convex_values438.VRecord<Record<string, string[]> | undefined, convex_values438.VString<string, "required">, convex_values438.VArray<string[], convex_values438.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: convex_values519.VAny<any, "optional", string>;
264
+ extend: convex_values438.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: convex_values519.VAny<any, "optional", string>;
265
- _id: convex_values519.VId<convex_values519.GenericId<"Group">, "required">;
266
- _creationTime: convex_values519.VFloat64<number, "required">;
266
+ extend: convex_values438.VAny<any, "optional", string>;
267
+ _id: convex_values438.VId<convex_values438.GenericId<"Group">, "required">;
268
+ _creationTime: convex_values438.VFloat64<number, "required">;
267
269
  }, "required", "name" | "_creationTime" | "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">;
268
- declare const vGroupMemberDoc: convex_values519.VObject<{
270
+ declare const vGroupMemberDoc: convex_values438.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: convex_values519.GenericId<"User">;
275
- groupId: convex_values519.GenericId<"Group">;
276
- _id: convex_values519.GenericId<"GroupMember">;
276
+ userId: convex_values438.GenericId<"User">;
277
+ groupId: convex_values438.GenericId<"Group">;
278
+ _id: convex_values438.GenericId<"GroupMember">;
277
279
  }, {
278
- groupId: convex_values519.VId<convex_values519.GenericId<"Group">, "required">;
279
- userId: convex_values519.VId<convex_values519.GenericId<"User">, "required">;
280
- role: convex_values519.VString<string | undefined, "optional">;
281
- roleIds: convex_values519.VArray<string[] | undefined, convex_values519.VString<string, "required">, "optional">;
282
- status: convex_values519.VString<string | undefined, "optional">;
283
- extend: convex_values519.VAny<any, "optional", string>;
284
- _id: convex_values519.VId<convex_values519.GenericId<"GroupMember">, "required">;
285
- _creationTime: convex_values519.VFloat64<number, "required">;
280
+ groupId: convex_values438.VId<convex_values438.GenericId<"Group">, "required">;
281
+ userId: convex_values438.VId<convex_values438.GenericId<"User">, "required">;
282
+ role: convex_values438.VString<string | undefined, "optional">;
283
+ roleIds: convex_values438.VArray<string[] | undefined, convex_values438.VString<string, "required">, "optional">;
284
+ status: convex_values438.VString<string | undefined, "optional">;
285
+ extend: convex_values438.VAny<any, "optional", string>;
286
+ _id: convex_values438.VId<convex_values438.GenericId<"GroupMember">, "required">;
287
+ _creationTime: convex_values438.VFloat64<number, "required">;
286
288
  }, "required", "_creationTime" | "extend" | `extend.${string}` | "userId" | "status" | "groupId" | "role" | "roleIds" | "_id">;
287
- declare const vGroupInviteDoc: convex_values519.VObject<{
289
+ declare const vGroupInviteDoc: convex_values438.VObject<{
288
290
  email?: string | undefined;
289
291
  extend?: any;
290
- groupId?: convex_values519.GenericId<"Group"> | undefined;
292
+ groupId?: convex_values438.GenericId<"Group"> | undefined;
291
293
  role?: string | undefined;
292
294
  roleIds?: string[] | undefined;
293
- invitedByUserId?: convex_values519.GenericId<"User"> | undefined;
295
+ invitedByUserId?: convex_values438.GenericId<"User"> | undefined;
294
296
  expiresTime?: number | undefined;
295
- acceptedByUserId?: convex_values519.GenericId<"User"> | undefined;
297
+ acceptedByUserId?: convex_values438.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: convex_values519.GenericId<"GroupInvite">;
302
+ _id: convex_values438.GenericId<"GroupInvite">;
301
303
  }, {
302
- groupId: convex_values519.VId<convex_values519.GenericId<"Group"> | undefined, "optional">;
303
- invitedByUserId: convex_values519.VId<convex_values519.GenericId<"User"> | undefined, "optional">;
304
- email: convex_values519.VString<string | undefined, "optional">;
305
- tokenHash: convex_values519.VString<string, "required">;
306
- role: convex_values519.VString<string | undefined, "optional">;
307
- roleIds: convex_values519.VArray<string[] | undefined, convex_values519.VString<string, "required">, "optional">;
308
- status: convex_values519.VUnion<"pending" | "accepted" | "revoked" | "expired", [convex_values519.VLiteral<"pending", "required">, convex_values519.VLiteral<"accepted", "required">, convex_values519.VLiteral<"revoked", "required">, convex_values519.VLiteral<"expired", "required">], "required", never>;
309
- expiresTime: convex_values519.VFloat64<number | undefined, "optional">;
310
- acceptedByUserId: convex_values519.VId<convex_values519.GenericId<"User"> | undefined, "optional">;
311
- acceptedTime: convex_values519.VFloat64<number | undefined, "optional">;
312
- extend: convex_values519.VAny<any, "optional", string>;
313
- _id: convex_values519.VId<convex_values519.GenericId<"GroupInvite">, "required">;
314
- _creationTime: convex_values519.VFloat64<number, "required">;
304
+ groupId: convex_values438.VId<convex_values438.GenericId<"Group"> | undefined, "optional">;
305
+ invitedByUserId: convex_values438.VId<convex_values438.GenericId<"User"> | undefined, "optional">;
306
+ email: convex_values438.VString<string | undefined, "optional">;
307
+ tokenHash: convex_values438.VString<string, "required">;
308
+ role: convex_values438.VString<string | undefined, "optional">;
309
+ roleIds: convex_values438.VArray<string[] | undefined, convex_values438.VString<string, "required">, "optional">;
310
+ status: convex_values438.VUnion<"pending" | "accepted" | "revoked" | "expired", [convex_values438.VLiteral<"pending", "required">, convex_values438.VLiteral<"accepted", "required">, convex_values438.VLiteral<"revoked", "required">, convex_values438.VLiteral<"expired", "required">], "required", never>;
311
+ expiresTime: convex_values438.VFloat64<number | undefined, "optional">;
312
+ acceptedByUserId: convex_values438.VId<convex_values438.GenericId<"User"> | undefined, "optional">;
313
+ acceptedTime: convex_values438.VFloat64<number | undefined, "optional">;
314
+ extend: convex_values438.VAny<any, "optional", string>;
315
+ _id: convex_values438.VId<convex_values438.GenericId<"GroupInvite">, "required">;
316
+ _creationTime: convex_values438.VFloat64<number, "required">;
315
317
  }, "required", "email" | "_creationTime" | "extend" | `extend.${string}` | "status" | "groupId" | "role" | "roleIds" | "invitedByUserId" | "tokenHash" | "expiresTime" | "acceptedByUserId" | "acceptedTime" | "_id">;
316
- declare const vApiKeyDoc: convex_values519.VObject<{
318
+ declare const vApiKeyDoc: convex_values438.VObject<{
317
319
  lastUsedAt?: number | undefined;
318
320
  expiresAt?: number | undefined;
319
321
  metadata?: any;
@@ -327,7 +329,7 @@ declare const vApiKeyDoc: convex_values519.VObject<{
327
329
  } | undefined;
328
330
  name: string;
329
331
  _creationTime: number;
330
- userId: convex_values519.GenericId<"User">;
332
+ userId: convex_values438.GenericId<"User">;
331
333
  createdAt: number;
332
334
  revoked: boolean;
333
335
  prefix: string;
@@ -336,43 +338,43 @@ declare const vApiKeyDoc: convex_values519.VObject<{
336
338
  resource: string;
337
339
  actions: string[];
338
340
  }[];
339
- _id: convex_values519.GenericId<"ApiKey">;
341
+ _id: convex_values438.GenericId<"ApiKey">;
340
342
  }, {
341
- userId: convex_values519.VId<convex_values519.GenericId<"User">, "required">;
342
- prefix: convex_values519.VString<string, "required">;
343
- hashedKey: convex_values519.VString<string, "required">;
344
- name: convex_values519.VString<string, "required">;
345
- scopes: convex_values519.VArray<{
343
+ userId: convex_values438.VId<convex_values438.GenericId<"User">, "required">;
344
+ prefix: convex_values438.VString<string, "required">;
345
+ hashedKey: convex_values438.VString<string, "required">;
346
+ name: convex_values438.VString<string, "required">;
347
+ scopes: convex_values438.VArray<{
346
348
  resource: string;
347
349
  actions: string[];
348
- }[], convex_values519.VObject<{
350
+ }[], convex_values438.VObject<{
349
351
  resource: string;
350
352
  actions: string[];
351
353
  }, {
352
- resource: convex_values519.VString<string, "required">;
353
- actions: convex_values519.VArray<string[], convex_values519.VString<string, "required">, "required">;
354
+ resource: convex_values438.VString<string, "required">;
355
+ actions: convex_values438.VArray<string[], convex_values438.VString<string, "required">, "required">;
354
356
  }, "required", "resource" | "actions">, "required">;
355
- rateLimit: convex_values519.VObject<{
357
+ rateLimit: convex_values438.VObject<{
356
358
  maxRequests: number;
357
359
  windowMs: number;
358
360
  } | undefined, {
359
- maxRequests: convex_values519.VFloat64<number, "required">;
360
- windowMs: convex_values519.VFloat64<number, "required">;
361
+ maxRequests: convex_values438.VFloat64<number, "required">;
362
+ windowMs: convex_values438.VFloat64<number, "required">;
361
363
  }, "optional", "maxRequests" | "windowMs">;
362
- rateLimitState: convex_values519.VObject<{
364
+ rateLimitState: convex_values438.VObject<{
363
365
  attemptsLeft: number;
364
366
  lastAttemptTime: number;
365
367
  } | undefined, {
366
- attemptsLeft: convex_values519.VFloat64<number, "required">;
367
- lastAttemptTime: convex_values519.VFloat64<number, "required">;
368
+ attemptsLeft: convex_values438.VFloat64<number, "required">;
369
+ lastAttemptTime: convex_values438.VFloat64<number, "required">;
368
370
  }, "optional", "attemptsLeft" | "lastAttemptTime">;
369
- expiresAt: convex_values519.VFloat64<number | undefined, "optional">;
370
- lastUsedAt: convex_values519.VFloat64<number | undefined, "optional">;
371
- createdAt: convex_values519.VFloat64<number, "required">;
372
- revoked: convex_values519.VBoolean<boolean, "required">;
373
- metadata: convex_values519.VAny<any, "optional", string>;
374
- _id: convex_values519.VId<convex_values519.GenericId<"ApiKey">, "required">;
375
- _creationTime: convex_values519.VFloat64<number, "required">;
371
+ expiresAt: convex_values438.VFloat64<number | undefined, "optional">;
372
+ lastUsedAt: convex_values438.VFloat64<number | undefined, "optional">;
373
+ createdAt: convex_values438.VFloat64<number, "required">;
374
+ revoked: convex_values438.VBoolean<boolean, "required">;
375
+ metadata: convex_values438.VAny<any, "optional", string>;
376
+ _id: convex_values438.VId<convex_values438.GenericId<"ApiKey">, "required">;
377
+ _creationTime: convex_values438.VFloat64<number, "required">;
376
378
  }, "required", "name" | "_creationTime" | "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 };
@@ -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"),