@convex-dev/crons 0.1.9 → 0.2.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.
- package/README.md +18 -16
- package/dist/{commonjs/client → client}/index.d.ts +5 -5
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/utils.d.ts +8 -0
- package/dist/client/utils.d.ts.map +1 -0
- package/dist/client/utils.js +2 -0
- package/dist/{commonjs/client → client}/utils.js.map +1 -1
- package/dist/component/_generated/api.d.ts +34 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/{src → dist}/component/_generated/api.js +11 -7
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +79 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/{src → dist}/component/_generated/server.d.ts +10 -42
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/{commonjs/component → component}/_generated/server.js +9 -7
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/{commonjs/component → component}/convex.config.d.ts +1 -1
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/{commonjs/component → component}/public.d.ts +2 -2
- package/dist/component/public.d.ts.map +1 -0
- package/dist/{commonjs/component → component}/public.js +9 -8
- package/dist/component/public.js.map +1 -0
- package/dist/{commonjs/component → component}/schema.d.ts +2 -2
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/{commonjs/component → component}/schema.js +3 -3
- package/dist/component/schema.js.map +1 -0
- package/package.json +60 -41
- package/src/client/index.ts +10 -10
- package/src/client/utils.ts +0 -32
- package/src/component/_generated/api.ts +50 -0
- package/src/component/_generated/component.ts +79 -0
- package/src/component/_generated/{dataModel.d.ts → dataModel.ts} +1 -5
- package/src/component/_generated/server.ts +156 -0
- package/src/component/public.ts +26 -19
- package/src/component/schema.ts +1 -1
- package/src/test.ts +18 -0
- package/dist/commonjs/client/index.d.ts.map +0 -1
- package/dist/commonjs/client/index.js.map +0 -1
- package/dist/commonjs/client/utils.d.ts +0 -15
- package/dist/commonjs/client/utils.d.ts.map +0 -1
- package/dist/commonjs/client/utils.js +0 -3
- package/dist/commonjs/component/_generated/api.d.ts +0 -12
- package/dist/commonjs/component/_generated/api.d.ts.map +0 -1
- package/dist/commonjs/component/_generated/api.js +0 -24
- package/dist/commonjs/component/_generated/api.js.map +0 -1
- package/dist/commonjs/component/_generated/server.d.ts +0 -64
- package/dist/commonjs/component/_generated/server.d.ts.map +0 -1
- package/dist/commonjs/component/_generated/server.js.map +0 -1
- package/dist/commonjs/component/convex.config.d.ts.map +0 -1
- package/dist/commonjs/component/convex.config.js.map +0 -1
- package/dist/commonjs/component/public.d.ts.map +0 -1
- package/dist/commonjs/component/public.js.map +0 -1
- package/dist/commonjs/component/schema.d.ts.map +0 -1
- package/dist/commonjs/component/schema.js.map +0 -1
- package/dist/commonjs/package.json +0 -3
- package/dist/esm/client/index.d.ts +0 -89
- package/dist/esm/client/index.d.ts.map +0 -1
- package/dist/esm/client/index.js +0 -104
- package/dist/esm/client/index.js.map +0 -1
- package/dist/esm/client/utils.d.ts +0 -15
- package/dist/esm/client/utils.d.ts.map +0 -1
- package/dist/esm/client/utils.js +0 -3
- package/dist/esm/client/utils.js.map +0 -1
- package/dist/esm/component/_generated/api.d.ts +0 -12
- package/dist/esm/component/_generated/api.d.ts.map +0 -1
- package/dist/esm/component/_generated/api.js +0 -24
- package/dist/esm/component/_generated/api.js.map +0 -1
- package/dist/esm/component/_generated/server.d.ts +0 -64
- package/dist/esm/component/_generated/server.d.ts.map +0 -1
- package/dist/esm/component/_generated/server.js +0 -76
- package/dist/esm/component/_generated/server.js.map +0 -1
- package/dist/esm/component/convex.config.d.ts +0 -3
- package/dist/esm/component/convex.config.d.ts.map +0 -1
- package/dist/esm/component/convex.config.js +0 -3
- package/dist/esm/component/convex.config.js.map +0 -1
- package/dist/esm/component/public.d.ts +0 -119
- package/dist/esm/component/public.d.ts.map +0 -1
- package/dist/esm/component/public.js +0 -226
- package/dist/esm/component/public.js.map +0 -1
- package/dist/esm/component/schema.d.ts +0 -49
- package/dist/esm/component/schema.d.ts.map +0 -1
- package/dist/esm/component/schema.js +0 -21
- package/dist/esm/component/schema.js.map +0 -1
- package/dist/esm/package.json +0 -3
- package/src/component/_generated/api.d.ts +0 -98
- package/src/component/_generated/server.js +0 -94
- /package/dist/{commonjs/client → client}/index.js +0 -0
- /package/dist/{commonjs/component → component}/convex.config.js +0 -0
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ const daily = await crons.register(
|
|
|
15
15
|
ctx,
|
|
16
16
|
{ kind: "cron", cronspec: "0 0 * * *" },
|
|
17
17
|
internal.example.logStuff,
|
|
18
|
-
{ message: "daily cron" }
|
|
18
|
+
{ message: "daily cron" },
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
// Register a cron to run every hour.
|
|
@@ -23,7 +23,7 @@ const hourly = await crons.register(
|
|
|
23
23
|
ctx,
|
|
24
24
|
{ kind: "interval", ms: 3600000 },
|
|
25
25
|
internal.example.logStuff,
|
|
26
|
-
{ message: "hourly cron" }
|
|
26
|
+
{ message: "hourly cron" },
|
|
27
27
|
);
|
|
28
28
|
```
|
|
29
29
|
|
|
@@ -44,16 +44,17 @@ format as the unix `cron` command:
|
|
|
44
44
|
|
|
45
45
|
### Design
|
|
46
46
|
|
|
47
|
-
The design of this component is based on the Cronvex demo app that's described
|
|
48
|
-
[this Stack post](https://stack.convex.dev/cron-jobs).
|
|
47
|
+
The design of this component is based on the Cronvex demo app that's described
|
|
48
|
+
in [this Stack post](https://stack.convex.dev/cron-jobs).
|
|
49
49
|
|
|
50
50
|
## Pre-requisite: Convex
|
|
51
51
|
|
|
52
|
-
You'll need an existing Convex project to use the component.
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
You'll need an existing Convex project to use the component. Convex is a hosted
|
|
53
|
+
backend platform, including a database, serverless functions, and a ton more you
|
|
54
|
+
can learn about [here](https://docs.convex.dev/get-started).
|
|
55
55
|
|
|
56
|
-
Run `npm create convex` or follow any of the
|
|
56
|
+
Run `npm create convex` or follow any of the
|
|
57
|
+
[quickstarts](https://docs.convex.dev/home) to set one up.
|
|
57
58
|
|
|
58
59
|
## Installation
|
|
59
60
|
|
|
@@ -63,12 +64,13 @@ Install the component package:
|
|
|
63
64
|
npm install @convex-dev/crons
|
|
64
65
|
```
|
|
65
66
|
|
|
66
|
-
Create a `convex.config.ts` file in your app's `convex/` folder and install the
|
|
67
|
+
Create a `convex.config.ts` file in your app's `convex/` folder and install the
|
|
68
|
+
component by calling `use`:
|
|
67
69
|
|
|
68
70
|
```ts
|
|
69
71
|
// convex/convex.config.ts
|
|
70
72
|
import { defineApp } from "convex/server";
|
|
71
|
-
import crons from "@convex-dev/crons/convex.config";
|
|
73
|
+
import crons from "@convex-dev/crons/convex.config.js";
|
|
72
74
|
|
|
73
75
|
const app = defineApp();
|
|
74
76
|
app.use(crons);
|
|
@@ -122,14 +124,14 @@ export const doSomeStuff = internalMutation({
|
|
|
122
124
|
{ kind: "interval", ms: 3600000 },
|
|
123
125
|
internal.example.logStuff,
|
|
124
126
|
{ message: "Hourly cron test" },
|
|
125
|
-
"hourly-test"
|
|
127
|
+
"hourly-test",
|
|
126
128
|
);
|
|
127
129
|
console.log("Registered new cron job with ID:", namedCronId);
|
|
128
130
|
const unnamedCronId = await crons.register(
|
|
129
131
|
ctx,
|
|
130
132
|
{ kind: "cron", cronspec: "0 * * * *" },
|
|
131
133
|
internal.example.logStuff,
|
|
132
|
-
{ message: "Minutely cron test" }
|
|
134
|
+
{ message: "Minutely cron test" },
|
|
133
135
|
);
|
|
134
136
|
console.log("Registered new cron job with ID:", unnamedCronId);
|
|
135
137
|
|
|
@@ -162,8 +164,8 @@ export const doSomeStuff = internalMutation({
|
|
|
162
164
|
|
|
163
165
|
If you'd like to statically define cronjobs like in the built-in `crons.ts`
|
|
164
166
|
Convex feature you can do so via an init script that idempotently registers a
|
|
165
|
-
cron with a given name. e.g., in an `init.ts` file that gets run on every
|
|
166
|
-
|
|
167
|
+
cron with a given name. e.g., in an `init.ts` file that gets run on every deploy
|
|
168
|
+
via `convex dev --run init`.
|
|
167
169
|
|
|
168
170
|
```ts
|
|
169
171
|
// Register a daily cron job. This could be called from an init script to make
|
|
@@ -178,7 +180,7 @@ export const registerDailyCron = internalMutation({
|
|
|
178
180
|
{
|
|
179
181
|
message: "daily cron",
|
|
180
182
|
},
|
|
181
|
-
"daily"
|
|
183
|
+
"daily",
|
|
182
184
|
);
|
|
183
185
|
}
|
|
184
186
|
},
|
|
@@ -200,7 +202,7 @@ export const selfDeletingCron = internalMutation({
|
|
|
200
202
|
{ kind: "interval", ms: 10000 },
|
|
201
203
|
internal.example.deleteSelf,
|
|
202
204
|
{ name: "self-deleting-cron" },
|
|
203
|
-
"self-deleting-cron"
|
|
205
|
+
"self-deleting-cron",
|
|
204
206
|
);
|
|
205
207
|
|
|
206
208
|
console.log("Registered self-deleting cron job with ID:", cronId);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FunctionArgs, SchedulableFunctionReference } from "convex/server";
|
|
2
|
-
import {
|
|
3
|
-
import { CronInfo, Schedule } from "../component/public.js";
|
|
4
|
-
import { RunMutationCtx, RunQueryCtx
|
|
1
|
+
import { type FunctionArgs, type SchedulableFunctionReference } from "convex/server";
|
|
2
|
+
import type { ComponentApi } from "../component/_generated/component.js";
|
|
3
|
+
import type { CronInfo, Schedule } from "../component/public.js";
|
|
4
|
+
import type { RunMutationCtx, RunQueryCtx } from "./utils.js";
|
|
5
5
|
export type { CronInfo };
|
|
6
6
|
export declare class Crons {
|
|
7
7
|
private component;
|
|
@@ -44,7 +44,7 @@ export declare class Crons {
|
|
|
44
44
|
* }
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
|
-
constructor(component:
|
|
47
|
+
constructor(component: ComponentApi);
|
|
48
48
|
/**
|
|
49
49
|
* Schedule a mutation or action to run on a cron schedule or interval.
|
|
50
50
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,4BAA4B,EAClC,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D,YAAY,EAAE,QAAQ,EAAE,CAAC;AAEzB,qBAAa,KAAK;IAwCJ,OAAO,CAAC,SAAS;IAvC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;gBACiB,SAAS,EAAE,YAAY;IAE3C;;;;;;;;;;;OAWG;IACG,QAAQ,CAAC,CAAC,SAAS,4BAA4B,EACnD,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EACrB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC;IASlB;;;;OAIG;IACG,IAAI,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAUjD;;;;;OAKG;IACG,GAAG,CACP,GAAG,EAAE,WAAW,EAChB,UAAU,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAC5C,OAAO,CAAC,QAAQ,GAAG,IAA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M,IAAI,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;QAC3E,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO;YACL,GAAG,IAAI;YACP,cAAc,EAAE,IAAI,CAAC,cAEpB;SACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CACV,GAAmB,EACnB,UAA6C;QAE7C,OAAO,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;IACpE,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GenericDataModel, GenericMutationCtx, GenericQueryCtx } from "convex/server";
|
|
2
|
+
export type RunQueryCtx = {
|
|
3
|
+
runQuery: GenericQueryCtx<GenericDataModel>["runQuery"];
|
|
4
|
+
};
|
|
5
|
+
export type RunMutationCtx = {
|
|
6
|
+
runMutation: GenericMutationCtx<GenericDataModel>["runMutation"];
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/client/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAChB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC,UAAU,CAAC,CAAC;CACzD,CAAC;AACF,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC,aAAa,CAAC,CAAC;CAClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/client/utils.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 public_ from "../public.js";
|
|
10
|
+
import type { ApiFromModules, FilterApi, FunctionReference } from "convex/server";
|
|
11
|
+
declare const fullApi: ApiFromModules<{
|
|
12
|
+
public: typeof public_;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
16
|
+
*
|
|
17
|
+
* Usage:
|
|
18
|
+
* ```js
|
|
19
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const api: FilterApi<typeof fullApi, FunctionReference<any, "public">>;
|
|
23
|
+
/**
|
|
24
|
+
* A utility for referencing Convex functions in your app's internal API.
|
|
25
|
+
*
|
|
26
|
+
* Usage:
|
|
27
|
+
* ```js
|
|
28
|
+
* const myFunctionReference = internal.myModule.myFunction;
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare const internal: FilterApi<typeof fullApi, FunctionReference<any, "internal">>;
|
|
32
|
+
export declare const components: {};
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,OAAO,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,QAAA,MAAM,OAAO,EAAE,cAAc,CAAC;IAC5B,MAAM,EAAE,OAAO,OAAO,CAAC;CACxB,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,EAAE,CAAC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* prettier-ignore-start */
|
|
2
|
-
|
|
3
1
|
/* eslint-disable */
|
|
4
2
|
/**
|
|
5
3
|
* Generated `api` utility.
|
|
@@ -9,11 +7,10 @@
|
|
|
9
7
|
* To regenerate, run `npx convex dev`.
|
|
10
8
|
* @module
|
|
11
9
|
*/
|
|
12
|
-
|
|
13
10
|
import { anyApi, componentsGeneric } from "convex/server";
|
|
14
|
-
|
|
11
|
+
const fullApi = anyApi;
|
|
15
12
|
/**
|
|
16
|
-
* A utility for referencing Convex functions in your app's API.
|
|
13
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
17
14
|
*
|
|
18
15
|
* Usage:
|
|
19
16
|
* ```js
|
|
@@ -21,7 +18,14 @@ import { anyApi, componentsGeneric } from "convex/server";
|
|
|
21
18
|
* ```
|
|
22
19
|
*/
|
|
23
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
|
+
*/
|
|
24
29
|
export const internal = anyApi;
|
|
25
30
|
export const components = componentsGeneric();
|
|
26
|
-
|
|
27
|
-
/* prettier-ignore-end */
|
|
31
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AASH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,OAAO,GAER,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,EAAmB,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
public: {
|
|
23
|
+
del: FunctionReference<"mutation", "internal", {
|
|
24
|
+
identifier: {
|
|
25
|
+
id: string;
|
|
26
|
+
} | {
|
|
27
|
+
name: string;
|
|
28
|
+
};
|
|
29
|
+
}, null, Name>;
|
|
30
|
+
get: FunctionReference<"query", "internal", {
|
|
31
|
+
identifier: {
|
|
32
|
+
id: string;
|
|
33
|
+
} | {
|
|
34
|
+
name: string;
|
|
35
|
+
};
|
|
36
|
+
}, {
|
|
37
|
+
args: Record<string, any>;
|
|
38
|
+
functionHandle: string;
|
|
39
|
+
id: string;
|
|
40
|
+
name?: string;
|
|
41
|
+
schedule: {
|
|
42
|
+
kind: "interval";
|
|
43
|
+
ms: number;
|
|
44
|
+
} | {
|
|
45
|
+
cronspec: string;
|
|
46
|
+
kind: "cron";
|
|
47
|
+
tz?: string;
|
|
48
|
+
};
|
|
49
|
+
} | null, Name>;
|
|
50
|
+
list: FunctionReference<"query", "internal", {}, Array<{
|
|
51
|
+
args: Record<string, any>;
|
|
52
|
+
functionHandle: string;
|
|
53
|
+
id: string;
|
|
54
|
+
name?: string;
|
|
55
|
+
schedule: {
|
|
56
|
+
kind: "interval";
|
|
57
|
+
ms: number;
|
|
58
|
+
} | {
|
|
59
|
+
cronspec: string;
|
|
60
|
+
kind: "cron";
|
|
61
|
+
tz?: string;
|
|
62
|
+
};
|
|
63
|
+
}>, Name>;
|
|
64
|
+
register: FunctionReference<"mutation", "internal", {
|
|
65
|
+
args: Record<string, any>;
|
|
66
|
+
functionHandle: string;
|
|
67
|
+
name?: string;
|
|
68
|
+
schedule: {
|
|
69
|
+
kind: "interval";
|
|
70
|
+
ms: number;
|
|
71
|
+
} | {
|
|
72
|
+
cronspec: string;
|
|
73
|
+
kind: "cron";
|
|
74
|
+
tz?: string;
|
|
75
|
+
};
|
|
76
|
+
}, string, Name>;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MA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E,GAChC;gBAAE,QAAQ,EAAE,MAAM,CAAC;gBAAC,IAAI,EAAE,MAAM,CAAC;gBAAC,EAAE,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;SACrD,CAAC,EACF,IAAI,CACL,CAAC;QACF,QAAQ,EAAE,iBAAiB,CACzB,UAAU,EACV,UAAU,EACV;YACE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC1B,cAAc,EAAE,MAAM,CAAC;YACvB,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,QAAQ,EACJ;gBAAE,IAAI,EAAE,UAAU,CAAC;gBAAC,EAAE,EAAE,MAAM,CAAA;aAAE,GAChC;gBAAE,QAAQ,EAAE,MAAM,CAAC;gBAAC,IAAI,EAAE,MAAM,CAAC;gBAAC,EAAE,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;SACrD,EACD,MAAM,EACN,IAAI,CACL,CAAC;KACH,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataModel.js","sourceRoot":"","sources":["../../../src/component/_generated/dataModel.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AASH,OAAO,MAAM,MAAM,cAAc,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* prettier-ignore-start */
|
|
2
|
-
|
|
3
|
-
/* eslint-disable */
|
|
4
1
|
/**
|
|
5
2
|
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
6
3
|
*
|
|
@@ -9,27 +6,8 @@
|
|
|
9
6
|
* To regenerate, run `npx convex dev`.
|
|
10
7
|
* @module
|
|
11
8
|
*/
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
ActionBuilder,
|
|
15
|
-
AnyComponents,
|
|
16
|
-
HttpActionBuilder,
|
|
17
|
-
MutationBuilder,
|
|
18
|
-
QueryBuilder,
|
|
19
|
-
GenericActionCtx,
|
|
20
|
-
GenericMutationCtx,
|
|
21
|
-
GenericQueryCtx,
|
|
22
|
-
GenericDatabaseReader,
|
|
23
|
-
GenericDatabaseWriter,
|
|
24
|
-
FunctionReference,
|
|
25
|
-
} from "convex/server";
|
|
9
|
+
import type { ActionBuilder, HttpActionBuilder, MutationBuilder, QueryBuilder, GenericActionCtx, GenericMutationCtx, GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter } from "convex/server";
|
|
26
10
|
import type { DataModel } from "./dataModel.js";
|
|
27
|
-
|
|
28
|
-
type GenericCtx =
|
|
29
|
-
| GenericActionCtx<DataModel>
|
|
30
|
-
| GenericMutationCtx<DataModel>
|
|
31
|
-
| GenericQueryCtx<DataModel>;
|
|
32
|
-
|
|
33
11
|
/**
|
|
34
12
|
* Define a query in this Convex app's public API.
|
|
35
13
|
*
|
|
@@ -39,7 +17,6 @@ type GenericCtx =
|
|
|
39
17
|
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
40
18
|
*/
|
|
41
19
|
export declare const query: QueryBuilder<DataModel, "public">;
|
|
42
|
-
|
|
43
20
|
/**
|
|
44
21
|
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
45
22
|
*
|
|
@@ -49,7 +26,6 @@ export declare const query: QueryBuilder<DataModel, "public">;
|
|
|
49
26
|
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
50
27
|
*/
|
|
51
28
|
export declare const internalQuery: QueryBuilder<DataModel, "internal">;
|
|
52
|
-
|
|
53
29
|
/**
|
|
54
30
|
* Define a mutation in this Convex app's public API.
|
|
55
31
|
*
|
|
@@ -59,7 +35,6 @@ export declare const internalQuery: QueryBuilder<DataModel, "internal">;
|
|
|
59
35
|
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
60
36
|
*/
|
|
61
37
|
export declare const mutation: MutationBuilder<DataModel, "public">;
|
|
62
|
-
|
|
63
38
|
/**
|
|
64
39
|
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
65
40
|
*
|
|
@@ -69,7 +44,6 @@ export declare const mutation: MutationBuilder<DataModel, "public">;
|
|
|
69
44
|
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
70
45
|
*/
|
|
71
46
|
export declare const internalMutation: MutationBuilder<DataModel, "internal">;
|
|
72
|
-
|
|
73
47
|
/**
|
|
74
48
|
* Define an action in this Convex app's public API.
|
|
75
49
|
*
|
|
@@ -82,7 +56,6 @@ export declare const internalMutation: MutationBuilder<DataModel, "internal">;
|
|
|
82
56
|
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
83
57
|
*/
|
|
84
58
|
export declare const action: ActionBuilder<DataModel, "public">;
|
|
85
|
-
|
|
86
59
|
/**
|
|
87
60
|
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
88
61
|
*
|
|
@@ -90,38 +63,36 @@ export declare const action: ActionBuilder<DataModel, "public">;
|
|
|
90
63
|
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
91
64
|
*/
|
|
92
65
|
export declare const internalAction: ActionBuilder<DataModel, "internal">;
|
|
93
|
-
|
|
94
66
|
/**
|
|
95
67
|
* Define an HTTP action.
|
|
96
68
|
*
|
|
97
|
-
*
|
|
98
|
-
* deployment if the requests matches the path and method where
|
|
99
|
-
* is routed. Be sure to route your
|
|
69
|
+
* The wrapped function will be used to respond to HTTP requests received
|
|
70
|
+
* by a Convex deployment if the requests matches the path and method where
|
|
71
|
+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
100
72
|
*
|
|
101
|
-
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
73
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
74
|
+
* and a Fetch API `Request` object as its second.
|
|
102
75
|
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
103
76
|
*/
|
|
104
77
|
export declare const httpAction: HttpActionBuilder;
|
|
105
|
-
|
|
106
78
|
/**
|
|
107
79
|
* A set of services for use within Convex query functions.
|
|
108
80
|
*
|
|
109
81
|
* The query context is passed as the first argument to any Convex query
|
|
110
82
|
* function run on the server.
|
|
111
83
|
*
|
|
112
|
-
*
|
|
113
|
-
* read-only.
|
|
84
|
+
* If you're using code generation, use the `QueryCtx` type in `convex/_generated/server.d.ts` instead.
|
|
114
85
|
*/
|
|
115
86
|
export type QueryCtx = GenericQueryCtx<DataModel>;
|
|
116
|
-
|
|
117
87
|
/**
|
|
118
88
|
* A set of services for use within Convex mutation functions.
|
|
119
89
|
*
|
|
120
90
|
* The mutation context is passed as the first argument to any Convex mutation
|
|
121
91
|
* function run on the server.
|
|
92
|
+
*
|
|
93
|
+
* If you're using code generation, use the `MutationCtx` type in `convex/_generated/server.d.ts` instead.
|
|
122
94
|
*/
|
|
123
95
|
export type MutationCtx = GenericMutationCtx<DataModel>;
|
|
124
|
-
|
|
125
96
|
/**
|
|
126
97
|
* A set of services for use within Convex action functions.
|
|
127
98
|
*
|
|
@@ -129,7 +100,6 @@ export type MutationCtx = GenericMutationCtx<DataModel>;
|
|
|
129
100
|
* function run on the server.
|
|
130
101
|
*/
|
|
131
102
|
export type ActionCtx = GenericActionCtx<DataModel>;
|
|
132
|
-
|
|
133
103
|
/**
|
|
134
104
|
* An interface to read from the database within Convex query functions.
|
|
135
105
|
*
|
|
@@ -138,7 +108,6 @@ export type ActionCtx = GenericActionCtx<DataModel>;
|
|
|
138
108
|
* building a query.
|
|
139
109
|
*/
|
|
140
110
|
export type DatabaseReader = GenericDatabaseReader<DataModel>;
|
|
141
|
-
|
|
142
111
|
/**
|
|
143
112
|
* An interface to read from and write to the database within Convex mutation
|
|
144
113
|
* functions.
|
|
@@ -149,5 +118,4 @@ export type DatabaseReader = GenericDatabaseReader<DataModel>;
|
|
|
149
118
|
* for the guarantees Convex provides your functions.
|
|
150
119
|
*/
|
|
151
120
|
export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
|
|
152
|
-
|
|
153
|
-
/* prettier-ignore-end */
|
|
121
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,qBAA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3
|
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
@@ -8,7 +7,7 @@
|
|
|
8
7
|
* To regenerate, run `npx convex dev`.
|
|
9
8
|
* @module
|
|
10
9
|
*/
|
|
11
|
-
import { actionGeneric, httpActionGeneric, queryGeneric, mutationGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric,
|
|
10
|
+
import { actionGeneric, httpActionGeneric, queryGeneric, mutationGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, } from "convex/server";
|
|
12
11
|
/**
|
|
13
12
|
* Define a query in this Convex app's public API.
|
|
14
13
|
*
|
|
@@ -65,12 +64,15 @@ export const action = actionGeneric;
|
|
|
65
64
|
*/
|
|
66
65
|
export const internalAction = internalActionGeneric;
|
|
67
66
|
/**
|
|
68
|
-
* Define
|
|
67
|
+
* Define an HTTP action.
|
|
69
68
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
69
|
+
* The wrapped function will be used to respond to HTTP requests received
|
|
70
|
+
* by a Convex deployment if the requests matches the path and method where
|
|
71
|
+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
72
|
+
*
|
|
73
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
74
|
+
* and a Fetch API `Request` object as its second.
|
|
75
|
+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
73
76
|
*/
|
|
74
77
|
export const httpAction = httpActionGeneric;
|
|
75
|
-
/* prettier-ignore-end */
|
|
76
78
|
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAaH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAGvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAsC,YAAY,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GACxB,oBAAoB,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAyC,eAAe,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,uBAAuB,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAuC,aAAa,CAAC;AAExE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GACzB,qBAAqB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAsB,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":";AAEA,wBAAwC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convex.config.js","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,eAAe,eAAe,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionHandle } from "convex/server";
|
|
1
|
+
import type { FunctionHandle } from "convex/server";
|
|
2
2
|
export type Schedule = {
|
|
3
3
|
/** A schedule using a cron specification string. */
|
|
4
4
|
kind: "cron";
|
|
@@ -45,8 +45,8 @@ export type CronInfo = {
|
|
|
45
45
|
*/
|
|
46
46
|
export declare const register: import("convex/server").RegisteredMutation<"public", {
|
|
47
47
|
name?: string | undefined;
|
|
48
|
-
functionHandle: string;
|
|
49
48
|
args: Record<string, any>;
|
|
49
|
+
functionHandle: string;
|
|
50
50
|
schedule: {
|
|
51
51
|
kind: "interval";
|
|
52
52
|
ms: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/component/public.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAcpD,MAAM,MAAM,QAAQ,GAChB;IACE,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;;;;;;OAaG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,GACD;IACE,oDAAoD;IACpD,IAAI,EAAE,UAAU,CAAC;IACjB,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAGN,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,cAAc,CAAC,UAAU,GAAG,QAAQ,CAAC,CAAC;IACtD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AASF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;uDAiCnB,CAAC;AA0CH;;;;GAIG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;KAaf,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;UAyBd,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,GAAG;;;;;;iBAoCd,CAAC;AASH,eAAO,MAAM,WAAW;;iBAmEtB,CAAC"}
|