@storyshelf/core 0.1.3 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -46
- package/dist/adapter/auth.d.mts +4 -4
- package/dist/adapter/auth.mjs.map +1 -1
- package/dist/{adapters → adapter}/capture-queue.d.mts +4 -4
- package/dist/adapter/capture-queue.mjs +4 -0
- package/dist/adapter/capture-runner.d.mts +7 -7
- package/dist/adapter/database.d.mts +20 -9
- package/dist/adapter/database.mjs +60 -1
- package/dist/adapter/database.mjs.map +1 -0
- package/dist/adapter/git-host/comments.d.mts +41 -0
- package/dist/adapter/git-host/comments.mjs +54 -0
- package/dist/adapter/git-host/comments.mjs.map +1 -0
- package/dist/adapter/git-host.d.mts +3 -7
- package/dist/adapter/init.d.mts +58 -0
- package/dist/adapter/init.mjs +93 -0
- package/dist/adapter/init.mjs.map +1 -0
- package/dist/adapter/metadata.d.mts +83 -0
- package/dist/adapter/metadata.mjs +4 -0
- package/dist/adapter/storage.d.mts +15 -4
- package/dist/adapters/webhook-events.mjs +12 -4
- package/dist/adapters/webhook-events.mjs.map +1 -1
- package/dist/capture/adapter.d.mts +5 -1
- package/dist/capture/dispatch.mjs +150 -0
- package/dist/capture/dispatch.mjs.map +1 -0
- package/dist/capture/orchestrator.d.mts +2 -0
- package/dist/capture/orchestrator.mjs +5 -44
- package/dist/capture/orchestrator.mjs.map +1 -1
- package/dist/capture/pipeline.d.mts +4 -1
- package/dist/capture/pipeline.mjs +6 -6
- package/dist/capture/pipeline.mjs.map +1 -1
- package/dist/capture/queue.d.mts +2 -1
- package/dist/capture/queue.mjs +2 -1
- package/dist/capture/queue.mjs.map +1 -1
- package/dist/capture/skip-checks.mjs +76 -0
- package/dist/capture/skip-checks.mjs.map +1 -0
- package/dist/capture/statics.mjs +124 -0
- package/dist/capture/statics.mjs.map +1 -0
- package/dist/capture/status-fanout.mjs.map +1 -1
- package/dist/capture/storybook.mjs.map +1 -1
- package/dist/capture.d.mts +8 -0
- package/dist/capture.mjs +9 -0
- package/dist/config.d.mts +10 -2
- package/dist/config.mjs +14 -2
- package/dist/config.mjs.map +1 -1
- package/dist/ddl.d.mts +1 -1
- package/dist/ddl.mjs +1 -1
- package/dist/ddl.mjs.map +1 -1
- package/dist/diff/engine.mjs.map +1 -1
- package/dist/diff/options.d.mts +3 -1
- package/dist/diff.d.mts +5 -0
- package/dist/diff.mjs +6 -0
- package/dist/index.d.mts +32 -25
- package/dist/index.mjs +207 -253
- package/dist/index.mjs.map +1 -1
- package/dist/logger.d.mts +3 -3
- package/dist/middleware/auth-gate.mjs +36 -0
- package/dist/middleware/auth-gate.mjs.map +1 -0
- package/dist/middleware/csrf.mjs.map +1 -1
- package/dist/middleware/request-log.mjs +28 -0
- package/dist/middleware/request-log.mjs.map +1 -0
- package/dist/middleware/store-scope.mjs +29 -0
- package/dist/middleware/store-scope.mjs.map +1 -0
- package/dist/models/baseline.mjs +7 -5
- package/dist/models/baseline.mjs.map +1 -1
- package/dist/models/build.mjs +3 -1
- package/dist/models/build.mjs.map +1 -1
- package/dist/models/comment.mjs +2 -1
- package/dist/models/comment.mjs.map +1 -1
- package/dist/models/label.mjs +2 -1
- package/dist/models/label.mjs.map +1 -1
- package/dist/models/member.mjs +1 -1
- package/dist/models/member.mjs.map +1 -1
- package/dist/models/project.mjs +1 -1
- package/dist/models/project.mjs.map +1 -1
- package/dist/models/snapshot.mjs +1 -1
- package/dist/models/snapshot.mjs.map +1 -1
- package/dist/models/status-config.mjs +1 -1
- package/dist/models/status-config.mjs.map +1 -1
- package/dist/models/token.mjs +1 -1
- package/dist/models/token.mjs.map +1 -1
- package/dist/models/webhook.mjs +11 -3
- package/dist/models/webhook.mjs.map +1 -1
- package/dist/pages/build-detail.mjs +9 -4
- package/dist/pages/build-detail.mjs.map +1 -1
- package/dist/pages/build-diff-comments.mjs +113 -0
- package/dist/pages/build-diff-comments.mjs.map +1 -0
- package/dist/pages/build-diff-header.mjs +163 -0
- package/dist/pages/build-diff-header.mjs.map +1 -0
- package/dist/pages/build-diff-nav.mjs +66 -0
- package/dist/pages/build-diff-nav.mjs.map +1 -0
- package/dist/pages/build-diff-viewer.mjs +197 -0
- package/dist/pages/build-diff-viewer.mjs.map +1 -0
- package/dist/pages/build-diff.mjs +65 -413
- package/dist/pages/build-diff.mjs.map +1 -1
- package/dist/pages/compute-jobs.mjs +1 -1
- package/dist/pages/compute-jobs.mjs.map +1 -1
- package/dist/pages/label-detail.mjs +4 -3
- package/dist/pages/label-detail.mjs.map +1 -1
- package/dist/pages/login.mjs.map +1 -1
- package/dist/pages/project-builds.mjs +5 -3
- package/dist/pages/project-builds.mjs.map +1 -1
- package/dist/pages/project-create.mjs.map +1 -1
- package/dist/pages/project-settings.mjs.map +1 -1
- package/dist/pages/projects.mjs +11 -6
- package/dist/pages/projects.mjs.map +1 -1
- package/dist/pages/root.mjs +6 -3
- package/dist/pages/root.mjs.map +1 -1
- package/dist/pages/settings-general.mjs.map +1 -1
- package/dist/pages/settings-labels.mjs +1 -1
- package/dist/pages/settings-labels.mjs.map +1 -1
- package/dist/pages/settings-members.mjs +1 -1
- package/dist/pages/settings-members.mjs.map +1 -1
- package/dist/pages/settings-status.mjs +2 -1
- package/dist/pages/settings-status.mjs.map +1 -1
- package/dist/pages/settings-tests.mjs +3 -3
- package/dist/pages/settings-tests.mjs.map +1 -1
- package/dist/pages/settings-tokens.mjs.map +1 -1
- package/dist/pages/settings-webhooks.mjs.map +1 -1
- package/dist/pages/storybook.mjs +38 -1
- package/dist/pages/storybook.mjs.map +1 -1
- package/dist/paths.mjs.map +1 -0
- package/dist/retention/purge.mjs +6 -3
- package/dist/retention/purge.mjs.map +1 -1
- package/dist/routers/admin.mjs +1 -1
- package/dist/routers/admin.mjs.map +1 -1
- package/dist/routers/assets.mjs.map +1 -1
- package/dist/routers/auth.mjs.map +1 -1
- package/dist/routers/builds.handlers.mjs +106 -21
- package/dist/routers/builds.handlers.mjs.map +1 -1
- package/dist/routers/builds.mjs +54 -34
- package/dist/routers/builds.mjs.map +1 -1
- package/dist/routers/comments.mjs.map +1 -1
- package/dist/routers/health.mjs +137 -0
- package/dist/routers/health.mjs.map +1 -0
- package/dist/routers/helpers.mjs +2 -2
- package/dist/routers/helpers.mjs.map +1 -1
- package/dist/routers/htmx.mjs.map +1 -1
- package/dist/routers/labels.mjs +1 -1
- package/dist/routers/labels.mjs.map +1 -1
- package/dist/routers/media.mjs +2 -2
- package/dist/routers/media.mjs.map +1 -1
- package/dist/routers/members.mjs.map +1 -1
- package/dist/routers/projects.mjs +1 -1
- package/dist/routers/projects.mjs.map +1 -1
- package/dist/routers/schemas.mjs.map +1 -1
- package/dist/routers/settings-general.mjs +95 -0
- package/dist/routers/settings-general.mjs.map +1 -0
- package/dist/routers/settings-labels.mjs +49 -0
- package/dist/routers/settings-labels.mjs.map +1 -0
- package/dist/routers/settings-members.mjs +30 -0
- package/dist/routers/settings-members.mjs.map +1 -0
- package/dist/routers/settings-status.mjs +73 -0
- package/dist/routers/settings-status.mjs.map +1 -0
- package/dist/routers/settings-tokens.mjs +40 -0
- package/dist/routers/settings-tokens.mjs.map +1 -0
- package/dist/routers/settings-webhooks.mjs +63 -0
- package/dist/routers/settings-webhooks.mjs.map +1 -0
- package/dist/routers/settings.handlers.mjs +93 -0
- package/dist/routers/settings.handlers.mjs.map +1 -0
- package/dist/routers/settings.mjs +13 -247
- package/dist/routers/settings.mjs.map +1 -1
- package/dist/routers/snapshots.mjs +1 -1
- package/dist/routers/snapshots.mjs.map +1 -1
- package/dist/routers/status-configs.mjs +1 -1
- package/dist/routers/status-configs.mjs.map +1 -1
- package/dist/routers/storybook.mjs +11 -4
- package/dist/routers/storybook.mjs.map +1 -1
- package/dist/routers/tokens.mjs +1 -1
- package/dist/routers/tokens.mjs.map +1 -1
- package/dist/routers/ui.mjs +4 -4
- package/dist/routers/ui.mjs.map +1 -1
- package/dist/routers/webhooks.mjs +6 -6
- package/dist/routers/webhooks.mjs.map +1 -1
- package/dist/schema/baseline.d.mts +18 -0
- package/dist/schema/baseline.mjs +22 -0
- package/dist/schema/baseline.mjs.map +1 -0
- package/dist/schema/build.d.mts +26 -0
- package/dist/schema/build.mjs +29 -0
- package/dist/schema/build.mjs.map +1 -0
- package/dist/schema/comment.d.mts +19 -0
- package/dist/schema/comment.mjs +26 -0
- package/dist/schema/comment.mjs.map +1 -0
- package/dist/schema/label.d.mts +25 -0
- package/dist/schema/label.mjs +30 -0
- package/dist/schema/label.mjs.map +1 -0
- package/dist/schema/member.d.mts +15 -0
- package/dist/schema/member.mjs +19 -0
- package/dist/schema/member.mjs.map +1 -0
- package/dist/schema/project.d.mts +34 -0
- package/dist/schema/project.mjs +25 -0
- package/dist/schema/project.mjs.map +1 -0
- package/dist/schema/snapshot.d.mts +30 -0
- package/dist/schema/snapshot.mjs +34 -0
- package/dist/schema/snapshot.mjs.map +1 -0
- package/dist/schema/status-config.d.mts +16 -0
- package/dist/schema/status-config.mjs +20 -0
- package/dist/schema/status-config.mjs.map +1 -0
- package/dist/schema/token.d.mts +15 -0
- package/dist/schema/token.mjs +19 -0
- package/dist/schema/token.mjs.map +1 -0
- package/dist/schema/user.d.mts +17 -0
- package/dist/schema/user.mjs +19 -0
- package/dist/schema/user.mjs.map +1 -0
- package/dist/schema/webhook.d.mts +16 -0
- package/dist/schema/webhook.mjs +20 -0
- package/dist/schema/webhook.mjs.map +1 -0
- package/dist/schema.d.mts +13 -168
- package/dist/schema.mjs +12 -2
- package/dist/schema.mjs.map +1 -1
- package/dist/store.mjs.map +1 -1
- package/dist/types.d.mts +1 -2
- package/dist/types.mjs.map +1 -1
- package/dist/ui/document.mjs.map +1 -1
- package/dist/ui/feedback.mjs +24 -0
- package/dist/ui/feedback.mjs.map +1 -0
- package/dist/ui/{components.mjs → forms.mjs} +3 -18
- package/dist/ui/forms.mjs.map +1 -0
- package/dist/ui/styles.mjs.map +1 -1
- package/dist/urls.mjs.map +1 -1
- package/package.json +47 -45
- package/dist/adapters/metadata.d.mts +0 -24
- package/dist/models/baseline.d.mts +0 -21
- package/dist/models/build.d.mts +0 -53
- package/dist/models/comment.d.mts +0 -22
- package/dist/models/label.d.mts +0 -49
- package/dist/models/member.d.mts +0 -27
- package/dist/models/project.d.mts +0 -43
- package/dist/models/snapshot.d.mts +0 -47
- package/dist/models/token.d.mts +0 -33
- package/dist/models/webhook.d.mts +0 -38
- package/dist/retention/purge.d.mts +0 -31
- package/dist/schema-tables.mjs +0 -166
- package/dist/schema-tables.mjs.map +0 -1
- package/dist/ui/components.mjs.map +0 -1
- package/dist/ui/document.d.mts +0 -9
- package/dist/utils/paths.mjs.map +0 -1
- package/dist/utils/ulid.d.mts +0 -10
- /package/dist/{utils/paths.d.mts → paths.d.mts} +0 -0
- /package/dist/{utils/paths.mjs → paths.mjs} +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { projects } from "./project.mjs";
|
|
5
|
+
import { builds } from "./build.mjs";
|
|
6
|
+
import { sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
|
|
7
|
+
//#region src/schema/label.ts
|
|
8
|
+
/** Narrow `label_types` table definition. */
|
|
9
|
+
const labelTypes = sqliteTable("label_types", {
|
|
10
|
+
id: text("id").primaryKey(),
|
|
11
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
12
|
+
key: text("key").notNull(),
|
|
13
|
+
name: text("name").notNull(),
|
|
14
|
+
linkTemplate: text("link_template"),
|
|
15
|
+
color: text("color"),
|
|
16
|
+
createdAt: text("created_at").notNull()
|
|
17
|
+
}, (t) => [uniqueIndex("label_types_project_key_idx").on(t.projectId, t.key)]);
|
|
18
|
+
/** Narrow `build_labels` table definition. */
|
|
19
|
+
const buildLabels = sqliteTable("build_labels", {
|
|
20
|
+
id: text("id").primaryKey(),
|
|
21
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
22
|
+
buildId: text("build_id").notNull().references(() => builds.id, { onDelete: "cascade" }),
|
|
23
|
+
typeKey: text("type_key").notNull(),
|
|
24
|
+
value: text("value").notNull(),
|
|
25
|
+
createdAt: text("created_at").notNull()
|
|
26
|
+
}, (t) => [uniqueIndex("build_labels_build_type_value_idx").on(t.buildId, t.typeKey, t.value)]);
|
|
27
|
+
//#endregion
|
|
28
|
+
export { buildLabels, labelTypes };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=label.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.mjs","names":[],"sources":["../../src/schema/label.ts"],"sourcesContent":["import { sqliteTable, text, uniqueIndex } from \"drizzle-orm/sqlite-core\";\nimport { builds } from \"./build.ts\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `label_types` table definition. */\nexport const labelTypes = sqliteTable(\n \"label_types\",\n {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n key: text(\"key\").notNull(),\n name: text(\"name\").notNull(),\n linkTemplate: text(\"link_template\"),\n color: text(\"color\"),\n createdAt: text(\"created_at\").notNull(),\n },\n (t) => [uniqueIndex(\"label_types_project_key_idx\").on(t.projectId, t.key)],\n);\n\n/** Narrow `build_labels` table definition. */\nexport const buildLabels = sqliteTable(\n \"build_labels\",\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 typeKey: text(\"type_key\").notNull(),\n value: text(\"value\").notNull(),\n createdAt: text(\"created_at\").notNull(),\n },\n (t) => [uniqueIndex(\"build_labels_build_type_value_idx\").on(t.buildId, t.typeKey, t.value)],\n);\n\n/** A label-type row. */\nexport interface LabelType {\n id: string;\n projectId: string;\n key: string;\n name: string;\n linkTemplate: string | null;\n color: string | null;\n createdAt: string;\n}\n\n/** A build-label row. */\nexport interface BuildLabel {\n id: string;\n projectId: string;\n buildId: string;\n typeKey: string;\n value: string;\n createdAt: string;\n}\n"],"mappings":";;;;;;;;AAKA,MAAa,aAAa,YACxB,eACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,KAAK,KAAK,KAAK,CAAC,CAAC,QAAQ;CACzB,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,cAAc,KAAK,eAAe;CAClC,OAAO,KAAK,OAAO;CACnB,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,IACC,MAAM,CAAC,YAAY,6BAA6B,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,CAAC,CAC3E;;AAGA,MAAa,cAAc,YACzB,gBACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,SAAS,KAAK,UAAU,CAAC,CACtB,QAAQ,CAAC,CACT,iBAAiB,OAAO,IAAI,EAAE,UAAU,UAAU,CAAC;CACtD,SAAS,KAAK,UAAU,CAAC,CAAC,QAAQ;CAClC,OAAO,KAAK,OAAO,CAAC,CAAC,QAAQ;CAC7B,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,IACC,MAAM,CAAC,YAAY,mCAAmC,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAC5F"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { ProjectRole } from "../types.mjs";
|
|
4
|
+
//#region src/schema/member.d.ts
|
|
5
|
+
/** A project-membership row. */
|
|
6
|
+
interface ProjectMember {
|
|
7
|
+
id: string;
|
|
8
|
+
projectId: string;
|
|
9
|
+
userId: string;
|
|
10
|
+
role: ProjectRole;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ProjectMember };
|
|
15
|
+
//# sourceMappingURL=member.d.mts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { projects } from "./project.mjs";
|
|
5
|
+
import { users } from "./user.mjs";
|
|
6
|
+
import { sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
|
|
7
|
+
//#region src/schema/member.ts
|
|
8
|
+
/** Narrow `project_members` table definition. */
|
|
9
|
+
const projectMembers = sqliteTable("project_members", {
|
|
10
|
+
id: text("id").primaryKey(),
|
|
11
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
12
|
+
userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
13
|
+
role: text("role").$type().notNull().default("viewer"),
|
|
14
|
+
createdAt: text("created_at").notNull()
|
|
15
|
+
}, (t) => [uniqueIndex("project_members_project_user_idx").on(t.projectId, t.userId)]);
|
|
16
|
+
//#endregion
|
|
17
|
+
export { projectMembers };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=member.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member.mjs","names":[],"sources":["../../src/schema/member.ts"],"sourcesContent":["import { sqliteTable, text, uniqueIndex } from \"drizzle-orm/sqlite-core\";\nimport type { ProjectRole } from \"../types.ts\";\nimport { projects } from \"./project.ts\";\nimport { users } from \"./user.ts\";\n\n/** Narrow `project_members` table definition. */\nexport const projectMembers = sqliteTable(\n \"project_members\",\n {\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 role: text(\"role\").$type<ProjectRole>().notNull().default(\"viewer\"),\n createdAt: text(\"created_at\").notNull(),\n },\n (t) => [uniqueIndex(\"project_members_project_user_idx\").on(t.projectId, t.userId)],\n);\n\n/** A project-membership row. */\nexport interface ProjectMember {\n id: string;\n projectId: string;\n userId: string;\n role: ProjectRole;\n createdAt: string;\n}\n"],"mappings":";;;;;;;;AAMA,MAAa,iBAAiB,YAC5B,mBACA;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,CACpB,QAAQ,CAAC,CACT,iBAAiB,MAAM,IAAI,EAAE,UAAU,UAAU,CAAC;CACrD,MAAM,KAAK,MAAM,CAAC,CAAC,MAAmB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,QAAQ;CAClE,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,IACC,MAAM,CAAC,YAAY,kCAAkC,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,CAAC,CACnF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/schema/project.d.ts
|
|
4
|
+
/** A project row. */
|
|
5
|
+
interface Project {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
gitRepository: string | null;
|
|
10
|
+
gitDefaultBranch: string;
|
|
11
|
+
pixelThreshold: number;
|
|
12
|
+
maxDiffRatio: number;
|
|
13
|
+
publicBranchRegex: string | null;
|
|
14
|
+
storybookMeta: string | null | undefined;
|
|
15
|
+
executePlay: boolean;
|
|
16
|
+
playTimeoutMs: number;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
}
|
|
20
|
+
/** Storybook metadata synced from a project's published Storybook. */
|
|
21
|
+
interface StorybookMeta {
|
|
22
|
+
framework?: {
|
|
23
|
+
name?: string;
|
|
24
|
+
options?: unknown;
|
|
25
|
+
};
|
|
26
|
+
addons?: string[];
|
|
27
|
+
storiesGlobs?: string[];
|
|
28
|
+
staticDirs?: string[];
|
|
29
|
+
packagePath?: string;
|
|
30
|
+
previewParameters?: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Project, StorybookMeta };
|
|
34
|
+
//# sourceMappingURL=project.d.mts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { integer, real, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
5
|
+
//#region src/schema/project.ts
|
|
6
|
+
/** Narrow `projects` table definition. */
|
|
7
|
+
const projects = sqliteTable("projects", {
|
|
8
|
+
id: text("id").primaryKey(),
|
|
9
|
+
name: text("name").notNull(),
|
|
10
|
+
slug: text("slug").notNull(),
|
|
11
|
+
gitRepository: text("git_repository"),
|
|
12
|
+
gitDefaultBranch: text("git_default_branch").notNull().default("main"),
|
|
13
|
+
pixelThreshold: real("pixel_threshold").notNull().default(.1),
|
|
14
|
+
maxDiffRatio: real("max_diff_ratio").notNull().default(.01),
|
|
15
|
+
publicBranchRegex: text("public_branch_regex"),
|
|
16
|
+
storybookMeta: text("storybook_meta").$type().default(null),
|
|
17
|
+
executePlay: integer("execute_play", { mode: "boolean" }).notNull().default(false),
|
|
18
|
+
playTimeoutMs: integer("play_timeout_ms").notNull().default(1e4),
|
|
19
|
+
createdAt: text("created_at").notNull(),
|
|
20
|
+
updatedAt: text("updated_at").notNull()
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { projects };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=project.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.mjs","names":[],"sources":["../../src/schema/project.ts"],"sourcesContent":["import { integer, real, sqliteTable, text } from \"drizzle-orm/sqlite-core\";\n\n/** Narrow `projects` table definition. */\nexport const projects = sqliteTable(\"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: real(\"pixel_threshold\").notNull().default(0.1),\n maxDiffRatio: real(\"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: integer(\"execute_play\", { mode: \"boolean\" }).notNull().default(false),\n playTimeoutMs: integer(\"play_timeout_ms\").notNull().default(10_000),\n createdAt: text(\"created_at\").notNull(),\n updatedAt: text(\"updated_at\").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 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,YAAY,YAAY;CAC9C,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,KAAK,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAG;CAC7D,cAAc,KAAK,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,GAAI;CAC3D,mBAAmB,KAAK,qBAAqB;CAC7C,eAAe,KAAK,gBAAgB,CAAC,CAAC,MAAiC,CAAC,CAAC,QAAQ,IAAI;CACrF,aAAa,QAAQ,gBAAgB,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CACjF,eAAe,QAAQ,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,GAAM;CAClE,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { SnapshotStatus } from "../types.mjs";
|
|
4
|
+
//#region src/schema/snapshot.d.ts
|
|
5
|
+
/** A snapshot row. */
|
|
6
|
+
interface Snapshot {
|
|
7
|
+
id: string;
|
|
8
|
+
projectId: string;
|
|
9
|
+
buildId: string;
|
|
10
|
+
storyId: string;
|
|
11
|
+
storyName: string;
|
|
12
|
+
storyTitle: string;
|
|
13
|
+
storyImportPath: string | null;
|
|
14
|
+
viewportName: string;
|
|
15
|
+
viewportWidth: number;
|
|
16
|
+
viewportHeight: number;
|
|
17
|
+
screenshotPath: string;
|
|
18
|
+
diffPath: string | null;
|
|
19
|
+
diffPixels: number | null;
|
|
20
|
+
diffRatio: number | null;
|
|
21
|
+
diffPassed: boolean | null;
|
|
22
|
+
status: SnapshotStatus;
|
|
23
|
+
reviewedBy: string | null;
|
|
24
|
+
reviewedAt: string | null;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Snapshot };
|
|
30
|
+
//# sourceMappingURL=snapshot.d.mts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { projects } from "./project.mjs";
|
|
5
|
+
import { builds } from "./build.mjs";
|
|
6
|
+
import { index, integer, real, sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
|
|
7
|
+
//#region src/schema/snapshot.ts
|
|
8
|
+
/** Narrow `snapshots` table definition. */
|
|
9
|
+
const snapshots = sqliteTable("snapshots", {
|
|
10
|
+
id: text("id").primaryKey(),
|
|
11
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
12
|
+
buildId: text("build_id").notNull().references(() => builds.id, { onDelete: "cascade" }),
|
|
13
|
+
storyId: text("story_id").notNull(),
|
|
14
|
+
storyName: text("story_name").notNull(),
|
|
15
|
+
storyTitle: text("story_title").notNull(),
|
|
16
|
+
storyImportPath: text("story_import_path"),
|
|
17
|
+
viewportName: text("viewport_name").notNull().default("desktop"),
|
|
18
|
+
viewportWidth: integer("viewport_width").notNull().default(1280),
|
|
19
|
+
viewportHeight: integer("viewport_height").notNull().default(720),
|
|
20
|
+
screenshotPath: text("screenshot_path").notNull(),
|
|
21
|
+
diffPath: text("diff_path"),
|
|
22
|
+
diffPixels: integer("diff_pixels"),
|
|
23
|
+
diffRatio: real("diff_ratio"),
|
|
24
|
+
diffPassed: integer("diff_passed", { mode: "boolean" }),
|
|
25
|
+
status: text("status").$type().notNull().default("pending"),
|
|
26
|
+
reviewedBy: text("reviewed_by"),
|
|
27
|
+
reviewedAt: text("reviewed_at"),
|
|
28
|
+
createdAt: text("created_at").notNull(),
|
|
29
|
+
updatedAt: text("updated_at").notNull()
|
|
30
|
+
}, (t) => [uniqueIndex("snapshots_build_story_viewport_idx").on(t.buildId, t.storyId, t.viewportName), index("snapshots_build_id_idx").on(t.buildId)]);
|
|
31
|
+
//#endregion
|
|
32
|
+
export { snapshots };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=snapshot.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.mjs","names":[],"sources":["../../src/schema/snapshot.ts"],"sourcesContent":["import { index, integer, real, sqliteTable, text, uniqueIndex } from \"drizzle-orm/sqlite-core\";\nimport type { SnapshotStatus } from \"../types.ts\";\nimport { builds } from \"./build.ts\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `snapshots` table definition. */\nexport const snapshots = sqliteTable(\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: real(\"diff_ratio\"),\n diffPassed: integer(\"diff_passed\", { mode: \"boolean\" }),\n status: text(\"status\").$type<SnapshotStatus>().notNull().default(\"pending\"),\n reviewedBy: text(\"reviewed_by\"),\n reviewedAt: text(\"reviewed_at\"),\n createdAt: text(\"created_at\").notNull(),\n updatedAt: text(\"updated_at\").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 createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;;AAMA,MAAa,YAAY,YACvB,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,KAAK,YAAY;CAC5B,YAAY,QAAQ,eAAe,EAAE,MAAM,UAAU,CAAC;CACtD,QAAQ,KAAK,QAAQ,CAAC,CAAC,MAAsB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,SAAS;CAC1E,YAAY,KAAK,aAAa;CAC9B,YAAY,KAAK,aAAa;CAC9B,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,IACC,MAAM,CACL,YAAY,oCAAoC,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,GACzF,MAAM,wBAAwB,CAAC,CAAC,GAAG,EAAE,OAAO,CAC9C,CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/schema/status-config.d.ts
|
|
4
|
+
/** A project status-config row. */
|
|
5
|
+
interface ProjectStatusConfig {
|
|
6
|
+
id: string;
|
|
7
|
+
projectId: string;
|
|
8
|
+
provider: string;
|
|
9
|
+
config: string;
|
|
10
|
+
tokenEncrypted: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { ProjectStatusConfig };
|
|
16
|
+
//# sourceMappingURL=status-config.d.mts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { projects } from "./project.mjs";
|
|
5
|
+
import { sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
6
|
+
//#region src/schema/status-config.ts
|
|
7
|
+
/** Narrow `project_status_configs` table definition. */
|
|
8
|
+
const projectStatusConfigs = sqliteTable("project_status_configs", {
|
|
9
|
+
id: text("id").primaryKey(),
|
|
10
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
11
|
+
provider: text("provider").notNull(),
|
|
12
|
+
config: text("config").notNull(),
|
|
13
|
+
tokenEncrypted: text("token_encrypted").notNull(),
|
|
14
|
+
createdAt: text("created_at").notNull(),
|
|
15
|
+
updatedAt: text("updated_at").notNull()
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { projectStatusConfigs };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=status-config.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-config.mjs","names":[],"sources":["../../src/schema/status-config.ts"],"sourcesContent":["import { sqliteTable, text } from \"drizzle-orm/sqlite-core\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `project_status_configs` table definition. */\nexport const projectStatusConfigs = sqliteTable(\"project_status_configs\", {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n provider: text(\"provider\").notNull(),\n config: text(\"config\").notNull(),\n tokenEncrypted: text(\"token_encrypted\").notNull(),\n createdAt: text(\"created_at\").notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n});\n\n/** A project status-config row. */\nexport interface ProjectStatusConfig {\n id: string;\n projectId: string;\n provider: string;\n config: string;\n tokenEncrypted: string;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;AAIA,MAAa,uBAAuB,YAAY,0BAA0B;CACxE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,UAAU,KAAK,UAAU,CAAC,CAAC,QAAQ;CACnC,QAAQ,KAAK,QAAQ,CAAC,CAAC,QAAQ;CAC/B,gBAAgB,KAAK,iBAAiB,CAAC,CAAC,QAAQ;CAChD,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/schema/token.d.ts
|
|
4
|
+
/** A CI token row (hash only; the secret itself is never stored). */
|
|
5
|
+
interface Token {
|
|
6
|
+
id: string;
|
|
7
|
+
projectId: string;
|
|
8
|
+
name: string;
|
|
9
|
+
hash: string;
|
|
10
|
+
lastUsedAt: string | null;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Token };
|
|
15
|
+
//# sourceMappingURL=token.d.mts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { projects } from "./project.mjs";
|
|
5
|
+
import { sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
6
|
+
//#region src/schema/token.ts
|
|
7
|
+
/** Narrow `tokens` table definition. */
|
|
8
|
+
const tokens = sqliteTable("tokens", {
|
|
9
|
+
id: text("id").primaryKey(),
|
|
10
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
11
|
+
name: text("name").notNull(),
|
|
12
|
+
hash: text("hash").notNull(),
|
|
13
|
+
lastUsedAt: text("last_used_at"),
|
|
14
|
+
createdAt: text("created_at").notNull()
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { tokens };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=token.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.mjs","names":[],"sources":["../../src/schema/token.ts"],"sourcesContent":["import { sqliteTable, text } from \"drizzle-orm/sqlite-core\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `tokens` table definition. */\nexport const tokens = sqliteTable(\"tokens\", {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n name: text(\"name\").notNull(),\n hash: text(\"hash\").notNull(),\n lastUsedAt: text(\"last_used_at\"),\n createdAt: text(\"created_at\").notNull(),\n});\n\n/** A CI token row (hash only; the secret itself is never stored). */\nexport interface Token {\n id: string;\n projectId: string;\n name: string;\n hash: string;\n lastUsedAt: string | null;\n createdAt: string;\n}\n"],"mappings":";;;;;;;AAIA,MAAa,SAAS,YAAY,UAAU;CAC1C,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,YAAY,KAAK,cAAc;CAC/B,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { SiteRole } from "../types.mjs";
|
|
4
|
+
//#region src/schema/user.d.ts
|
|
5
|
+
/** A user row. */
|
|
6
|
+
interface User {
|
|
7
|
+
id: string;
|
|
8
|
+
email: string;
|
|
9
|
+
name: string;
|
|
10
|
+
avatarUrl: string | null;
|
|
11
|
+
role: SiteRole;
|
|
12
|
+
lastLoginAt: string | null;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { User };
|
|
17
|
+
//# sourceMappingURL=user.d.mts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
5
|
+
//#region src/schema/user.ts
|
|
6
|
+
/** Narrow `users` table definition. */
|
|
7
|
+
const users = sqliteTable("users", {
|
|
8
|
+
id: text("id").primaryKey(),
|
|
9
|
+
email: text("email").notNull(),
|
|
10
|
+
name: text("name").notNull(),
|
|
11
|
+
avatarUrl: text("avatar_url"),
|
|
12
|
+
role: text("role").$type().notNull().default("member"),
|
|
13
|
+
lastLoginAt: text("last_login_at"),
|
|
14
|
+
createdAt: text("created_at").notNull()
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { users };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=user.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.mjs","names":[],"sources":["../../src/schema/user.ts"],"sourcesContent":["import { sqliteTable, text } from \"drizzle-orm/sqlite-core\";\nimport type { SiteRole } from \"../types.ts\";\n\n/** Narrow `users` table definition. */\nexport const users = sqliteTable(\"users\", {\n id: text(\"id\").primaryKey(),\n email: text(\"email\").notNull(),\n name: text(\"name\").notNull(),\n avatarUrl: text(\"avatar_url\"),\n role: text(\"role\").$type<SiteRole>().notNull().default(\"member\"),\n lastLoginAt: text(\"last_login_at\"),\n createdAt: text(\"created_at\").notNull(),\n});\n\n/** A user row. */\nexport interface User {\n id: string;\n email: string;\n name: string;\n avatarUrl: string | null;\n role: SiteRole;\n lastLoginAt: string | null;\n createdAt: string;\n}\n"],"mappings":";;;;;;AAIA,MAAa,QAAQ,YAAY,SAAS;CACxC,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,OAAO,KAAK,OAAO,CAAC,CAAC,QAAQ;CAC7B,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,WAAW,KAAK,YAAY;CAC5B,MAAM,KAAK,MAAM,CAAC,CAAC,MAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,QAAQ;CAC/D,aAAa,KAAK,eAAe;CACjC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/schema/webhook.d.ts
|
|
4
|
+
/** A webhook subscription row. */
|
|
5
|
+
interface Webhook {
|
|
6
|
+
id: string;
|
|
7
|
+
projectId: string;
|
|
8
|
+
url: string;
|
|
9
|
+
secretEncrypted: string;
|
|
10
|
+
events: string | null;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Webhook };
|
|
16
|
+
//# sourceMappingURL=webhook.d.mts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { projects } from "./project.mjs";
|
|
5
|
+
import { sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
6
|
+
//#region src/schema/webhook.ts
|
|
7
|
+
/** Narrow `webhooks` table definition. */
|
|
8
|
+
const webhooks = sqliteTable("webhooks", {
|
|
9
|
+
id: text("id").primaryKey(),
|
|
10
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
11
|
+
url: text("url").notNull(),
|
|
12
|
+
secretEncrypted: text("secret_encrypted").notNull(),
|
|
13
|
+
events: text("events"),
|
|
14
|
+
createdAt: text("created_at").notNull(),
|
|
15
|
+
updatedAt: text("updated_at").notNull()
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { webhooks };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=webhook.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.mjs","names":[],"sources":["../../src/schema/webhook.ts"],"sourcesContent":["import { sqliteTable, text } from \"drizzle-orm/sqlite-core\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `webhooks` table definition. */\nexport const webhooks = sqliteTable(\"webhooks\", {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n url: text(\"url\").notNull(),\n secretEncrypted: text(\"secret_encrypted\").notNull(),\n events: text(\"events\"),\n createdAt: text(\"created_at\").notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n});\n\n/** A webhook subscription row. */\nexport interface Webhook {\n id: string;\n projectId: string;\n url: string;\n secretEncrypted: string;\n events: string | null;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;AAIA,MAAa,WAAW,YAAY,YAAY;CAC9C,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,KAAK,KAAK,KAAK,CAAC,CAAC,QAAQ;CACzB,iBAAiB,KAAK,kBAAkB,CAAC,CAAC,QAAQ;CAClD,QAAQ,KAAK,QAAQ;CACrB,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,CAAC"}
|
package/dist/schema.d.mts
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
import {
|
|
3
|
+
import { Build } from "./schema/build.mjs";
|
|
4
|
+
import { Project, StorybookMeta } from "./schema/project.mjs";
|
|
5
|
+
import { Baseline } from "./schema/baseline.mjs";
|
|
6
|
+
import { Comment } from "./schema/comment.mjs";
|
|
7
|
+
import { BuildLabel, LabelType } from "./schema/label.mjs";
|
|
8
|
+
import { ProjectMember } from "./schema/member.mjs";
|
|
9
|
+
import { ProjectStatusConfig } from "./schema/status-config.mjs";
|
|
10
|
+
import { Snapshot } from "./schema/snapshot.mjs";
|
|
11
|
+
import { Token } from "./schema/token.mjs";
|
|
12
|
+
import { User } from "./schema/user.mjs";
|
|
13
|
+
import { Webhook } from "./schema/webhook.mjs";
|
|
4
14
|
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
5
|
-
//#region src/schema.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Database schema: table handles, row types, and the schema object passed to
|
|
8
|
-
* the Drizzle client.
|
|
9
|
-
*/
|
|
10
|
-
/** Storybook metadata synced from a project's published Storybook. */
|
|
11
|
-
interface StorybookMeta {
|
|
12
|
-
framework?: {
|
|
13
|
-
name?: string;
|
|
14
|
-
options?: unknown;
|
|
15
|
-
};
|
|
16
|
-
addons?: string[];
|
|
17
|
-
storiesGlobs?: string[];
|
|
18
|
-
staticDirs?: string[];
|
|
19
|
-
packagePath?: string;
|
|
20
|
-
previewParameters?: Record<string, unknown>;
|
|
21
|
-
}
|
|
15
|
+
//#region src/schema/index.d.ts
|
|
22
16
|
/** Projects table (one row per Storybook project). */
|
|
23
17
|
declare const projects: AnySQLiteTable;
|
|
24
18
|
/** Project status-configs table (merge-gate configurations). */
|
|
@@ -60,155 +54,6 @@ declare const schema: {
|
|
|
60
54
|
};
|
|
61
55
|
/** The full database schema type. */
|
|
62
56
|
type Schema = typeof schema;
|
|
63
|
-
/** A project row. */
|
|
64
|
-
interface Project {
|
|
65
|
-
id: string;
|
|
66
|
-
name: string;
|
|
67
|
-
slug: string;
|
|
68
|
-
gitRepository: string | null;
|
|
69
|
-
gitDefaultBranch: string;
|
|
70
|
-
pixelThreshold: number;
|
|
71
|
-
maxDiffRatio: number;
|
|
72
|
-
publicBranchRegex: string | null;
|
|
73
|
-
storybookMeta: string | null | undefined;
|
|
74
|
-
executePlay: boolean;
|
|
75
|
-
playTimeoutMs: number;
|
|
76
|
-
createdAt: string;
|
|
77
|
-
updatedAt: string;
|
|
78
|
-
}
|
|
79
|
-
/** A project status-config row. */
|
|
80
|
-
interface ProjectStatusConfig {
|
|
81
|
-
id: string;
|
|
82
|
-
projectId: string;
|
|
83
|
-
provider: string;
|
|
84
|
-
config: string;
|
|
85
|
-
tokenEncrypted: string;
|
|
86
|
-
createdAt: string;
|
|
87
|
-
updatedAt: string;
|
|
88
|
-
}
|
|
89
|
-
/** A build row. */
|
|
90
|
-
interface Build {
|
|
91
|
-
id: string;
|
|
92
|
-
projectId: string;
|
|
93
|
-
gitSha: string;
|
|
94
|
-
gitBranch: string;
|
|
95
|
-
isDefault: boolean;
|
|
96
|
-
authorEmail: string | null;
|
|
97
|
-
authorName: string | null;
|
|
98
|
-
message: string | null;
|
|
99
|
-
public: boolean;
|
|
100
|
-
status: BuildStatus;
|
|
101
|
-
snapshotCount: number;
|
|
102
|
-
changedCount: number;
|
|
103
|
-
approvedCount: number;
|
|
104
|
-
rejectedCount: number;
|
|
105
|
-
createdAt: string;
|
|
106
|
-
updatedAt: string;
|
|
107
|
-
}
|
|
108
|
-
/** A snapshot row. */
|
|
109
|
-
interface Snapshot {
|
|
110
|
-
id: string;
|
|
111
|
-
projectId: string;
|
|
112
|
-
buildId: string;
|
|
113
|
-
storyId: string;
|
|
114
|
-
storyName: string;
|
|
115
|
-
storyTitle: string;
|
|
116
|
-
storyImportPath: string | null;
|
|
117
|
-
viewportName: string;
|
|
118
|
-
viewportWidth: number;
|
|
119
|
-
viewportHeight: number;
|
|
120
|
-
screenshotPath: string;
|
|
121
|
-
diffPath: string | null;
|
|
122
|
-
diffPixels: number | null;
|
|
123
|
-
diffRatio: number | null;
|
|
124
|
-
diffPassed: boolean | null;
|
|
125
|
-
status: SnapshotStatus;
|
|
126
|
-
reviewedBy: string | null;
|
|
127
|
-
reviewedAt: string | null;
|
|
128
|
-
createdAt: string;
|
|
129
|
-
updatedAt: string;
|
|
130
|
-
}
|
|
131
|
-
/** A baseline row. */
|
|
132
|
-
interface Baseline {
|
|
133
|
-
id: string;
|
|
134
|
-
projectId: string;
|
|
135
|
-
storyId: string;
|
|
136
|
-
viewportName: string;
|
|
137
|
-
branch: string;
|
|
138
|
-
snapshotId: string | null;
|
|
139
|
-
screenshotPath: string;
|
|
140
|
-
createdAt: string;
|
|
141
|
-
updatedAt: string;
|
|
142
|
-
}
|
|
143
|
-
/** A comment row. */
|
|
144
|
-
interface Comment {
|
|
145
|
-
id: string;
|
|
146
|
-
projectId: string;
|
|
147
|
-
buildId: string;
|
|
148
|
-
snapshotId: string | null;
|
|
149
|
-
userId: string;
|
|
150
|
-
body: string;
|
|
151
|
-
parentId: string | null;
|
|
152
|
-
resolved: boolean;
|
|
153
|
-
createdAt: string;
|
|
154
|
-
updatedAt: string;
|
|
155
|
-
}
|
|
156
|
-
/** A label-type row. */
|
|
157
|
-
interface LabelType {
|
|
158
|
-
id: string;
|
|
159
|
-
projectId: string;
|
|
160
|
-
key: string;
|
|
161
|
-
name: string;
|
|
162
|
-
linkTemplate: string | null;
|
|
163
|
-
color: string | null;
|
|
164
|
-
createdAt: string;
|
|
165
|
-
}
|
|
166
|
-
/** A build-label row. */
|
|
167
|
-
interface BuildLabel {
|
|
168
|
-
id: string;
|
|
169
|
-
projectId: string;
|
|
170
|
-
buildId: string;
|
|
171
|
-
typeKey: string;
|
|
172
|
-
value: string;
|
|
173
|
-
createdAt: string;
|
|
174
|
-
}
|
|
175
|
-
/** A CI token row (hash only; the secret itself is never stored). */
|
|
176
|
-
interface Token {
|
|
177
|
-
id: string;
|
|
178
|
-
projectId: string;
|
|
179
|
-
name: string;
|
|
180
|
-
hash: string;
|
|
181
|
-
lastUsedAt: string | null;
|
|
182
|
-
createdAt: string;
|
|
183
|
-
}
|
|
184
|
-
/** A webhook subscription row. */
|
|
185
|
-
interface Webhook {
|
|
186
|
-
id: string;
|
|
187
|
-
projectId: string;
|
|
188
|
-
url: string;
|
|
189
|
-
secret: string;
|
|
190
|
-
events: string | null;
|
|
191
|
-
createdAt: string;
|
|
192
|
-
updatedAt: string;
|
|
193
|
-
}
|
|
194
|
-
/** A user row. */
|
|
195
|
-
interface User {
|
|
196
|
-
id: string;
|
|
197
|
-
email: string;
|
|
198
|
-
name: string;
|
|
199
|
-
avatarUrl: string | null;
|
|
200
|
-
role: SiteRole;
|
|
201
|
-
lastLoginAt: string | null;
|
|
202
|
-
createdAt: string;
|
|
203
|
-
}
|
|
204
|
-
/** A project-membership row. */
|
|
205
|
-
interface ProjectMember {
|
|
206
|
-
id: string;
|
|
207
|
-
projectId: string;
|
|
208
|
-
userId: string;
|
|
209
|
-
role: ProjectRole;
|
|
210
|
-
createdAt: string;
|
|
211
|
-
}
|
|
212
57
|
//#endregion
|
|
213
|
-
export { Baseline, Build, BuildLabel, Comment, LabelType, Project, ProjectMember, ProjectStatusConfig, Schema, Snapshot, StorybookMeta, Token, User, Webhook, baselines, buildLabels, builds, comments, labelTypes, projectMembers, projectStatusConfigs, projects, schema, snapshots, tokens, users, webhooks };
|
|
58
|
+
export { type Baseline, type Build, type BuildLabel, type Comment, type LabelType, type Project, type ProjectMember, type ProjectStatusConfig, Schema, type Snapshot, type StorybookMeta, type Token, type User, type Webhook, baselines, buildLabels, builds, comments, labelTypes, projectMembers, projectStatusConfigs, projects, schema, snapshots, tokens, users, webhooks };
|
|
214
59
|
//# sourceMappingURL=schema.d.mts.map
|
package/dist/schema.mjs
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import "node:path";
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { projects as projects$1 } from "./schema/project.mjs";
|
|
5
|
+
import { builds as builds$1 } from "./schema/build.mjs";
|
|
6
|
+
import { buildLabels as buildLabels$1, labelTypes as labelTypes$1 } from "./schema/label.mjs";
|
|
7
|
+
import { snapshots as snapshots$1 } from "./schema/snapshot.mjs";
|
|
8
|
+
import { webhooks as webhooks$1 } from "./schema/webhook.mjs";
|
|
9
|
+
import { baselines as baselines$1 } from "./schema/baseline.mjs";
|
|
10
|
+
import { projectStatusConfigs as projectStatusConfigs$1 } from "./schema/status-config.mjs";
|
|
11
|
+
import { users as users$1 } from "./schema/user.mjs";
|
|
12
|
+
import { projectMembers as projectMembers$1 } from "./schema/member.mjs";
|
|
13
|
+
import { tokens as tokens$1 } from "./schema/token.mjs";
|
|
14
|
+
import { comments as comments$1 } from "./schema/comment.mjs";
|
|
15
|
+
//#region src/schema/index.ts
|
|
6
16
|
/** Projects table (one row per Storybook project). */
|
|
7
17
|
const projects = projects$1;
|
|
8
18
|
/** Project status-configs table (merge-gate configurations). */
|