@convex-dev/agent 0.1.10 → 0.1.12
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/dist/esm/client/index.d.ts +2 -0
- package/dist/esm/client/index.d.ts.map +1 -1
- package/dist/esm/client/index.js +35 -26
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/mapping.d.ts +1 -0
- package/dist/esm/mapping.d.ts.map +1 -1
- package/dist/esm/mapping.js +2 -2
- package/dist/esm/mapping.js.map +1 -1
- package/dist/esm/react/useSmoothText.d.ts +7 -1
- package/dist/esm/react/useSmoothText.d.ts.map +1 -1
- package/dist/esm/react/useSmoothText.js +5 -5
- package/dist/esm/react/useSmoothText.js.map +1 -1
- package/dist/esm.tsbuildinfo +1 -1
- package/package.json +24 -53
- package/src/client/index.ts +39 -29
- package/src/mapping.ts +9 -2
- package/src/react/useSmoothText.ts +11 -4
- package/dist/commonjs/client/_generated/_ignore.d.ts +0 -1
- package/dist/commonjs/client/_generated/_ignore.d.ts.map +0 -1
- package/dist/commonjs/client/_generated/_ignore.js +0 -3
- package/dist/commonjs/client/_generated/_ignore.js.map +0 -1
- package/dist/commonjs/client/createTool.d.ts +0 -47
- package/dist/commonjs/client/createTool.d.ts.map +0 -1
- package/dist/commonjs/client/createTool.js +0 -49
- package/dist/commonjs/client/createTool.js.map +0 -1
- package/dist/commonjs/client/files.d.ts +0 -56
- package/dist/commonjs/client/files.d.ts.map +0 -1
- package/dist/commonjs/client/files.js +0 -129
- package/dist/commonjs/client/files.js.map +0 -1
- package/dist/commonjs/client/index.d.ts +0 -1355
- package/dist/commonjs/client/index.d.ts.map +0 -1
- package/dist/commonjs/client/index.js +0 -1169
- package/dist/commonjs/client/index.js.map +0 -1
- package/dist/commonjs/client/streaming.d.ts +0 -57
- package/dist/commonjs/client/streaming.d.ts.map +0 -1
- package/dist/commonjs/client/streaming.js +0 -148
- package/dist/commonjs/client/streaming.js.map +0 -1
- package/dist/commonjs/client/types.d.ts +0 -352
- package/dist/commonjs/client/types.d.ts.map +0 -1
- package/dist/commonjs/client/types.js +0 -3
- package/dist/commonjs/client/types.js.map +0 -1
- package/dist/commonjs/component/_generated/api.d.ts +0 -1938
- package/dist/commonjs/component/_generated/api.d.ts.map +0 -1
- package/dist/commonjs/component/_generated/api.js +0 -25
- package/dist/commonjs/component/_generated/api.js.map +0 -1
- package/dist/commonjs/component/_generated/dataModel.d.ts +0 -60
- package/dist/commonjs/component/_generated/server.d.ts +0 -149
- package/dist/commonjs/component/_generated/server.d.ts.map +0 -1
- package/dist/commonjs/component/_generated/server.js +0 -77
- package/dist/commonjs/component/_generated/server.js.map +0 -1
- package/dist/commonjs/component/apiKeys.d.ts +0 -11
- package/dist/commonjs/component/apiKeys.d.ts.map +0 -1
- package/dist/commonjs/component/apiKeys.js +0 -72
- package/dist/commonjs/component/apiKeys.js.map +0 -1
- package/dist/commonjs/component/convex.config.d.ts +0 -3
- package/dist/commonjs/component/convex.config.d.ts.map +0 -1
- package/dist/commonjs/component/convex.config.js +0 -5
- package/dist/commonjs/component/convex.config.js.map +0 -1
- package/dist/commonjs/component/files.d.ts +0 -90
- package/dist/commonjs/component/files.d.ts.map +0 -1
- package/dist/commonjs/component/files.js +0 -157
- package/dist/commonjs/component/files.js.map +0 -1
- package/dist/commonjs/component/messages.d.ts +0 -1479
- package/dist/commonjs/component/messages.d.ts.map +0 -1
- package/dist/commonjs/component/messages.js +0 -483
- package/dist/commonjs/component/messages.js.map +0 -1
- package/dist/commonjs/component/schema.d.ts +0 -4582
- package/dist/commonjs/component/schema.d.ts.map +0 -1
- package/dist/commonjs/component/schema.js +0 -167
- package/dist/commonjs/component/schema.js.map +0 -1
- package/dist/commonjs/component/streams.d.ts +0 -242
- package/dist/commonjs/component/streams.d.ts.map +0 -1
- package/dist/commonjs/component/streams.js +0 -323
- package/dist/commonjs/component/streams.js.map +0 -1
- package/dist/commonjs/component/threads.d.ts +0 -101
- package/dist/commonjs/component/threads.d.ts.map +0 -1
- package/dist/commonjs/component/threads.js +0 -188
- package/dist/commonjs/component/threads.js.map +0 -1
- package/dist/commonjs/component/users.d.ts +0 -52
- package/dist/commonjs/component/users.d.ts.map +0 -1
- package/dist/commonjs/component/users.js +0 -233
- package/dist/commonjs/component/users.js.map +0 -1
- package/dist/commonjs/component/vector/index.d.ts +0 -61
- package/dist/commonjs/component/vector/index.d.ts.map +0 -1
- package/dist/commonjs/component/vector/index.js +0 -153
- package/dist/commonjs/component/vector/index.js.map +0 -1
- package/dist/commonjs/component/vector/tables.d.ts +0 -58
- package/dist/commonjs/component/vector/tables.d.ts.map +0 -1
- package/dist/commonjs/component/vector/tables.js +0 -62
- package/dist/commonjs/component/vector/tables.js.map +0 -1
- package/dist/commonjs/mapping.d.ts +0 -50
- package/dist/commonjs/mapping.d.ts.map +0 -1
- package/dist/commonjs/mapping.js +0 -272
- package/dist/commonjs/mapping.js.map +0 -1
- package/dist/commonjs/package.json +0 -3
- package/dist/commonjs/react/deltas.d.ts +0 -29
- package/dist/commonjs/react/deltas.d.ts.map +0 -1
- package/dist/commonjs/react/deltas.js +0 -274
- package/dist/commonjs/react/deltas.js.map +0 -1
- package/dist/commonjs/react/index.d.ts +0 -95
- package/dist/commonjs/react/index.d.ts.map +0 -1
- package/dist/commonjs/react/index.js +0 -219
- package/dist/commonjs/react/index.js.map +0 -1
- package/dist/commonjs/react/optimisticallySendMessage.d.ts +0 -8
- package/dist/commonjs/react/optimisticallySendMessage.d.ts.map +0 -1
- package/dist/commonjs/react/optimisticallySendMessage.js +0 -43
- package/dist/commonjs/react/optimisticallySendMessage.js.map +0 -1
- package/dist/commonjs/react/toUIMessages.d.ts +0 -13
- package/dist/commonjs/react/toUIMessages.d.ts.map +0 -1
- package/dist/commonjs/react/toUIMessages.js +0 -149
- package/dist/commonjs/react/toUIMessages.js.map +0 -1
- package/dist/commonjs/react/types.d.ts +0 -26
- package/dist/commonjs/react/types.d.ts.map +0 -1
- package/dist/commonjs/react/types.js +0 -3
- package/dist/commonjs/react/types.js.map +0 -1
- package/dist/commonjs/react/useSmoothText.d.ts +0 -20
- package/dist/commonjs/react/useSmoothText.d.ts.map +0 -1
- package/dist/commonjs/react/useSmoothText.js +0 -54
- package/dist/commonjs/react/useSmoothText.js.map +0 -1
- package/dist/commonjs/shared.d.ts +0 -10
- package/dist/commonjs/shared.d.ts.map +0 -1
- package/dist/commonjs/shared.js +0 -35
- package/dist/commonjs/shared.js.map +0 -1
- package/dist/commonjs/validators.d.ts +0 -5716
- package/dist/commonjs/validators.d.ts.map +0 -1
- package/dist/commonjs/validators.js +0 -319
- package/dist/commonjs/validators.js.map +0 -1
- package/dist/commonjs/vitest.config.d.ts +0 -3
- package/dist/commonjs/vitest.config.d.ts.map +0 -1
- package/dist/commonjs/vitest.config.js +0 -9
- package/dist/commonjs/vitest.config.js.map +0 -1
- package/dist/commonjs.tsbuildinfo +0 -1
- package/dist/esm/vitest.config.d.ts +0 -3
- package/dist/esm/vitest.config.d.ts.map +0 -1
- package/dist/esm/vitest.config.js +0 -7
- package/dist/esm/vitest.config.js.map +0 -1
- package/react/package.json +0 -5
- package/validators/package.json +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/component/_generated/api.js"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,iDAA0B;AAC1B,sDAA+B;AAC/B,oEAA8C"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Generated `api` utility.
|
|
5
|
-
*
|
|
6
|
-
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
7
|
-
*
|
|
8
|
-
* To regenerate, run `npx convex dev`.
|
|
9
|
-
* @module
|
|
10
|
-
*/
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.components = exports.internal = exports.api = void 0;
|
|
13
|
-
const server_1 = require("convex/server");
|
|
14
|
-
/**
|
|
15
|
-
* A utility for referencing Convex functions in your app's API.
|
|
16
|
-
*
|
|
17
|
-
* Usage:
|
|
18
|
-
* ```js
|
|
19
|
-
* const myFunctionReference = api.myModule.myFunction;
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
exports.api = server_1.anyApi;
|
|
23
|
-
exports.internal = server_1.anyApi;
|
|
24
|
-
exports.components = (0, server_1.componentsGeneric)();
|
|
25
|
-
//# sourceMappingURL=api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../src/component/_generated/api.js"],"names":[],"mappings":";AAAA,oBAAoB;AACpB;;;;;;;GAOG;;;AAEH,0CAA0D;AAE1D;;;;;;;GAOG;AACU,QAAA,GAAG,GAAG,eAAM,CAAC;AACb,QAAA,QAAQ,GAAG,eAAM,CAAC;AAClB,QAAA,UAAU,GAAG,IAAA,0BAAiB,GAAE,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
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(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>;
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/**
|
|
3
|
-
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
4
|
-
*
|
|
5
|
-
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
-
*
|
|
7
|
-
* To regenerate, run `npx convex dev`.
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
ActionBuilder,
|
|
13
|
-
AnyComponents,
|
|
14
|
-
HttpActionBuilder,
|
|
15
|
-
MutationBuilder,
|
|
16
|
-
QueryBuilder,
|
|
17
|
-
GenericActionCtx,
|
|
18
|
-
GenericMutationCtx,
|
|
19
|
-
GenericQueryCtx,
|
|
20
|
-
GenericDatabaseReader,
|
|
21
|
-
GenericDatabaseWriter,
|
|
22
|
-
FunctionReference,
|
|
23
|
-
} from "convex/server";
|
|
24
|
-
import type { DataModel } from "./dataModel.js";
|
|
25
|
-
|
|
26
|
-
type GenericCtx =
|
|
27
|
-
| GenericActionCtx<DataModel>
|
|
28
|
-
| GenericMutationCtx<DataModel>
|
|
29
|
-
| GenericQueryCtx<DataModel>;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Define a query in this Convex app's public API.
|
|
33
|
-
*
|
|
34
|
-
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
35
|
-
*
|
|
36
|
-
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
37
|
-
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
38
|
-
*/
|
|
39
|
-
export declare const query: QueryBuilder<DataModel, "public">;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
43
|
-
*
|
|
44
|
-
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
45
|
-
*
|
|
46
|
-
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
47
|
-
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
48
|
-
*/
|
|
49
|
-
export declare const internalQuery: QueryBuilder<DataModel, "internal">;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Define a mutation in this Convex app's public API.
|
|
53
|
-
*
|
|
54
|
-
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
55
|
-
*
|
|
56
|
-
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
57
|
-
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
58
|
-
*/
|
|
59
|
-
export declare const mutation: MutationBuilder<DataModel, "public">;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
63
|
-
*
|
|
64
|
-
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
65
|
-
*
|
|
66
|
-
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
67
|
-
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
68
|
-
*/
|
|
69
|
-
export declare const internalMutation: MutationBuilder<DataModel, "internal">;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Define an action in this Convex app's public API.
|
|
73
|
-
*
|
|
74
|
-
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
75
|
-
* code and code with side-effects, like calling third-party services.
|
|
76
|
-
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
77
|
-
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
78
|
-
*
|
|
79
|
-
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
80
|
-
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
81
|
-
*/
|
|
82
|
-
export declare const action: ActionBuilder<DataModel, "public">;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
86
|
-
*
|
|
87
|
-
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
88
|
-
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
89
|
-
*/
|
|
90
|
-
export declare const internalAction: ActionBuilder<DataModel, "internal">;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Define an HTTP action.
|
|
94
|
-
*
|
|
95
|
-
* This function will be used to respond to HTTP requests received by a Convex
|
|
96
|
-
* deployment if the requests matches the path and method where this action
|
|
97
|
-
* is routed. Be sure to route your action in `convex/http.js`.
|
|
98
|
-
*
|
|
99
|
-
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
100
|
-
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
101
|
-
*/
|
|
102
|
-
export declare const httpAction: HttpActionBuilder;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* A set of services for use within Convex query functions.
|
|
106
|
-
*
|
|
107
|
-
* The query context is passed as the first argument to any Convex query
|
|
108
|
-
* function run on the server.
|
|
109
|
-
*
|
|
110
|
-
* This differs from the {@link MutationCtx} because all of the services are
|
|
111
|
-
* read-only.
|
|
112
|
-
*/
|
|
113
|
-
export type QueryCtx = GenericQueryCtx<DataModel>;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* A set of services for use within Convex mutation functions.
|
|
117
|
-
*
|
|
118
|
-
* The mutation context is passed as the first argument to any Convex mutation
|
|
119
|
-
* function run on the server.
|
|
120
|
-
*/
|
|
121
|
-
export type MutationCtx = GenericMutationCtx<DataModel>;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* A set of services for use within Convex action functions.
|
|
125
|
-
*
|
|
126
|
-
* The action context is passed as the first argument to any Convex action
|
|
127
|
-
* function run on the server.
|
|
128
|
-
*/
|
|
129
|
-
export type ActionCtx = GenericActionCtx<DataModel>;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* An interface to read from the database within Convex query functions.
|
|
133
|
-
*
|
|
134
|
-
* The two entry points are {@link DatabaseReader.get}, which fetches a single
|
|
135
|
-
* document by its {@link Id}, or {@link DatabaseReader.query}, which starts
|
|
136
|
-
* building a query.
|
|
137
|
-
*/
|
|
138
|
-
export type DatabaseReader = GenericDatabaseReader<DataModel>;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* An interface to read from and write to the database within Convex mutation
|
|
142
|
-
* functions.
|
|
143
|
-
*
|
|
144
|
-
* Convex guarantees that all writes within a single mutation are
|
|
145
|
-
* executed atomically, so you never have to worry about partial writes leaving
|
|
146
|
-
* your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
|
|
147
|
-
* for the guarantees Convex provides your functions.
|
|
148
|
-
*/
|
|
149
|
-
export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/component/_generated/server.js"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH,wEAAkC;AAElC;;;;;;;GAOG;AACH,kFAAkD;AAElD;;;;;;;GAOG;AACH,8EAAwC;AAExC;;;;;;;GAOG;AACH,wFAAwD;AAExD;;;;;;;;;;GAUG;AACH,0EAAoC;AAEpC;;;;;GAKG;AACH,oFAAoD;AAEpD;;;;;;GAMG;AACH,8MAA4C"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
5
|
-
*
|
|
6
|
-
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
7
|
-
*
|
|
8
|
-
* To regenerate, run `npx convex dev`.
|
|
9
|
-
* @module
|
|
10
|
-
*/
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.httpAction = exports.internalAction = exports.action = exports.internalMutation = exports.mutation = exports.internalQuery = exports.query = void 0;
|
|
13
|
-
const server_1 = require("convex/server");
|
|
14
|
-
/**
|
|
15
|
-
* Define a query in this Convex app's public API.
|
|
16
|
-
*
|
|
17
|
-
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
18
|
-
*
|
|
19
|
-
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
20
|
-
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
21
|
-
*/
|
|
22
|
-
exports.query = server_1.queryGeneric;
|
|
23
|
-
/**
|
|
24
|
-
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
25
|
-
*
|
|
26
|
-
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
27
|
-
*
|
|
28
|
-
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
29
|
-
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
30
|
-
*/
|
|
31
|
-
exports.internalQuery = server_1.internalQueryGeneric;
|
|
32
|
-
/**
|
|
33
|
-
* Define a mutation in this Convex app's public API.
|
|
34
|
-
*
|
|
35
|
-
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
36
|
-
*
|
|
37
|
-
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
38
|
-
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
39
|
-
*/
|
|
40
|
-
exports.mutation = server_1.mutationGeneric;
|
|
41
|
-
/**
|
|
42
|
-
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
43
|
-
*
|
|
44
|
-
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
45
|
-
*
|
|
46
|
-
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
47
|
-
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
48
|
-
*/
|
|
49
|
-
exports.internalMutation = server_1.internalMutationGeneric;
|
|
50
|
-
/**
|
|
51
|
-
* Define an action in this Convex app's public API.
|
|
52
|
-
*
|
|
53
|
-
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
54
|
-
* code and code with side-effects, like calling third-party services.
|
|
55
|
-
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
56
|
-
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
57
|
-
*
|
|
58
|
-
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
59
|
-
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
60
|
-
*/
|
|
61
|
-
exports.action = server_1.actionGeneric;
|
|
62
|
-
/**
|
|
63
|
-
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
64
|
-
*
|
|
65
|
-
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
66
|
-
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
67
|
-
*/
|
|
68
|
-
exports.internalAction = server_1.internalActionGeneric;
|
|
69
|
-
/**
|
|
70
|
-
* Define a Convex HTTP action.
|
|
71
|
-
*
|
|
72
|
-
* @param func - The function. It receives an {@link ActionCtx} as its first argument, and a `Request` object
|
|
73
|
-
* as its second.
|
|
74
|
-
* @returns The wrapped endpoint function. Route a URL path to this function in `convex/http.js`.
|
|
75
|
-
*/
|
|
76
|
-
exports.httpAction = server_1.httpActionGeneric;
|
|
77
|
-
//# sourceMappingURL=server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../src/component/_generated/server.js"],"names":[],"mappings":";AAAA,oBAAoB;AACpB;;;;;;;GAOG;;;AAEH,0CASuB;AAEvB;;;;;;;GAOG;AACU,QAAA,KAAK,GAAG,qBAAY,CAAC;AAElC;;;;;;;GAOG;AACU,QAAA,aAAa,GAAG,6BAAoB,CAAC;AAElD;;;;;;;GAOG;AACU,QAAA,QAAQ,GAAG,wBAAe,CAAC;AAExC;;;;;;;GAOG;AACU,QAAA,gBAAgB,GAAG,gCAAuB,CAAC;AAExD;;;;;;;;;;GAUG;AACU,QAAA,MAAM,GAAG,sBAAa,CAAC;AAEpC;;;;;GAKG;AACU,QAAA,cAAc,GAAG,8BAAqB,CAAC;AAEpD;;;;;;GAMG;AACU,QAAA,UAAU,GAAG,0BAAiB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const issue: import("convex/server").RegisteredMutation<"public", {
|
|
2
|
-
name?: string | undefined;
|
|
3
|
-
}, Promise<import("convex/values").GenericId<"apiKeys">>>;
|
|
4
|
-
export declare const validate: import("convex/server").RegisteredQuery<"public", {
|
|
5
|
-
apiKey: import("convex/values").GenericId<"apiKeys">;
|
|
6
|
-
}, Promise<boolean>>;
|
|
7
|
-
export declare const destroy: import("convex/server").RegisteredMutation<"public", {
|
|
8
|
-
name?: string | undefined;
|
|
9
|
-
apiKey?: import("convex/values").GenericId<"apiKeys"> | undefined;
|
|
10
|
-
}, Promise<"missing" | "deleted" | "name mismatch" | "must provide either apiKey or name">>;
|
|
11
|
-
//# sourceMappingURL=apiKeys.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apiKeys.d.ts","sourceRoot":"","sources":["../../../src/component/apiKeys.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;yDAmBhB,CAAC;AAEH,eAAO,MAAM,QAAQ;;oBAYnB,CAAC;AAEH,eAAO,MAAM,OAAO;;;2FAmClB,CAAC"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.destroy = exports.validate = exports.issue = void 0;
|
|
4
|
-
const values_1 = require("convex/values");
|
|
5
|
-
const server_js_1 = require("./_generated/server.js");
|
|
6
|
-
exports.issue = (0, server_js_1.mutation)({
|
|
7
|
-
args: {
|
|
8
|
-
name: values_1.v.optional(values_1.v.string()),
|
|
9
|
-
},
|
|
10
|
-
handler: async (ctx, args) => {
|
|
11
|
-
if (args.name) {
|
|
12
|
-
const existingApiKey = await ctx.db
|
|
13
|
-
.query("apiKeys")
|
|
14
|
-
.withIndex("name", (q) => q.eq("name", args.name))
|
|
15
|
-
.first();
|
|
16
|
-
if (existingApiKey) {
|
|
17
|
-
console.warn(`API key ${args.name} already exists, deleting...`);
|
|
18
|
-
await ctx.db.delete(existingApiKey._id);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const apiKey = await ctx.db.insert("apiKeys", args);
|
|
22
|
-
return apiKey;
|
|
23
|
-
},
|
|
24
|
-
returns: values_1.v.id("apiKeys"),
|
|
25
|
-
});
|
|
26
|
-
exports.validate = (0, server_js_1.query)({
|
|
27
|
-
args: {
|
|
28
|
-
apiKey: values_1.v.id("apiKeys"),
|
|
29
|
-
},
|
|
30
|
-
handler: async (ctx, args) => {
|
|
31
|
-
const apiKey = await ctx.db.get(args.apiKey);
|
|
32
|
-
if (!apiKey) {
|
|
33
|
-
throw new Error("Invalid API key");
|
|
34
|
-
}
|
|
35
|
-
return true;
|
|
36
|
-
},
|
|
37
|
-
returns: values_1.v.boolean(),
|
|
38
|
-
});
|
|
39
|
-
exports.destroy = (0, server_js_1.mutation)({
|
|
40
|
-
args: values_1.v.object({
|
|
41
|
-
apiKey: values_1.v.optional(values_1.v.id("apiKeys")),
|
|
42
|
-
name: values_1.v.optional(values_1.v.string()),
|
|
43
|
-
}),
|
|
44
|
-
handler: async (ctx, args) => {
|
|
45
|
-
if (args.apiKey) {
|
|
46
|
-
const apiKey = await ctx.db.get(args.apiKey);
|
|
47
|
-
if (!apiKey) {
|
|
48
|
-
return "missing";
|
|
49
|
-
}
|
|
50
|
-
if (apiKey.name !== args.name) {
|
|
51
|
-
return "name mismatch";
|
|
52
|
-
}
|
|
53
|
-
await ctx.db.delete(args.apiKey);
|
|
54
|
-
}
|
|
55
|
-
else if (args.name) {
|
|
56
|
-
const apiKey = await ctx.db
|
|
57
|
-
.query("apiKeys")
|
|
58
|
-
.withIndex("name", (q) => q.eq("name", args.name))
|
|
59
|
-
.first();
|
|
60
|
-
if (!apiKey) {
|
|
61
|
-
return "missing";
|
|
62
|
-
}
|
|
63
|
-
await ctx.db.delete(apiKey._id);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
return "must provide either apiKey or name";
|
|
67
|
-
}
|
|
68
|
-
return "deleted";
|
|
69
|
-
},
|
|
70
|
-
returns: values_1.v.union(values_1.v.literal("missing"), values_1.v.literal("deleted"), values_1.v.literal("name mismatch"), values_1.v.literal("must provide either apiKey or name")),
|
|
71
|
-
});
|
|
72
|
-
//# sourceMapp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I,CAAC,IAAI,CAAC,CAAC;iBACjD,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,OAAO,oCAAoC,CAAC;QAC9C,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,EAAE,UAAC,CAAC,KAAK,CACd,UAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EACpB,UAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EACpB,UAAC,CAAC,OAAO,CAAC,eAAe,CAAC,EAC1B,UAAC,CAAC,OAAO,CAAC,oCAAoC,CAAC,CAChD;CACF,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../../src/component/convex.config.ts"],"names":[],"mappings":";AAEA,wBAAwC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convex.config.js","sourceRoot":"","sources":["../../../src/component/convex.config.ts"],"names":[],"mappings":";;AAAA,0CAAgD;AAEhD,kBAAe,IAAA,wBAAe,EAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { Id } from "./_generated/dataModel.js";
|
|
2
|
-
import { type MutationCtx } from "./_generated/server.js";
|
|
3
|
-
import type { Infer } from "convex/values";
|
|
4
|
-
declare const addFileArgs: import("convex/values").VObject<{
|
|
5
|
-
filename?: string | undefined;
|
|
6
|
-
mimeType: string;
|
|
7
|
-
storageId: string;
|
|
8
|
-
hash: string;
|
|
9
|
-
}, {
|
|
10
|
-
storageId: import("convex/values").VString<string, "required">;
|
|
11
|
-
hash: import("convex/values").VString<string, "required">;
|
|
12
|
-
filename: import("convex/values").VString<string | undefined, "optional">;
|
|
13
|
-
mimeType: import("convex/values").VString<string, "required">;
|
|
14
|
-
}, "required", "mimeType" | "filename" | "storageId" | "hash">;
|
|
15
|
-
export declare const addFile: import("convex/server").RegisteredMutation<"public", {
|
|
16
|
-
filename?: string | undefined;
|
|
17
|
-
mimeType: string;
|
|
18
|
-
storageId: string;
|
|
19
|
-
hash: string;
|
|
20
|
-
}, Promise<{
|
|
21
|
-
fileId: import("convex/values").GenericId<"files">;
|
|
22
|
-
storageId: string;
|
|
23
|
-
}>>;
|
|
24
|
-
export declare function addFileHandler(ctx: MutationCtx, args: Infer<typeof addFileArgs>): Promise<{
|
|
25
|
-
fileId: import("convex/values").GenericId<"files">;
|
|
26
|
-
storageId: string;
|
|
27
|
-
}>;
|
|
28
|
-
export declare const get: import("convex/server").RegisteredQuery<"public", {
|
|
29
|
-
fileId: import("convex/values").GenericId<"files">;
|
|
30
|
-
}, Promise<{
|
|
31
|
-
_id: import("convex/values").GenericId<"files">;
|
|
32
|
-
_creationTime: number;
|
|
33
|
-
filename?: string | undefined;
|
|
34
|
-
mimeType: string;
|
|
35
|
-
storageId: string;
|
|
36
|
-
hash: string;
|
|
37
|
-
refcount: number;
|
|
38
|
-
lastTouchedAt: number;
|
|
39
|
-
} | null>>;
|
|
40
|
-
/**
|
|
41
|
-
* If you plan to have the same file added over and over without a reference to
|
|
42
|
-
* the fileId, you can use this query to get the fileId of the existing file.
|
|
43
|
-
* Note: this will not increment the refcount. only saving messages does that.
|
|
44
|
-
* It will only match if the filename is the same (or both are undefined).
|
|
45
|
-
*/
|
|
46
|
-
export declare const useExistingFile: import("convex/server").RegisteredMutation<"public", {
|
|
47
|
-
filename?: string | undefined;
|
|
48
|
-
hash: string;
|
|
49
|
-
}, Promise<{
|
|
50
|
-
fileId: import("convex/values").GenericId<"files">;
|
|
51
|
-
storageId: string;
|
|
52
|
-
} | null>>;
|
|
53
|
-
export declare const copyFile: import("convex/server").RegisteredMutation<"public", {
|
|
54
|
-
fileId: Id<"files">;
|
|
55
|
-
}, Promise<void>>;
|
|
56
|
-
export declare function copyFileHandler(ctx: MutationCtx, args: {
|
|
57
|
-
fileId: Id<"files">;
|
|
58
|
-
}): Promise<void>;
|
|
59
|
-
/**
|
|
60
|
-
* Get files that are unused and can be deleted.
|
|
61
|
-
* This is useful for cleaning up files that are no longer needed.
|
|
62
|
-
* Note: recently added files that have not been saved yet will show up here.
|
|
63
|
-
* You can inspect the `lastTouchedAt` field to see how recently it was used.
|
|
64
|
-
* I'd recommend not deleting anything touched in the last 24 hours.
|
|
65
|
-
*/
|
|
66
|
-
export declare const getFilesToDelete: import("convex/server").RegisteredQuery<"public", {
|
|
67
|
-
paginationOpts: {
|
|
68
|
-
id?: number | undefined;
|
|
69
|
-
endCursor?: string | null | undefined;
|
|
70
|
-
maximumRowsRead?: number | undefined;
|
|
71
|
-
maximumBytesRead?: number | undefined;
|
|
72
|
-
numItems: number;
|
|
73
|
-
cursor: string | null;
|
|
74
|
-
};
|
|
75
|
-
}, Promise<import("convex/server").PaginationResult<{
|
|
76
|
-
_id: import("convex/values").GenericId<"files">;
|
|
77
|
-
_creationTime: number;
|
|
78
|
-
filename?: string | undefined;
|
|
79
|
-
mimeType: string;
|
|
80
|
-
storageId: string;
|
|
81
|
-
hash: string;
|
|
82
|
-
refcount: number;
|
|
83
|
-
lastTouchedAt: number;
|
|
84
|
-
}>>>;
|
|
85
|
-
export declare const deleteFiles: import("convex/server").RegisteredMutation<"public", {
|
|
86
|
-
force?: boolean | undefined;
|
|
87
|
-
fileIds: import("convex/values").GenericId<"files">[];
|
|
88
|
-
}, Promise<import("convex/values").GenericId<"files">[]>>;
|
|
89
|
-
export {};
|
|
90
|
-
//# sourceMappingURL=files.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/component/files.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAY,KAAK,WAAW,EAAS,MAAM,wBAAwB,CAAC;AAG3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,QAAA,MAAM,WAAW;;;;;;;;;;8DAKf,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;GAOlB,CAAC;AAEH,wBAAsB,cAAc,CAClC,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,KAAK,CAAC,OAAO,WAAW,CAAC;;;GA4BhC;AAED,eAAO,MAAM,GAAG;;;;;;;;;;;UAQd,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;;;UA0B1B,CAAC;AAEH,eAAO,MAAM,QAAQ;YAUH,EAAE,CAAC,OAAO,CAAC;iBAJ3B,CAAC;AAEH,wBAAsB,eAAe,CACnC,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE;IAAE,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,CAAA;CAAE,iBAU9B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;IAgB3B,CAAC;AAEH,eAAO,MAAM,WAAW;;;yDA4BtB,CAAC"}
|