@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
|
@@ -19,21 +19,21 @@ export declare const whereValidator: import("convex/values").VObject<{
|
|
|
19
19
|
val: import("convex/values").VUnion<string | number | boolean | null, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">, import("convex/values").VNull<null, "required">], "required", never>;
|
|
20
20
|
}, "required", "dim" | "val">;
|
|
21
21
|
/** Rollup bucket granularity. `minute` is opt-in for short live windows. */
|
|
22
|
-
export declare const granularityValidator: import("convex/values").VUnion<"
|
|
22
|
+
export declare const granularityValidator: import("convex/values").VUnion<"day" | "hour" | "minute", [import("convex/values").VLiteral<"minute", "required">, import("convex/values").VLiteral<"hour", "required">, import("convex/values").VLiteral<"day", "required">], "required", never>;
|
|
23
23
|
/** Array of granularities (the `granularities` config, shared by `track` + `backfill`). */
|
|
24
|
-
export declare const granularitiesValidator: import("convex/values").VArray<("
|
|
24
|
+
export declare const granularitiesValidator: import("convex/values").VArray<("day" | "hour" | "minute")[], import("convex/values").VUnion<"day" | "hour" | "minute", [import("convex/values").VLiteral<"minute", "required">, import("convex/values").VLiteral<"hour", "required">, import("convex/values").VLiteral<"day", "required">], "required", never>, "required">;
|
|
25
25
|
/** A raw event as returned by reads. */
|
|
26
26
|
export declare const eventView: import("convex/values").VObject<{
|
|
27
|
-
subjectRef?: string | undefined;
|
|
28
|
-
sessionRef?: string | undefined;
|
|
29
|
-
dedupeKey?: string | undefined;
|
|
30
27
|
_creationTime: number;
|
|
31
|
-
name: string;
|
|
32
|
-
ts: number;
|
|
33
28
|
_id: string;
|
|
34
|
-
|
|
29
|
+
dedupeKey?: string | undefined;
|
|
30
|
+
name: string;
|
|
35
31
|
props: Record<string, string | number | boolean | null>;
|
|
32
|
+
scope: string;
|
|
36
33
|
seq: number;
|
|
34
|
+
sessionRef?: string | undefined;
|
|
35
|
+
subjectRef?: string | undefined;
|
|
36
|
+
ts: number;
|
|
37
37
|
}, {
|
|
38
38
|
_id: import("convex/values").VString<string, "required">;
|
|
39
39
|
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
@@ -45,7 +45,7 @@ export declare const eventView: import("convex/values").VObject<{
|
|
|
45
45
|
ts: import("convex/values").VFloat64<number, "required">;
|
|
46
46
|
seq: import("convex/values").VFloat64<number, "required">;
|
|
47
47
|
dedupeKey: import("convex/values").VString<string | undefined, "optional">;
|
|
48
|
-
}, "required", "_creationTime" | "
|
|
48
|
+
}, "required", "_creationTime" | "_id" | "dedupeKey" | "name" | "props" | "scope" | "seq" | "sessionRef" | "subjectRef" | "ts" | `props.${string}`>;
|
|
49
49
|
/** A `(value, count)` pair for `top` breakdowns. */
|
|
50
50
|
export declare const topRow: import("convex/values").VObject<{
|
|
51
51
|
count: number;
|
|
@@ -56,21 +56,21 @@ export declare const topRow: import("convex/values").VObject<{
|
|
|
56
56
|
}, "required", "count" | "value">;
|
|
57
57
|
/** A `(bucket, count)` pair for `timeseries`. */
|
|
58
58
|
export declare const timeseriesPoint: import("convex/values").VObject<{
|
|
59
|
-
count: number;
|
|
60
59
|
bucket: number;
|
|
60
|
+
count: number;
|
|
61
61
|
}, {
|
|
62
62
|
bucket: import("convex/values").VFloat64<number, "required">;
|
|
63
63
|
count: import("convex/values").VFloat64<number, "required">;
|
|
64
|
-
}, "required", "
|
|
64
|
+
}, "required", "bucket" | "count">;
|
|
65
65
|
/** DAU/WAU/MAU rollup of distinct subjects. */
|
|
66
66
|
export declare const uniquesView: import("convex/values").VObject<{
|
|
67
67
|
dau: number;
|
|
68
|
-
wau: number;
|
|
69
68
|
mau: number;
|
|
70
69
|
trend: {
|
|
71
70
|
bucket: number;
|
|
72
71
|
uniques: number;
|
|
73
72
|
}[];
|
|
73
|
+
wau: number;
|
|
74
74
|
}, {
|
|
75
75
|
dau: import("convex/values").VFloat64<number, "required">;
|
|
76
76
|
wau: import("convex/values").VFloat64<number, "required">;
|
|
@@ -85,7 +85,7 @@ export declare const uniquesView: import("convex/values").VObject<{
|
|
|
85
85
|
bucket: import("convex/values").VFloat64<number, "required">;
|
|
86
86
|
uniques: import("convex/values").VFloat64<number, "required">;
|
|
87
87
|
}, "required", "bucket" | "uniques">, "required">;
|
|
88
|
-
}, "required", "dau" | "
|
|
88
|
+
}, "required", "dau" | "mau" | "trend" | "wau">;
|
|
89
89
|
/** A single funnel step result. */
|
|
90
90
|
export declare const funnelStep: import("convex/values").VObject<{
|
|
91
91
|
count: number;
|
|
@@ -99,52 +99,52 @@ export declare const funnelStep: import("convex/values").VObject<{
|
|
|
99
99
|
/** A single retention cohort row. */
|
|
100
100
|
export declare const retentionCohort: import("convex/values").VObject<{
|
|
101
101
|
cohort: number;
|
|
102
|
-
size: number;
|
|
103
102
|
retained: number[];
|
|
103
|
+
size: number;
|
|
104
104
|
}, {
|
|
105
105
|
cohort: import("convex/values").VFloat64<number, "required">;
|
|
106
106
|
size: import("convex/values").VFloat64<number, "required">;
|
|
107
107
|
retained: import("convex/values").VArray<number[], import("convex/values").VFloat64<number, "required">, "required">;
|
|
108
|
-
}, "required", "cohort" | "
|
|
108
|
+
}, "required", "cohort" | "retained" | "size">;
|
|
109
109
|
/** Paginated raw-event page (Convex pagination result shape). */
|
|
110
110
|
export declare const eventPage: import("convex/values").VObject<{
|
|
111
|
+
continueCursor: string;
|
|
112
|
+
isDone: boolean;
|
|
111
113
|
page: {
|
|
112
|
-
subjectRef?: string | undefined;
|
|
113
|
-
sessionRef?: string | undefined;
|
|
114
|
-
dedupeKey?: string | undefined;
|
|
115
114
|
_creationTime: number;
|
|
116
|
-
name: string;
|
|
117
|
-
ts: number;
|
|
118
115
|
_id: string;
|
|
119
|
-
|
|
116
|
+
dedupeKey?: string | undefined;
|
|
117
|
+
name: string;
|
|
120
118
|
props: Record<string, string | number | boolean | null>;
|
|
119
|
+
scope: string;
|
|
121
120
|
seq: number;
|
|
121
|
+
sessionRef?: string | undefined;
|
|
122
|
+
subjectRef?: string | undefined;
|
|
123
|
+
ts: number;
|
|
122
124
|
}[];
|
|
123
|
-
isDone: boolean;
|
|
124
|
-
continueCursor: string;
|
|
125
125
|
}, {
|
|
126
126
|
page: import("convex/values").VArray<{
|
|
127
|
-
subjectRef?: string | undefined;
|
|
128
|
-
sessionRef?: string | undefined;
|
|
129
|
-
dedupeKey?: string | undefined;
|
|
130
127
|
_creationTime: number;
|
|
131
|
-
name: string;
|
|
132
|
-
ts: number;
|
|
133
128
|
_id: string;
|
|
134
|
-
|
|
129
|
+
dedupeKey?: string | undefined;
|
|
130
|
+
name: string;
|
|
135
131
|
props: Record<string, string | number | boolean | null>;
|
|
132
|
+
scope: string;
|
|
136
133
|
seq: number;
|
|
137
|
-
}[], import("convex/values").VObject<{
|
|
138
|
-
subjectRef?: string | undefined;
|
|
139
134
|
sessionRef?: string | undefined;
|
|
140
|
-
|
|
141
|
-
_creationTime: number;
|
|
142
|
-
name: string;
|
|
135
|
+
subjectRef?: string | undefined;
|
|
143
136
|
ts: number;
|
|
137
|
+
}[], import("convex/values").VObject<{
|
|
138
|
+
_creationTime: number;
|
|
144
139
|
_id: string;
|
|
145
|
-
|
|
140
|
+
dedupeKey?: string | undefined;
|
|
141
|
+
name: string;
|
|
146
142
|
props: Record<string, string | number | boolean | null>;
|
|
143
|
+
scope: string;
|
|
147
144
|
seq: number;
|
|
145
|
+
sessionRef?: string | undefined;
|
|
146
|
+
subjectRef?: string | undefined;
|
|
147
|
+
ts: number;
|
|
148
148
|
}, {
|
|
149
149
|
_id: import("convex/values").VString<string, "required">;
|
|
150
150
|
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
@@ -156,10 +156,10 @@ export declare const eventPage: import("convex/values").VObject<{
|
|
|
156
156
|
ts: import("convex/values").VFloat64<number, "required">;
|
|
157
157
|
seq: import("convex/values").VFloat64<number, "required">;
|
|
158
158
|
dedupeKey: import("convex/values").VString<string | undefined, "optional">;
|
|
159
|
-
}, "required", "_creationTime" | "
|
|
159
|
+
}, "required", "_creationTime" | "_id" | "dedupeKey" | "name" | "props" | "scope" | "seq" | "sessionRef" | "subjectRef" | "ts" | `props.${string}`>, "required">;
|
|
160
160
|
isDone: import("convex/values").VBoolean<boolean, "required">;
|
|
161
161
|
continueCursor: import("convex/values").VString<string, "required">;
|
|
162
|
-
}, "required", "
|
|
162
|
+
}, "required", "continueCursor" | "isDone" | "page">;
|
|
163
163
|
/** A single histogram bin: events whose measure falls at or below `upper`. */
|
|
164
164
|
export declare const distributionBin: import("convex/values").VObject<{
|
|
165
165
|
count: number;
|
|
@@ -170,13 +170,13 @@ export declare const distributionBin: import("convex/values").VObject<{
|
|
|
170
170
|
}, "required", "count" | "upper">;
|
|
171
171
|
/** Histogram of a numeric measure: ascending upper-bound bins + an overflow bucket. */
|
|
172
172
|
export declare const distributionView: import("convex/values").VObject<{
|
|
173
|
-
count: number;
|
|
174
|
-
sum: number;
|
|
175
173
|
bins: {
|
|
176
174
|
count: number;
|
|
177
175
|
upper: number;
|
|
178
176
|
}[];
|
|
177
|
+
count: number;
|
|
179
178
|
overflow: number;
|
|
179
|
+
sum: number;
|
|
180
180
|
}, {
|
|
181
181
|
bins: import("convex/values").VArray<{
|
|
182
182
|
count: number;
|
|
@@ -191,5 +191,5 @@ export declare const distributionView: import("convex/values").VObject<{
|
|
|
191
191
|
overflow: import("convex/values").VFloat64<number, "required">;
|
|
192
192
|
count: import("convex/values").VFloat64<number, "required">;
|
|
193
193
|
sum: import("convex/values").VFloat64<number, "required">;
|
|
194
|
-
}, "required", "
|
|
194
|
+
}, "required", "bins" | "count" | "overflow" | "sum">;
|
|
195
195
|
//# sourceMappingURL=validators.d.ts.map
|
package/dist/shared.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export type Granularity = "minute" | "hour" | "day";
|
|
|
9
9
|
export declare function bucketSize(granularity: Granularity): number;
|
|
10
10
|
/** Truncate an epoch-millis timestamp to the start of its `granularity` bucket. */
|
|
11
11
|
export declare function bucketStart(ts: number, granularity: Granularity): number;
|
|
12
|
+
/** Serialize a string tuple without delimiter collisions. */
|
|
13
|
+
export declare function tupleKey(...parts: string[]): string;
|
|
12
14
|
/** Coerce a scalar prop value to the string form used as a rollup `val` key. */
|
|
13
15
|
export declare function valKey(value: Scalar): string;
|
|
14
16
|
//# sourceMappingURL=shared.d.ts.map
|
package/dist/shared.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAEvE,+BAA+B;AAC/B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEtD,wDAAwD;AACxD,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3C,4EAA4E;AAC5E,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAMpD,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAE3D;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,MAAM,CAGxE;AAED,gFAAgF;AAChF,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5C"}
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAEvE,+BAA+B;AAC/B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEtD,wDAAwD;AACxD,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3C,4EAA4E;AAC5E,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAMpD,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAE3D;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,MAAM,CAGxE;AAED,6DAA6D;AAC7D,wBAAgB,QAAQ,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAEnD;AAED,gFAAgF;AAChF,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5C"}
|
package/dist/shared.js
CHANGED
|
@@ -11,6 +11,10 @@ export function bucketStart(ts, granularity) {
|
|
|
11
11
|
const size = bucketSize(granularity);
|
|
12
12
|
return Math.floor(ts / size) * size;
|
|
13
13
|
}
|
|
14
|
+
/** Serialize a string tuple without delimiter collisions. */
|
|
15
|
+
export function tupleKey(...parts) {
|
|
16
|
+
return JSON.stringify(parts);
|
|
17
|
+
}
|
|
14
18
|
/** Coerce a scalar prop value to the string form used as a rollup `val` key. */
|
|
15
19
|
export function valKey(value) {
|
|
16
20
|
return value === null ? "null" : String(value);
|
package/dist/shared.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA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C,EAAU,EAAE,WAAwB;IAC9D,MAAM,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IACrC,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;AACtC,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,QAAQ,CAAC,GAAG,KAAe;IACzC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,MAAM,CAAC,KAAa;IAClC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC"}
|
package/dist/test.d.ts
CHANGED
|
@@ -20,14 +20,14 @@ declare const _default: {
|
|
|
20
20
|
register: typeof register;
|
|
21
21
|
schema: SchemaDefinition<{
|
|
22
22
|
events: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
23
|
-
subjectRef?: string | undefined;
|
|
24
|
-
sessionRef?: string | undefined;
|
|
25
23
|
dedupeKey?: string | undefined;
|
|
26
24
|
name: string;
|
|
27
|
-
ts: number;
|
|
28
|
-
scope: string;
|
|
29
25
|
props: Record<string, string | number | boolean | null>;
|
|
26
|
+
scope: string;
|
|
30
27
|
seq: number;
|
|
28
|
+
sessionRef?: string | undefined;
|
|
29
|
+
subjectRef?: string | undefined;
|
|
30
|
+
ts: number;
|
|
31
31
|
}, {
|
|
32
32
|
scope: import("convex/values").VString<string, "required">;
|
|
33
33
|
name: import("convex/values").VString<string, "required">;
|
|
@@ -37,56 +37,57 @@ declare const _default: {
|
|
|
37
37
|
ts: import("convex/values").VFloat64<number, "required">;
|
|
38
38
|
seq: import("convex/values").VFloat64<number, "required">;
|
|
39
39
|
dedupeKey: import("convex/values").VString<string | undefined, "optional">;
|
|
40
|
-
}, "required", "
|
|
40
|
+
}, "required", "dedupeKey" | "name" | "props" | "scope" | "seq" | "sessionRef" | "subjectRef" | "ts" | `props.${string}`>, {
|
|
41
|
+
by_dedupe: ["scope", "dedupeKey", "_creationTime"];
|
|
41
42
|
by_scope_name_ts: ["scope", "name", "ts", "_creationTime"];
|
|
42
|
-
by_scope_subject_ts: ["scope", "subjectRef", "ts", "_creationTime"];
|
|
43
43
|
by_scope_session_ts: ["scope", "sessionRef", "ts", "_creationTime"];
|
|
44
|
-
|
|
44
|
+
by_scope_subject_ts: ["scope", "subjectRef", "ts", "_creationTime"];
|
|
45
|
+
by_scope_ts: ["scope", "ts", "_creationTime"];
|
|
45
46
|
}, {}, {}>;
|
|
46
47
|
rollups: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
48
|
+
bucket: number;
|
|
47
49
|
count: number;
|
|
48
|
-
name: string;
|
|
49
50
|
dim: string;
|
|
50
|
-
|
|
51
|
+
granularity: "day" | "hour" | "minute";
|
|
52
|
+
name: string;
|
|
51
53
|
scope: string;
|
|
52
|
-
|
|
53
|
-
granularity: "minute" | "hour" | "day";
|
|
54
|
+
val: string;
|
|
54
55
|
}, {
|
|
55
56
|
scope: import("convex/values").VString<string, "required">;
|
|
56
57
|
name: import("convex/values").VString<string, "required">;
|
|
57
|
-
granularity: import("convex/values").VUnion<"
|
|
58
|
+
granularity: import("convex/values").VUnion<"day" | "hour" | "minute", [import("convex/values").VLiteral<"minute", "required">, import("convex/values").VLiteral<"hour", "required">, import("convex/values").VLiteral<"day", "required">], "required", never>;
|
|
58
59
|
bucket: import("convex/values").VFloat64<number, "required">;
|
|
59
60
|
dim: import("convex/values").VString<string, "required">;
|
|
60
61
|
val: import("convex/values").VString<string, "required">;
|
|
61
62
|
count: import("convex/values").VFloat64<number, "required">;
|
|
62
|
-
}, "required", "
|
|
63
|
-
by_scope_name_gran_bucket_dim: ["scope", "name", "granularity", "bucket", "dim", "val", "_creationTime"];
|
|
63
|
+
}, "required", "bucket" | "count" | "dim" | "granularity" | "name" | "scope" | "val">, {
|
|
64
64
|
by_scope_name_dim_val: ["scope", "name", "dim", "val", "_creationTime"];
|
|
65
|
+
by_scope_name_gran_bucket_dim: ["scope", "name", "granularity", "bucket", "dim", "val", "_creationTime"];
|
|
65
66
|
}, {}, {}>;
|
|
66
67
|
subjects: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
67
|
-
|
|
68
|
-
subjectRef: string;
|
|
68
|
+
eventCount: number;
|
|
69
69
|
firstSeen: number;
|
|
70
70
|
lastSeen: number;
|
|
71
|
-
|
|
71
|
+
scope: string;
|
|
72
|
+
subjectRef: string;
|
|
72
73
|
}, {
|
|
73
74
|
scope: import("convex/values").VString<string, "required">;
|
|
74
75
|
subjectRef: import("convex/values").VString<string, "required">;
|
|
75
76
|
firstSeen: import("convex/values").VFloat64<number, "required">;
|
|
76
77
|
lastSeen: import("convex/values").VFloat64<number, "required">;
|
|
77
78
|
eventCount: import("convex/values").VFloat64<number, "required">;
|
|
78
|
-
}, "required", "
|
|
79
|
-
by_scope_subject: ["scope", "subjectRef", "_creationTime"];
|
|
79
|
+
}, "required", "eventCount" | "firstSeen" | "lastSeen" | "scope" | "subjectRef">, {
|
|
80
80
|
by_scope_firstSeen: ["scope", "firstSeen", "_creationTime"];
|
|
81
|
+
by_scope_subject: ["scope", "subjectRef", "_creationTime"];
|
|
81
82
|
}, {}, {}>;
|
|
82
83
|
sessions: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
83
|
-
subjectRef?: string | undefined;
|
|
84
84
|
endTs?: number | undefined;
|
|
85
|
+
eventCount: number;
|
|
86
|
+
lastTs: number;
|
|
85
87
|
scope: string;
|
|
86
88
|
sessionRef: string;
|
|
87
|
-
eventCount: number;
|
|
88
89
|
startTs: number;
|
|
89
|
-
|
|
90
|
+
subjectRef?: string | undefined;
|
|
90
91
|
}, {
|
|
91
92
|
scope: import("convex/values").VString<string, "required">;
|
|
92
93
|
sessionRef: import("convex/values").VString<string, "required">;
|
|
@@ -95,19 +96,27 @@ declare const _default: {
|
|
|
95
96
|
endTs: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
96
97
|
lastTs: import("convex/values").VFloat64<number, "required">;
|
|
97
98
|
eventCount: import("convex/values").VFloat64<number, "required">;
|
|
98
|
-
}, "required", "
|
|
99
|
-
|
|
99
|
+
}, "required", "endTs" | "eventCount" | "lastTs" | "scope" | "sessionRef" | "startTs" | "subjectRef">, {
|
|
100
|
+
by_scope_endTs_lastTs: ["scope", "endTs", "lastTs", "_creationTime"];
|
|
100
101
|
by_scope_lastTs: ["scope", "lastTs", "_creationTime"];
|
|
102
|
+
by_scope_session: ["scope", "sessionRef", "_creationTime"];
|
|
103
|
+
}, {}, {}>;
|
|
104
|
+
scopes: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
105
|
+
scope: string;
|
|
106
|
+
}, {
|
|
107
|
+
scope: import("convex/values").VString<string, "required">;
|
|
108
|
+
}, "required", "scope">, {
|
|
109
|
+
by_scope: ["scope", "_creationTime"];
|
|
101
110
|
}, {}, {}>;
|
|
102
111
|
config: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
103
|
-
value: string;
|
|
104
112
|
key: string;
|
|
105
113
|
scope: string;
|
|
114
|
+
value: string;
|
|
106
115
|
}, {
|
|
107
116
|
scope: import("convex/values").VString<string, "required">;
|
|
108
117
|
key: import("convex/values").VString<string, "required">;
|
|
109
118
|
value: import("convex/values").VString<string, "required">;
|
|
110
|
-
}, "required", "
|
|
119
|
+
}, "required", "key" | "scope" | "value">, {
|
|
111
120
|
by_scope_key: ["scope", "key", "_creationTime"];
|
|
112
121
|
}, {}, {}>;
|
|
113
122
|
}, true>;
|
package/dist/test.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAQrE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CACtB,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,EACvD,IAAI,GAAE,MAAoB,GACzB,IAAI,CAaN
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAQrE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CACtB,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,EACvD,IAAI,GAAE,MAAoB,GACzB,IAAI,CAaN"}
|
package/dist/test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAGA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,kBAAkB,MAAM,kCAAkC,CAAC;AAClE,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAGA,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,kBAAkB,MAAM,kCAAkC,CAAC;AAClE,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,MAAM,OAAO,GAAG,OAAO,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAExD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,QAAQ,CACtB,CAAuD,EACvD,IAAI,GAAW,WAAW;IAE1B,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC,CAAC,iBAAiB,CAAC,GAAG,IAAI,YAAY,EAAE,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACtF,CAAC,CAAC,iBAAiB,CACjB,GAAG,IAAI,iBAAiB,EACxB,kBAAkB,CAAC,MAAM,EACzB,kBAAkB,CAAC,OAAO,CAC3B,CAAC;IACF,CAAC,CAAC,iBAAiB,CACjB,GAAG,IAAI,cAAc,EACrB,eAAe,CAAC,MAAM,EACtB,eAAe,CAAC,OAAO,CACxB,CAAC;AACJ,CAAC;AAED,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/web/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,aAAa,YACxB,MAAM,EACN,UAAU,EACV,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,SAAS,EACT,WAAW,EACX,WAAW,EACX,aAAa,CACL,CAAC;AAEX,sCAAsC;AACtC,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,gCAAgC;AAChC,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;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AAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,yBAAyB;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,+EAA+E;IAC/E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,aAAa,CAAC,CAAC,SAAS,cAAc,EAC1D,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,OAAO,CAAC,CAmClB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vllnt/convex-analytics",
|
|
3
|
-
"version": "0.1.0
|
|
4
|
-
"description": "Generic, configurable analytics component for Convex
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Generic, configurable analytics component for Convex \u2014 any event, any dimension, any domain; rollup-on-write with funnels, retention, uniques",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"packageManager": "pnpm@9.15.0",
|
|
@@ -39,37 +39,42 @@
|
|
|
39
39
|
"LICENSE"
|
|
40
40
|
],
|
|
41
41
|
"scripts": {
|
|
42
|
-
"build": "rm -rf dist && tsc",
|
|
42
|
+
"build": "rm -rf dist && tsc && cp ../../README.md ../../LICENSE ./",
|
|
43
43
|
"test": "vitest run",
|
|
44
44
|
"test:watch": "vitest",
|
|
45
45
|
"test:coverage": "vitest run --coverage",
|
|
46
46
|
"typecheck": "tsc --noEmit",
|
|
47
47
|
"typecheck:ci": "tsc --noEmit",
|
|
48
|
-
"lint": "eslint src/",
|
|
48
|
+
"lint": "pnpm --dir ../.. check:agents && eslint src/",
|
|
49
49
|
"generate:llms": "node scripts/generate-llms.mjs",
|
|
50
|
-
"preversion": "pnpm install --frozen-lockfile && pnpm build && pnpm test:coverage && pnpm typecheck && pnpm generate:llms"
|
|
50
|
+
"preversion": "pnpm install --frozen-lockfile && pnpm build && pnpm test:coverage && pnpm typecheck && pnpm generate:llms",
|
|
51
|
+
"codegen": "node scripts/codegen.mjs",
|
|
52
|
+
"build:codegen": "pnpm codegen && pnpm build"
|
|
51
53
|
},
|
|
52
54
|
"dependencies": {
|
|
53
|
-
"@convex-dev/aggregate": "^0.
|
|
55
|
+
"@convex-dev/aggregate": "^0.3.0",
|
|
54
56
|
"@convex-dev/rate-limiter": "^0.3.2",
|
|
55
|
-
"@convex-dev/sharded-counter": "^0.2.
|
|
56
|
-
"convex": "^1.
|
|
57
|
+
"@convex-dev/sharded-counter": "^0.2.1",
|
|
58
|
+
"convex": "^1.45.0"
|
|
57
59
|
},
|
|
58
60
|
"devDependencies": {
|
|
59
|
-
"@edge-runtime/vm": "^
|
|
60
|
-
"@testing-library/react": "^16.
|
|
61
|
-
"@types/react": "^19.
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
61
|
+
"@edge-runtime/vm": "^5.0.0",
|
|
62
|
+
"@testing-library/react": "^16.3.3",
|
|
63
|
+
"@types/react": "^19.2.18",
|
|
64
|
+
"@typescript/native": "npm:typescript@7.0.2",
|
|
65
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
66
|
+
"@vllnt/eslint-config": "2.0.0",
|
|
67
|
+
"@vllnt/typescript": "2.0.0",
|
|
68
|
+
"convex-test": "^0.0.56",
|
|
69
|
+
"jsdom": "^29.1.1",
|
|
70
|
+
"react": "^19.2.8",
|
|
71
|
+
"react-dom": "^19.2.8",
|
|
72
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
73
|
+
"vite": "^8.2.2",
|
|
74
|
+
"vitest": "^4.1.11"
|
|
70
75
|
},
|
|
71
76
|
"peerDependencies": {
|
|
72
|
-
"convex": "
|
|
77
|
+
"convex": "^1.45.0",
|
|
73
78
|
"react": ">=18.0.0"
|
|
74
79
|
},
|
|
75
80
|
"peerDependenciesMeta": {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
/**
|
|
3
3
|
* Generated `api` utility.
|
|
4
|
+
*
|
|
4
5
|
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
5
8
|
* @module
|
|
6
9
|
*/
|
|
7
10
|
|
|
11
|
+
import type * as http from "../http.js";
|
|
12
|
+
import type * as internal_mutations from "../internal_mutations.js";
|
|
8
13
|
import type * as mutations from "../mutations.js";
|
|
9
14
|
import type * as queries from "../queries.js";
|
|
10
|
-
import type * as
|
|
11
|
-
import type * as http from "../http.js";
|
|
15
|
+
import type * as validators from "../validators.js";
|
|
12
16
|
|
|
13
17
|
import type {
|
|
14
18
|
ApiFromModules,
|
|
@@ -18,18 +22,41 @@ import type {
|
|
|
18
22
|
import { anyApi, componentsGeneric } from "convex/server";
|
|
19
23
|
|
|
20
24
|
const fullApi: ApiFromModules<{
|
|
25
|
+
http: typeof http;
|
|
26
|
+
internal_mutations: typeof internal_mutations;
|
|
21
27
|
mutations: typeof mutations;
|
|
22
28
|
queries: typeof queries;
|
|
23
|
-
|
|
24
|
-
http: typeof http;
|
|
29
|
+
validators: typeof validators;
|
|
25
30
|
}> = anyApi as any;
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
/**
|
|
33
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
34
|
+
*
|
|
35
|
+
* Usage:
|
|
36
|
+
* ```js
|
|
37
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export const api: FilterApi<
|
|
41
|
+
typeof fullApi,
|
|
42
|
+
FunctionReference<any, "public">
|
|
43
|
+
> = anyApi as any;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A utility for referencing Convex functions in your app's internal API.
|
|
47
|
+
*
|
|
48
|
+
* Usage:
|
|
49
|
+
* ```js
|
|
50
|
+
* const myFunctionReference = internal.myModule.myFunction;
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
29
53
|
export const internal: FilterApi<
|
|
30
54
|
typeof fullApi,
|
|
31
55
|
FunctionReference<any, "internal">
|
|
32
|
-
> =
|
|
56
|
+
> = anyApi as any;
|
|
33
57
|
|
|
34
|
-
export const components
|
|
35
|
-
|
|
58
|
+
export const components = componentsGeneric() as unknown as {
|
|
59
|
+
aggregate: import("@convex-dev/aggregate/_generated/component.js").ComponentApi<"aggregate">;
|
|
60
|
+
shardedCounter: import("@convex-dev/sharded-counter/_generated/component.js").ComponentApi<"shardedCounter">;
|
|
61
|
+
rateLimiter: import("@convex-dev/rate-limiter/_generated/component.js").ComponentApi<"rateLimiter">;
|
|
62
|
+
};
|