@storyshelf/db-sqlite 0.6.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/better-sqlite3.d.mts +0 -2
- package/dist/better-sqlite3.mjs +8 -4
- package/dist/better-sqlite3.mjs.map +1 -1
- package/dist/bun-sqlite.d.mts +0 -2
- package/dist/bun-sqlite.mjs +8 -4
- package/dist/bun-sqlite.mjs.map +1 -1
- package/dist/d1.d.mts +0 -2
- package/dist/d1.mjs +6 -5
- package/dist/d1.mjs.map +1 -1
- package/dist/ddl.d.mts +10 -4
- package/dist/ddl.mjs +247 -16
- package/dist/ddl.mjs.map +1 -1
- package/dist/drizzle-factory.d.mts +0 -2
- package/dist/drizzle-factory.mjs +6 -3
- package/dist/drizzle-factory.mjs.map +1 -1
- package/dist/ensure-db-dir.mjs +2 -4
- package/dist/ensure-db-dir.mjs.map +1 -1
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +9 -5
- package/dist/index.mjs.map +1 -1
- package/dist/schema/baseline.d.mts +87 -13
- package/dist/schema/baseline.mjs +6 -3
- package/dist/schema/baseline.mjs.map +1 -1
- package/dist/schema/{status-config.d.mts → build-component.d.mts} +41 -36
- package/dist/schema/build-component.mjs +21 -0
- package/dist/schema/build-component.mjs.map +1 -0
- package/dist/schema/build-review.d.mts +127 -0
- package/dist/schema/build-review.mjs +19 -0
- package/dist/schema/build-review.mjs.map +1 -0
- package/dist/schema/build.d.mts +81 -25
- package/dist/schema/build.mjs +5 -2
- package/dist/schema/build.mjs.map +1 -1
- package/dist/schema/capture-attempt.d.mts +25 -27
- package/dist/schema/capture-attempt.mjs +1 -2
- package/dist/schema/capture-job.d.mts +357 -0
- package/dist/schema/capture-job.mjs +37 -0
- package/dist/schema/capture-job.mjs.map +1 -0
- package/dist/schema/capture-shard.d.mts +279 -0
- package/dist/schema/capture-shard.mjs +27 -0
- package/dist/schema/capture-shard.mjs.map +1 -0
- package/dist/schema/comment.d.mts +31 -13
- package/dist/schema/comment.mjs +4 -4
- package/dist/schema/comment.mjs.map +1 -1
- package/dist/schema/connection.d.mts +189 -0
- package/dist/schema/connection.mjs +25 -0
- package/dist/schema/connection.mjs.map +1 -0
- package/dist/schema/content-refs.d.mts +0 -2
- package/dist/schema/content-refs.mjs +1 -2
- package/dist/schema/design.d.mts +647 -0
- package/dist/schema/design.mjs +48 -0
- package/dist/schema/design.mjs.map +1 -0
- package/dist/schema/insight.d.mts +687 -0
- package/dist/schema/insight.mjs +52 -0
- package/dist/schema/insight.mjs.map +1 -0
- package/dist/schema/label.d.mts +15 -17
- package/dist/schema/label.mjs +1 -2
- package/dist/schema/member.d.mts +7 -9
- package/dist/schema/member.mjs +1 -2
- package/dist/schema/notification.d.mts +58 -20
- package/dist/schema/notification.mjs +3 -2
- package/dist/schema/notification.mjs.map +1 -1
- package/dist/schema/project-group-mapping.d.mts +6 -8
- package/dist/schema/project-group-mapping.mjs +1 -2
- package/dist/schema/project.d.mts +132 -2
- package/dist/schema/project.mjs +9 -3
- package/dist/schema/project.mjs.map +1 -1
- package/dist/schema/site-setting.d.mts +107 -0
- package/dist/schema/site-setting.mjs +16 -0
- package/dist/schema/site-setting.mjs.map +1 -0
- package/dist/schema/snapshot.d.mts +203 -27
- package/dist/schema/snapshot.mjs +15 -3
- package/dist/schema/snapshot.mjs.map +1 -1
- package/dist/schema/token.d.mts +8 -10
- package/dist/schema/token.mjs +1 -2
- package/dist/schema/usage.d.mts +291 -0
- package/dist/schema/usage.mjs +29 -0
- package/dist/schema/usage.mjs.map +1 -0
- package/dist/schema/user-invite.d.mts +7 -9
- package/dist/schema/user-invite.mjs +1 -2
- package/dist/schema/user.d.mts +0 -2
- package/dist/schema/user.mjs +1 -2
- package/dist/schema/webhook.d.mts +8 -10
- package/dist/schema/webhook.mjs +1 -2
- package/dist/schema.d.mts +24 -5
- package/dist/schema.mjs +26 -6
- package/dist/schema.mjs.map +1 -1
- package/dist/turso.d.mts +2 -4
- package/dist/turso.mjs +20 -8
- package/dist/turso.mjs.map +1 -1
- package/package.json +7 -7
- package/dist/schema/status-config.mjs +0 -20
- package/dist/schema/status-config.mjs.map +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
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 { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
7
|
+
// src/schema/insight.ts
|
|
8
|
+
/** Narrow `insights` table definition (build triage and project health results). */
|
|
9
|
+
const insights = sqliteTable("insights", {
|
|
10
|
+
id: text("id").primaryKey(),
|
|
11
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
12
|
+
buildId: text("build_id").references(() => builds.id, { onDelete: "cascade" }),
|
|
13
|
+
kind: text("kind").notNull(),
|
|
14
|
+
windowKey: text("window_key"),
|
|
15
|
+
inputHash: text("input_hash").notNull(),
|
|
16
|
+
status: text("status").notNull(),
|
|
17
|
+
profile: text("profile").notNull(),
|
|
18
|
+
model: text("model").notNull(),
|
|
19
|
+
promptVersion: text("prompt_version").notNull(),
|
|
20
|
+
verdict: text("verdict"),
|
|
21
|
+
summary: text("summary"),
|
|
22
|
+
result: text("result"),
|
|
23
|
+
errorCode: text("error_code"),
|
|
24
|
+
createdAt: text("created_at").notNull(),
|
|
25
|
+
startedAt: text("started_at"),
|
|
26
|
+
finishedAt: text("finished_at")
|
|
27
|
+
});
|
|
28
|
+
/** Narrow `ai_usage` table definition (provider-reported usage; survives build purge). */
|
|
29
|
+
const aiUsage = sqliteTable("ai_usage", {
|
|
30
|
+
id: text("id").primaryKey(),
|
|
31
|
+
insightId: text("insight_id"),
|
|
32
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
33
|
+
profile: text("profile").notNull(),
|
|
34
|
+
task: text("task").notNull(),
|
|
35
|
+
model: text("model").notNull(),
|
|
36
|
+
inputTokens: integer("input_tokens").notNull().default(0),
|
|
37
|
+
outputTokens: integer("output_tokens").notNull().default(0),
|
|
38
|
+
estimated: integer("estimated", { mode: "boolean" }).notNull().default(false),
|
|
39
|
+
images: integer("images").notNull().default(0),
|
|
40
|
+
status: text("status").notNull(),
|
|
41
|
+
createdAt: text("created_at").notNull()
|
|
42
|
+
});
|
|
43
|
+
/** Narrow `ai_budget_alerts` table definition (primary key `${day}:${threshold}` is the claim). */
|
|
44
|
+
const aiBudgetAlerts = sqliteTable("ai_budget_alerts", {
|
|
45
|
+
id: text("id").primaryKey(),
|
|
46
|
+
day: text("day").notNull(),
|
|
47
|
+
threshold: integer("threshold").notNull(),
|
|
48
|
+
createdAt: text("created_at").notNull()
|
|
49
|
+
});
|
|
50
|
+
export { aiBudgetAlerts, aiUsage, insights };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=insight.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insight.mjs","names":[],"sources":["../../src/schema/insight.ts"],"sourcesContent":["import { integer, sqliteTable, text } from \"drizzle-orm/sqlite-core\";\nimport { builds } from \"./build.ts\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `insights` table definition (build triage and project health results). */\nexport const insights = sqliteTable(\"insights\", {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n buildId: text(\"build_id\").references(() => builds.id, { onDelete: \"cascade\" }),\n kind: text(\"kind\").notNull(),\n windowKey: text(\"window_key\"),\n inputHash: text(\"input_hash\").notNull(),\n status: text(\"status\").notNull(),\n profile: text(\"profile\").notNull(),\n model: text(\"model\").notNull(),\n promptVersion: text(\"prompt_version\").notNull(),\n verdict: text(\"verdict\"),\n summary: text(\"summary\"),\n result: text(\"result\"),\n errorCode: text(\"error_code\"),\n createdAt: text(\"created_at\").notNull(),\n startedAt: text(\"started_at\"),\n finishedAt: text(\"finished_at\"),\n});\n\n/** Narrow `ai_usage` table definition (provider-reported usage; survives build purge). */\nexport const aiUsage = sqliteTable(\"ai_usage\", {\n id: text(\"id\").primaryKey(),\n insightId: text(\"insight_id\"),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n profile: text(\"profile\").notNull(),\n task: text(\"task\").notNull(),\n model: text(\"model\").notNull(),\n inputTokens: integer(\"input_tokens\").notNull().default(0),\n outputTokens: integer(\"output_tokens\").notNull().default(0),\n estimated: integer(\"estimated\", { mode: \"boolean\" }).notNull().default(false),\n images: integer(\"images\").notNull().default(0),\n status: text(\"status\").notNull(),\n createdAt: text(\"created_at\").notNull(),\n});\n\n/** Narrow `ai_budget_alerts` table definition (primary key `${day}:${threshold}` is the claim). */\nexport const aiBudgetAlerts = sqliteTable(\"ai_budget_alerts\", {\n id: text(\"id\").primaryKey(),\n day: text(\"day\").notNull(),\n threshold: integer(\"threshold\").notNull(),\n createdAt: text(\"created_at\").notNull(),\n});\n\n/** An insight row. */\nexport interface Insight {\n id: string;\n projectId: string;\n buildId: string | null;\n kind: string;\n windowKey: string | null;\n inputHash: string;\n status: string;\n profile: string;\n model: string;\n promptVersion: string;\n verdict: string | null;\n summary: string | null;\n result: string | null;\n errorCode: string | null;\n createdAt: string;\n startedAt: string | null;\n finishedAt: string | null;\n}\n\n/** An AI usage row. */\nexport interface AiUsage {\n id: string;\n insightId: string | null;\n projectId: string;\n profile: string;\n task: string;\n model: string;\n inputTokens: number;\n outputTokens: number;\n estimated: boolean;\n images: number;\n status: string;\n createdAt: string;\n}\n\n/** A budget-threshold alert claim row. */\nexport interface AiBudgetAlert {\n id: string;\n day: string;\n threshold: number;\n createdAt: string;\n}\n"],"mappings":";;;;;;;;AAKA,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,SAAS,KAAK,UAAU,CAAC,CAAC,iBAAiB,OAAO,IAAI,EAAE,UAAU,UAAU,CAAC;CAC7E,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,WAAW,KAAK,YAAY;CAC5B,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,QAAQ,KAAK,QAAQ,CAAC,CAAC,QAAQ;CAC/B,SAAS,KAAK,SAAS,CAAC,CAAC,QAAQ;CACjC,OAAO,KAAK,OAAO,CAAC,CAAC,QAAQ;CAC7B,eAAe,KAAK,gBAAgB,CAAC,CAAC,QAAQ;CAC9C,SAAS,KAAK,SAAS;CACvB,SAAS,KAAK,SAAS;CACvB,QAAQ,KAAK,QAAQ;CACrB,WAAW,KAAK,YAAY;CAC5B,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;CACtC,WAAW,KAAK,YAAY;CAC5B,YAAY,KAAK,aAAa;AAChC,CAAC;;AAGD,MAAa,UAAU,YAAY,YAAY;CAC7C,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY;CAC5B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,SAAS,KAAK,SAAS,CAAC,CAAC,QAAQ;CACjC,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,OAAO,KAAK,OAAO,CAAC,CAAC,QAAQ;CAC7B,aAAa,QAAQ,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CACxD,cAAc,QAAQ,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC1D,WAAW,QAAQ,aAAa,EAAE,MAAM,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,KAAK;CAC5E,QAAQ,QAAQ,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;CAC7C,QAAQ,KAAK,QAAQ,CAAC,CAAC,QAAQ;CAC/B,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,CAAC;;AAGD,MAAa,iBAAiB,YAAY,oBAAoB;CAC5D,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,KAAK,KAAK,KAAK,CAAC,CAAC,QAAQ;CACzB,WAAW,QAAQ,WAAW,CAAC,CAAC,QAAQ;CACxC,WAAW,KAAK,YAAY,CAAC,CAAC,QAAQ;AACxC,CAAC"}
|
package/dist/schema/label.d.mts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
//#region src/schema/label.d.ts
|
|
4
3
|
/** Narrow `label_types` table definition. */
|
|
5
|
-
declare const labelTypes: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
4
|
+
declare const labelTypes: import("drizzle-orm/sqlite-core/table.js").SQLiteTableWithColumns<{
|
|
6
5
|
name: "label_types";
|
|
7
6
|
schema: undefined;
|
|
8
7
|
columns: {
|
|
9
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
8
|
+
id: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
10
9
|
name: "id";
|
|
11
10
|
tableName: "label_types";
|
|
12
11
|
dataType: "string";
|
|
@@ -25,7 +24,7 @@ declare const labelTypes: import("drizzle-orm/sqlite-core").SQLiteTableWithColum
|
|
|
25
24
|
}, {}, {
|
|
26
25
|
length: number | undefined;
|
|
27
26
|
}>;
|
|
28
|
-
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
27
|
+
projectId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
29
28
|
name: "project_id";
|
|
30
29
|
tableName: "label_types";
|
|
31
30
|
dataType: "string";
|
|
@@ -44,7 +43,7 @@ declare const labelTypes: import("drizzle-orm/sqlite-core").SQLiteTableWithColum
|
|
|
44
43
|
}, {}, {
|
|
45
44
|
length: number | undefined;
|
|
46
45
|
}>;
|
|
47
|
-
key: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
46
|
+
key: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
48
47
|
name: "key";
|
|
49
48
|
tableName: "label_types";
|
|
50
49
|
dataType: "string";
|
|
@@ -63,7 +62,7 @@ declare const labelTypes: import("drizzle-orm/sqlite-core").SQLiteTableWithColum
|
|
|
63
62
|
}, {}, {
|
|
64
63
|
length: number | undefined;
|
|
65
64
|
}>;
|
|
66
|
-
name: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
65
|
+
name: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
67
66
|
name: "name";
|
|
68
67
|
tableName: "label_types";
|
|
69
68
|
dataType: "string";
|
|
@@ -82,7 +81,7 @@ declare const labelTypes: import("drizzle-orm/sqlite-core").SQLiteTableWithColum
|
|
|
82
81
|
}, {}, {
|
|
83
82
|
length: number | undefined;
|
|
84
83
|
}>;
|
|
85
|
-
linkTemplate: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
84
|
+
linkTemplate: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
86
85
|
name: "link_template";
|
|
87
86
|
tableName: "label_types";
|
|
88
87
|
dataType: "string";
|
|
@@ -101,7 +100,7 @@ declare const labelTypes: import("drizzle-orm/sqlite-core").SQLiteTableWithColum
|
|
|
101
100
|
}, {}, {
|
|
102
101
|
length: number | undefined;
|
|
103
102
|
}>;
|
|
104
|
-
color: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
103
|
+
color: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
105
104
|
name: "color";
|
|
106
105
|
tableName: "label_types";
|
|
107
106
|
dataType: "string";
|
|
@@ -120,7 +119,7 @@ declare const labelTypes: import("drizzle-orm/sqlite-core").SQLiteTableWithColum
|
|
|
120
119
|
}, {}, {
|
|
121
120
|
length: number | undefined;
|
|
122
121
|
}>;
|
|
123
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
122
|
+
createdAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
124
123
|
name: "created_at";
|
|
125
124
|
tableName: "label_types";
|
|
126
125
|
dataType: "string";
|
|
@@ -143,11 +142,11 @@ declare const labelTypes: import("drizzle-orm/sqlite-core").SQLiteTableWithColum
|
|
|
143
142
|
dialect: 'sqlite';
|
|
144
143
|
}>;
|
|
145
144
|
/** Narrow `build_labels` table definition. */
|
|
146
|
-
declare const buildLabels: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
145
|
+
declare const buildLabels: import("drizzle-orm/sqlite-core/table.js").SQLiteTableWithColumns<{
|
|
147
146
|
name: "build_labels";
|
|
148
147
|
schema: undefined;
|
|
149
148
|
columns: {
|
|
150
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
149
|
+
id: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
151
150
|
name: "id";
|
|
152
151
|
tableName: "build_labels";
|
|
153
152
|
dataType: "string";
|
|
@@ -166,7 +165,7 @@ declare const buildLabels: import("drizzle-orm/sqlite-core").SQLiteTableWithColu
|
|
|
166
165
|
}, {}, {
|
|
167
166
|
length: number | undefined;
|
|
168
167
|
}>;
|
|
169
|
-
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
168
|
+
projectId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
170
169
|
name: "project_id";
|
|
171
170
|
tableName: "build_labels";
|
|
172
171
|
dataType: "string";
|
|
@@ -185,7 +184,7 @@ declare const buildLabels: import("drizzle-orm/sqlite-core").SQLiteTableWithColu
|
|
|
185
184
|
}, {}, {
|
|
186
185
|
length: number | undefined;
|
|
187
186
|
}>;
|
|
188
|
-
buildId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
187
|
+
buildId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
189
188
|
name: "build_id";
|
|
190
189
|
tableName: "build_labels";
|
|
191
190
|
dataType: "string";
|
|
@@ -204,7 +203,7 @@ declare const buildLabels: import("drizzle-orm/sqlite-core").SQLiteTableWithColu
|
|
|
204
203
|
}, {}, {
|
|
205
204
|
length: number | undefined;
|
|
206
205
|
}>;
|
|
207
|
-
typeKey: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
206
|
+
typeKey: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
208
207
|
name: "type_key";
|
|
209
208
|
tableName: "build_labels";
|
|
210
209
|
dataType: "string";
|
|
@@ -223,7 +222,7 @@ declare const buildLabels: import("drizzle-orm/sqlite-core").SQLiteTableWithColu
|
|
|
223
222
|
}, {}, {
|
|
224
223
|
length: number | undefined;
|
|
225
224
|
}>;
|
|
226
|
-
value: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
225
|
+
value: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
227
226
|
name: "value";
|
|
228
227
|
tableName: "build_labels";
|
|
229
228
|
dataType: "string";
|
|
@@ -242,7 +241,7 @@ declare const buildLabels: import("drizzle-orm/sqlite-core").SQLiteTableWithColu
|
|
|
242
241
|
}, {}, {
|
|
243
242
|
length: number | undefined;
|
|
244
243
|
}>;
|
|
245
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
244
|
+
createdAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
246
245
|
name: "created_at";
|
|
247
246
|
tableName: "build_labels";
|
|
248
247
|
dataType: "string";
|
|
@@ -283,6 +282,5 @@ interface BuildLabel {
|
|
|
283
282
|
value: string;
|
|
284
283
|
createdAt: string;
|
|
285
284
|
}
|
|
286
|
-
//#endregion
|
|
287
285
|
export { BuildLabel, LabelType, buildLabels, labelTypes };
|
|
288
286
|
//# sourceMappingURL=label.d.mts.map
|
package/dist/schema/label.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import.meta.url;
|
|
|
4
4
|
import { projects } from "./project.mjs";
|
|
5
5
|
import { builds } from "./build.mjs";
|
|
6
6
|
import { sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
|
|
7
|
-
|
|
7
|
+
// src/schema/label.ts
|
|
8
8
|
/** Narrow `label_types` table definition. */
|
|
9
9
|
const labelTypes = sqliteTable("label_types", {
|
|
10
10
|
id: text("id").primaryKey(),
|
|
@@ -24,7 +24,6 @@ const buildLabels = sqliteTable("build_labels", {
|
|
|
24
24
|
value: text("value").notNull(),
|
|
25
25
|
createdAt: text("created_at").notNull()
|
|
26
26
|
}, (t) => [uniqueIndex("build_labels_build_type_value_idx").on(t.buildId, t.typeKey, t.value)]);
|
|
27
|
-
//#endregion
|
|
28
27
|
export { buildLabels, labelTypes };
|
|
29
28
|
|
|
30
29
|
//# sourceMappingURL=label.mjs.map
|
package/dist/schema/member.d.mts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { ProjectRole } from "@storyshelf/core/types";
|
|
4
|
-
//#region src/schema/member.d.ts
|
|
5
4
|
/** Narrow `project_members` table definition. */
|
|
6
|
-
declare const projectMembers: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
5
|
+
declare const projectMembers: import("drizzle-orm/sqlite-core/table.js").SQLiteTableWithColumns<{
|
|
7
6
|
name: "project_members";
|
|
8
7
|
schema: undefined;
|
|
9
8
|
columns: {
|
|
10
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
9
|
+
id: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
11
10
|
name: "id";
|
|
12
11
|
tableName: "project_members";
|
|
13
12
|
dataType: "string";
|
|
@@ -26,7 +25,7 @@ declare const projectMembers: import("drizzle-orm/sqlite-core").SQLiteTableWithC
|
|
|
26
25
|
}, {}, {
|
|
27
26
|
length: number | undefined;
|
|
28
27
|
}>;
|
|
29
|
-
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
28
|
+
projectId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
30
29
|
name: "project_id";
|
|
31
30
|
tableName: "project_members";
|
|
32
31
|
dataType: "string";
|
|
@@ -45,7 +44,7 @@ declare const projectMembers: import("drizzle-orm/sqlite-core").SQLiteTableWithC
|
|
|
45
44
|
}, {}, {
|
|
46
45
|
length: number | undefined;
|
|
47
46
|
}>;
|
|
48
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
47
|
+
userId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
49
48
|
name: "user_id";
|
|
50
49
|
tableName: "project_members";
|
|
51
50
|
dataType: "string";
|
|
@@ -64,7 +63,7 @@ declare const projectMembers: import("drizzle-orm/sqlite-core").SQLiteTableWithC
|
|
|
64
63
|
}, {}, {
|
|
65
64
|
length: number | undefined;
|
|
66
65
|
}>;
|
|
67
|
-
role: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
66
|
+
role: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
68
67
|
name: "role";
|
|
69
68
|
tableName: "project_members";
|
|
70
69
|
dataType: "string";
|
|
@@ -84,7 +83,7 @@ declare const projectMembers: import("drizzle-orm/sqlite-core").SQLiteTableWithC
|
|
|
84
83
|
length: number | undefined;
|
|
85
84
|
$type: "admin" | "approver" | "developer" | "viewer";
|
|
86
85
|
}>;
|
|
87
|
-
source: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
86
|
+
source: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
88
87
|
name: "source";
|
|
89
88
|
tableName: "project_members";
|
|
90
89
|
dataType: "string";
|
|
@@ -103,7 +102,7 @@ declare const projectMembers: import("drizzle-orm/sqlite-core").SQLiteTableWithC
|
|
|
103
102
|
}, {}, {
|
|
104
103
|
length: number | undefined;
|
|
105
104
|
}>;
|
|
106
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
105
|
+
createdAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
107
106
|
name: "created_at";
|
|
108
107
|
tableName: "project_members";
|
|
109
108
|
dataType: "string";
|
|
@@ -135,6 +134,5 @@ interface ProjectMember {
|
|
|
135
134
|
source: string;
|
|
136
135
|
createdAt: string;
|
|
137
136
|
}
|
|
138
|
-
//#endregion
|
|
139
137
|
export { ProjectMember, projectMembers };
|
|
140
138
|
//# sourceMappingURL=member.d.mts.map
|
package/dist/schema/member.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import.meta.url;
|
|
|
4
4
|
import { projects } from "./project.mjs";
|
|
5
5
|
import { users } from "./user.mjs";
|
|
6
6
|
import { sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
|
|
7
|
-
|
|
7
|
+
// src/schema/member.ts
|
|
8
8
|
/** Narrow `project_members` table definition. */
|
|
9
9
|
const projectMembers = sqliteTable("project_members", {
|
|
10
10
|
id: text("id").primaryKey(),
|
|
@@ -14,7 +14,6 @@ const projectMembers = sqliteTable("project_members", {
|
|
|
14
14
|
source: text("source").notNull().default("manual"),
|
|
15
15
|
createdAt: text("created_at").notNull()
|
|
16
16
|
}, (t) => [uniqueIndex("project_members_project_user_idx").on(t.projectId, t.userId)]);
|
|
17
|
-
//#endregion
|
|
18
17
|
export { projectMembers };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=member.mjs.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
|
-
//#region src/schema/notification.d.ts
|
|
4
3
|
/** Narrow `notification_channels` table definition. */
|
|
5
|
-
declare const notificationChannels: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
4
|
+
declare const notificationChannels: import("drizzle-orm/sqlite-core/table.js").SQLiteTableWithColumns<{
|
|
6
5
|
name: "notification_channels";
|
|
7
6
|
schema: undefined;
|
|
8
7
|
columns: {
|
|
9
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
8
|
+
id: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
10
9
|
name: "id";
|
|
11
10
|
tableName: "notification_channels";
|
|
12
11
|
dataType: "string";
|
|
@@ -25,7 +24,7 @@ declare const notificationChannels: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
25
24
|
}, {}, {
|
|
26
25
|
length: number | undefined;
|
|
27
26
|
}>;
|
|
28
|
-
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
27
|
+
projectId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
29
28
|
name: "project_id";
|
|
30
29
|
tableName: "notification_channels";
|
|
31
30
|
dataType: "string";
|
|
@@ -44,7 +43,7 @@ declare const notificationChannels: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
44
43
|
}, {}, {
|
|
45
44
|
length: number | undefined;
|
|
46
45
|
}>;
|
|
47
|
-
provider: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
46
|
+
provider: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
48
47
|
name: "provider";
|
|
49
48
|
tableName: "notification_channels";
|
|
50
49
|
dataType: "string";
|
|
@@ -63,7 +62,7 @@ declare const notificationChannels: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
63
62
|
}, {}, {
|
|
64
63
|
length: number | undefined;
|
|
65
64
|
}>;
|
|
66
|
-
config: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
65
|
+
config: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
67
66
|
name: "config";
|
|
68
67
|
tableName: "notification_channels";
|
|
69
68
|
dataType: "string";
|
|
@@ -82,7 +81,7 @@ declare const notificationChannels: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
82
81
|
}, {}, {
|
|
83
82
|
length: number | undefined;
|
|
84
83
|
}>;
|
|
85
|
-
secretEncrypted: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
84
|
+
secretEncrypted: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
86
85
|
name: "secret_encrypted";
|
|
87
86
|
tableName: "notification_channels";
|
|
88
87
|
dataType: "string";
|
|
@@ -101,7 +100,7 @@ declare const notificationChannels: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
101
100
|
}, {}, {
|
|
102
101
|
length: number | undefined;
|
|
103
102
|
}>;
|
|
104
|
-
events: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
103
|
+
events: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
105
104
|
name: "events";
|
|
106
105
|
tableName: "notification_channels";
|
|
107
106
|
dataType: "string";
|
|
@@ -120,7 +119,7 @@ declare const notificationChannels: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
120
119
|
}, {}, {
|
|
121
120
|
length: number | undefined;
|
|
122
121
|
}>;
|
|
123
|
-
enabled: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
122
|
+
enabled: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
124
123
|
name: "enabled";
|
|
125
124
|
tableName: "notification_channels";
|
|
126
125
|
dataType: "boolean";
|
|
@@ -137,7 +136,45 @@ declare const notificationChannels: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
137
136
|
identity: undefined;
|
|
138
137
|
generated: undefined;
|
|
139
138
|
}, {}, {}>;
|
|
140
|
-
|
|
139
|
+
lastError: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
140
|
+
name: "last_error";
|
|
141
|
+
tableName: "notification_channels";
|
|
142
|
+
dataType: "string";
|
|
143
|
+
columnType: "SQLiteText";
|
|
144
|
+
data: string;
|
|
145
|
+
driverParam: string;
|
|
146
|
+
notNull: false;
|
|
147
|
+
hasDefault: false;
|
|
148
|
+
isPrimaryKey: false;
|
|
149
|
+
isAutoincrement: false;
|
|
150
|
+
hasRuntimeDefault: false;
|
|
151
|
+
enumValues: [string, ...string[]];
|
|
152
|
+
baseColumn: never;
|
|
153
|
+
identity: undefined;
|
|
154
|
+
generated: undefined;
|
|
155
|
+
}, {}, {
|
|
156
|
+
length: number | undefined;
|
|
157
|
+
}>;
|
|
158
|
+
lastErrorAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
159
|
+
name: "last_error_at";
|
|
160
|
+
tableName: "notification_channels";
|
|
161
|
+
dataType: "string";
|
|
162
|
+
columnType: "SQLiteText";
|
|
163
|
+
data: string;
|
|
164
|
+
driverParam: string;
|
|
165
|
+
notNull: false;
|
|
166
|
+
hasDefault: false;
|
|
167
|
+
isPrimaryKey: false;
|
|
168
|
+
isAutoincrement: false;
|
|
169
|
+
hasRuntimeDefault: false;
|
|
170
|
+
enumValues: [string, ...string[]];
|
|
171
|
+
baseColumn: never;
|
|
172
|
+
identity: undefined;
|
|
173
|
+
generated: undefined;
|
|
174
|
+
}, {}, {
|
|
175
|
+
length: number | undefined;
|
|
176
|
+
}>;
|
|
177
|
+
createdAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
141
178
|
name: "created_at";
|
|
142
179
|
tableName: "notification_channels";
|
|
143
180
|
dataType: "string";
|
|
@@ -156,7 +193,7 @@ declare const notificationChannels: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
156
193
|
}, {}, {
|
|
157
194
|
length: number | undefined;
|
|
158
195
|
}>;
|
|
159
|
-
updatedAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
196
|
+
updatedAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
160
197
|
name: "updated_at";
|
|
161
198
|
tableName: "notification_channels";
|
|
162
199
|
dataType: "string";
|
|
@@ -179,11 +216,11 @@ declare const notificationChannels: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
179
216
|
dialect: 'sqlite';
|
|
180
217
|
}>;
|
|
181
218
|
/** Narrow `notification_subscriptions` table definition. */
|
|
182
|
-
declare const notificationSubscriptions: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
219
|
+
declare const notificationSubscriptions: import("drizzle-orm/sqlite-core/table.js").SQLiteTableWithColumns<{
|
|
183
220
|
name: "notification_subscriptions";
|
|
184
221
|
schema: undefined;
|
|
185
222
|
columns: {
|
|
186
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
223
|
+
id: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
187
224
|
name: "id";
|
|
188
225
|
tableName: "notification_subscriptions";
|
|
189
226
|
dataType: "string";
|
|
@@ -202,7 +239,7 @@ declare const notificationSubscriptions: import("drizzle-orm/sqlite-core").SQLit
|
|
|
202
239
|
}, {}, {
|
|
203
240
|
length: number | undefined;
|
|
204
241
|
}>;
|
|
205
|
-
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
242
|
+
projectId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
206
243
|
name: "project_id";
|
|
207
244
|
tableName: "notification_subscriptions";
|
|
208
245
|
dataType: "string";
|
|
@@ -221,7 +258,7 @@ declare const notificationSubscriptions: import("drizzle-orm/sqlite-core").SQLit
|
|
|
221
258
|
}, {}, {
|
|
222
259
|
length: number | undefined;
|
|
223
260
|
}>;
|
|
224
|
-
userId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
261
|
+
userId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
225
262
|
name: "user_id";
|
|
226
263
|
tableName: "notification_subscriptions";
|
|
227
264
|
dataType: "string";
|
|
@@ -240,7 +277,7 @@ declare const notificationSubscriptions: import("drizzle-orm/sqlite-core").SQLit
|
|
|
240
277
|
}, {}, {
|
|
241
278
|
length: number | undefined;
|
|
242
279
|
}>;
|
|
243
|
-
events: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
280
|
+
events: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
244
281
|
name: "events";
|
|
245
282
|
tableName: "notification_subscriptions";
|
|
246
283
|
dataType: "string";
|
|
@@ -259,7 +296,7 @@ declare const notificationSubscriptions: import("drizzle-orm/sqlite-core").SQLit
|
|
|
259
296
|
}, {}, {
|
|
260
297
|
length: number | undefined;
|
|
261
298
|
}>;
|
|
262
|
-
via: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
299
|
+
via: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
263
300
|
name: "via";
|
|
264
301
|
tableName: "notification_subscriptions";
|
|
265
302
|
dataType: "string";
|
|
@@ -278,7 +315,7 @@ declare const notificationSubscriptions: import("drizzle-orm/sqlite-core").SQLit
|
|
|
278
315
|
}, {}, {
|
|
279
316
|
length: number | undefined;
|
|
280
317
|
}>;
|
|
281
|
-
enabled: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
318
|
+
enabled: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
282
319
|
name: "enabled";
|
|
283
320
|
tableName: "notification_subscriptions";
|
|
284
321
|
dataType: "boolean";
|
|
@@ -295,7 +332,7 @@ declare const notificationSubscriptions: import("drizzle-orm/sqlite-core").SQLit
|
|
|
295
332
|
identity: undefined;
|
|
296
333
|
generated: undefined;
|
|
297
334
|
}, {}, {}>;
|
|
298
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
335
|
+
createdAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
299
336
|
name: "created_at";
|
|
300
337
|
tableName: "notification_subscriptions";
|
|
301
338
|
dataType: "string";
|
|
@@ -326,6 +363,8 @@ interface NotificationChannel {
|
|
|
326
363
|
secretEncrypted: string | null;
|
|
327
364
|
events: string | null;
|
|
328
365
|
enabled: boolean;
|
|
366
|
+
lastError: string | null;
|
|
367
|
+
lastErrorAt: string | null;
|
|
329
368
|
createdAt: string;
|
|
330
369
|
updatedAt: string;
|
|
331
370
|
}
|
|
@@ -339,6 +378,5 @@ interface NotificationSubscription {
|
|
|
339
378
|
enabled: boolean;
|
|
340
379
|
createdAt: string;
|
|
341
380
|
}
|
|
342
|
-
//#endregion
|
|
343
381
|
export { NotificationChannel, NotificationSubscription, notificationChannels, notificationSubscriptions };
|
|
344
382
|
//# sourceMappingURL=notification.d.mts.map
|
|
@@ -4,7 +4,7 @@ import.meta.url;
|
|
|
4
4
|
import { projects } from "./project.mjs";
|
|
5
5
|
import { users } from "./user.mjs";
|
|
6
6
|
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
7
|
-
|
|
7
|
+
// src/schema/notification.ts
|
|
8
8
|
/** Narrow `notification_channels` table definition. */
|
|
9
9
|
const notificationChannels = sqliteTable("notification_channels", {
|
|
10
10
|
id: text("id").primaryKey(),
|
|
@@ -14,6 +14,8 @@ const notificationChannels = sqliteTable("notification_channels", {
|
|
|
14
14
|
secretEncrypted: text("secret_encrypted"),
|
|
15
15
|
events: text("events"),
|
|
16
16
|
enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
|
|
17
|
+
lastError: text("last_error"),
|
|
18
|
+
lastErrorAt: text("last_error_at"),
|
|
17
19
|
createdAt: text("created_at").notNull(),
|
|
18
20
|
updatedAt: text("updated_at").notNull()
|
|
19
21
|
});
|
|
@@ -27,7 +29,6 @@ const notificationSubscriptions = sqliteTable("notification_subscriptions", {
|
|
|
27
29
|
enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
|
|
28
30
|
createdAt: text("created_at").notNull()
|
|
29
31
|
});
|
|
30
|
-
//#endregion
|
|
31
32
|
export { notificationChannels, notificationSubscriptions };
|
|
32
33
|
|
|
33
34
|
//# sourceMappingURL=notification.mjs.map
|
|
@@ -1 +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"}
|
|
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 lastError: text(\"last_error\"),\n lastErrorAt: text(\"last_error_at\"),\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 lastError: string | null;\n lastErrorAt: string | null;\n createdAt: string;\n updatedAt: string;\n}\n\n/** A per-user notification subscription row. */\nexport interface NotificationSubscription {\n id: string;\n projectId: string;\n userId: string;\n events: string | null;\n via: string | null;\n enabled: boolean;\n createdAt: string;\n}\n"],"mappings":";;;;;;;;AAKA,MAAa,uBAAuB,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;CAC5B,aAAa,KAAK,eAAe;CACjC,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"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import __tsdown_shims_path from 'node:path';
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { ProjectRole } from "@storyshelf/core/types";
|
|
4
|
-
//#region src/schema/project-group-mapping.d.ts
|
|
5
4
|
/** Narrow `project_group_mappings` table definition. */
|
|
6
|
-
declare const projectGroupMappings: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
5
|
+
declare const projectGroupMappings: import("drizzle-orm/sqlite-core/table.js").SQLiteTableWithColumns<{
|
|
7
6
|
name: "project_group_mappings";
|
|
8
7
|
schema: undefined;
|
|
9
8
|
columns: {
|
|
10
|
-
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
9
|
+
id: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
11
10
|
name: "id";
|
|
12
11
|
tableName: "project_group_mappings";
|
|
13
12
|
dataType: "string";
|
|
@@ -26,7 +25,7 @@ declare const projectGroupMappings: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
26
25
|
}, {}, {
|
|
27
26
|
length: number | undefined;
|
|
28
27
|
}>;
|
|
29
|
-
projectId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
28
|
+
projectId: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
30
29
|
name: "project_id";
|
|
31
30
|
tableName: "project_group_mappings";
|
|
32
31
|
dataType: "string";
|
|
@@ -45,7 +44,7 @@ declare const projectGroupMappings: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
45
44
|
}, {}, {
|
|
46
45
|
length: number | undefined;
|
|
47
46
|
}>;
|
|
48
|
-
groupName: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
47
|
+
groupName: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
49
48
|
name: "group_name";
|
|
50
49
|
tableName: "project_group_mappings";
|
|
51
50
|
dataType: "string";
|
|
@@ -64,7 +63,7 @@ declare const projectGroupMappings: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
64
63
|
}, {}, {
|
|
65
64
|
length: number | undefined;
|
|
66
65
|
}>;
|
|
67
|
-
role: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
66
|
+
role: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
68
67
|
name: "role";
|
|
69
68
|
tableName: "project_group_mappings";
|
|
70
69
|
dataType: "string";
|
|
@@ -84,7 +83,7 @@ declare const projectGroupMappings: import("drizzle-orm/sqlite-core").SQLiteTabl
|
|
|
84
83
|
length: number | undefined;
|
|
85
84
|
$type: "admin" | "approver" | "developer" | "viewer";
|
|
86
85
|
}>;
|
|
87
|
-
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
86
|
+
createdAt: import("drizzle-orm/sqlite-core/index.js").SQLiteColumn<{
|
|
88
87
|
name: "created_at";
|
|
89
88
|
tableName: "project_group_mappings";
|
|
90
89
|
dataType: "string";
|
|
@@ -114,6 +113,5 @@ interface ProjectGroupMapping {
|
|
|
114
113
|
role: ProjectRole;
|
|
115
114
|
createdAt: string;
|
|
116
115
|
}
|
|
117
|
-
//#endregion
|
|
118
116
|
export { ProjectGroupMapping, projectGroupMappings };
|
|
119
117
|
//# sourceMappingURL=project-group-mapping.d.mts.map
|
|
@@ -3,7 +3,7 @@ import "node:url";
|
|
|
3
3
|
import.meta.url;
|
|
4
4
|
import { projects } from "./project.mjs";
|
|
5
5
|
import { sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
|
|
6
|
-
|
|
6
|
+
// src/schema/project-group-mapping.ts
|
|
7
7
|
/** Narrow `project_group_mappings` table definition. */
|
|
8
8
|
const projectGroupMappings = sqliteTable("project_group_mappings", {
|
|
9
9
|
id: text("id").primaryKey(),
|
|
@@ -12,7 +12,6 @@ const projectGroupMappings = sqliteTable("project_group_mappings", {
|
|
|
12
12
|
role: text("role").$type().notNull().default("viewer"),
|
|
13
13
|
createdAt: text("created_at").notNull()
|
|
14
14
|
}, (t) => [uniqueIndex("project_group_mappings_project_group_idx").on(t.projectId, t.groupName)]);
|
|
15
|
-
//#endregion
|
|
16
15
|
export { projectGroupMappings };
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=project-group-mapping.mjs.map
|