convex-vapi 0.0.1

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 (52) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +437 -0
  3. package/dist/client/_generated/_ignore.d.ts +1 -0
  4. package/dist/client/_generated/_ignore.d.ts.map +1 -0
  5. package/dist/client/_generated/_ignore.js +3 -0
  6. package/dist/client/_generated/_ignore.js.map +1 -0
  7. package/dist/client/index.d.ts +115 -0
  8. package/dist/client/index.d.ts.map +1 -0
  9. package/dist/client/index.js +172 -0
  10. package/dist/client/index.js.map +1 -0
  11. package/dist/component/_generated/api.d.ts +34 -0
  12. package/dist/component/_generated/api.d.ts.map +1 -0
  13. package/dist/component/_generated/api.js +31 -0
  14. package/dist/component/_generated/api.js.map +1 -0
  15. package/dist/component/_generated/component.d.ts +125 -0
  16. package/dist/component/_generated/component.d.ts.map +1 -0
  17. package/dist/component/_generated/component.js +11 -0
  18. package/dist/component/_generated/component.js.map +1 -0
  19. package/dist/component/_generated/dataModel.d.ts +46 -0
  20. package/dist/component/_generated/dataModel.d.ts.map +1 -0
  21. package/dist/component/_generated/dataModel.js +11 -0
  22. package/dist/component/_generated/dataModel.js.map +1 -0
  23. package/dist/component/_generated/server.d.ts +133 -0
  24. package/dist/component/_generated/server.d.ts.map +1 -0
  25. package/dist/component/_generated/server.js +80 -0
  26. package/dist/component/_generated/server.js.map +1 -0
  27. package/dist/component/convex.config.d.ts +3 -0
  28. package/dist/component/convex.config.d.ts.map +1 -0
  29. package/dist/component/convex.config.js +4 -0
  30. package/dist/component/convex.config.js.map +1 -0
  31. package/dist/component/lib.d.ts +101 -0
  32. package/dist/component/lib.d.ts.map +1 -0
  33. package/dist/component/lib.js +177 -0
  34. package/dist/component/lib.js.map +1 -0
  35. package/dist/component/schema.d.ts +53 -0
  36. package/dist/component/schema.d.ts.map +1 -0
  37. package/dist/component/schema.js +30 -0
  38. package/dist/component/schema.js.map +1 -0
  39. package/package.json +105 -0
  40. package/src/client/_generated/_ignore.ts +1 -0
  41. package/src/client/index.ts +250 -0
  42. package/src/client/setup.test.ts +26 -0
  43. package/src/component/_generated/api.ts +50 -0
  44. package/src/component/_generated/component.ts +159 -0
  45. package/src/component/_generated/dataModel.ts +60 -0
  46. package/src/component/_generated/server.ts +169 -0
  47. package/src/component/convex.config.ts +5 -0
  48. package/src/component/lib.test.ts +167 -0
  49. package/src/component/lib.ts +193 -0
  50. package/src/component/schema.ts +31 -0
  51. package/src/component/setup.test.ts +11 -0
  52. package/src/test.ts +18 -0
package/package.json ADDED
@@ -0,0 +1,105 @@
1
+ {
2
+ "name": "convex-vapi",
3
+ "description": "Sync Vapi voice AI calls into Convex reactively, and place outbound calls from Convex functions.",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/sholajegede/convex-vapi.git"
7
+ },
8
+ "homepage": "https://github.com/sholajegede/convex-vapi#readme",
9
+ "bugs": {
10
+ "url": "https://github.com/sholajegede/convex-vapi/issues"
11
+ },
12
+ "version": "0.0.1",
13
+ "license": "Apache-2.0",
14
+ "keywords": [
15
+ "convex",
16
+ "component",
17
+ "vapi",
18
+ "voice-ai",
19
+ "calls",
20
+ "webhooks",
21
+ "telephony"
22
+ ],
23
+ "type": "module",
24
+ "scripts": {
25
+ "dev": "run-p -r 'dev:*'",
26
+ "dev:backend": "convex dev --typecheck-components",
27
+ "dev:frontend": "cd example && vite --clearScreen false",
28
+ "dev:build": "chokidar 'tsconfig*.json' 'src/**/*.ts' -i '**/*.test.ts' -c 'npm run build:codegen' --initial",
29
+ "predev": "path-exists .env.local dist || (npm run build && convex dev --once)",
30
+ "build": "tsc --project ./tsconfig.build.json",
31
+ "build:codegen": "npx convex codegen --component-dir ./src/component && npm run build",
32
+ "build:clean": "rm -rf dist *.tsbuildinfo && npm run build:codegen",
33
+ "typecheck": "tsc --noEmit && tsc -p example && tsc -p example/convex",
34
+ "lint": "eslint .",
35
+ "all": "run-p -r 'dev:*' 'test:watch'",
36
+ "test": "vitest run --typecheck",
37
+ "test:watch": "vitest --typecheck --clearScreen false",
38
+ "test:debug": "vitest --inspect-brk --no-file-parallelism",
39
+ "test:coverage": "vitest run --coverage --coverage.reporter=text",
40
+ "preversion": "npm install --legacy-peer-deps && npm run build:clean && run-p test lint typecheck",
41
+ "prepublishOnly": "npm whoami || npm login",
42
+ "alpha": "npm version prerelease --preid alpha && npm publish --tag alpha && git push --follow-tags",
43
+ "release": "npm version patch && npm publish && git push --follow-tags",
44
+ "version": "vim -c 'normal o' -c 'normal o## '$npm_package_version CHANGELOG.md && prettier -w CHANGELOG.md && git add CHANGELOG.md"
45
+ },
46
+ "files": [
47
+ "dist",
48
+ "src"
49
+ ],
50
+ "exports": {
51
+ "./package.json": "./package.json",
52
+ ".": {
53
+ "types": "./dist/client/index.d.ts",
54
+ "default": "./dist/client/index.js"
55
+ },
56
+ "./test": "./src/test.ts",
57
+ "./_generated/component.js": {
58
+ "types": "./dist/component/_generated/component.d.ts"
59
+ },
60
+ "./_generated/component": {
61
+ "types": "./dist/component/_generated/component.d.ts"
62
+ },
63
+ "./convex.config.js": {
64
+ "types": "./dist/component/convex.config.d.ts",
65
+ "default": "./dist/component/convex.config.js"
66
+ },
67
+ "./convex.config": {
68
+ "types": "./dist/component/convex.config.d.ts",
69
+ "default": "./dist/component/convex.config.js"
70
+ }
71
+ },
72
+ "peerDependencies": {
73
+ "convex": "^1.34.1"
74
+ },
75
+ "devDependencies": {
76
+ "@convex-dev/eslint-plugin": "^1.2.0",
77
+ "@edge-runtime/vm": "^5.0.0",
78
+ "@eslint/eslintrc": "^3.3.5",
79
+ "@eslint/js": "9.39.4",
80
+ "@types/node": "^24.12.0",
81
+ "@types/react": "^19.2.14",
82
+ "@types/react-dom": "^19.2.3",
83
+ "@vitejs/plugin-react": "^5.2.0",
84
+ "chokidar-cli": "3.0.0",
85
+ "convex": "1.45.0",
86
+ "convex-test": "0.0.41",
87
+ "eslint": "9.39.4",
88
+ "eslint-plugin-react": "^7.37.5",
89
+ "eslint-plugin-react-hooks": "^7.0.1",
90
+ "eslint-plugin-react-refresh": "^0.5.2",
91
+ "globals": "^17.4.0",
92
+ "npm-run-all2": "8.0.4",
93
+ "path-exists-cli": "2.0.0",
94
+ "pkg-pr-new": "^0.0.66",
95
+ "prettier": "3.8.1",
96
+ "react": "^19.2.4",
97
+ "react-dom": "^19.2.4",
98
+ "typescript": "5.9.3",
99
+ "typescript-eslint": "8.57.1",
100
+ "vite": "7.3.1",
101
+ "vitest": "4.1.0"
102
+ },
103
+ "types": "./dist/client/index.d.ts",
104
+ "module": "./dist/client/index.js"
105
+ }
@@ -0,0 +1 @@
1
+ // This is only here so convex-test can detect a _generated folder
@@ -0,0 +1,250 @@
1
+ import { httpActionGeneric } from "convex/server";
2
+ import type { GenericActionCtx, GenericDataModel } from "convex/server";
3
+ import type { ComponentApi } from "../component/_generated/component.js";
4
+
5
+ const VAPI_API_BASE = "https://api.vapi.ai";
6
+
7
+ export type VapiOptions = {
8
+ /** A private API key from the Vapi dashboard. */
9
+ apiKey: string;
10
+ /**
11
+ * The shared secret configured in the assistant's `server.secret` field.
12
+ * Sent back by Vapi on every webhook request in the `X-Vapi-Secret` header.
13
+ */
14
+ webhookSecret: string;
15
+ };
16
+
17
+ export type CreateCallArgs = {
18
+ assistantId: string;
19
+ phoneNumberId: string;
20
+ customerNumber: string;
21
+ };
22
+
23
+ function timingSafeEqual(a: string, b: string): boolean {
24
+ if (a.length !== b.length) return false;
25
+ let mismatch = 0;
26
+ for (let i = 0; i < a.length; i++) {
27
+ mismatch |= a.charCodeAt(i) ^ b.charCodeAt(i);
28
+ }
29
+ return mismatch === 0;
30
+ }
31
+
32
+ async function sha256Hex(payload: string): Promise<string> {
33
+ const enc = new TextEncoder();
34
+ const digest = await crypto.subtle.digest("SHA-256", enc.encode(payload));
35
+ return Array.from(new Uint8Array(digest))
36
+ .map((b) => b.toString(16).padStart(2, "0"))
37
+ .join("");
38
+ }
39
+
40
+ function callRecordFromApiObject(call: Record<string, unknown>) {
41
+ const customer = call.customer as Record<string, unknown> | undefined;
42
+ return {
43
+ callId: String(call.id),
44
+ assistantId: (call.assistantId as string) ?? undefined,
45
+ phoneNumberId: (call.phoneNumberId as string) ?? undefined,
46
+ customerNumber: (customer?.number as string) ?? undefined,
47
+ status: (call.status as string) ?? "unknown",
48
+ endedReason: (call.endedReason as string) ?? undefined,
49
+ startedAt: call.startedAt
50
+ ? new Date(call.startedAt as string).getTime()
51
+ : undefined,
52
+ endedAt: call.endedAt
53
+ ? new Date(call.endedAt as string).getTime()
54
+ : undefined,
55
+ cost: (call.cost as number) ?? undefined,
56
+ };
57
+ }
58
+
59
+ export class Vapi {
60
+ webhookHandler: ReturnType<typeof httpActionGeneric>;
61
+
62
+ constructor(
63
+ private component: ComponentApi,
64
+ private options: VapiOptions,
65
+ ) {
66
+ const component_ = component;
67
+ const webhookSecret = options.webhookSecret;
68
+
69
+ this.webhookHandler = httpActionGeneric(async (ctx, request) => {
70
+ const rawBody = await request.text();
71
+ const secretHeader = request.headers.get("x-vapi-secret");
72
+
73
+ if (!secretHeader) {
74
+ return new Response(
75
+ JSON.stringify({ error: "Missing X-Vapi-Secret header" }),
76
+ {
77
+ status: 400,
78
+ headers: { "Content-Type": "application/json" },
79
+ },
80
+ );
81
+ }
82
+
83
+ if (!timingSafeEqual(secretHeader, webhookSecret)) {
84
+ console.error("convex-vapi: webhook secret mismatch");
85
+ return new Response(JSON.stringify({ error: "Invalid secret" }), {
86
+ status: 401,
87
+ headers: { "Content-Type": "application/json" },
88
+ });
89
+ }
90
+
91
+ // Vapi does not send a per-delivery id header, so duplicates are
92
+ // detected by hashing the raw payload itself.
93
+ const eventId = await sha256Hex(rawBody);
94
+
95
+ const payload = JSON.parse(rawBody) as {
96
+ message?: Record<string, unknown>;
97
+ };
98
+ const message = payload.message ?? {};
99
+ const eventType = (message.type as string) ?? "unknown";
100
+ const call = message.call as Record<string, unknown> | undefined;
101
+ const callId = call?.id ? String(call.id) : undefined;
102
+
103
+ const { alreadyProcessed } = await ctx.runMutation(
104
+ component_.lib.checkAndRecordEvent,
105
+ {
106
+ eventId,
107
+ eventType,
108
+ callId,
109
+ payload: rawBody,
110
+ },
111
+ );
112
+
113
+ if (alreadyProcessed) {
114
+ return new Response(
115
+ JSON.stringify({ success: true, duplicate: true }),
116
+ {
117
+ status: 200,
118
+ headers: { "Content-Type": "application/json" },
119
+ },
120
+ );
121
+ }
122
+
123
+ if (eventType === "status-update" && call) {
124
+ await ctx.runMutation(component_.lib.recordCall, {
125
+ ...callRecordFromApiObject(call),
126
+ status:
127
+ (message.status as string) ?? (call.status as string) ?? "unknown",
128
+ });
129
+ } else if (eventType === "end-of-call-report" && call) {
130
+ const artifact = message.artifact as
131
+ | Record<string, unknown>
132
+ | undefined;
133
+ await ctx.runMutation(component_.lib.recordCall, {
134
+ ...callRecordFromApiObject(call),
135
+ status: "ended",
136
+ endedReason: (message.endedReason as string) ?? undefined,
137
+ transcript: (artifact?.transcript as string) ?? undefined,
138
+ summary: (artifact?.summary as string) ?? undefined,
139
+ recordingUrl:
140
+ (artifact?.recordingUrl as string) ??
141
+ ((artifact?.recording as Record<string, unknown> | undefined)
142
+ ?.stereoUrl as string) ??
143
+ undefined,
144
+ });
145
+ }
146
+ // Other event types (transcript, conversation-update, speech-update,
147
+ // tool-calls, etc.) are accepted and recorded in webhookEvents for
148
+ // idempotency/auditing, but do not update the calls table — see the
149
+ // README's Limitations section.
150
+
151
+ return new Response(JSON.stringify({ success: true }), {
152
+ status: 200,
153
+ headers: { "Content-Type": "application/json" },
154
+ });
155
+ });
156
+ }
157
+
158
+ private headers(): Record<string, string> {
159
+ return {
160
+ Authorization: `Bearer ${this.options.apiKey}`,
161
+ "Content-Type": "application/json",
162
+ };
163
+ }
164
+
165
+ async createCall(
166
+ ctx: GenericActionCtx<GenericDataModel>,
167
+ args: CreateCallArgs,
168
+ ): Promise<{ callId: string; status: string }> {
169
+ const res = await fetch(`${VAPI_API_BASE}/call`, {
170
+ method: "POST",
171
+ headers: this.headers(),
172
+ body: JSON.stringify({
173
+ assistantId: args.assistantId,
174
+ phoneNumberId: args.phoneNumberId,
175
+ customer: { number: args.customerNumber },
176
+ }),
177
+ });
178
+ if (!res.ok) {
179
+ throw new Error(
180
+ `Failed to create Vapi call: ${res.status} ${await res.text()}`,
181
+ );
182
+ }
183
+ const json = (await res.json()) as Record<string, unknown>;
184
+
185
+ await ctx.runMutation(
186
+ this.component.lib.recordCall,
187
+ callRecordFromApiObject(json),
188
+ );
189
+
190
+ return {
191
+ callId: String(json.id),
192
+ status: (json.status as string) ?? "queued",
193
+ };
194
+ }
195
+
196
+ /** Fetches the latest call state directly from the Vapi API and re-records it. */
197
+ async refreshCall(
198
+ ctx: GenericActionCtx<GenericDataModel>,
199
+ args: { callId: string },
200
+ ): Promise<void> {
201
+ const res = await fetch(`${VAPI_API_BASE}/call/${args.callId}`, {
202
+ method: "GET",
203
+ headers: this.headers(),
204
+ });
205
+ if (!res.ok) {
206
+ throw new Error(
207
+ `Failed to fetch Vapi call: ${res.status} ${await res.text()}`,
208
+ );
209
+ }
210
+ const json = (await res.json()) as Record<string, unknown>;
211
+ const artifact = json.artifact as Record<string, unknown> | undefined;
212
+
213
+ await ctx.runMutation(this.component.lib.recordCall, {
214
+ ...callRecordFromApiObject(json),
215
+ transcript: (artifact?.transcript as string) ?? undefined,
216
+ summary: (artifact?.summary as string) ?? undefined,
217
+ recordingUrl: (artifact?.recordingUrl as string) ?? undefined,
218
+ });
219
+ }
220
+
221
+ async getCall(ctx: RunQueryCtx, args: { callId: string }) {
222
+ return await ctx.runQuery(this.component.lib.getCall, args);
223
+ }
224
+
225
+ async listCallsByAssistant(
226
+ ctx: RunQueryCtx,
227
+ args: { assistantId: string; limit?: number },
228
+ ) {
229
+ return await ctx.runQuery(this.component.lib.listCallsByAssistant, args);
230
+ }
231
+
232
+ async getStats(ctx: RunQueryCtx) {
233
+ return await ctx.runQuery(this.component.lib.getStats, {});
234
+ }
235
+
236
+ async listRecentCalls(ctx: RunQueryCtx, args: { limit?: number } = {}) {
237
+ return await ctx.runQuery(this.component.lib.listRecentCalls, args);
238
+ }
239
+
240
+ async listRecentWebhookEvents(
241
+ ctx: RunQueryCtx,
242
+ args: { limit?: number } = {},
243
+ ) {
244
+ return await ctx.runQuery(this.component.lib.listRecentWebhookEvents, args);
245
+ }
246
+ }
247
+
248
+ type RunQueryCtx = {
249
+ runQuery: GenericActionCtx<GenericDataModel>["runQuery"];
250
+ };
@@ -0,0 +1,26 @@
1
+ /// <reference types="vite/client" />
2
+ import { test } from "vitest";
3
+ import { convexTest } from "convex-test";
4
+ export const modules = import.meta.glob("./**/*.*s");
5
+
6
+ import {
7
+ defineSchema,
8
+ type GenericSchema,
9
+ type SchemaDefinition,
10
+ } from "convex/server";
11
+ import { type ComponentApi } from "../component/_generated/component.js";
12
+ import { componentsGeneric } from "convex/server";
13
+ import { register } from "../test.js";
14
+
15
+ export function initConvexTest<
16
+ Schema extends SchemaDefinition<GenericSchema, boolean>,
17
+ >(schema?: Schema) {
18
+ const t = convexTest(schema ?? defineSchema({}), modules);
19
+ register(t);
20
+ return t;
21
+ }
22
+ export const components = componentsGeneric() as unknown as {
23
+ convexVapi: ComponentApi;
24
+ };
25
+
26
+ test("setup", () => {});
@@ -0,0 +1,50 @@
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
+
11
+ import type * as lib from "../lib.js";
12
+
13
+ import type {
14
+ ApiFromModules,
15
+ FilterApi,
16
+ FunctionReference,
17
+ } from "convex/server";
18
+ import { anyApi, componentsGeneric } from "convex/server";
19
+
20
+ const fullApi: ApiFromModules<{
21
+ lib: typeof lib;
22
+ }> = anyApi as any;
23
+
24
+ /**
25
+ * A utility for referencing Convex functions in your app's public API.
26
+ *
27
+ * Usage:
28
+ * ```js
29
+ * const myFunctionReference = api.myModule.myFunction;
30
+ * ```
31
+ */
32
+ export const api: FilterApi<
33
+ typeof fullApi,
34
+ FunctionReference<any, "public">
35
+ > = anyApi as any;
36
+
37
+ /**
38
+ * A utility for referencing Convex functions in your app's internal API.
39
+ *
40
+ * Usage:
41
+ * ```js
42
+ * const myFunctionReference = internal.myModule.myFunction;
43
+ * ```
44
+ */
45
+ export const internal: FilterApi<
46
+ typeof fullApi,
47
+ FunctionReference<any, "internal">
48
+ > = anyApi as any;
49
+
50
+ export const components = componentsGeneric() as unknown as {};
@@ -0,0 +1,159 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated `ComponentApi` utility.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import type { FunctionReference } from "convex/server";
12
+
13
+ /**
14
+ * A utility for referencing a Convex component's exposed API.
15
+ *
16
+ * Useful when expecting a parameter like `components.myComponent`.
17
+ * Usage:
18
+ * ```ts
19
+ * async function myFunction(ctx: QueryCtx, component: ComponentApi) {
20
+ * return ctx.runQuery(component.someFile.someQuery, { ...args });
21
+ * }
22
+ * ```
23
+ */
24
+ export type ComponentApi<Name extends string | undefined = string | undefined> =
25
+ {
26
+ lib: {
27
+ checkAndRecordEvent: FunctionReference<
28
+ "mutation",
29
+ "internal",
30
+ {
31
+ callId?: string;
32
+ eventId: string;
33
+ eventType: string;
34
+ payload: string;
35
+ },
36
+ { alreadyProcessed: boolean },
37
+ Name
38
+ >;
39
+ getCall: FunctionReference<
40
+ "query",
41
+ "internal",
42
+ { callId: string },
43
+ null | {
44
+ _creationTime: number;
45
+ _id: string;
46
+ assistantId?: string;
47
+ callId: string;
48
+ cost?: number;
49
+ createdAt: number;
50
+ customerNumber?: string;
51
+ endedAt?: number;
52
+ endedReason?: string;
53
+ phoneNumberId?: string;
54
+ recordingUrl?: string;
55
+ startedAt?: number;
56
+ status: string;
57
+ summary?: string;
58
+ transcript?: string;
59
+ updatedAt: number;
60
+ },
61
+ Name
62
+ >;
63
+ getStats: FunctionReference<
64
+ "query",
65
+ "internal",
66
+ {},
67
+ {
68
+ callCount: number;
69
+ endedCount: number;
70
+ liveCount: number;
71
+ webhookEventCount: number;
72
+ },
73
+ Name
74
+ >;
75
+ listCallsByAssistant: FunctionReference<
76
+ "query",
77
+ "internal",
78
+ { assistantId: string; limit?: number },
79
+ Array<{
80
+ _creationTime: number;
81
+ _id: string;
82
+ assistantId?: string;
83
+ callId: string;
84
+ cost?: number;
85
+ createdAt: number;
86
+ customerNumber?: string;
87
+ endedAt?: number;
88
+ endedReason?: string;
89
+ phoneNumberId?: string;
90
+ recordingUrl?: string;
91
+ startedAt?: number;
92
+ status: string;
93
+ summary?: string;
94
+ transcript?: string;
95
+ updatedAt: number;
96
+ }>,
97
+ Name
98
+ >;
99
+ listRecentCalls: FunctionReference<
100
+ "query",
101
+ "internal",
102
+ { limit?: number },
103
+ Array<{
104
+ _creationTime: number;
105
+ _id: string;
106
+ assistantId?: string;
107
+ callId: string;
108
+ cost?: number;
109
+ createdAt: number;
110
+ customerNumber?: string;
111
+ endedAt?: number;
112
+ endedReason?: string;
113
+ phoneNumberId?: string;
114
+ recordingUrl?: string;
115
+ startedAt?: number;
116
+ status: string;
117
+ summary?: string;
118
+ transcript?: string;
119
+ updatedAt: number;
120
+ }>,
121
+ Name
122
+ >;
123
+ listRecentWebhookEvents: FunctionReference<
124
+ "query",
125
+ "internal",
126
+ { limit?: number },
127
+ Array<{
128
+ _creationTime: number;
129
+ _id: string;
130
+ callId?: string;
131
+ eventId: string;
132
+ eventType: string;
133
+ payload: string;
134
+ receivedAt: number;
135
+ }>,
136
+ Name
137
+ >;
138
+ recordCall: FunctionReference<
139
+ "mutation",
140
+ "internal",
141
+ {
142
+ assistantId?: string;
143
+ callId: string;
144
+ cost?: number;
145
+ customerNumber?: string;
146
+ endedAt?: number;
147
+ endedReason?: string;
148
+ phoneNumberId?: string;
149
+ recordingUrl?: string;
150
+ startedAt?: number;
151
+ status: string;
152
+ summary?: string;
153
+ transcript?: string;
154
+ },
155
+ string,
156
+ Name
157
+ >;
158
+ };
159
+ };
@@ -0,0 +1,60 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated data model types.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import type {
12
+ DataModelFromSchemaDefinition,
13
+ DocumentByName,
14
+ TableNamesInDataModel,
15
+ SystemTableNames,
16
+ } from "convex/server";
17
+ import type { GenericId } from "convex/values";
18
+ import schema from "../schema.js";
19
+
20
+ /**
21
+ * The names of all of your Convex tables.
22
+ */
23
+ export type TableNames = TableNamesInDataModel<DataModel>;
24
+
25
+ /**
26
+ * The type of a document stored in Convex.
27
+ *
28
+ * @typeParam TableName - A string literal type of the table name (like "users").
29
+ */
30
+ export type Doc<TableName extends TableNames> = DocumentByName<
31
+ DataModel,
32
+ TableName
33
+ >;
34
+
35
+ /**
36
+ * An identifier for a document in Convex.
37
+ *
38
+ * Convex documents are uniquely identified by their `Id`, which is accessible
39
+ * on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
40
+ *
41
+ * Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
42
+ *
43
+ * IDs are just strings at runtime, but this type can be used to distinguish them from other
44
+ * strings when type checking.
45
+ *
46
+ * @typeParam TableName - A string literal type of the table name (like "users").
47
+ */
48
+ export type Id<TableName extends TableNames | SystemTableNames> =
49
+ GenericId<TableName>;
50
+
51
+ /**
52
+ * A type describing your Convex data model.
53
+ *
54
+ * This type includes information about what tables you have, the type of
55
+ * documents stored in those tables, and the indexes defined on them.
56
+ *
57
+ * This type is used to parameterize methods like `queryGeneric` and
58
+ * `mutationGeneric` to make them type-safe.
59
+ */
60
+ export type DataModel = DataModelFromSchemaDefinition<typeof schema>;