@robelest/convex-auth 0.0.4-preview.23 → 0.0.4-preview.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -11
- package/dist/bin.js +22 -3
- package/dist/component/convex.config.d.ts +2 -2
- package/dist/component/convex.config.d.ts.map +1 -1
- package/dist/component/index.js +2 -2
- package/dist/component/model.d.ts +88 -88
- package/dist/component/model.d.ts.map +1 -1
- package/dist/component/providers/passkey.d.ts +1 -1
- package/dist/component/schema.d.ts +300 -300
- package/dist/component/server/auth.d.ts +103 -103
- package/dist/component/server/auth.d.ts.map +1 -1
- package/dist/component/server/auth.js +70 -68
- package/dist/component/server/auth.js.map +1 -1
- package/dist/component/server/context.js +53 -0
- package/dist/component/server/context.js.map +1 -0
- package/dist/component/server/core.js +2 -20
- package/dist/component/server/core.js.map +1 -1
- package/dist/component/server/device.js +1 -1
- package/dist/component/server/http.d.ts +85 -0
- package/dist/component/server/http.d.ts.map +1 -0
- package/dist/component/server/http.js +59 -1
- package/dist/component/server/http.js.map +1 -1
- package/dist/component/server/passkey.js +5 -2
- package/dist/component/server/passkey.js.map +1 -1
- package/dist/component/server/runtime.d.ts +4 -4
- package/dist/component/server/runtime.d.ts.map +1 -1
- package/dist/component/server/runtime.js +110 -109
- package/dist/component/server/runtime.js.map +1 -1
- package/dist/component/server/types.d.ts +3 -2
- package/dist/component/server/types.d.ts.map +1 -1
- package/dist/component/server/types.js.map +1 -1
- package/dist/component/server/utils.js +14 -1
- package/dist/component/server/utils.js.map +1 -1
- package/dist/providers/passkey.d.ts +1 -1
- package/dist/providers/passkey.js.map +1 -1
- package/dist/server/auth.d.ts +103 -103
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +70 -68
- package/dist/server/auth.js.map +1 -1
- package/dist/server/context.d.ts +1 -0
- package/dist/server/context.js +53 -0
- package/dist/server/context.js.map +1 -0
- package/dist/server/core.d.ts +3 -36
- package/dist/server/core.d.ts.map +1 -1
- package/dist/server/core.js +2 -20
- package/dist/server/core.js.map +1 -1
- package/dist/server/device.js +1 -1
- package/dist/server/http.d.ts +81 -3
- package/dist/server/http.d.ts.map +1 -1
- package/dist/server/http.js +59 -1
- package/dist/server/http.js.map +1 -1
- package/dist/server/index.d.ts +3 -2
- package/dist/server/index.js +2 -2
- package/dist/server/mounts.d.ts +81 -81
- package/dist/server/mounts.d.ts.map +1 -1
- package/dist/server/mounts.js +1 -1
- package/dist/server/mounts.js.map +1 -1
- package/dist/server/mutations/account.d.ts +6 -6
- package/dist/server/mutations/account.d.ts.map +1 -1
- package/dist/server/mutations/code.d.ts +11 -11
- package/dist/server/mutations/code.d.ts.map +1 -1
- package/dist/server/mutations/invalidate.d.ts +4 -4
- package/dist/server/mutations/invalidate.d.ts.map +1 -1
- package/dist/server/mutations/oauth.d.ts +7 -7
- package/dist/server/mutations/oauth.d.ts.map +1 -1
- package/dist/server/mutations/refresh.d.ts +3 -3
- package/dist/server/mutations/register.d.ts +9 -9
- package/dist/server/mutations/register.d.ts.map +1 -1
- package/dist/server/mutations/retrieve.d.ts +6 -6
- package/dist/server/mutations/retrieve.d.ts.map +1 -1
- package/dist/server/mutations/signature.d.ts +4 -4
- package/dist/server/mutations/signature.d.ts.map +1 -1
- package/dist/server/mutations/signin.d.ts +5 -5
- package/dist/server/mutations/store.d.ts +76 -76
- package/dist/server/mutations/store.d.ts.map +1 -1
- package/dist/server/mutations/verify.d.ts +7 -7
- package/dist/server/mutations/verify.d.ts.map +1 -1
- package/dist/server/passkey.d.ts.map +1 -1
- package/dist/server/passkey.js +5 -2
- package/dist/server/passkey.js.map +1 -1
- package/dist/server/runtime.d.ts +10 -10
- package/dist/server/runtime.d.ts.map +1 -1
- package/dist/server/runtime.js +110 -109
- package/dist/server/runtime.js.map +1 -1
- package/dist/server/types.d.ts +3 -2
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/types.js.map +1 -1
- package/dist/server/utils.js +14 -1
- package/dist/server/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/index.ts +39 -2
- package/src/component/index.ts +8 -2
- package/src/providers/passkey.ts +1 -1
- package/src/server/auth.ts +183 -147
- package/src/server/context.ts +90 -0
- package/src/server/core.ts +5 -60
- package/src/server/http.ts +253 -0
- package/src/server/index.ts +8 -2
- package/src/server/mounts.ts +9 -6
- package/src/server/passkey.ts +6 -2
- package/src/server/runtime.ts +287 -264
- package/src/server/types.ts +3 -2
- package/src/server/utils.ts +21 -0
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ one setup API, full TypeScript support.
|
|
|
20
20
|
- **Groups, memberships, invites** — hierarchical multi-tenancy with roles.
|
|
21
21
|
- **SSR support** — framework-agnostic httpOnly cookie API (SvelteKit, TanStack
|
|
22
22
|
Start, Next.js).
|
|
23
|
-
- **Context enrichment** — zero-boilerplate `ctx.auth.userId` via `
|
|
23
|
+
- **Context enrichment** — zero-boilerplate `ctx.auth.userId` via `auth.ctx()`.
|
|
24
24
|
|
|
25
25
|
## Install
|
|
26
26
|
|
|
@@ -105,11 +105,11 @@ import { auth } from "./auth";
|
|
|
105
105
|
|
|
106
106
|
const convex = createBuilder<DataModel>();
|
|
107
107
|
|
|
108
|
+
// `auth.context(ctx)` resolves { userId, user, groupId, role, grants }
|
|
109
|
+
// and throws before the handler runs when unauthenticated.
|
|
108
110
|
const withRequiredAuth = convex.createMiddleware<any, { auth: any }>(
|
|
109
111
|
async (ctx, next) => {
|
|
110
|
-
|
|
111
|
-
const user = await auth.user.get(ctx, userId);
|
|
112
|
-
return next({ ...ctx, auth: { ...ctx.auth, userId, user } });
|
|
112
|
+
return next({ ...ctx, auth: await auth.context(ctx) });
|
|
113
113
|
},
|
|
114
114
|
);
|
|
115
115
|
|
|
@@ -117,19 +117,18 @@ export const query = convex.query().use(withRequiredAuth).extend(WithZod);
|
|
|
117
117
|
export const mutation = convex.mutation().use(withRequiredAuth).extend(WithZod);
|
|
118
118
|
```
|
|
119
119
|
|
|
120
|
-
`
|
|
121
|
-
project already uses `convex-helpers`.
|
|
120
|
+
`auth.ctx()` works with `convex-helpers` and other custom builder setups.
|
|
122
121
|
|
|
123
122
|
## Providers
|
|
124
123
|
|
|
125
124
|
| Provider | Import |
|
|
126
125
|
| ----------------- | ----------------------------------------------------------------------- |
|
|
127
126
|
| OAuth (Arctic) | `import { OAuth } from "@robelest/convex-auth/providers"` |
|
|
128
|
-
| Password | `import { Password } from "@robelest/convex-auth/providers
|
|
129
|
-
| Passkey | `import { Passkey } from "@robelest/convex-auth/providers
|
|
130
|
-
| TOTP | `import { Totp } from "@robelest/convex-auth/providers
|
|
131
|
-
| Phone/SMS | `import {
|
|
132
|
-
| Anonymous | `import { Anonymous } from "@robelest/convex-auth/providers
|
|
127
|
+
| Password | `import { Password } from "@robelest/convex-auth/providers"` |
|
|
128
|
+
| Passkey | `import { Passkey } from "@robelest/convex-auth/providers"` |
|
|
129
|
+
| TOTP | `import { Totp } from "@robelest/convex-auth/providers"` |
|
|
130
|
+
| Phone/SMS | `import { Phone } from "@robelest/convex-auth/providers"` |
|
|
131
|
+
| Anonymous | `import { Anonymous } from "@robelest/convex-auth/providers"` |
|
|
133
132
|
| Device (RFC 8628) | `import { Device } from "@robelest/convex-auth/providers"` |
|
|
134
133
|
|
|
135
134
|
## Enterprise
|
package/dist/bin.js
CHANGED
|
@@ -5682,7 +5682,7 @@ function convexCmd(...subArgs) {
|
|
|
5682
5682
|
};
|
|
5683
5683
|
}
|
|
5684
5684
|
const program = new Command().name("@robelest/convex-auth").version(version).description("Add code and set environment variables for @robelest/convex-auth.\n\nFull docs: https://deepwiki.com/robelest/convex-auth");
|
|
5685
|
-
program.option("--site-url <url>", "Your frontend app URL (e.g. 'http://localhost:5173' for dev, 'https://myapp.com' for prod)").option("--variables <json>", "Configure additional variables for interactive configuration.").option("--skip-git-check", "Don't warn when running outside a Git checkout.").option("--allow-dirty-git-state", "Don't warn when Git state is not clean.").addDeploymentSelectionOptions(actionDescription("Set environment variables on")).action(async (options) => {
|
|
5685
|
+
program.option("--site-url <url>", "Your frontend app URL (e.g. 'http://localhost:5173' for dev, 'https://myapp.com' for prod)").option("--secondary-url <urls>", "Comma-separated additional frontend URLs allowed to share the same auth instance").option("--variables <json>", "Configure additional variables for interactive configuration.").option("--skip-git-check", "Don't warn when running outside a Git checkout.").option("--allow-dirty-git-state", "Don't warn when Git state is not clean.").addDeploymentSelectionOptions(actionDescription("Set environment variables on")).action(async (options) => {
|
|
5686
5686
|
Wt("@robelest/convex-auth");
|
|
5687
5687
|
await checkSourceControl(options);
|
|
5688
5688
|
const packageJson = readPackageJson();
|
|
@@ -5700,7 +5700,7 @@ program.option("--site-url <url>", "Your frontend app URL (e.g. 'http://localhos
|
|
|
5700
5700
|
deployment,
|
|
5701
5701
|
step: 1
|
|
5702
5702
|
};
|
|
5703
|
-
await configureSiteUrl(config, options.siteUrl);
|
|
5703
|
+
await configureSiteUrl(config, options.siteUrl, options.secondaryUrl);
|
|
5704
5704
|
await configureKeys(config);
|
|
5705
5705
|
await modifyTsConfig(config);
|
|
5706
5706
|
await configureConvexConfig(config);
|
|
@@ -5710,7 +5710,7 @@ program.option("--site-url <url>", "Your frontend app URL (e.g. 'http://localhos
|
|
|
5710
5710
|
else printFinalSuccessMessage(config);
|
|
5711
5711
|
Gt("Done!");
|
|
5712
5712
|
});
|
|
5713
|
-
async function configureSiteUrl(config, forcedValue) {
|
|
5713
|
+
async function configureSiteUrl(config, forcedValue, forcedSecondaryValue) {
|
|
5714
5714
|
logStep(config, "Configure SITE_URL");
|
|
5715
5715
|
if (config.isExpo) {
|
|
5716
5716
|
R.info("React Native projects don't require a SITE_URL.");
|
|
@@ -5730,9 +5730,27 @@ async function configureSiteUrl(config, forcedValue) {
|
|
|
5730
5730
|
},
|
|
5731
5731
|
forcedValue
|
|
5732
5732
|
});
|
|
5733
|
+
await configureEnvVar(config, {
|
|
5734
|
+
name: "SECONDARY_URL",
|
|
5735
|
+
description: "additional frontend URLs as a comma-separated list (optional)",
|
|
5736
|
+
validate: (input) => {
|
|
5737
|
+
if (input.trim() === "") return true;
|
|
5738
|
+
for (const candidate of input.split(",").map((url) => url.trim())) {
|
|
5739
|
+
if (candidate === "") continue;
|
|
5740
|
+
try {
|
|
5741
|
+
new URL(candidate);
|
|
5742
|
+
} catch {
|
|
5743
|
+
return "Each URL must start with http:// or https://";
|
|
5744
|
+
}
|
|
5745
|
+
}
|
|
5746
|
+
return true;
|
|
5747
|
+
},
|
|
5748
|
+
forcedValue: forcedSecondaryValue
|
|
5749
|
+
});
|
|
5733
5750
|
}
|
|
5734
5751
|
async function configureEnvVar(config, variable) {
|
|
5735
5752
|
if (variable.forcedValue && (variable.validate ? variable.validate(variable.forcedValue) : true)) {
|
|
5753
|
+
if (variable.forcedValue.trim() === "") return;
|
|
5736
5754
|
await setEnvVar(config, variable.name, variable.forcedValue);
|
|
5737
5755
|
return;
|
|
5738
5756
|
}
|
|
@@ -5744,6 +5762,7 @@ async function configureEnvVar(config, variable) {
|
|
|
5744
5762
|
default: variable.default,
|
|
5745
5763
|
validate: variable.validate
|
|
5746
5764
|
});
|
|
5765
|
+
if (chosenValue.trim() === "") return;
|
|
5747
5766
|
await setEnvVar(config, variable.name, chosenValue);
|
|
5748
5767
|
}
|
|
5749
5768
|
async function configureKeys(config) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as convex_server24 from "convex/server";
|
|
2
2
|
|
|
3
3
|
//#region src/component/convex.config.d.ts
|
|
4
|
-
declare const component:
|
|
4
|
+
declare const component: convex_server24.ComponentDefinition<any>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { component as default };
|
|
7
7
|
//# sourceMappingURL=convex.config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convex.config.d.ts","names":[],"sources":["../../src/component/convex.config.ts"],"mappings":";;;cAEM,SAAA,EAAmC,
|
|
1
|
+
{"version":3,"file":"convex.config.d.ts","names":[],"sources":["../../src/component/convex.config.ts"],"mappings":";;;cAEM,SAAA,EAAmC,eAAA,CAA1B,mBAAA"}
|
package/dist/component/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAuth } from "./server/auth.js";
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { createAuth };
|
|
@@ -1,73 +1,72 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as convex_values121 from "convex/values";
|
|
2
2
|
|
|
3
3
|
//#region src/component/model.d.ts
|
|
4
|
-
declare const vAuthVerifierDoc:
|
|
5
|
-
sessionId?:
|
|
4
|
+
declare const vAuthVerifierDoc: convex_values121.VObject<{
|
|
5
|
+
sessionId?: convex_values121.GenericId<"Session"> | undefined;
|
|
6
6
|
signature?: string | undefined;
|
|
7
7
|
_creationTime: number;
|
|
8
|
-
_id:
|
|
8
|
+
_id: convex_values121.GenericId<"AuthVerifier">;
|
|
9
9
|
}, {
|
|
10
|
-
sessionId:
|
|
11
|
-
signature:
|
|
12
|
-
_id:
|
|
13
|
-
_creationTime:
|
|
14
|
-
}, "required", "
|
|
15
|
-
declare const vPasskeyDoc:
|
|
10
|
+
sessionId: convex_values121.VId<convex_values121.GenericId<"Session"> | undefined, "optional">;
|
|
11
|
+
signature: convex_values121.VString<string | undefined, "optional">;
|
|
12
|
+
_id: convex_values121.VId<convex_values121.GenericId<"AuthVerifier">, "required">;
|
|
13
|
+
_creationTime: convex_values121.VFloat64<number, "required">;
|
|
14
|
+
}, "required", "_creationTime" | "_id" | "sessionId" | "signature">;
|
|
15
|
+
declare const vPasskeyDoc: convex_values121.VObject<{
|
|
16
16
|
name?: string | undefined;
|
|
17
|
-
transports?: string[] | undefined;
|
|
18
17
|
lastUsedAt?: number | undefined;
|
|
19
|
-
|
|
18
|
+
transports?: string[] | undefined;
|
|
20
19
|
_creationTime: number;
|
|
20
|
+
userId: convex_values121.GenericId<"User">;
|
|
21
|
+
createdAt: number;
|
|
22
|
+
_id: convex_values121.GenericId<"Passkey">;
|
|
21
23
|
credentialId: string;
|
|
22
24
|
publicKey: ArrayBuffer;
|
|
23
25
|
algorithm: number;
|
|
24
26
|
counter: number;
|
|
25
27
|
deviceType: string;
|
|
26
28
|
backedUp: boolean;
|
|
27
|
-
createdAt: number;
|
|
28
|
-
_id: convex_values474.GenericId<"Passkey">;
|
|
29
29
|
}, {
|
|
30
|
-
userId:
|
|
31
|
-
credentialId:
|
|
32
|
-
publicKey:
|
|
33
|
-
algorithm:
|
|
34
|
-
counter:
|
|
35
|
-
transports:
|
|
36
|
-
deviceType:
|
|
37
|
-
backedUp:
|
|
38
|
-
name:
|
|
39
|
-
createdAt:
|
|
40
|
-
lastUsedAt:
|
|
41
|
-
_id:
|
|
42
|
-
_creationTime:
|
|
43
|
-
}, "required", "
|
|
44
|
-
declare const vTotpFactorDoc:
|
|
30
|
+
userId: convex_values121.VId<convex_values121.GenericId<"User">, "required">;
|
|
31
|
+
credentialId: convex_values121.VString<string, "required">;
|
|
32
|
+
publicKey: convex_values121.VBytes<ArrayBuffer, "required">;
|
|
33
|
+
algorithm: convex_values121.VFloat64<number, "required">;
|
|
34
|
+
counter: convex_values121.VFloat64<number, "required">;
|
|
35
|
+
transports: convex_values121.VArray<string[] | undefined, convex_values121.VString<string, "required">, "optional">;
|
|
36
|
+
deviceType: convex_values121.VString<string, "required">;
|
|
37
|
+
backedUp: convex_values121.VBoolean<boolean, "required">;
|
|
38
|
+
name: convex_values121.VString<string | undefined, "optional">;
|
|
39
|
+
createdAt: convex_values121.VFloat64<number, "required">;
|
|
40
|
+
lastUsedAt: convex_values121.VFloat64<number | undefined, "optional">;
|
|
41
|
+
_id: convex_values121.VId<convex_values121.GenericId<"Passkey">, "required">;
|
|
42
|
+
_creationTime: convex_values121.VFloat64<number, "required">;
|
|
43
|
+
}, "required", "_creationTime" | "name" | "lastUsedAt" | "userId" | "createdAt" | "_id" | "credentialId" | "publicKey" | "algorithm" | "counter" | "transports" | "deviceType" | "backedUp">;
|
|
44
|
+
declare const vTotpFactorDoc: convex_values121.VObject<{
|
|
45
45
|
name?: string | undefined;
|
|
46
46
|
lastUsedAt?: number | undefined;
|
|
47
|
-
userId: convex_values474.GenericId<"User">;
|
|
48
|
-
secret: ArrayBuffer;
|
|
49
47
|
_creationTime: number;
|
|
48
|
+
userId: convex_values121.GenericId<"User">;
|
|
50
49
|
createdAt: number;
|
|
50
|
+
_id: convex_values121.GenericId<"TotpFactor">;
|
|
51
|
+
secret: ArrayBuffer;
|
|
51
52
|
digits: number;
|
|
52
53
|
period: number;
|
|
53
54
|
verified: boolean;
|
|
54
|
-
_id: convex_values474.GenericId<"TotpFactor">;
|
|
55
55
|
}, {
|
|
56
|
-
userId:
|
|
57
|
-
secret:
|
|
58
|
-
digits:
|
|
59
|
-
period:
|
|
60
|
-
verified:
|
|
61
|
-
name:
|
|
62
|
-
createdAt:
|
|
63
|
-
lastUsedAt:
|
|
64
|
-
_id:
|
|
65
|
-
_creationTime:
|
|
66
|
-
}, "required", "
|
|
67
|
-
declare const vApiKeyDoc:
|
|
56
|
+
userId: convex_values121.VId<convex_values121.GenericId<"User">, "required">;
|
|
57
|
+
secret: convex_values121.VBytes<ArrayBuffer, "required">;
|
|
58
|
+
digits: convex_values121.VFloat64<number, "required">;
|
|
59
|
+
period: convex_values121.VFloat64<number, "required">;
|
|
60
|
+
verified: convex_values121.VBoolean<boolean, "required">;
|
|
61
|
+
name: convex_values121.VString<string | undefined, "optional">;
|
|
62
|
+
createdAt: convex_values121.VFloat64<number, "required">;
|
|
63
|
+
lastUsedAt: convex_values121.VFloat64<number | undefined, "optional">;
|
|
64
|
+
_id: convex_values121.VId<convex_values121.GenericId<"TotpFactor">, "required">;
|
|
65
|
+
_creationTime: convex_values121.VFloat64<number, "required">;
|
|
66
|
+
}, "required", "_creationTime" | "name" | "lastUsedAt" | "userId" | "createdAt" | "_id" | "secret" | "digits" | "period" | "verified">;
|
|
67
|
+
declare const vApiKeyDoc: convex_values121.VObject<{
|
|
68
68
|
lastUsedAt?: number | undefined;
|
|
69
69
|
expiresAt?: number | undefined;
|
|
70
|
-
metadata?: any;
|
|
71
70
|
rateLimit?: {
|
|
72
71
|
maxRequests: number;
|
|
73
72
|
windowMs: number;
|
|
@@ -76,78 +75,79 @@ declare const vApiKeyDoc: convex_values474.VObject<{
|
|
|
76
75
|
attemptsLeft: number;
|
|
77
76
|
lastAttemptTime: number;
|
|
78
77
|
} | undefined;
|
|
79
|
-
|
|
80
|
-
userId: convex_values474.GenericId<"User">;
|
|
78
|
+
metadata?: any;
|
|
81
79
|
_creationTime: number;
|
|
82
|
-
|
|
80
|
+
name: string;
|
|
83
81
|
revoked: boolean;
|
|
82
|
+
userId: convex_values121.GenericId<"User">;
|
|
84
83
|
prefix: string;
|
|
85
84
|
hashedKey: string;
|
|
86
85
|
scopes: {
|
|
87
86
|
resource: string;
|
|
88
87
|
actions: string[];
|
|
89
88
|
}[];
|
|
90
|
-
|
|
89
|
+
createdAt: number;
|
|
90
|
+
_id: convex_values121.GenericId<"ApiKey">;
|
|
91
91
|
}, {
|
|
92
|
-
userId:
|
|
93
|
-
prefix:
|
|
94
|
-
hashedKey:
|
|
95
|
-
name:
|
|
96
|
-
scopes:
|
|
92
|
+
userId: convex_values121.VId<convex_values121.GenericId<"User">, "required">;
|
|
93
|
+
prefix: convex_values121.VString<string, "required">;
|
|
94
|
+
hashedKey: convex_values121.VString<string, "required">;
|
|
95
|
+
name: convex_values121.VString<string, "required">;
|
|
96
|
+
scopes: convex_values121.VArray<{
|
|
97
97
|
resource: string;
|
|
98
98
|
actions: string[];
|
|
99
|
-
}[],
|
|
99
|
+
}[], convex_values121.VObject<{
|
|
100
100
|
resource: string;
|
|
101
101
|
actions: string[];
|
|
102
102
|
}, {
|
|
103
|
-
resource:
|
|
104
|
-
actions:
|
|
103
|
+
resource: convex_values121.VString<string, "required">;
|
|
104
|
+
actions: convex_values121.VArray<string[], convex_values121.VString<string, "required">, "required">;
|
|
105
105
|
}, "required", "resource" | "actions">, "required">;
|
|
106
|
-
rateLimit:
|
|
106
|
+
rateLimit: convex_values121.VObject<{
|
|
107
107
|
maxRequests: number;
|
|
108
108
|
windowMs: number;
|
|
109
109
|
} | undefined, {
|
|
110
|
-
maxRequests:
|
|
111
|
-
windowMs:
|
|
110
|
+
maxRequests: convex_values121.VFloat64<number, "required">;
|
|
111
|
+
windowMs: convex_values121.VFloat64<number, "required">;
|
|
112
112
|
}, "optional", "maxRequests" | "windowMs">;
|
|
113
|
-
rateLimitState:
|
|
113
|
+
rateLimitState: convex_values121.VObject<{
|
|
114
114
|
attemptsLeft: number;
|
|
115
115
|
lastAttemptTime: number;
|
|
116
116
|
} | undefined, {
|
|
117
|
-
attemptsLeft:
|
|
118
|
-
lastAttemptTime:
|
|
117
|
+
attemptsLeft: convex_values121.VFloat64<number, "required">;
|
|
118
|
+
lastAttemptTime: convex_values121.VFloat64<number, "required">;
|
|
119
119
|
}, "optional", "attemptsLeft" | "lastAttemptTime">;
|
|
120
|
-
expiresAt:
|
|
121
|
-
lastUsedAt:
|
|
122
|
-
createdAt:
|
|
123
|
-
revoked:
|
|
124
|
-
metadata:
|
|
125
|
-
_id:
|
|
126
|
-
_creationTime:
|
|
127
|
-
}, "required", "
|
|
128
|
-
declare const vDeviceCodeDoc:
|
|
129
|
-
userId?:
|
|
130
|
-
sessionId?:
|
|
120
|
+
expiresAt: convex_values121.VFloat64<number | undefined, "optional">;
|
|
121
|
+
lastUsedAt: convex_values121.VFloat64<number | undefined, "optional">;
|
|
122
|
+
createdAt: convex_values121.VFloat64<number, "required">;
|
|
123
|
+
revoked: convex_values121.VBoolean<boolean, "required">;
|
|
124
|
+
metadata: convex_values121.VAny<any, "optional", string>;
|
|
125
|
+
_id: convex_values121.VId<convex_values121.GenericId<"ApiKey">, "required">;
|
|
126
|
+
_creationTime: convex_values121.VFloat64<number, "required">;
|
|
127
|
+
}, "required", "_creationTime" | "name" | "revoked" | "lastUsedAt" | "expiresAt" | "userId" | "prefix" | "hashedKey" | "scopes" | "rateLimit" | "rateLimitState" | "createdAt" | "metadata" | "_id" | "rateLimit.maxRequests" | "rateLimit.windowMs" | "rateLimitState.attemptsLeft" | "rateLimitState.lastAttemptTime" | `metadata.${string}`>;
|
|
128
|
+
declare const vDeviceCodeDoc: convex_values121.VObject<{
|
|
129
|
+
userId?: convex_values121.GenericId<"User"> | undefined;
|
|
130
|
+
sessionId?: convex_values121.GenericId<"Session"> | undefined;
|
|
131
131
|
lastPolledAt?: number | undefined;
|
|
132
|
-
status: "pending" | "authorized" | "denied";
|
|
133
132
|
_creationTime: number;
|
|
133
|
+
status: "pending" | "authorized" | "denied";
|
|
134
|
+
expiresAt: number;
|
|
135
|
+
_id: convex_values121.GenericId<"DeviceCode">;
|
|
134
136
|
deviceCodeHash: string;
|
|
135
137
|
userCode: string;
|
|
136
|
-
expiresAt: number;
|
|
137
138
|
interval: number;
|
|
138
|
-
_id: convex_values474.GenericId<"DeviceCode">;
|
|
139
139
|
}, {
|
|
140
|
-
deviceCodeHash:
|
|
141
|
-
userCode:
|
|
142
|
-
expiresAt:
|
|
143
|
-
interval:
|
|
144
|
-
status:
|
|
145
|
-
userId:
|
|
146
|
-
sessionId:
|
|
147
|
-
lastPolledAt:
|
|
148
|
-
_id:
|
|
149
|
-
_creationTime:
|
|
150
|
-
}, "required", "
|
|
140
|
+
deviceCodeHash: convex_values121.VString<string, "required">;
|
|
141
|
+
userCode: convex_values121.VString<string, "required">;
|
|
142
|
+
expiresAt: convex_values121.VFloat64<number, "required">;
|
|
143
|
+
interval: convex_values121.VFloat64<number, "required">;
|
|
144
|
+
status: convex_values121.VUnion<"pending" | "authorized" | "denied", [convex_values121.VLiteral<"pending", "required">, convex_values121.VLiteral<"authorized", "required">, convex_values121.VLiteral<"denied", "required">], "required", never>;
|
|
145
|
+
userId: convex_values121.VId<convex_values121.GenericId<"User"> | undefined, "optional">;
|
|
146
|
+
sessionId: convex_values121.VId<convex_values121.GenericId<"Session"> | undefined, "optional">;
|
|
147
|
+
lastPolledAt: convex_values121.VFloat64<number | undefined, "optional">;
|
|
148
|
+
_id: convex_values121.VId<convex_values121.GenericId<"DeviceCode">, "required">;
|
|
149
|
+
_creationTime: convex_values121.VFloat64<number, "required">;
|
|
150
|
+
}, "required", "_creationTime" | "status" | "expiresAt" | "userId" | "_id" | "sessionId" | "deviceCodeHash" | "userCode" | "interval" | "lastPolledAt">;
|
|
151
151
|
//#endregion
|
|
152
152
|
export { vApiKeyDoc, vAuthVerifierDoc, vDeviceCodeDoc, vPasskeyDoc, vTotpFactorDoc };
|
|
153
153
|
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","names":[],"sources":["../../src/component/model.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"model.d.ts","names":[],"sources":["../../src/component/model.ts"],"mappings":";;;;;;cAEa,MAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;cA2BA,IAAA,iBAAI,OAAA;;;;OAAmD,cAAA,CAAA,OAAA;;;cAEvD,UAAA,GAAc,IAAA,yBAAS,OAAA;;;;SAIhC,cAAA,CAAA,MAAA;;;cAES,aAAA,EAAa,cAAA,CAAA,MAAA,kDAKzB,cAAA,CALyB,QAAA,yBAAA,cAAA,CAAA,QAAA,0BAAA,cAAA,CAAA,QAAA,yBAAA,cAAA,CAAA,QAAA;AAAA,cAOb,aAAA,EAAa,cAAA,CAAA,MAAA,uCAIzB,cAAA,CAJyB,QAAA,yBAAA,cAAA,CAAA,QAAA,4BAAA,cAAA,CAAA,QAAA;AAAA,cAMb,+BAAA,EAA+B,cAAA,CAAA,MAAA,4BAG3C,cAAA,CAH2C,QAAA,+BAAA,cAAA,CAAA,QAAA;AAAA,cAK/B,8BAAA,EAA8B,cAAA,CAAA,MAAA,yBAG1C,cAAA,CAH0C,QAAA,4BAAA,cAAA,CAAA,QAAA;AAAA,cAK9B,8BAAA,EAA8B,cAAA,CAAA,MAAA,oDAI1C,cAAA,CAJ0C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asskeyConfig {
|
|
|
18
18
|
rpName?: string;
|
|
19
19
|
/** Relying Party ID (hostname). Defaults to SITE_URL hostname. */
|
|
20
20
|
rpId?: string;
|
|
21
|
-
/** Allowed origins for credential verification. Defaults to SITE_URL. */
|
|
21
|
+
/** Allowed origins for credential verification. Defaults to SITE_URL plus SECONDARY_URL. */
|
|
22
22
|
origin?: string | string[];
|
|
23
23
|
/** Attestation conveyance preference. Defaults to "none". */
|
|
24
24
|
attestation?: "none" | "direct";
|