@storyshelf/db-mysql 0.13.0 → 0.14.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.
Files changed (39) hide show
  1. package/README.md +22 -1
  2. package/dist/baseline-preparation.mjs +154 -0
  3. package/dist/baseline-preparation.mjs.map +1 -0
  4. package/dist/build-deletion-steps.mjs +98 -0
  5. package/dist/build-deletion-steps.mjs.map +1 -0
  6. package/dist/build-reference-lifecycle.mjs +157 -0
  7. package/dist/build-reference-lifecycle.mjs.map +1 -0
  8. package/dist/content-uses.mjs +192 -0
  9. package/dist/content-uses.mjs.map +1 -0
  10. package/dist/ddl.d.mts +1 -1
  11. package/dist/ddl.mjs +76 -0
  12. package/dist/ddl.mjs.map +1 -1
  13. package/dist/drizzle-factory-mysql.mjs +6 -2
  14. package/dist/drizzle-factory-mysql.mjs.map +1 -1
  15. package/dist/foreign-keys.mjs +57 -0
  16. package/dist/foreign-keys.mjs.map +1 -1
  17. package/dist/index.d.mts +9 -1
  18. package/dist/index.mjs +36 -10
  19. package/dist/index.mjs.map +1 -1
  20. package/dist/lifecycle-transaction.mjs +105 -0
  21. package/dist/lifecycle-transaction.mjs.map +1 -0
  22. package/dist/migrate.mjs +11 -1
  23. package/dist/migrate.mjs.map +1 -1
  24. package/dist/planetscale.mjs +2 -2
  25. package/dist/planetscale.mjs.map +1 -1
  26. package/dist/retention-activation.mjs +127 -0
  27. package/dist/retention-activation.mjs.map +1 -0
  28. package/dist/schema/build.d.mts +17 -0
  29. package/dist/schema/build.mjs +2 -0
  30. package/dist/schema/build.mjs.map +1 -1
  31. package/dist/schema/git-connection.d.mts +505 -0
  32. package/dist/schema/git-connection.mjs +66 -0
  33. package/dist/schema/git-connection.mjs.map +1 -0
  34. package/dist/schema.d.mts +4 -1
  35. package/dist/schema.mjs +5 -2
  36. package/dist/schema.mjs.map +1 -1
  37. package/dist/tidb.mjs +2 -2
  38. package/dist/tidb.mjs.map +1 -1
  39. package/package.json +3 -2
@@ -0,0 +1,505 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { GitConnectionProvider, GitRepositoryLinkState } from "@storyshelf/core/schema";
4
+ /** Narrow `git_connections` table definition: one credential per git host account (epic #1117). */
5
+ declare const gitConnections: import("drizzle-orm/mysql-core/table.js").MySqlTableWithColumns<{
6
+ name: "git_connections";
7
+ schema: undefined;
8
+ columns: {
9
+ id: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
10
+ name: "id";
11
+ tableName: "git_connections";
12
+ dataType: "string";
13
+ columnType: "MySqlText";
14
+ data: string;
15
+ driverParam: string;
16
+ notNull: true;
17
+ hasDefault: false;
18
+ isPrimaryKey: true;
19
+ isAutoincrement: false;
20
+ hasRuntimeDefault: false;
21
+ enumValues: [string, ...string[]];
22
+ baseColumn: never;
23
+ identity: undefined;
24
+ generated: undefined;
25
+ }, {}, {}>;
26
+ provider: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
27
+ name: "provider";
28
+ tableName: "git_connections";
29
+ dataType: "string";
30
+ columnType: "MySqlText";
31
+ data: GitConnectionProvider;
32
+ driverParam: string;
33
+ notNull: true;
34
+ hasDefault: false;
35
+ isPrimaryKey: false;
36
+ isAutoincrement: false;
37
+ hasRuntimeDefault: false;
38
+ enumValues: [string, ...string[]];
39
+ baseColumn: never;
40
+ identity: undefined;
41
+ generated: undefined;
42
+ }, {}, {
43
+ $type: GitConnectionProvider;
44
+ }>;
45
+ name: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
46
+ name: "name";
47
+ tableName: "git_connections";
48
+ dataType: "string";
49
+ columnType: "MySqlText";
50
+ data: string;
51
+ driverParam: string;
52
+ notNull: true;
53
+ hasDefault: false;
54
+ isPrimaryKey: false;
55
+ isAutoincrement: false;
56
+ hasRuntimeDefault: false;
57
+ enumValues: [string, ...string[]];
58
+ baseColumn: never;
59
+ identity: undefined;
60
+ generated: undefined;
61
+ }, {}, {}>;
62
+ apiBase: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
63
+ name: "api_base";
64
+ tableName: "git_connections";
65
+ dataType: "string";
66
+ columnType: "MySqlText";
67
+ data: string;
68
+ driverParam: string;
69
+ notNull: false;
70
+ hasDefault: false;
71
+ isPrimaryKey: false;
72
+ isAutoincrement: false;
73
+ hasRuntimeDefault: false;
74
+ enumValues: [string, ...string[]];
75
+ baseColumn: never;
76
+ identity: undefined;
77
+ generated: undefined;
78
+ }, {}, {}>;
79
+ config: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
80
+ name: "config";
81
+ tableName: "git_connections";
82
+ dataType: "string";
83
+ columnType: "MySqlText";
84
+ data: string;
85
+ driverParam: string;
86
+ notNull: true;
87
+ hasDefault: false;
88
+ isPrimaryKey: false;
89
+ isAutoincrement: false;
90
+ hasRuntimeDefault: false;
91
+ enumValues: [string, ...string[]];
92
+ baseColumn: never;
93
+ identity: undefined;
94
+ generated: undefined;
95
+ }, {}, {}>;
96
+ secretEncrypted: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
97
+ name: "secret_encrypted";
98
+ tableName: "git_connections";
99
+ dataType: "string";
100
+ columnType: "MySqlText";
101
+ data: string;
102
+ driverParam: string;
103
+ notNull: false;
104
+ hasDefault: false;
105
+ isPrimaryKey: false;
106
+ isAutoincrement: false;
107
+ hasRuntimeDefault: false;
108
+ enumValues: [string, ...string[]];
109
+ baseColumn: never;
110
+ identity: undefined;
111
+ generated: undefined;
112
+ }, {}, {}>;
113
+ createdBy: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
114
+ name: "created_by";
115
+ tableName: "git_connections";
116
+ dataType: "string";
117
+ columnType: "MySqlText";
118
+ data: string;
119
+ driverParam: string;
120
+ notNull: false;
121
+ hasDefault: false;
122
+ isPrimaryKey: false;
123
+ isAutoincrement: false;
124
+ hasRuntimeDefault: false;
125
+ enumValues: [string, ...string[]];
126
+ baseColumn: never;
127
+ identity: undefined;
128
+ generated: undefined;
129
+ }, {}, {}>;
130
+ state: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
131
+ name: "state";
132
+ tableName: "git_connections";
133
+ dataType: "string";
134
+ columnType: "MySqlText";
135
+ data: string;
136
+ driverParam: string;
137
+ notNull: true;
138
+ hasDefault: true;
139
+ isPrimaryKey: false;
140
+ isAutoincrement: false;
141
+ hasRuntimeDefault: false;
142
+ enumValues: [string, ...string[]];
143
+ baseColumn: never;
144
+ identity: undefined;
145
+ generated: undefined;
146
+ }, {}, {}>;
147
+ createdAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
148
+ name: "created_at";
149
+ tableName: "git_connections";
150
+ dataType: "custom";
151
+ columnType: "MySqlCustomColumn";
152
+ data: string;
153
+ driverParam: string;
154
+ notNull: true;
155
+ hasDefault: false;
156
+ isPrimaryKey: false;
157
+ isAutoincrement: false;
158
+ hasRuntimeDefault: false;
159
+ enumValues: undefined;
160
+ baseColumn: never;
161
+ identity: undefined;
162
+ generated: undefined;
163
+ }, {}, {}>;
164
+ updatedAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
165
+ name: "updated_at";
166
+ tableName: "git_connections";
167
+ dataType: "custom";
168
+ columnType: "MySqlCustomColumn";
169
+ data: string;
170
+ driverParam: string;
171
+ notNull: true;
172
+ hasDefault: false;
173
+ isPrimaryKey: false;
174
+ isAutoincrement: false;
175
+ hasRuntimeDefault: false;
176
+ enumValues: undefined;
177
+ baseColumn: never;
178
+ identity: undefined;
179
+ generated: undefined;
180
+ }, {}, {}>;
181
+ };
182
+ dialect: 'mysql';
183
+ }>;
184
+ /** Narrow `git_repository_links` table definition: a project's link to one repository. */
185
+ declare const gitRepositoryLinks: import("drizzle-orm/mysql-core/table.js").MySqlTableWithColumns<{
186
+ name: "git_repository_links";
187
+ schema: undefined;
188
+ columns: {
189
+ id: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
190
+ name: "id";
191
+ tableName: "git_repository_links";
192
+ dataType: "string";
193
+ columnType: "MySqlText";
194
+ data: string;
195
+ driverParam: string;
196
+ notNull: true;
197
+ hasDefault: false;
198
+ isPrimaryKey: true;
199
+ isAutoincrement: false;
200
+ hasRuntimeDefault: false;
201
+ enumValues: [string, ...string[]];
202
+ baseColumn: never;
203
+ identity: undefined;
204
+ generated: undefined;
205
+ }, {}, {}>;
206
+ projectId: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
207
+ name: "project_id";
208
+ tableName: "git_repository_links";
209
+ dataType: "string";
210
+ columnType: "MySqlText";
211
+ data: string;
212
+ driverParam: string;
213
+ notNull: true;
214
+ hasDefault: false;
215
+ isPrimaryKey: false;
216
+ isAutoincrement: false;
217
+ hasRuntimeDefault: false;
218
+ enumValues: [string, ...string[]];
219
+ baseColumn: never;
220
+ identity: undefined;
221
+ generated: undefined;
222
+ }, {}, {}>;
223
+ connectionId: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
224
+ name: "connection_id";
225
+ tableName: "git_repository_links";
226
+ dataType: "string";
227
+ columnType: "MySqlText";
228
+ data: string;
229
+ driverParam: string;
230
+ notNull: true;
231
+ hasDefault: false;
232
+ isPrimaryKey: false;
233
+ isAutoincrement: false;
234
+ hasRuntimeDefault: false;
235
+ enumValues: [string, ...string[]];
236
+ baseColumn: never;
237
+ identity: undefined;
238
+ generated: undefined;
239
+ }, {}, {}>;
240
+ host: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
241
+ name: "host";
242
+ tableName: "git_repository_links";
243
+ dataType: "string";
244
+ columnType: "MySqlText";
245
+ data: string;
246
+ driverParam: string;
247
+ notNull: true;
248
+ hasDefault: false;
249
+ isPrimaryKey: false;
250
+ isAutoincrement: false;
251
+ hasRuntimeDefault: false;
252
+ enumValues: [string, ...string[]];
253
+ baseColumn: never;
254
+ identity: undefined;
255
+ generated: undefined;
256
+ }, {}, {}>;
257
+ owner: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
258
+ name: "owner";
259
+ tableName: "git_repository_links";
260
+ dataType: "string";
261
+ columnType: "MySqlText";
262
+ data: string;
263
+ driverParam: string;
264
+ notNull: true;
265
+ hasDefault: false;
266
+ isPrimaryKey: false;
267
+ isAutoincrement: false;
268
+ hasRuntimeDefault: false;
269
+ enumValues: [string, ...string[]];
270
+ baseColumn: never;
271
+ identity: undefined;
272
+ generated: undefined;
273
+ }, {}, {}>;
274
+ repo: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
275
+ name: "repo";
276
+ tableName: "git_repository_links";
277
+ dataType: "string";
278
+ columnType: "MySqlText";
279
+ data: string;
280
+ driverParam: string;
281
+ notNull: true;
282
+ hasDefault: false;
283
+ isPrimaryKey: false;
284
+ isAutoincrement: false;
285
+ hasRuntimeDefault: false;
286
+ enumValues: [string, ...string[]];
287
+ baseColumn: never;
288
+ identity: undefined;
289
+ generated: undefined;
290
+ }, {}, {}>;
291
+ hostRepositoryId: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
292
+ name: "host_repository_id";
293
+ tableName: "git_repository_links";
294
+ dataType: "string";
295
+ columnType: "MySqlText";
296
+ data: string;
297
+ driverParam: string;
298
+ notNull: false;
299
+ hasDefault: false;
300
+ isPrimaryKey: false;
301
+ isAutoincrement: false;
302
+ hasRuntimeDefault: false;
303
+ enumValues: [string, ...string[]];
304
+ baseColumn: never;
305
+ identity: undefined;
306
+ generated: undefined;
307
+ }, {}, {}>;
308
+ prefix: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
309
+ name: "prefix";
310
+ tableName: "git_repository_links";
311
+ dataType: "string";
312
+ columnType: "MySqlText";
313
+ data: string;
314
+ driverParam: string;
315
+ notNull: true;
316
+ hasDefault: true;
317
+ isPrimaryKey: false;
318
+ isAutoincrement: false;
319
+ hasRuntimeDefault: false;
320
+ enumValues: [string, ...string[]];
321
+ baseColumn: never;
322
+ identity: undefined;
323
+ generated: undefined;
324
+ }, {}, {}>;
325
+ state: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
326
+ name: "state";
327
+ tableName: "git_repository_links";
328
+ dataType: "string";
329
+ columnType: "MySqlText";
330
+ data: GitRepositoryLinkState;
331
+ driverParam: string;
332
+ notNull: true;
333
+ hasDefault: true;
334
+ isPrimaryKey: false;
335
+ isAutoincrement: false;
336
+ hasRuntimeDefault: false;
337
+ enumValues: [string, ...string[]];
338
+ baseColumn: never;
339
+ identity: undefined;
340
+ generated: undefined;
341
+ }, {}, {
342
+ $type: GitRepositoryLinkState;
343
+ }>;
344
+ reason: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
345
+ name: "reason";
346
+ tableName: "git_repository_links";
347
+ dataType: "string";
348
+ columnType: "MySqlText";
349
+ data: string;
350
+ driverParam: string;
351
+ notNull: false;
352
+ hasDefault: false;
353
+ isPrimaryKey: false;
354
+ isAutoincrement: false;
355
+ hasRuntimeDefault: false;
356
+ enumValues: [string, ...string[]];
357
+ baseColumn: never;
358
+ identity: undefined;
359
+ generated: undefined;
360
+ }, {}, {}>;
361
+ outputs: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
362
+ name: "outputs";
363
+ tableName: "git_repository_links";
364
+ dataType: "string";
365
+ columnType: "MySqlText";
366
+ data: string;
367
+ driverParam: string;
368
+ notNull: true;
369
+ hasDefault: false;
370
+ isPrimaryKey: false;
371
+ isAutoincrement: false;
372
+ hasRuntimeDefault: false;
373
+ enumValues: [string, ...string[]];
374
+ baseColumn: never;
375
+ identity: undefined;
376
+ generated: undefined;
377
+ }, {}, {}>;
378
+ installationId: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
379
+ name: "installation_id";
380
+ tableName: "git_repository_links";
381
+ dataType: "string";
382
+ columnType: "MySqlText";
383
+ data: string;
384
+ driverParam: string;
385
+ notNull: false;
386
+ hasDefault: false;
387
+ isPrimaryKey: false;
388
+ isAutoincrement: false;
389
+ hasRuntimeDefault: false;
390
+ enumValues: [string, ...string[]];
391
+ baseColumn: never;
392
+ identity: undefined;
393
+ generated: undefined;
394
+ }, {}, {}>;
395
+ requestedBy: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
396
+ name: "requested_by";
397
+ tableName: "git_repository_links";
398
+ dataType: "string";
399
+ columnType: "MySqlText";
400
+ data: string;
401
+ driverParam: string;
402
+ notNull: false;
403
+ hasDefault: false;
404
+ isPrimaryKey: false;
405
+ isAutoincrement: false;
406
+ hasRuntimeDefault: false;
407
+ enumValues: [string, ...string[]];
408
+ baseColumn: never;
409
+ identity: undefined;
410
+ generated: undefined;
411
+ }, {}, {}>;
412
+ approvedBy: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
413
+ name: "approved_by";
414
+ tableName: "git_repository_links";
415
+ dataType: "string";
416
+ columnType: "MySqlText";
417
+ data: string;
418
+ driverParam: string;
419
+ notNull: false;
420
+ hasDefault: false;
421
+ isPrimaryKey: false;
422
+ isAutoincrement: false;
423
+ hasRuntimeDefault: false;
424
+ enumValues: [string, ...string[]];
425
+ baseColumn: never;
426
+ identity: undefined;
427
+ generated: undefined;
428
+ }, {}, {}>;
429
+ approvedAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
430
+ name: "approved_at";
431
+ tableName: "git_repository_links";
432
+ dataType: "custom";
433
+ columnType: "MySqlCustomColumn";
434
+ data: string;
435
+ driverParam: string;
436
+ notNull: false;
437
+ hasDefault: false;
438
+ isPrimaryKey: false;
439
+ isAutoincrement: false;
440
+ hasRuntimeDefault: false;
441
+ enumValues: undefined;
442
+ baseColumn: never;
443
+ identity: undefined;
444
+ generated: undefined;
445
+ }, {}, {}>;
446
+ lastDeliveredAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
447
+ name: "last_delivered_at";
448
+ tableName: "git_repository_links";
449
+ dataType: "custom";
450
+ columnType: "MySqlCustomColumn";
451
+ data: string;
452
+ driverParam: string;
453
+ notNull: false;
454
+ hasDefault: false;
455
+ isPrimaryKey: false;
456
+ isAutoincrement: false;
457
+ hasRuntimeDefault: false;
458
+ enumValues: undefined;
459
+ baseColumn: never;
460
+ identity: undefined;
461
+ generated: undefined;
462
+ }, {}, {}>;
463
+ createdAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
464
+ name: "created_at";
465
+ tableName: "git_repository_links";
466
+ dataType: "custom";
467
+ columnType: "MySqlCustomColumn";
468
+ data: string;
469
+ driverParam: string;
470
+ notNull: true;
471
+ hasDefault: false;
472
+ isPrimaryKey: false;
473
+ isAutoincrement: false;
474
+ hasRuntimeDefault: false;
475
+ enumValues: undefined;
476
+ baseColumn: never;
477
+ identity: undefined;
478
+ generated: undefined;
479
+ }, {}, {}>;
480
+ updatedAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
481
+ name: "updated_at";
482
+ tableName: "git_repository_links";
483
+ dataType: "custom";
484
+ columnType: "MySqlCustomColumn";
485
+ data: string;
486
+ driverParam: string;
487
+ notNull: true;
488
+ hasDefault: false;
489
+ isPrimaryKey: false;
490
+ isAutoincrement: false;
491
+ hasRuntimeDefault: false;
492
+ enumValues: undefined;
493
+ baseColumn: never;
494
+ identity: undefined;
495
+ generated: undefined;
496
+ }, {}, {}>;
497
+ };
498
+ dialect: 'mysql';
499
+ }>;
500
+ /** Git connection row. */
501
+ type GitConnection = typeof gitConnections.$inferSelect;
502
+ /** Git repository link row. */
503
+ type GitRepositoryLink = typeof gitRepositoryLinks.$inferSelect;
504
+ export { GitConnection, GitRepositoryLink, gitConnections, gitRepositoryLinks };
505
+ //# sourceMappingURL=git-connection.d.mts.map
@@ -0,0 +1,66 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { datetime } from "./datetime.mjs";
5
+ import { projects } from "./project.mjs";
6
+ import { index, mysqlTable, text, uniqueIndex } from "drizzle-orm/mysql-core";
7
+ // src/schema/git-connection.ts
8
+ /** Narrow `git_connections` table definition: one credential per git host account (epic #1117). */
9
+ const gitConnections = mysqlTable("git_connections", {
10
+ id: text("id").primaryKey(),
11
+ provider: text("provider").$type().notNull(),
12
+ name: text("name").notNull(),
13
+ apiBase: text("api_base"),
14
+ config: text("config").notNull(),
15
+ secretEncrypted: text("secret_encrypted"),
16
+ createdBy: text("created_by"),
17
+ state: text("state").notNull().default("active"),
18
+ createdAt: datetime("created_at", {
19
+ mode: "string",
20
+ fsp: 3
21
+ }).notNull(),
22
+ updatedAt: datetime("updated_at", {
23
+ mode: "string",
24
+ fsp: 3
25
+ }).notNull()
26
+ });
27
+ /** Narrow `git_repository_links` table definition: a project's link to one repository. */
28
+ const gitRepositoryLinks = mysqlTable("git_repository_links", {
29
+ id: text("id").primaryKey(),
30
+ projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
31
+ connectionId: text("connection_id").notNull().references(() => gitConnections.id),
32
+ host: text("host").notNull(),
33
+ owner: text("owner").notNull(),
34
+ repo: text("repo").notNull(),
35
+ hostRepositoryId: text("host_repository_id"),
36
+ prefix: text("prefix").notNull().default(""),
37
+ state: text("state").$type().notNull().default("pending"),
38
+ reason: text("reason"),
39
+ outputs: text("outputs").notNull(),
40
+ installationId: text("installation_id"),
41
+ requestedBy: text("requested_by"),
42
+ approvedBy: text("approved_by"),
43
+ approvedAt: datetime("approved_at", {
44
+ mode: "string",
45
+ fsp: 3
46
+ }),
47
+ lastDeliveredAt: datetime("last_delivered_at", {
48
+ mode: "string",
49
+ fsp: 3
50
+ }),
51
+ createdAt: datetime("created_at", {
52
+ mode: "string",
53
+ fsp: 3
54
+ }).notNull(),
55
+ updatedAt: datetime("updated_at", {
56
+ mode: "string",
57
+ fsp: 3
58
+ }).notNull()
59
+ }, (t) => [
60
+ uniqueIndex("git_repository_links_repository_idx").on(t.host, t.owner, t.repo, t.prefix),
61
+ index("git_repository_links_project_id_idx").on(t.projectId),
62
+ index("git_repository_links_connection_id_idx").on(t.connectionId)
63
+ ]);
64
+ export { gitConnections, gitRepositoryLinks };
65
+
66
+ //# sourceMappingURL=git-connection.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-connection.mjs","names":[],"sources":["../../src/schema/git-connection.ts"],"sourcesContent":["import type { GitConnectionProvider, GitRepositoryLinkState } from \"@storyshelf/core/schema\";\nimport { index, mysqlTable, text, uniqueIndex } from \"drizzle-orm/mysql-core\";\nimport { datetime } from \"./datetime.ts\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `git_connections` table definition: one credential per git host account (epic #1117). */\nexport const gitConnections = mysqlTable(\"git_connections\", {\n id: text(\"id\").primaryKey(),\n provider: text(\"provider\").$type<GitConnectionProvider>().notNull(),\n name: text(\"name\").notNull(),\n apiBase: text(\"api_base\"),\n config: text(\"config\").notNull(),\n secretEncrypted: text(\"secret_encrypted\"),\n createdBy: text(\"created_by\"),\n state: text(\"state\").notNull().default(\"active\"),\n createdAt: datetime(\"created_at\", { mode: \"string\", fsp: 3 }).notNull(),\n updatedAt: datetime(\"updated_at\", { mode: \"string\", fsp: 3 }).notNull(),\n});\n\n/** Narrow `git_repository_links` table definition: a project's link to one repository. */\nexport const gitRepositoryLinks = mysqlTable(\n \"git_repository_links\",\n {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n connectionId: text(\"connection_id\")\n .notNull()\n .references(() => gitConnections.id),\n host: text(\"host\").notNull(),\n owner: text(\"owner\").notNull(),\n repo: text(\"repo\").notNull(),\n hostRepositoryId: text(\"host_repository_id\"),\n prefix: text(\"prefix\").notNull().default(\"\"),\n state: text(\"state\").$type<GitRepositoryLinkState>().notNull().default(\"pending\"),\n reason: text(\"reason\"),\n outputs: text(\"outputs\").notNull(),\n installationId: text(\"installation_id\"),\n requestedBy: text(\"requested_by\"),\n approvedBy: text(\"approved_by\"),\n approvedAt: datetime(\"approved_at\", { mode: \"string\", fsp: 3 }),\n lastDeliveredAt: datetime(\"last_delivered_at\", { mode: \"string\", fsp: 3 }),\n createdAt: datetime(\"created_at\", { mode: \"string\", fsp: 3 }).notNull(),\n updatedAt: datetime(\"updated_at\", { mode: \"string\", fsp: 3 }).notNull(),\n },\n (t) => [\n uniqueIndex(\"git_repository_links_repository_idx\").on(t.host, t.owner, t.repo, t.prefix),\n index(\"git_repository_links_project_id_idx\").on(t.projectId),\n index(\"git_repository_links_connection_id_idx\").on(t.connectionId),\n ],\n);\n\n/** Git connection row. */\nexport type GitConnection = typeof gitConnections.$inferSelect;\n/** Git repository link row. */\nexport type GitRepositoryLink = typeof gitRepositoryLinks.$inferSelect;\n"],"mappings":";;;;;;;;AAMA,MAAa,iBAAiB,WAAW,mBAAmB;CAC1D,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,UAAU,KAAK,UAAU,CAAC,CAAC,MAA6B,CAAC,CAAC,QAAQ;CAClE,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,SAAS,KAAK,UAAU;CACxB,QAAQ,KAAK,QAAQ,CAAC,CAAC,QAAQ;CAC/B,iBAAiB,KAAK,kBAAkB;CACxC,WAAW,KAAK,YAAY;CAC5B,OAAO,KAAK,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,QAAQ;CAC/C,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;CACtE,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;AACxE,CAAC;;AAGD,MAAa,qBAAqB,WAChC,wBACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,cAAc,KAAK,eAAe,CAAC,CAChC,QAAQ,CAAC,CACT,iBAAiB,eAAe,EAAE;CACrC,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,OAAO,KAAK,OAAO,CAAC,CAAC,QAAQ;CAC7B,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,kBAAkB,KAAK,oBAAoB;CAC3C,QAAQ,KAAK,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE;CAC3C,OAAO,KAAK,OAAO,CAAC,CAAC,MAA8B,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,SAAS;CAChF,QAAQ,KAAK,QAAQ;CACrB,SAAS,KAAK,SAAS,CAAC,CAAC,QAAQ;CACjC,gBAAgB,KAAK,iBAAiB;CACtC,aAAa,KAAK,cAAc;CAChC,YAAY,KAAK,aAAa;CAC9B,YAAY,SAAS,eAAe;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC;CAC9D,iBAAiB,SAAS,qBAAqB;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC;CACzE,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;CACtE,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;AACxE,IACC,MAAM;CACL,YAAY,qCAAqC,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;CACvF,MAAM,qCAAqC,CAAC,CAAC,GAAG,EAAE,SAAS;CAC3D,MAAM,wCAAwC,CAAC,CAAC,GAAG,EAAE,YAAY;AACnE,CACF"}
package/dist/schema.d.mts CHANGED
@@ -25,6 +25,7 @@ import { Webhook, webhooks } from "./schema/webhook.mjs";
25
25
  import { AiBudgetAlert, AiUsage, Insight, aiBudgetAlerts, aiUsage, insights } from "./schema/insight.mjs";
26
26
  import { NotificationChannel, NotificationSubscription, notificationChannels, notificationSubscriptions } from "./schema/notification.mjs";
27
27
  import { ContentUse, contentUses } from "./schema/content-uses.mjs";
28
+ import { GitConnection, GitRepositoryLink, gitConnections, gitRepositoryLinks } from "./schema/git-connection.mjs";
28
29
  import { AnyMySqlTable } from "drizzle-orm/mysql-core";
29
30
  /** Full Drizzle schema object passed to the database client. */
30
31
  declare const schema: {
@@ -61,8 +62,10 @@ declare const schema: {
61
62
  projectMembers: AnyMySqlTable;
62
63
  projectGroupMappings: AnyMySqlTable;
63
64
  contentUses: AnyMySqlTable;
65
+ gitConnections: AnyMySqlTable;
66
+ gitRepositoryLinks: AnyMySqlTable;
64
67
  };
65
68
  /** The full database schema type. */
66
69
  type Schema = typeof schema;
67
- export { type AiBudgetAlert, type AiUsage, type Baseline, type Build, type BuildLabel, type BuildPackageUsage, type CaptureAttempt, type CaptureLog, type Comment, type ContentUse, type DesignCredential, type DesignLink, type DesignNode, type Insight, type LabelType, type NotificationChannel, type NotificationSubscription, type Project, type ProjectGroupMapping, type ProjectLink, type ProjectMember, Schema, type Snapshot, type StorybookMeta, type Token, type User, type UserConnection, type UserInviteToken, type Webhook, aiBudgetAlerts, aiUsage, baselines, buildComponents, buildLabels, buildPackageUsage, buildReviews, builds, captureAttempts, captureJobs, captureLogs, captureShards, comments, contentUses, designCredentials, designLinks, designNodes, insights, labelTypes, notificationChannels, notificationSubscriptions, projectGroupMappings, projectLinks, projectMembers, projects, schema, schemaMeta, siteSettings, snapshots, tokens, userConnections, userInviteTokens, users, webhooks };
70
+ export { type AiBudgetAlert, type AiUsage, type Baseline, type Build, type BuildLabel, type BuildPackageUsage, type CaptureAttempt, type CaptureLog, type Comment, type ContentUse, type DesignCredential, type DesignLink, type DesignNode, type GitConnection, type GitRepositoryLink, type Insight, type LabelType, type NotificationChannel, type NotificationSubscription, type Project, type ProjectGroupMapping, type ProjectLink, type ProjectMember, Schema, type Snapshot, type StorybookMeta, type Token, type User, type UserConnection, type UserInviteToken, type Webhook, aiBudgetAlerts, aiUsage, baselines, buildComponents, buildLabels, buildPackageUsage, buildReviews, builds, captureAttempts, captureJobs, captureLogs, captureShards, comments, contentUses, designCredentials, designLinks, designNodes, gitConnections, gitRepositoryLinks, insights, labelTypes, notificationChannels, notificationSubscriptions, projectGroupMappings, projectLinks, projectMembers, projects, schema, schemaMeta, siteSettings, snapshots, tokens, userConnections, userInviteTokens, users, webhooks };
68
71
  //# sourceMappingURL=schema.d.mts.map
package/dist/schema.mjs CHANGED
@@ -15,6 +15,7 @@ import { comments } from "./schema/comment.mjs";
15
15
  import { userConnections } from "./schema/connection.mjs";
16
16
  import { contentUses } from "./schema/content-uses.mjs";
17
17
  import { designCredentials, designLinks, designNodes } from "./schema/design.mjs";
18
+ import { gitConnections, gitRepositoryLinks } from "./schema/git-connection.mjs";
18
19
  import { aiBudgetAlerts, aiUsage, insights } from "./schema/insight.mjs";
19
20
  import { buildLabels, labelTypes } from "./schema/label.mjs";
20
21
  import { projectMembers } from "./schema/member.mjs";
@@ -61,8 +62,10 @@ const schema = {
61
62
  userInviteTokens,
62
63
  projectMembers,
63
64
  projectGroupMappings,
64
- contentUses
65
+ contentUses,
66
+ gitConnections,
67
+ gitRepositoryLinks
65
68
  };
66
- export { aiBudgetAlerts, aiUsage, baselines, buildComponents, buildLabels, buildPackageUsage, buildReviews, builds, captureAttempts, captureJobs, captureLogs, captureShards, comments, contentUses, designCredentials, designLinks, designNodes, insights, labelTypes, notificationChannels, notificationSubscriptions, projectGroupMappings, projectLinks, projectMembers, projects, schema, schemaMeta, siteSettings, snapshots, tokens, userConnections, userInviteTokens, users, webhooks };
69
+ export { aiBudgetAlerts, aiUsage, baselines, buildComponents, buildLabels, buildPackageUsage, buildReviews, builds, captureAttempts, captureJobs, captureLogs, captureShards, comments, contentUses, designCredentials, designLinks, designNodes, gitConnections, gitRepositoryLinks, insights, labelTypes, notificationChannels, notificationSubscriptions, projectGroupMappings, projectLinks, projectMembers, projects, schema, schemaMeta, siteSettings, snapshots, tokens, userConnections, userInviteTokens, users, webhooks };
67
70
 
68
71
  //# sourceMappingURL=schema.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.mjs","names":["projectsTable","buildsTable","captureAttemptsTable","captureLogsTable","captureShardsTable","captureJobsTable","buildComponentsTable","buildReviewsTable","siteSettingsTable","schemaMetaTable","snapshotsTable","baselinesTable","commentsTable","labelTypesTable","buildLabelsTable","projectLinksTable","designLinksTable","designCredentialsTable","userConnectionsTable","designNodesTable","buildPackageUsageTable","tokensTable","webhooksTable","insightsTable","aiUsageTable","aiBudgetAlertsTable","notificationChannelsTable","notificationSubscriptionsTable","usersTable","userInviteTokensTable","projectMembersTable","projectGroupMappingsTable","contentUsesTable"],"sources":["../src/schema/index.ts"],"sourcesContent":["/**\n * Database schema: table handles, row types, and the schema object passed\n * to the database client.\n *\n * Table handles are available on the `schema` object with full type\n * inference (`schema.builds`, …); exact column types live on the narrow\n * per-entity definitions, and the row interfaces are pinned to them by\n * `schema-types.test.ts`.\n */\nimport type { AnyMySqlTable } from \"drizzle-orm/mysql-core\";\nimport { baselines as baselinesTable } from \"./baseline.ts\";\nimport { buildComponents as buildComponentsTable } from \"./build-component.ts\";\nimport { buildReviews as buildReviewsTable } from \"./build-review.ts\";\nimport { builds as buildsTable } from \"./build.ts\";\nimport {\n captureAttempts as captureAttemptsTable,\n captureLogs as captureLogsTable,\n} from \"./capture-attempt.ts\";\nimport { captureJobs as captureJobsTable } from \"./capture-job.ts\";\nimport { captureShards as captureShardsTable } from \"./capture-shard.ts\";\nimport { comments as commentsTable } from \"./comment.ts\";\nimport { userConnections as userConnectionsTable } from \"./connection.ts\";\nimport { contentUses as contentUsesTable } from \"./content-uses.ts\";\nimport {\n designLinks as designLinksTable,\n designCredentials as designCredentialsTable,\n designNodes as designNodesTable,\n} from \"./design.ts\";\nimport {\n aiBudgetAlerts as aiBudgetAlertsTable,\n aiUsage as aiUsageTable,\n insights as insightsTable,\n} from \"./insight.ts\";\nimport { buildLabels as buildLabelsTable, labelTypes as labelTypesTable } from \"./label.ts\";\nimport { projectMembers as projectMembersTable } from \"./member.ts\";\nimport {\n notificationChannels as notificationChannelsTable,\n notificationSubscriptions as notificationSubscriptionsTable,\n} from \"./notification.ts\";\nimport { projectGroupMappings as projectGroupMappingsTable } from \"./project-group-mapping.ts\";\nimport { projects as projectsTable } from \"./project.ts\";\nimport { schemaMeta as schemaMetaTable } from \"./schema-meta.ts\";\nimport { siteSettings as siteSettingsTable } from \"./site-setting.ts\";\nimport { snapshots as snapshotsTable } from \"./snapshot.ts\";\nimport { tokens as tokensTable } from \"./token.ts\";\nimport {\n buildPackageUsage as buildPackageUsageTable,\n projectLinks as projectLinksTable,\n} from \"./usage.ts\";\nimport { userInviteTokens as userInviteTokensTable } from \"./user-invite.ts\";\nimport { users as usersTable } from \"./user.ts\";\nimport { webhooks as webhooksTable } from \"./webhook.ts\";\n\nexport { builds } from \"./build.ts\";\nexport { captureAttempts, captureLogs } from \"./capture-attempt.ts\";\nexport { captureJobs } from \"./capture-job.ts\";\nexport { buildComponents } from \"./build-component.ts\";\nexport { buildReviews } from \"./build-review.ts\";\nexport { schemaMeta } from \"./schema-meta.ts\";\nexport { siteSettings } from \"./site-setting.ts\";\nexport { captureShards } from \"./capture-shard.ts\";\nexport { baselines } from \"./baseline.ts\";\nexport { comments } from \"./comment.ts\";\nexport { buildLabels, labelTypes } from \"./label.ts\";\nexport { projectMembers } from \"./member.ts\";\nexport { buildPackageUsage, projectLinks } from \"./usage.ts\";\nexport { userConnections } from \"./connection.ts\";\nexport { designCredentials, designLinks, designNodes } from \"./design.ts\";\nexport { projectGroupMappings } from \"./project-group-mapping.ts\";\nexport { projects } from \"./project.ts\";\nexport { snapshots } from \"./snapshot.ts\";\nexport { tokens } from \"./token.ts\";\nexport { userInviteTokens } from \"./user-invite.ts\";\nexport { users } from \"./user.ts\";\nexport { webhooks } from \"./webhook.ts\";\nexport { aiBudgetAlerts, aiUsage, insights } from \"./insight.ts\";\nexport { notificationChannels, notificationSubscriptions } from \"./notification.ts\";\nexport { contentUses } from \"./content-uses.ts\";\n\n/** A capture attempt and its log lines for a single build run. */\nexport type { CaptureAttempt, CaptureLog } from \"./capture-attempt.ts\";\n/** Build row as stored in the `builds` table. */\nexport type { Build } from \"./build.ts\";\n/** Review comment row as stored in the `comments` table. */\nexport type { Comment } from \"./comment.ts\";\n/** Build label and label type rows. */\nexport type { BuildLabel, LabelType } from \"./label.ts\";\n/** A user's OAuth connection to an external service. */\nexport type { UserConnection } from \"./connection.ts\";\n/** Design link, provider credential and cached design node rows. */\nexport type { DesignCredential, DesignLink, DesignNode } from \"./design.ts\";\n/** Project link and per-build package usage rows. */\nexport type { BuildPackageUsage, ProjectLink } from \"./usage.ts\";\n/** Project membership row linking a user to a project role. */\nexport type { ProjectMember } from \"./member.ts\";\n/** Identity-provider group to project-role mapping row. */\nexport type { ProjectGroupMapping } from \"./project-group-mapping.ts\";\n/** Project row and its embedded Storybook metadata. */\nexport type { Project, StorybookMeta } from \"./project.ts\";\n/** Per-project git provider status-check configuration row. */\n/** Snapshot row capturing a single story at one viewport. */\nexport type { Snapshot } from \"./snapshot.ts\";\n/** CI token row (stores only the hash). */\nexport type { Token } from \"./token.ts\";\n/** One-time invite token for local accounts. */\nexport type { UserInviteToken } from \"./user-invite.ts\";\n/** User row for authenticated identities. */\nexport type { User } from \"./user.ts\";\n/** Webhook subscription row. */\nexport type { Webhook } from \"./webhook.ts\";\n/** Insight, AI usage and budget-alert rows. */\nexport type { AiBudgetAlert, AiUsage, Insight } from \"./insight.ts\";\n/** Notification channel and subscription rows. */\nexport type { NotificationChannel, NotificationSubscription } from \"./notification.ts\";\n/** Baseline row. */\nexport type { Baseline } from \"./baseline.ts\";\n/** Content ref row for deduplicated assets. */\nexport type { ContentUse } from \"./content-uses.ts\";\n\n/** Full Drizzle schema object passed to the database client. */\nexport const schema: {\n projects: AnyMySqlTable;\n builds: AnyMySqlTable;\n captureAttempts: AnyMySqlTable;\n captureLogs: AnyMySqlTable;\n captureShards: AnyMySqlTable;\n captureJobs: AnyMySqlTable;\n buildComponents: AnyMySqlTable;\n buildReviews: AnyMySqlTable;\n siteSettings: AnyMySqlTable;\n schemaMeta: AnyMySqlTable;\n snapshots: AnyMySqlTable;\n baselines: AnyMySqlTable;\n comments: AnyMySqlTable;\n labelTypes: AnyMySqlTable;\n buildLabels: AnyMySqlTable;\n projectLinks: AnyMySqlTable;\n designLinks: AnyMySqlTable;\n designCredentials: AnyMySqlTable;\n userConnections: AnyMySqlTable;\n designNodes: AnyMySqlTable;\n buildPackageUsage: AnyMySqlTable;\n tokens: AnyMySqlTable;\n webhooks: AnyMySqlTable;\n insights: AnyMySqlTable;\n aiUsage: AnyMySqlTable;\n aiBudgetAlerts: AnyMySqlTable;\n notificationChannels: AnyMySqlTable;\n notificationSubscriptions: AnyMySqlTable;\n users: AnyMySqlTable;\n userInviteTokens: AnyMySqlTable;\n projectMembers: AnyMySqlTable;\n projectGroupMappings: AnyMySqlTable;\n contentUses: AnyMySqlTable;\n} = {\n projects: projectsTable,\n builds: buildsTable,\n captureAttempts: captureAttemptsTable,\n captureLogs: captureLogsTable,\n captureShards: captureShardsTable,\n captureJobs: captureJobsTable,\n buildComponents: buildComponentsTable,\n buildReviews: buildReviewsTable,\n siteSettings: siteSettingsTable,\n schemaMeta: schemaMetaTable,\n snapshots: snapshotsTable,\n baselines: baselinesTable,\n comments: commentsTable,\n labelTypes: labelTypesTable,\n buildLabels: buildLabelsTable,\n projectLinks: projectLinksTable,\n designLinks: designLinksTable,\n designCredentials: designCredentialsTable,\n userConnections: userConnectionsTable,\n designNodes: designNodesTable,\n buildPackageUsage: buildPackageUsageTable,\n tokens: tokensTable,\n webhooks: webhooksTable,\n insights: insightsTable,\n aiUsage: aiUsageTable,\n aiBudgetAlerts: aiBudgetAlertsTable,\n notificationChannels: notificationChannelsTable,\n notificationSubscriptions: notificationSubscriptionsTable,\n users: usersTable,\n userInviteTokens: userInviteTokensTable,\n projectMembers: projectMembersTable,\n projectGroupMappings: projectGroupMappingsTable,\n contentUses: contentUsesTable,\n};\n\n/** The full database schema type. */\nexport type Schema = typeof schema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwHA,MAAa,SAkCT;CACQA;CACFC;CACSC;CACJC;CACEC;CACFC;CACIC;CACHC;CACAC;CACFC;CACDC;CACAC;CACDC;CACEC;CACCC;CACCC;CACDC;CACMC;CACFC;CACJC;CACMC;CACXC;CACEC;CACAC;CACDC;CACOC;CACMC;CACKC;CACpBC;CACWC;CACFC;CACMC;CACTC;AACf"}
1
+ {"version":3,"file":"schema.mjs","names":["projectsTable","buildsTable","captureAttemptsTable","captureLogsTable","captureShardsTable","captureJobsTable","buildComponentsTable","buildReviewsTable","siteSettingsTable","schemaMetaTable","snapshotsTable","baselinesTable","commentsTable","labelTypesTable","buildLabelsTable","projectLinksTable","designLinksTable","designCredentialsTable","userConnectionsTable","designNodesTable","buildPackageUsageTable","tokensTable","webhooksTable","insightsTable","aiUsageTable","aiBudgetAlertsTable","notificationChannelsTable","notificationSubscriptionsTable","usersTable","userInviteTokensTable","projectMembersTable","projectGroupMappingsTable","contentUsesTable","gitConnectionsTable","gitRepositoryLinksTable"],"sources":["../src/schema/index.ts"],"sourcesContent":["/**\n * Database schema: table handles, row types, and the schema object passed\n * to the database client.\n *\n * Table handles are available on the `schema` object with full type\n * inference (`schema.builds`, …); exact column types live on the narrow\n * per-entity definitions, and the row interfaces are pinned to them by\n * `schema-types.test.ts`.\n */\nimport type { AnyMySqlTable } from \"drizzle-orm/mysql-core\";\nimport { baselines as baselinesTable } from \"./baseline.ts\";\nimport { buildComponents as buildComponentsTable } from \"./build-component.ts\";\nimport { buildReviews as buildReviewsTable } from \"./build-review.ts\";\nimport { builds as buildsTable } from \"./build.ts\";\nimport {\n captureAttempts as captureAttemptsTable,\n captureLogs as captureLogsTable,\n} from \"./capture-attempt.ts\";\nimport { captureJobs as captureJobsTable } from \"./capture-job.ts\";\nimport { captureShards as captureShardsTable } from \"./capture-shard.ts\";\nimport { comments as commentsTable } from \"./comment.ts\";\nimport { userConnections as userConnectionsTable } from \"./connection.ts\";\nimport { contentUses as contentUsesTable } from \"./content-uses.ts\";\nimport {\n designLinks as designLinksTable,\n designCredentials as designCredentialsTable,\n designNodes as designNodesTable,\n} from \"./design.ts\";\nimport {\n gitConnections as gitConnectionsTable,\n gitRepositoryLinks as gitRepositoryLinksTable,\n} from \"./git-connection.ts\";\nimport {\n aiBudgetAlerts as aiBudgetAlertsTable,\n aiUsage as aiUsageTable,\n insights as insightsTable,\n} from \"./insight.ts\";\nimport { buildLabels as buildLabelsTable, labelTypes as labelTypesTable } from \"./label.ts\";\nimport { projectMembers as projectMembersTable } from \"./member.ts\";\nimport {\n notificationChannels as notificationChannelsTable,\n notificationSubscriptions as notificationSubscriptionsTable,\n} from \"./notification.ts\";\nimport { projectGroupMappings as projectGroupMappingsTable } from \"./project-group-mapping.ts\";\nimport { projects as projectsTable } from \"./project.ts\";\nimport { schemaMeta as schemaMetaTable } from \"./schema-meta.ts\";\nimport { siteSettings as siteSettingsTable } from \"./site-setting.ts\";\nimport { snapshots as snapshotsTable } from \"./snapshot.ts\";\nimport { tokens as tokensTable } from \"./token.ts\";\nimport {\n buildPackageUsage as buildPackageUsageTable,\n projectLinks as projectLinksTable,\n} from \"./usage.ts\";\nimport { userInviteTokens as userInviteTokensTable } from \"./user-invite.ts\";\nimport { users as usersTable } from \"./user.ts\";\nimport { webhooks as webhooksTable } from \"./webhook.ts\";\n\nexport { builds } from \"./build.ts\";\nexport { captureAttempts, captureLogs } from \"./capture-attempt.ts\";\nexport { captureJobs } from \"./capture-job.ts\";\nexport { buildComponents } from \"./build-component.ts\";\nexport { buildReviews } from \"./build-review.ts\";\nexport { schemaMeta } from \"./schema-meta.ts\";\nexport { siteSettings } from \"./site-setting.ts\";\nexport { captureShards } from \"./capture-shard.ts\";\nexport { baselines } from \"./baseline.ts\";\nexport { comments } from \"./comment.ts\";\nexport { buildLabels, labelTypes } from \"./label.ts\";\nexport { projectMembers } from \"./member.ts\";\nexport { buildPackageUsage, projectLinks } from \"./usage.ts\";\nexport { userConnections } from \"./connection.ts\";\nexport { designCredentials, designLinks, designNodes } from \"./design.ts\";\nexport { projectGroupMappings } from \"./project-group-mapping.ts\";\nexport { projects } from \"./project.ts\";\nexport { snapshots } from \"./snapshot.ts\";\nexport { tokens } from \"./token.ts\";\nexport { userInviteTokens } from \"./user-invite.ts\";\nexport { users } from \"./user.ts\";\nexport { webhooks } from \"./webhook.ts\";\nexport { aiBudgetAlerts, aiUsage, insights } from \"./insight.ts\";\nexport { notificationChannels, notificationSubscriptions } from \"./notification.ts\";\nexport { contentUses } from \"./content-uses.ts\";\nexport { gitConnections, gitRepositoryLinks } from \"./git-connection.ts\";\n\n/** A capture attempt and its log lines for a single build run. */\nexport type { CaptureAttempt, CaptureLog } from \"./capture-attempt.ts\";\n/** Build row as stored in the `builds` table. */\nexport type { Build } from \"./build.ts\";\n/** Review comment row as stored in the `comments` table. */\nexport type { Comment } from \"./comment.ts\";\n/** Build label and label type rows. */\nexport type { BuildLabel, LabelType } from \"./label.ts\";\n/** A user's OAuth connection to an external service. */\nexport type { UserConnection } from \"./connection.ts\";\n/** Design link, provider credential and cached design node rows. */\nexport type { DesignCredential, DesignLink, DesignNode } from \"./design.ts\";\n/** Project link and per-build package usage rows. */\nexport type { BuildPackageUsage, ProjectLink } from \"./usage.ts\";\n/** Project membership row linking a user to a project role. */\nexport type { ProjectMember } from \"./member.ts\";\n/** Identity-provider group to project-role mapping row. */\nexport type { ProjectGroupMapping } from \"./project-group-mapping.ts\";\n/** Project row and its embedded Storybook metadata. */\nexport type { Project, StorybookMeta } from \"./project.ts\";\n/** Per-project git provider status-check configuration row. */\n/** Snapshot row capturing a single story at one viewport. */\nexport type { Snapshot } from \"./snapshot.ts\";\n/** CI token row (stores only the hash). */\nexport type { Token } from \"./token.ts\";\n/** One-time invite token for local accounts. */\nexport type { UserInviteToken } from \"./user-invite.ts\";\n/** User row for authenticated identities. */\nexport type { User } from \"./user.ts\";\n/** Webhook subscription row. */\nexport type { Webhook } from \"./webhook.ts\";\n/** Insight, AI usage and budget-alert rows. */\nexport type { AiBudgetAlert, AiUsage, Insight } from \"./insight.ts\";\n/** Notification channel and subscription rows. */\nexport type { NotificationChannel, NotificationSubscription } from \"./notification.ts\";\n/** Baseline row. */\nexport type { Baseline } from \"./baseline.ts\";\n/** Content ref row for deduplicated assets. */\nexport type { ContentUse } from \"./content-uses.ts\";\n/** Git connection and repository link rows. */\nexport type { GitConnection, GitRepositoryLink } from \"./git-connection.ts\";\n\n/** Full Drizzle schema object passed to the database client. */\nexport const schema: {\n projects: AnyMySqlTable;\n builds: AnyMySqlTable;\n captureAttempts: AnyMySqlTable;\n captureLogs: AnyMySqlTable;\n captureShards: AnyMySqlTable;\n captureJobs: AnyMySqlTable;\n buildComponents: AnyMySqlTable;\n buildReviews: AnyMySqlTable;\n siteSettings: AnyMySqlTable;\n schemaMeta: AnyMySqlTable;\n snapshots: AnyMySqlTable;\n baselines: AnyMySqlTable;\n comments: AnyMySqlTable;\n labelTypes: AnyMySqlTable;\n buildLabels: AnyMySqlTable;\n projectLinks: AnyMySqlTable;\n designLinks: AnyMySqlTable;\n designCredentials: AnyMySqlTable;\n userConnections: AnyMySqlTable;\n designNodes: AnyMySqlTable;\n buildPackageUsage: AnyMySqlTable;\n tokens: AnyMySqlTable;\n webhooks: AnyMySqlTable;\n insights: AnyMySqlTable;\n aiUsage: AnyMySqlTable;\n aiBudgetAlerts: AnyMySqlTable;\n notificationChannels: AnyMySqlTable;\n notificationSubscriptions: AnyMySqlTable;\n users: AnyMySqlTable;\n userInviteTokens: AnyMySqlTable;\n projectMembers: AnyMySqlTable;\n projectGroupMappings: AnyMySqlTable;\n contentUses: AnyMySqlTable;\n gitConnections: AnyMySqlTable;\n gitRepositoryLinks: AnyMySqlTable;\n} = {\n projects: projectsTable,\n builds: buildsTable,\n captureAttempts: captureAttemptsTable,\n captureLogs: captureLogsTable,\n captureShards: captureShardsTable,\n captureJobs: captureJobsTable,\n buildComponents: buildComponentsTable,\n buildReviews: buildReviewsTable,\n siteSettings: siteSettingsTable,\n schemaMeta: schemaMetaTable,\n snapshots: snapshotsTable,\n baselines: baselinesTable,\n comments: commentsTable,\n labelTypes: labelTypesTable,\n buildLabels: buildLabelsTable,\n projectLinks: projectLinksTable,\n designLinks: designLinksTable,\n designCredentials: designCredentialsTable,\n userConnections: userConnectionsTable,\n designNodes: designNodesTable,\n buildPackageUsage: buildPackageUsageTable,\n tokens: tokensTable,\n webhooks: webhooksTable,\n insights: insightsTable,\n aiUsage: aiUsageTable,\n aiBudgetAlerts: aiBudgetAlertsTable,\n notificationChannels: notificationChannelsTable,\n notificationSubscriptions: notificationSubscriptionsTable,\n users: usersTable,\n userInviteTokens: userInviteTokensTable,\n projectMembers: projectMembersTable,\n projectGroupMappings: projectGroupMappingsTable,\n contentUses: contentUsesTable,\n gitConnections: gitConnectionsTable,\n gitRepositoryLinks: gitRepositoryLinksTable,\n};\n\n/** The full database schema type. */\nexport type Schema = typeof schema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+HA,MAAa,SAoCT;CACQA;CACFC;CACSC;CACJC;CACEC;CACFC;CACIC;CACHC;CACAC;CACFC;CACDC;CACAC;CACDC;CACEC;CACCC;CACCC;CACDC;CACMC;CACFC;CACJC;CACMC;CACXC;CACEC;CACAC;CACDC;CACOC;CACMC;CACKC;CACpBC;CACWC;CACFC;CACMC;CACTC;CACGC;CACIC;AACtB"}