@robelest/convex-auth 0.0.4-preview.21 → 0.0.4-preview.22

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 (39) hide show
  1. package/dist/component/convex.config.d.ts +2 -2
  2. package/dist/component/convex.config.d.ts.map +1 -1
  3. package/dist/component/model.d.ts +10 -10
  4. package/dist/component/model.d.ts.map +1 -1
  5. package/dist/component/schema.d.ts +51 -51
  6. package/dist/component/server/auth.d.ts +71 -25
  7. package/dist/component/server/auth.d.ts.map +1 -1
  8. package/dist/component/server/auth.js +13 -27
  9. package/dist/component/server/auth.js.map +1 -1
  10. package/dist/component/server/runtime.d.ts +2 -2
  11. package/dist/server/auth.d.ts +70 -24
  12. package/dist/server/auth.d.ts.map +1 -1
  13. package/dist/server/auth.js +13 -27
  14. package/dist/server/auth.js.map +1 -1
  15. package/dist/server/index.d.ts +2 -2
  16. package/dist/server/mounts.d.ts +12 -12
  17. package/dist/server/mutations/account.d.ts +6 -6
  18. package/dist/server/mutations/account.d.ts.map +1 -1
  19. package/dist/server/mutations/code.d.ts +13 -13
  20. package/dist/server/mutations/invalidate.d.ts +4 -4
  21. package/dist/server/mutations/invalidate.d.ts.map +1 -1
  22. package/dist/server/mutations/oauth.d.ts +9 -9
  23. package/dist/server/mutations/oauth.d.ts.map +1 -1
  24. package/dist/server/mutations/refresh.d.ts +3 -3
  25. package/dist/server/mutations/refresh.d.ts.map +1 -1
  26. package/dist/server/mutations/register.d.ts +11 -11
  27. package/dist/server/mutations/retrieve.d.ts +6 -6
  28. package/dist/server/mutations/retrieve.d.ts.map +1 -1
  29. package/dist/server/mutations/signature.d.ts +4 -4
  30. package/dist/server/mutations/signin.d.ts +5 -5
  31. package/dist/server/mutations/store.d.ts +100 -100
  32. package/dist/server/mutations/store.d.ts.map +1 -1
  33. package/dist/server/mutations/verify.d.ts +10 -10
  34. package/dist/server/runtime.d.ts +15 -15
  35. package/package.json +2 -2
  36. package/src/cli/index.ts +1 -1
  37. package/src/component/index.ts +1 -0
  38. package/src/server/auth.ts +103 -59
  39. package/src/server/index.ts +2 -0
@@ -3,16 +3,16 @@ import { AuthError } from "../authError.js";
3
3
  import { Config } from "../crypto.js";
4
4
  import { Fx } from "@robelest/fx";
5
5
  import { GenericActionCtx, GenericDataModel } from "convex/server";
6
- import * as convex_values111 from "convex/values";
6
+ import * as convex_values110 from "convex/values";
7
7
  import { Infer } from "convex/values";
8
8
 
9
9
  //#region src/server/mutations/signature.d.ts
10
- declare const verifierSignatureArgs: convex_values111.VObject<{
10
+ declare const verifierSignatureArgs: convex_values110.VObject<{
11
11
  verifier: string;
12
12
  signature: string;
13
13
  }, {
14
- verifier: convex_values111.VString<string, "required">;
15
- signature: convex_values111.VString<string, "required">;
14
+ verifier: convex_values110.VString<string, "required">;
15
+ signature: convex_values110.VString<string, "required">;
16
16
  }, "required", "verifier" | "signature">;
17
17
  type ReturnType = void;
18
18
  declare function verifierSignatureImpl(ctx: MutationCtx, args: Infer<typeof verifierSignatureArgs>, config: Config): Fx<ReturnType, AuthError>;
@@ -1,18 +1,18 @@
1
1
  import { MutationCtx, SessionInfo } from "../types.js";
2
2
  import { Config } from "../crypto.js";
3
3
  import { GenericActionCtx, GenericDataModel } from "convex/server";
4
- import * as convex_values16 from "convex/values";
4
+ import * as convex_values26 from "convex/values";
5
5
  import { Infer } from "convex/values";
6
6
 
7
7
  //#region src/server/mutations/signin.d.ts
8
- declare const signInArgs: convex_values16.VObject<{
8
+ declare const signInArgs: convex_values26.VObject<{
9
9
  sessionId?: string | undefined;
10
10
  userId: string;
11
11
  generateTokens: boolean;
12
12
  }, {
13
- userId: convex_values16.VString<string, "required">;
14
- sessionId: convex_values16.VString<string | undefined, "optional">;
15
- generateTokens: convex_values16.VBoolean<boolean, "required">;
13
+ userId: convex_values26.VString<string, "required">;
14
+ sessionId: convex_values26.VString<string | undefined, "optional">;
15
+ generateTokens: convex_values26.VBoolean<boolean, "required">;
16
16
  }, "required", "userId" | "sessionId" | "generateTokens">;
17
17
  type ReturnType = SessionInfo;
18
18
  declare function signInImpl(ctx: MutationCtx, args: Infer<typeof signInArgs>, config: Config): Promise<ReturnType>;
@@ -1,14 +1,14 @@
1
1
  import { Doc, MutationCtx, SessionInfo } from "../types.js";
2
2
  import { Config, GetProviderOrThrowFunc } from "../crypto.js";
3
- import * as convex_values20 from "convex/values";
3
+ import * as convex_values41 from "convex/values";
4
4
  import { Infer } from "convex/values";
5
5
 
6
6
  //#region src/server/mutations/store.d.ts
7
- declare const storeArgs: convex_values20.VObject<{
7
+ declare const storeArgs: convex_values41.VObject<{
8
8
  args: {
9
9
  sessionId?: string | undefined;
10
- userId: string;
11
10
  type: "signIn";
11
+ userId: string;
12
12
  generateTokens: boolean;
13
13
  } | {
14
14
  type: "signOut";
@@ -19,9 +19,9 @@ declare const storeArgs: convex_values20.VObject<{
19
19
  provider?: string | undefined;
20
20
  verifier?: string | undefined;
21
21
  type: "verifyCodeAndSignIn";
22
- allowExtraProviders: boolean;
23
- generateTokens: boolean;
24
22
  params: any;
23
+ generateTokens: boolean;
24
+ allowExtraProviders: boolean;
25
25
  } | {
26
26
  type: "verifier";
27
27
  } | {
@@ -30,30 +30,30 @@ declare const storeArgs: convex_values20.VObject<{
30
30
  signature: string;
31
31
  } | {
32
32
  accountExtend?: any;
33
+ profile: any;
33
34
  type: "userOAuth";
34
35
  provider: string;
35
36
  signature: string;
36
37
  providerAccountId: string;
37
- profile: any;
38
38
  } | {
39
+ phone?: string | undefined;
39
40
  email?: string | undefined;
40
41
  accountId?: string | undefined;
41
- phone?: string | undefined;
42
+ code: string;
42
43
  type: "createVerificationCode";
43
44
  provider: string;
44
- code: string;
45
- expirationTime: number;
46
45
  allowExtraProviders: boolean;
46
+ expirationTime: number;
47
47
  } | {
48
48
  shouldLinkViaEmail?: boolean | undefined;
49
49
  shouldLinkViaPhone?: boolean | undefined;
50
+ profile: any;
50
51
  type: "createAccountFromCredentials";
51
52
  provider: string;
52
53
  account: {
53
54
  secret?: string | undefined;
54
55
  id: string;
55
56
  };
56
- profile: any;
57
57
  } | {
58
58
  type: "retrieveAccountWithCredentials";
59
59
  provider: string;
@@ -70,14 +70,14 @@ declare const storeArgs: convex_values20.VObject<{
70
70
  };
71
71
  } | {
72
72
  except?: string[] | undefined;
73
- userId: string;
74
73
  type: "invalidateSessions";
74
+ userId: string;
75
75
  };
76
76
  }, {
77
- args: convex_values20.VUnion<{
77
+ args: convex_values41.VUnion<{
78
78
  sessionId?: string | undefined;
79
- userId: string;
80
79
  type: "signIn";
80
+ userId: string;
81
81
  generateTokens: boolean;
82
82
  } | {
83
83
  type: "signOut";
@@ -88,9 +88,9 @@ declare const storeArgs: convex_values20.VObject<{
88
88
  provider?: string | undefined;
89
89
  verifier?: string | undefined;
90
90
  type: "verifyCodeAndSignIn";
91
- allowExtraProviders: boolean;
92
- generateTokens: boolean;
93
91
  params: any;
92
+ generateTokens: boolean;
93
+ allowExtraProviders: boolean;
94
94
  } | {
95
95
  type: "verifier";
96
96
  } | {
@@ -99,30 +99,30 @@ declare const storeArgs: convex_values20.VObject<{
99
99
  signature: string;
100
100
  } | {
101
101
  accountExtend?: any;
102
+ profile: any;
102
103
  type: "userOAuth";
103
104
  provider: string;
104
105
  signature: string;
105
106
  providerAccountId: string;
106
- profile: any;
107
107
  } | {
108
+ phone?: string | undefined;
108
109
  email?: string | undefined;
109
110
  accountId?: string | undefined;
110
- phone?: string | undefined;
111
+ code: string;
111
112
  type: "createVerificationCode";
112
113
  provider: string;
113
- code: string;
114
- expirationTime: number;
115
114
  allowExtraProviders: boolean;
115
+ expirationTime: number;
116
116
  } | {
117
117
  shouldLinkViaEmail?: boolean | undefined;
118
118
  shouldLinkViaPhone?: boolean | undefined;
119
+ profile: any;
119
120
  type: "createAccountFromCredentials";
120
121
  provider: string;
121
122
  account: {
122
123
  secret?: string | undefined;
123
124
  id: string;
124
125
  };
125
- profile: any;
126
126
  } | {
127
127
  type: "retrieveAccountWithCredentials";
128
128
  provider: string;
@@ -139,110 +139,110 @@ declare const storeArgs: convex_values20.VObject<{
139
139
  };
140
140
  } | {
141
141
  except?: string[] | undefined;
142
- userId: string;
143
142
  type: "invalidateSessions";
144
- }, [convex_values20.VObject<{
145
- sessionId?: string | undefined;
146
143
  userId: string;
144
+ }, [convex_values41.VObject<{
145
+ sessionId?: string | undefined;
147
146
  type: "signIn";
147
+ userId: string;
148
148
  generateTokens: boolean;
149
149
  }, {
150
- userId: convex_values20.VString<string, "required">;
151
- sessionId: convex_values20.VString<string | undefined, "optional">;
152
- generateTokens: convex_values20.VBoolean<boolean, "required">;
153
- type: convex_values20.VLiteral<"signIn", "required">;
154
- }, "required", "userId" | "type" | "sessionId" | "generateTokens">, convex_values20.VObject<{
150
+ userId: convex_values41.VString<string, "required">;
151
+ sessionId: convex_values41.VString<string | undefined, "optional">;
152
+ generateTokens: convex_values41.VBoolean<boolean, "required">;
153
+ type: convex_values41.VLiteral<"signIn", "required">;
154
+ }, "required", "type" | "userId" | "sessionId" | "generateTokens">, convex_values41.VObject<{
155
155
  type: "signOut";
156
156
  }, {
157
- type: convex_values20.VLiteral<"signOut", "required">;
158
- }, "required", "type">, convex_values20.VObject<{
157
+ type: convex_values41.VLiteral<"signOut", "required">;
158
+ }, "required", "type">, convex_values41.VObject<{
159
159
  type: "refreshSession";
160
160
  refreshToken: string;
161
161
  }, {
162
- refreshToken: convex_values20.VString<string, "required">;
163
- type: convex_values20.VLiteral<"refreshSession", "required">;
164
- }, "required", "type" | "refreshToken">, convex_values20.VObject<{
162
+ refreshToken: convex_values41.VString<string, "required">;
163
+ type: convex_values41.VLiteral<"refreshSession", "required">;
164
+ }, "required", "type" | "refreshToken">, convex_values41.VObject<{
165
165
  provider?: string | undefined;
166
166
  verifier?: string | undefined;
167
167
  type: "verifyCodeAndSignIn";
168
- allowExtraProviders: boolean;
169
- generateTokens: boolean;
170
168
  params: any;
169
+ generateTokens: boolean;
170
+ allowExtraProviders: boolean;
171
171
  }, {
172
- params: convex_values20.VAny<any, "required", string>;
173
- provider: convex_values20.VString<string | undefined, "optional">;
174
- verifier: convex_values20.VString<string | undefined, "optional">;
175
- generateTokens: convex_values20.VBoolean<boolean, "required">;
176
- allowExtraProviders: convex_values20.VBoolean<boolean, "required">;
177
- type: convex_values20.VLiteral<"verifyCodeAndSignIn", "required">;
178
- }, "required", "type" | "provider" | "allowExtraProviders" | "generateTokens" | "params" | "verifier" | `params.${string}`>, convex_values20.VObject<{
172
+ params: convex_values41.VAny<any, "required", string>;
173
+ provider: convex_values41.VString<string | undefined, "optional">;
174
+ verifier: convex_values41.VString<string | undefined, "optional">;
175
+ generateTokens: convex_values41.VBoolean<boolean, "required">;
176
+ allowExtraProviders: convex_values41.VBoolean<boolean, "required">;
177
+ type: convex_values41.VLiteral<"verifyCodeAndSignIn", "required">;
178
+ }, "required", "type" | "provider" | "params" | "verifier" | "generateTokens" | "allowExtraProviders" | `params.${string}`>, convex_values41.VObject<{
179
179
  type: "verifier";
180
180
  }, {
181
- type: convex_values20.VLiteral<"verifier", "required">;
182
- }, "required", "type">, convex_values20.VObject<{
181
+ type: convex_values41.VLiteral<"verifier", "required">;
182
+ }, "required", "type">, convex_values41.VObject<{
183
183
  type: "verifierSignature";
184
184
  verifier: string;
185
185
  signature: string;
186
186
  }, {
187
- verifier: convex_values20.VString<string, "required">;
188
- signature: convex_values20.VString<string, "required">;
189
- type: convex_values20.VLiteral<"verifierSignature", "required">;
190
- }, "required", "type" | "verifier" | "signature">, convex_values20.VObject<{
187
+ verifier: convex_values41.VString<string, "required">;
188
+ signature: convex_values41.VString<string, "required">;
189
+ type: convex_values41.VLiteral<"verifierSignature", "required">;
190
+ }, "required", "type" | "verifier" | "signature">, convex_values41.VObject<{
191
191
  accountExtend?: any;
192
+ profile: any;
192
193
  type: "userOAuth";
193
194
  provider: string;
194
195
  signature: string;
195
196
  providerAccountId: string;
196
- profile: any;
197
197
  }, {
198
- provider: convex_values20.VString<string, "required">;
199
- providerAccountId: convex_values20.VString<string, "required">;
200
- profile: convex_values20.VAny<any, "required", string>;
201
- signature: convex_values20.VString<string, "required">;
202
- accountExtend: convex_values20.VAny<any, "optional", string>;
203
- type: convex_values20.VLiteral<"userOAuth", "required">;
204
- }, "required", "type" | "provider" | "signature" | "providerAccountId" | "profile" | "accountExtend" | `profile.${string}` | `accountExtend.${string}`>, convex_values20.VObject<{
198
+ provider: convex_values41.VString<string, "required">;
199
+ providerAccountId: convex_values41.VString<string, "required">;
200
+ profile: convex_values41.VAny<any, "required", string>;
201
+ signature: convex_values41.VString<string, "required">;
202
+ accountExtend: convex_values41.VAny<any, "optional", string>;
203
+ type: convex_values41.VLiteral<"userOAuth", "required">;
204
+ }, "required", "profile" | "type" | "provider" | "signature" | "providerAccountId" | "accountExtend" | `profile.${string}` | `accountExtend.${string}`>, convex_values41.VObject<{
205
+ phone?: string | undefined;
205
206
  email?: string | undefined;
206
207
  accountId?: string | undefined;
207
- phone?: string | undefined;
208
+ code: string;
208
209
  type: "createVerificationCode";
209
210
  provider: string;
210
- code: string;
211
- expirationTime: number;
212
211
  allowExtraProviders: boolean;
212
+ expirationTime: number;
213
213
  }, {
214
- accountId: convex_values20.VString<string | undefined, "optional">;
215
- provider: convex_values20.VString<string, "required">;
216
- email: convex_values20.VString<string | undefined, "optional">;
217
- phone: convex_values20.VString<string | undefined, "optional">;
218
- code: convex_values20.VString<string, "required">;
219
- expirationTime: convex_values20.VFloat64<number, "required">;
220
- allowExtraProviders: convex_values20.VBoolean<boolean, "required">;
221
- type: convex_values20.VLiteral<"createVerificationCode", "required">;
222
- }, "required", "email" | "type" | "provider" | "code" | "accountId" | "phone" | "expirationTime" | "allowExtraProviders">, convex_values20.VObject<{
214
+ accountId: convex_values41.VString<string | undefined, "optional">;
215
+ provider: convex_values41.VString<string, "required">;
216
+ email: convex_values41.VString<string | undefined, "optional">;
217
+ phone: convex_values41.VString<string | undefined, "optional">;
218
+ code: convex_values41.VString<string, "required">;
219
+ expirationTime: convex_values41.VFloat64<number, "required">;
220
+ allowExtraProviders: convex_values41.VBoolean<boolean, "required">;
221
+ type: convex_values41.VLiteral<"createVerificationCode", "required">;
222
+ }, "required", "phone" | "email" | "code" | "type" | "provider" | "allowExtraProviders" | "accountId" | "expirationTime">, convex_values41.VObject<{
223
223
  shouldLinkViaEmail?: boolean | undefined;
224
224
  shouldLinkViaPhone?: boolean | undefined;
225
+ profile: any;
225
226
  type: "createAccountFromCredentials";
226
227
  provider: string;
227
228
  account: {
228
229
  secret?: string | undefined;
229
230
  id: string;
230
231
  };
231
- profile: any;
232
232
  }, {
233
- provider: convex_values20.VString<string, "required">;
234
- account: convex_values20.VObject<{
233
+ provider: convex_values41.VString<string, "required">;
234
+ account: convex_values41.VObject<{
235
235
  secret?: string | undefined;
236
236
  id: string;
237
237
  }, {
238
- id: convex_values20.VString<string, "required">;
239
- secret: convex_values20.VString<string | undefined, "optional">;
238
+ id: convex_values41.VString<string, "required">;
239
+ secret: convex_values41.VString<string | undefined, "optional">;
240
240
  }, "required", "id" | "secret">;
241
- profile: convex_values20.VAny<any, "required", string>;
242
- shouldLinkViaEmail: convex_values20.VBoolean<boolean | undefined, "optional">;
243
- shouldLinkViaPhone: convex_values20.VBoolean<boolean | undefined, "optional">;
244
- type: convex_values20.VLiteral<"createAccountFromCredentials", "required">;
245
- }, "required", "type" | "provider" | "account" | "account.id" | "account.secret" | "profile" | `profile.${string}` | "shouldLinkViaEmail" | "shouldLinkViaPhone">, convex_values20.VObject<{
241
+ profile: convex_values41.VAny<any, "required", string>;
242
+ shouldLinkViaEmail: convex_values41.VBoolean<boolean | undefined, "optional">;
243
+ shouldLinkViaPhone: convex_values41.VBoolean<boolean | undefined, "optional">;
244
+ type: convex_values41.VLiteral<"createAccountFromCredentials", "required">;
245
+ }, "required", "profile" | "type" | "provider" | `profile.${string}` | "account" | "shouldLinkViaEmail" | "shouldLinkViaPhone" | "account.id" | "account.secret">, convex_values41.VObject<{
246
246
  type: "retrieveAccountWithCredentials";
247
247
  provider: string;
248
248
  account: {
@@ -250,16 +250,16 @@ declare const storeArgs: convex_values20.VObject<{
250
250
  id: string;
251
251
  };
252
252
  }, {
253
- provider: convex_values20.VString<string, "required">;
254
- account: convex_values20.VObject<{
253
+ provider: convex_values41.VString<string, "required">;
254
+ account: convex_values41.VObject<{
255
255
  secret?: string | undefined;
256
256
  id: string;
257
257
  }, {
258
- id: convex_values20.VString<string, "required">;
259
- secret: convex_values20.VString<string | undefined, "optional">;
258
+ id: convex_values41.VString<string, "required">;
259
+ secret: convex_values41.VString<string | undefined, "optional">;
260
260
  }, "required", "id" | "secret">;
261
- type: convex_values20.VLiteral<"retrieveAccountWithCredentials", "required">;
262
- }, "required", "type" | "provider" | "account" | "account.id" | "account.secret">, convex_values20.VObject<{
261
+ type: convex_values41.VLiteral<"retrieveAccountWithCredentials", "required">;
262
+ }, "required", "type" | "provider" | "account" | "account.id" | "account.secret">, convex_values41.VObject<{
263
263
  type: "modifyAccount";
264
264
  provider: string;
265
265
  account: {
@@ -267,31 +267,31 @@ declare const storeArgs: convex_values20.VObject<{
267
267
  secret: string;
268
268
  };
269
269
  }, {
270
- provider: convex_values20.VString<string, "required">;
271
- account: convex_values20.VObject<{
270
+ provider: convex_values41.VString<string, "required">;
271
+ account: convex_values41.VObject<{
272
272
  id: string;
273
273
  secret: string;
274
274
  }, {
275
- id: convex_values20.VString<string, "required">;
276
- secret: convex_values20.VString<string, "required">;
275
+ id: convex_values41.VString<string, "required">;
276
+ secret: convex_values41.VString<string, "required">;
277
277
  }, "required", "id" | "secret">;
278
- type: convex_values20.VLiteral<"modifyAccount", "required">;
279
- }, "required", "type" | "provider" | "account" | "account.id" | "account.secret">, convex_values20.VObject<{
278
+ type: convex_values41.VLiteral<"modifyAccount", "required">;
279
+ }, "required", "type" | "provider" | "account" | "account.id" | "account.secret">, convex_values41.VObject<{
280
280
  except?: string[] | undefined;
281
- userId: string;
282
281
  type: "invalidateSessions";
282
+ userId: string;
283
283
  }, {
284
- userId: convex_values20.VString<string, "required">;
285
- except: convex_values20.VArray<string[] | undefined, convex_values20.VString<string, "required">, "optional">;
286
- type: convex_values20.VLiteral<"invalidateSessions", "required">;
287
- }, "required", "userId" | "except" | "type">], "required", "email" | "userId" | "except" | "type" | "provider" | "account" | "account.id" | "account.secret" | "code" | "accountId" | "phone" | "expirationTime" | "allowExtraProviders" | "sessionId" | "generateTokens" | "refreshToken" | "params" | "verifier" | `params.${string}` | "signature" | "providerAccountId" | "profile" | "accountExtend" | `profile.${string}` | `accountExtend.${string}` | "shouldLinkViaEmail" | "shouldLinkViaPhone">;
288
- }, "required", "args" | "args.email" | "args.userId" | "args.except" | "args.type" | "args.provider" | "args.account" | "args.account.id" | "args.account.secret" | "args.code" | "args.accountId" | "args.phone" | "args.expirationTime" | "args.allowExtraProviders" | "args.sessionId" | "args.generateTokens" | "args.refreshToken" | "args.params" | "args.verifier" | `args.params.${string}` | "args.signature" | "args.providerAccountId" | "args.profile" | "args.accountExtend" | `args.profile.${string}` | `args.accountExtend.${string}` | "args.shouldLinkViaEmail" | "args.shouldLinkViaPhone">;
289
- declare const storeImpl: (ctx: MutationCtx, fnArgs: Infer<typeof storeArgs>, getProviderOrThrow: GetProviderOrThrowFunc, config: Config) => Promise<string | void | SessionInfo | {
290
- userId: convex_values20.GenericId<"User">;
291
- sessionId: convex_values20.GenericId<"Session">;
284
+ userId: convex_values41.VString<string, "required">;
285
+ except: convex_values41.VArray<string[] | undefined, convex_values41.VString<string, "required">, "optional">;
286
+ type: convex_values41.VLiteral<"invalidateSessions", "required">;
287
+ }, "required", "type" | "userId" | "except">], "required", "phone" | "email" | "profile" | "code" | "type" | "provider" | "params" | "verifier" | "refreshToken" | "userId" | "sessionId" | "generateTokens" | "allowExtraProviders" | `params.${string}` | "signature" | "providerAccountId" | "accountExtend" | `profile.${string}` | `accountExtend.${string}` | "accountId" | "expirationTime" | "account" | "shouldLinkViaEmail" | "shouldLinkViaPhone" | "account.id" | "account.secret" | "except">;
288
+ }, "required", "args" | "args.phone" | "args.email" | "args.profile" | "args.code" | "args.type" | "args.provider" | "args.params" | "args.verifier" | "args.refreshToken" | "args.userId" | "args.sessionId" | "args.generateTokens" | "args.allowExtraProviders" | `args.params.${string}` | "args.signature" | "args.providerAccountId" | "args.accountExtend" | `args.profile.${string}` | `args.accountExtend.${string}` | "args.accountId" | "args.expirationTime" | "args.account" | "args.shouldLinkViaEmail" | "args.shouldLinkViaPhone" | "args.account.id" | "args.account.secret" | "args.except">;
289
+ declare const storeImpl: (ctx: MutationCtx, fnArgs: Infer<typeof storeArgs>, getProviderOrThrow: GetProviderOrThrowFunc, config: Config) => Promise<string | void | {
290
+ userId: convex_values41.GenericId<"User">;
291
+ sessionId: convex_values41.GenericId<"Session">;
292
292
  } | (string & {
293
293
  __tableName: "AuthVerifier";
294
- }) | {
294
+ }) | SessionInfo | {
295
295
  token: string;
296
296
  refreshToken: string;
297
297
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","names":[],"sources":["../../../src/server/mutations/store.ts"],"mappings":";;;;;;cAyBa,SAAA,kBAAS,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAiDpB,eAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEW,SAAA,GACX,GAAA,EAAK,WAAA,EACL,MAAA,EAAQ,KAAA,QAAa,SAAA,GACrB,kBAAA,EAAoB,sBAAA,EACpB,MAAA,EAAQ,MAAA,KAAe,OAAA,iBAAA,WAAA;UAAA,eAAA,CAAA,SAAA"}
1
+ {"version":3,"file":"store.d.ts","names":[],"sources":["../../../src/server/mutations/store.ts"],"mappings":";;;;;;cAyBa,SAAA,kBAAS,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAiDpB,eAAA,CAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEW,SAAA,GACX,GAAA,EAAK,WAAA,EACL,MAAA,EAAQ,KAAA,QAAa,SAAA,GACrB,kBAAA,EAAoB,sBAAA,EACpB,MAAA,EAAQ,MAAA,KAAe,OAAA;UAAA,eAAA,CAAA,SAAA"}
@@ -1,23 +1,23 @@
1
1
  import { MutationCtx, SessionInfo } from "../types.js";
2
2
  import { Config, GetProviderOrThrowFunc } from "../crypto.js";
3
3
  import { GenericActionCtx, GenericDataModel } from "convex/server";
4
- import * as convex_values95 from "convex/values";
4
+ import * as convex_values30 from "convex/values";
5
5
  import { Infer } from "convex/values";
6
6
 
7
7
  //#region src/server/mutations/verify.d.ts
8
- declare const verifyCodeAndSignInArgs: convex_values95.VObject<{
8
+ declare const verifyCodeAndSignInArgs: convex_values30.VObject<{
9
9
  provider?: string | undefined;
10
10
  verifier?: string | undefined;
11
- allowExtraProviders: boolean;
12
- generateTokens: boolean;
13
11
  params: any;
12
+ generateTokens: boolean;
13
+ allowExtraProviders: boolean;
14
14
  }, {
15
- params: convex_values95.VAny<any, "required", string>;
16
- provider: convex_values95.VString<string | undefined, "optional">;
17
- verifier: convex_values95.VString<string | undefined, "optional">;
18
- generateTokens: convex_values95.VBoolean<boolean, "required">;
19
- allowExtraProviders: convex_values95.VBoolean<boolean, "required">;
20
- }, "required", "provider" | "allowExtraProviders" | "generateTokens" | "params" | "verifier" | `params.${string}`>;
15
+ params: convex_values30.VAny<any, "required", string>;
16
+ provider: convex_values30.VString<string | undefined, "optional">;
17
+ verifier: convex_values30.VString<string | undefined, "optional">;
18
+ generateTokens: convex_values30.VBoolean<boolean, "required">;
19
+ allowExtraProviders: convex_values30.VBoolean<boolean, "required">;
20
+ }, "required", "provider" | "params" | "verifier" | "generateTokens" | "allowExtraProviders" | `params.${string}`>;
21
21
  type ReturnType = null | SessionInfo;
22
22
  declare function verifyCodeAndSignInImpl(ctx: MutationCtx, args: Infer<typeof verifyCodeAndSignInArgs>, getProviderOrThrow: GetProviderOrThrowFunc, config: Config): Promise<ReturnType>;
23
23
  declare const callVerifyCodeAndSignIn: <DataModel extends GenericDataModel>(ctx: GenericActionCtx<DataModel>, args: Infer<typeof verifyCodeAndSignInArgs>) => Promise<ReturnType>;
@@ -1,6 +1,6 @@
1
1
  import { ConvexAuthConfig, Doc, SessionInfo } from "./types.js";
2
2
  import * as convex_server63 from "convex/server";
3
- import * as convex_values114 from "convex/values";
3
+ import * as convex_values20 from "convex/values";
4
4
 
5
5
  //#region src/server/runtime.d.ts
6
6
  /**
@@ -33,9 +33,9 @@ declare function Auth(config_: ConvexAuthConfig): {
33
33
  */
34
34
  signIn: convex_server63.RegisteredAction<"public", {
35
35
  provider?: string | undefined;
36
- refreshToken?: string | undefined;
37
36
  params?: any;
38
37
  verifier?: string | undefined;
38
+ refreshToken?: string | undefined;
39
39
  calledBy?: string | undefined;
40
40
  }, Promise<SignInActionResult>>;
41
41
  /**
@@ -49,8 +49,8 @@ declare function Auth(config_: ConvexAuthConfig): {
49
49
  store: convex_server63.RegisteredMutation<"internal", {
50
50
  args: {
51
51
  sessionId?: string | undefined;
52
- userId: string;
53
52
  type: "signIn";
53
+ userId: string;
54
54
  generateTokens: boolean;
55
55
  } | {
56
56
  type: "signOut";
@@ -61,9 +61,9 @@ declare function Auth(config_: ConvexAuthConfig): {
61
61
  provider?: string | undefined;
62
62
  verifier?: string | undefined;
63
63
  type: "verifyCodeAndSignIn";
64
- allowExtraProviders: boolean;
65
- generateTokens: boolean;
66
64
  params: any;
65
+ generateTokens: boolean;
66
+ allowExtraProviders: boolean;
67
67
  } | {
68
68
  type: "verifier";
69
69
  } | {
@@ -72,30 +72,30 @@ declare function Auth(config_: ConvexAuthConfig): {
72
72
  signature: string;
73
73
  } | {
74
74
  accountExtend?: any;
75
+ profile: any;
75
76
  type: "userOAuth";
76
77
  provider: string;
77
78
  signature: string;
78
79
  providerAccountId: string;
79
- profile: any;
80
80
  } | {
81
+ phone?: string | undefined;
81
82
  email?: string | undefined;
82
83
  accountId?: string | undefined;
83
- phone?: string | undefined;
84
+ code: string;
84
85
  type: "createVerificationCode";
85
86
  provider: string;
86
- code: string;
87
- expirationTime: number;
88
87
  allowExtraProviders: boolean;
88
+ expirationTime: number;
89
89
  } | {
90
90
  shouldLinkViaEmail?: boolean | undefined;
91
91
  shouldLinkViaPhone?: boolean | undefined;
92
+ profile: any;
92
93
  type: "createAccountFromCredentials";
93
94
  provider: string;
94
95
  account: {
95
96
  secret?: string | undefined;
96
97
  id: string;
97
98
  };
98
- profile: any;
99
99
  } | {
100
100
  type: "retrieveAccountWithCredentials";
101
101
  provider: string;
@@ -112,15 +112,15 @@ declare function Auth(config_: ConvexAuthConfig): {
112
112
  };
113
113
  } | {
114
114
  except?: string[] | undefined;
115
- userId: string;
116
115
  type: "invalidateSessions";
116
+ userId: string;
117
117
  };
118
- }, Promise<string | void | SessionInfo | {
119
- userId: convex_values114.GenericId<"User">;
120
- sessionId: convex_values114.GenericId<"Session">;
118
+ }, Promise<string | void | {
119
+ userId: convex_values20.GenericId<"User">;
120
+ sessionId: convex_values20.GenericId<"Session">;
121
121
  } | (string & {
122
122
  __tableName: "AuthVerifier";
123
- }) | {
123
+ }) | SessionInfo | {
124
124
  token: string;
125
125
  refreshToken: string;
126
126
  } | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robelest/convex-auth",
3
- "version": "0.0.4-preview.21",
3
+ "version": "0.0.4-preview.22",
4
4
  "description": "Authentication for Convex",
5
5
  "keywords": [
6
6
  "auth",
@@ -103,7 +103,7 @@
103
103
  },
104
104
  "@comment devDependencies": [
105
105
  "The CLI deps (@clack/prompts, @commander-js/extra-typings, dotenv,",
106
- "valibot) are devDependencies because they are bundled into dist/bin.cjs",
106
+ "valibot) are devDependencies because they are bundled into dist/bin.js",
107
107
  "via esbuild."
108
108
  ],
109
109
  "scripts": {
package/src/cli/index.ts CHANGED
@@ -22,7 +22,7 @@ import { generateKeys } from "./keys";
22
22
  // ---------------------------------------------------------------------------
23
23
 
24
24
  function getPackageVersion(): string {
25
- // When bundled to dist/bin.cjs the package.json is one level up
25
+ // When bundled to dist/bin.js the package.json is one level up
26
26
  for (const relative of ["..", "../.."]) {
27
27
  try {
28
28
  const pkgPath = path.resolve(__dirname, relative, "package.json");
@@ -12,6 +12,7 @@ export type {
12
12
  AuthApi,
13
13
  AuthConfig,
14
14
  AuthCtxConfig,
15
+ AuthResolvedContext,
15
16
  InferAuth,
16
17
  UserDoc,
17
18
  } from "../server/auth";