@storyshelf/db-postgres 0.6.2 → 0.7.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 (69) hide show
  1. package/README.md +56 -0
  2. package/dist/ddl.d.mts +1 -1
  3. package/dist/ddl.mjs +209 -13
  4. package/dist/ddl.mjs.map +1 -1
  5. package/dist/index.mjs +1 -1
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/migrate.mjs +83 -3
  8. package/dist/migrate.mjs.map +1 -1
  9. package/dist/neon-http.mjs +1 -1
  10. package/dist/neon-http.mjs.map +1 -1
  11. package/dist/neon.mjs +1 -1
  12. package/dist/neon.mjs.map +1 -1
  13. package/dist/pg.mjs +1 -1
  14. package/dist/pg.mjs.map +1 -1
  15. package/dist/pglite.mjs +2 -2
  16. package/dist/pglite.mjs.map +1 -1
  17. package/dist/schema/baseline.d.mts +54 -0
  18. package/dist/schema/baseline.mjs +4 -1
  19. package/dist/schema/baseline.mjs.map +1 -1
  20. package/dist/schema/{status-config.d.mts → build-component.d.mts} +42 -35
  21. package/dist/schema/build-component.mjs +25 -0
  22. package/dist/schema/build-component.mjs.map +1 -0
  23. package/dist/schema/build-review.d.mts +118 -0
  24. package/dist/schema/build-review.mjs +23 -0
  25. package/dist/schema/build-review.mjs.map +1 -0
  26. package/dist/schema/build.d.mts +38 -2
  27. package/dist/schema/build.mjs +3 -0
  28. package/dist/schema/build.mjs.map +1 -1
  29. package/dist/schema/capture-job.d.mts +330 -0
  30. package/dist/schema/capture-job.mjs +56 -0
  31. package/dist/schema/capture-job.mjs.map +1 -0
  32. package/dist/schema/capture-shard.d.mts +257 -0
  33. package/dist/schema/capture-shard.mjs +40 -0
  34. package/dist/schema/capture-shard.mjs.map +1 -0
  35. package/dist/schema/comment.d.mts +18 -0
  36. package/dist/schema/comment.mjs +3 -2
  37. package/dist/schema/comment.mjs.map +1 -1
  38. package/dist/schema/connection.d.mts +173 -0
  39. package/dist/schema/connection.mjs +35 -0
  40. package/dist/schema/connection.mjs.map +1 -0
  41. package/dist/schema/design.d.mts +589 -0
  42. package/dist/schema/design.mjs +73 -0
  43. package/dist/schema/design.mjs.map +1 -0
  44. package/dist/schema/insight.d.mts +633 -0
  45. package/dist/schema/insight.mjs +68 -0
  46. package/dist/schema/insight.mjs.map +1 -0
  47. package/dist/schema/notification.d.mts +36 -0
  48. package/dist/schema/notification.mjs +5 -0
  49. package/dist/schema/notification.mjs.map +1 -1
  50. package/dist/schema/project.d.mts +126 -0
  51. package/dist/schema/project.mjs +8 -1
  52. package/dist/schema/project.mjs.map +1 -1
  53. package/dist/schema/site-setting.d.mts +99 -0
  54. package/dist/schema/site-setting.mjs +23 -0
  55. package/dist/schema/site-setting.mjs.map +1 -0
  56. package/dist/schema/snapshot.d.mts +108 -0
  57. package/dist/schema/snapshot.mjs +11 -1
  58. package/dist/schema/snapshot.mjs.map +1 -1
  59. package/dist/schema/usage.d.mts +267 -0
  60. package/dist/schema/usage.mjs +36 -0
  61. package/dist/schema/usage.mjs.map +1 -0
  62. package/dist/schema.d.mts +24 -3
  63. package/dist/schema.mjs +25 -4
  64. package/dist/schema.mjs.map +1 -1
  65. package/dist/vercel.mjs +1 -1
  66. package/dist/vercel.mjs.map +1 -1
  67. package/package.json +5 -5
  68. package/dist/schema/status-config.mjs +0 -26
  69. package/dist/schema/status-config.mjs.map +0 -1
@@ -125,6 +125,40 @@ declare const notificationChannels: import("drizzle-orm/pg-core").PgTableWithCol
125
125
  identity: undefined;
126
126
  generated: undefined;
127
127
  }, {}, {}>;
128
+ lastError: import("drizzle-orm/pg-core").PgColumn<{
129
+ name: "last_error";
130
+ tableName: "notification_channels";
131
+ dataType: "string";
132
+ columnType: "PgText";
133
+ data: string;
134
+ driverParam: string;
135
+ notNull: false;
136
+ hasDefault: false;
137
+ isPrimaryKey: false;
138
+ isAutoincrement: false;
139
+ hasRuntimeDefault: false;
140
+ enumValues: [string, ...string[]];
141
+ baseColumn: never;
142
+ identity: undefined;
143
+ generated: undefined;
144
+ }, {}, {}>;
145
+ lastErrorAt: import("drizzle-orm/pg-core").PgColumn<{
146
+ name: "last_error_at";
147
+ tableName: "notification_channels";
148
+ dataType: "string";
149
+ columnType: "PgTimestampString";
150
+ data: string;
151
+ driverParam: string;
152
+ notNull: false;
153
+ hasDefault: false;
154
+ isPrimaryKey: false;
155
+ isAutoincrement: false;
156
+ hasRuntimeDefault: false;
157
+ enumValues: undefined;
158
+ baseColumn: never;
159
+ identity: undefined;
160
+ generated: undefined;
161
+ }, {}, {}>;
128
162
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
129
163
  name: "created_at";
130
164
  tableName: "notification_channels";
@@ -298,6 +332,8 @@ interface NotificationChannel {
298
332
  secretEncrypted: string | null;
299
333
  events: string | null;
300
334
  enabled: boolean;
335
+ lastError: string | null;
336
+ lastErrorAt: string | null;
301
337
  createdAt: string;
302
338
  updatedAt: string;
303
339
  }
@@ -14,6 +14,11 @@ const notificationChannels = pgTable("notification_channels", {
14
14
  secretEncrypted: text("secret_encrypted"),
15
15
  events: text("events"),
16
16
  enabled: boolean("enabled").notNull().default(true),
17
+ lastError: text("last_error"),
18
+ lastErrorAt: timestamp("last_error_at", {
19
+ withTimezone: true,
20
+ mode: "string"
21
+ }),
17
22
  createdAt: timestamp("created_at", {
18
23
  withTimezone: true,
19
24
  mode: "string"
@@ -1 +1 @@
1
- {"version":3,"file":"notification.mjs","names":[],"sources":["../../src/schema/notification.ts"],"sourcesContent":["import { boolean, pgTable, text, timestamp } from \"drizzle-orm/pg-core\";\nimport { projects } from \"./project.ts\";\nimport { users } from \"./user.ts\";\n\n/** Narrow `notification_channels` table definition. */\nexport const notificationChannels = pgTable(\"notification_channels\", {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\").references(() => projects.id, { onDelete: \"cascade\" }),\n provider: text(\"provider\").notNull(),\n config: text(\"config\").notNull(),\n secretEncrypted: text(\"secret_encrypted\"),\n events: text(\"events\"),\n enabled: boolean(\"enabled\").notNull().default(true),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n});\n\n/** Narrow `notification_subscriptions` table definition. */\nexport const notificationSubscriptions = pgTable(\"notification_subscriptions\", {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n userId: text(\"user_id\")\n .notNull()\n .references(() => users.id, { onDelete: \"cascade\" }),\n events: text(\"events\"),\n via: text(\"via\"),\n enabled: boolean(\"enabled\").notNull().default(true),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n});\n\n/** A notification channel row. */\nexport interface NotificationChannel {\n id: string;\n projectId: string | null;\n provider: string;\n config: string;\n secretEncrypted: string | null;\n events: string | null;\n enabled: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\n/** A per-user notification subscription row. */\nexport interface NotificationSubscription {\n id: string;\n projectId: string;\n userId: string;\n events: string | null;\n via: string | null;\n enabled: boolean;\n createdAt: string;\n}\n"],"mappings":";;;;;;;;AAKA,MAAa,uBAAuB,QAAQ,yBAAyB;CACnE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAAC,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACnF,UAAU,KAAK,UAAU,CAAC,CAAC,QAAQ;CACnC,QAAQ,KAAK,QAAQ,CAAC,CAAC,QAAQ;CAC/B,iBAAiB,KAAK,kBAAkB;CACxC,QAAQ,KAAK,QAAQ;CACrB,SAAS,QAAQ,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CAClD,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,CAAC;;AAGD,MAAa,4BAA4B,QAAQ,8BAA8B;CAC7E,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,CACpB,QAAQ,CAAC,CACT,iBAAiB,MAAM,IAAI,EAAE,UAAU,UAAU,CAAC;CACrD,QAAQ,KAAK,QAAQ;CACrB,KAAK,KAAK,KAAK;CACf,SAAS,QAAQ,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CAClD,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;AACrF,CAAC"}
1
+ {"version":3,"file":"notification.mjs","names":[],"sources":["../../src/schema/notification.ts"],"sourcesContent":["import { boolean, pgTable, text, timestamp } from \"drizzle-orm/pg-core\";\nimport { projects } from \"./project.ts\";\nimport { users } from \"./user.ts\";\n\n/** Narrow `notification_channels` table definition. */\nexport const notificationChannels = pgTable(\"notification_channels\", {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\").references(() => projects.id, { onDelete: \"cascade\" }),\n provider: text(\"provider\").notNull(),\n config: text(\"config\").notNull(),\n secretEncrypted: text(\"secret_encrypted\"),\n events: text(\"events\"),\n enabled: boolean(\"enabled\").notNull().default(true),\n lastError: text(\"last_error\"),\n lastErrorAt: timestamp(\"last_error_at\", { withTimezone: true, mode: \"string\" }),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n});\n\n/** Narrow `notification_subscriptions` table definition. */\nexport const notificationSubscriptions = pgTable(\"notification_subscriptions\", {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n userId: text(\"user_id\")\n .notNull()\n .references(() => users.id, { onDelete: \"cascade\" }),\n events: text(\"events\"),\n via: text(\"via\"),\n enabled: boolean(\"enabled\").notNull().default(true),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n});\n\n/** A notification channel row. */\nexport interface NotificationChannel {\n id: string;\n projectId: string | null;\n provider: string;\n config: string;\n secretEncrypted: string | null;\n events: string | null;\n enabled: boolean;\n lastError: string | null;\n lastErrorAt: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\n/** A per-user notification subscription row. */\nexport interface NotificationSubscription {\n id: string;\n projectId: string;\n userId: string;\n events: string | null;\n via: string | null;\n enabled: boolean;\n createdAt: string;\n}\n"],"mappings":";;;;;;;;AAKA,MAAa,uBAAuB,QAAQ,yBAAyB;CACnE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAAC,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACnF,UAAU,KAAK,UAAU,CAAC,CAAC,QAAQ;CACnC,QAAQ,KAAK,QAAQ,CAAC,CAAC,QAAQ;CAC/B,iBAAiB,KAAK,kBAAkB;CACxC,QAAQ,KAAK,QAAQ;CACrB,SAAS,QAAQ,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CAClD,WAAW,KAAK,YAAY;CAC5B,aAAa,UAAU,iBAAiB;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC;CAC9E,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,CAAC;;AAGD,MAAa,4BAA4B,QAAQ,8BAA8B;CAC7E,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,CACpB,QAAQ,CAAC,CACT,iBAAiB,MAAM,IAAI,EAAE,UAAU,UAAU,CAAC;CACrD,QAAQ,KAAK,QAAQ;CACrB,KAAK,KAAK,KAAK;CACf,SAAS,QAAQ,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CAClD,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;AACrF,CAAC"}
@@ -212,6 +212,23 @@ declare const projects: import("drizzle-orm/pg-core").PgTableWithColumns<{
212
212
  identity: undefined;
213
213
  generated: undefined;
214
214
  }, {}, {}>;
215
+ runTests: import("drizzle-orm/pg-core").PgColumn<{
216
+ name: "run_tests";
217
+ tableName: "projects";
218
+ dataType: "boolean";
219
+ columnType: "PgBoolean";
220
+ data: boolean;
221
+ driverParam: boolean;
222
+ notNull: true;
223
+ hasDefault: true;
224
+ isPrimaryKey: false;
225
+ isAutoincrement: false;
226
+ hasRuntimeDefault: false;
227
+ enumValues: undefined;
228
+ baseColumn: never;
229
+ identity: undefined;
230
+ generated: undefined;
231
+ }, {}, {}>;
215
232
  browser: import("drizzle-orm/pg-core").PgColumn<{
216
233
  name: "browser";
217
234
  tableName: "projects";
@@ -246,6 +263,40 @@ declare const projects: import("drizzle-orm/pg-core").PgTableWithColumns<{
246
263
  identity: undefined;
247
264
  generated: undefined;
248
265
  }, {}, {}>;
266
+ browsers: import("drizzle-orm/pg-core").PgColumn<{
267
+ name: "browsers";
268
+ tableName: "projects";
269
+ dataType: "string";
270
+ columnType: "PgText";
271
+ data: string;
272
+ driverParam: string;
273
+ notNull: false;
274
+ hasDefault: false;
275
+ isPrimaryKey: false;
276
+ isAutoincrement: false;
277
+ hasRuntimeDefault: false;
278
+ enumValues: [string, ...string[]];
279
+ baseColumn: never;
280
+ identity: undefined;
281
+ generated: undefined;
282
+ }, {}, {}>;
283
+ modesAllowlist: import("drizzle-orm/pg-core").PgColumn<{
284
+ name: "modes_allowlist";
285
+ tableName: "projects";
286
+ dataType: "string";
287
+ columnType: "PgText";
288
+ data: string;
289
+ driverParam: string;
290
+ notNull: false;
291
+ hasDefault: false;
292
+ isPrimaryKey: false;
293
+ isAutoincrement: false;
294
+ hasRuntimeDefault: false;
295
+ enumValues: [string, ...string[]];
296
+ baseColumn: never;
297
+ identity: undefined;
298
+ generated: undefined;
299
+ }, {}, {}>;
249
300
  automigrate: import("drizzle-orm/pg-core").PgColumn<{
250
301
  name: "automigrate";
251
302
  tableName: "projects";
@@ -263,6 +314,74 @@ declare const projects: import("drizzle-orm/pg-core").PgTableWithColumns<{
263
314
  identity: undefined;
264
315
  generated: undefined;
265
316
  }, {}, {}>;
317
+ aiProfile: import("drizzle-orm/pg-core").PgColumn<{
318
+ name: "ai_profile";
319
+ tableName: "projects";
320
+ dataType: "string";
321
+ columnType: "PgText";
322
+ data: string;
323
+ driverParam: string;
324
+ notNull: false;
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
+ reviewEnabled: import("drizzle-orm/pg-core").PgColumn<{
335
+ name: "review_enabled";
336
+ tableName: "projects";
337
+ dataType: "boolean";
338
+ columnType: "PgBoolean";
339
+ data: boolean;
340
+ driverParam: boolean;
341
+ notNull: true;
342
+ hasDefault: true;
343
+ isPrimaryKey: false;
344
+ isAutoincrement: false;
345
+ hasRuntimeDefault: false;
346
+ enumValues: undefined;
347
+ baseColumn: never;
348
+ identity: undefined;
349
+ generated: undefined;
350
+ }, {}, {}>;
351
+ reviewApprovals: import("drizzle-orm/pg-core").PgColumn<{
352
+ name: "review_approvals";
353
+ tableName: "projects";
354
+ dataType: "number";
355
+ columnType: "PgInteger";
356
+ data: number;
357
+ driverParam: string | number;
358
+ notNull: true;
359
+ hasDefault: true;
360
+ isPrimaryKey: false;
361
+ isAutoincrement: false;
362
+ hasRuntimeDefault: false;
363
+ enumValues: undefined;
364
+ baseColumn: never;
365
+ identity: undefined;
366
+ generated: undefined;
367
+ }, {}, {}>;
368
+ storybookUrlTtlSeconds: import("drizzle-orm/pg-core").PgColumn<{
369
+ name: "storybook_url_ttl_seconds";
370
+ tableName: "projects";
371
+ dataType: "number";
372
+ columnType: "PgInteger";
373
+ data: number;
374
+ driverParam: string | number;
375
+ notNull: false;
376
+ hasDefault: false;
377
+ isPrimaryKey: false;
378
+ isAutoincrement: false;
379
+ hasRuntimeDefault: false;
380
+ enumValues: undefined;
381
+ baseColumn: never;
382
+ identity: undefined;
383
+ generated: undefined;
384
+ }, {}, {}>;
266
385
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
267
386
  name: "created_at";
268
387
  tableName: "projects";
@@ -314,9 +433,16 @@ interface Project {
314
433
  executePlay: boolean;
315
434
  playTimeoutMs: number;
316
435
  runA11y?: boolean;
436
+ runTests?: boolean;
317
437
  browser?: string;
318
438
  viewports?: string | null;
439
+ browsers?: string | null;
440
+ modesAllowlist?: string | null;
319
441
  automigrate: boolean;
442
+ aiProfile: string | null;
443
+ reviewEnabled: boolean;
444
+ reviewApprovals: number;
445
+ storybookUrlTtlSeconds: number | null;
320
446
  createdAt: string;
321
447
  updatedAt: string;
322
448
  }
@@ -16,10 +16,17 @@ const projects = pgTable("projects", {
16
16
  storybookMeta: text("storybook_meta").$type().default(null),
17
17
  executePlay: boolean("execute_play").notNull().default(false),
18
18
  playTimeoutMs: integer("play_timeout_ms").notNull().default(1e4),
19
- runA11y: boolean("run_a11y").notNull().default(false),
19
+ runA11y: boolean("run_a11y").notNull().default(true),
20
+ runTests: boolean("run_tests").notNull().default(false),
20
21
  browser: text("browser").notNull().default("chromium"),
21
22
  viewports: text("viewports"),
23
+ browsers: text("browsers"),
24
+ modesAllowlist: text("modes_allowlist"),
22
25
  automigrate: boolean("automigrate").notNull().default(false),
26
+ aiProfile: text("ai_profile"),
27
+ reviewEnabled: boolean("review_enabled").notNull().default(true),
28
+ reviewApprovals: integer("review_approvals").notNull().default(1),
29
+ storybookUrlTtlSeconds: integer("storybook_url_ttl_seconds"),
23
30
  createdAt: timestamp("created_at", {
24
31
  withTimezone: true,
25
32
  mode: "string"
@@ -1 +1 @@
1
- {"version":3,"file":"project.mjs","names":[],"sources":["../../src/schema/project.ts"],"sourcesContent":["import { boolean, doublePrecision, integer, pgTable, text, timestamp } from \"drizzle-orm/pg-core\";\n\n/** Narrow `projects` table definition. */\nexport const projects = pgTable(\"projects\", {\n id: text(\"id\").primaryKey(),\n name: text(\"name\").notNull(),\n slug: text(\"slug\").notNull(),\n gitRepository: text(\"git_repository\"),\n gitDefaultBranch: text(\"git_default_branch\").notNull().default(\"main\"),\n pixelThreshold: doublePrecision(\"pixel_threshold\").notNull().default(0.1),\n maxDiffRatio: doublePrecision(\"max_diff_ratio\").notNull().default(0.01),\n publicBranchRegex: text(\"public_branch_regex\"),\n storybookMeta: text(\"storybook_meta\").$type<string | null | undefined>().default(null),\n executePlay: boolean(\"execute_play\").notNull().default(false),\n playTimeoutMs: integer(\"play_timeout_ms\").notNull().default(10_000),\n runA11y: boolean(\"run_a11y\").notNull().default(false),\n browser: text(\"browser\").notNull().default(\"chromium\"),\n viewports: text(\"viewports\"),\n automigrate: boolean(\"automigrate\").notNull().default(false),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n});\n\n/** A project row. */\nexport interface Project {\n id: string;\n name: string;\n slug: string;\n gitRepository: string | null;\n gitDefaultBranch: string;\n pixelThreshold: number;\n maxDiffRatio: number;\n publicBranchRegex: string | null;\n storybookMeta: string | null | undefined;\n executePlay: boolean;\n playTimeoutMs: number;\n runA11y?: boolean;\n browser?: string;\n viewports?: string | null;\n automigrate: boolean;\n createdAt: string;\n updatedAt: string;\n}\n\n/** Storybook metadata synced from a project's published Storybook. */\nexport interface StorybookMeta {\n framework?: { name?: string; options?: unknown };\n addons?: string[];\n storiesGlobs?: string[];\n staticDirs?: string[];\n packagePath?: string;\n previewParameters?: Record<string, unknown>;\n}\n"],"mappings":";;;;;;AAGA,MAAa,WAAW,QAAQ,YAAY;CAC1C,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,eAAe,KAAK,gBAAgB;CACpC,kBAAkB,KAAK,oBAAoB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,MAAM;CACrE,gBAAgB,gBAAgB,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAG;CACxE,cAAc,gBAAgB,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,GAAI;CACtE,mBAAmB,KAAK,qBAAqB;CAC7C,eAAe,KAAK,gBAAgB,CAAC,CAAC,MAAiC,CAAC,CAAC,QAAQ,IAAI;CACrF,aAAa,QAAQ,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CAC5D,eAAe,QAAQ,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,GAAM;CAClE,SAAS,QAAQ,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACpD,SAAS,KAAK,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,UAAU;CACrD,WAAW,KAAK,WAAW;CAC3B,aAAa,QAAQ,aAAa,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CAC3D,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,CAAC"}
1
+ {"version":3,"file":"project.mjs","names":[],"sources":["../../src/schema/project.ts"],"sourcesContent":["import { boolean, doublePrecision, integer, pgTable, text, timestamp } from \"drizzle-orm/pg-core\";\n\n/** Narrow `projects` table definition. */\nexport const projects = pgTable(\"projects\", {\n id: text(\"id\").primaryKey(),\n name: text(\"name\").notNull(),\n slug: text(\"slug\").notNull(),\n gitRepository: text(\"git_repository\"),\n gitDefaultBranch: text(\"git_default_branch\").notNull().default(\"main\"),\n pixelThreshold: doublePrecision(\"pixel_threshold\").notNull().default(0.1),\n maxDiffRatio: doublePrecision(\"max_diff_ratio\").notNull().default(0.01),\n publicBranchRegex: text(\"public_branch_regex\"),\n storybookMeta: text(\"storybook_meta\").$type<string | null | undefined>().default(null),\n executePlay: boolean(\"execute_play\").notNull().default(false),\n playTimeoutMs: integer(\"play_timeout_ms\").notNull().default(10_000),\n runA11y: boolean(\"run_a11y\").notNull().default(true),\n runTests: boolean(\"run_tests\").notNull().default(false),\n browser: text(\"browser\").notNull().default(\"chromium\"),\n viewports: text(\"viewports\"),\n browsers: text(\"browsers\"),\n modesAllowlist: text(\"modes_allowlist\"),\n automigrate: boolean(\"automigrate\").notNull().default(false),\n aiProfile: text(\"ai_profile\"),\n reviewEnabled: boolean(\"review_enabled\").notNull().default(true),\n reviewApprovals: integer(\"review_approvals\").notNull().default(1),\n storybookUrlTtlSeconds: integer(\"storybook_url_ttl_seconds\"),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n});\n\n/** A project row. */\nexport interface Project {\n id: string;\n name: string;\n slug: string;\n gitRepository: string | null;\n gitDefaultBranch: string;\n pixelThreshold: number;\n maxDiffRatio: number;\n publicBranchRegex: string | null;\n storybookMeta: string | null | undefined;\n executePlay: boolean;\n playTimeoutMs: number;\n runA11y?: boolean;\n runTests?: boolean;\n browser?: string;\n viewports?: string | null;\n browsers?: string | null;\n modesAllowlist?: string | null;\n automigrate: boolean;\n aiProfile: string | null;\n reviewEnabled: boolean;\n reviewApprovals: number;\n storybookUrlTtlSeconds: number | null;\n createdAt: string;\n updatedAt: string;\n}\n\n/** Storybook metadata synced from a project's published Storybook. */\nexport interface StorybookMeta {\n framework?: { name?: string; options?: unknown };\n addons?: string[];\n storiesGlobs?: string[];\n staticDirs?: string[];\n packagePath?: string;\n previewParameters?: Record<string, unknown>;\n}\n"],"mappings":";;;;;;AAGA,MAAa,WAAW,QAAQ,YAAY;CAC1C,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,eAAe,KAAK,gBAAgB;CACpC,kBAAkB,KAAK,oBAAoB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,MAAM;CACrE,gBAAgB,gBAAgB,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAG;CACxE,cAAc,gBAAgB,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,GAAI;CACtE,mBAAmB,KAAK,qBAAqB;CAC7C,eAAe,KAAK,gBAAgB,CAAC,CAAC,MAAiC,CAAC,CAAC,QAAQ,IAAI;CACrF,aAAa,QAAQ,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CAC5D,eAAe,QAAQ,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,GAAM;CAClE,SAAS,QAAQ,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CACnD,UAAU,QAAQ,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACtD,SAAS,KAAK,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,UAAU;CACrD,WAAW,KAAK,WAAW;CAC3B,UAAU,KAAK,UAAU;CACzB,gBAAgB,KAAK,iBAAiB;CACtC,aAAa,QAAQ,aAAa,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CAC3D,WAAW,KAAK,YAAY;CAC5B,eAAe,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CAC/D,iBAAiB,QAAQ,kBAAkB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAChE,wBAAwB,QAAQ,2BAA2B;CAC3D,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,CAAC"}
@@ -0,0 +1,99 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ //#region src/schema/site-setting.d.ts
4
+ /** Narrow `site_settings` table definition: key-value facts the app learns at runtime. */
5
+ declare const siteSettings: import("drizzle-orm/pg-core").PgTableWithColumns<{
6
+ name: "site_settings";
7
+ schema: undefined;
8
+ columns: {
9
+ id: import("drizzle-orm/pg-core").PgColumn<{
10
+ name: "id";
11
+ tableName: "site_settings";
12
+ dataType: "string";
13
+ columnType: "PgText";
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
+ value: import("drizzle-orm/pg-core").PgColumn<{
27
+ name: "value";
28
+ tableName: "site_settings";
29
+ dataType: "string";
30
+ columnType: "PgText";
31
+ data: string;
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
+ updatedBy: import("drizzle-orm/pg-core").PgColumn<{
44
+ name: "updated_by";
45
+ tableName: "site_settings";
46
+ dataType: "string";
47
+ columnType: "PgText";
48
+ data: string;
49
+ driverParam: string;
50
+ notNull: false;
51
+ hasDefault: false;
52
+ isPrimaryKey: false;
53
+ isAutoincrement: false;
54
+ hasRuntimeDefault: false;
55
+ enumValues: [string, ...string[]];
56
+ baseColumn: never;
57
+ identity: undefined;
58
+ generated: undefined;
59
+ }, {}, {}>;
60
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
61
+ name: "created_at";
62
+ tableName: "site_settings";
63
+ dataType: "string";
64
+ columnType: "PgTimestampString";
65
+ data: string;
66
+ driverParam: string;
67
+ notNull: true;
68
+ hasDefault: false;
69
+ isPrimaryKey: false;
70
+ isAutoincrement: false;
71
+ hasRuntimeDefault: false;
72
+ enumValues: undefined;
73
+ baseColumn: never;
74
+ identity: undefined;
75
+ generated: undefined;
76
+ }, {}, {}>;
77
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
78
+ name: "updated_at";
79
+ tableName: "site_settings";
80
+ dataType: "string";
81
+ columnType: "PgTimestampString";
82
+ data: string;
83
+ driverParam: string;
84
+ notNull: true;
85
+ hasDefault: false;
86
+ isPrimaryKey: false;
87
+ isAutoincrement: false;
88
+ hasRuntimeDefault: false;
89
+ enumValues: undefined;
90
+ baseColumn: never;
91
+ identity: undefined;
92
+ generated: undefined;
93
+ }, {}, {}>;
94
+ };
95
+ dialect: 'pg';
96
+ }>;
97
+ //#endregion
98
+ export { siteSettings };
99
+ //# sourceMappingURL=site-setting.d.mts.map
@@ -0,0 +1,23 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { pgTable, text, timestamp } from "drizzle-orm/pg-core";
5
+ //#region src/schema/site-setting.ts
6
+ /** Narrow `site_settings` table definition: key-value facts the app learns at runtime. */
7
+ const siteSettings = pgTable("site_settings", {
8
+ id: text("id").primaryKey(),
9
+ value: text("value").notNull(),
10
+ updatedBy: text("updated_by"),
11
+ createdAt: timestamp("created_at", {
12
+ withTimezone: true,
13
+ mode: "string"
14
+ }).notNull(),
15
+ updatedAt: timestamp("updated_at", {
16
+ withTimezone: true,
17
+ mode: "string"
18
+ }).notNull()
19
+ });
20
+ //#endregion
21
+ export { siteSettings };
22
+
23
+ //# sourceMappingURL=site-setting.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"site-setting.mjs","names":[],"sources":["../../src/schema/site-setting.ts"],"sourcesContent":["import { pgTable, text, timestamp } from \"drizzle-orm/pg-core\";\n\n/** Narrow `site_settings` table definition: key-value facts the app learns at runtime. */\nexport const siteSettings = pgTable(\"site_settings\", {\n id: text(\"id\").primaryKey(),\n value: text(\"value\").notNull(),\n updatedBy: text(\"updated_by\"),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n});\n"],"mappings":";;;;;;AAGA,MAAa,eAAe,QAAQ,iBAAiB;CACnD,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,OAAO,KAAK,OAAO,CAAC,CAAC,QAAQ;CAC7B,WAAW,KAAK,YAAY;CAC5B,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,CAAC"}
@@ -126,6 +126,23 @@ declare const snapshots: import("drizzle-orm/pg-core").PgTableWithColumns<{
126
126
  identity: undefined;
127
127
  generated: undefined;
128
128
  }, {}, {}>;
129
+ designUrl: import("drizzle-orm/pg-core").PgColumn<{
130
+ name: "design_url";
131
+ tableName: "snapshots";
132
+ dataType: "string";
133
+ columnType: "PgText";
134
+ data: string;
135
+ driverParam: string;
136
+ notNull: false;
137
+ hasDefault: false;
138
+ isPrimaryKey: false;
139
+ isAutoincrement: false;
140
+ hasRuntimeDefault: false;
141
+ enumValues: [string, ...string[]];
142
+ baseColumn: never;
143
+ identity: undefined;
144
+ generated: undefined;
145
+ }, {}, {}>;
129
146
  viewportName: import("drizzle-orm/pg-core").PgColumn<{
130
147
  name: "viewport_name";
131
148
  tableName: "snapshots";
@@ -332,6 +349,23 @@ declare const snapshots: import("drizzle-orm/pg-core").PgTableWithColumns<{
332
349
  identity: undefined;
333
350
  generated: undefined;
334
351
  }, {}, {}>;
352
+ envChange: import("drizzle-orm/pg-core").PgColumn<{
353
+ name: "env_change";
354
+ tableName: "snapshots";
355
+ dataType: "string";
356
+ columnType: "PgText";
357
+ data: string;
358
+ driverParam: string;
359
+ notNull: false;
360
+ hasDefault: false;
361
+ isPrimaryKey: false;
362
+ isAutoincrement: false;
363
+ hasRuntimeDefault: false;
364
+ enumValues: [string, ...string[]];
365
+ baseColumn: never;
366
+ identity: undefined;
367
+ generated: undefined;
368
+ }, {}, {}>;
335
369
  inherited: import("drizzle-orm/pg-core").PgColumn<{
336
370
  name: "inherited";
337
371
  tableName: "snapshots";
@@ -383,6 +417,74 @@ declare const snapshots: import("drizzle-orm/pg-core").PgTableWithColumns<{
383
417
  identity: undefined;
384
418
  generated: undefined;
385
419
  }, {}, {}>;
420
+ mode: import("drizzle-orm/pg-core").PgColumn<{
421
+ name: "mode";
422
+ tableName: "snapshots";
423
+ dataType: "string";
424
+ columnType: "PgText";
425
+ data: string;
426
+ driverParam: string;
427
+ notNull: false;
428
+ hasDefault: false;
429
+ isPrimaryKey: false;
430
+ isAutoincrement: false;
431
+ hasRuntimeDefault: false;
432
+ enumValues: [string, ...string[]];
433
+ baseColumn: never;
434
+ identity: undefined;
435
+ generated: undefined;
436
+ }, {}, {}>;
437
+ browser: import("drizzle-orm/pg-core").PgColumn<{
438
+ name: "browser";
439
+ tableName: "snapshots";
440
+ dataType: "string";
441
+ columnType: "PgText";
442
+ data: string;
443
+ driverParam: string;
444
+ notNull: true;
445
+ hasDefault: true;
446
+ isPrimaryKey: false;
447
+ isAutoincrement: false;
448
+ hasRuntimeDefault: false;
449
+ enumValues: [string, ...string[]];
450
+ baseColumn: never;
451
+ identity: undefined;
452
+ generated: undefined;
453
+ }, {}, {}>;
454
+ durationMs: import("drizzle-orm/pg-core").PgColumn<{
455
+ name: "duration_ms";
456
+ tableName: "snapshots";
457
+ dataType: "number";
458
+ columnType: "PgInteger";
459
+ data: number;
460
+ driverParam: string | number;
461
+ notNull: false;
462
+ hasDefault: false;
463
+ isPrimaryKey: false;
464
+ isAutoincrement: false;
465
+ hasRuntimeDefault: false;
466
+ enumValues: undefined;
467
+ baseColumn: never;
468
+ identity: undefined;
469
+ generated: undefined;
470
+ }, {}, {}>;
471
+ a11yViolations: import("drizzle-orm/pg-core").PgColumn<{
472
+ name: "a11y_violations";
473
+ tableName: "snapshots";
474
+ dataType: "string";
475
+ columnType: "PgText";
476
+ data: string;
477
+ driverParam: string;
478
+ notNull: false;
479
+ hasDefault: false;
480
+ isPrimaryKey: false;
481
+ isAutoincrement: false;
482
+ hasRuntimeDefault: false;
483
+ enumValues: [string, ...string[]];
484
+ baseColumn: never;
485
+ identity: undefined;
486
+ generated: undefined;
487
+ }, {}, {}>;
386
488
  createdAt: import("drizzle-orm/pg-core").PgColumn<{
387
489
  name: "created_at";
388
490
  tableName: "snapshots";
@@ -429,6 +531,7 @@ interface Snapshot {
429
531
  storyName: string;
430
532
  storyTitle: string;
431
533
  storyImportPath: string | null;
534
+ designUrl: string | null;
432
535
  viewportName: string;
433
536
  viewportWidth: number;
434
537
  viewportHeight: number;
@@ -441,9 +544,14 @@ interface Snapshot {
441
544
  reviewedBy: string | null;
442
545
  reviewedAt: string | null;
443
546
  infraHash: string | null;
547
+ envChange: string | null;
444
548
  inherited: boolean;
445
549
  baselineId: string | null;
446
550
  baselineVersion: string | null;
551
+ mode?: string | null;
552
+ browser?: string;
553
+ durationMs: number | null;
554
+ a11yViolations: string | null;
447
555
  createdAt: string;
448
556
  updatedAt: string;
449
557
  }
@@ -14,6 +14,7 @@ const snapshots = pgTable("snapshots", {
14
14
  storyName: text("story_name").notNull(),
15
15
  storyTitle: text("story_title").notNull(),
16
16
  storyImportPath: text("story_import_path"),
17
+ designUrl: text("design_url"),
17
18
  viewportName: text("viewport_name").notNull().default("desktop"),
18
19
  viewportWidth: integer("viewport_width").notNull().default(1280),
19
20
  viewportHeight: integer("viewport_height").notNull().default(720),
@@ -29,9 +30,14 @@ const snapshots = pgTable("snapshots", {
29
30
  mode: "string"
30
31
  }),
31
32
  infraHash: text("infra_hash"),
33
+ envChange: text("env_change"),
32
34
  inherited: boolean("inherited").notNull().default(false),
33
35
  baselineId: text("baseline_id"),
34
36
  baselineVersion: text("baseline_version"),
37
+ mode: text("mode"),
38
+ browser: text("browser").notNull().default("chromium"),
39
+ durationMs: integer("duration_ms"),
40
+ a11yViolations: text("a11y_violations"),
35
41
  createdAt: timestamp("created_at", {
36
42
  withTimezone: true,
37
43
  mode: "string"
@@ -40,7 +46,11 @@ const snapshots = pgTable("snapshots", {
40
46
  withTimezone: true,
41
47
  mode: "string"
42
48
  }).notNull()
43
- }, (t) => [uniqueIndex("snapshots_build_story_viewport_idx").on(t.buildId, t.storyId, t.viewportName), index("snapshots_build_id_idx").on(t.buildId)]);
49
+ }, (t) => [
50
+ uniqueIndex("snapshots_build_story_mode_browser_idx").on(t.buildId, t.storyId, t.viewportName, t.browser),
51
+ index("snapshots_build_id_idx").on(t.buildId),
52
+ index("snapshots_project_import_path_idx").on(t.projectId, t.storyImportPath)
53
+ ]);
44
54
  //#endregion
45
55
  export { snapshots };
46
56
 
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot.mjs","names":[],"sources":["../../src/schema/snapshot.ts"],"sourcesContent":["import type { SnapshotStatus } from \"@storyshelf/core/types\";\nimport {\n boolean,\n doublePrecision,\n index,\n integer,\n pgTable,\n text,\n timestamp,\n uniqueIndex,\n} from \"drizzle-orm/pg-core\";\nimport { builds } from \"./build.ts\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `snapshots` table definition. */\nexport const snapshots = pgTable(\n \"snapshots\",\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 storyId: text(\"story_id\").notNull(),\n storyName: text(\"story_name\").notNull(),\n storyTitle: text(\"story_title\").notNull(),\n storyImportPath: text(\"story_import_path\"),\n viewportName: text(\"viewport_name\").notNull().default(\"desktop\"),\n viewportWidth: integer(\"viewport_width\").notNull().default(1280),\n viewportHeight: integer(\"viewport_height\").notNull().default(720),\n screenshotPath: text(\"screenshot_path\").notNull(),\n diffPath: text(\"diff_path\"),\n diffPixels: integer(\"diff_pixels\"),\n diffRatio: doublePrecision(\"diff_ratio\"),\n diffPassed: boolean(\"diff_passed\"),\n status: text(\"status\").$type<SnapshotStatus>().notNull().default(\"pending\"),\n reviewedBy: text(\"reviewed_by\"),\n reviewedAt: timestamp(\"reviewed_at\", { withTimezone: true, mode: \"string\" }),\n infraHash: text(\"infra_hash\"),\n inherited: boolean(\"inherited\").notNull().default(false),\n baselineId: text(\"baseline_id\"),\n baselineVersion: text(\"baseline_version\"),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n },\n (t) => [\n uniqueIndex(\"snapshots_build_story_viewport_idx\").on(t.buildId, t.storyId, t.viewportName),\n index(\"snapshots_build_id_idx\").on(t.buildId),\n ],\n);\n\n/** A snapshot row. */\nexport interface Snapshot {\n id: string;\n projectId: string;\n buildId: string;\n storyId: string;\n storyName: string;\n storyTitle: string;\n storyImportPath: string | null;\n viewportName: string;\n viewportWidth: number;\n viewportHeight: number;\n screenshotPath: string;\n diffPath: string | null;\n diffPixels: number | null;\n diffRatio: number | null;\n diffPassed: boolean | null;\n status: SnapshotStatus;\n reviewedBy: string | null;\n reviewedAt: string | null;\n infraHash: string | null;\n inherited: boolean;\n baselineId: string | null;\n baselineVersion: string | null;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;;AAeA,MAAa,YAAY,QACvB,aACA;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,SAAS,KAAK,UAAU,CAAC,CAAC,QAAQ;CAClC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,YAAY,KAAK,aAAa,CAAC,CAAC,QAAQ;CACxC,iBAAiB,KAAK,mBAAmB;CACzC,cAAc,KAAK,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,SAAS;CAC/D,eAAe,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CAC/D,gBAAgB,QAAQ,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,GAAG;CAChE,gBAAgB,KAAK,iBAAiB,CAAC,CAAC,QAAQ;CAChD,UAAU,KAAK,WAAW;CAC1B,YAAY,QAAQ,aAAa;CACjC,WAAW,gBAAgB,YAAY;CACvC,YAAY,QAAQ,aAAa;CACjC,QAAQ,KAAK,QAAQ,CAAC,CAAC,MAAsB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,SAAS;CAC1E,YAAY,KAAK,aAAa;CAC9B,YAAY,UAAU,eAAe;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC;CAC3E,WAAW,KAAK,YAAY;CAC5B,WAAW,QAAQ,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACvD,YAAY,KAAK,aAAa;CAC9B,iBAAiB,KAAK,kBAAkB;CACxC,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,YAAY,oCAAoC,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,GACzF,MAAM,wBAAwB,CAAC,CAAC,GAAG,EAAE,OAAO,CAC9C,CACF"}
1
+ {"version":3,"file":"snapshot.mjs","names":[],"sources":["../../src/schema/snapshot.ts"],"sourcesContent":["import type { SnapshotStatus } from \"@storyshelf/core/types\";\nimport {\n boolean,\n doublePrecision,\n index,\n integer,\n pgTable,\n text,\n timestamp,\n uniqueIndex,\n} from \"drizzle-orm/pg-core\";\nimport { builds } from \"./build.ts\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `snapshots` table definition. */\nexport const snapshots = pgTable(\n \"snapshots\",\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 storyId: text(\"story_id\").notNull(),\n storyName: text(\"story_name\").notNull(),\n storyTitle: text(\"story_title\").notNull(),\n storyImportPath: text(\"story_import_path\"),\n designUrl: text(\"design_url\"),\n viewportName: text(\"viewport_name\").notNull().default(\"desktop\"),\n viewportWidth: integer(\"viewport_width\").notNull().default(1280),\n viewportHeight: integer(\"viewport_height\").notNull().default(720),\n screenshotPath: text(\"screenshot_path\").notNull(),\n diffPath: text(\"diff_path\"),\n diffPixels: integer(\"diff_pixels\"),\n diffRatio: doublePrecision(\"diff_ratio\"),\n diffPassed: boolean(\"diff_passed\"),\n status: text(\"status\").$type<SnapshotStatus>().notNull().default(\"pending\"),\n reviewedBy: text(\"reviewed_by\"),\n reviewedAt: timestamp(\"reviewed_at\", { withTimezone: true, mode: \"string\" }),\n infraHash: text(\"infra_hash\"),\n envChange: text(\"env_change\"),\n inherited: boolean(\"inherited\").notNull().default(false),\n baselineId: text(\"baseline_id\"),\n baselineVersion: text(\"baseline_version\"),\n mode: text(\"mode\"),\n browser: text(\"browser\").notNull().default(\"chromium\"),\n durationMs: integer(\"duration_ms\"),\n a11yViolations: text(\"a11y_violations\"),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n },\n (t) => [\n uniqueIndex(\"snapshots_build_story_mode_browser_idx\").on(\n t.buildId,\n t.storyId,\n t.viewportName,\n t.browser,\n ),\n index(\"snapshots_build_id_idx\").on(t.buildId),\n index(\"snapshots_project_import_path_idx\").on(t.projectId, t.storyImportPath),\n ],\n);\n\n/** A snapshot row. */\nexport interface Snapshot {\n id: string;\n projectId: string;\n buildId: string;\n storyId: string;\n storyName: string;\n storyTitle: string;\n storyImportPath: string | null;\n designUrl: string | null;\n viewportName: string;\n viewportWidth: number;\n viewportHeight: number;\n screenshotPath: string;\n diffPath: string | null;\n diffPixels: number | null;\n diffRatio: number | null;\n diffPassed: boolean | null;\n status: SnapshotStatus;\n reviewedBy: string | null;\n reviewedAt: string | null;\n infraHash: string | null;\n envChange: string | null;\n inherited: boolean;\n baselineId: string | null;\n baselineVersion: string | null;\n mode?: string | null;\n browser?: string;\n durationMs: number | null;\n a11yViolations: string | null;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;;AAeA,MAAa,YAAY,QACvB,aACA;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,SAAS,KAAK,UAAU,CAAC,CAAC,QAAQ;CAClC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,YAAY,KAAK,aAAa,CAAC,CAAC,QAAQ;CACxC,iBAAiB,KAAK,mBAAmB;CACzC,WAAW,KAAK,YAAY;CAC5B,cAAc,KAAK,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,SAAS;CAC/D,eAAe,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CAC/D,gBAAgB,QAAQ,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,GAAG;CAChE,gBAAgB,KAAK,iBAAiB,CAAC,CAAC,QAAQ;CAChD,UAAU,KAAK,WAAW;CAC1B,YAAY,QAAQ,aAAa;CACjC,WAAW,gBAAgB,YAAY;CACvC,YAAY,QAAQ,aAAa;CACjC,QAAQ,KAAK,QAAQ,CAAC,CAAC,MAAsB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,SAAS;CAC1E,YAAY,KAAK,aAAa;CAC9B,YAAY,UAAU,eAAe;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC;CAC3E,WAAW,KAAK,YAAY;CAC5B,WAAW,KAAK,YAAY;CAC5B,WAAW,QAAQ,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACvD,YAAY,KAAK,aAAa;CAC9B,iBAAiB,KAAK,kBAAkB;CACxC,MAAM,KAAK,MAAM;CACjB,SAAS,KAAK,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,UAAU;CACrD,YAAY,QAAQ,aAAa;CACjC,gBAAgB,KAAK,iBAAiB;CACtC,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,YAAY,wCAAwC,CAAC,CAAC,GACpD,EAAE,SACF,EAAE,SACF,EAAE,cACF,EAAE,OACJ;CACA,MAAM,wBAAwB,CAAC,CAAC,GAAG,EAAE,OAAO;CAC5C,MAAM,mCAAmC,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,eAAe;AAC9E,CACF"}