@storyshelf/db-sqlite 0.3.2 → 0.5.4

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 (73) hide show
  1. package/README.md +29 -3
  2. package/dist/better-sqlite3.d.mts +29 -0
  3. package/dist/better-sqlite3.mjs +116 -0
  4. package/dist/better-sqlite3.mjs.map +1 -0
  5. package/dist/bun-sqlite.d.mts +30 -0
  6. package/dist/bun-sqlite.mjs +120 -0
  7. package/dist/bun-sqlite.mjs.map +1 -0
  8. package/dist/d1.d.mts +38 -0
  9. package/dist/d1.mjs +108 -0
  10. package/dist/d1.mjs.map +1 -0
  11. package/dist/ddl.d.mts +14 -0
  12. package/dist/ddl.mjs +342 -0
  13. package/dist/ddl.mjs.map +1 -0
  14. package/dist/drizzle-factory.d.mts +19 -0
  15. package/dist/drizzle-factory.mjs +121 -0
  16. package/dist/drizzle-factory.mjs.map +1 -0
  17. package/dist/index.mjs +102 -36
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/schema/baseline.d.mts +204 -0
  20. package/dist/schema/baseline.mjs +23 -0
  21. package/dist/schema/baseline.mjs.map +1 -0
  22. package/dist/schema/build.d.mts +405 -0
  23. package/dist/schema/build.mjs +33 -0
  24. package/dist/schema/build.mjs.map +1 -0
  25. package/dist/schema/capture-attempt.d.mts +482 -0
  26. package/dist/schema/capture-attempt.mjs +40 -0
  27. package/dist/schema/capture-attempt.mjs.map +1 -0
  28. package/dist/schema/comment.d.mts +215 -0
  29. package/dist/schema/comment.mjs +26 -0
  30. package/dist/schema/comment.mjs.map +1 -0
  31. package/dist/schema/content-refs.d.mts +95 -0
  32. package/dist/schema/content-refs.mjs +16 -0
  33. package/dist/schema/content-refs.mjs.map +1 -0
  34. package/dist/schema/label.d.mts +288 -0
  35. package/dist/schema/label.mjs +30 -0
  36. package/dist/schema/label.mjs.map +1 -0
  37. package/dist/schema/member.d.mts +140 -0
  38. package/dist/schema/member.mjs +20 -0
  39. package/dist/schema/member.mjs.map +1 -0
  40. package/dist/schema/notification.d.mts +344 -0
  41. package/dist/schema/notification.mjs +33 -0
  42. package/dist/schema/notification.mjs.map +1 -0
  43. package/dist/schema/project-group-mapping.d.mts +119 -0
  44. package/dist/schema/project-group-mapping.mjs +18 -0
  45. package/dist/schema/project-group-mapping.mjs.map +1 -0
  46. package/dist/schema/project.d.mts +358 -0
  47. package/dist/schema/project.mjs +29 -0
  48. package/dist/schema/project.mjs.map +1 -0
  49. package/dist/schema/snapshot.d.mts +487 -0
  50. package/dist/schema/snapshot.mjs +38 -0
  51. package/dist/schema/snapshot.mjs.map +1 -0
  52. package/dist/schema/status-config.d.mts +157 -0
  53. package/dist/schema/status-config.mjs +20 -0
  54. package/dist/schema/status-config.mjs.map +1 -0
  55. package/dist/schema/token.d.mts +157 -0
  56. package/dist/schema/token.mjs +21 -0
  57. package/dist/schema/token.mjs.map +1 -0
  58. package/dist/schema/user-invite.d.mts +137 -0
  59. package/dist/schema/user-invite.mjs +19 -0
  60. package/dist/schema/user-invite.mjs.map +1 -0
  61. package/dist/schema/user.d.mts +238 -0
  62. package/dist/schema/user.mjs +23 -0
  63. package/dist/schema/user.mjs.map +1 -0
  64. package/dist/schema/webhook.d.mts +157 -0
  65. package/dist/schema/webhook.mjs +20 -0
  66. package/dist/schema/webhook.mjs.map +1 -0
  67. package/dist/schema.d.mts +47 -0
  68. package/dist/schema.mjs +46 -0
  69. package/dist/schema.mjs.map +1 -0
  70. package/dist/turso.d.mts +32 -0
  71. package/dist/turso.mjs +134 -0
  72. package/dist/turso.mjs.map +1 -0
  73. package/package.json +66 -10
@@ -0,0 +1,140 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ProjectRole } from "@storyshelf/core/types";
4
+ //#region src/schema/member.d.ts
5
+ /** Narrow `project_members` table definition. */
6
+ declare const projectMembers: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
7
+ name: "project_members";
8
+ schema: undefined;
9
+ columns: {
10
+ id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
11
+ name: "id";
12
+ tableName: "project_members";
13
+ dataType: "string";
14
+ columnType: "SQLiteText";
15
+ data: string;
16
+ driverParam: string;
17
+ notNull: true;
18
+ hasDefault: false;
19
+ isPrimaryKey: true;
20
+ isAutoincrement: false;
21
+ hasRuntimeDefault: false;
22
+ enumValues: [string, ...string[]];
23
+ baseColumn: never;
24
+ identity: undefined;
25
+ generated: undefined;
26
+ }, {}, {
27
+ length: number | undefined;
28
+ }>;
29
+ projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
30
+ name: "project_id";
31
+ tableName: "project_members";
32
+ dataType: "string";
33
+ columnType: "SQLiteText";
34
+ data: string;
35
+ driverParam: string;
36
+ notNull: true;
37
+ hasDefault: false;
38
+ isPrimaryKey: false;
39
+ isAutoincrement: false;
40
+ hasRuntimeDefault: false;
41
+ enumValues: [string, ...string[]];
42
+ baseColumn: never;
43
+ identity: undefined;
44
+ generated: undefined;
45
+ }, {}, {
46
+ length: number | undefined;
47
+ }>;
48
+ userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
49
+ name: "user_id";
50
+ tableName: "project_members";
51
+ dataType: "string";
52
+ columnType: "SQLiteText";
53
+ data: string;
54
+ driverParam: string;
55
+ notNull: true;
56
+ hasDefault: false;
57
+ isPrimaryKey: false;
58
+ isAutoincrement: false;
59
+ hasRuntimeDefault: false;
60
+ enumValues: [string, ...string[]];
61
+ baseColumn: never;
62
+ identity: undefined;
63
+ generated: undefined;
64
+ }, {}, {
65
+ length: number | undefined;
66
+ }>;
67
+ role: import("drizzle-orm/sqlite-core").SQLiteColumn<{
68
+ name: "role";
69
+ tableName: "project_members";
70
+ dataType: "string";
71
+ columnType: "SQLiteText";
72
+ data: "admin" | "approver" | "developer" | "viewer";
73
+ driverParam: string;
74
+ notNull: true;
75
+ hasDefault: true;
76
+ isPrimaryKey: false;
77
+ isAutoincrement: false;
78
+ hasRuntimeDefault: false;
79
+ enumValues: [string, ...string[]];
80
+ baseColumn: never;
81
+ identity: undefined;
82
+ generated: undefined;
83
+ }, {}, {
84
+ length: number | undefined;
85
+ $type: "admin" | "approver" | "developer" | "viewer";
86
+ }>;
87
+ source: import("drizzle-orm/sqlite-core").SQLiteColumn<{
88
+ name: "source";
89
+ tableName: "project_members";
90
+ dataType: "string";
91
+ columnType: "SQLiteText";
92
+ data: string;
93
+ driverParam: string;
94
+ notNull: true;
95
+ hasDefault: true;
96
+ isPrimaryKey: false;
97
+ isAutoincrement: false;
98
+ hasRuntimeDefault: false;
99
+ enumValues: [string, ...string[]];
100
+ baseColumn: never;
101
+ identity: undefined;
102
+ generated: undefined;
103
+ }, {}, {
104
+ length: number | undefined;
105
+ }>;
106
+ createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
107
+ name: "created_at";
108
+ tableName: "project_members";
109
+ dataType: "string";
110
+ columnType: "SQLiteText";
111
+ data: string;
112
+ driverParam: string;
113
+ notNull: true;
114
+ hasDefault: false;
115
+ isPrimaryKey: false;
116
+ isAutoincrement: false;
117
+ hasRuntimeDefault: false;
118
+ enumValues: [string, ...string[]];
119
+ baseColumn: never;
120
+ identity: undefined;
121
+ generated: undefined;
122
+ }, {}, {
123
+ length: number | undefined;
124
+ }>;
125
+ };
126
+ dialect: 'sqlite';
127
+ }>;
128
+ /** A project-membership row. */
129
+ interface ProjectMember {
130
+ id: string;
131
+ projectId: string;
132
+ userId: string;
133
+ role: ProjectRole;
134
+ /** Provenance: `manual` grants vs `oidc:<group>` synced grants. */
135
+ source: string;
136
+ createdAt: string;
137
+ }
138
+ //#endregion
139
+ export { ProjectMember, projectMembers };
140
+ //# sourceMappingURL=member.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 { 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
+ source: text("source").notNull().default("manual"),
15
+ createdAt: text("created_at").notNull()
16
+ }, (t) => [uniqueIndex("project_members_project_user_idx").on(t.projectId, t.userId)]);
17
+ //#endregion
18
+ export { projectMembers };
19
+
20
+ //# sourceMappingURL=member.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member.mjs","names":[],"sources":["../../src/schema/member.ts"],"sourcesContent":["import type { ProjectRole } from \"@storyshelf/core/types\";\nimport { sqliteTable, text, uniqueIndex } from \"drizzle-orm/sqlite-core\";\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 source: text(\"source\").notNull().default(\"manual\"),\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 /** Provenance: `manual` grants vs `oidc:<group>` synced grants. */\n source: string;\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,QAAQ,KAAK,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,QAAQ;CACjD,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,IACC,MAAM,CAAC,YAAY,kCAAkC,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,CAAC,CACnF"}
@@ -0,0 +1,344 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ //#region src/schema/notification.d.ts
4
+ /** Narrow `notification_channels` table definition. */
5
+ declare const notificationChannels: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
6
+ name: "notification_channels";
7
+ schema: undefined;
8
+ columns: {
9
+ id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
10
+ name: "id";
11
+ tableName: "notification_channels";
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: "notification_channels";
31
+ dataType: "string";
32
+ columnType: "SQLiteText";
33
+ data: string;
34
+ driverParam: string;
35
+ notNull: false;
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
+ provider: import("drizzle-orm/sqlite-core").SQLiteColumn<{
48
+ name: "provider";
49
+ tableName: "notification_channels";
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
+ config: import("drizzle-orm/sqlite-core").SQLiteColumn<{
67
+ name: "config";
68
+ tableName: "notification_channels";
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
+ secretEncrypted: import("drizzle-orm/sqlite-core").SQLiteColumn<{
86
+ name: "secret_encrypted";
87
+ tableName: "notification_channels";
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
+ events: import("drizzle-orm/sqlite-core").SQLiteColumn<{
105
+ name: "events";
106
+ tableName: "notification_channels";
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
+ enabled: import("drizzle-orm/sqlite-core").SQLiteColumn<{
124
+ name: "enabled";
125
+ tableName: "notification_channels";
126
+ dataType: "boolean";
127
+ columnType: "SQLiteBoolean";
128
+ data: boolean;
129
+ driverParam: number;
130
+ notNull: true;
131
+ hasDefault: true;
132
+ isPrimaryKey: false;
133
+ isAutoincrement: false;
134
+ hasRuntimeDefault: false;
135
+ enumValues: undefined;
136
+ baseColumn: never;
137
+ identity: undefined;
138
+ generated: undefined;
139
+ }, {}, {}>;
140
+ createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
141
+ name: "created_at";
142
+ tableName: "notification_channels";
143
+ dataType: "string";
144
+ columnType: "SQLiteText";
145
+ data: string;
146
+ driverParam: string;
147
+ notNull: true;
148
+ hasDefault: false;
149
+ isPrimaryKey: false;
150
+ isAutoincrement: false;
151
+ hasRuntimeDefault: false;
152
+ enumValues: [string, ...string[]];
153
+ baseColumn: never;
154
+ identity: undefined;
155
+ generated: undefined;
156
+ }, {}, {
157
+ length: number | undefined;
158
+ }>;
159
+ updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
160
+ name: "updated_at";
161
+ tableName: "notification_channels";
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
+ };
179
+ dialect: 'sqlite';
180
+ }>;
181
+ /** Narrow `notification_subscriptions` table definition. */
182
+ declare const notificationSubscriptions: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
183
+ name: "notification_subscriptions";
184
+ schema: undefined;
185
+ columns: {
186
+ id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
187
+ name: "id";
188
+ tableName: "notification_subscriptions";
189
+ dataType: "string";
190
+ columnType: "SQLiteText";
191
+ data: string;
192
+ driverParam: string;
193
+ notNull: true;
194
+ hasDefault: false;
195
+ isPrimaryKey: true;
196
+ isAutoincrement: false;
197
+ hasRuntimeDefault: false;
198
+ enumValues: [string, ...string[]];
199
+ baseColumn: never;
200
+ identity: undefined;
201
+ generated: undefined;
202
+ }, {}, {
203
+ length: number | undefined;
204
+ }>;
205
+ projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
206
+ name: "project_id";
207
+ tableName: "notification_subscriptions";
208
+ dataType: "string";
209
+ columnType: "SQLiteText";
210
+ data: string;
211
+ driverParam: string;
212
+ notNull: true;
213
+ hasDefault: false;
214
+ isPrimaryKey: false;
215
+ isAutoincrement: false;
216
+ hasRuntimeDefault: false;
217
+ enumValues: [string, ...string[]];
218
+ baseColumn: never;
219
+ identity: undefined;
220
+ generated: undefined;
221
+ }, {}, {
222
+ length: number | undefined;
223
+ }>;
224
+ userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
225
+ name: "user_id";
226
+ tableName: "notification_subscriptions";
227
+ dataType: "string";
228
+ columnType: "SQLiteText";
229
+ data: string;
230
+ driverParam: string;
231
+ notNull: true;
232
+ hasDefault: false;
233
+ isPrimaryKey: false;
234
+ isAutoincrement: false;
235
+ hasRuntimeDefault: false;
236
+ enumValues: [string, ...string[]];
237
+ baseColumn: never;
238
+ identity: undefined;
239
+ generated: undefined;
240
+ }, {}, {
241
+ length: number | undefined;
242
+ }>;
243
+ events: import("drizzle-orm/sqlite-core").SQLiteColumn<{
244
+ name: "events";
245
+ tableName: "notification_subscriptions";
246
+ dataType: "string";
247
+ columnType: "SQLiteText";
248
+ data: string;
249
+ driverParam: string;
250
+ notNull: false;
251
+ hasDefault: false;
252
+ isPrimaryKey: false;
253
+ isAutoincrement: false;
254
+ hasRuntimeDefault: false;
255
+ enumValues: [string, ...string[]];
256
+ baseColumn: never;
257
+ identity: undefined;
258
+ generated: undefined;
259
+ }, {}, {
260
+ length: number | undefined;
261
+ }>;
262
+ via: import("drizzle-orm/sqlite-core").SQLiteColumn<{
263
+ name: "via";
264
+ tableName: "notification_subscriptions";
265
+ dataType: "string";
266
+ columnType: "SQLiteText";
267
+ data: string;
268
+ driverParam: string;
269
+ notNull: false;
270
+ hasDefault: false;
271
+ isPrimaryKey: false;
272
+ isAutoincrement: false;
273
+ hasRuntimeDefault: false;
274
+ enumValues: [string, ...string[]];
275
+ baseColumn: never;
276
+ identity: undefined;
277
+ generated: undefined;
278
+ }, {}, {
279
+ length: number | undefined;
280
+ }>;
281
+ enabled: import("drizzle-orm/sqlite-core").SQLiteColumn<{
282
+ name: "enabled";
283
+ tableName: "notification_subscriptions";
284
+ dataType: "boolean";
285
+ columnType: "SQLiteBoolean";
286
+ data: boolean;
287
+ driverParam: number;
288
+ notNull: true;
289
+ hasDefault: true;
290
+ isPrimaryKey: false;
291
+ isAutoincrement: false;
292
+ hasRuntimeDefault: false;
293
+ enumValues: undefined;
294
+ baseColumn: never;
295
+ identity: undefined;
296
+ generated: undefined;
297
+ }, {}, {}>;
298
+ createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
299
+ name: "created_at";
300
+ tableName: "notification_subscriptions";
301
+ dataType: "string";
302
+ columnType: "SQLiteText";
303
+ data: string;
304
+ driverParam: string;
305
+ notNull: true;
306
+ hasDefault: false;
307
+ isPrimaryKey: false;
308
+ isAutoincrement: false;
309
+ hasRuntimeDefault: false;
310
+ enumValues: [string, ...string[]];
311
+ baseColumn: never;
312
+ identity: undefined;
313
+ generated: undefined;
314
+ }, {}, {
315
+ length: number | undefined;
316
+ }>;
317
+ };
318
+ dialect: 'sqlite';
319
+ }>;
320
+ /** A notification channel row. */
321
+ interface NotificationChannel {
322
+ id: string;
323
+ projectId: string | null;
324
+ provider: string;
325
+ config: string;
326
+ secretEncrypted: string | null;
327
+ events: string | null;
328
+ enabled: boolean;
329
+ createdAt: string;
330
+ updatedAt: string;
331
+ }
332
+ /** A per-user notification subscription row. */
333
+ interface NotificationSubscription {
334
+ id: string;
335
+ projectId: string;
336
+ userId: string;
337
+ events: string | null;
338
+ via: string | null;
339
+ enabled: boolean;
340
+ createdAt: string;
341
+ }
342
+ //#endregion
343
+ export { NotificationChannel, NotificationSubscription, notificationChannels, notificationSubscriptions };
344
+ //# sourceMappingURL=notification.d.mts.map
@@ -0,0 +1,33 @@
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 { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
7
+ //#region src/schema/notification.ts
8
+ /** Narrow `notification_channels` table definition. */
9
+ const notificationChannels = sqliteTable("notification_channels", {
10
+ id: text("id").primaryKey(),
11
+ projectId: text("project_id").references(() => projects.id, { onDelete: "cascade" }),
12
+ provider: text("provider").notNull(),
13
+ config: text("config").notNull(),
14
+ secretEncrypted: text("secret_encrypted"),
15
+ events: text("events"),
16
+ enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
17
+ createdAt: text("created_at").notNull(),
18
+ updatedAt: text("updated_at").notNull()
19
+ });
20
+ /** Narrow `notification_subscriptions` table definition. */
21
+ const notificationSubscriptions = sqliteTable("notification_subscriptions", {
22
+ id: text("id").primaryKey(),
23
+ projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
24
+ userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
25
+ events: text("events"),
26
+ via: text("via"),
27
+ enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
28
+ createdAt: text("created_at").notNull()
29
+ });
30
+ //#endregion
31
+ export { notificationChannels, notificationSubscriptions };
32
+
33
+ //# sourceMappingURL=notification.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.mjs","names":[],"sources":["../../src/schema/notification.ts"],"sourcesContent":["import { integer, sqliteTable, text } from \"drizzle-orm/sqlite-core\";\nimport { projects } from \"./project.ts\";\nimport { users } from \"./user.ts\";\n\n/** Narrow `notification_channels` table definition. */\nexport const notificationChannels = sqliteTable(\"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: integer(\"enabled\", { mode: \"boolean\" }).notNull().default(true),\n createdAt: text(\"created_at\").notNull(),\n updatedAt: text(\"updated_at\").notNull(),\n});\n\n/** Narrow `notification_subscriptions` table definition. */\nexport const notificationSubscriptions = sqliteTable(\"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: integer(\"enabled\", { mode: \"boolean\" }).notNull().default(true),\n createdAt: text(\"created_at\").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,YAAY,yBAAyB;CACvE,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,WAAW,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CACvE,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,CAAC;;AAGD,MAAa,4BAA4B,YAAY,8BAA8B;CACjF,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,WAAW,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,IAAI;CACvE,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,CAAC"}
@@ -0,0 +1,119 @@
1
+ import __tsdown_shims_path from 'node:path';
2
+ import __tsdown_shims_url from 'node:url';
3
+ import { ProjectRole } from "@storyshelf/core/types";
4
+ //#region src/schema/project-group-mapping.d.ts
5
+ /** Narrow `project_group_mappings` table definition. */
6
+ declare const projectGroupMappings: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
7
+ name: "project_group_mappings";
8
+ schema: undefined;
9
+ columns: {
10
+ id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
11
+ name: "id";
12
+ tableName: "project_group_mappings";
13
+ dataType: "string";
14
+ columnType: "SQLiteText";
15
+ data: string;
16
+ driverParam: string;
17
+ notNull: true;
18
+ hasDefault: false;
19
+ isPrimaryKey: true;
20
+ isAutoincrement: false;
21
+ hasRuntimeDefault: false;
22
+ enumValues: [string, ...string[]];
23
+ baseColumn: never;
24
+ identity: undefined;
25
+ generated: undefined;
26
+ }, {}, {
27
+ length: number | undefined;
28
+ }>;
29
+ projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
30
+ name: "project_id";
31
+ tableName: "project_group_mappings";
32
+ dataType: "string";
33
+ columnType: "SQLiteText";
34
+ data: string;
35
+ driverParam: string;
36
+ notNull: true;
37
+ hasDefault: false;
38
+ isPrimaryKey: false;
39
+ isAutoincrement: false;
40
+ hasRuntimeDefault: false;
41
+ enumValues: [string, ...string[]];
42
+ baseColumn: never;
43
+ identity: undefined;
44
+ generated: undefined;
45
+ }, {}, {
46
+ length: number | undefined;
47
+ }>;
48
+ groupName: import("drizzle-orm/sqlite-core").SQLiteColumn<{
49
+ name: "group_name";
50
+ tableName: "project_group_mappings";
51
+ dataType: "string";
52
+ columnType: "SQLiteText";
53
+ data: string;
54
+ driverParam: string;
55
+ notNull: true;
56
+ hasDefault: false;
57
+ isPrimaryKey: false;
58
+ isAutoincrement: false;
59
+ hasRuntimeDefault: false;
60
+ enumValues: [string, ...string[]];
61
+ baseColumn: never;
62
+ identity: undefined;
63
+ generated: undefined;
64
+ }, {}, {
65
+ length: number | undefined;
66
+ }>;
67
+ role: import("drizzle-orm/sqlite-core").SQLiteColumn<{
68
+ name: "role";
69
+ tableName: "project_group_mappings";
70
+ dataType: "string";
71
+ columnType: "SQLiteText";
72
+ data: "admin" | "approver" | "developer" | "viewer";
73
+ driverParam: string;
74
+ notNull: true;
75
+ hasDefault: true;
76
+ isPrimaryKey: false;
77
+ isAutoincrement: false;
78
+ hasRuntimeDefault: false;
79
+ enumValues: [string, ...string[]];
80
+ baseColumn: never;
81
+ identity: undefined;
82
+ generated: undefined;
83
+ }, {}, {
84
+ length: number | undefined;
85
+ $type: "admin" | "approver" | "developer" | "viewer";
86
+ }>;
87
+ createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
88
+ name: "created_at";
89
+ tableName: "project_group_mappings";
90
+ dataType: "string";
91
+ columnType: "SQLiteText";
92
+ data: string;
93
+ driverParam: string;
94
+ notNull: true;
95
+ hasDefault: false;
96
+ isPrimaryKey: false;
97
+ isAutoincrement: false;
98
+ hasRuntimeDefault: false;
99
+ enumValues: [string, ...string[]];
100
+ baseColumn: never;
101
+ identity: undefined;
102
+ generated: undefined;
103
+ }, {}, {
104
+ length: number | undefined;
105
+ }>;
106
+ };
107
+ dialect: 'sqlite';
108
+ }>;
109
+ /** An identity-provider group to project-role mapping row. */
110
+ interface ProjectGroupMapping {
111
+ id: string;
112
+ projectId: string;
113
+ groupName: string;
114
+ role: ProjectRole;
115
+ createdAt: string;
116
+ }
117
+ //#endregion
118
+ export { ProjectGroupMapping, projectGroupMappings };
119
+ //# sourceMappingURL=project-group-mapping.d.mts.map
@@ -0,0 +1,18 @@
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ import { projects } from "./project.mjs";
5
+ import { sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
6
+ //#region src/schema/project-group-mapping.ts
7
+ /** Narrow `project_group_mappings` table definition. */
8
+ const projectGroupMappings = sqliteTable("project_group_mappings", {
9
+ id: text("id").primaryKey(),
10
+ projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
11
+ groupName: text("group_name").notNull(),
12
+ role: text("role").$type().notNull().default("viewer"),
13
+ createdAt: text("created_at").notNull()
14
+ }, (t) => [uniqueIndex("project_group_mappings_project_group_idx").on(t.projectId, t.groupName)]);
15
+ //#endregion
16
+ export { projectGroupMappings };
17
+
18
+ //# sourceMappingURL=project-group-mapping.mjs.map