convex-tracer 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 +201 -0
- package/README.md +592 -0
- package/dist/client/_generated/_ignore.d.ts +1 -0
- package/dist/client/_generated/_ignore.d.ts.map +1 -0
- package/dist/client/_generated/_ignore.js +3 -0
- package/dist/client/_generated/_ignore.js.map +1 -0
- package/dist/client/helpers.d.ts +31 -0
- package/dist/client/helpers.d.ts.map +1 -0
- package/dist/client/helpers.js +177 -0
- package/dist/client/helpers.js.map +1 -0
- package/dist/client/index.d.ts +210 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +355 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/tracer-api/index.d.ts +27 -0
- package/dist/client/tracer-api/index.d.ts.map +1 -0
- package/dist/client/tracer-api/index.js +177 -0
- package/dist/client/tracer-api/index.js.map +1 -0
- package/dist/client/tracer-api/types.d.ts +143 -0
- package/dist/client/tracer-api/types.d.ts.map +1 -0
- package/dist/client/tracer-api/types.js +2 -0
- package/dist/client/tracer-api/types.js.map +1 -0
- package/dist/client/types.d.ts +168 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +2 -0
- package/dist/client/types.js.map +1 -0
- package/dist/component/_generated/api.d.ts +36 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +31 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +139 -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/dist/component/_generated/server.d.ts +121 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +78 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/convex.config.d.ts +3 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +3 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/lib.d.ts +161 -0
- package/dist/component/lib.d.ts.map +1 -0
- package/dist/component/lib.js +349 -0
- package/dist/component/lib.js.map +1 -0
- package/dist/component/schema.d.ts +75 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +46 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/component/types.d.ts +286 -0
- package/dist/component/types.d.ts.map +1 -0
- package/dist/component/types.js +28 -0
- package/dist/component/types.js.map +1 -0
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +11 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/types.d.ts +8 -0
- package/dist/react/types.d.ts.map +1 -0
- package/dist/react/types.js +2 -0
- package/dist/react/types.js.map +1 -0
- package/package.json +121 -0
- package/src/client/_generated/_ignore.ts +1 -0
- package/src/client/helpers.ts +278 -0
- package/src/client/index.ts +593 -0
- package/src/client/setup.test.ts +26 -0
- package/src/client/tracer-api/index.ts +235 -0
- package/src/client/tracer-api/types.ts +168 -0
- package/src/client/types.ts +257 -0
- package/src/component/_generated/api.ts +52 -0
- package/src/component/_generated/component.ts +199 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +161 -0
- package/src/component/convex.config.ts +3 -0
- package/src/component/lib.ts +399 -0
- package/src/component/schema.ts +62 -0
- package/src/component/setup.test.ts +11 -0
- package/src/component/types.ts +38 -0
- package/src/react/index.ts +36 -0
- package/src/react/types.ts +15 -0
- package/src/test.ts +18 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { type Infer } from "convex/values";
|
|
2
|
+
export declare const vTrace: import("convex/values").VObject<{
|
|
3
|
+
metadata?: Record<string, any> | undefined;
|
|
4
|
+
userId?: string | undefined;
|
|
5
|
+
preserve?: boolean | undefined;
|
|
6
|
+
status: "error" | "success" | "pending";
|
|
7
|
+
sampleRate: number;
|
|
8
|
+
updatedAt: number;
|
|
9
|
+
_creationTime: number;
|
|
10
|
+
_id: string;
|
|
11
|
+
}, {
|
|
12
|
+
status: import("convex/values").VUnion<"error" | "success" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"success", "required">, import("convex/values").VLiteral<"error", "required">], "required", never>;
|
|
13
|
+
sampleRate: import("convex/values").VFloat64<number, "required">;
|
|
14
|
+
preserve: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
15
|
+
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
16
|
+
metadata: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
|
|
17
|
+
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
18
|
+
_id: import("convex/values").VString<string, "required">;
|
|
19
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
20
|
+
}, "required", "status" | "metadata" | "sampleRate" | "userId" | "preserve" | "updatedAt" | `metadata.${string}` | "_creationTime" | "_id">;
|
|
21
|
+
export declare const vSpan: import("convex/values").VObject<{
|
|
22
|
+
error?: string | undefined;
|
|
23
|
+
duration?: number | undefined;
|
|
24
|
+
endTime?: number | undefined;
|
|
25
|
+
result?: any;
|
|
26
|
+
status: "error" | "success" | "pending";
|
|
27
|
+
metadata?: Record<string, any> | undefined;
|
|
28
|
+
source: "frontend" | "backend";
|
|
29
|
+
spanName: string;
|
|
30
|
+
startTime: number;
|
|
31
|
+
functionName?: string | undefined;
|
|
32
|
+
args?: any;
|
|
33
|
+
parentSpanId?: string | undefined;
|
|
34
|
+
traceId: string;
|
|
35
|
+
_creationTime: number;
|
|
36
|
+
_id: string;
|
|
37
|
+
}, {
|
|
38
|
+
error: import("convex/values").VString<string | undefined, "optional">;
|
|
39
|
+
duration: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
40
|
+
endTime: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
41
|
+
result: import("convex/values").VAny<any, "optional", string>;
|
|
42
|
+
status: import("convex/values").VUnion<"error" | "success" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"success", "required">, import("convex/values").VLiteral<"error", "required">], "required", never>;
|
|
43
|
+
metadata: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
|
|
44
|
+
source: import("convex/values").VUnion<"frontend" | "backend", [import("convex/values").VLiteral<"frontend", "required">, import("convex/values").VLiteral<"backend", "required">], "required", never>;
|
|
45
|
+
spanName: import("convex/values").VString<string, "required">;
|
|
46
|
+
startTime: import("convex/values").VFloat64<number, "required">;
|
|
47
|
+
functionName: import("convex/values").VString<string | undefined, "optional">;
|
|
48
|
+
args: import("convex/values").VAny<any, "optional", string>;
|
|
49
|
+
_id: import("convex/values").VString<string, "required">;
|
|
50
|
+
traceId: import("convex/values").VString<string, "required">;
|
|
51
|
+
parentSpanId: import("convex/values").VString<string | undefined, "optional">;
|
|
52
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
53
|
+
}, "required", "error" | "traceId" | "duration" | "endTime" | "result" | "status" | "metadata" | "source" | `metadata.${string}` | "_creationTime" | "parentSpanId" | "spanName" | "startTime" | "functionName" | "args" | `result.${string}` | `args.${string}` | "_id">;
|
|
54
|
+
export declare const vLog: import("convex/values").VObject<{
|
|
55
|
+
metadata?: Record<string, any> | undefined;
|
|
56
|
+
severity: "info" | "warn" | "error";
|
|
57
|
+
timestamp: number;
|
|
58
|
+
message: string;
|
|
59
|
+
spanId: string;
|
|
60
|
+
_creationTime: number;
|
|
61
|
+
_id: string;
|
|
62
|
+
}, {
|
|
63
|
+
metadata: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
|
|
64
|
+
severity: import("convex/values").VUnion<"info" | "warn" | "error", [import("convex/values").VLiteral<"info", "required">, import("convex/values").VLiteral<"warn", "required">, import("convex/values").VLiteral<"error", "required">], "required", never>;
|
|
65
|
+
timestamp: import("convex/values").VFloat64<number, "required">;
|
|
66
|
+
message: import("convex/values").VString<string, "required">;
|
|
67
|
+
_id: import("convex/values").VString<string, "required">;
|
|
68
|
+
spanId: import("convex/values").VString<string, "required">;
|
|
69
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
70
|
+
}, "required", "spanId" | "metadata" | `metadata.${string}` | "_creationTime" | "severity" | "timestamp" | "message" | "_id">;
|
|
71
|
+
export declare const vSpanWithLogs: import("convex/values").VObject<{
|
|
72
|
+
error?: string | undefined;
|
|
73
|
+
duration?: number | undefined;
|
|
74
|
+
endTime?: number | undefined;
|
|
75
|
+
result?: any;
|
|
76
|
+
status: "error" | "success" | "pending";
|
|
77
|
+
metadata?: Record<string, any> | undefined;
|
|
78
|
+
source: "frontend" | "backend";
|
|
79
|
+
spanName: string;
|
|
80
|
+
startTime: number;
|
|
81
|
+
functionName?: string | undefined;
|
|
82
|
+
args?: any;
|
|
83
|
+
parentSpanId?: string | undefined;
|
|
84
|
+
traceId: string;
|
|
85
|
+
_creationTime: number;
|
|
86
|
+
_id: string;
|
|
87
|
+
logs?: {
|
|
88
|
+
metadata?: Record<string, any> | undefined;
|
|
89
|
+
severity: "info" | "warn" | "error";
|
|
90
|
+
timestamp: number;
|
|
91
|
+
message: string;
|
|
92
|
+
spanId: string;
|
|
93
|
+
_creationTime: number;
|
|
94
|
+
_id: string;
|
|
95
|
+
}[] | undefined;
|
|
96
|
+
children?: any[] | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
error: import("convex/values").VString<string | undefined, "optional">;
|
|
99
|
+
duration: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
100
|
+
endTime: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
101
|
+
result: import("convex/values").VAny<any, "optional", string>;
|
|
102
|
+
status: import("convex/values").VUnion<"error" | "success" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"success", "required">, import("convex/values").VLiteral<"error", "required">], "required", never>;
|
|
103
|
+
metadata: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
|
|
104
|
+
source: import("convex/values").VUnion<"frontend" | "backend", [import("convex/values").VLiteral<"frontend", "required">, import("convex/values").VLiteral<"backend", "required">], "required", never>;
|
|
105
|
+
spanName: import("convex/values").VString<string, "required">;
|
|
106
|
+
startTime: import("convex/values").VFloat64<number, "required">;
|
|
107
|
+
functionName: import("convex/values").VString<string | undefined, "optional">;
|
|
108
|
+
args: import("convex/values").VAny<any, "optional", string>;
|
|
109
|
+
_id: import("convex/values").VString<string, "required">;
|
|
110
|
+
traceId: import("convex/values").VString<string, "required">;
|
|
111
|
+
parentSpanId: import("convex/values").VString<string | undefined, "optional">;
|
|
112
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
113
|
+
logs: import("convex/values").VArray<{
|
|
114
|
+
metadata?: Record<string, any> | undefined;
|
|
115
|
+
severity: "info" | "warn" | "error";
|
|
116
|
+
timestamp: number;
|
|
117
|
+
message: string;
|
|
118
|
+
spanId: string;
|
|
119
|
+
_creationTime: number;
|
|
120
|
+
_id: string;
|
|
121
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
122
|
+
metadata?: Record<string, any> | undefined;
|
|
123
|
+
severity: "info" | "warn" | "error";
|
|
124
|
+
timestamp: number;
|
|
125
|
+
message: string;
|
|
126
|
+
spanId: string;
|
|
127
|
+
_creationTime: number;
|
|
128
|
+
_id: string;
|
|
129
|
+
}, {
|
|
130
|
+
metadata: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
|
|
131
|
+
severity: import("convex/values").VUnion<"info" | "warn" | "error", [import("convex/values").VLiteral<"info", "required">, import("convex/values").VLiteral<"warn", "required">, import("convex/values").VLiteral<"error", "required">], "required", never>;
|
|
132
|
+
timestamp: import("convex/values").VFloat64<number, "required">;
|
|
133
|
+
message: import("convex/values").VString<string, "required">;
|
|
134
|
+
_id: import("convex/values").VString<string, "required">;
|
|
135
|
+
spanId: import("convex/values").VString<string, "required">;
|
|
136
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
137
|
+
}, "required", "spanId" | "metadata" | `metadata.${string}` | "_creationTime" | "severity" | "timestamp" | "message" | "_id">, "optional">;
|
|
138
|
+
children: import("convex/values").VArray<any[] | undefined, import("convex/values").VAny<any, "required", string>, "optional">;
|
|
139
|
+
}, "required", "error" | "traceId" | "duration" | "endTime" | "result" | "status" | "metadata" | "source" | `metadata.${string}` | "_creationTime" | "parentSpanId" | "spanName" | "startTime" | "functionName" | "args" | `result.${string}` | `args.${string}` | "logs" | "_id" | "children">;
|
|
140
|
+
export declare const vCompleteTrace: import("convex/values").VObject<{
|
|
141
|
+
metadata?: Record<string, any> | undefined;
|
|
142
|
+
userId?: string | undefined;
|
|
143
|
+
preserve?: boolean | undefined;
|
|
144
|
+
status: "error" | "success" | "pending";
|
|
145
|
+
sampleRate: number;
|
|
146
|
+
updatedAt: number;
|
|
147
|
+
_creationTime: number;
|
|
148
|
+
_id: string;
|
|
149
|
+
spans: {
|
|
150
|
+
error?: string | undefined;
|
|
151
|
+
duration?: number | undefined;
|
|
152
|
+
endTime?: number | undefined;
|
|
153
|
+
result?: any;
|
|
154
|
+
status: "error" | "success" | "pending";
|
|
155
|
+
metadata?: Record<string, any> | undefined;
|
|
156
|
+
source: "frontend" | "backend";
|
|
157
|
+
spanName: string;
|
|
158
|
+
startTime: number;
|
|
159
|
+
functionName?: string | undefined;
|
|
160
|
+
args?: any;
|
|
161
|
+
parentSpanId?: string | undefined;
|
|
162
|
+
traceId: string;
|
|
163
|
+
_creationTime: number;
|
|
164
|
+
_id: string;
|
|
165
|
+
logs?: {
|
|
166
|
+
metadata?: Record<string, any> | undefined;
|
|
167
|
+
severity: "info" | "warn" | "error";
|
|
168
|
+
timestamp: number;
|
|
169
|
+
message: string;
|
|
170
|
+
spanId: string;
|
|
171
|
+
_creationTime: number;
|
|
172
|
+
_id: string;
|
|
173
|
+
}[] | undefined;
|
|
174
|
+
children?: any[] | undefined;
|
|
175
|
+
}[];
|
|
176
|
+
}, {
|
|
177
|
+
status: import("convex/values").VUnion<"error" | "success" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"success", "required">, import("convex/values").VLiteral<"error", "required">], "required", never>;
|
|
178
|
+
sampleRate: import("convex/values").VFloat64<number, "required">;
|
|
179
|
+
preserve: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
180
|
+
updatedAt: import("convex/values").VFloat64<number, "required">;
|
|
181
|
+
metadata: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
|
|
182
|
+
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
183
|
+
_id: import("convex/values").VString<string, "required">;
|
|
184
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
185
|
+
spans: import("convex/values").VArray<{
|
|
186
|
+
error?: string | undefined;
|
|
187
|
+
duration?: number | undefined;
|
|
188
|
+
endTime?: number | undefined;
|
|
189
|
+
result?: any;
|
|
190
|
+
status: "error" | "success" | "pending";
|
|
191
|
+
metadata?: Record<string, any> | undefined;
|
|
192
|
+
source: "frontend" | "backend";
|
|
193
|
+
spanName: string;
|
|
194
|
+
startTime: number;
|
|
195
|
+
functionName?: string | undefined;
|
|
196
|
+
args?: any;
|
|
197
|
+
parentSpanId?: string | undefined;
|
|
198
|
+
traceId: string;
|
|
199
|
+
_creationTime: number;
|
|
200
|
+
_id: string;
|
|
201
|
+
logs?: {
|
|
202
|
+
metadata?: Record<string, any> | undefined;
|
|
203
|
+
severity: "info" | "warn" | "error";
|
|
204
|
+
timestamp: number;
|
|
205
|
+
message: string;
|
|
206
|
+
spanId: string;
|
|
207
|
+
_creationTime: number;
|
|
208
|
+
_id: string;
|
|
209
|
+
}[] | undefined;
|
|
210
|
+
children?: any[] | undefined;
|
|
211
|
+
}[], import("convex/values").VObject<{
|
|
212
|
+
error?: string | undefined;
|
|
213
|
+
duration?: number | undefined;
|
|
214
|
+
endTime?: number | undefined;
|
|
215
|
+
result?: any;
|
|
216
|
+
status: "error" | "success" | "pending";
|
|
217
|
+
metadata?: Record<string, any> | undefined;
|
|
218
|
+
source: "frontend" | "backend";
|
|
219
|
+
spanName: string;
|
|
220
|
+
startTime: number;
|
|
221
|
+
functionName?: string | undefined;
|
|
222
|
+
args?: any;
|
|
223
|
+
parentSpanId?: string | undefined;
|
|
224
|
+
traceId: string;
|
|
225
|
+
_creationTime: number;
|
|
226
|
+
_id: string;
|
|
227
|
+
logs?: {
|
|
228
|
+
metadata?: Record<string, any> | undefined;
|
|
229
|
+
severity: "info" | "warn" | "error";
|
|
230
|
+
timestamp: number;
|
|
231
|
+
message: string;
|
|
232
|
+
spanId: string;
|
|
233
|
+
_creationTime: number;
|
|
234
|
+
_id: string;
|
|
235
|
+
}[] | undefined;
|
|
236
|
+
children?: any[] | undefined;
|
|
237
|
+
}, {
|
|
238
|
+
error: import("convex/values").VString<string | undefined, "optional">;
|
|
239
|
+
duration: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
240
|
+
endTime: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
241
|
+
result: import("convex/values").VAny<any, "optional", string>;
|
|
242
|
+
status: import("convex/values").VUnion<"error" | "success" | "pending", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"success", "required">, import("convex/values").VLiteral<"error", "required">], "required", never>;
|
|
243
|
+
metadata: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
|
|
244
|
+
source: import("convex/values").VUnion<"frontend" | "backend", [import("convex/values").VLiteral<"frontend", "required">, import("convex/values").VLiteral<"backend", "required">], "required", never>;
|
|
245
|
+
spanName: import("convex/values").VString<string, "required">;
|
|
246
|
+
startTime: import("convex/values").VFloat64<number, "required">;
|
|
247
|
+
functionName: import("convex/values").VString<string | undefined, "optional">;
|
|
248
|
+
args: import("convex/values").VAny<any, "optional", string>;
|
|
249
|
+
_id: import("convex/values").VString<string, "required">;
|
|
250
|
+
traceId: import("convex/values").VString<string, "required">;
|
|
251
|
+
parentSpanId: import("convex/values").VString<string | undefined, "optional">;
|
|
252
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
253
|
+
logs: import("convex/values").VArray<{
|
|
254
|
+
metadata?: Record<string, any> | undefined;
|
|
255
|
+
severity: "info" | "warn" | "error";
|
|
256
|
+
timestamp: number;
|
|
257
|
+
message: string;
|
|
258
|
+
spanId: string;
|
|
259
|
+
_creationTime: number;
|
|
260
|
+
_id: string;
|
|
261
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
262
|
+
metadata?: Record<string, any> | undefined;
|
|
263
|
+
severity: "info" | "warn" | "error";
|
|
264
|
+
timestamp: number;
|
|
265
|
+
message: string;
|
|
266
|
+
spanId: string;
|
|
267
|
+
_creationTime: number;
|
|
268
|
+
_id: string;
|
|
269
|
+
}, {
|
|
270
|
+
metadata: import("convex/values").VRecord<Record<string, any> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VAny<any, "required", string>, "optional", string>;
|
|
271
|
+
severity: import("convex/values").VUnion<"info" | "warn" | "error", [import("convex/values").VLiteral<"info", "required">, import("convex/values").VLiteral<"warn", "required">, import("convex/values").VLiteral<"error", "required">], "required", never>;
|
|
272
|
+
timestamp: import("convex/values").VFloat64<number, "required">;
|
|
273
|
+
message: import("convex/values").VString<string, "required">;
|
|
274
|
+
_id: import("convex/values").VString<string, "required">;
|
|
275
|
+
spanId: import("convex/values").VString<string, "required">;
|
|
276
|
+
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
277
|
+
}, "required", "spanId" | "metadata" | `metadata.${string}` | "_creationTime" | "severity" | "timestamp" | "message" | "_id">, "optional">;
|
|
278
|
+
children: import("convex/values").VArray<any[] | undefined, import("convex/values").VAny<any, "required", string>, "optional">;
|
|
279
|
+
}, "required", "error" | "traceId" | "duration" | "endTime" | "result" | "status" | "metadata" | "source" | `metadata.${string}` | "_creationTime" | "parentSpanId" | "spanName" | "startTime" | "functionName" | "args" | `result.${string}` | `args.${string}` | "logs" | "_id" | "children">, "required">;
|
|
280
|
+
}, "required", "status" | "metadata" | "sampleRate" | "userId" | "preserve" | "updatedAt" | `metadata.${string}` | "_creationTime" | "spans" | "_id">;
|
|
281
|
+
export type Trace = Infer<typeof vTrace>;
|
|
282
|
+
export type Span = Infer<typeof vSpan>;
|
|
283
|
+
export type Log = Infer<typeof vLog>;
|
|
284
|
+
export type SpanWithLogs = Infer<typeof vSpanWithLogs>;
|
|
285
|
+
export type CompleteTrace = Infer<typeof vCompleteTrace>;
|
|
286
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/component/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAG9C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;2IAGjB,CAAC;AAEH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yQAQd,CAAC;AAEL,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;6HAIf,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+RAGxB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qJAEzB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AACzC,MAAM,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AACvC,MAAM,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACrC,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACvD,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
import schema from "./schema";
|
|
3
|
+
export const vTrace = schema.tables.traces.validator.extend({
|
|
4
|
+
_id: v.string(),
|
|
5
|
+
_creationTime: v.number(),
|
|
6
|
+
});
|
|
7
|
+
export const vSpan = schema.tables.spans.validator
|
|
8
|
+
.omit("parentSpanId")
|
|
9
|
+
.omit("traceId")
|
|
10
|
+
.extend({
|
|
11
|
+
_id: v.string(),
|
|
12
|
+
traceId: v.string(),
|
|
13
|
+
parentSpanId: v.optional(v.string()),
|
|
14
|
+
_creationTime: v.number(),
|
|
15
|
+
});
|
|
16
|
+
export const vLog = schema.tables.logs.validator.omit("spanId").extend({
|
|
17
|
+
_id: v.string(),
|
|
18
|
+
spanId: v.string(),
|
|
19
|
+
_creationTime: v.number(),
|
|
20
|
+
});
|
|
21
|
+
export const vSpanWithLogs = vSpan.extend({
|
|
22
|
+
logs: v.optional(v.array(vLog)),
|
|
23
|
+
children: v.optional(v.array(v.any())),
|
|
24
|
+
});
|
|
25
|
+
export const vCompleteTrace = vTrace.extend({
|
|
26
|
+
spans: v.array(vSpanWithLogs),
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src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AAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;CAC9B,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FunctionReference, FunctionReturnType } from "convex/server";
|
|
2
|
+
import type { EmptyObject, OptionalTracedArgs } from "./types";
|
|
3
|
+
export declare function useTracedQuery<TQuery extends FunctionReference<"mutation">>(fnRef: TQuery): OptionalTracedArgs<TQuery> extends [args?: EmptyObject] ? (args?: EmptyObject) => Promise<FunctionReturnType<TQuery>> : OptionalTracedArgs<TQuery> extends [args: infer Args] ? (args: Args) => Promise<FunctionReturnType<TQuery>> : never;
|
|
4
|
+
export declare function useTracedMutation<TMutation extends FunctionReference<"mutation">>(fnRef: TMutation): OptionalTracedArgs<TMutation> extends [args?: EmptyObject] ? (args?: EmptyObject) => Promise<FunctionReturnType<TMutation>> : OptionalTracedArgs<TMutation> extends [args: infer Args] ? (args: Args) => Promise<FunctionReturnType<TMutation>> : never;
|
|
5
|
+
export declare function useTracedAction<TAction extends FunctionReference<"action">>(fnRef: TAction): OptionalTracedArgs<TAction> extends [args?: EmptyObject] ? (args?: EmptyObject) => Promise<FunctionReturnType<TAction>> : OptionalTracedArgs<TAction> extends [args: infer Args] ? (args: Args) => Promise<FunctionReturnType<TAction>> : never;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE/D,wBAAgB,cAAc,CAAC,MAAM,SAAS,iBAAiB,CAAC,UAAU,CAAC,EACzE,KAAK,EAAE,MAAM,GACZ,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ation } from "convex/react";
|
|
2
|
+
export function useTracedQuery(fnRef) {
|
|
3
|
+
return useMutation(fnRef);
|
|
4
|
+
}
|
|
5
|
+
export function useTracedMutation(fnRef) {
|
|
6
|
+
return useMutation(fnRef);
|
|
7
|
+
}
|
|
8
|
+
export function useTracedAction(fnRef) {
|
|
9
|
+
return useAction(fnRef);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAKtD,MAAM,UAAU,cAAc,CAC5B,KAAa;IAMb,OAAO,WAAW,CAAC,KAAK,CAAQ,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAG/B,KAAgB;IAMhB,OAAO,WAAW,CAAC,KAAK,CAAQ,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,KAAc;IAMd,OAAO,SAAS,CAAC,KAAK,CAAQ,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AnyFunctionReference } from "../client/types";
|
|
2
|
+
export type EmptyObject = Record<string, never>;
|
|
3
|
+
export type OmitTraceContext<T> = T extends {
|
|
4
|
+
__traceContext?: any;
|
|
5
|
+
} ? Omit<T, "__traceContext"> : T;
|
|
6
|
+
export type ArgsWithoutTrace<Args> = Args extends Record<string, any> ? OmitTraceContext<Args> : Args;
|
|
7
|
+
export type OptionalTracedArgs<FuncRef extends AnyFunctionReference> = keyof OmitTraceContext<FuncRef["_args"]> extends never ? [args?: EmptyObject] : [args: OmitTraceContext<FuncRef["_args"]>];
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/react/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEhD,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,cAAc,CAAC,EAAE,GAAG,CAAA;CAAE,GAChE,IAAI,CAAC,CAAC,EAAE,gBAAgB,CAAC,GACzB,CAAC,CAAC;AAEN,MAAM,MAAM,gBAAgB,CAAC,IAAI,IAC/B,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAEnE,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,oBAAoB,IACjE,MAAM,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,SAAS,KAAK,GAClD,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,GACpB,CAAC,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/react/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "convex-tracer",
|
|
3
|
+
"description": "A Tracer component for Convex.",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/Moumen-io/convex-tracer.git"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/Moumen-io/convex-tracer#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/Moumen-io/convex-tracer/issues"
|
|
11
|
+
},
|
|
12
|
+
"version": "0.1.0",
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"convex",
|
|
16
|
+
"component",
|
|
17
|
+
"tracing",
|
|
18
|
+
"observability",
|
|
19
|
+
"debug"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "run-p -r 'dev:*'",
|
|
24
|
+
"dev:backend": "convex dev --typecheck-components",
|
|
25
|
+
"dev:frontend": "cd example && vite --clearScreen false",
|
|
26
|
+
"dev:build": "chokidar 'tsconfig*.json' 'src/**/*.ts' -i '**/*.test.ts' -c 'npm run build:codegen' --initial",
|
|
27
|
+
"predev": "path-exists .env.local dist || (npm run build && convex dev --once)",
|
|
28
|
+
"build": "tsc --project ./tsconfig.build.json",
|
|
29
|
+
"build:codegen": "npx convex codegen --component-dir ./src/component && npm run build",
|
|
30
|
+
"build:clean": "rm -rf dist *.tsbuildinfo && npm run build:codegen",
|
|
31
|
+
"typecheck": "tsc --noEmit && tsc -p example && tsc -p example/convex",
|
|
32
|
+
"lint": "eslint .",
|
|
33
|
+
"all": "run-p -r 'dev:*' 'test:watch'",
|
|
34
|
+
"test": "vitest run --typecheck",
|
|
35
|
+
"test:watch": "vitest --typecheck --clearScreen false",
|
|
36
|
+
"test:debug": "vitest --inspect-brk --no-file-parallelism",
|
|
37
|
+
"test:coverage": "vitest run --coverage --coverage.reporter=text",
|
|
38
|
+
"preversion": "npm ci && npm run build:clean && run-p test lint typecheck",
|
|
39
|
+
"alpha": "npm version prerelease --preid alpha && npm publish --tag alpha && git push --follow-tags",
|
|
40
|
+
"release": "npm version patch && npm publish && git push --follow-tags",
|
|
41
|
+
"version": "vim -c 'normal o' -c 'normal o## '$npm_package_version CHANGELOG.md && prettier -w CHANGELOG.md && git add CHANGELOG.md"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist",
|
|
45
|
+
"src"
|
|
46
|
+
],
|
|
47
|
+
"exports": {
|
|
48
|
+
"./package.json": "./package.json",
|
|
49
|
+
".": {
|
|
50
|
+
"types": "./dist/client/index.d.ts",
|
|
51
|
+
"default": "./dist/client/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./react": {
|
|
54
|
+
"types": "./dist/react/index.d.ts",
|
|
55
|
+
"default": "./dist/react/index.js"
|
|
56
|
+
},
|
|
57
|
+
"./test": "./src/test.ts",
|
|
58
|
+
"./_generated/component.js": {
|
|
59
|
+
"types": "./dist/component/_generated/component.d.ts"
|
|
60
|
+
},
|
|
61
|
+
"./_generated/component": {
|
|
62
|
+
"types": "./dist/component/_generated/component.d.ts"
|
|
63
|
+
},
|
|
64
|
+
"./convex.config.js": {
|
|
65
|
+
"types": "./dist/component/convex.config.d.ts",
|
|
66
|
+
"default": "./dist/component/convex.config.js"
|
|
67
|
+
},
|
|
68
|
+
"./convex.config": {
|
|
69
|
+
"types": "./dist/component/convex.config.d.ts",
|
|
70
|
+
"default": "./dist/component/convex.config.js"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"convex": "^1.29.3",
|
|
75
|
+
"react": "^18.3.1 || ^19.0.0"
|
|
76
|
+
},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@convex-dev/eslint-plugin": "^1.1.1",
|
|
79
|
+
"@edge-runtime/vm": "^5.0.0",
|
|
80
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
81
|
+
"@eslint/js": "9.39.1",
|
|
82
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
83
|
+
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
84
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
85
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
86
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
87
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
88
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
89
|
+
"@types/node": "^24.10.4",
|
|
90
|
+
"@types/react": "^19.2.7",
|
|
91
|
+
"@types/react-dom": "^19.2.3",
|
|
92
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
93
|
+
"chokidar-cli": "3.0.0",
|
|
94
|
+
"class-variance-authority": "^0.7.1",
|
|
95
|
+
"clsx": "^2.1.1",
|
|
96
|
+
"convex": "1.31.0",
|
|
97
|
+
"convex-test": "0.0.40",
|
|
98
|
+
"cpy-cli": "^6.0.0",
|
|
99
|
+
"eslint": "9.39.1",
|
|
100
|
+
"eslint-plugin-react": "^7.37.5",
|
|
101
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
102
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
103
|
+
"globals": "^17.0.0",
|
|
104
|
+
"lucide-react": "^0.562.0",
|
|
105
|
+
"npm-run-all2": "8.0.4",
|
|
106
|
+
"path-exists-cli": "2.0.0",
|
|
107
|
+
"pkg-pr-new": "^0.0.60",
|
|
108
|
+
"prettier": "3.6.2",
|
|
109
|
+
"react": "^19.2.1",
|
|
110
|
+
"react-dom": "^19.2.1",
|
|
111
|
+
"tailwind-merge": "^3.4.0",
|
|
112
|
+
"tailwindcss": "^4.1.18",
|
|
113
|
+
"tw-animate-css": "^1.4.0",
|
|
114
|
+
"typescript": "5.9.3",
|
|
115
|
+
"typescript-eslint": "8.47.0",
|
|
116
|
+
"vite": "7.2.6",
|
|
117
|
+
"vitest": "4.0.17"
|
|
118
|
+
},
|
|
119
|
+
"types": "./dist/client/index.d.ts",
|
|
120
|
+
"module": "./dist/client/index.js"
|
|
121
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// This is only here so convex-test can detect a _generated folder
|