@storyshelf/db-sqlite 0.3.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -3
- package/dist/better-sqlite3.d.mts +29 -0
- package/dist/better-sqlite3.mjs +116 -0
- package/dist/better-sqlite3.mjs.map +1 -0
- package/dist/bun-sqlite.d.mts +30 -0
- package/dist/bun-sqlite.mjs +120 -0
- package/dist/bun-sqlite.mjs.map +1 -0
- package/dist/d1.d.mts +38 -0
- package/dist/d1.mjs +108 -0
- package/dist/d1.mjs.map +1 -0
- package/dist/ddl.d.mts +14 -0
- package/dist/ddl.mjs +342 -0
- package/dist/ddl.mjs.map +1 -0
- package/dist/drizzle-factory.d.mts +19 -0
- package/dist/drizzle-factory.mjs +121 -0
- package/dist/drizzle-factory.mjs.map +1 -0
- package/dist/index.mjs +102 -36
- package/dist/index.mjs.map +1 -1
- package/dist/schema/baseline.d.mts +204 -0
- package/dist/schema/baseline.mjs +23 -0
- package/dist/schema/baseline.mjs.map +1 -0
- package/dist/schema/build.d.mts +405 -0
- package/dist/schema/build.mjs +33 -0
- package/dist/schema/build.mjs.map +1 -0
- package/dist/schema/capture-attempt.d.mts +482 -0
- package/dist/schema/capture-attempt.mjs +40 -0
- package/dist/schema/capture-attempt.mjs.map +1 -0
- package/dist/schema/comment.d.mts +215 -0
- package/dist/schema/comment.mjs +26 -0
- package/dist/schema/comment.mjs.map +1 -0
- package/dist/schema/content-refs.d.mts +95 -0
- package/dist/schema/content-refs.mjs +16 -0
- package/dist/schema/content-refs.mjs.map +1 -0
- package/dist/schema/label.d.mts +288 -0
- package/dist/schema/label.mjs +30 -0
- package/dist/schema/label.mjs.map +1 -0
- package/dist/schema/member.d.mts +140 -0
- package/dist/schema/member.mjs +20 -0
- package/dist/schema/member.mjs.map +1 -0
- package/dist/schema/notification.d.mts +344 -0
- package/dist/schema/notification.mjs +33 -0
- package/dist/schema/notification.mjs.map +1 -0
- package/dist/schema/project-group-mapping.d.mts +119 -0
- package/dist/schema/project-group-mapping.mjs +18 -0
- package/dist/schema/project-group-mapping.mjs.map +1 -0
- package/dist/schema/project.d.mts +358 -0
- package/dist/schema/project.mjs +29 -0
- package/dist/schema/project.mjs.map +1 -0
- package/dist/schema/snapshot.d.mts +487 -0
- package/dist/schema/snapshot.mjs +38 -0
- package/dist/schema/snapshot.mjs.map +1 -0
- package/dist/schema/status-config.d.mts +157 -0
- package/dist/schema/status-config.mjs +20 -0
- package/dist/schema/status-config.mjs.map +1 -0
- package/dist/schema/token.d.mts +157 -0
- package/dist/schema/token.mjs +21 -0
- package/dist/schema/token.mjs.map +1 -0
- package/dist/schema/user-invite.d.mts +137 -0
- package/dist/schema/user-invite.mjs +19 -0
- package/dist/schema/user-invite.mjs.map +1 -0
- package/dist/schema/user.d.mts +238 -0
- package/dist/schema/user.mjs +23 -0
- package/dist/schema/user.mjs.map +1 -0
- package/dist/schema/webhook.d.mts +157 -0
- package/dist/schema/webhook.mjs +20 -0
- package/dist/schema/webhook.mjs.map +1 -0
- package/dist/schema.d.mts +47 -0
- package/dist/schema.mjs +46 -0
- package/dist/schema.mjs.map +1 -0
- package/dist/turso.d.mts +32 -0
- package/dist/turso.mjs +134 -0
- package/dist/turso.mjs.map +1 -0
- package/package.json +66 -10
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/schema/comment.d.ts
|
|
4
|
+
/** Narrow `comments` table definition. */
|
|
5
|
+
declare const comments: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
6
|
+
name: "comments";
|
|
7
|
+
schema: undefined;
|
|
8
|
+
columns: {
|
|
9
|
+
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
10
|
+
name: "id";
|
|
11
|
+
tableName: "comments";
|
|
12
|
+
dataType: "string";
|
|
13
|
+
columnType: "SQLiteText";
|
|
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
|
+
length: number | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
29
|
+
name: "project_id";
|
|
30
|
+
tableName: "comments";
|
|
31
|
+
dataType: "string";
|
|
32
|
+
columnType: "SQLiteText";
|
|
33
|
+
data: string;
|
|
34
|
+
driverParam: string;
|
|
35
|
+
notNull: true;
|
|
36
|
+
hasDefault: false;
|
|
37
|
+
isPrimaryKey: false;
|
|
38
|
+
isAutoincrement: false;
|
|
39
|
+
hasRuntimeDefault: false;
|
|
40
|
+
enumValues: [string, ...string[]];
|
|
41
|
+
baseColumn: never;
|
|
42
|
+
identity: undefined;
|
|
43
|
+
generated: undefined;
|
|
44
|
+
}, {}, {
|
|
45
|
+
length: number | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
buildId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
48
|
+
name: "build_id";
|
|
49
|
+
tableName: "comments";
|
|
50
|
+
dataType: "string";
|
|
51
|
+
columnType: "SQLiteText";
|
|
52
|
+
data: string;
|
|
53
|
+
driverParam: string;
|
|
54
|
+
notNull: true;
|
|
55
|
+
hasDefault: false;
|
|
56
|
+
isPrimaryKey: false;
|
|
57
|
+
isAutoincrement: false;
|
|
58
|
+
hasRuntimeDefault: false;
|
|
59
|
+
enumValues: [string, ...string[]];
|
|
60
|
+
baseColumn: never;
|
|
61
|
+
identity: undefined;
|
|
62
|
+
generated: undefined;
|
|
63
|
+
}, {}, {
|
|
64
|
+
length: number | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
snapshotId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
67
|
+
name: "snapshot_id";
|
|
68
|
+
tableName: "comments";
|
|
69
|
+
dataType: "string";
|
|
70
|
+
columnType: "SQLiteText";
|
|
71
|
+
data: string;
|
|
72
|
+
driverParam: string;
|
|
73
|
+
notNull: false;
|
|
74
|
+
hasDefault: false;
|
|
75
|
+
isPrimaryKey: false;
|
|
76
|
+
isAutoincrement: false;
|
|
77
|
+
hasRuntimeDefault: false;
|
|
78
|
+
enumValues: [string, ...string[]];
|
|
79
|
+
baseColumn: never;
|
|
80
|
+
identity: undefined;
|
|
81
|
+
generated: undefined;
|
|
82
|
+
}, {}, {
|
|
83
|
+
length: number | undefined;
|
|
84
|
+
}>;
|
|
85
|
+
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
86
|
+
name: "user_id";
|
|
87
|
+
tableName: "comments";
|
|
88
|
+
dataType: "string";
|
|
89
|
+
columnType: "SQLiteText";
|
|
90
|
+
data: string;
|
|
91
|
+
driverParam: string;
|
|
92
|
+
notNull: false;
|
|
93
|
+
hasDefault: false;
|
|
94
|
+
isPrimaryKey: false;
|
|
95
|
+
isAutoincrement: false;
|
|
96
|
+
hasRuntimeDefault: false;
|
|
97
|
+
enumValues: [string, ...string[]];
|
|
98
|
+
baseColumn: never;
|
|
99
|
+
identity: undefined;
|
|
100
|
+
generated: undefined;
|
|
101
|
+
}, {}, {
|
|
102
|
+
length: number | undefined;
|
|
103
|
+
}>;
|
|
104
|
+
body: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
105
|
+
name: "body";
|
|
106
|
+
tableName: "comments";
|
|
107
|
+
dataType: "string";
|
|
108
|
+
columnType: "SQLiteText";
|
|
109
|
+
data: string;
|
|
110
|
+
driverParam: string;
|
|
111
|
+
notNull: true;
|
|
112
|
+
hasDefault: false;
|
|
113
|
+
isPrimaryKey: false;
|
|
114
|
+
isAutoincrement: false;
|
|
115
|
+
hasRuntimeDefault: false;
|
|
116
|
+
enumValues: [string, ...string[]];
|
|
117
|
+
baseColumn: never;
|
|
118
|
+
identity: undefined;
|
|
119
|
+
generated: undefined;
|
|
120
|
+
}, {}, {
|
|
121
|
+
length: number | undefined;
|
|
122
|
+
}>;
|
|
123
|
+
parentId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
124
|
+
name: "parent_id";
|
|
125
|
+
tableName: "comments";
|
|
126
|
+
dataType: "string";
|
|
127
|
+
columnType: "SQLiteText";
|
|
128
|
+
data: string;
|
|
129
|
+
driverParam: string;
|
|
130
|
+
notNull: false;
|
|
131
|
+
hasDefault: false;
|
|
132
|
+
isPrimaryKey: false;
|
|
133
|
+
isAutoincrement: false;
|
|
134
|
+
hasRuntimeDefault: false;
|
|
135
|
+
enumValues: [string, ...string[]];
|
|
136
|
+
baseColumn: never;
|
|
137
|
+
identity: undefined;
|
|
138
|
+
generated: undefined;
|
|
139
|
+
}, {}, {
|
|
140
|
+
length: number | undefined;
|
|
141
|
+
}>;
|
|
142
|
+
resolved: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
143
|
+
name: "resolved";
|
|
144
|
+
tableName: "comments";
|
|
145
|
+
dataType: "boolean";
|
|
146
|
+
columnType: "SQLiteBoolean";
|
|
147
|
+
data: boolean;
|
|
148
|
+
driverParam: number;
|
|
149
|
+
notNull: true;
|
|
150
|
+
hasDefault: true;
|
|
151
|
+
isPrimaryKey: false;
|
|
152
|
+
isAutoincrement: false;
|
|
153
|
+
hasRuntimeDefault: false;
|
|
154
|
+
enumValues: undefined;
|
|
155
|
+
baseColumn: never;
|
|
156
|
+
identity: undefined;
|
|
157
|
+
generated: undefined;
|
|
158
|
+
}, {}, {}>;
|
|
159
|
+
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
160
|
+
name: "created_at";
|
|
161
|
+
tableName: "comments";
|
|
162
|
+
dataType: "string";
|
|
163
|
+
columnType: "SQLiteText";
|
|
164
|
+
data: string;
|
|
165
|
+
driverParam: string;
|
|
166
|
+
notNull: true;
|
|
167
|
+
hasDefault: false;
|
|
168
|
+
isPrimaryKey: false;
|
|
169
|
+
isAutoincrement: false;
|
|
170
|
+
hasRuntimeDefault: false;
|
|
171
|
+
enumValues: [string, ...string[]];
|
|
172
|
+
baseColumn: never;
|
|
173
|
+
identity: undefined;
|
|
174
|
+
generated: undefined;
|
|
175
|
+
}, {}, {
|
|
176
|
+
length: number | undefined;
|
|
177
|
+
}>;
|
|
178
|
+
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
179
|
+
name: "updated_at";
|
|
180
|
+
tableName: "comments";
|
|
181
|
+
dataType: "string";
|
|
182
|
+
columnType: "SQLiteText";
|
|
183
|
+
data: string;
|
|
184
|
+
driverParam: string;
|
|
185
|
+
notNull: true;
|
|
186
|
+
hasDefault: false;
|
|
187
|
+
isPrimaryKey: false;
|
|
188
|
+
isAutoincrement: false;
|
|
189
|
+
hasRuntimeDefault: false;
|
|
190
|
+
enumValues: [string, ...string[]];
|
|
191
|
+
baseColumn: never;
|
|
192
|
+
identity: undefined;
|
|
193
|
+
generated: undefined;
|
|
194
|
+
}, {}, {
|
|
195
|
+
length: number | undefined;
|
|
196
|
+
}>;
|
|
197
|
+
};
|
|
198
|
+
dialect: 'sqlite';
|
|
199
|
+
}>;
|
|
200
|
+
/** A comment row. */
|
|
201
|
+
interface Comment {
|
|
202
|
+
id: string;
|
|
203
|
+
projectId: string;
|
|
204
|
+
buildId: string;
|
|
205
|
+
snapshotId: string | null;
|
|
206
|
+
userId: string | null;
|
|
207
|
+
body: string;
|
|
208
|
+
parentId: string | null;
|
|
209
|
+
resolved: boolean;
|
|
210
|
+
createdAt: string;
|
|
211
|
+
updatedAt: string;
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
214
|
+
export { Comment, comments };
|
|
215
|
+
//# sourceMappingURL=comment.d.mts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { snapshots } from "./snapshot.mjs";
|
|
7
|
+
import { users } from "./user.mjs";
|
|
8
|
+
import { index, integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
9
|
+
//#region src/schema/comment.ts
|
|
10
|
+
/** Narrow `comments` table definition. */
|
|
11
|
+
const comments = sqliteTable("comments", {
|
|
12
|
+
id: text("id").primaryKey(),
|
|
13
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
14
|
+
buildId: text("build_id").notNull().references(() => builds.id, { onDelete: "cascade" }),
|
|
15
|
+
snapshotId: text("snapshot_id").references(() => snapshots.id, { onDelete: "cascade" }),
|
|
16
|
+
userId: text("user_id").references(() => users.id, { onDelete: "cascade" }),
|
|
17
|
+
body: text("body").notNull(),
|
|
18
|
+
parentId: text("parent_id"),
|
|
19
|
+
resolved: integer("resolved", { mode: "boolean" }).notNull().default(false),
|
|
20
|
+
createdAt: text("created_at").notNull(),
|
|
21
|
+
updatedAt: text("updated_at").notNull()
|
|
22
|
+
}, (t) => [index("comments_build_id_idx").on(t.buildId)]);
|
|
23
|
+
//#endregion
|
|
24
|
+
export { comments };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=comment.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment.mjs","names":[],"sources":["../../src/schema/comment.ts"],"sourcesContent":["import { index, integer, sqliteTable, text } from \"drizzle-orm/sqlite-core\";\nimport { builds } from \"./build.ts\";\nimport { projects } from \"./project.ts\";\nimport { snapshots } from \"./snapshot.ts\";\nimport { users } from \"./user.ts\";\n\n/** Narrow `comments` table definition. */\nexport const comments = sqliteTable(\n \"comments\",\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 snapshotId: text(\"snapshot_id\").references(() => snapshots.id, { onDelete: \"cascade\" }),\n userId: text(\"user_id\").references(() => users.id, { onDelete: \"cascade\" }),\n body: text(\"body\").notNull(),\n parentId: text(\"parent_id\"),\n resolved: integer(\"resolved\", { mode: \"boolean\" }).notNull().default(false),\n createdAt: text(\"created_at\").notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n },\n (t) => [index(\"comments_build_id_idx\").on(t.buildId)],\n);\n\n/** A comment row. */\nexport interface Comment {\n id: string;\n projectId: string;\n buildId: string;\n snapshotId: string | null;\n userId: string | null;\n body: string;\n parentId: string | null;\n resolved: boolean;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;;;;AAOA,MAAa,WAAW,YACtB,YACA;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,YAAY,KAAK,aAAa,CAAC,CAAC,iBAAiB,UAAU,IAAI,EAAE,UAAU,UAAU,CAAC;CACtF,QAAQ,KAAK,SAAS,CAAC,CAAC,iBAAiB,MAAM,IAAI,EAAE,UAAU,UAAU,CAAC;CAC1E,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,UAAU,KAAK,WAAW;CAC1B,UAAU,QAAQ,YAAY,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CAC1E,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,IACC,MAAM,CAAC,MAAM,uBAAuB,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CACtD"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/schema/content-refs.d.ts
|
|
4
|
+
/** Content-addressed storage refs for deduplicated Storybook assets. */
|
|
5
|
+
declare const contentRefs: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
6
|
+
name: "content_refs";
|
|
7
|
+
schema: undefined;
|
|
8
|
+
columns: {
|
|
9
|
+
hash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
10
|
+
name: "hash";
|
|
11
|
+
tableName: "content_refs";
|
|
12
|
+
dataType: "string";
|
|
13
|
+
columnType: "SQLiteText";
|
|
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
|
+
length: number | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
refCount: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
29
|
+
name: "ref_count";
|
|
30
|
+
tableName: "content_refs";
|
|
31
|
+
dataType: "number";
|
|
32
|
+
columnType: "SQLiteInteger";
|
|
33
|
+
data: number;
|
|
34
|
+
driverParam: number;
|
|
35
|
+
notNull: true;
|
|
36
|
+
hasDefault: true;
|
|
37
|
+
isPrimaryKey: false;
|
|
38
|
+
isAutoincrement: false;
|
|
39
|
+
hasRuntimeDefault: false;
|
|
40
|
+
enumValues: undefined;
|
|
41
|
+
baseColumn: never;
|
|
42
|
+
identity: undefined;
|
|
43
|
+
generated: undefined;
|
|
44
|
+
}, {}, {}>;
|
|
45
|
+
lastSeenAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
46
|
+
name: "last_seen_at";
|
|
47
|
+
tableName: "content_refs";
|
|
48
|
+
dataType: "string";
|
|
49
|
+
columnType: "SQLiteText";
|
|
50
|
+
data: string;
|
|
51
|
+
driverParam: string;
|
|
52
|
+
notNull: true;
|
|
53
|
+
hasDefault: false;
|
|
54
|
+
isPrimaryKey: false;
|
|
55
|
+
isAutoincrement: false;
|
|
56
|
+
hasRuntimeDefault: false;
|
|
57
|
+
enumValues: [string, ...string[]];
|
|
58
|
+
baseColumn: never;
|
|
59
|
+
identity: undefined;
|
|
60
|
+
generated: undefined;
|
|
61
|
+
}, {}, {
|
|
62
|
+
length: number | undefined;
|
|
63
|
+
}>;
|
|
64
|
+
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
65
|
+
name: "created_at";
|
|
66
|
+
tableName: "content_refs";
|
|
67
|
+
dataType: "string";
|
|
68
|
+
columnType: "SQLiteText";
|
|
69
|
+
data: string;
|
|
70
|
+
driverParam: string;
|
|
71
|
+
notNull: true;
|
|
72
|
+
hasDefault: false;
|
|
73
|
+
isPrimaryKey: false;
|
|
74
|
+
isAutoincrement: false;
|
|
75
|
+
hasRuntimeDefault: false;
|
|
76
|
+
enumValues: [string, ...string[]];
|
|
77
|
+
baseColumn: never;
|
|
78
|
+
identity: undefined;
|
|
79
|
+
generated: undefined;
|
|
80
|
+
}, {}, {
|
|
81
|
+
length: number | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
};
|
|
84
|
+
dialect: 'sqlite';
|
|
85
|
+
}>;
|
|
86
|
+
/** Content ref row. */
|
|
87
|
+
interface ContentRef {
|
|
88
|
+
hash: string;
|
|
89
|
+
refCount: number;
|
|
90
|
+
lastSeenAt: string;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
export { ContentRef, contentRefs };
|
|
95
|
+
//# sourceMappingURL=content-refs.d.mts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
5
|
+
//#region src/schema/content-refs.ts
|
|
6
|
+
/** Content-addressed storage refs for deduplicated Storybook assets. */
|
|
7
|
+
const contentRefs = sqliteTable("content_refs", {
|
|
8
|
+
hash: text("hash").primaryKey(),
|
|
9
|
+
refCount: integer("ref_count").notNull().default(1),
|
|
10
|
+
lastSeenAt: text("last_seen_at").notNull(),
|
|
11
|
+
createdAt: text("created_at").notNull()
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { contentRefs };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=content-refs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-refs.mjs","names":[],"sources":["../../src/schema/content-refs.ts"],"sourcesContent":["import { integer, sqliteTable, text } from \"drizzle-orm/sqlite-core\";\n\n/** Content-addressed storage refs for deduplicated Storybook assets. */\nexport const contentRefs = sqliteTable(\"content_refs\", {\n hash: text(\"hash\").primaryKey(),\n refCount: integer(\"ref_count\").notNull().default(1),\n lastSeenAt: text(\"last_seen_at\").notNull(),\n createdAt: text(\"created_at\").notNull(),\n});\n\n/** Content ref row. */\nexport interface ContentRef {\n hash: string;\n refCount: number;\n lastSeenAt: string;\n createdAt: string;\n}\n"],"mappings":";;;;;;AAGA,MAAa,cAAc,YAAY,gBAAgB;CACrD,MAAM,KAAK,MAAM,CAAC,CAAC,WAAW;CAC9B,UAAU,QAAQ,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAClD,YAAY,KAAK,cAAc,CAAC,CAAC,QAAQ;CACzC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,CAAC"}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/schema/label.d.ts
|
|
4
|
+
/** Narrow `label_types` table definition. */
|
|
5
|
+
declare const labelTypes: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
6
|
+
name: "label_types";
|
|
7
|
+
schema: undefined;
|
|
8
|
+
columns: {
|
|
9
|
+
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
10
|
+
name: "id";
|
|
11
|
+
tableName: "label_types";
|
|
12
|
+
dataType: "string";
|
|
13
|
+
columnType: "SQLiteText";
|
|
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
|
+
length: number | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
29
|
+
name: "project_id";
|
|
30
|
+
tableName: "label_types";
|
|
31
|
+
dataType: "string";
|
|
32
|
+
columnType: "SQLiteText";
|
|
33
|
+
data: string;
|
|
34
|
+
driverParam: string;
|
|
35
|
+
notNull: true;
|
|
36
|
+
hasDefault: false;
|
|
37
|
+
isPrimaryKey: false;
|
|
38
|
+
isAutoincrement: false;
|
|
39
|
+
hasRuntimeDefault: false;
|
|
40
|
+
enumValues: [string, ...string[]];
|
|
41
|
+
baseColumn: never;
|
|
42
|
+
identity: undefined;
|
|
43
|
+
generated: undefined;
|
|
44
|
+
}, {}, {
|
|
45
|
+
length: number | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
key: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
48
|
+
name: "key";
|
|
49
|
+
tableName: "label_types";
|
|
50
|
+
dataType: "string";
|
|
51
|
+
columnType: "SQLiteText";
|
|
52
|
+
data: string;
|
|
53
|
+
driverParam: string;
|
|
54
|
+
notNull: true;
|
|
55
|
+
hasDefault: false;
|
|
56
|
+
isPrimaryKey: false;
|
|
57
|
+
isAutoincrement: false;
|
|
58
|
+
hasRuntimeDefault: false;
|
|
59
|
+
enumValues: [string, ...string[]];
|
|
60
|
+
baseColumn: never;
|
|
61
|
+
identity: undefined;
|
|
62
|
+
generated: undefined;
|
|
63
|
+
}, {}, {
|
|
64
|
+
length: number | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
name: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
67
|
+
name: "name";
|
|
68
|
+
tableName: "label_types";
|
|
69
|
+
dataType: "string";
|
|
70
|
+
columnType: "SQLiteText";
|
|
71
|
+
data: string;
|
|
72
|
+
driverParam: string;
|
|
73
|
+
notNull: true;
|
|
74
|
+
hasDefault: false;
|
|
75
|
+
isPrimaryKey: false;
|
|
76
|
+
isAutoincrement: false;
|
|
77
|
+
hasRuntimeDefault: false;
|
|
78
|
+
enumValues: [string, ...string[]];
|
|
79
|
+
baseColumn: never;
|
|
80
|
+
identity: undefined;
|
|
81
|
+
generated: undefined;
|
|
82
|
+
}, {}, {
|
|
83
|
+
length: number | undefined;
|
|
84
|
+
}>;
|
|
85
|
+
linkTemplate: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
86
|
+
name: "link_template";
|
|
87
|
+
tableName: "label_types";
|
|
88
|
+
dataType: "string";
|
|
89
|
+
columnType: "SQLiteText";
|
|
90
|
+
data: string;
|
|
91
|
+
driverParam: string;
|
|
92
|
+
notNull: false;
|
|
93
|
+
hasDefault: false;
|
|
94
|
+
isPrimaryKey: false;
|
|
95
|
+
isAutoincrement: false;
|
|
96
|
+
hasRuntimeDefault: false;
|
|
97
|
+
enumValues: [string, ...string[]];
|
|
98
|
+
baseColumn: never;
|
|
99
|
+
identity: undefined;
|
|
100
|
+
generated: undefined;
|
|
101
|
+
}, {}, {
|
|
102
|
+
length: number | undefined;
|
|
103
|
+
}>;
|
|
104
|
+
color: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
105
|
+
name: "color";
|
|
106
|
+
tableName: "label_types";
|
|
107
|
+
dataType: "string";
|
|
108
|
+
columnType: "SQLiteText";
|
|
109
|
+
data: string;
|
|
110
|
+
driverParam: string;
|
|
111
|
+
notNull: false;
|
|
112
|
+
hasDefault: false;
|
|
113
|
+
isPrimaryKey: false;
|
|
114
|
+
isAutoincrement: false;
|
|
115
|
+
hasRuntimeDefault: false;
|
|
116
|
+
enumValues: [string, ...string[]];
|
|
117
|
+
baseColumn: never;
|
|
118
|
+
identity: undefined;
|
|
119
|
+
generated: undefined;
|
|
120
|
+
}, {}, {
|
|
121
|
+
length: number | undefined;
|
|
122
|
+
}>;
|
|
123
|
+
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
124
|
+
name: "created_at";
|
|
125
|
+
tableName: "label_types";
|
|
126
|
+
dataType: "string";
|
|
127
|
+
columnType: "SQLiteText";
|
|
128
|
+
data: string;
|
|
129
|
+
driverParam: string;
|
|
130
|
+
notNull: true;
|
|
131
|
+
hasDefault: false;
|
|
132
|
+
isPrimaryKey: false;
|
|
133
|
+
isAutoincrement: false;
|
|
134
|
+
hasRuntimeDefault: false;
|
|
135
|
+
enumValues: [string, ...string[]];
|
|
136
|
+
baseColumn: never;
|
|
137
|
+
identity: undefined;
|
|
138
|
+
generated: undefined;
|
|
139
|
+
}, {}, {
|
|
140
|
+
length: number | undefined;
|
|
141
|
+
}>;
|
|
142
|
+
};
|
|
143
|
+
dialect: 'sqlite';
|
|
144
|
+
}>;
|
|
145
|
+
/** Narrow `build_labels` table definition. */
|
|
146
|
+
declare const buildLabels: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
147
|
+
name: "build_labels";
|
|
148
|
+
schema: undefined;
|
|
149
|
+
columns: {
|
|
150
|
+
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
151
|
+
name: "id";
|
|
152
|
+
tableName: "build_labels";
|
|
153
|
+
dataType: "string";
|
|
154
|
+
columnType: "SQLiteText";
|
|
155
|
+
data: string;
|
|
156
|
+
driverParam: string;
|
|
157
|
+
notNull: true;
|
|
158
|
+
hasDefault: false;
|
|
159
|
+
isPrimaryKey: true;
|
|
160
|
+
isAutoincrement: false;
|
|
161
|
+
hasRuntimeDefault: false;
|
|
162
|
+
enumValues: [string, ...string[]];
|
|
163
|
+
baseColumn: never;
|
|
164
|
+
identity: undefined;
|
|
165
|
+
generated: undefined;
|
|
166
|
+
}, {}, {
|
|
167
|
+
length: number | undefined;
|
|
168
|
+
}>;
|
|
169
|
+
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
170
|
+
name: "project_id";
|
|
171
|
+
tableName: "build_labels";
|
|
172
|
+
dataType: "string";
|
|
173
|
+
columnType: "SQLiteText";
|
|
174
|
+
data: string;
|
|
175
|
+
driverParam: string;
|
|
176
|
+
notNull: true;
|
|
177
|
+
hasDefault: false;
|
|
178
|
+
isPrimaryKey: false;
|
|
179
|
+
isAutoincrement: false;
|
|
180
|
+
hasRuntimeDefault: false;
|
|
181
|
+
enumValues: [string, ...string[]];
|
|
182
|
+
baseColumn: never;
|
|
183
|
+
identity: undefined;
|
|
184
|
+
generated: undefined;
|
|
185
|
+
}, {}, {
|
|
186
|
+
length: number | undefined;
|
|
187
|
+
}>;
|
|
188
|
+
buildId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
189
|
+
name: "build_id";
|
|
190
|
+
tableName: "build_labels";
|
|
191
|
+
dataType: "string";
|
|
192
|
+
columnType: "SQLiteText";
|
|
193
|
+
data: string;
|
|
194
|
+
driverParam: string;
|
|
195
|
+
notNull: true;
|
|
196
|
+
hasDefault: false;
|
|
197
|
+
isPrimaryKey: false;
|
|
198
|
+
isAutoincrement: false;
|
|
199
|
+
hasRuntimeDefault: false;
|
|
200
|
+
enumValues: [string, ...string[]];
|
|
201
|
+
baseColumn: never;
|
|
202
|
+
identity: undefined;
|
|
203
|
+
generated: undefined;
|
|
204
|
+
}, {}, {
|
|
205
|
+
length: number | undefined;
|
|
206
|
+
}>;
|
|
207
|
+
typeKey: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
208
|
+
name: "type_key";
|
|
209
|
+
tableName: "build_labels";
|
|
210
|
+
dataType: "string";
|
|
211
|
+
columnType: "SQLiteText";
|
|
212
|
+
data: string;
|
|
213
|
+
driverParam: string;
|
|
214
|
+
notNull: true;
|
|
215
|
+
hasDefault: false;
|
|
216
|
+
isPrimaryKey: false;
|
|
217
|
+
isAutoincrement: false;
|
|
218
|
+
hasRuntimeDefault: false;
|
|
219
|
+
enumValues: [string, ...string[]];
|
|
220
|
+
baseColumn: never;
|
|
221
|
+
identity: undefined;
|
|
222
|
+
generated: undefined;
|
|
223
|
+
}, {}, {
|
|
224
|
+
length: number | undefined;
|
|
225
|
+
}>;
|
|
226
|
+
value: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
227
|
+
name: "value";
|
|
228
|
+
tableName: "build_labels";
|
|
229
|
+
dataType: "string";
|
|
230
|
+
columnType: "SQLiteText";
|
|
231
|
+
data: string;
|
|
232
|
+
driverParam: string;
|
|
233
|
+
notNull: true;
|
|
234
|
+
hasDefault: false;
|
|
235
|
+
isPrimaryKey: false;
|
|
236
|
+
isAutoincrement: false;
|
|
237
|
+
hasRuntimeDefault: false;
|
|
238
|
+
enumValues: [string, ...string[]];
|
|
239
|
+
baseColumn: never;
|
|
240
|
+
identity: undefined;
|
|
241
|
+
generated: undefined;
|
|
242
|
+
}, {}, {
|
|
243
|
+
length: number | undefined;
|
|
244
|
+
}>;
|
|
245
|
+
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
246
|
+
name: "created_at";
|
|
247
|
+
tableName: "build_labels";
|
|
248
|
+
dataType: "string";
|
|
249
|
+
columnType: "SQLiteText";
|
|
250
|
+
data: string;
|
|
251
|
+
driverParam: string;
|
|
252
|
+
notNull: true;
|
|
253
|
+
hasDefault: false;
|
|
254
|
+
isPrimaryKey: false;
|
|
255
|
+
isAutoincrement: false;
|
|
256
|
+
hasRuntimeDefault: false;
|
|
257
|
+
enumValues: [string, ...string[]];
|
|
258
|
+
baseColumn: never;
|
|
259
|
+
identity: undefined;
|
|
260
|
+
generated: undefined;
|
|
261
|
+
}, {}, {
|
|
262
|
+
length: number | undefined;
|
|
263
|
+
}>;
|
|
264
|
+
};
|
|
265
|
+
dialect: 'sqlite';
|
|
266
|
+
}>;
|
|
267
|
+
/** A label-type row. */
|
|
268
|
+
interface LabelType {
|
|
269
|
+
id: string;
|
|
270
|
+
projectId: string;
|
|
271
|
+
key: string;
|
|
272
|
+
name: string;
|
|
273
|
+
linkTemplate: string | null;
|
|
274
|
+
color: string | null;
|
|
275
|
+
createdAt: string;
|
|
276
|
+
}
|
|
277
|
+
/** A build-label row. */
|
|
278
|
+
interface BuildLabel {
|
|
279
|
+
id: string;
|
|
280
|
+
projectId: string;
|
|
281
|
+
buildId: string;
|
|
282
|
+
typeKey: string;
|
|
283
|
+
value: string;
|
|
284
|
+
createdAt: string;
|
|
285
|
+
}
|
|
286
|
+
//#endregion
|
|
287
|
+
export { BuildLabel, LabelType, buildLabels, labelTypes };
|
|
288
|
+
//# sourceMappingURL=label.d.mts.map
|
|
@@ -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"}
|