@robelest/convex-auth 0.0.2-preview.0 → 0.0.2-preview.2

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 (166) hide show
  1. package/dist/bin.cjs +17 -15
  2. package/dist/client/index.d.ts +84 -30
  3. package/dist/client/index.d.ts.map +1 -1
  4. package/dist/client/index.js +259 -59
  5. package/dist/client/index.js.map +1 -1
  6. package/dist/component/_generated/component.d.ts +46 -120
  7. package/dist/component/_generated/component.d.ts.map +1 -1
  8. package/dist/component/index.d.ts +2 -4
  9. package/dist/component/index.d.ts.map +1 -1
  10. package/dist/component/index.js +2 -4
  11. package/dist/component/index.js.map +1 -1
  12. package/dist/component/public.d.ts +233 -167
  13. package/dist/component/public.d.ts.map +1 -1
  14. package/dist/component/public.js +328 -155
  15. package/dist/component/public.js.map +1 -1
  16. package/dist/component/schema.d.ts +127 -12
  17. package/dist/component/schema.d.ts.map +1 -1
  18. package/dist/component/schema.js +136 -10
  19. package/dist/component/schema.js.map +1 -1
  20. package/dist/providers/{Anonymous.d.ts → anonymous.d.ts} +8 -8
  21. package/dist/providers/{Anonymous.d.ts.map → anonymous.d.ts.map} +1 -1
  22. package/dist/providers/{Anonymous.js → anonymous.js} +9 -10
  23. package/dist/providers/anonymous.js.map +1 -0
  24. package/dist/providers/{ConvexCredentials.d.ts → credentials.d.ts} +11 -11
  25. package/dist/providers/credentials.d.ts.map +1 -0
  26. package/dist/providers/{ConvexCredentials.js → credentials.js} +8 -8
  27. package/dist/providers/credentials.js.map +1 -0
  28. package/dist/providers/{Email.d.ts → email.d.ts} +6 -6
  29. package/dist/providers/email.d.ts.map +1 -0
  30. package/dist/providers/{Email.js → email.js} +6 -6
  31. package/dist/providers/email.js.map +1 -0
  32. package/dist/providers/{Password.d.ts → password.d.ts} +10 -10
  33. package/dist/providers/{Password.d.ts.map → password.d.ts.map} +1 -1
  34. package/dist/providers/{Password.js → password.js} +19 -20
  35. package/dist/providers/password.js.map +1 -0
  36. package/dist/providers/{Phone.d.ts → phone.d.ts} +3 -3
  37. package/dist/providers/{Phone.d.ts.map → phone.d.ts.map} +1 -1
  38. package/dist/providers/{Phone.js → phone.js} +3 -3
  39. package/dist/providers/{Phone.js.map → phone.js.map} +1 -1
  40. package/dist/server/implementation/db.d.ts +5 -2
  41. package/dist/server/implementation/db.d.ts.map +1 -1
  42. package/dist/server/implementation/db.js +2 -1
  43. package/dist/server/implementation/db.js.map +1 -1
  44. package/dist/server/implementation/index.d.ts +285 -180
  45. package/dist/server/implementation/index.d.ts.map +1 -1
  46. package/dist/server/implementation/index.js +280 -173
  47. package/dist/server/implementation/index.js.map +1 -1
  48. package/dist/server/implementation/mutations/createAccountFromCredentials.d.ts.map +1 -1
  49. package/dist/server/implementation/mutations/createAccountFromCredentials.js +8 -18
  50. package/dist/server/implementation/mutations/createAccountFromCredentials.js.map +1 -1
  51. package/dist/server/implementation/mutations/createVerificationCode.d.ts.map +1 -1
  52. package/dist/server/implementation/mutations/createVerificationCode.js +16 -44
  53. package/dist/server/implementation/mutations/createVerificationCode.js.map +1 -1
  54. package/dist/server/implementation/mutations/invalidateSessions.d.ts.map +1 -1
  55. package/dist/server/implementation/mutations/invalidateSessions.js +4 -8
  56. package/dist/server/implementation/mutations/invalidateSessions.js.map +1 -1
  57. package/dist/server/implementation/mutations/modifyAccount.d.ts.map +1 -1
  58. package/dist/server/implementation/mutations/modifyAccount.js +8 -19
  59. package/dist/server/implementation/mutations/modifyAccount.js.map +1 -1
  60. package/dist/server/implementation/mutations/refreshSession.d.ts.map +1 -1
  61. package/dist/server/implementation/mutations/refreshSession.js +9 -23
  62. package/dist/server/implementation/mutations/refreshSession.js.map +1 -1
  63. package/dist/server/implementation/mutations/retrieveAccountWithCredentials.d.ts.map +1 -1
  64. package/dist/server/implementation/mutations/retrieveAccountWithCredentials.js +6 -12
  65. package/dist/server/implementation/mutations/retrieveAccountWithCredentials.js.map +1 -1
  66. package/dist/server/implementation/mutations/signIn.d.ts.map +1 -1
  67. package/dist/server/implementation/mutations/signIn.js +2 -1
  68. package/dist/server/implementation/mutations/signIn.js.map +1 -1
  69. package/dist/server/implementation/mutations/signOut.d.ts.map +1 -1
  70. package/dist/server/implementation/mutations/signOut.js +5 -6
  71. package/dist/server/implementation/mutations/signOut.js.map +1 -1
  72. package/dist/server/implementation/mutations/storeRef.d.ts +8 -0
  73. package/dist/server/implementation/mutations/storeRef.d.ts.map +1 -0
  74. package/dist/server/implementation/mutations/storeRef.js +8 -0
  75. package/dist/server/implementation/mutations/storeRef.js.map +1 -0
  76. package/dist/server/implementation/mutations/userOAuth.d.ts.map +1 -1
  77. package/dist/server/implementation/mutations/userOAuth.js +16 -53
  78. package/dist/server/implementation/mutations/userOAuth.js.map +1 -1
  79. package/dist/server/implementation/mutations/verifier.d.ts.map +1 -1
  80. package/dist/server/implementation/mutations/verifier.js +4 -8
  81. package/dist/server/implementation/mutations/verifier.js.map +1 -1
  82. package/dist/server/implementation/mutations/verifierSignature.d.ts.map +1 -1
  83. package/dist/server/implementation/mutations/verifierSignature.js +6 -10
  84. package/dist/server/implementation/mutations/verifierSignature.js.map +1 -1
  85. package/dist/server/implementation/mutations/verifyCodeAndSignIn.d.ts.map +1 -1
  86. package/dist/server/implementation/mutations/verifyCodeAndSignIn.js +7 -16
  87. package/dist/server/implementation/mutations/verifyCodeAndSignIn.js.map +1 -1
  88. package/dist/server/implementation/provider.d.ts +2 -1
  89. package/dist/server/implementation/provider.d.ts.map +1 -1
  90. package/dist/server/implementation/provider.js.map +1 -1
  91. package/dist/server/implementation/rateLimit.d.ts.map +1 -1
  92. package/dist/server/implementation/rateLimit.js +13 -39
  93. package/dist/server/implementation/rateLimit.js.map +1 -1
  94. package/dist/server/implementation/refreshTokens.d.ts +1 -8
  95. package/dist/server/implementation/refreshTokens.d.ts.map +1 -1
  96. package/dist/server/implementation/refreshTokens.js +14 -58
  97. package/dist/server/implementation/refreshTokens.js.map +1 -1
  98. package/dist/server/implementation/sessions.d.ts +2 -20
  99. package/dist/server/implementation/sessions.d.ts.map +1 -1
  100. package/dist/server/implementation/sessions.js +8 -35
  101. package/dist/server/implementation/sessions.js.map +1 -1
  102. package/dist/server/implementation/types.d.ts +11 -267
  103. package/dist/server/implementation/types.d.ts.map +1 -1
  104. package/dist/server/implementation/types.js +1 -181
  105. package/dist/server/implementation/types.js.map +1 -1
  106. package/dist/server/implementation/users.d.ts.map +1 -1
  107. package/dist/server/implementation/users.js +19 -67
  108. package/dist/server/implementation/users.js.map +1 -1
  109. package/dist/server/index.d.ts +18 -0
  110. package/dist/server/index.d.ts.map +1 -1
  111. package/dist/server/index.js +255 -0
  112. package/dist/server/index.js.map +1 -1
  113. package/dist/server/provider_utils.d.ts +1 -1
  114. package/dist/server/provider_utils.d.ts.map +1 -1
  115. package/dist/server/provider_utils.js +2 -2
  116. package/dist/server/provider_utils.js.map +1 -1
  117. package/dist/server/types.d.ts +91 -52
  118. package/dist/server/types.d.ts.map +1 -1
  119. package/package.json +3 -6
  120. package/src/cli/index.ts +20 -19
  121. package/src/client/index.ts +347 -110
  122. package/src/component/_generated/component.ts +55 -214
  123. package/src/component/index.ts +1 -11
  124. package/src/component/public.ts +366 -178
  125. package/src/component/schema.ts +150 -19
  126. package/src/providers/{Anonymous.ts → anonymous.ts} +10 -11
  127. package/src/providers/{ConvexCredentials.ts → credentials.ts} +11 -11
  128. package/src/providers/{Email.ts → email.ts} +5 -5
  129. package/src/providers/{Password.ts → password.ts} +22 -27
  130. package/src/providers/{Phone.ts → phone.ts} +2 -2
  131. package/src/server/implementation/db.ts +5 -2
  132. package/src/server/implementation/index.ts +368 -313
  133. package/src/server/implementation/mutations/createAccountFromCredentials.ts +11 -25
  134. package/src/server/implementation/mutations/createVerificationCode.ts +16 -47
  135. package/src/server/implementation/mutations/invalidateSessions.ts +4 -9
  136. package/src/server/implementation/mutations/modifyAccount.ts +8 -22
  137. package/src/server/implementation/mutations/refreshSession.ts +11 -24
  138. package/src/server/implementation/mutations/retrieveAccountWithCredentials.ts +9 -17
  139. package/src/server/implementation/mutations/signIn.ts +2 -1
  140. package/src/server/implementation/mutations/signOut.ts +5 -8
  141. package/src/server/implementation/mutations/storeRef.ts +7 -0
  142. package/src/server/implementation/mutations/userOAuth.ts +10 -50
  143. package/src/server/implementation/mutations/verifier.ts +4 -9
  144. package/src/server/implementation/mutations/verifierSignature.ts +6 -12
  145. package/src/server/implementation/mutations/verifyCodeAndSignIn.ts +7 -18
  146. package/src/server/implementation/provider.ts +2 -1
  147. package/src/server/implementation/rateLimit.ts +15 -41
  148. package/src/server/implementation/refreshTokens.ts +26 -76
  149. package/src/server/implementation/sessions.ts +8 -39
  150. package/src/server/implementation/types.ts +16 -191
  151. package/src/server/implementation/users.ts +19 -66
  152. package/src/server/index.ts +373 -0
  153. package/src/server/provider_utils.ts +2 -2
  154. package/src/server/types.ts +116 -51
  155. package/dist/providers/Anonymous.js.map +0 -1
  156. package/dist/providers/ConvexCredentials.d.ts.map +0 -1
  157. package/dist/providers/ConvexCredentials.js.map +0 -1
  158. package/dist/providers/Email.d.ts.map +0 -1
  159. package/dist/providers/Email.js.map +0 -1
  160. package/dist/providers/Password.js.map +0 -1
  161. package/providers/Anonymous/package.json +0 -6
  162. package/providers/ConvexCredentials/package.json +0 -6
  163. package/providers/Email/package.json +0 -6
  164. package/providers/Password/package.json +0 -6
  165. package/providers/Phone/package.json +0 -6
  166. package/server/package.json +0 -6
@@ -1,10 +1,9 @@
1
- import { Auth, DocumentByName, GenericActionCtx, GenericDataModel, HttpRouter, WithoutSystemFields } from "convex/server";
2
- import { GenericId, Value } from "convex/values";
3
- import { FunctionReferenceFromExport, GenericDoc } from "../convex_types.js";
4
- import { AuthProviderConfig, ConvexAuthConfig, GenericActionCtxWithAuthConfig } from "../types.js";
1
+ import { Auth, GenericActionCtx, GenericDataModel, HttpRouter } from "convex/server";
2
+ import { GenericId } from "convex/values";
3
+ import { FunctionReferenceFromExport } from "../convex_types.js";
4
+ import { AuthProviderConfig, ConvexAuthConfig } from "../types.js";
5
5
  import { Tokens } from "./types.js";
6
- export { authTables, Doc, Tokens } from "./types.js";
7
- export { getAuthSessionId } from "./sessions.js";
6
+ export { Doc, Tokens } from "./types.js";
8
7
  /**
9
8
  * The type of the signIn Convex Action returned from the auth() helper.
10
9
  *
@@ -26,8 +25,10 @@ export type SignOutAction = FunctionReferenceFromExport<ReturnType<typeof Auth>[
26
25
  *
27
26
  * ```ts filename="convex/auth.ts"
28
27
  * import { Auth } from "@robelest/convex-auth/component";
28
+ * import { components } from "./_generated/api";
29
29
  *
30
30
  * export const { auth, signIn, signOut, store } = Auth({
31
+ * component: components.auth,
31
32
  * providers: [],
32
33
  * });
33
34
  * ```
@@ -41,44 +42,302 @@ export declare function Auth(config_: ConvexAuthConfig): {
41
42
  */
42
43
  auth: {
43
44
  user: {
45
+ /**
46
+ * Get the current user's ID from the auth context, or `null` if
47
+ * not signed in.
48
+ */
44
49
  current: (ctx: {
45
50
  auth: Auth;
46
51
  }) => Promise<GenericId<"user"> | null>;
52
+ /**
53
+ * Get the current user's ID, or throw if not signed in.
54
+ * Use this when authentication is required.
55
+ */
47
56
  require: (ctx: {
48
57
  auth: Auth;
49
58
  }) => Promise<GenericId<"user">>;
59
+ /**
60
+ * Retrieve a user document by their ID.
61
+ */
50
62
  get: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery">, userId: string) => Promise<any>;
63
+ /**
64
+ * Get the currently signed-in user's document, or `null` if not
65
+ * signed in. Convenience method combining `current` + `get`.
66
+ */
51
67
  viewer: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery"> & {
52
68
  auth: Auth;
53
69
  }) => Promise<any>;
70
+ /**
71
+ * Query a user's group memberships.
72
+ */
73
+ group: {
74
+ /**
75
+ * List all groups a user belongs to. Returns member records which
76
+ * include the `groupId`, `role`, `status`, and `extend` for each.
77
+ */
78
+ list: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery">, opts: {
79
+ userId: string;
80
+ }) => Promise<any>;
81
+ /**
82
+ * Look up a user's membership in a specific group. Returns the member
83
+ * record (with role, status, extend) or `null` if the user is not
84
+ * a member.
85
+ */
86
+ get: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery">, opts: {
87
+ userId: string;
88
+ groupId: string;
89
+ }) => Promise<any>;
90
+ };
91
+ };
92
+ session: {
93
+ /**
94
+ * Get the current session ID from the auth context, or `null` if
95
+ * not signed in.
96
+ */
97
+ current: (ctx: {
98
+ auth: Auth;
99
+ }) => Promise<GenericId<"session"> | null>;
100
+ /**
101
+ * Invalidate sessions for a user, optionally preserving specific sessions.
102
+ */
103
+ invalidate: <DataModel extends GenericDataModel>(ctx: GenericActionCtx<DataModel>, args: {
104
+ userId: GenericId<"user">;
105
+ except?: GenericId<"session">[];
106
+ }) => Promise<void>;
107
+ };
108
+ account: {
109
+ /**
110
+ * Create an account and user for a credentials provider.
111
+ */
112
+ create: <DataModel extends GenericDataModel>(ctx: GenericActionCtx<DataModel>, args: {
113
+ provider: string;
114
+ account: {
115
+ id: string;
116
+ secret?: string;
117
+ };
118
+ profile: Record<string, unknown>;
119
+ shouldLinkViaEmail?: boolean;
120
+ shouldLinkViaPhone?: boolean;
121
+ }) => Promise<{
122
+ account: import("./types.js").Doc<"account">;
123
+ user: import("./types.js").Doc<"user">;
124
+ }>;
125
+ /**
126
+ * Retrieve an account and user for a credentials provider.
127
+ */
128
+ get: <DataModel extends GenericDataModel>(ctx: GenericActionCtx<DataModel>, args: {
129
+ provider: string;
130
+ account: {
131
+ id: string;
132
+ secret?: string;
133
+ };
134
+ }) => Promise<{
135
+ account: import("./types.js").Doc<"account">;
136
+ user: import("./types.js").Doc<"user">;
137
+ }>;
138
+ /**
139
+ * Update credentials for an existing account.
140
+ */
141
+ updateCredentials: <DataModel extends GenericDataModel>(ctx: GenericActionCtx<DataModel>, args: {
142
+ provider: string;
143
+ account: {
144
+ id: string;
145
+ secret: string;
146
+ };
147
+ }) => Promise<void>;
54
148
  };
55
- organization: {
56
- create: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, data: Record<string, unknown>) => Promise<string>;
57
- get: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, organizationId: string) => Promise<any>;
58
- list: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, ownerUserId?: string) => Promise<any>;
59
- update: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, organizationId: string, data: Record<string, unknown>) => Promise<void>;
60
- delete: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, organizationId: string) => Promise<void>;
149
+ provider: {
150
+ /**
151
+ * Sign in via another provider, typically from a credentials flow.
152
+ */
153
+ signIn: <DataModel extends GenericDataModel>(ctx: GenericActionCtx<DataModel>, provider: AuthProviderConfig, args: {
154
+ accountId?: GenericId<"account">;
155
+ params?: Record<string, unknown>;
156
+ }) => Promise<{
157
+ userId: GenericId<"user">;
158
+ sessionId: GenericId<"session">;
159
+ } | null>;
160
+ };
161
+ /**
162
+ * Hierarchical group management. Groups can nest arbitrarily deep
163
+ * via `parentGroupId`. A root group has no parent.
164
+ *
165
+ * ```ts
166
+ * const groupId = await auth.group.create(ctx, { name: "Acme Corp" });
167
+ * const subGroupId = await auth.group.create(ctx, {
168
+ * name: "Engineering",
169
+ * parentGroupId: groupId,
170
+ * });
171
+ * ```
172
+ */
173
+ group: {
174
+ /**
175
+ * Create a new group. Omit `parentGroupId` for a root-level group,
176
+ * or provide it to create a nested group.
177
+ *
178
+ * @returns The ID of the newly created group.
179
+ */
180
+ create: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, data: {
181
+ name: string;
182
+ slug?: string;
183
+ parentGroupId?: string;
184
+ extend?: Record<string, unknown>;
185
+ }) => Promise<string>;
186
+ /**
187
+ * Retrieve a group by its ID. Returns `null` if not found.
188
+ */
189
+ get: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery">, groupId: string) => Promise<any>;
190
+ /**
191
+ * List groups. When `parentGroupId` is provided, returns children of
192
+ * that group. When omitted, returns root-level groups (no parent).
193
+ */
194
+ list: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery">, opts?: {
195
+ parentGroupId?: string;
196
+ }) => Promise<any>;
197
+ /**
198
+ * Update a group's fields (name, slug, extend, parentGroupId).
199
+ */
200
+ update: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, groupId: string, data: Record<string, unknown>) => Promise<void>;
201
+ /**
202
+ * Delete a group and cascade to all descendants. Deletes child groups
203
+ * (recursively), all members, and all invites for this group and its
204
+ * descendants.
205
+ */
206
+ delete: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, groupId: string) => Promise<void>;
207
+ /**
208
+ * Manage group membership. A member links a user to a group with an
209
+ * application-defined role string (e.g. "owner", "admin", "member").
210
+ *
211
+ * The auth component stores roles but does not enforce access control.
212
+ * Your application defines what each role means.
213
+ */
61
214
  member: {
62
- add: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, data: Record<string, unknown>) => Promise<string>;
63
- remove: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, memberId: string) => Promise<void>;
64
- list: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, args: {
65
- organizationId: string;
66
- teamId?: string;
215
+ /**
216
+ * Add a user as a member of a group.
217
+ *
218
+ * @param data.groupId - The group to add the member to.
219
+ * @param data.userId - The user to add.
220
+ * @param data.role - Application-defined role (e.g. "owner", "admin", "member").
221
+ * @param data.status - Optional membership status (e.g. "active", "suspended").
222
+ * @param data.extend - Optional arbitrary JSON extension data.
223
+ * @throws ConvexError with code `DUPLICATE_MEMBERSHIP` if the user is
224
+ * already a member of the target group.
225
+ * @returns The ID of the new member record.
226
+ */
227
+ add: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, data: {
228
+ groupId: string;
229
+ userId: string;
230
+ role?: string;
231
+ status?: string;
232
+ extend?: Record<string, unknown>;
233
+ }) => Promise<string>;
234
+ /**
235
+ * Retrieve a member record by its ID. Returns `null` if not found.
236
+ */
237
+ get: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery">, memberId: string) => Promise<any>;
238
+ /**
239
+ * List all members of a group.
240
+ */
241
+ list: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery">, opts: {
242
+ groupId: string;
67
243
  }) => Promise<any>;
68
- role: {
69
- set: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, memberId: string, role: string) => Promise<void>;
70
- get: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, memberId: string) => Promise<any>;
71
- };
244
+ /**
245
+ * Remove a member from a group by deleting the member record.
246
+ */
247
+ remove: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, memberId: string) => Promise<void>;
248
+ /**
249
+ * Update a member's fields (role, status, extend).
250
+ *
251
+ * ```ts
252
+ * await auth.group.member.update(ctx, memberId, { role: "admin" });
253
+ * ```
254
+ */
255
+ update: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, memberId: string, data: Record<string, unknown>) => Promise<void>;
72
256
  };
73
257
  };
258
+ /**
259
+ * Manage platform-level invitations.
260
+ *
261
+ * Invites can optionally target a group by setting `groupId`, but they do
262
+ * not require groups and can be used in apps with user-only collaboration.
263
+ */
74
264
  invite: {
75
- create: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, data: Record<string, unknown>) => Promise<string>;
76
- get: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, inviteId: string) => Promise<any>;
77
- list: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, args: {
78
- organizationId?: string;
79
- status?: string;
265
+ /**
266
+ * Create a new invitation.
267
+ *
268
+ * @param data.groupId - Optional group to invite the user into.
269
+ * @param data.invitedByUserId - The user sending the invitation.
270
+ * @param data.email - The email address of the invitee.
271
+ * @param data.tokenHash - Hashed token for secure acceptance.
272
+ * @param data.role - Optional role to assign on acceptance.
273
+ * @param data.status - Initial status (typically "pending").
274
+ * @param data.expiresTime - Timestamp when the invite expires.
275
+ * @param data.extend - Optional arbitrary JSON extension data.
276
+ * @throws ConvexError with code `DUPLICATE_INVITE` if a pending invite
277
+ * already exists for this email and scope.
278
+ * @returns The ID of the new invite record.
279
+ */
280
+ create: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, data: {
281
+ groupId?: string;
282
+ invitedByUserId: string;
283
+ email: string;
284
+ tokenHash: string;
285
+ role?: string;
286
+ status: "pending" | "accepted" | "revoked" | "expired";
287
+ expiresTime: number;
288
+ extend?: Record<string, unknown>;
289
+ }) => Promise<string>;
290
+ /**
291
+ * Retrieve an invite by its ID. Returns `null` if not found.
292
+ */
293
+ get: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery">, inviteId: string) => Promise<any>;
294
+ /**
295
+ * List invites, optionally filtered by group and/or status.
296
+ */
297
+ list: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery">, opts?: {
298
+ groupId?: string;
299
+ status?: "pending" | "accepted" | "revoked" | "expired";
80
300
  }) => Promise<any>;
301
+ /**
302
+ * Accept an invitation. Marks the invite as "accepted" and records
303
+ * the timestamp. If the invite has a group, the caller is responsible
304
+ * for creating the member record via `auth.group.member.add` in the
305
+ * same Convex mutation for transactional safety.
306
+ *
307
+ * @throws ConvexError with code `INVITE_NOT_FOUND` when the invite does
308
+ * not exist.
309
+ * @throws ConvexError with code `INVITE_NOT_PENDING` when the invite is
310
+ * not in `pending` status.
311
+ *
312
+ * ```ts
313
+ * export const acceptInvite = mutation({
314
+ * args: { inviteId: v.string() },
315
+ * handler: async (ctx, { inviteId }) => {
316
+ * const userId = await auth.user.require(ctx);
317
+ * const invite = await auth.invite.get(ctx, inviteId);
318
+ * if (!invite) throw new Error("Invite not found");
319
+ *
320
+ * await auth.invite.accept(ctx, inviteId);
321
+ * if (invite.groupId) {
322
+ * await auth.group.member.add(ctx, {
323
+ * groupId: invite.groupId,
324
+ * userId,
325
+ * role: invite.role,
326
+ * });
327
+ * }
328
+ * },
329
+ * });
330
+ * ```
331
+ */
81
332
  accept: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, inviteId: string) => Promise<void>;
333
+ /**
334
+ * Revoke a pending invitation.
335
+ *
336
+ * @throws ConvexError with code `INVITE_NOT_FOUND` when the invite does
337
+ * not exist.
338
+ * @throws ConvexError with code `INVITE_NOT_PENDING` when the invite is
339
+ * not in `pending` status.
340
+ */
82
341
  revoke: (ctx: Pick<GenericActionCtx<GenericDataModel>, "runQuery" | "runMutation">, inviteId: string) => Promise<void>;
83
342
  };
84
343
  /**
@@ -213,158 +472,4 @@ export declare function Auth(config_: ConvexAuthConfig): {
213
472
  user: import("./types.js").Doc<"user">;
214
473
  } | null>>;
215
474
  };
216
- /**
217
- * Return the currently signed-in user's ID.
218
- *
219
- * ```ts filename="convex/myFunctions.tsx"
220
- * import { mutation } from "./_generated/server";
221
- * import { getAuthUserId } from "@robelest/convex-auth/component";
222
- *
223
- * export const doSomething = mutation({
224
- * args: {/* ... *\/},
225
- * handler: async (ctx, args) => {
226
- * const userId = await getAuthUserId(ctx);
227
- * if (userId === null) {
228
- * throw new Error("Client is not authenticated!")
229
- * }
230
- * const user = await ctx.db.get(userId);
231
- * // ...
232
- * },
233
- * });
234
- * ```
235
- *
236
- * @param ctx query, mutation or action `ctx`
237
- * @returns the user ID or `null` if the client isn't authenticated
238
- */
239
- export declare function getAuthUserId(ctx: {
240
- auth: Auth;
241
- }): Promise<GenericId<"user"> | null>;
242
- /**
243
- * Use this function from a
244
- * [`ConvexCredentials`](https://labs.convex.dev/auth/api_reference/providers/ConvexCredentials)
245
- * provider to create an account and a user with a unique account "id" (OAuth
246
- * provider ID, email address, phone number, username etc.).
247
- *
248
- * @returns user ID if it successfully creates the account
249
- * or throws an error.
250
- */
251
- export declare function createAccount<DataModel extends GenericDataModel = GenericDataModel>(ctx: GenericActionCtx<DataModel>, args: {
252
- /**
253
- * The provider ID (like "password"), used to disambiguate accounts.
254
- *
255
- * It is also used to configure account secret hashing via the provider's
256
- * `crypto` option.
257
- */
258
- provider: string;
259
- account: {
260
- /**
261
- * The unique external ID for the account, for example email address.
262
- */
263
- id: string;
264
- /**
265
- * The secret credential to store for this account, if given.
266
- */
267
- secret?: string;
268
- };
269
- /**
270
- * The profile data to store for the user.
271
- * These must fit the `users` table schema.
272
- */
273
- profile: WithoutSystemFields<DocumentByName<DataModel, "user">>;
274
- /**
275
- * If `true`, the account will be linked to an existing user
276
- * with the same verified email address.
277
- * This is only safe if the returned account's email is verified
278
- * before the user is allowed to sign in with it.
279
- */
280
- shouldLinkViaEmail?: boolean;
281
- /**
282
- * If `true`, the account will be linked to an existing user
283
- * with the same verified phone number.
284
- * This is only safe if the returned account's phone is verified
285
- * before the user is allowed to sign in with it.
286
- */
287
- shouldLinkViaPhone?: boolean;
288
- }): Promise<{
289
- account: GenericDoc<DataModel, "account">;
290
- user: GenericDoc<DataModel, "user">;
291
- }>;
292
- /**
293
- * Use this function from a
294
- * [`ConvexCredentials`](https://labs.convex.dev/auth/api_reference/providers/ConvexCredentials)
295
- * provider to retrieve a user given the account provider ID and
296
- * the provider-specific account ID.
297
- *
298
- * @returns the retrieved user document, or `null` if there is no account
299
- * for given account ID or throws if the provided
300
- * secret does not match.
301
- */
302
- export declare function retrieveAccount<DataModel extends GenericDataModel = GenericDataModel>(ctx: GenericActionCtx<DataModel>, args: {
303
- /**
304
- * The provider ID (like "password"), used to disambiguate accounts.
305
- *
306
- * It is also used to configure account secret hashing via the provider's
307
- * `crypto` option.
308
- */
309
- provider: string;
310
- account: {
311
- /**
312
- * The unique external ID for the account, for example email address.
313
- */
314
- id: string;
315
- /**
316
- * The secret that should match the stored credential, if given.
317
- */
318
- secret?: string;
319
- };
320
- }): Promise<{
321
- account: GenericDoc<DataModel, "account">;
322
- user: GenericDoc<DataModel, "user">;
323
- }>;
324
- /**
325
- * Use this function to modify the account credentials
326
- * from a [`ConvexCredentials`](https://labs.convex.dev/auth/api_reference/providers/ConvexCredentials)
327
- * provider.
328
- */
329
- export declare function modifyAccountCredentials<DataModel extends GenericDataModel = GenericDataModel>(ctx: GenericActionCtx<DataModel>, args: {
330
- /**
331
- * The provider ID (like "password"), used to disambiguate accounts.
332
- *
333
- * It is also used to configure account secret hashing via the `crypto` option.
334
- */
335
- provider: string;
336
- account: {
337
- /**
338
- * The unique external ID for the account, for example email address.
339
- */
340
- id: string;
341
- /**
342
- * The new secret credential to store for this account.
343
- */
344
- secret: string;
345
- };
346
- }): Promise<void>;
347
- /**
348
- * Use this function to invalidate existing sessions.
349
- */
350
- export declare function invalidateSessions<DataModel extends GenericDataModel = GenericDataModel>(ctx: GenericActionCtx<DataModel>, args: {
351
- userId: GenericId<"user">;
352
- except?: GenericId<"session">[];
353
- }): Promise<void>;
354
- /**
355
- * Use this function from a
356
- * [`ConvexCredentials`](https://labs.convex.dev/auth/api_reference/providers/ConvexCredentials)
357
- * provider to sign in the user via another provider (usually
358
- * for email verification on sign up or password reset).
359
- *
360
- * Returns the user ID if the sign can proceed,
361
- * or `null`.
362
- */
363
- export declare function signInViaProvider<DataModel extends GenericDataModel = GenericDataModel>(ctx: GenericActionCtxWithAuthConfig<DataModel>, provider: AuthProviderConfig, args: {
364
- accountId?: GenericId<"account">;
365
- params?: Record<string, Value | undefined>;
366
- }): Promise<{
367
- userId: GenericId<"user">;
368
- sessionId: GenericId<"session">;
369
- } | null>;
370
475
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/implementation/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,IAAI,EACJ,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,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