@storyshelf/db-postgres 0.6.2 → 0.8.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 (97) hide show
  1. package/README.md +56 -0
  2. package/dist/ddl.d.mts +1 -3
  3. package/dist/ddl.mjs +219 -16
  4. package/dist/ddl.mjs.map +1 -1
  5. package/dist/drizzle-factory-pg.mjs +9 -7
  6. package/dist/drizzle-factory-pg.mjs.map +1 -1
  7. package/dist/drizzle-factory.mjs +1 -2
  8. package/dist/index.d.mts +0 -2
  9. package/dist/index.mjs +2 -3
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/migrate.mjs +115 -5
  12. package/dist/migrate.mjs.map +1 -1
  13. package/dist/neon-http.d.mts +0 -2
  14. package/dist/neon-http.mjs +2 -3
  15. package/dist/neon-http.mjs.map +1 -1
  16. package/dist/neon.d.mts +0 -2
  17. package/dist/neon.mjs +2 -3
  18. package/dist/neon.mjs.map +1 -1
  19. package/dist/pg.d.mts +0 -2
  20. package/dist/pg.mjs +2 -3
  21. package/dist/pg.mjs.map +1 -1
  22. package/dist/pglite.d.mts +0 -2
  23. package/dist/pglite.mjs +3 -4
  24. package/dist/pglite.mjs.map +1 -1
  25. package/dist/schema/baseline.d.mts +83 -13
  26. package/dist/schema/baseline.mjs +6 -3
  27. package/dist/schema/baseline.mjs.map +1 -1
  28. package/dist/schema/{status-config.d.mts → build-component.d.mts} +43 -38
  29. package/dist/schema/build-component.mjs +24 -0
  30. package/dist/schema/build-component.mjs.map +1 -0
  31. package/dist/schema/build-review.d.mts +116 -0
  32. package/dist/schema/build-review.mjs +22 -0
  33. package/dist/schema/build-review.mjs.map +1 -0
  34. package/dist/schema/build.d.mts +59 -25
  35. package/dist/schema/build.mjs +4 -2
  36. package/dist/schema/build.mjs.map +1 -1
  37. package/dist/schema/capture-attempt.d.mts +25 -27
  38. package/dist/schema/capture-attempt.mjs +1 -2
  39. package/dist/schema/capture-job.d.mts +328 -0
  40. package/dist/schema/capture-job.mjs +55 -0
  41. package/dist/schema/capture-job.mjs.map +1 -0
  42. package/dist/schema/capture-shard.d.mts +255 -0
  43. package/dist/schema/capture-shard.mjs +39 -0
  44. package/dist/schema/capture-shard.mjs.map +1 -0
  45. package/dist/schema/comment.d.mts +29 -13
  46. package/dist/schema/comment.mjs +4 -4
  47. package/dist/schema/comment.mjs.map +1 -1
  48. package/dist/schema/connection.d.mts +171 -0
  49. package/dist/schema/connection.mjs +34 -0
  50. package/dist/schema/connection.mjs.map +1 -0
  51. package/dist/schema/content-refs.d.mts +0 -2
  52. package/dist/schema/content-refs.mjs +1 -2
  53. package/dist/schema/design.d.mts +587 -0
  54. package/dist/schema/design.mjs +72 -0
  55. package/dist/schema/design.mjs.map +1 -0
  56. package/dist/schema/insight.d.mts +631 -0
  57. package/dist/schema/insight.mjs +67 -0
  58. package/dist/schema/insight.mjs.map +1 -0
  59. package/dist/schema/label.d.mts +15 -17
  60. package/dist/schema/label.mjs +1 -2
  61. package/dist/schema/member.d.mts +7 -9
  62. package/dist/schema/member.mjs +1 -2
  63. package/dist/schema/notification.d.mts +54 -20
  64. package/dist/schema/notification.mjs +6 -2
  65. package/dist/schema/notification.mjs.map +1 -1
  66. package/dist/schema/project-group-mapping.d.mts +6 -8
  67. package/dist/schema/project-group-mapping.mjs +1 -2
  68. package/dist/schema/project.d.mts +126 -2
  69. package/dist/schema/project.mjs +9 -3
  70. package/dist/schema/project.mjs.map +1 -1
  71. package/dist/schema/site-setting.d.mts +97 -0
  72. package/dist/schema/site-setting.mjs +22 -0
  73. package/dist/schema/site-setting.mjs.map +1 -0
  74. package/dist/schema/snapshot.d.mts +187 -27
  75. package/dist/schema/snapshot.mjs +15 -3
  76. package/dist/schema/snapshot.mjs.map +1 -1
  77. package/dist/schema/token.d.mts +8 -10
  78. package/dist/schema/token.mjs +1 -2
  79. package/dist/schema/usage.d.mts +265 -0
  80. package/dist/schema/usage.mjs +35 -0
  81. package/dist/schema/usage.mjs.map +1 -0
  82. package/dist/schema/user-invite.d.mts +7 -9
  83. package/dist/schema/user-invite.mjs +1 -2
  84. package/dist/schema/user.d.mts +74 -2
  85. package/dist/schema/user.mjs +7 -4
  86. package/dist/schema/user.mjs.map +1 -1
  87. package/dist/schema/webhook.d.mts +8 -10
  88. package/dist/schema/webhook.mjs +1 -2
  89. package/dist/schema.d.mts +24 -5
  90. package/dist/schema.mjs +26 -6
  91. package/dist/schema.mjs.map +1 -1
  92. package/dist/vercel.d.mts +0 -2
  93. package/dist/vercel.mjs +2 -3
  94. package/dist/vercel.mjs.map +1 -1
  95. package/package.json +7 -7
  96. package/dist/schema/status-config.mjs +0 -26
  97. package/dist/schema/status-config.mjs.map +0 -1
@@ -1,13 +1,12 @@
1
1
  import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
3
  import { BuildStatus } from "@storyshelf/core/types";
4
- //#region src/schema/build.d.ts
5
4
  /** Narrow `builds` table definition. */
6
- declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
5
+ declare const builds: import("drizzle-orm/pg-core/table.js").PgTableWithColumns<{
7
6
  name: "builds";
8
7
  schema: undefined;
9
8
  columns: {
10
- id: import("drizzle-orm/pg-core").PgColumn<{
9
+ id: import("drizzle-orm/pg-core/index.js").PgColumn<{
11
10
  name: "id";
12
11
  tableName: "builds";
13
12
  dataType: "string";
@@ -24,7 +23,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
24
23
  identity: undefined;
25
24
  generated: undefined;
26
25
  }, {}, {}>;
27
- projectId: import("drizzle-orm/pg-core").PgColumn<{
26
+ projectId: import("drizzle-orm/pg-core/index.js").PgColumn<{
28
27
  name: "project_id";
29
28
  tableName: "builds";
30
29
  dataType: "string";
@@ -41,7 +40,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
41
40
  identity: undefined;
42
41
  generated: undefined;
43
42
  }, {}, {}>;
44
- gitSha: import("drizzle-orm/pg-core").PgColumn<{
43
+ gitSha: import("drizzle-orm/pg-core/index.js").PgColumn<{
45
44
  name: "git_sha";
46
45
  tableName: "builds";
47
46
  dataType: "string";
@@ -58,7 +57,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
58
57
  identity: undefined;
59
58
  generated: undefined;
60
59
  }, {}, {}>;
61
- gitBranch: import("drizzle-orm/pg-core").PgColumn<{
60
+ gitBranch: import("drizzle-orm/pg-core/index.js").PgColumn<{
62
61
  name: "git_branch";
63
62
  tableName: "builds";
64
63
  dataType: "string";
@@ -75,7 +74,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
75
74
  identity: undefined;
76
75
  generated: undefined;
77
76
  }, {}, {}>;
78
- isDefault: import("drizzle-orm/pg-core").PgColumn<{
77
+ isDefault: import("drizzle-orm/pg-core/index.js").PgColumn<{
79
78
  name: "is_default";
80
79
  tableName: "builds";
81
80
  dataType: "boolean";
@@ -92,7 +91,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
92
91
  identity: undefined;
93
92
  generated: undefined;
94
93
  }, {}, {}>;
95
- authorEmail: import("drizzle-orm/pg-core").PgColumn<{
94
+ authorEmail: import("drizzle-orm/pg-core/index.js").PgColumn<{
96
95
  name: "author_email";
97
96
  tableName: "builds";
98
97
  dataType: "string";
@@ -109,7 +108,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
109
108
  identity: undefined;
110
109
  generated: undefined;
111
110
  }, {}, {}>;
112
- authorName: import("drizzle-orm/pg-core").PgColumn<{
111
+ authorName: import("drizzle-orm/pg-core/index.js").PgColumn<{
113
112
  name: "author_name";
114
113
  tableName: "builds";
115
114
  dataType: "string";
@@ -126,7 +125,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
126
125
  identity: undefined;
127
126
  generated: undefined;
128
127
  }, {}, {}>;
129
- message: import("drizzle-orm/pg-core").PgColumn<{
128
+ message: import("drizzle-orm/pg-core/index.js").PgColumn<{
130
129
  name: "message";
131
130
  tableName: "builds";
132
131
  dataType: "string";
@@ -143,7 +142,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
143
142
  identity: undefined;
144
143
  generated: undefined;
145
144
  }, {}, {}>;
146
- public: import("drizzle-orm/pg-core").PgColumn<{
145
+ public: import("drizzle-orm/pg-core/index.js").PgColumn<{
147
146
  name: "public";
148
147
  tableName: "builds";
149
148
  dataType: "boolean";
@@ -160,12 +159,12 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
160
159
  identity: undefined;
161
160
  generated: undefined;
162
161
  }, {}, {}>;
163
- status: import("drizzle-orm/pg-core").PgColumn<{
162
+ status: import("drizzle-orm/pg-core/index.js").PgColumn<{
164
163
  name: "status";
165
164
  tableName: "builds";
166
165
  dataType: "string";
167
166
  columnType: "PgText";
168
- data: "approved" | "capturing" | "comparing" | "failed" | "pending" | "rejected" | "reviewing";
167
+ data: "approved" | "cancelled" | "capturing" | "comparing" | "failed" | "pending" | "rejected" | "reviewing";
169
168
  driverParam: string;
170
169
  notNull: true;
171
170
  hasDefault: true;
@@ -177,9 +176,9 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
177
176
  identity: undefined;
178
177
  generated: undefined;
179
178
  }, {}, {
180
- $type: "approved" | "capturing" | "comparing" | "failed" | "pending" | "rejected" | "reviewing";
179
+ $type: "approved" | "cancelled" | "capturing" | "comparing" | "failed" | "pending" | "rejected" | "reviewing";
181
180
  }>;
182
- snapshotCount: import("drizzle-orm/pg-core").PgColumn<{
181
+ snapshotCount: import("drizzle-orm/pg-core/index.js").PgColumn<{
183
182
  name: "snapshot_count";
184
183
  tableName: "builds";
185
184
  dataType: "number";
@@ -196,7 +195,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
196
195
  identity: undefined;
197
196
  generated: undefined;
198
197
  }, {}, {}>;
199
- changedCount: import("drizzle-orm/pg-core").PgColumn<{
198
+ changedCount: import("drizzle-orm/pg-core/index.js").PgColumn<{
200
199
  name: "changed_count";
201
200
  tableName: "builds";
202
201
  dataType: "number";
@@ -213,7 +212,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
213
212
  identity: undefined;
214
213
  generated: undefined;
215
214
  }, {}, {}>;
216
- approvedCount: import("drizzle-orm/pg-core").PgColumn<{
215
+ approvedCount: import("drizzle-orm/pg-core/index.js").PgColumn<{
217
216
  name: "approved_count";
218
217
  tableName: "builds";
219
218
  dataType: "number";
@@ -230,7 +229,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
230
229
  identity: undefined;
231
230
  generated: undefined;
232
231
  }, {}, {}>;
233
- rejectedCount: import("drizzle-orm/pg-core").PgColumn<{
232
+ rejectedCount: import("drizzle-orm/pg-core/index.js").PgColumn<{
234
233
  name: "rejected_count";
235
234
  tableName: "builds";
236
235
  dataType: "number";
@@ -247,7 +246,24 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
247
246
  identity: undefined;
248
247
  generated: undefined;
249
248
  }, {}, {}>;
250
- affectedOnly: import("drizzle-orm/pg-core").PgColumn<{
249
+ inheritedCount: import("drizzle-orm/pg-core/index.js").PgColumn<{
250
+ name: "inherited_count";
251
+ tableName: "builds";
252
+ dataType: "number";
253
+ columnType: "PgInteger";
254
+ data: number;
255
+ driverParam: string | number;
256
+ notNull: true;
257
+ hasDefault: true;
258
+ isPrimaryKey: false;
259
+ isAutoincrement: false;
260
+ hasRuntimeDefault: false;
261
+ enumValues: undefined;
262
+ baseColumn: never;
263
+ identity: undefined;
264
+ generated: undefined;
265
+ }, {}, {}>;
266
+ affectedOnly: import("drizzle-orm/pg-core/index.js").PgColumn<{
251
267
  name: "affected_only";
252
268
  tableName: "builds";
253
269
  dataType: "boolean";
@@ -264,7 +280,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
264
280
  identity: undefined;
265
281
  generated: undefined;
266
282
  }, {}, {}>;
267
- baselineSha: import("drizzle-orm/pg-core").PgColumn<{
283
+ baselineSha: import("drizzle-orm/pg-core/index.js").PgColumn<{
268
284
  name: "baseline_sha";
269
285
  tableName: "builds";
270
286
  dataType: "string";
@@ -281,7 +297,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
281
297
  identity: undefined;
282
298
  generated: undefined;
283
299
  }, {}, {}>;
284
- changedFiles: import("drizzle-orm/pg-core").PgColumn<{
300
+ changedFiles: import("drizzle-orm/pg-core/index.js").PgColumn<{
285
301
  name: "changed_files";
286
302
  tableName: "builds";
287
303
  dataType: "string";
@@ -298,7 +314,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
298
314
  identity: undefined;
299
315
  generated: undefined;
300
316
  }, {}, {}>;
301
- affectedImportPaths: import("drizzle-orm/pg-core").PgColumn<{
317
+ affectedImportPaths: import("drizzle-orm/pg-core/index.js").PgColumn<{
302
318
  name: "affected_import_paths";
303
319
  tableName: "builds";
304
320
  dataType: "string";
@@ -315,7 +331,24 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
315
331
  identity: undefined;
316
332
  generated: undefined;
317
333
  }, {}, {}>;
318
- createdAt: import("drizzle-orm/pg-core").PgColumn<{
334
+ testResults: import("drizzle-orm/pg-core/index.js").PgColumn<{
335
+ name: "test_results";
336
+ tableName: "builds";
337
+ dataType: "string";
338
+ columnType: "PgText";
339
+ data: string;
340
+ driverParam: string;
341
+ notNull: false;
342
+ hasDefault: false;
343
+ isPrimaryKey: false;
344
+ isAutoincrement: false;
345
+ hasRuntimeDefault: false;
346
+ enumValues: [string, ...string[]];
347
+ baseColumn: never;
348
+ identity: undefined;
349
+ generated: undefined;
350
+ }, {}, {}>;
351
+ createdAt: import("drizzle-orm/pg-core/index.js").PgColumn<{
319
352
  name: "created_at";
320
353
  tableName: "builds";
321
354
  dataType: "string";
@@ -332,7 +365,7 @@ declare const builds: import("drizzle-orm/pg-core").PgTableWithColumns<{
332
365
  identity: undefined;
333
366
  generated: undefined;
334
367
  }, {}, {}>;
335
- updatedAt: import("drizzle-orm/pg-core").PgColumn<{
368
+ updatedAt: import("drizzle-orm/pg-core/index.js").PgColumn<{
336
369
  name: "updated_at";
337
370
  tableName: "builds";
338
371
  dataType: "string";
@@ -368,13 +401,14 @@ interface Build {
368
401
  changedCount: number;
369
402
  approvedCount: number;
370
403
  rejectedCount: number;
404
+ inheritedCount: number;
371
405
  affectedOnly: boolean;
372
406
  baselineSha: string | null;
373
407
  changedFiles: string | null;
374
408
  affectedImportPaths: string | null;
409
+ testResults: string | null;
375
410
  createdAt: string;
376
411
  updatedAt: string;
377
412
  }
378
- //#endregion
379
413
  export { Build, builds };
380
414
  //# sourceMappingURL=build.d.mts.map
@@ -3,7 +3,7 @@ import "node:url";
3
3
  import.meta.url;
4
4
  import { projects } from "./project.mjs";
5
5
  import { boolean, index, integer, pgTable, text, timestamp } from "drizzle-orm/pg-core";
6
- //#region src/schema/build.ts
6
+ // src/schema/build.ts
7
7
  /** Narrow `builds` table definition. */
8
8
  const builds = pgTable("builds", {
9
9
  id: text("id").primaryKey(),
@@ -20,10 +20,13 @@ const builds = pgTable("builds", {
20
20
  changedCount: integer("changed_count").notNull().default(0),
21
21
  approvedCount: integer("approved_count").notNull().default(0),
22
22
  rejectedCount: integer("rejected_count").notNull().default(0),
23
+ /** Snapshots inherited from the baseline without rendering (affected capture). */
24
+ inheritedCount: integer("inherited_count").notNull().default(0),
23
25
  affectedOnly: boolean("affected_only").notNull().default(true),
24
26
  baselineSha: text("baseline_sha"),
25
27
  changedFiles: text("changed_files"),
26
28
  affectedImportPaths: text("affected_import_paths"),
29
+ testResults: text("test_results"),
27
30
  createdAt: timestamp("created_at", {
28
31
  withTimezone: true,
29
32
  mode: "string"
@@ -33,7 +36,6 @@ const builds = pgTable("builds", {
33
36
  mode: "string"
34
37
  }).notNull()
35
38
  }, (t) => [index("builds_project_gitsha_idx").on(t.projectId, t.gitSha), index("builds_git_branch_idx").on(t.gitBranch)]);
36
- //#endregion
37
39
  export { builds };
38
40
 
39
41
  //# sourceMappingURL=build.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.mjs","names":[],"sources":["../../src/schema/build.ts"],"sourcesContent":["import type { BuildStatus } from \"@storyshelf/core/types\";\nimport { boolean, index, integer, pgTable, text, timestamp } from \"drizzle-orm/pg-core\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `builds` table definition. */\nexport const builds = pgTable(\n \"builds\",\n {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n gitSha: text(\"git_sha\").notNull(),\n gitBranch: text(\"git_branch\").notNull(),\n isDefault: boolean(\"is_default\").notNull().default(false),\n authorEmail: text(\"author_email\"),\n authorName: text(\"author_name\"),\n message: text(\"message\"),\n public: boolean(\"public\").notNull().default(false),\n status: text(\"status\").$type<BuildStatus>().notNull().default(\"pending\"),\n snapshotCount: integer(\"snapshot_count\").notNull().default(0),\n changedCount: integer(\"changed_count\").notNull().default(0),\n approvedCount: integer(\"approved_count\").notNull().default(0),\n rejectedCount: integer(\"rejected_count\").notNull().default(0),\n affectedOnly: boolean(\"affected_only\").notNull().default(true),\n baselineSha: text(\"baseline_sha\"),\n changedFiles: text(\"changed_files\"),\n affectedImportPaths: text(\"affected_import_paths\"),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n },\n (t) => [\n index(\"builds_project_gitsha_idx\").on(t.projectId, t.gitSha),\n index(\"builds_git_branch_idx\").on(t.gitBranch),\n ],\n);\n\n/** A build row. */\nexport interface Build {\n id: string;\n projectId: string;\n gitSha: string;\n gitBranch: string;\n isDefault: boolean;\n authorEmail: string | null;\n authorName: string | null;\n message: string | null;\n public: boolean;\n status: BuildStatus;\n snapshotCount: number;\n changedCount: number;\n approvedCount: number;\n rejectedCount: number;\n affectedOnly: boolean;\n baselineSha: string | null;\n changedFiles: string | null;\n affectedImportPaths: string | null;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;AAKA,MAAa,SAAS,QACpB,UACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,QAAQ,KAAK,SAAS,CAAC,CAAC,QAAQ;CAChC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,QAAQ,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACxD,aAAa,KAAK,cAAc;CAChC,YAAY,KAAK,aAAa;CAC9B,SAAS,KAAK,SAAS;CACvB,QAAQ,QAAQ,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACjD,QAAQ,KAAK,QAAQ,CAAC,CAAC,MAAmB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,SAAS;CACvE,eAAe,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC5D,cAAc,QAAQ,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC1D,eAAe,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC5D,eAAe,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC5D,cAAc,QAAQ,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CAC7D,aAAa,KAAK,cAAc;CAChC,cAAc,KAAK,eAAe;CAClC,qBAAqB,KAAK,uBAAuB;CACjD,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;CACnF,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;AACrF,IACC,MAAM,CACL,MAAM,2BAA2B,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,GAC3D,MAAM,uBAAuB,CAAC,CAAC,GAAG,EAAE,SAAS,CAC/C,CACF"}
1
+ {"version":3,"file":"build.mjs","names":[],"sources":["../../src/schema/build.ts"],"sourcesContent":["import type { BuildStatus } from \"@storyshelf/core/types\";\nimport { boolean, index, integer, pgTable, text, timestamp } from \"drizzle-orm/pg-core\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `builds` table definition. */\nexport const builds = pgTable(\n \"builds\",\n {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n gitSha: text(\"git_sha\").notNull(),\n gitBranch: text(\"git_branch\").notNull(),\n isDefault: boolean(\"is_default\").notNull().default(false),\n authorEmail: text(\"author_email\"),\n authorName: text(\"author_name\"),\n message: text(\"message\"),\n public: boolean(\"public\").notNull().default(false),\n status: text(\"status\").$type<BuildStatus>().notNull().default(\"pending\"),\n snapshotCount: integer(\"snapshot_count\").notNull().default(0),\n changedCount: integer(\"changed_count\").notNull().default(0),\n approvedCount: integer(\"approved_count\").notNull().default(0),\n rejectedCount: integer(\"rejected_count\").notNull().default(0),\n /** Snapshots inherited from the baseline without rendering (affected capture). */\n inheritedCount: integer(\"inherited_count\").notNull().default(0),\n affectedOnly: boolean(\"affected_only\").notNull().default(true),\n baselineSha: text(\"baseline_sha\"),\n changedFiles: text(\"changed_files\"),\n affectedImportPaths: text(\"affected_import_paths\"),\n testResults: text(\"test_results\"),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n },\n (t) => [\n index(\"builds_project_gitsha_idx\").on(t.projectId, t.gitSha),\n index(\"builds_git_branch_idx\").on(t.gitBranch),\n ],\n);\n\n/** A build row. */\nexport interface Build {\n id: string;\n projectId: string;\n gitSha: string;\n gitBranch: string;\n isDefault: boolean;\n authorEmail: string | null;\n authorName: string | null;\n message: string | null;\n public: boolean;\n status: BuildStatus;\n snapshotCount: number;\n changedCount: number;\n approvedCount: number;\n rejectedCount: number;\n inheritedCount: number;\n affectedOnly: boolean;\n baselineSha: string | null;\n changedFiles: string | null;\n affectedImportPaths: string | null;\n testResults: string | null;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;AAKA,MAAa,SAAS,QACpB,UACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,QAAQ,KAAK,SAAS,CAAC,CAAC,QAAQ;CAChC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,QAAQ,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACxD,aAAa,KAAK,cAAc;CAChC,YAAY,KAAK,aAAa;CAC9B,SAAS,KAAK,SAAS;CACvB,QAAQ,QAAQ,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACjD,QAAQ,KAAK,QAAQ,CAAC,CAAC,MAAmB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,SAAS;CACvE,eAAe,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC5D,cAAc,QAAQ,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC1D,eAAe,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC5D,eAAe,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;;CAE5D,gBAAgB,QAAQ,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC9D,cAAc,QAAQ,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CAC7D,aAAa,KAAK,cAAc;CAChC,cAAc,KAAK,eAAe;CAClC,qBAAqB,KAAK,uBAAuB;CACjD,aAAa,KAAK,cAAc;CAChC,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;CACnF,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;AACrF,IACC,MAAM,CACL,MAAM,2BAA2B,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,GAC3D,MAAM,uBAAuB,CAAC,CAAC,GAAG,EAAE,SAAS,CAC/C,CACF"}
@@ -1,13 +1,12 @@
1
1
  import __tsdown_shims_path from 'node:path';
2
2
  import __tsdown_shims_url from 'node:url';
3
3
  import { JobStatus } from "@storyshelf/core/adapter/capture-queue";
4
- //#region src/schema/capture-attempt.d.ts
5
4
  /** Narrow `capture_attempts` table definition: one row per build capture run. */
6
- declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<{
5
+ declare const captureAttempts: import("drizzle-orm/pg-core/table.js").PgTableWithColumns<{
7
6
  name: "capture_attempts";
8
7
  schema: undefined;
9
8
  columns: {
10
- id: import("drizzle-orm/pg-core").PgColumn<{
9
+ id: import("drizzle-orm/pg-core/index.js").PgColumn<{
11
10
  name: "id";
12
11
  tableName: "capture_attempts";
13
12
  dataType: "string";
@@ -24,7 +23,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
24
23
  identity: undefined;
25
24
  generated: undefined;
26
25
  }, {}, {}>;
27
- projectId: import("drizzle-orm/pg-core").PgColumn<{
26
+ projectId: import("drizzle-orm/pg-core/index.js").PgColumn<{
28
27
  name: "project_id";
29
28
  tableName: "capture_attempts";
30
29
  dataType: "string";
@@ -41,7 +40,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
41
40
  identity: undefined;
42
41
  generated: undefined;
43
42
  }, {}, {}>;
44
- buildId: import("drizzle-orm/pg-core").PgColumn<{
43
+ buildId: import("drizzle-orm/pg-core/index.js").PgColumn<{
45
44
  name: "build_id";
46
45
  tableName: "capture_attempts";
47
46
  dataType: "string";
@@ -58,7 +57,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
58
57
  identity: undefined;
59
58
  generated: undefined;
60
59
  }, {}, {}>;
61
- attemptNo: import("drizzle-orm/pg-core").PgColumn<{
60
+ attemptNo: import("drizzle-orm/pg-core/index.js").PgColumn<{
62
61
  name: "attempt_no";
63
62
  tableName: "capture_attempts";
64
63
  dataType: "number";
@@ -75,7 +74,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
75
74
  identity: undefined;
76
75
  generated: undefined;
77
76
  }, {}, {}>;
78
- status: import("drizzle-orm/pg-core").PgColumn<{
77
+ status: import("drizzle-orm/pg-core/index.js").PgColumn<{
79
78
  name: "status";
80
79
  tableName: "capture_attempts";
81
80
  dataType: "string";
@@ -94,7 +93,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
94
93
  }, {}, {
95
94
  $type: JobStatus;
96
95
  }>;
97
- error: import("drizzle-orm/pg-core").PgColumn<{
96
+ error: import("drizzle-orm/pg-core/index.js").PgColumn<{
98
97
  name: "error";
99
98
  tableName: "capture_attempts";
100
99
  dataType: "string";
@@ -111,7 +110,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
111
110
  identity: undefined;
112
111
  generated: undefined;
113
112
  }, {}, {}>;
114
- reqId: import("drizzle-orm/pg-core").PgColumn<{
113
+ reqId: import("drizzle-orm/pg-core/index.js").PgColumn<{
115
114
  name: "req_id";
116
115
  tableName: "capture_attempts";
117
116
  dataType: "string";
@@ -128,7 +127,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
128
127
  identity: undefined;
129
128
  generated: undefined;
130
129
  }, {}, {}>;
131
- storyCount: import("drizzle-orm/pg-core").PgColumn<{
130
+ storyCount: import("drizzle-orm/pg-core/index.js").PgColumn<{
132
131
  name: "story_count";
133
132
  tableName: "capture_attempts";
134
133
  dataType: "number";
@@ -145,7 +144,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
145
144
  identity: undefined;
146
145
  generated: undefined;
147
146
  }, {}, {}>;
148
- failedCount: import("drizzle-orm/pg-core").PgColumn<{
147
+ failedCount: import("drizzle-orm/pg-core/index.js").PgColumn<{
149
148
  name: "failed_count";
150
149
  tableName: "capture_attempts";
151
150
  dataType: "number";
@@ -162,7 +161,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
162
161
  identity: undefined;
163
162
  generated: undefined;
164
163
  }, {}, {}>;
165
- queuedAt: import("drizzle-orm/pg-core").PgColumn<{
164
+ queuedAt: import("drizzle-orm/pg-core/index.js").PgColumn<{
166
165
  name: "queued_at";
167
166
  tableName: "capture_attempts";
168
167
  dataType: "string";
@@ -179,7 +178,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
179
178
  identity: undefined;
180
179
  generated: undefined;
181
180
  }, {}, {}>;
182
- startedAt: import("drizzle-orm/pg-core").PgColumn<{
181
+ startedAt: import("drizzle-orm/pg-core/index.js").PgColumn<{
183
182
  name: "started_at";
184
183
  tableName: "capture_attempts";
185
184
  dataType: "string";
@@ -196,7 +195,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
196
195
  identity: undefined;
197
196
  generated: undefined;
198
197
  }, {}, {}>;
199
- finishedAt: import("drizzle-orm/pg-core").PgColumn<{
198
+ finishedAt: import("drizzle-orm/pg-core/index.js").PgColumn<{
200
199
  name: "finished_at";
201
200
  tableName: "capture_attempts";
202
201
  dataType: "string";
@@ -213,7 +212,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
213
212
  identity: undefined;
214
213
  generated: undefined;
215
214
  }, {}, {}>;
216
- createdAt: import("drizzle-orm/pg-core").PgColumn<{
215
+ createdAt: import("drizzle-orm/pg-core/index.js").PgColumn<{
217
216
  name: "created_at";
218
217
  tableName: "capture_attempts";
219
218
  dataType: "string";
@@ -230,7 +229,7 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
230
229
  identity: undefined;
231
230
  generated: undefined;
232
231
  }, {}, {}>;
233
- updatedAt: import("drizzle-orm/pg-core").PgColumn<{
232
+ updatedAt: import("drizzle-orm/pg-core/index.js").PgColumn<{
234
233
  name: "updated_at";
235
234
  tableName: "capture_attempts";
236
235
  dataType: "string";
@@ -251,11 +250,11 @@ declare const captureAttempts: import("drizzle-orm/pg-core").PgTableWithColumns<
251
250
  dialect: 'pg';
252
251
  }>;
253
252
  /** Narrow `capture_logs` table definition: every log line of an attempt. */
254
- declare const captureLogs: import("drizzle-orm/pg-core").PgTableWithColumns<{
253
+ declare const captureLogs: import("drizzle-orm/pg-core/table.js").PgTableWithColumns<{
255
254
  name: "capture_logs";
256
255
  schema: undefined;
257
256
  columns: {
258
- id: import("drizzle-orm/pg-core").PgColumn<{
257
+ id: import("drizzle-orm/pg-core/index.js").PgColumn<{
259
258
  name: "id";
260
259
  tableName: "capture_logs";
261
260
  dataType: "string";
@@ -272,7 +271,7 @@ declare const captureLogs: import("drizzle-orm/pg-core").PgTableWithColumns<{
272
271
  identity: undefined;
273
272
  generated: undefined;
274
273
  }, {}, {}>;
275
- projectId: import("drizzle-orm/pg-core").PgColumn<{
274
+ projectId: import("drizzle-orm/pg-core/index.js").PgColumn<{
276
275
  name: "project_id";
277
276
  tableName: "capture_logs";
278
277
  dataType: "string";
@@ -289,7 +288,7 @@ declare const captureLogs: import("drizzle-orm/pg-core").PgTableWithColumns<{
289
288
  identity: undefined;
290
289
  generated: undefined;
291
290
  }, {}, {}>;
292
- buildId: import("drizzle-orm/pg-core").PgColumn<{
291
+ buildId: import("drizzle-orm/pg-core/index.js").PgColumn<{
293
292
  name: "build_id";
294
293
  tableName: "capture_logs";
295
294
  dataType: "string";
@@ -306,7 +305,7 @@ declare const captureLogs: import("drizzle-orm/pg-core").PgTableWithColumns<{
306
305
  identity: undefined;
307
306
  generated: undefined;
308
307
  }, {}, {}>;
309
- attemptId: import("drizzle-orm/pg-core").PgColumn<{
308
+ attemptId: import("drizzle-orm/pg-core/index.js").PgColumn<{
310
309
  name: "attempt_id";
311
310
  tableName: "capture_logs";
312
311
  dataType: "string";
@@ -323,7 +322,7 @@ declare const captureLogs: import("drizzle-orm/pg-core").PgTableWithColumns<{
323
322
  identity: undefined;
324
323
  generated: undefined;
325
324
  }, {}, {}>;
326
- seq: import("drizzle-orm/pg-core").PgColumn<{
325
+ seq: import("drizzle-orm/pg-core/index.js").PgColumn<{
327
326
  name: "seq";
328
327
  tableName: "capture_logs";
329
328
  dataType: "number";
@@ -340,7 +339,7 @@ declare const captureLogs: import("drizzle-orm/pg-core").PgTableWithColumns<{
340
339
  identity: undefined;
341
340
  generated: undefined;
342
341
  }, {}, {}>;
343
- level: import("drizzle-orm/pg-core").PgColumn<{
342
+ level: import("drizzle-orm/pg-core/index.js").PgColumn<{
344
343
  name: "level";
345
344
  tableName: "capture_logs";
346
345
  dataType: "string";
@@ -357,7 +356,7 @@ declare const captureLogs: import("drizzle-orm/pg-core").PgTableWithColumns<{
357
356
  identity: undefined;
358
357
  generated: undefined;
359
358
  }, {}, {}>;
360
- message: import("drizzle-orm/pg-core").PgColumn<{
359
+ message: import("drizzle-orm/pg-core/index.js").PgColumn<{
361
360
  name: "message";
362
361
  tableName: "capture_logs";
363
362
  dataType: "string";
@@ -374,7 +373,7 @@ declare const captureLogs: import("drizzle-orm/pg-core").PgTableWithColumns<{
374
373
  identity: undefined;
375
374
  generated: undefined;
376
375
  }, {}, {}>;
377
- fields: import("drizzle-orm/pg-core").PgColumn<{
376
+ fields: import("drizzle-orm/pg-core/index.js").PgColumn<{
378
377
  name: "fields";
379
378
  tableName: "capture_logs";
380
379
  dataType: "string";
@@ -391,7 +390,7 @@ declare const captureLogs: import("drizzle-orm/pg-core").PgTableWithColumns<{
391
390
  identity: undefined;
392
391
  generated: undefined;
393
392
  }, {}, {}>;
394
- createdAt: import("drizzle-orm/pg-core").PgColumn<{
393
+ createdAt: import("drizzle-orm/pg-core/index.js").PgColumn<{
395
394
  name: "created_at";
396
395
  tableName: "capture_logs";
397
396
  dataType: "string";
@@ -440,6 +439,5 @@ interface CaptureLog {
440
439
  fields: string | null;
441
440
  createdAt: string;
442
441
  }
443
- //#endregion
444
442
  export { CaptureAttempt, CaptureLog, captureAttempts, captureLogs };
445
443
  //# sourceMappingURL=capture-attempt.d.mts.map
@@ -4,7 +4,7 @@ import.meta.url;
4
4
  import { projects } from "./project.mjs";
5
5
  import { builds } from "./build.mjs";
6
6
  import { index, integer, pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
7
- //#region src/schema/capture-attempt.ts
7
+ // src/schema/capture-attempt.ts
8
8
  /** Narrow `capture_attempts` table definition: one row per build capture run. */
9
9
  const captureAttempts = pgTable("capture_attempts", {
10
10
  id: text("id").primaryKey(),
@@ -52,7 +52,6 @@ const captureLogs = pgTable("capture_logs", {
52
52
  mode: "string"
53
53
  }).notNull()
54
54
  }, (t) => [index("capture_logs_attempt_seq_idx").on(t.attemptId, t.seq)]);
55
- //#endregion
56
55
  export { captureAttempts, captureLogs };
57
56
 
58
57
  //# sourceMappingURL=capture-attempt.mjs.map