@vllnt/convex-analytics 0.1.0-canary.e8e8f2b → 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/LICENSE +21 -0
- package/README.md +198 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/api.d.ts +30 -6
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js +21 -2
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +181 -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 +33 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -1
- package/dist/component/_generated/dataModel.js +3 -0
- package/dist/component/_generated/dataModel.js.map +1 -1
- package/dist/component/_generated/server.d.ts +113 -0
- package/dist/component/_generated/server.d.ts.map +1 -1
- package/dist/component/_generated/server.js +65 -0
- package/dist/component/_generated/server.js.map +1 -1
- package/dist/component/convex.config.d.ts +1 -1
- package/dist/component/convex.config.d.ts.map +1 -1
- package/dist/component/crons.d.ts +3 -0
- package/dist/component/crons.d.ts.map +1 -0
- package/dist/component/crons.js +7 -0
- package/dist/component/crons.js.map +1 -0
- package/dist/component/http.d.ts.map +1 -1
- package/dist/component/internal_mutations.d.ts +5 -2
- package/dist/component/internal_mutations.d.ts.map +1 -1
- package/dist/component/internal_mutations.js +72 -42
- package/dist/component/internal_mutations.js.map +1 -1
- package/dist/component/mutations.d.ts +11 -11
- package/dist/component/mutations.d.ts.map +1 -1
- package/dist/component/mutations.js +24 -9
- package/dist/component/mutations.js.map +1 -1
- package/dist/component/queries.d.ts +21 -21
- package/dist/component/queries.d.ts.map +1 -1
- package/dist/component/queries.js +20 -20
- package/dist/component/queries.js.map +1 -1
- package/dist/component/schema.d.ts +35 -26
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +6 -1
- package/dist/component/schema.js.map +1 -1
- package/dist/component/validators.d.ts +40 -40
- package/dist/shared.d.ts +2 -0
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +4 -0
- package/dist/shared.js.map +1 -1
- package/dist/test.d.ts +35 -26
- package/dist/test.d.ts.map +1 -1
- package/dist/test.js.map +1 -1
- package/dist/web/index.d.ts.map +1 -1
- package/package.json +25 -20
- package/src/component/_generated/api.ts +36 -9
- package/src/component/_generated/component.ts +196 -0
- package/src/component/_generated/dataModel.ts +36 -0
- package/src/component/_generated/server.ts +130 -3
- package/src/component/crons.ts +19 -0
- package/src/component/internal_mutations.ts +102 -55
- package/src/component/mutations.ts +26 -9
- package/src/component/queries.ts +22 -20
- package/src/component/schema.ts +7 -1
- package/src/shared.ts +5 -0
|
@@ -1,20 +1,133 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
3
|
+
*
|
|
3
4
|
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
+
*
|
|
6
|
+
* To regenerate, run `npx convex dev`.
|
|
4
7
|
* @module
|
|
5
8
|
*/
|
|
6
9
|
import type { ActionBuilder, HttpActionBuilder, MutationBuilder, QueryBuilder, GenericActionCtx, GenericMutationCtx, GenericQueryCtx, GenericDatabaseReader, GenericDatabaseWriter } from "convex/server";
|
|
7
10
|
import type { DataModel } from "./dataModel.js";
|
|
11
|
+
/**
|
|
12
|
+
* Typesafe environment variables.
|
|
13
|
+
*
|
|
14
|
+
* This includes platform-provided env vars and any variables declared in
|
|
15
|
+
* `convex.config.ts`.
|
|
16
|
+
*/
|
|
17
|
+
type Env = {
|
|
18
|
+
readonly CONVEX_CLOUD_URL: string;
|
|
19
|
+
readonly CONVEX_SITE_URL: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Define a query in this Convex app's public API.
|
|
23
|
+
*
|
|
24
|
+
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
25
|
+
*
|
|
26
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
27
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
28
|
+
*/
|
|
8
29
|
export declare const query: QueryBuilder<DataModel, "public">;
|
|
30
|
+
/**
|
|
31
|
+
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
32
|
+
*
|
|
33
|
+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
34
|
+
*
|
|
35
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
36
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
37
|
+
*/
|
|
9
38
|
export declare const internalQuery: QueryBuilder<DataModel, "internal">;
|
|
39
|
+
/**
|
|
40
|
+
* Define a mutation in this Convex app's public API.
|
|
41
|
+
*
|
|
42
|
+
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
43
|
+
*
|
|
44
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
45
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
46
|
+
*/
|
|
10
47
|
export declare const mutation: MutationBuilder<DataModel, "public">;
|
|
48
|
+
/**
|
|
49
|
+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
50
|
+
*
|
|
51
|
+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
52
|
+
*
|
|
53
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
54
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
55
|
+
*/
|
|
11
56
|
export declare const internalMutation: MutationBuilder<DataModel, "internal">;
|
|
57
|
+
/**
|
|
58
|
+
* Define an action in this Convex app's public API.
|
|
59
|
+
*
|
|
60
|
+
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
61
|
+
* code and code with side-effects, like calling third-party services.
|
|
62
|
+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
63
|
+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
64
|
+
*
|
|
65
|
+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
66
|
+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
67
|
+
*/
|
|
12
68
|
export declare const action: ActionBuilder<DataModel, "public">;
|
|
69
|
+
/**
|
|
70
|
+
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
71
|
+
*
|
|
72
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
73
|
+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
74
|
+
*/
|
|
13
75
|
export declare const internalAction: ActionBuilder<DataModel, "internal">;
|
|
76
|
+
/**
|
|
77
|
+
* Define an HTTP action.
|
|
78
|
+
*
|
|
79
|
+
* The wrapped function will be used to respond to HTTP requests received
|
|
80
|
+
* by a Convex deployment if the requests matches the path and method where
|
|
81
|
+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
82
|
+
*
|
|
83
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
84
|
+
* and a Fetch API `Request` object as its second.
|
|
85
|
+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
86
|
+
*/
|
|
14
87
|
export declare const httpAction: HttpActionBuilder;
|
|
88
|
+
export declare const env: Env;
|
|
89
|
+
/**
|
|
90
|
+
* A set of services for use within Convex query functions.
|
|
91
|
+
*
|
|
92
|
+
* The query context is passed as the first argument to any Convex query
|
|
93
|
+
* function run on the server.
|
|
94
|
+
*
|
|
95
|
+
* If you're using code generation, use the `QueryCtx` type in `convex/_generated/server.d.ts` instead.
|
|
96
|
+
*/
|
|
15
97
|
export type QueryCtx = GenericQueryCtx<DataModel>;
|
|
98
|
+
/**
|
|
99
|
+
* A set of services for use within Convex mutation functions.
|
|
100
|
+
*
|
|
101
|
+
* The mutation context is passed as the first argument to any Convex mutation
|
|
102
|
+
* function run on the server.
|
|
103
|
+
*
|
|
104
|
+
* If you're using code generation, use the `MutationCtx` type in `convex/_generated/server.d.ts` instead.
|
|
105
|
+
*/
|
|
16
106
|
export type MutationCtx = GenericMutationCtx<DataModel>;
|
|
107
|
+
/**
|
|
108
|
+
* A set of services for use within Convex action functions.
|
|
109
|
+
*
|
|
110
|
+
* The action context is passed as the first argument to any Convex action
|
|
111
|
+
* function run on the server.
|
|
112
|
+
*/
|
|
17
113
|
export type ActionCtx = GenericActionCtx<DataModel>;
|
|
114
|
+
/**
|
|
115
|
+
* An interface to read from the database within Convex query functions.
|
|
116
|
+
*
|
|
117
|
+
* The two entry points are {@link DatabaseReader.get}, which fetches a single
|
|
118
|
+
* document by its {@link Id}, or {@link DatabaseReader.query}, which starts
|
|
119
|
+
* building a query.
|
|
120
|
+
*/
|
|
18
121
|
export type DatabaseReader = GenericDatabaseReader<DataModel>;
|
|
122
|
+
/**
|
|
123
|
+
* An interface to read from and write to the database within Convex mutation
|
|
124
|
+
* functions.
|
|
125
|
+
*
|
|
126
|
+
* Convex guarantees that all writes within a single mutation are
|
|
127
|
+
* executed atomically, so you never have to worry about partial writes leaving
|
|
128
|
+
* your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
|
|
129
|
+
* for the guarantees Convex provides your functions.
|
|
130
|
+
*/
|
|
19
131
|
export type DatabaseWriter = GenericDatabaseWriter<DataModel>;
|
|
132
|
+
export {};
|
|
20
133
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AACA
|
|
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,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,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1,15 +1,80 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
/**
|
|
3
3
|
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
4
|
+
*
|
|
4
5
|
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
5
8
|
* @module
|
|
6
9
|
*/
|
|
7
10
|
import { actionGeneric, httpActionGeneric, queryGeneric, mutationGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, } from "convex/server";
|
|
11
|
+
/**
|
|
12
|
+
* Define a query in this Convex app's public API.
|
|
13
|
+
*
|
|
14
|
+
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
15
|
+
*
|
|
16
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
17
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
18
|
+
*/
|
|
8
19
|
export const query = queryGeneric;
|
|
20
|
+
/**
|
|
21
|
+
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
22
|
+
*
|
|
23
|
+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
24
|
+
*
|
|
25
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
26
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
27
|
+
*/
|
|
9
28
|
export const internalQuery = internalQueryGeneric;
|
|
29
|
+
/**
|
|
30
|
+
* Define a mutation in this Convex app's public API.
|
|
31
|
+
*
|
|
32
|
+
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
33
|
+
*
|
|
34
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
35
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
36
|
+
*/
|
|
10
37
|
export const mutation = mutationGeneric;
|
|
38
|
+
/**
|
|
39
|
+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
40
|
+
*
|
|
41
|
+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
42
|
+
*
|
|
43
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
44
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
45
|
+
*/
|
|
11
46
|
export const internalMutation = internalMutationGeneric;
|
|
47
|
+
/**
|
|
48
|
+
* Define an action in this Convex app's public API.
|
|
49
|
+
*
|
|
50
|
+
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
51
|
+
* code and code with side-effects, like calling third-party services.
|
|
52
|
+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
53
|
+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
54
|
+
*
|
|
55
|
+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
56
|
+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
57
|
+
*/
|
|
12
58
|
export const action = actionGeneric;
|
|
59
|
+
/**
|
|
60
|
+
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
61
|
+
*
|
|
62
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
63
|
+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
64
|
+
*/
|
|
13
65
|
export const internalAction = internalActionGeneric;
|
|
66
|
+
/**
|
|
67
|
+
* Define an HTTP action.
|
|
68
|
+
*
|
|
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.
|
|
76
|
+
*/
|
|
14
77
|
export const httpAction = httpActionGeneric;
|
|
78
|
+
export const env = globalThis
|
|
79
|
+
.process.env;
|
|
15
80
|
//# sourceMappingURL=server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB
|
|
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;AAcvB;;;;;;;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;AAC/D,MAAM,CAAC,MAAM,GAAG,GAAS,UAAmD;KACzE,OAAO,CAAC,GAAG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,SAAS,sDAA+B,CAAC;eAMhC,SAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crons.d.ts","sourceRoot":"","sources":["../../src/component/crons.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,KAAK,+BAAa,CAAC;eAeV,KAAK"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { cronJobs } from "convex/server";
|
|
2
|
+
import { internal } from "./_generated/api";
|
|
3
|
+
const crons = cronJobs();
|
|
4
|
+
crons.interval("analytics:close-sessions", { minutes: 30 }, internal.internal_mutations.closeSessions, {});
|
|
5
|
+
crons.interval("analytics:prune-events", { hours: 24 }, internal.internal_mutations.prune, {});
|
|
6
|
+
export default crons;
|
|
7
|
+
//# sourceMappingURL=crons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crons.js","sourceRoot":"","sources":["../../src/component/crons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;AAEzB,KAAK,CAAC,QAAQ,CACZ,0BAA0B,EAC1B,EAAE,OAAO,EAAE,EAAE,EAAE,EACf,QAAQ,CAAC,kBAAkB,CAAC,aAAa,EACzC,EAAE,CACH,CAAC;AACF,KAAK,CAAC,QAAQ,CACZ,wBAAwB,EACxB,EAAE,KAAK,EAAE,EAAE,EAAE,EACb,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EACjC,EAAE,CACH,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/component/http.ts"],"names":[],"mappings":"AAyEA,eAAO,MAAM,aAAa,0CA8BxB,CAAC;AAEH,eAAO,MAAM,cAAc,0CAmBzB,CAAC;AAEH,eAAO,MAAM,WAAW,0CAoBtB,CAAC;AAEH,eAAO,MAAM,kBAAkB,0CAqB7B,CAAC;AAEH,eAAO,MAAM,eAAe,0CAkB1B,CAAC;AAEH;;;;GAIG;AACH,QAAA,MAAM,IAAI,oCAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/component/http.ts"],"names":[],"mappings":"AAyEA,eAAO,MAAM,aAAa,0CA8BxB,CAAC;AAEH,eAAO,MAAM,cAAc,0CAmBzB,CAAC;AAEH,eAAO,MAAM,WAAW,0CAoBtB,CAAC;AAEH,eAAO,MAAM,kBAAkB,0CAqB7B,CAAC;AAEH,eAAO,MAAM,eAAe,0CAkB1B,CAAC;AAEH;;;;GAIG;AACH,QAAA,MAAM,IAAI,oCAAe,CAAC;eAOX,IAAI"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
export declare function guardBackfillSize(eventCount: number): void;
|
|
1
2
|
/** Delete raw events past `retentionDays` for a scope. Rollups are kept forever. Idempotent. */
|
|
2
3
|
export declare const prune: import("convex/server").RegisteredMutation<"internal", {
|
|
4
|
+
afterScope?: string | undefined;
|
|
3
5
|
scope?: string | undefined;
|
|
4
6
|
}, Promise<{
|
|
5
7
|
deleted: number;
|
|
6
8
|
}>>;
|
|
7
9
|
/** Close sessions idle past `sessionIdleMs` (set `endTs`). Idempotent. */
|
|
8
10
|
export declare const closeSessions: import("convex/server").RegisteredMutation<"internal", {
|
|
11
|
+
afterScope?: string | undefined;
|
|
9
12
|
scope?: string | undefined;
|
|
10
13
|
}, Promise<{
|
|
11
14
|
closed: number;
|
|
@@ -15,10 +18,10 @@ export declare const closeSessions: import("convex/server").RegisteredMutation<"
|
|
|
15
18
|
* existing rollup rows for the name, then recomputes from the retained raw events.
|
|
16
19
|
*/
|
|
17
20
|
export declare const backfill: import("convex/server").RegisteredMutation<"internal", {
|
|
21
|
+
dimensions: string[];
|
|
22
|
+
granularities: ("day" | "hour" | "minute")[];
|
|
18
23
|
name: string;
|
|
19
24
|
scope: string;
|
|
20
|
-
granularities: ("minute" | "hour" | "day")[];
|
|
21
|
-
dimensions: string[];
|
|
22
25
|
}, Promise<{
|
|
23
26
|
events: number;
|
|
24
27
|
rows: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal_mutations.d.ts","sourceRoot":"","sources":["../../src/component/internal_mutations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal_mutations.d.ts","sourceRoot":"","sources":["../../src/component/internal_mutations.ts"],"names":[],"mappings":"AAcA,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAI1D;AAoBD,gGAAgG;AAChG,eAAO,MAAM,KAAK;;;;;GA6ChB,CAAC;AAEH,0EAA0E;AAC1E,eAAO,MAAM,aAAa;;;;;GAmDxB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;GAmEnB,CAAC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
import { internal } from "./_generated/api";
|
|
1
2
|
import { internalMutation } from "./_generated/server";
|
|
2
3
|
import { v } from "convex/values";
|
|
3
4
|
import { granularitiesValidator } from "./validators.js";
|
|
4
5
|
import { bucketStart, valKey } from "../shared.js";
|
|
5
|
-
const
|
|
6
|
+
const MAINTENANCE_CAP = 500;
|
|
6
7
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
7
8
|
const DEFAULT_RETENTION_DAYS = 90;
|
|
8
9
|
const DEFAULT_SESSION_IDLE_MS = 30 * 60 * 1000;
|
|
9
10
|
const TOTAL = "";
|
|
11
|
+
export function guardBackfillSize(eventCount) {
|
|
12
|
+
if (eventCount > 50000) {
|
|
13
|
+
throw new Error("backfill requires at most 50000 retained events; existing rollups were preserved");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
10
16
|
/** Read a numeric config value for a scope, falling back to a default. */
|
|
11
17
|
async function readNumber(ctx, scope, key, fallback) {
|
|
12
18
|
const entry = await ctx.db
|
|
@@ -18,52 +24,75 @@ async function readNumber(ctx, scope, key, fallback) {
|
|
|
18
24
|
const n = Number(entry.value);
|
|
19
25
|
return Number.isFinite(n) ? n : fallback;
|
|
20
26
|
}
|
|
21
|
-
|
|
22
|
-
async function configuredScopes(ctx) {
|
|
23
|
-
const rows = await ctx.db.query("config").collect();
|
|
24
|
-
return [...new Set(rows.map((r) => r.scope))];
|
|
25
|
-
}
|
|
27
|
+
const SCOPE_BATCH = 100;
|
|
26
28
|
/** Delete raw events past `retentionDays` for a scope. Rollups are kept forever. Idempotent. */
|
|
27
29
|
export const prune = internalMutation({
|
|
28
|
-
args: { scope: v.optional(v.string()) },
|
|
30
|
+
args: { scope: v.optional(v.string()), afterScope: v.optional(v.string()) },
|
|
29
31
|
returns: v.object({ deleted: v.number() }),
|
|
30
32
|
handler: async (ctx, args) => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
if (args.scope === undefined) {
|
|
34
|
+
const scopes = await ctx.db
|
|
35
|
+
.query("scopes")
|
|
36
|
+
.withIndex("by_scope", (q) => args.afterScope === undefined ? q : q.gt("scope", args.afterScope))
|
|
37
|
+
.take(SCOPE_BATCH);
|
|
38
|
+
await Promise.all(scopes.map((row) => ctx.scheduler.runAfter(0, internal.internal_mutations.prune, {
|
|
39
|
+
scope: row.scope,
|
|
40
|
+
})));
|
|
41
|
+
if (scopes.length === SCOPE_BATCH) {
|
|
42
|
+
await ctx.scheduler.runAfter(0, internal.internal_mutations.prune, {
|
|
43
|
+
afterScope: scopes[scopes.length - 1].scope,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return { deleted: 0 };
|
|
47
|
+
}
|
|
48
|
+
const retentionDays = await readNumber(ctx, args.scope, "retentionDays", DEFAULT_RETENTION_DAYS);
|
|
49
|
+
const cutoff = Date.now() - retentionDays * DAY_MS;
|
|
50
|
+
const stale = await ctx.db
|
|
51
|
+
.query("events")
|
|
52
|
+
.withIndex("by_scope_ts", (q) => q.eq("scope", args.scope).lt("ts", cutoff))
|
|
53
|
+
.take(MAINTENANCE_CAP);
|
|
54
|
+
await Promise.all(stale.map((event) => ctx.db.delete("events", event._id)));
|
|
55
|
+
if (stale.length === MAINTENANCE_CAP) {
|
|
56
|
+
await ctx.scheduler.runAfter(0, internal.internal_mutations.prune, {
|
|
57
|
+
scope: args.scope,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return { deleted: stale.length };
|
|
46
61
|
},
|
|
47
62
|
});
|
|
48
63
|
/** Close sessions idle past `sessionIdleMs` (set `endTs`). Idempotent. */
|
|
49
64
|
export const closeSessions = internalMutation({
|
|
50
|
-
args: { scope: v.optional(v.string()) },
|
|
65
|
+
args: { scope: v.optional(v.string()), afterScope: v.optional(v.string()) },
|
|
51
66
|
returns: v.object({ closed: v.number() }),
|
|
52
67
|
handler: async (ctx, args) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
if (args.scope === undefined) {
|
|
69
|
+
const scopes = await ctx.db
|
|
70
|
+
.query("scopes")
|
|
71
|
+
.withIndex("by_scope", (q) => args.afterScope === undefined ? q : q.gt("scope", args.afterScope))
|
|
72
|
+
.take(SCOPE_BATCH);
|
|
73
|
+
await Promise.all(scopes.map((row) => ctx.scheduler.runAfter(0, internal.internal_mutations.closeSessions, {
|
|
74
|
+
scope: row.scope,
|
|
75
|
+
})));
|
|
76
|
+
if (scopes.length === SCOPE_BATCH) {
|
|
77
|
+
await ctx.scheduler.runAfter(0, internal.internal_mutations.closeSessions, {
|
|
78
|
+
afterScope: scopes[scopes.length - 1].scope,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return { closed: 0 };
|
|
82
|
+
}
|
|
83
|
+
const idleMs = await readNumber(ctx, args.scope, "sessionIdleMs", DEFAULT_SESSION_IDLE_MS);
|
|
84
|
+
const cutoff = Date.now() - idleMs;
|
|
85
|
+
const stale = await ctx.db
|
|
86
|
+
.query("sessions")
|
|
87
|
+
.withIndex("by_scope_endTs_lastTs", (q) => q.eq("scope", args.scope).eq("endTs", undefined).lt("lastTs", cutoff))
|
|
88
|
+
.take(MAINTENANCE_CAP);
|
|
89
|
+
await Promise.all(stale.map((session) => ctx.db.patch("sessions", session._id, { endTs: session.lastTs })));
|
|
90
|
+
if (stale.length === MAINTENANCE_CAP) {
|
|
91
|
+
await ctx.scheduler.runAfter(0, internal.internal_mutations.closeSessions, {
|
|
92
|
+
scope: args.scope,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return { closed: stale.length };
|
|
67
96
|
},
|
|
68
97
|
});
|
|
69
98
|
/**
|
|
@@ -80,15 +109,16 @@ export const backfill = internalMutation({
|
|
|
80
109
|
returns: v.object({ events: v.number(), rows: v.number() }),
|
|
81
110
|
handler: async (ctx, args) => {
|
|
82
111
|
const grans = args.granularities.length > 0 ? args.granularities : ["day"];
|
|
112
|
+
const events = await ctx.db
|
|
113
|
+
.query("events")
|
|
114
|
+
.withIndex("by_scope_name_ts", (q) => q.eq("scope", args.scope).eq("name", args.name))
|
|
115
|
+
.take(50001);
|
|
116
|
+
guardBackfillSize(events.length);
|
|
83
117
|
const existing = await ctx.db
|
|
84
118
|
.query("rollups")
|
|
85
119
|
.withIndex("by_scope_name_dim_val", (q) => q.eq("scope", args.scope).eq("name", args.name))
|
|
86
120
|
.collect();
|
|
87
|
-
await Promise.all(existing.map((r) => ctx.db.delete(r._id)));
|
|
88
|
-
const events = await ctx.db
|
|
89
|
-
.query("events")
|
|
90
|
-
.withIndex("by_scope_name_ts", (q) => q.eq("scope", args.scope).eq("name", args.name))
|
|
91
|
-
.take(50000);
|
|
121
|
+
await Promise.all(existing.map((r) => ctx.db.delete("rollups", r._id)));
|
|
92
122
|
const counts = new Map();
|
|
93
123
|
const meta = new Map();
|
|
94
124
|
const bump = (gran, bucket, dim, val) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal_mutations.js","sourceRoot":"","sources":["../../src/component/internal_mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGnD,MAAM,
|
|
1
|
+
{"version":3,"file":"internal_mutations.js","sourceRoot":"","sources":["../../src/component/internal_mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGnD,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACnC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC/C,MAAM,KAAK,GAAG,EAAE,CAAC;AAEjB,MAAM,UAAU,iBAAiB,CAAC,UA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,24 @@
|
|
|
1
1
|
export declare const track: import("convex/server").RegisteredMutation<"public", {
|
|
2
|
-
ts?: number | undefined;
|
|
3
|
-
subjectRef?: string | undefined;
|
|
4
|
-
sessionRef?: string | undefined;
|
|
5
|
-
props?: Record<string, string | number | boolean | null> | undefined;
|
|
6
2
|
dedupeKey?: string | undefined;
|
|
7
|
-
|
|
3
|
+
dimensions: string[];
|
|
4
|
+
granularities: ("day" | "hour" | "minute")[];
|
|
8
5
|
name: string;
|
|
6
|
+
props?: Record<string, string | number | boolean | null> | undefined;
|
|
7
|
+
sampleRate?: number | undefined;
|
|
9
8
|
scope: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
sessionRef?: string | undefined;
|
|
10
|
+
subjectRef?: string | undefined;
|
|
11
|
+
ts?: number | undefined;
|
|
12
|
+
}, Promise<"dropped" | "duplicate" | "tracked">>;
|
|
13
13
|
export declare const configSet: import("convex/server").RegisteredMutation<"public", {
|
|
14
|
-
value: string;
|
|
15
14
|
key: string;
|
|
16
15
|
scope: string;
|
|
16
|
+
value: string;
|
|
17
17
|
}, Promise<null>>;
|
|
18
18
|
export declare const configure: import("convex/server").RegisteredMutation<"public", {
|
|
19
|
-
sampleRate?: number | undefined;
|
|
20
19
|
retentionDays?: number | undefined;
|
|
21
|
-
|
|
20
|
+
sampleRate?: number | undefined;
|
|
22
21
|
scope: string;
|
|
22
|
+
sessionIdleMs?: number | undefined;
|
|
23
23
|
}, Promise<null>>;
|
|
24
24
|
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/component/mutations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/component/mutations.ts"],"names":[],"mappings":"AA0EA,eAAO,MAAM,KAAK;;;;;;;;;;;gDA8IhB,CAAC;AAoBH,eAAO,MAAM,SAAS;;;;iBAQpB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;iBAyBpB,CAAC"}
|