@storyshelf/db-sqlite 0.3.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -3
- package/dist/better-sqlite3.d.mts +29 -0
- package/dist/better-sqlite3.mjs +116 -0
- package/dist/better-sqlite3.mjs.map +1 -0
- package/dist/bun-sqlite.d.mts +30 -0
- package/dist/bun-sqlite.mjs +120 -0
- package/dist/bun-sqlite.mjs.map +1 -0
- package/dist/d1.d.mts +38 -0
- package/dist/d1.mjs +108 -0
- package/dist/d1.mjs.map +1 -0
- package/dist/ddl.d.mts +14 -0
- package/dist/ddl.mjs +342 -0
- package/dist/ddl.mjs.map +1 -0
- package/dist/drizzle-factory.d.mts +19 -0
- package/dist/drizzle-factory.mjs +121 -0
- package/dist/drizzle-factory.mjs.map +1 -0
- package/dist/index.mjs +102 -36
- package/dist/index.mjs.map +1 -1
- package/dist/schema/baseline.d.mts +204 -0
- package/dist/schema/baseline.mjs +23 -0
- package/dist/schema/baseline.mjs.map +1 -0
- package/dist/schema/build.d.mts +405 -0
- package/dist/schema/build.mjs +33 -0
- package/dist/schema/build.mjs.map +1 -0
- package/dist/schema/capture-attempt.d.mts +482 -0
- package/dist/schema/capture-attempt.mjs +40 -0
- package/dist/schema/capture-attempt.mjs.map +1 -0
- package/dist/schema/comment.d.mts +215 -0
- package/dist/schema/comment.mjs +26 -0
- package/dist/schema/comment.mjs.map +1 -0
- package/dist/schema/content-refs.d.mts +95 -0
- package/dist/schema/content-refs.mjs +16 -0
- package/dist/schema/content-refs.mjs.map +1 -0
- package/dist/schema/label.d.mts +288 -0
- package/dist/schema/label.mjs +30 -0
- package/dist/schema/label.mjs.map +1 -0
- package/dist/schema/member.d.mts +140 -0
- package/dist/schema/member.mjs +20 -0
- package/dist/schema/member.mjs.map +1 -0
- package/dist/schema/notification.d.mts +344 -0
- package/dist/schema/notification.mjs +33 -0
- package/dist/schema/notification.mjs.map +1 -0
- package/dist/schema/project-group-mapping.d.mts +119 -0
- package/dist/schema/project-group-mapping.mjs +18 -0
- package/dist/schema/project-group-mapping.mjs.map +1 -0
- package/dist/schema/project.d.mts +358 -0
- package/dist/schema/project.mjs +29 -0
- package/dist/schema/project.mjs.map +1 -0
- package/dist/schema/snapshot.d.mts +487 -0
- package/dist/schema/snapshot.mjs +38 -0
- package/dist/schema/snapshot.mjs.map +1 -0
- package/dist/schema/status-config.d.mts +157 -0
- package/dist/schema/status-config.mjs +20 -0
- package/dist/schema/status-config.mjs.map +1 -0
- package/dist/schema/token.d.mts +157 -0
- package/dist/schema/token.mjs +21 -0
- package/dist/schema/token.mjs.map +1 -0
- package/dist/schema/user-invite.d.mts +137 -0
- package/dist/schema/user-invite.mjs +19 -0
- package/dist/schema/user-invite.mjs.map +1 -0
- package/dist/schema/user.d.mts +238 -0
- package/dist/schema/user.mjs +23 -0
- package/dist/schema/user.mjs.map +1 -0
- package/dist/schema/webhook.d.mts +157 -0
- package/dist/schema/webhook.mjs +20 -0
- package/dist/schema/webhook.mjs.map +1 -0
- package/dist/schema.d.mts +47 -0
- package/dist/schema.mjs +46 -0
- package/dist/schema.mjs.map +1 -0
- package/dist/turso.d.mts +32 -0
- package/dist/turso.mjs +134 -0
- package/dist/turso.mjs.map +1 -0
- package/package.json +66 -10
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { JobStatus } from "@storyshelf/core/adapter/capture-queue";
|
|
4
|
+
//#region src/schema/capture-attempt.d.ts
|
|
5
|
+
/** Narrow `capture_attempts` table definition: one row per build capture run. */
|
|
6
|
+
declare const captureAttempts: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
7
|
+
name: "capture_attempts";
|
|
8
|
+
schema: undefined;
|
|
9
|
+
columns: {
|
|
10
|
+
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
11
|
+
name: "id";
|
|
12
|
+
tableName: "capture_attempts";
|
|
13
|
+
dataType: "string";
|
|
14
|
+
columnType: "SQLiteText";
|
|
15
|
+
data: string;
|
|
16
|
+
driverParam: string;
|
|
17
|
+
notNull: true;
|
|
18
|
+
hasDefault: false;
|
|
19
|
+
isPrimaryKey: true;
|
|
20
|
+
isAutoincrement: false;
|
|
21
|
+
hasRuntimeDefault: false;
|
|
22
|
+
enumValues: [string, ...string[]];
|
|
23
|
+
baseColumn: never;
|
|
24
|
+
identity: undefined;
|
|
25
|
+
generated: undefined;
|
|
26
|
+
}, {}, {
|
|
27
|
+
length: number | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
30
|
+
name: "project_id";
|
|
31
|
+
tableName: "capture_attempts";
|
|
32
|
+
dataType: "string";
|
|
33
|
+
columnType: "SQLiteText";
|
|
34
|
+
data: string;
|
|
35
|
+
driverParam: string;
|
|
36
|
+
notNull: true;
|
|
37
|
+
hasDefault: false;
|
|
38
|
+
isPrimaryKey: false;
|
|
39
|
+
isAutoincrement: false;
|
|
40
|
+
hasRuntimeDefault: false;
|
|
41
|
+
enumValues: [string, ...string[]];
|
|
42
|
+
baseColumn: never;
|
|
43
|
+
identity: undefined;
|
|
44
|
+
generated: undefined;
|
|
45
|
+
}, {}, {
|
|
46
|
+
length: number | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
buildId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
49
|
+
name: "build_id";
|
|
50
|
+
tableName: "capture_attempts";
|
|
51
|
+
dataType: "string";
|
|
52
|
+
columnType: "SQLiteText";
|
|
53
|
+
data: string;
|
|
54
|
+
driverParam: string;
|
|
55
|
+
notNull: true;
|
|
56
|
+
hasDefault: false;
|
|
57
|
+
isPrimaryKey: false;
|
|
58
|
+
isAutoincrement: false;
|
|
59
|
+
hasRuntimeDefault: false;
|
|
60
|
+
enumValues: [string, ...string[]];
|
|
61
|
+
baseColumn: never;
|
|
62
|
+
identity: undefined;
|
|
63
|
+
generated: undefined;
|
|
64
|
+
}, {}, {
|
|
65
|
+
length: number | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
attemptNo: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
68
|
+
name: "attempt_no";
|
|
69
|
+
tableName: "capture_attempts";
|
|
70
|
+
dataType: "number";
|
|
71
|
+
columnType: "SQLiteInteger";
|
|
72
|
+
data: number;
|
|
73
|
+
driverParam: number;
|
|
74
|
+
notNull: true;
|
|
75
|
+
hasDefault: false;
|
|
76
|
+
isPrimaryKey: false;
|
|
77
|
+
isAutoincrement: false;
|
|
78
|
+
hasRuntimeDefault: false;
|
|
79
|
+
enumValues: undefined;
|
|
80
|
+
baseColumn: never;
|
|
81
|
+
identity: undefined;
|
|
82
|
+
generated: undefined;
|
|
83
|
+
}, {}, {}>;
|
|
84
|
+
status: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
85
|
+
name: "status";
|
|
86
|
+
tableName: "capture_attempts";
|
|
87
|
+
dataType: "string";
|
|
88
|
+
columnType: "SQLiteText";
|
|
89
|
+
data: JobStatus;
|
|
90
|
+
driverParam: string;
|
|
91
|
+
notNull: true;
|
|
92
|
+
hasDefault: true;
|
|
93
|
+
isPrimaryKey: false;
|
|
94
|
+
isAutoincrement: false;
|
|
95
|
+
hasRuntimeDefault: false;
|
|
96
|
+
enumValues: [string, ...string[]];
|
|
97
|
+
baseColumn: never;
|
|
98
|
+
identity: undefined;
|
|
99
|
+
generated: undefined;
|
|
100
|
+
}, {}, {
|
|
101
|
+
length: number | undefined;
|
|
102
|
+
$type: JobStatus;
|
|
103
|
+
}>;
|
|
104
|
+
error: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
105
|
+
name: "error";
|
|
106
|
+
tableName: "capture_attempts";
|
|
107
|
+
dataType: "string";
|
|
108
|
+
columnType: "SQLiteText";
|
|
109
|
+
data: string;
|
|
110
|
+
driverParam: string;
|
|
111
|
+
notNull: false;
|
|
112
|
+
hasDefault: false;
|
|
113
|
+
isPrimaryKey: false;
|
|
114
|
+
isAutoincrement: false;
|
|
115
|
+
hasRuntimeDefault: false;
|
|
116
|
+
enumValues: [string, ...string[]];
|
|
117
|
+
baseColumn: never;
|
|
118
|
+
identity: undefined;
|
|
119
|
+
generated: undefined;
|
|
120
|
+
}, {}, {
|
|
121
|
+
length: number | undefined;
|
|
122
|
+
}>;
|
|
123
|
+
reqId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
124
|
+
name: "req_id";
|
|
125
|
+
tableName: "capture_attempts";
|
|
126
|
+
dataType: "string";
|
|
127
|
+
columnType: "SQLiteText";
|
|
128
|
+
data: string;
|
|
129
|
+
driverParam: string;
|
|
130
|
+
notNull: false;
|
|
131
|
+
hasDefault: false;
|
|
132
|
+
isPrimaryKey: false;
|
|
133
|
+
isAutoincrement: false;
|
|
134
|
+
hasRuntimeDefault: false;
|
|
135
|
+
enumValues: [string, ...string[]];
|
|
136
|
+
baseColumn: never;
|
|
137
|
+
identity: undefined;
|
|
138
|
+
generated: undefined;
|
|
139
|
+
}, {}, {
|
|
140
|
+
length: number | undefined;
|
|
141
|
+
}>;
|
|
142
|
+
storyCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
143
|
+
name: "story_count";
|
|
144
|
+
tableName: "capture_attempts";
|
|
145
|
+
dataType: "number";
|
|
146
|
+
columnType: "SQLiteInteger";
|
|
147
|
+
data: number;
|
|
148
|
+
driverParam: number;
|
|
149
|
+
notNull: true;
|
|
150
|
+
hasDefault: true;
|
|
151
|
+
isPrimaryKey: false;
|
|
152
|
+
isAutoincrement: false;
|
|
153
|
+
hasRuntimeDefault: false;
|
|
154
|
+
enumValues: undefined;
|
|
155
|
+
baseColumn: never;
|
|
156
|
+
identity: undefined;
|
|
157
|
+
generated: undefined;
|
|
158
|
+
}, {}, {}>;
|
|
159
|
+
failedCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
160
|
+
name: "failed_count";
|
|
161
|
+
tableName: "capture_attempts";
|
|
162
|
+
dataType: "number";
|
|
163
|
+
columnType: "SQLiteInteger";
|
|
164
|
+
data: number;
|
|
165
|
+
driverParam: number;
|
|
166
|
+
notNull: true;
|
|
167
|
+
hasDefault: true;
|
|
168
|
+
isPrimaryKey: false;
|
|
169
|
+
isAutoincrement: false;
|
|
170
|
+
hasRuntimeDefault: false;
|
|
171
|
+
enumValues: undefined;
|
|
172
|
+
baseColumn: never;
|
|
173
|
+
identity: undefined;
|
|
174
|
+
generated: undefined;
|
|
175
|
+
}, {}, {}>;
|
|
176
|
+
queuedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
177
|
+
name: "queued_at";
|
|
178
|
+
tableName: "capture_attempts";
|
|
179
|
+
dataType: "string";
|
|
180
|
+
columnType: "SQLiteText";
|
|
181
|
+
data: string;
|
|
182
|
+
driverParam: string;
|
|
183
|
+
notNull: true;
|
|
184
|
+
hasDefault: false;
|
|
185
|
+
isPrimaryKey: false;
|
|
186
|
+
isAutoincrement: false;
|
|
187
|
+
hasRuntimeDefault: false;
|
|
188
|
+
enumValues: [string, ...string[]];
|
|
189
|
+
baseColumn: never;
|
|
190
|
+
identity: undefined;
|
|
191
|
+
generated: undefined;
|
|
192
|
+
}, {}, {
|
|
193
|
+
length: number | undefined;
|
|
194
|
+
}>;
|
|
195
|
+
startedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
196
|
+
name: "started_at";
|
|
197
|
+
tableName: "capture_attempts";
|
|
198
|
+
dataType: "string";
|
|
199
|
+
columnType: "SQLiteText";
|
|
200
|
+
data: string;
|
|
201
|
+
driverParam: string;
|
|
202
|
+
notNull: false;
|
|
203
|
+
hasDefault: false;
|
|
204
|
+
isPrimaryKey: false;
|
|
205
|
+
isAutoincrement: false;
|
|
206
|
+
hasRuntimeDefault: false;
|
|
207
|
+
enumValues: [string, ...string[]];
|
|
208
|
+
baseColumn: never;
|
|
209
|
+
identity: undefined;
|
|
210
|
+
generated: undefined;
|
|
211
|
+
}, {}, {
|
|
212
|
+
length: number | undefined;
|
|
213
|
+
}>;
|
|
214
|
+
finishedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
215
|
+
name: "finished_at";
|
|
216
|
+
tableName: "capture_attempts";
|
|
217
|
+
dataType: "string";
|
|
218
|
+
columnType: "SQLiteText";
|
|
219
|
+
data: string;
|
|
220
|
+
driverParam: string;
|
|
221
|
+
notNull: false;
|
|
222
|
+
hasDefault: false;
|
|
223
|
+
isPrimaryKey: false;
|
|
224
|
+
isAutoincrement: false;
|
|
225
|
+
hasRuntimeDefault: false;
|
|
226
|
+
enumValues: [string, ...string[]];
|
|
227
|
+
baseColumn: never;
|
|
228
|
+
identity: undefined;
|
|
229
|
+
generated: undefined;
|
|
230
|
+
}, {}, {
|
|
231
|
+
length: number | undefined;
|
|
232
|
+
}>;
|
|
233
|
+
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
234
|
+
name: "created_at";
|
|
235
|
+
tableName: "capture_attempts";
|
|
236
|
+
dataType: "string";
|
|
237
|
+
columnType: "SQLiteText";
|
|
238
|
+
data: string;
|
|
239
|
+
driverParam: string;
|
|
240
|
+
notNull: true;
|
|
241
|
+
hasDefault: false;
|
|
242
|
+
isPrimaryKey: false;
|
|
243
|
+
isAutoincrement: false;
|
|
244
|
+
hasRuntimeDefault: false;
|
|
245
|
+
enumValues: [string, ...string[]];
|
|
246
|
+
baseColumn: never;
|
|
247
|
+
identity: undefined;
|
|
248
|
+
generated: undefined;
|
|
249
|
+
}, {}, {
|
|
250
|
+
length: number | undefined;
|
|
251
|
+
}>;
|
|
252
|
+
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
253
|
+
name: "updated_at";
|
|
254
|
+
tableName: "capture_attempts";
|
|
255
|
+
dataType: "string";
|
|
256
|
+
columnType: "SQLiteText";
|
|
257
|
+
data: string;
|
|
258
|
+
driverParam: string;
|
|
259
|
+
notNull: true;
|
|
260
|
+
hasDefault: false;
|
|
261
|
+
isPrimaryKey: false;
|
|
262
|
+
isAutoincrement: false;
|
|
263
|
+
hasRuntimeDefault: false;
|
|
264
|
+
enumValues: [string, ...string[]];
|
|
265
|
+
baseColumn: never;
|
|
266
|
+
identity: undefined;
|
|
267
|
+
generated: undefined;
|
|
268
|
+
}, {}, {
|
|
269
|
+
length: number | undefined;
|
|
270
|
+
}>;
|
|
271
|
+
};
|
|
272
|
+
dialect: 'sqlite';
|
|
273
|
+
}>;
|
|
274
|
+
/** Narrow `capture_logs` table definition: every log line of an attempt. */
|
|
275
|
+
declare const captureLogs: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
276
|
+
name: "capture_logs";
|
|
277
|
+
schema: undefined;
|
|
278
|
+
columns: {
|
|
279
|
+
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
280
|
+
name: "id";
|
|
281
|
+
tableName: "capture_logs";
|
|
282
|
+
dataType: "string";
|
|
283
|
+
columnType: "SQLiteText";
|
|
284
|
+
data: string;
|
|
285
|
+
driverParam: string;
|
|
286
|
+
notNull: true;
|
|
287
|
+
hasDefault: false;
|
|
288
|
+
isPrimaryKey: true;
|
|
289
|
+
isAutoincrement: false;
|
|
290
|
+
hasRuntimeDefault: false;
|
|
291
|
+
enumValues: [string, ...string[]];
|
|
292
|
+
baseColumn: never;
|
|
293
|
+
identity: undefined;
|
|
294
|
+
generated: undefined;
|
|
295
|
+
}, {}, {
|
|
296
|
+
length: number | undefined;
|
|
297
|
+
}>;
|
|
298
|
+
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
299
|
+
name: "project_id";
|
|
300
|
+
tableName: "capture_logs";
|
|
301
|
+
dataType: "string";
|
|
302
|
+
columnType: "SQLiteText";
|
|
303
|
+
data: string;
|
|
304
|
+
driverParam: string;
|
|
305
|
+
notNull: true;
|
|
306
|
+
hasDefault: false;
|
|
307
|
+
isPrimaryKey: false;
|
|
308
|
+
isAutoincrement: false;
|
|
309
|
+
hasRuntimeDefault: false;
|
|
310
|
+
enumValues: [string, ...string[]];
|
|
311
|
+
baseColumn: never;
|
|
312
|
+
identity: undefined;
|
|
313
|
+
generated: undefined;
|
|
314
|
+
}, {}, {
|
|
315
|
+
length: number | undefined;
|
|
316
|
+
}>;
|
|
317
|
+
buildId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
318
|
+
name: "build_id";
|
|
319
|
+
tableName: "capture_logs";
|
|
320
|
+
dataType: "string";
|
|
321
|
+
columnType: "SQLiteText";
|
|
322
|
+
data: string;
|
|
323
|
+
driverParam: string;
|
|
324
|
+
notNull: true;
|
|
325
|
+
hasDefault: false;
|
|
326
|
+
isPrimaryKey: false;
|
|
327
|
+
isAutoincrement: false;
|
|
328
|
+
hasRuntimeDefault: false;
|
|
329
|
+
enumValues: [string, ...string[]];
|
|
330
|
+
baseColumn: never;
|
|
331
|
+
identity: undefined;
|
|
332
|
+
generated: undefined;
|
|
333
|
+
}, {}, {
|
|
334
|
+
length: number | undefined;
|
|
335
|
+
}>;
|
|
336
|
+
attemptId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
337
|
+
name: "attempt_id";
|
|
338
|
+
tableName: "capture_logs";
|
|
339
|
+
dataType: "string";
|
|
340
|
+
columnType: "SQLiteText";
|
|
341
|
+
data: string;
|
|
342
|
+
driverParam: string;
|
|
343
|
+
notNull: true;
|
|
344
|
+
hasDefault: false;
|
|
345
|
+
isPrimaryKey: false;
|
|
346
|
+
isAutoincrement: false;
|
|
347
|
+
hasRuntimeDefault: false;
|
|
348
|
+
enumValues: [string, ...string[]];
|
|
349
|
+
baseColumn: never;
|
|
350
|
+
identity: undefined;
|
|
351
|
+
generated: undefined;
|
|
352
|
+
}, {}, {
|
|
353
|
+
length: number | undefined;
|
|
354
|
+
}>;
|
|
355
|
+
seq: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
356
|
+
name: "seq";
|
|
357
|
+
tableName: "capture_logs";
|
|
358
|
+
dataType: "number";
|
|
359
|
+
columnType: "SQLiteInteger";
|
|
360
|
+
data: number;
|
|
361
|
+
driverParam: number;
|
|
362
|
+
notNull: true;
|
|
363
|
+
hasDefault: false;
|
|
364
|
+
isPrimaryKey: false;
|
|
365
|
+
isAutoincrement: false;
|
|
366
|
+
hasRuntimeDefault: false;
|
|
367
|
+
enumValues: undefined;
|
|
368
|
+
baseColumn: never;
|
|
369
|
+
identity: undefined;
|
|
370
|
+
generated: undefined;
|
|
371
|
+
}, {}, {}>;
|
|
372
|
+
level: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
373
|
+
name: "level";
|
|
374
|
+
tableName: "capture_logs";
|
|
375
|
+
dataType: "string";
|
|
376
|
+
columnType: "SQLiteText";
|
|
377
|
+
data: string;
|
|
378
|
+
driverParam: string;
|
|
379
|
+
notNull: true;
|
|
380
|
+
hasDefault: true;
|
|
381
|
+
isPrimaryKey: false;
|
|
382
|
+
isAutoincrement: false;
|
|
383
|
+
hasRuntimeDefault: false;
|
|
384
|
+
enumValues: [string, ...string[]];
|
|
385
|
+
baseColumn: never;
|
|
386
|
+
identity: undefined;
|
|
387
|
+
generated: undefined;
|
|
388
|
+
}, {}, {
|
|
389
|
+
length: number | undefined;
|
|
390
|
+
}>;
|
|
391
|
+
message: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
392
|
+
name: "message";
|
|
393
|
+
tableName: "capture_logs";
|
|
394
|
+
dataType: "string";
|
|
395
|
+
columnType: "SQLiteText";
|
|
396
|
+
data: string;
|
|
397
|
+
driverParam: string;
|
|
398
|
+
notNull: true;
|
|
399
|
+
hasDefault: false;
|
|
400
|
+
isPrimaryKey: false;
|
|
401
|
+
isAutoincrement: false;
|
|
402
|
+
hasRuntimeDefault: false;
|
|
403
|
+
enumValues: [string, ...string[]];
|
|
404
|
+
baseColumn: never;
|
|
405
|
+
identity: undefined;
|
|
406
|
+
generated: undefined;
|
|
407
|
+
}, {}, {
|
|
408
|
+
length: number | undefined;
|
|
409
|
+
}>;
|
|
410
|
+
fields: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
411
|
+
name: "fields";
|
|
412
|
+
tableName: "capture_logs";
|
|
413
|
+
dataType: "string";
|
|
414
|
+
columnType: "SQLiteText";
|
|
415
|
+
data: string;
|
|
416
|
+
driverParam: string;
|
|
417
|
+
notNull: false;
|
|
418
|
+
hasDefault: false;
|
|
419
|
+
isPrimaryKey: false;
|
|
420
|
+
isAutoincrement: false;
|
|
421
|
+
hasRuntimeDefault: false;
|
|
422
|
+
enumValues: [string, ...string[]];
|
|
423
|
+
baseColumn: never;
|
|
424
|
+
identity: undefined;
|
|
425
|
+
generated: undefined;
|
|
426
|
+
}, {}, {
|
|
427
|
+
length: number | undefined;
|
|
428
|
+
}>;
|
|
429
|
+
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
430
|
+
name: "created_at";
|
|
431
|
+
tableName: "capture_logs";
|
|
432
|
+
dataType: "string";
|
|
433
|
+
columnType: "SQLiteText";
|
|
434
|
+
data: string;
|
|
435
|
+
driverParam: string;
|
|
436
|
+
notNull: true;
|
|
437
|
+
hasDefault: false;
|
|
438
|
+
isPrimaryKey: false;
|
|
439
|
+
isAutoincrement: false;
|
|
440
|
+
hasRuntimeDefault: false;
|
|
441
|
+
enumValues: [string, ...string[]];
|
|
442
|
+
baseColumn: never;
|
|
443
|
+
identity: undefined;
|
|
444
|
+
generated: undefined;
|
|
445
|
+
}, {}, {
|
|
446
|
+
length: number | undefined;
|
|
447
|
+
}>;
|
|
448
|
+
};
|
|
449
|
+
dialect: 'sqlite';
|
|
450
|
+
}>;
|
|
451
|
+
/** A capture attempt row. */
|
|
452
|
+
interface CaptureAttempt {
|
|
453
|
+
id: string;
|
|
454
|
+
projectId: string;
|
|
455
|
+
buildId: string;
|
|
456
|
+
attemptNo: number;
|
|
457
|
+
status: JobStatus;
|
|
458
|
+
error: string | null;
|
|
459
|
+
reqId: string | null;
|
|
460
|
+
storyCount: number;
|
|
461
|
+
failedCount: number;
|
|
462
|
+
queuedAt: string;
|
|
463
|
+
startedAt: string | null;
|
|
464
|
+
finishedAt: string | null;
|
|
465
|
+
createdAt: string;
|
|
466
|
+
updatedAt: string;
|
|
467
|
+
}
|
|
468
|
+
/** A capture log line row. */
|
|
469
|
+
interface CaptureLog {
|
|
470
|
+
id: string;
|
|
471
|
+
projectId: string;
|
|
472
|
+
buildId: string;
|
|
473
|
+
attemptId: string;
|
|
474
|
+
seq: number;
|
|
475
|
+
level: string;
|
|
476
|
+
message: string;
|
|
477
|
+
fields: string | null;
|
|
478
|
+
createdAt: string;
|
|
479
|
+
}
|
|
480
|
+
//#endregion
|
|
481
|
+
export { CaptureAttempt, CaptureLog, captureAttempts, captureLogs };
|
|
482
|
+
//# sourceMappingURL=capture-attempt.d.mts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { projects } from "./project.mjs";
|
|
5
|
+
import { builds } from "./build.mjs";
|
|
6
|
+
import { index, integer, sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
|
|
7
|
+
//#region src/schema/capture-attempt.ts
|
|
8
|
+
/** Narrow `capture_attempts` table definition: one row per build capture run. */
|
|
9
|
+
const captureAttempts = sqliteTable("capture_attempts", {
|
|
10
|
+
id: text("id").primaryKey(),
|
|
11
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
12
|
+
buildId: text("build_id").notNull().references(() => builds.id, { onDelete: "cascade" }),
|
|
13
|
+
attemptNo: integer("attempt_no").notNull(),
|
|
14
|
+
status: text("status").$type().notNull().default("queued"),
|
|
15
|
+
error: text("error"),
|
|
16
|
+
reqId: text("req_id"),
|
|
17
|
+
storyCount: integer("story_count").notNull().default(0),
|
|
18
|
+
failedCount: integer("failed_count").notNull().default(0),
|
|
19
|
+
queuedAt: text("queued_at").notNull(),
|
|
20
|
+
startedAt: text("started_at"),
|
|
21
|
+
finishedAt: text("finished_at"),
|
|
22
|
+
createdAt: text("created_at").notNull(),
|
|
23
|
+
updatedAt: text("updated_at").notNull()
|
|
24
|
+
}, (t) => [uniqueIndex("capture_attempts_build_no_idx").on(t.buildId, t.attemptNo), index("capture_attempts_build_id_idx").on(t.buildId)]);
|
|
25
|
+
/** Narrow `capture_logs` table definition: every log line of an attempt. */
|
|
26
|
+
const captureLogs = sqliteTable("capture_logs", {
|
|
27
|
+
id: text("id").primaryKey(),
|
|
28
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
29
|
+
buildId: text("build_id").notNull().references(() => builds.id, { onDelete: "cascade" }),
|
|
30
|
+
attemptId: text("attempt_id").notNull().references(() => captureAttempts.id, { onDelete: "cascade" }),
|
|
31
|
+
seq: integer("seq").notNull(),
|
|
32
|
+
level: text("level").notNull().default("info"),
|
|
33
|
+
message: text("message").notNull(),
|
|
34
|
+
fields: text("fields"),
|
|
35
|
+
createdAt: text("created_at").notNull()
|
|
36
|
+
}, (t) => [index("capture_logs_attempt_seq_idx").on(t.attemptId, t.seq)]);
|
|
37
|
+
//#endregion
|
|
38
|
+
export { captureAttempts, captureLogs };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=capture-attempt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture-attempt.mjs","names":[],"sources":["../../src/schema/capture-attempt.ts"],"sourcesContent":["import type { JobStatus } from \"@storyshelf/core/adapter/capture-queue\";\nimport { index, integer, sqliteTable, text, uniqueIndex } from \"drizzle-orm/sqlite-core\";\nimport { builds } from \"./build.ts\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `capture_attempts` table definition: one row per build capture run. */\nexport const captureAttempts = sqliteTable(\n \"capture_attempts\",\n {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n buildId: text(\"build_id\")\n .notNull()\n .references(() => builds.id, { onDelete: \"cascade\" }),\n attemptNo: integer(\"attempt_no\").notNull(),\n status: text(\"status\").$type<JobStatus>().notNull().default(\"queued\"),\n error: text(\"error\"),\n reqId: text(\"req_id\"),\n storyCount: integer(\"story_count\").notNull().default(0),\n failedCount: integer(\"failed_count\").notNull().default(0),\n queuedAt: text(\"queued_at\").notNull(),\n startedAt: text(\"started_at\"),\n finishedAt: text(\"finished_at\"),\n createdAt: text(\"created_at\").notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n },\n (t) => [\n uniqueIndex(\"capture_attempts_build_no_idx\").on(t.buildId, t.attemptNo),\n index(\"capture_attempts_build_id_idx\").on(t.buildId),\n ],\n);\n\n/** Narrow `capture_logs` table definition: every log line of an attempt. */\nexport const captureLogs = sqliteTable(\n \"capture_logs\",\n {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n buildId: text(\"build_id\")\n .notNull()\n .references(() => builds.id, { onDelete: \"cascade\" }),\n attemptId: text(\"attempt_id\")\n .notNull()\n .references(() => captureAttempts.id, { onDelete: \"cascade\" }),\n seq: integer(\"seq\").notNull(),\n level: text(\"level\").notNull().default(\"info\"),\n message: text(\"message\").notNull(),\n fields: text(\"fields\"),\n createdAt: text(\"created_at\").notNull(),\n },\n (t) => [index(\"capture_logs_attempt_seq_idx\").on(t.attemptId, t.seq)],\n);\n\n/** A capture attempt row. */\nexport interface CaptureAttempt {\n id: string;\n projectId: string;\n buildId: string;\n attemptNo: number;\n status: JobStatus;\n error: string | null;\n reqId: string | null;\n storyCount: number;\n failedCount: number;\n queuedAt: string;\n startedAt: string | null;\n finishedAt: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\n/** A capture log line row. */\nexport interface CaptureLog {\n id: string;\n projectId: string;\n buildId: string;\n attemptId: string;\n seq: number;\n level: string;\n message: string;\n fields: string | null;\n createdAt: string;\n}\n"],"mappings":";;;;;;;;AAMA,MAAa,kBAAkB,YAC7B,oBACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,SAAS,KAAK,UAAU,CAAC,CACtB,QAAQ,CAAC,CACT,iBAAiB,OAAO,IAAI,EAAE,UAAU,UAAU,CAAC;CACtD,WAAW,QAAQ,YAAY,CAAC,CAAC,QAAQ;CACzC,QAAQ,KAAK,QAAQ,CAAC,CAAC,MAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,QAAQ;CACpE,OAAO,KAAK,OAAO;CACnB,OAAO,KAAK,QAAQ;CACpB,YAAY,QAAQ,aAAa,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CACtD,aAAa,QAAQ,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CACxD,UAAU,KAAK,WAAW,CAAC,CAAC,QAAQ;CACpC,WAAW,KAAK,YAAY;CAC5B,YAAY,KAAK,aAAa;CAC9B,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,IACC,MAAM,CACL,YAAY,+BAA+B,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,GACtE,MAAM,+BAA+B,CAAC,CAAC,GAAG,EAAE,OAAO,CACrD,CACF;;AAGA,MAAa,cAAc,YACzB,gBACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,SAAS,KAAK,UAAU,CAAC,CACtB,QAAQ,CAAC,CACT,iBAAiB,OAAO,IAAI,EAAE,UAAU,UAAU,CAAC;CACtD,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,gBAAgB,IAAI,EAAE,UAAU,UAAU,CAAC;CAC/D,KAAK,QAAQ,KAAK,CAAC,CAAC,QAAQ;CAC5B,OAAO,KAAK,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,MAAM;CAC7C,SAAS,KAAK,SAAS,CAAC,CAAC,QAAQ;CACjC,QAAQ,KAAK,QAAQ;CACrB,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,IACC,MAAM,CAAC,MAAM,8BAA8B,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,CAAC,CACtE"}
|