@vllnt/convex-api-keys 0.1.0-canary.f67cc26 → 0.1.0
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/package.json +18 -20
- package/src/shared.ts +0 -1
- package/dist/client/_generated/_ignore.d.ts +0 -1
- package/dist/client/_generated/_ignore.d.ts.map +0 -1
- package/dist/client/_generated/_ignore.js +0 -3
- package/dist/client/_generated/_ignore.js.map +0 -1
- package/dist/client/index.d.ts +0 -67
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js +0 -93
- package/dist/client/index.js.map +0 -1
- package/dist/client/types.d.ts +0 -68
- package/dist/client/types.d.ts.map +0 -1
- package/dist/client/types.js +0 -2
- package/dist/client/types.js.map +0 -1
- package/dist/component/_generated/api.d.ts +0 -41
- package/dist/component/_generated/api.d.ts.map +0 -1
- package/dist/component/_generated/api.js +0 -31
- package/dist/component/_generated/api.js.map +0 -1
- package/dist/component/_generated/component.d.ts +0 -146
- package/dist/component/_generated/component.d.ts.map +0 -1
- package/dist/component/_generated/component.js +0 -11
- package/dist/component/_generated/component.js.map +0 -1
- package/dist/component/_generated/dataModel.d.ts +0 -46
- package/dist/component/_generated/dataModel.d.ts.map +0 -1
- package/dist/component/_generated/dataModel.js +0 -11
- package/dist/component/_generated/dataModel.js.map +0 -1
- package/dist/component/_generated/server.d.ts +0 -121
- package/dist/component/_generated/server.d.ts.map +0 -1
- package/dist/component/_generated/server.js +0 -78
- package/dist/component/_generated/server.js.map +0 -1
- package/dist/component/convex.config.d.ts +0 -3
- package/dist/component/convex.config.d.ts.map +0 -1
- package/dist/component/convex.config.js +0 -12
- package/dist/component/convex.config.js.map +0 -1
- package/dist/component/mutations.d.ts +0 -94
- package/dist/component/mutations.d.ts.map +0 -1
- package/dist/component/mutations.js +0 -456
- package/dist/component/mutations.js.map +0 -1
- package/dist/component/queries.d.ts +0 -49
- package/dist/component/queries.d.ts.map +0 -1
- package/dist/component/queries.js +0 -147
- package/dist/component/queries.js.map +0 -1
- package/dist/component/schema.d.ts +0 -70
- package/dist/component/schema.d.ts.map +0 -1
- package/dist/component/schema.js +0 -43
- package/dist/component/schema.js.map +0 -1
- package/dist/component/validators.d.ts +0 -3
- package/dist/component/validators.d.ts.map +0 -1
- package/dist/component/validators.js +0 -4
- package/dist/component/validators.js.map +0 -1
- package/dist/log.d.ts +0 -11
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js +0 -15
- package/dist/log.js.map +0 -1
- package/dist/shared.d.ts +0 -26
- package/dist/shared.d.ts.map +0 -1
- package/dist/shared.js +0 -60
- package/dist/shared.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vllnt/convex-api-keys",
|
|
3
|
-
"version": "0.1.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Convex component for secure API key management — create, validate, revoke, rotate, rate-limit, track usage",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"packageManager": "pnpm@9.15.4",
|
|
8
7
|
"files": [
|
|
9
8
|
"dist",
|
|
10
9
|
"src"
|
|
@@ -33,22 +32,6 @@
|
|
|
33
32
|
},
|
|
34
33
|
"types": "./dist/client/index.d.ts",
|
|
35
34
|
"module": "./dist/client/index.js",
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "tsc --project ./tsconfig.build.json",
|
|
38
|
-
"build:codegen": "pnpm convex codegen --component-dir ./src/component && pnpm build",
|
|
39
|
-
"build:clean": "rm -rf dist *.tsbuildinfo && pnpm build:codegen",
|
|
40
|
-
"typecheck": "tsc --noEmit",
|
|
41
|
-
"typecheck:ci": "tsc --noEmit --project tsconfig.ci.json",
|
|
42
|
-
"lint": "eslint .",
|
|
43
|
-
"test": "vitest run --passWithNoTests",
|
|
44
|
-
"test:watch": "vitest --typecheck --clearScreen false",
|
|
45
|
-
"test:coverage": "vitest run --coverage --coverage.reporter=text",
|
|
46
|
-
"generate:llms": "node -e \"const{execSync:e}=require('child_process');const fs=require('fs');const files=['README.md','src/shared.ts','src/client/types.ts','src/client/index.ts','src/component/schema.ts','src/component/validators.ts','src/component/mutations.ts','src/component/queries.ts','src/test.ts'];let out='# @vllnt/convex-api-keys — Full Source\\n\\nAuto-generated. Do not edit manually.\\n';for(const f of files){out+='\\n---\\n\\n## '+f+'\\n\\n';if(f.endsWith('.md')){out+=fs.readFileSync(f,'utf8')}else{out+='\\`\\`\\`ts\\n'+fs.readFileSync(f,'utf8')+'\\`\\`\\`'}out+='\\n'}fs.writeFileSync('llms-full.txt',out)\"",
|
|
47
|
-
"preversion": "pnpm install --frozen-lockfile && pnpm build:clean && pnpm test && pnpm typecheck && pnpm generate:llms",
|
|
48
|
-
"prepublishOnly": "npm whoami || npm login",
|
|
49
|
-
"alpha": "npm version prerelease --preid alpha && npm publish --tag alpha && git push --follow-tags",
|
|
50
|
-
"release": "npm version patch && npm publish && git push --follow-tags"
|
|
51
|
-
},
|
|
52
35
|
"dependencies": {
|
|
53
36
|
"@convex-dev/rate-limiter": "^0.3.0",
|
|
54
37
|
"@convex-dev/sharded-counter": "^0.2.0",
|
|
@@ -92,5 +75,20 @@
|
|
|
92
75
|
"rate-limiting",
|
|
93
76
|
"multi-tenant",
|
|
94
77
|
"convex-component"
|
|
95
|
-
]
|
|
96
|
-
|
|
78
|
+
],
|
|
79
|
+
"scripts": {
|
|
80
|
+
"build": "tsc --project ./tsconfig.build.json",
|
|
81
|
+
"build:codegen": "pnpm convex codegen --component-dir ./src/component && pnpm build",
|
|
82
|
+
"build:clean": "rm -rf dist *.tsbuildinfo && pnpm build:codegen",
|
|
83
|
+
"typecheck": "tsc --noEmit",
|
|
84
|
+
"typecheck:ci": "tsc --noEmit --project tsconfig.ci.json",
|
|
85
|
+
"lint": "eslint .",
|
|
86
|
+
"test": "vitest run --passWithNoTests",
|
|
87
|
+
"test:watch": "vitest --typecheck --clearScreen false",
|
|
88
|
+
"test:coverage": "vitest run --coverage --coverage.reporter=text",
|
|
89
|
+
"generate:llms": "node -e \"const{execSync:e}=require('child_process');const fs=require('fs');const files=['README.md','src/shared.ts','src/client/types.ts','src/client/index.ts','src/component/schema.ts','src/component/validators.ts','src/component/mutations.ts','src/component/queries.ts','src/test.ts'];let out='# @vllnt/convex-api-keys — Full Source\\n\\nAuto-generated. Do not edit manually.\\n';for(const f of files){out+='\\n---\\n\\n## '+f+'\\n\\n';if(f.endsWith('.md')){out+=fs.readFileSync(f,'utf8')}else{out+='\\`\\`\\`ts\\n'+fs.readFileSync(f,'utf8')+'\\`\\`\\`'}out+='\\n'}fs.writeFileSync('llms-full.txt',out)\"",
|
|
90
|
+
"preversion": "pnpm install --frozen-lockfile && pnpm build:clean && pnpm test && pnpm typecheck && pnpm generate:llms",
|
|
91
|
+
"alpha": "npm version prerelease --preid alpha && npm publish --tag alpha && git push --follow-tags",
|
|
92
|
+
"release": "npm version patch && npm publish && git push --follow-tags"
|
|
93
|
+
}
|
|
94
|
+
}
|
package/src/shared.ts
CHANGED
|
@@ -111,7 +111,6 @@ export function timingSafeEqual(a: string, b: string): boolean {
|
|
|
111
111
|
return result === 0;
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
/** Compute SHA-256 hash of input, returned as lowercase hex string. */
|
|
115
114
|
export async function sha256Hex(input: string): Promise<string> {
|
|
116
115
|
const encoder = new TextEncoder();
|
|
117
116
|
const data = encoder.encode(input);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=_ignore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_ignore.d.ts","sourceRoot":"","sources":["../../../src/client/_generated/_ignore.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_ignore.js","sourceRoot":"","sources":["../../../src/client/_generated/_ignore.ts"],"names":[],"mappings":";AAAA,kEAAkE"}
|
package/dist/client/index.d.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { GenericMutationCtx, GenericQueryCtx, GenericDataModel } from "convex/server";
|
|
2
|
-
import type { ComponentApi } from "../component/_generated/component.js";
|
|
3
|
-
import type { CreateKeyOptions, CreateKeyResult, ValidationResult, KeyMetadata, UsageStats, RotateResult, KeyType, KeyStatus } from "./types.js";
|
|
4
|
-
export type { CreateKeyOptions, CreateKeyResult, ValidationResult, KeyMetadata, UsageStats, RotateResult, KeyType, KeyStatus, };
|
|
5
|
-
export type RunMutationCtx = Pick<GenericMutationCtx<GenericDataModel>, "runMutation">;
|
|
6
|
-
export type RunQueryCtx = Pick<GenericQueryCtx<GenericDataModel>, "runQuery">;
|
|
7
|
-
export interface ApiKeysConfig {
|
|
8
|
-
prefix?: string;
|
|
9
|
-
defaultType?: KeyType;
|
|
10
|
-
}
|
|
11
|
-
export declare class ApiKeys {
|
|
12
|
-
component: ComponentApi;
|
|
13
|
-
private prefix;
|
|
14
|
-
private defaultType;
|
|
15
|
-
constructor(component: ComponentApi, config?: ApiKeysConfig);
|
|
16
|
-
create(ctx: RunMutationCtx, options: CreateKeyOptions): Promise<CreateKeyResult>;
|
|
17
|
-
validate(ctx: RunMutationCtx, args: {
|
|
18
|
-
key: string;
|
|
19
|
-
}): Promise<ValidationResult>;
|
|
20
|
-
revoke(ctx: RunMutationCtx, args: {
|
|
21
|
-
keyId: string;
|
|
22
|
-
}): Promise<void>;
|
|
23
|
-
revokeByTag(ctx: RunMutationCtx, args: {
|
|
24
|
-
ownerId: string;
|
|
25
|
-
tag: string;
|
|
26
|
-
}): Promise<{
|
|
27
|
-
revokedCount: number;
|
|
28
|
-
}>;
|
|
29
|
-
rotate(ctx: RunMutationCtx, args: {
|
|
30
|
-
keyId: string;
|
|
31
|
-
gracePeriodMs?: number;
|
|
32
|
-
}): Promise<RotateResult>;
|
|
33
|
-
list(ctx: RunQueryCtx, args: {
|
|
34
|
-
ownerId: string;
|
|
35
|
-
env?: string;
|
|
36
|
-
status?: KeyStatus;
|
|
37
|
-
}): Promise<KeyMetadata[]>;
|
|
38
|
-
listByTag(ctx: RunQueryCtx, args: {
|
|
39
|
-
ownerId: string;
|
|
40
|
-
tag: string;
|
|
41
|
-
}): Promise<KeyMetadata[]>;
|
|
42
|
-
update(ctx: RunMutationCtx, args: {
|
|
43
|
-
keyId: string;
|
|
44
|
-
name?: string;
|
|
45
|
-
scopes?: string[];
|
|
46
|
-
tags?: string[];
|
|
47
|
-
metadata?: Record<string, unknown>;
|
|
48
|
-
}): Promise<void>;
|
|
49
|
-
disable(ctx: RunMutationCtx, args: {
|
|
50
|
-
keyId: string;
|
|
51
|
-
}): Promise<void>;
|
|
52
|
-
enable(ctx: RunMutationCtx, args: {
|
|
53
|
-
keyId: string;
|
|
54
|
-
}): Promise<void>;
|
|
55
|
-
getUsage(ctx: RunQueryCtx, args: {
|
|
56
|
-
keyId: string;
|
|
57
|
-
period?: {
|
|
58
|
-
start: number;
|
|
59
|
-
end: number;
|
|
60
|
-
};
|
|
61
|
-
}): Promise<UsageStats>;
|
|
62
|
-
configure(ctx: RunMutationCtx, args: {
|
|
63
|
-
cleanupIntervalMs?: number;
|
|
64
|
-
defaultExpiryMs?: number;
|
|
65
|
-
}): Promise<void>;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,OAAO,EACP,SAAS,EACV,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,gB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,GAC7D,OAAO,CAAC,IAAI,CAAC;CAGjB"}
|
package/dist/client/index.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { sha256Hex } from "../shared.js";
|
|
2
|
-
function generateRandomHex(length) {
|
|
3
|
-
const bytes = new Uint8Array(length / 2);
|
|
4
|
-
crypto.getRandomValues(bytes);
|
|
5
|
-
return Array.from(bytes)
|
|
6
|
-
.map((b) => b.toString(16).padStart(2, "0"))
|
|
7
|
-
.join("");
|
|
8
|
-
}
|
|
9
|
-
export class ApiKeys {
|
|
10
|
-
component;
|
|
11
|
-
prefix;
|
|
12
|
-
defaultType;
|
|
13
|
-
constructor(component, config) {
|
|
14
|
-
this.component = component;
|
|
15
|
-
this.prefix = config?.prefix ?? "vk";
|
|
16
|
-
this.defaultType = config?.defaultType ?? "secret";
|
|
17
|
-
}
|
|
18
|
-
async create(ctx, options) {
|
|
19
|
-
const type = options.type ?? this.defaultType;
|
|
20
|
-
const typeShort = type === "publishable" ? "pub" : "secret";
|
|
21
|
-
const env = options.env ?? "live";
|
|
22
|
-
const lookupPrefix = generateRandomHex(8);
|
|
23
|
-
const secretHex = generateRandomHex(64);
|
|
24
|
-
const rawKey = [this.prefix, typeShort, env, lookupPrefix, secretHex].join("_");
|
|
25
|
-
const hash = await sha256Hex(rawKey);
|
|
26
|
-
const result = await ctx.runMutation(this.component.mutations.create, {
|
|
27
|
-
name: options.name,
|
|
28
|
-
ownerId: options.ownerId,
|
|
29
|
-
type,
|
|
30
|
-
scopes: options.scopes,
|
|
31
|
-
tags: options.tags,
|
|
32
|
-
env,
|
|
33
|
-
metadata: options.metadata,
|
|
34
|
-
remaining: options.remaining,
|
|
35
|
-
expiresAt: options.expiresAt,
|
|
36
|
-
keyPrefix: this.prefix,
|
|
37
|
-
lookupPrefix,
|
|
38
|
-
secretHex,
|
|
39
|
-
hash,
|
|
40
|
-
});
|
|
41
|
-
return { keyId: result.keyId, key: result.key };
|
|
42
|
-
}
|
|
43
|
-
async validate(ctx, args) {
|
|
44
|
-
return await ctx.runMutation(this.component.mutations.validate, { key: args.key });
|
|
45
|
-
}
|
|
46
|
-
async revoke(ctx, args) {
|
|
47
|
-
await ctx.runMutation(this.component.mutations.revoke, { keyId: args.keyId });
|
|
48
|
-
}
|
|
49
|
-
async revokeByTag(ctx, args) {
|
|
50
|
-
return await ctx.runMutation(this.component.mutations.revokeByTag, args);
|
|
51
|
-
}
|
|
52
|
-
async rotate(ctx, args) {
|
|
53
|
-
const lookupPrefix = generateRandomHex(8);
|
|
54
|
-
const secretHex = generateRandomHex(64);
|
|
55
|
-
return await ctx.runMutation(this.component.mutations.rotate, {
|
|
56
|
-
keyId: args.keyId,
|
|
57
|
-
gracePeriodMs: args.gracePeriodMs,
|
|
58
|
-
lookupPrefix,
|
|
59
|
-
secretHex,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
async list(ctx, args) {
|
|
63
|
-
return await ctx.runQuery(this.component.queries.list, args);
|
|
64
|
-
}
|
|
65
|
-
async listByTag(ctx, args) {
|
|
66
|
-
return await ctx.runQuery(this.component.queries.listByTag, args);
|
|
67
|
-
}
|
|
68
|
-
async update(ctx, args) {
|
|
69
|
-
await ctx.runMutation(this.component.mutations.update, {
|
|
70
|
-
keyId: args.keyId,
|
|
71
|
-
name: args.name,
|
|
72
|
-
scopes: args.scopes,
|
|
73
|
-
tags: args.tags,
|
|
74
|
-
metadata: args.metadata,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
async disable(ctx, args) {
|
|
78
|
-
await ctx.runMutation(this.component.mutations.disable, { keyId: args.keyId });
|
|
79
|
-
}
|
|
80
|
-
async enable(ctx, args) {
|
|
81
|
-
await ctx.runMutation(this.component.mutations.enable, { keyId: args.keyId });
|
|
82
|
-
}
|
|
83
|
-
async getUsage(ctx, args) {
|
|
84
|
-
return await ctx.runQuery(this.component.queries.getUsage, {
|
|
85
|
-
keyId: args.keyId,
|
|
86
|
-
period: args.period,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
async configure(ctx, args) {
|
|
90
|
-
await ctx.runMutation(this.component.mutations.configure, args);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=index.js.map
|
package/dist/client/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AA+BzC,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACzC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;SACrB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAC3C,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC;AAED,MAAM,OAAO,OAAO;IACX,SAAS,CAAe;IACvB,MAAM,CAAS;IACf,WAAW,CAAU;IAE7B,YAAY,SAAuB,EAAE,MAAsB;QACzD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,IAAI,IAAI,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,MAAM,EAAE,WAAW,IAAI,QAAQ,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,MAAM,CACV,GAAmB,EACnB,OAAyB;QAEzB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC;QAC9C,MAAM,SAAS,GAAG,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC5D,MAAM,GAAG,GAAG,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MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,GAAmB,EAAE,IAAuB;QACxD,MAAM,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAmB,EAAE,IAAuB;QACvD,MAAM,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,GAAgB,EAChB,IAAgE;QAEhE,OAAO,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE;YACzD,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAe,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,SAAS,CACb,GAAmB,EACnB,IAA8D;QAE9D,MAAM,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAClE,CAAC;CACF"}
|
package/dist/client/types.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { KeyType, KeyStatus, EventType } from "../shared.js";
|
|
2
|
-
export type { KeyType, KeyStatus, EventType };
|
|
3
|
-
export interface CreateKeyOptions {
|
|
4
|
-
name: string;
|
|
5
|
-
ownerId: string;
|
|
6
|
-
type?: KeyType;
|
|
7
|
-
scopes?: string[];
|
|
8
|
-
tags?: string[];
|
|
9
|
-
env?: string;
|
|
10
|
-
metadata?: Record<string, unknown>;
|
|
11
|
-
remaining?: number;
|
|
12
|
-
expiresAt?: number;
|
|
13
|
-
}
|
|
14
|
-
export interface CreateKeyResult {
|
|
15
|
-
keyId: string;
|
|
16
|
-
key: string;
|
|
17
|
-
}
|
|
18
|
-
export interface ValidationSuccess {
|
|
19
|
-
valid: true;
|
|
20
|
-
keyId: string;
|
|
21
|
-
ownerId: string;
|
|
22
|
-
type: KeyType;
|
|
23
|
-
env: string;
|
|
24
|
-
scopes: string[];
|
|
25
|
-
tags: string[];
|
|
26
|
-
metadata?: Record<string, unknown>;
|
|
27
|
-
remaining?: number;
|
|
28
|
-
}
|
|
29
|
-
export interface ValidationFailure {
|
|
30
|
-
valid: false;
|
|
31
|
-
reason: string;
|
|
32
|
-
retryAfter?: number;
|
|
33
|
-
}
|
|
34
|
-
export type ValidationResult = ValidationSuccess | ValidationFailure;
|
|
35
|
-
export interface KeyMetadata {
|
|
36
|
-
keyId: string;
|
|
37
|
-
name: string;
|
|
38
|
-
lookupPrefix: string;
|
|
39
|
-
type: KeyType;
|
|
40
|
-
env: string;
|
|
41
|
-
scopes: string[];
|
|
42
|
-
tags: string[];
|
|
43
|
-
status: KeyStatus;
|
|
44
|
-
metadata?: Record<string, unknown>;
|
|
45
|
-
remaining?: number;
|
|
46
|
-
expiresAt?: number;
|
|
47
|
-
createdAt: number;
|
|
48
|
-
lastUsedAt?: number;
|
|
49
|
-
}
|
|
50
|
-
export interface UsageStats {
|
|
51
|
-
total: number;
|
|
52
|
-
remaining?: number;
|
|
53
|
-
lastUsedAt?: number;
|
|
54
|
-
}
|
|
55
|
-
export interface RotateResult {
|
|
56
|
-
newKeyId: string;
|
|
57
|
-
newKey: string;
|
|
58
|
-
oldKeyExpiresAt: number;
|
|
59
|
-
}
|
|
60
|
-
export interface KeyEvent {
|
|
61
|
-
keyId: string;
|
|
62
|
-
ownerId: string;
|
|
63
|
-
eventType: EventType;
|
|
64
|
-
reason?: string;
|
|
65
|
-
metadata?: Record<string, unknown>;
|
|
66
|
-
timestamp: number;
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAElE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,IAAI,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAErE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/client/types.js
DELETED
package/dist/client/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated `api` utility.
|
|
3
|
-
*
|
|
4
|
-
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
-
*
|
|
6
|
-
* To regenerate, run `npx convex dev`.
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
import type * as mutations from "../mutations.js";
|
|
10
|
-
import type * as queries from "../queries.js";
|
|
11
|
-
import type { ApiFromModules, FilterApi, FunctionReference } from "convex/server";
|
|
12
|
-
declare const fullApi: ApiFromModules<{
|
|
13
|
-
mutations: typeof mutations;
|
|
14
|
-
queries: typeof queries;
|
|
15
|
-
}>;
|
|
16
|
-
/**
|
|
17
|
-
* A utility for referencing Convex functions in your app's public API.
|
|
18
|
-
*
|
|
19
|
-
* Usage:
|
|
20
|
-
* ```js
|
|
21
|
-
* const myFunctionReference = api.myModule.myFunction;
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare const api: FilterApi<typeof fullApi, FunctionReference<any, "public">>;
|
|
25
|
-
/**
|
|
26
|
-
* A utility for referencing Convex functions in your app's internal API.
|
|
27
|
-
*
|
|
28
|
-
* Usage:
|
|
29
|
-
* ```js
|
|
30
|
-
* const myFunctionReference = internal.myModule.myFunction;
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export declare const internal: FilterApi<typeof fullApi, FunctionReference<any, "internal">>;
|
|
34
|
-
export declare const components: {
|
|
35
|
-
rateLimiter: import("@convex-dev/rate-limiter/_generated/component.js").ComponentApi<"rateLimiter">;
|
|
36
|
-
shardedCounter: import("@convex-dev/sharded-counter/_generated/component.js").ComponentApi<"shardedCounter">;
|
|
37
|
-
usageAggregate: import("@convex-dev/aggregate/_generated/component.js").ComponentApi<"usageAggregate">;
|
|
38
|
-
crons: import("@convex-dev/crons/_generated/component.js").ComponentApi<"crons">;
|
|
39
|
-
};
|
|
40
|
-
export {};
|
|
41
|
-
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,QAAA,MAAM,OAAO,EAAE,cAAc,CAAC;IAC5B,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,OAAO,EAAE,OAAO,OAAO,CAAC;CACzB,CAAiB,CAAC;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAE,SAAS,CACzB,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CACjB,CAAC;AAElB;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAC9B,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CACnB,CAAC;AAElB,eAAO,MAAM,UAAU,EAAqC;IAC1D,WAAW,EAAE,OAAO,kDAAkD,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;IACpG,cAAc,EAAE,OAAO,qDAAqD,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAC7G,cAAc,EAAE,OAAO,+CAA+C,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACvG,KAAK,EAAE,OAAO,2CAA2C,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;CAClF,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* Generated `api` utility.
|
|
4
|
-
*
|
|
5
|
-
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
-
*
|
|
7
|
-
* To regenerate, run `npx convex dev`.
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
import { anyApi, componentsGeneric } from "convex/server";
|
|
11
|
-
const fullApi = anyApi;
|
|
12
|
-
/**
|
|
13
|
-
* A utility for referencing Convex functions in your app's public API.
|
|
14
|
-
*
|
|
15
|
-
* Usage:
|
|
16
|
-
* ```js
|
|
17
|
-
* const myFunctionReference = api.myModule.myFunction;
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export const api = anyApi;
|
|
21
|
-
/**
|
|
22
|
-
* A utility for referencing Convex functions in your app's internal API.
|
|
23
|
-
*
|
|
24
|
-
* Usage:
|
|
25
|
-
* ```js
|
|
26
|
-
* const myFunctionReference = internal.myModule.myFunction;
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export const internal = anyApi;
|
|
30
|
-
export const components = componentsGeneric();
|
|
31
|
-
//# sourceMappingURL=api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAUH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,OAAO,GAGR,MAAa,CAAC;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,GAAG,GAGZ,MAAa,CAAC;AAElB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAGjB,MAAa,CAAC;AAElB,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,EAK1C,CAAC"}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated `ComponentApi` utility.
|
|
3
|
-
*
|
|
4
|
-
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
-
*
|
|
6
|
-
* To regenerate, run `npx convex dev`.
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
import type { FunctionReference } from "convex/server";
|
|
10
|
-
/**
|
|
11
|
-
* A utility for referencing a Convex component's exposed API.
|
|
12
|
-
*
|
|
13
|
-
* Useful when expecting a parameter like `components.myComponent`.
|
|
14
|
-
* Usage:
|
|
15
|
-
* ```ts
|
|
16
|
-
* async function myFunction(ctx: QueryCtx, component: ComponentApi) {
|
|
17
|
-
* return ctx.runQuery(component.someFile.someQuery, { ...args });
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export type ComponentApi<Name extends string | undefined = string | undefined> = {
|
|
22
|
-
mutations: {
|
|
23
|
-
configure: FunctionReference<"mutation", "internal", {
|
|
24
|
-
cleanupIntervalMs?: number;
|
|
25
|
-
defaultExpiryMs?: number;
|
|
26
|
-
}, null, Name>;
|
|
27
|
-
create: FunctionReference<"mutation", "internal", {
|
|
28
|
-
env?: string;
|
|
29
|
-
expiresAt?: number;
|
|
30
|
-
hash: string;
|
|
31
|
-
keyPrefix?: string;
|
|
32
|
-
lookupPrefix: string;
|
|
33
|
-
metadata?: any;
|
|
34
|
-
name: string;
|
|
35
|
-
ownerId: string;
|
|
36
|
-
remaining?: number;
|
|
37
|
-
scopes?: Array<string>;
|
|
38
|
-
secretHex: string;
|
|
39
|
-
tags?: Array<string>;
|
|
40
|
-
type?: "secret" | "publishable";
|
|
41
|
-
}, {
|
|
42
|
-
key: string;
|
|
43
|
-
keyId: string;
|
|
44
|
-
}, Name>;
|
|
45
|
-
disable: FunctionReference<"mutation", "internal", {
|
|
46
|
-
keyId: string;
|
|
47
|
-
}, null, Name>;
|
|
48
|
-
enable: FunctionReference<"mutation", "internal", {
|
|
49
|
-
keyId: string;
|
|
50
|
-
}, null, Name>;
|
|
51
|
-
revoke: FunctionReference<"mutation", "internal", {
|
|
52
|
-
keyId: string;
|
|
53
|
-
}, null, Name>;
|
|
54
|
-
revokeByTag: FunctionReference<"mutation", "internal", {
|
|
55
|
-
ownerId: string;
|
|
56
|
-
tag: string;
|
|
57
|
-
}, {
|
|
58
|
-
revokedCount: number;
|
|
59
|
-
}, Name>;
|
|
60
|
-
rotate: FunctionReference<"mutation", "internal", {
|
|
61
|
-
gracePeriodMs?: number;
|
|
62
|
-
keyId: string;
|
|
63
|
-
lookupPrefix: string;
|
|
64
|
-
secretHex: string;
|
|
65
|
-
}, {
|
|
66
|
-
newKey: string;
|
|
67
|
-
newKeyId: string;
|
|
68
|
-
oldKeyExpiresAt: number;
|
|
69
|
-
}, Name>;
|
|
70
|
-
update: FunctionReference<"mutation", "internal", {
|
|
71
|
-
keyId: string;
|
|
72
|
-
metadata?: any;
|
|
73
|
-
name?: string;
|
|
74
|
-
scopes?: Array<string>;
|
|
75
|
-
tags?: Array<string>;
|
|
76
|
-
}, null, Name>;
|
|
77
|
-
validate: FunctionReference<"mutation", "internal", {
|
|
78
|
-
key: string;
|
|
79
|
-
}, {
|
|
80
|
-
env: string;
|
|
81
|
-
keyId: string;
|
|
82
|
-
metadata?: any;
|
|
83
|
-
ownerId: string;
|
|
84
|
-
remaining?: number;
|
|
85
|
-
scopes: Array<string>;
|
|
86
|
-
tags: Array<string>;
|
|
87
|
-
type: "secret" | "publishable";
|
|
88
|
-
valid: true;
|
|
89
|
-
} | {
|
|
90
|
-
reason: string;
|
|
91
|
-
retryAfter?: number;
|
|
92
|
-
valid: false;
|
|
93
|
-
}, Name>;
|
|
94
|
-
};
|
|
95
|
-
queries: {
|
|
96
|
-
getUsage: FunctionReference<"query", "internal", {
|
|
97
|
-
keyId: string;
|
|
98
|
-
period?: {
|
|
99
|
-
end: number;
|
|
100
|
-
start: number;
|
|
101
|
-
};
|
|
102
|
-
}, {
|
|
103
|
-
lastUsedAt?: number;
|
|
104
|
-
remaining?: number;
|
|
105
|
-
total: number;
|
|
106
|
-
}, Name>;
|
|
107
|
-
list: FunctionReference<"query", "internal", {
|
|
108
|
-
env?: string;
|
|
109
|
-
ownerId: string;
|
|
110
|
-
status?: "active" | "disabled" | "revoked" | "rotating" | "expired" | "exhausted";
|
|
111
|
-
}, Array<{
|
|
112
|
-
createdAt: number;
|
|
113
|
-
env: string;
|
|
114
|
-
expiresAt?: number;
|
|
115
|
-
keyId: string;
|
|
116
|
-
lastUsedAt?: number;
|
|
117
|
-
lookupPrefix: string;
|
|
118
|
-
metadata?: any;
|
|
119
|
-
name: string;
|
|
120
|
-
remaining?: number;
|
|
121
|
-
scopes: Array<string>;
|
|
122
|
-
status: "active" | "disabled" | "revoked" | "rotating" | "expired" | "exhausted";
|
|
123
|
-
tags: Array<string>;
|
|
124
|
-
type: "secret" | "publishable";
|
|
125
|
-
}>, Name>;
|
|
126
|
-
listByTag: FunctionReference<"query", "internal", {
|
|
127
|
-
ownerId: string;
|
|
128
|
-
tag: string;
|
|
129
|
-
}, Array<{
|
|
130
|
-
createdAt: number;
|
|
131
|
-
env: string;
|
|
132
|
-
expiresAt?: number;
|
|
133
|
-
keyId: string;
|
|
134
|
-
lastUsedAt?: number;
|
|
135
|
-
lookupPrefix: string;
|
|
136
|
-
metadata?: any;
|
|
137
|
-
name: string;
|
|
138
|
-
remaining?: number;
|
|
139
|
-
scopes: Array<string>;
|
|
140
|
-
status: "active" | "disabled" | "revoked" | "rotating" | "expired" | "exhausted";
|
|
141
|
-
tags: Array<string>;
|
|
142
|
-
type: "secret" | "publishable";
|
|
143
|
-
}>, Name>;
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,CAAC,IAAI,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,IAC3E;IACE,SAAS,EAAE;QACT,SAAS,EAAE,iBAAiB,CAC1B,UAAU,EACV,UAAU,EACV;YA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;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,EAChC,KAAK,CAAC;YACJ,SAAS,EAAE,MAAM,CAAC;YAClB,GAAG,EAAE,MAAM,CAAC;YACZ,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,KAAK,EAAE,MAAM,CAAC;YACd,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,YAAY,EAAE,MAAM,CAAC;YACrB,QAAQ,CAAC,EAAE,GAAG,CAAC;YACf,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACtB,MAAM,EACF,QAAQ,GACR,UAAU,GACV,SAAS,GACT,UAAU,GACV,SAAS,GACT,WAAW,CAAC;YAChB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YACpB,IAAI,EAAE,QAAQ,GAAG,aAAa,CAAC;SAChC,CAAC,EACF,IAAI,CACL,CAAC;KACH,CAAC;CACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated data model types.
|
|
3
|
-
*
|
|
4
|
-
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
-
*
|
|
6
|
-
* To regenerate, run `npx convex dev`.
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
import type { DataModelFromSchemaDefinition, DocumentByName, TableNamesInDataModel, SystemTableNames } from "convex/server";
|
|
10
|
-
import type { GenericId } from "convex/values";
|
|
11
|
-
import schema from "../schema.js";
|
|
12
|
-
/**
|
|
13
|
-
* The names of all of your Convex tables.
|
|
14
|
-
*/
|
|
15
|
-
export type TableNames = TableNamesInDataModel<DataModel>;
|
|
16
|
-
/**
|
|
17
|
-
* The type of a document stored in Convex.
|
|
18
|
-
*
|
|
19
|
-
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
20
|
-
*/
|
|
21
|
-
export type Doc<TableName extends TableNames> = DocumentByName<DataModel, TableName>;
|
|
22
|
-
/**
|
|
23
|
-
* An identifier for a document in Convex.
|
|
24
|
-
*
|
|
25
|
-
* Convex documents are uniquely identified by their `Id`, which is accessible
|
|
26
|
-
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
|
|
27
|
-
*
|
|
28
|
-
* Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
|
|
29
|
-
*
|
|
30
|
-
* IDs are just strings at runtime, but this type can be used to distinguish them from other
|
|
31
|
-
* strings when type checking.
|
|
32
|
-
*
|
|
33
|
-
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
34
|
-
*/
|
|
35
|
-
export type Id<TableName extends TableNames | SystemTableNames> = GenericId<TableName>;
|
|
36
|
-
/**
|
|
37
|
-
* A type describing your Convex data model.
|
|
38
|
-
*
|
|
39
|
-
* This type includes information about what tables you have, the type of
|
|
40
|
-
* documents stored in those tables, and the indexes defined on them.
|
|
41
|
-
*
|
|
42
|
-
* This type is used to parameterize methods like `queryGeneric` and
|
|
43
|
-
* `mutationGeneric` to make them type-safe.
|
|
44
|
-
*/
|
|
45
|
-
export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
|
|
46
|
-
//# sourceMappingURL=dataModel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataModel.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/dataModel.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,6BAA6B,EAC7B,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,GAAG,CAAC,SAAS,SAAS,UAAU,IAAI,cAAc,CAC5D,SAAS,EACT,SAAS,CACV,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,EAAE,CAAC,SAAS,SAAS,UAAU,GAAG,gBAAgB,IAC5D,SAAS,CAAC,SAAS,CAAC,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,6BAA6B,CAAC,OAAO,MAAM,CAAC,CAAC"}
|