@storyshelf/db-postgres 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/dist/ddl.d.mts +1 -1
- package/dist/ddl.mjs +209 -13
- package/dist/ddl.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/migrate.mjs +83 -3
- package/dist/migrate.mjs.map +1 -1
- package/dist/neon-http.mjs +1 -1
- package/dist/neon-http.mjs.map +1 -1
- package/dist/neon.mjs +1 -1
- package/dist/neon.mjs.map +1 -1
- package/dist/pg.mjs +1 -1
- package/dist/pg.mjs.map +1 -1
- package/dist/pglite.mjs +2 -2
- package/dist/pglite.mjs.map +1 -1
- package/dist/schema/baseline.d.mts +54 -0
- package/dist/schema/baseline.mjs +4 -1
- package/dist/schema/baseline.mjs.map +1 -1
- package/dist/schema/{status-config.d.mts → build-component.d.mts} +42 -35
- package/dist/schema/build-component.mjs +25 -0
- package/dist/schema/build-component.mjs.map +1 -0
- package/dist/schema/build-review.d.mts +118 -0
- package/dist/schema/build-review.mjs +23 -0
- package/dist/schema/build-review.mjs.map +1 -0
- package/dist/schema/build.d.mts +38 -2
- package/dist/schema/build.mjs +3 -0
- package/dist/schema/build.mjs.map +1 -1
- package/dist/schema/capture-job.d.mts +330 -0
- package/dist/schema/capture-job.mjs +56 -0
- package/dist/schema/capture-job.mjs.map +1 -0
- package/dist/schema/capture-shard.d.mts +257 -0
- package/dist/schema/capture-shard.mjs +40 -0
- package/dist/schema/capture-shard.mjs.map +1 -0
- package/dist/schema/comment.d.mts +18 -0
- package/dist/schema/comment.mjs +3 -2
- package/dist/schema/comment.mjs.map +1 -1
- package/dist/schema/connection.d.mts +173 -0
- package/dist/schema/connection.mjs +35 -0
- package/dist/schema/connection.mjs.map +1 -0
- package/dist/schema/design.d.mts +589 -0
- package/dist/schema/design.mjs +73 -0
- package/dist/schema/design.mjs.map +1 -0
- package/dist/schema/insight.d.mts +633 -0
- package/dist/schema/insight.mjs +68 -0
- package/dist/schema/insight.mjs.map +1 -0
- package/dist/schema/notification.d.mts +36 -0
- package/dist/schema/notification.mjs +5 -0
- package/dist/schema/notification.mjs.map +1 -1
- package/dist/schema/project.d.mts +126 -0
- package/dist/schema/project.mjs +8 -1
- package/dist/schema/project.mjs.map +1 -1
- package/dist/schema/site-setting.d.mts +99 -0
- package/dist/schema/site-setting.mjs +23 -0
- package/dist/schema/site-setting.mjs.map +1 -0
- package/dist/schema/snapshot.d.mts +108 -0
- package/dist/schema/snapshot.mjs +11 -1
- package/dist/schema/snapshot.mjs.map +1 -1
- package/dist/schema/usage.d.mts +267 -0
- package/dist/schema/usage.mjs +36 -0
- package/dist/schema/usage.mjs.map +1 -0
- package/dist/schema.d.mts +24 -3
- package/dist/schema.mjs +25 -4
- package/dist/schema.mjs.map +1 -1
- package/dist/vercel.mjs +1 -1
- package/dist/vercel.mjs.map +1 -1
- package/package.json +5 -5
- package/dist/schema/status-config.mjs +0 -26
- package/dist/schema/status-config.mjs.map +0 -1
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
//#region src/schema/usage.d.ts
|
|
4
|
+
/** Narrow `project_links` table definition. */
|
|
5
|
+
declare const projectLinks: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
6
|
+
name: "project_links";
|
|
7
|
+
schema: undefined;
|
|
8
|
+
columns: {
|
|
9
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
10
|
+
name: "id";
|
|
11
|
+
tableName: "project_links";
|
|
12
|
+
dataType: "string";
|
|
13
|
+
columnType: "PgText";
|
|
14
|
+
data: string;
|
|
15
|
+
driverParam: string;
|
|
16
|
+
notNull: true;
|
|
17
|
+
hasDefault: false;
|
|
18
|
+
isPrimaryKey: true;
|
|
19
|
+
isAutoincrement: false;
|
|
20
|
+
hasRuntimeDefault: false;
|
|
21
|
+
enumValues: [string, ...string[]];
|
|
22
|
+
baseColumn: never;
|
|
23
|
+
identity: undefined;
|
|
24
|
+
generated: undefined;
|
|
25
|
+
}, {}, {}>;
|
|
26
|
+
downstreamId: import("drizzle-orm/pg-core").PgColumn<{
|
|
27
|
+
name: "downstream_id";
|
|
28
|
+
tableName: "project_links";
|
|
29
|
+
dataType: "string";
|
|
30
|
+
columnType: "PgText";
|
|
31
|
+
data: string;
|
|
32
|
+
driverParam: string;
|
|
33
|
+
notNull: true;
|
|
34
|
+
hasDefault: false;
|
|
35
|
+
isPrimaryKey: false;
|
|
36
|
+
isAutoincrement: false;
|
|
37
|
+
hasRuntimeDefault: false;
|
|
38
|
+
enumValues: [string, ...string[]];
|
|
39
|
+
baseColumn: never;
|
|
40
|
+
identity: undefined;
|
|
41
|
+
generated: undefined;
|
|
42
|
+
}, {}, {}>;
|
|
43
|
+
upstreamId: import("drizzle-orm/pg-core").PgColumn<{
|
|
44
|
+
name: "upstream_id";
|
|
45
|
+
tableName: "project_links";
|
|
46
|
+
dataType: "string";
|
|
47
|
+
columnType: "PgText";
|
|
48
|
+
data: string;
|
|
49
|
+
driverParam: string;
|
|
50
|
+
notNull: true;
|
|
51
|
+
hasDefault: false;
|
|
52
|
+
isPrimaryKey: false;
|
|
53
|
+
isAutoincrement: false;
|
|
54
|
+
hasRuntimeDefault: false;
|
|
55
|
+
enumValues: [string, ...string[]];
|
|
56
|
+
baseColumn: never;
|
|
57
|
+
identity: undefined;
|
|
58
|
+
generated: undefined;
|
|
59
|
+
}, {}, {}>;
|
|
60
|
+
packageName: import("drizzle-orm/pg-core").PgColumn<{
|
|
61
|
+
name: "package_name";
|
|
62
|
+
tableName: "project_links";
|
|
63
|
+
dataType: "string";
|
|
64
|
+
columnType: "PgText";
|
|
65
|
+
data: string;
|
|
66
|
+
driverParam: string;
|
|
67
|
+
notNull: true;
|
|
68
|
+
hasDefault: false;
|
|
69
|
+
isPrimaryKey: false;
|
|
70
|
+
isAutoincrement: false;
|
|
71
|
+
hasRuntimeDefault: false;
|
|
72
|
+
enumValues: [string, ...string[]];
|
|
73
|
+
baseColumn: never;
|
|
74
|
+
identity: undefined;
|
|
75
|
+
generated: undefined;
|
|
76
|
+
}, {}, {}>;
|
|
77
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
78
|
+
name: "created_at";
|
|
79
|
+
tableName: "project_links";
|
|
80
|
+
dataType: "string";
|
|
81
|
+
columnType: "PgTimestampString";
|
|
82
|
+
data: string;
|
|
83
|
+
driverParam: string;
|
|
84
|
+
notNull: true;
|
|
85
|
+
hasDefault: false;
|
|
86
|
+
isPrimaryKey: false;
|
|
87
|
+
isAutoincrement: false;
|
|
88
|
+
hasRuntimeDefault: false;
|
|
89
|
+
enumValues: undefined;
|
|
90
|
+
baseColumn: never;
|
|
91
|
+
identity: undefined;
|
|
92
|
+
generated: undefined;
|
|
93
|
+
}, {}, {}>;
|
|
94
|
+
};
|
|
95
|
+
dialect: 'pg';
|
|
96
|
+
}>;
|
|
97
|
+
/** Narrow `build_package_usage` table definition. */
|
|
98
|
+
declare const buildPackageUsage: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
99
|
+
name: "build_package_usage";
|
|
100
|
+
schema: undefined;
|
|
101
|
+
columns: {
|
|
102
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
103
|
+
name: "id";
|
|
104
|
+
tableName: "build_package_usage";
|
|
105
|
+
dataType: "string";
|
|
106
|
+
columnType: "PgText";
|
|
107
|
+
data: string;
|
|
108
|
+
driverParam: string;
|
|
109
|
+
notNull: true;
|
|
110
|
+
hasDefault: false;
|
|
111
|
+
isPrimaryKey: true;
|
|
112
|
+
isAutoincrement: false;
|
|
113
|
+
hasRuntimeDefault: false;
|
|
114
|
+
enumValues: [string, ...string[]];
|
|
115
|
+
baseColumn: never;
|
|
116
|
+
identity: undefined;
|
|
117
|
+
generated: undefined;
|
|
118
|
+
}, {}, {}>;
|
|
119
|
+
projectId: import("drizzle-orm/pg-core").PgColumn<{
|
|
120
|
+
name: "project_id";
|
|
121
|
+
tableName: "build_package_usage";
|
|
122
|
+
dataType: "string";
|
|
123
|
+
columnType: "PgText";
|
|
124
|
+
data: string;
|
|
125
|
+
driverParam: string;
|
|
126
|
+
notNull: true;
|
|
127
|
+
hasDefault: false;
|
|
128
|
+
isPrimaryKey: false;
|
|
129
|
+
isAutoincrement: false;
|
|
130
|
+
hasRuntimeDefault: false;
|
|
131
|
+
enumValues: [string, ...string[]];
|
|
132
|
+
baseColumn: never;
|
|
133
|
+
identity: undefined;
|
|
134
|
+
generated: undefined;
|
|
135
|
+
}, {}, {}>;
|
|
136
|
+
buildId: import("drizzle-orm/pg-core").PgColumn<{
|
|
137
|
+
name: "build_id";
|
|
138
|
+
tableName: "build_package_usage";
|
|
139
|
+
dataType: "string";
|
|
140
|
+
columnType: "PgText";
|
|
141
|
+
data: string;
|
|
142
|
+
driverParam: string;
|
|
143
|
+
notNull: true;
|
|
144
|
+
hasDefault: false;
|
|
145
|
+
isPrimaryKey: false;
|
|
146
|
+
isAutoincrement: false;
|
|
147
|
+
hasRuntimeDefault: false;
|
|
148
|
+
enumValues: [string, ...string[]];
|
|
149
|
+
baseColumn: never;
|
|
150
|
+
identity: undefined;
|
|
151
|
+
generated: undefined;
|
|
152
|
+
}, {}, {}>;
|
|
153
|
+
storyImportPath: import("drizzle-orm/pg-core").PgColumn<{
|
|
154
|
+
name: "story_import_path";
|
|
155
|
+
tableName: "build_package_usage";
|
|
156
|
+
dataType: "string";
|
|
157
|
+
columnType: "PgText";
|
|
158
|
+
data: string;
|
|
159
|
+
driverParam: string;
|
|
160
|
+
notNull: true;
|
|
161
|
+
hasDefault: false;
|
|
162
|
+
isPrimaryKey: false;
|
|
163
|
+
isAutoincrement: false;
|
|
164
|
+
hasRuntimeDefault: false;
|
|
165
|
+
enumValues: [string, ...string[]];
|
|
166
|
+
baseColumn: never;
|
|
167
|
+
identity: undefined;
|
|
168
|
+
generated: undefined;
|
|
169
|
+
}, {}, {}>;
|
|
170
|
+
packageName: import("drizzle-orm/pg-core").PgColumn<{
|
|
171
|
+
name: "package_name";
|
|
172
|
+
tableName: "build_package_usage";
|
|
173
|
+
dataType: "string";
|
|
174
|
+
columnType: "PgText";
|
|
175
|
+
data: string;
|
|
176
|
+
driverParam: string;
|
|
177
|
+
notNull: true;
|
|
178
|
+
hasDefault: false;
|
|
179
|
+
isPrimaryKey: false;
|
|
180
|
+
isAutoincrement: false;
|
|
181
|
+
hasRuntimeDefault: false;
|
|
182
|
+
enumValues: [string, ...string[]];
|
|
183
|
+
baseColumn: never;
|
|
184
|
+
identity: undefined;
|
|
185
|
+
generated: undefined;
|
|
186
|
+
}, {}, {}>;
|
|
187
|
+
modulePath: import("drizzle-orm/pg-core").PgColumn<{
|
|
188
|
+
name: "module_path";
|
|
189
|
+
tableName: "build_package_usage";
|
|
190
|
+
dataType: "string";
|
|
191
|
+
columnType: "PgText";
|
|
192
|
+
data: string;
|
|
193
|
+
driverParam: string;
|
|
194
|
+
notNull: true;
|
|
195
|
+
hasDefault: false;
|
|
196
|
+
isPrimaryKey: false;
|
|
197
|
+
isAutoincrement: false;
|
|
198
|
+
hasRuntimeDefault: false;
|
|
199
|
+
enumValues: [string, ...string[]];
|
|
200
|
+
baseColumn: never;
|
|
201
|
+
identity: undefined;
|
|
202
|
+
generated: undefined;
|
|
203
|
+
}, {}, {}>;
|
|
204
|
+
version: import("drizzle-orm/pg-core").PgColumn<{
|
|
205
|
+
name: "version";
|
|
206
|
+
tableName: "build_package_usage";
|
|
207
|
+
dataType: "string";
|
|
208
|
+
columnType: "PgText";
|
|
209
|
+
data: string;
|
|
210
|
+
driverParam: string;
|
|
211
|
+
notNull: false;
|
|
212
|
+
hasDefault: false;
|
|
213
|
+
isPrimaryKey: false;
|
|
214
|
+
isAutoincrement: false;
|
|
215
|
+
hasRuntimeDefault: false;
|
|
216
|
+
enumValues: [string, ...string[]];
|
|
217
|
+
baseColumn: never;
|
|
218
|
+
identity: undefined;
|
|
219
|
+
generated: undefined;
|
|
220
|
+
}, {}, {}>;
|
|
221
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
222
|
+
name: "created_at";
|
|
223
|
+
tableName: "build_package_usage";
|
|
224
|
+
dataType: "string";
|
|
225
|
+
columnType: "PgTimestampString";
|
|
226
|
+
data: string;
|
|
227
|
+
driverParam: string;
|
|
228
|
+
notNull: true;
|
|
229
|
+
hasDefault: false;
|
|
230
|
+
isPrimaryKey: false;
|
|
231
|
+
isAutoincrement: false;
|
|
232
|
+
hasRuntimeDefault: false;
|
|
233
|
+
enumValues: undefined;
|
|
234
|
+
baseColumn: never;
|
|
235
|
+
identity: undefined;
|
|
236
|
+
generated: undefined;
|
|
237
|
+
}, {}, {}>;
|
|
238
|
+
};
|
|
239
|
+
dialect: 'pg';
|
|
240
|
+
}>;
|
|
241
|
+
/** A link from a downstream project to the upstream project that publishes a package it consumes. */
|
|
242
|
+
interface ProjectLink {
|
|
243
|
+
id: string;
|
|
244
|
+
/** Project that consumes the package (the app). */
|
|
245
|
+
downstreamId: string;
|
|
246
|
+
/** Project whose Storybook publishes the package's components (the design system). */
|
|
247
|
+
upstreamId: string;
|
|
248
|
+
packageName: string;
|
|
249
|
+
createdAt: string;
|
|
250
|
+
}
|
|
251
|
+
/** A dependency package a story file reaches in a build. */
|
|
252
|
+
interface BuildPackageUsage {
|
|
253
|
+
id: string;
|
|
254
|
+
projectId: string;
|
|
255
|
+
buildId: string;
|
|
256
|
+
/** Story import path, joined to `snapshots.storyImportPath` at read time. */
|
|
257
|
+
storyImportPath: string;
|
|
258
|
+
packageName: string;
|
|
259
|
+
/** First module inside the package the story reaches. */
|
|
260
|
+
modulePath: string;
|
|
261
|
+
/** Installed package version at upload time; null when it could not be resolved. */
|
|
262
|
+
version: string | null;
|
|
263
|
+
createdAt: string;
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
export { BuildPackageUsage, ProjectLink, buildPackageUsage, projectLinks };
|
|
267
|
+
//# sourceMappingURL=usage.d.mts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { projects } from "./project.mjs";
|
|
5
|
+
import { builds } from "./build.mjs";
|
|
6
|
+
import { index, pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
|
|
7
|
+
//#region src/schema/usage.ts
|
|
8
|
+
/** Narrow `project_links` table definition. */
|
|
9
|
+
const projectLinks = pgTable("project_links", {
|
|
10
|
+
id: text("id").primaryKey(),
|
|
11
|
+
downstreamId: text("downstream_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
12
|
+
upstreamId: text("upstream_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
13
|
+
packageName: text("package_name").notNull(),
|
|
14
|
+
createdAt: timestamp("created_at", {
|
|
15
|
+
withTimezone: true,
|
|
16
|
+
mode: "string"
|
|
17
|
+
}).notNull()
|
|
18
|
+
}, (t) => [uniqueIndex("project_links_downstream_package_idx").on(t.downstreamId, t.packageName)]);
|
|
19
|
+
/** Narrow `build_package_usage` table definition. */
|
|
20
|
+
const buildPackageUsage = pgTable("build_package_usage", {
|
|
21
|
+
id: text("id").primaryKey(),
|
|
22
|
+
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
23
|
+
buildId: text("build_id").notNull().references(() => builds.id, { onDelete: "cascade" }),
|
|
24
|
+
storyImportPath: text("story_import_path").notNull(),
|
|
25
|
+
packageName: text("package_name").notNull(),
|
|
26
|
+
modulePath: text("module_path").notNull(),
|
|
27
|
+
version: text("version"),
|
|
28
|
+
createdAt: timestamp("created_at", {
|
|
29
|
+
withTimezone: true,
|
|
30
|
+
mode: "string"
|
|
31
|
+
}).notNull()
|
|
32
|
+
}, (t) => [index("build_package_usage_build_id_idx").on(t.buildId)]);
|
|
33
|
+
//#endregion
|
|
34
|
+
export { buildPackageUsage, projectLinks };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=usage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.mjs","names":[],"sources":["../../src/schema/usage.ts"],"sourcesContent":["import { pgTable, text, timestamp, uniqueIndex, index } from \"drizzle-orm/pg-core\";\nimport { builds } from \"./build.ts\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `project_links` table definition. */\nexport const projectLinks = pgTable(\n \"project_links\",\n {\n id: text(\"id\").primaryKey(),\n downstreamId: text(\"downstream_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n upstreamId: text(\"upstream_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n packageName: text(\"package_name\").notNull(),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n },\n (t) => [uniqueIndex(\"project_links_downstream_package_idx\").on(t.downstreamId, t.packageName)],\n);\n\n/** Narrow `build_package_usage` table definition. */\nexport const buildPackageUsage = pgTable(\n \"build_package_usage\",\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 storyImportPath: text(\"story_import_path\").notNull(),\n packageName: text(\"package_name\").notNull(),\n modulePath: text(\"module_path\").notNull(),\n version: text(\"version\"),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n },\n (t) => [index(\"build_package_usage_build_id_idx\").on(t.buildId)],\n);\n\n/** A link from a downstream project to the upstream project that publishes a package it consumes. */\nexport interface ProjectLink {\n id: string;\n /** Project that consumes the package (the app). */\n downstreamId: string;\n /** Project whose Storybook publishes the package's components (the design system). */\n upstreamId: string;\n packageName: string;\n createdAt: string;\n}\n\n/** A dependency package a story file reaches in a build. */\nexport interface BuildPackageUsage {\n id: string;\n projectId: string;\n buildId: string;\n /** Story import path, joined to `snapshots.storyImportPath` at read time. */\n storyImportPath: string;\n packageName: string;\n /** First module inside the package the story reaches. */\n modulePath: string;\n /** Installed package version at upload time; null when it could not be resolved. */\n version: string | null;\n createdAt: string;\n}\n"],"mappings":";;;;;;;;AAKA,MAAa,eAAe,QAC1B,iBACA;CACE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,cAAc,KAAK,eAAe,CAAC,CAChC,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,YAAY,KAAK,aAAa,CAAC,CAC5B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,aAAa,KAAK,cAAc,CAAC,CAAC,QAAQ;CAC1C,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;AACrF,IACC,MAAM,CAAC,YAAY,sCAAsC,CAAC,CAAC,GAAG,EAAE,cAAc,EAAE,WAAW,CAAC,CAC/F;;AAGA,MAAa,oBAAoB,QAC/B,uBACA;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,iBAAiB,KAAK,mBAAmB,CAAC,CAAC,QAAQ;CACnD,aAAa,KAAK,cAAc,CAAC,CAAC,QAAQ;CAC1C,YAAY,KAAK,aAAa,CAAC,CAAC,QAAQ;CACxC,SAAS,KAAK,SAAS;CACvB,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;AACrF,IACC,MAAM,CAAC,MAAM,kCAAkC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CACjE"}
|
package/dist/schema.d.mts
CHANGED
|
@@ -2,18 +2,26 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { Build, builds } from "./schema/build.mjs";
|
|
4
4
|
import { CaptureAttempt, CaptureLog, captureAttempts, captureLogs } from "./schema/capture-attempt.mjs";
|
|
5
|
+
import { captureJobs } from "./schema/capture-job.mjs";
|
|
6
|
+
import { buildComponents } from "./schema/build-component.mjs";
|
|
7
|
+
import { buildReviews } from "./schema/build-review.mjs";
|
|
8
|
+
import { siteSettings } from "./schema/site-setting.mjs";
|
|
9
|
+
import { captureShards } from "./schema/capture-shard.mjs";
|
|
5
10
|
import { Baseline, baselines } from "./schema/baseline.mjs";
|
|
6
11
|
import { Comment, comments } from "./schema/comment.mjs";
|
|
7
12
|
import { BuildLabel, LabelType, buildLabels, labelTypes } from "./schema/label.mjs";
|
|
8
13
|
import { ProjectMember, projectMembers } from "./schema/member.mjs";
|
|
14
|
+
import { BuildPackageUsage, ProjectLink, buildPackageUsage, projectLinks } from "./schema/usage.mjs";
|
|
15
|
+
import { UserConnection, userConnections } from "./schema/connection.mjs";
|
|
16
|
+
import { DesignCredential, DesignLink, DesignNode, designCredentials, designLinks, designNodes } from "./schema/design.mjs";
|
|
9
17
|
import { ProjectGroupMapping, projectGroupMappings } from "./schema/project-group-mapping.mjs";
|
|
10
18
|
import { Project, StorybookMeta, projects } from "./schema/project.mjs";
|
|
11
19
|
import { Snapshot, snapshots } from "./schema/snapshot.mjs";
|
|
12
|
-
import { ProjectStatusConfig, projectStatusConfigs } from "./schema/status-config.mjs";
|
|
13
20
|
import { Token, tokens } from "./schema/token.mjs";
|
|
14
21
|
import { UserInviteToken, userInviteTokens } from "./schema/user-invite.mjs";
|
|
15
22
|
import { User, users } from "./schema/user.mjs";
|
|
16
23
|
import { Webhook, webhooks } from "./schema/webhook.mjs";
|
|
24
|
+
import { AiBudgetAlert, AiUsage, Insight, aiBudgetAlerts, aiUsage, insights } from "./schema/insight.mjs";
|
|
17
25
|
import { NotificationChannel, NotificationSubscription, notificationChannels, notificationSubscriptions } from "./schema/notification.mjs";
|
|
18
26
|
import { ContentRef, contentRefs } from "./schema/content-refs.mjs";
|
|
19
27
|
import { AnyPgTable } from "drizzle-orm/pg-core";
|
|
@@ -21,17 +29,30 @@ import { AnyPgTable } from "drizzle-orm/pg-core";
|
|
|
21
29
|
/** Full Drizzle schema object passed to the database client. */
|
|
22
30
|
declare const schema: {
|
|
23
31
|
projects: AnyPgTable;
|
|
24
|
-
projectStatusConfigs: AnyPgTable;
|
|
25
32
|
builds: AnyPgTable;
|
|
26
33
|
captureAttempts: AnyPgTable;
|
|
27
34
|
captureLogs: AnyPgTable;
|
|
35
|
+
captureShards: AnyPgTable;
|
|
36
|
+
captureJobs: AnyPgTable;
|
|
37
|
+
buildComponents: AnyPgTable;
|
|
38
|
+
buildReviews: AnyPgTable;
|
|
39
|
+
siteSettings: AnyPgTable;
|
|
28
40
|
snapshots: AnyPgTable;
|
|
29
41
|
baselines: AnyPgTable;
|
|
30
42
|
comments: AnyPgTable;
|
|
31
43
|
labelTypes: AnyPgTable;
|
|
32
44
|
buildLabels: AnyPgTable;
|
|
45
|
+
projectLinks: AnyPgTable;
|
|
46
|
+
designLinks: AnyPgTable;
|
|
47
|
+
designCredentials: AnyPgTable;
|
|
48
|
+
userConnections: AnyPgTable;
|
|
49
|
+
designNodes: AnyPgTable;
|
|
50
|
+
buildPackageUsage: AnyPgTable;
|
|
33
51
|
tokens: AnyPgTable;
|
|
34
52
|
webhooks: AnyPgTable;
|
|
53
|
+
insights: AnyPgTable;
|
|
54
|
+
aiUsage: AnyPgTable;
|
|
55
|
+
aiBudgetAlerts: AnyPgTable;
|
|
35
56
|
notificationChannels: AnyPgTable;
|
|
36
57
|
notificationSubscriptions: AnyPgTable;
|
|
37
58
|
users: AnyPgTable;
|
|
@@ -43,5 +64,5 @@ declare const schema: {
|
|
|
43
64
|
/** The full database schema type. */
|
|
44
65
|
type Schema = typeof schema;
|
|
45
66
|
//#endregion
|
|
46
|
-
export { type Baseline, type Build, type BuildLabel, type CaptureAttempt, type CaptureLog, type Comment, type ContentRef, type LabelType, type NotificationChannel, type NotificationSubscription, type Project, type ProjectGroupMapping, type
|
|
67
|
+
export { type AiBudgetAlert, type AiUsage, type Baseline, type Build, type BuildLabel, type BuildPackageUsage, type CaptureAttempt, type CaptureLog, type Comment, type ContentRef, type DesignCredential, type DesignLink, type DesignNode, type Insight, type LabelType, type NotificationChannel, type NotificationSubscription, type Project, type ProjectGroupMapping, type ProjectLink, type ProjectMember, Schema, type Snapshot, type StorybookMeta, type Token, type User, type UserConnection, type UserInviteToken, type Webhook, aiBudgetAlerts, aiUsage, baselines, buildComponents, buildLabels, buildPackageUsage, buildReviews, builds, captureAttempts, captureJobs, captureLogs, captureShards, comments, contentRefs, designCredentials, designLinks, designNodes, insights, labelTypes, notificationChannels, notificationSubscriptions, projectGroupMappings, projectLinks, projectMembers, projects, schema, siteSettings, snapshots, tokens, userConnections, userInviteTokens, users, webhooks };
|
|
47
68
|
//# sourceMappingURL=schema.d.mts.map
|
package/dist/schema.mjs
CHANGED
|
@@ -4,34 +4,55 @@ import.meta.url;
|
|
|
4
4
|
import { projects } from "./schema/project.mjs";
|
|
5
5
|
import { baselines } from "./schema/baseline.mjs";
|
|
6
6
|
import { builds } from "./schema/build.mjs";
|
|
7
|
+
import { buildComponents } from "./schema/build-component.mjs";
|
|
8
|
+
import { users } from "./schema/user.mjs";
|
|
9
|
+
import { buildReviews } from "./schema/build-review.mjs";
|
|
7
10
|
import { captureAttempts, captureLogs } from "./schema/capture-attempt.mjs";
|
|
11
|
+
import { captureJobs } from "./schema/capture-job.mjs";
|
|
12
|
+
import { captureShards } from "./schema/capture-shard.mjs";
|
|
8
13
|
import { snapshots } from "./schema/snapshot.mjs";
|
|
9
|
-
import { users } from "./schema/user.mjs";
|
|
10
14
|
import { comments } from "./schema/comment.mjs";
|
|
15
|
+
import { userConnections } from "./schema/connection.mjs";
|
|
11
16
|
import { contentRefs } from "./schema/content-refs.mjs";
|
|
17
|
+
import { designCredentials, designLinks, designNodes } from "./schema/design.mjs";
|
|
18
|
+
import { aiBudgetAlerts, aiUsage, insights } from "./schema/insight.mjs";
|
|
12
19
|
import { buildLabels, labelTypes } from "./schema/label.mjs";
|
|
13
20
|
import { projectMembers } from "./schema/member.mjs";
|
|
14
21
|
import { notificationChannels, notificationSubscriptions } from "./schema/notification.mjs";
|
|
15
22
|
import { projectGroupMappings } from "./schema/project-group-mapping.mjs";
|
|
16
|
-
import {
|
|
23
|
+
import { siteSettings } from "./schema/site-setting.mjs";
|
|
17
24
|
import { tokens } from "./schema/token.mjs";
|
|
25
|
+
import { buildPackageUsage, projectLinks } from "./schema/usage.mjs";
|
|
18
26
|
import { userInviteTokens } from "./schema/user-invite.mjs";
|
|
19
27
|
import { webhooks } from "./schema/webhook.mjs";
|
|
20
28
|
//#region src/schema/index.ts
|
|
21
29
|
/** Full Drizzle schema object passed to the database client. */
|
|
22
30
|
const schema = {
|
|
23
31
|
projects,
|
|
24
|
-
projectStatusConfigs,
|
|
25
32
|
builds,
|
|
26
33
|
captureAttempts,
|
|
27
34
|
captureLogs,
|
|
35
|
+
captureShards,
|
|
36
|
+
captureJobs,
|
|
37
|
+
buildComponents,
|
|
38
|
+
buildReviews,
|
|
39
|
+
siteSettings,
|
|
28
40
|
snapshots,
|
|
29
41
|
baselines,
|
|
30
42
|
comments,
|
|
31
43
|
labelTypes,
|
|
32
44
|
buildLabels,
|
|
45
|
+
projectLinks,
|
|
46
|
+
designLinks,
|
|
47
|
+
designCredentials,
|
|
48
|
+
userConnections,
|
|
49
|
+
designNodes,
|
|
50
|
+
buildPackageUsage,
|
|
33
51
|
tokens,
|
|
34
52
|
webhooks,
|
|
53
|
+
insights,
|
|
54
|
+
aiUsage,
|
|
55
|
+
aiBudgetAlerts,
|
|
35
56
|
notificationChannels,
|
|
36
57
|
notificationSubscriptions,
|
|
37
58
|
users,
|
|
@@ -41,6 +62,6 @@ const schema = {
|
|
|
41
62
|
contentRefs
|
|
42
63
|
};
|
|
43
64
|
//#endregion
|
|
44
|
-
export { baselines, buildLabels, builds, captureAttempts, captureLogs, comments, contentRefs, labelTypes, notificationChannels, notificationSubscriptions, projectGroupMappings,
|
|
65
|
+
export { aiBudgetAlerts, aiUsage, baselines, buildComponents, buildLabels, buildPackageUsage, buildReviews, builds, captureAttempts, captureJobs, captureLogs, captureShards, comments, contentRefs, designCredentials, designLinks, designNodes, insights, labelTypes, notificationChannels, notificationSubscriptions, projectGroupMappings, projectLinks, projectMembers, projects, schema, siteSettings, snapshots, tokens, userConnections, userInviteTokens, users, webhooks };
|
|
45
66
|
|
|
46
67
|
//# sourceMappingURL=schema.mjs.map
|
package/dist/schema.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.mjs","names":["projectsTable","
|
|
1
|
+
{"version":3,"file":"schema.mjs","names":["projectsTable","buildsTable","captureAttemptsTable","captureLogsTable","captureShardsTable","captureJobsTable","buildComponentsTable","buildReviewsTable","siteSettingsTable","snapshotsTable","baselinesTable","commentsTable","labelTypesTable","buildLabelsTable","projectLinksTable","designLinksTable","designCredentialsTable","userConnectionsTable","designNodesTable","buildPackageUsageTable","tokensTable","webhooksTable","insightsTable","aiUsageTable","aiBudgetAlertsTable","notificationChannelsTable","notificationSubscriptionsTable","usersTable","userInviteTokensTable","projectMembersTable","projectGroupMappingsTable","contentRefsTable"],"sources":["../src/schema/index.ts"],"sourcesContent":["/**\n * Database schema: table handles, row types, and the schema object passed\n * to the database client.\n *\n * Table handles are available on the `schema` object with full type\n * inference (`schema.builds`, …); exact column types live on the narrow\n * per-entity definitions, and the row interfaces are pinned to them by\n * `schema-types.test.ts`.\n */\nimport type { AnyPgTable } from \"drizzle-orm/pg-core\";\nimport { baselines as baselinesTable } from \"./baseline.ts\";\nimport { buildComponents as buildComponentsTable } from \"./build-component.ts\";\nimport { buildReviews as buildReviewsTable } from \"./build-review.ts\";\nimport { builds as buildsTable } from \"./build.ts\";\nimport {\n captureAttempts as captureAttemptsTable,\n captureLogs as captureLogsTable,\n} from \"./capture-attempt.ts\";\nimport { captureJobs as captureJobsTable } from \"./capture-job.ts\";\nimport { captureShards as captureShardsTable } from \"./capture-shard.ts\";\nimport { comments as commentsTable } from \"./comment.ts\";\nimport { userConnections as userConnectionsTable } from \"./connection.ts\";\nimport { contentRefs as contentRefsTable } from \"./content-refs.ts\";\nimport {\n designLinks as designLinksTable,\n designCredentials as designCredentialsTable,\n designNodes as designNodesTable,\n} from \"./design.ts\";\nimport {\n aiBudgetAlerts as aiBudgetAlertsTable,\n aiUsage as aiUsageTable,\n insights as insightsTable,\n} from \"./insight.ts\";\nimport { buildLabels as buildLabelsTable, labelTypes as labelTypesTable } from \"./label.ts\";\nimport { projectMembers as projectMembersTable } from \"./member.ts\";\nimport {\n notificationChannels as notificationChannelsTable,\n notificationSubscriptions as notificationSubscriptionsTable,\n} from \"./notification.ts\";\nimport { projectGroupMappings as projectGroupMappingsTable } from \"./project-group-mapping.ts\";\nimport { projects as projectsTable } from \"./project.ts\";\nimport { siteSettings as siteSettingsTable } from \"./site-setting.ts\";\nimport { snapshots as snapshotsTable } from \"./snapshot.ts\";\nimport { tokens as tokensTable } from \"./token.ts\";\nimport {\n buildPackageUsage as buildPackageUsageTable,\n projectLinks as projectLinksTable,\n} from \"./usage.ts\";\nimport { userInviteTokens as userInviteTokensTable } from \"./user-invite.ts\";\nimport { users as usersTable } from \"./user.ts\";\nimport { webhooks as webhooksTable } from \"./webhook.ts\";\n\nexport { builds } from \"./build.ts\";\nexport { captureAttempts, captureLogs } from \"./capture-attempt.ts\";\nexport { captureJobs } from \"./capture-job.ts\";\nexport { buildComponents } from \"./build-component.ts\";\nexport { buildReviews } from \"./build-review.ts\";\nexport { siteSettings } from \"./site-setting.ts\";\nexport { captureShards } from \"./capture-shard.ts\";\nexport { baselines } from \"./baseline.ts\";\nexport { comments } from \"./comment.ts\";\nexport { buildLabels, labelTypes } from \"./label.ts\";\nexport { projectMembers } from \"./member.ts\";\nexport { buildPackageUsage, projectLinks } from \"./usage.ts\";\nexport { userConnections } from \"./connection.ts\";\nexport { designCredentials, designLinks, designNodes } from \"./design.ts\";\nexport { projectGroupMappings } from \"./project-group-mapping.ts\";\nexport { projects } from \"./project.ts\";\nexport { snapshots } from \"./snapshot.ts\";\nexport { tokens } from \"./token.ts\";\nexport { userInviteTokens } from \"./user-invite.ts\";\nexport { users } from \"./user.ts\";\nexport { webhooks } from \"./webhook.ts\";\nexport { aiBudgetAlerts, aiUsage, insights } from \"./insight.ts\";\nexport { notificationChannels, notificationSubscriptions } from \"./notification.ts\";\nexport { contentRefs } from \"./content-refs.ts\";\n\n/** A capture attempt and its log lines for a single build run. */\nexport type { CaptureAttempt, CaptureLog } from \"./capture-attempt.ts\";\n/** Build row as stored in the `builds` table. */\nexport type { Build } from \"./build.ts\";\n/** Review comment row as stored in the `comments` table. */\nexport type { Comment } from \"./comment.ts\";\n/** Build label and label type rows. */\nexport type { BuildLabel, LabelType } from \"./label.ts\";\n/** A user's OAuth connection to an external service. */\nexport type { UserConnection } from \"./connection.ts\";\n/** Design link, provider credential and cached design node rows. */\nexport type { DesignCredential, DesignLink, DesignNode } from \"./design.ts\";\n/** Project link and per-build package usage rows. */\nexport type { BuildPackageUsage, ProjectLink } from \"./usage.ts\";\n/** Project membership row linking a user to a project role. */\nexport type { ProjectMember } from \"./member.ts\";\n/** Identity-provider group to project-role mapping row. */\nexport type { ProjectGroupMapping } from \"./project-group-mapping.ts\";\n/** Project row and its embedded Storybook metadata. */\nexport type { Project, StorybookMeta } from \"./project.ts\";\n/** Per-project git provider status-check configuration row. */\n/** Snapshot row capturing a single story at one viewport. */\nexport type { Snapshot } from \"./snapshot.ts\";\n/** CI token row (stores only the hash). */\nexport type { Token } from \"./token.ts\";\n/** One-time invite token for local accounts. */\nexport type { UserInviteToken } from \"./user-invite.ts\";\n/** User row for authenticated identities. */\nexport type { User } from \"./user.ts\";\n/** Webhook subscription row. */\nexport type { Webhook } from \"./webhook.ts\";\n/** Insight, AI usage and budget-alert rows. */\nexport type { AiBudgetAlert, AiUsage, Insight } from \"./insight.ts\";\n/** Notification channel and subscription rows. */\nexport type { NotificationChannel, NotificationSubscription } from \"./notification.ts\";\n/** Baseline row. */\nexport type { Baseline } from \"./baseline.ts\";\n/** Content ref row for deduplicated assets. */\nexport type { ContentRef } from \"./content-refs.ts\";\n\n/** Full Drizzle schema object passed to the database client. */\nexport const schema: {\n projects: AnyPgTable;\n builds: AnyPgTable;\n captureAttempts: AnyPgTable;\n captureLogs: AnyPgTable;\n captureShards: AnyPgTable;\n captureJobs: AnyPgTable;\n buildComponents: AnyPgTable;\n buildReviews: AnyPgTable;\n siteSettings: AnyPgTable;\n snapshots: AnyPgTable;\n baselines: AnyPgTable;\n comments: AnyPgTable;\n labelTypes: AnyPgTable;\n buildLabels: AnyPgTable;\n projectLinks: AnyPgTable;\n designLinks: AnyPgTable;\n designCredentials: AnyPgTable;\n userConnections: AnyPgTable;\n designNodes: AnyPgTable;\n buildPackageUsage: AnyPgTable;\n tokens: AnyPgTable;\n webhooks: AnyPgTable;\n insights: AnyPgTable;\n aiUsage: AnyPgTable;\n aiBudgetAlerts: AnyPgTable;\n notificationChannels: AnyPgTable;\n notificationSubscriptions: AnyPgTable;\n users: AnyPgTable;\n userInviteTokens: AnyPgTable;\n projectMembers: AnyPgTable;\n projectGroupMappings: AnyPgTable;\n contentRefs: AnyPgTable;\n} = {\n projects: projectsTable,\n builds: buildsTable,\n captureAttempts: captureAttemptsTable,\n captureLogs: captureLogsTable,\n captureShards: captureShardsTable,\n captureJobs: captureJobsTable,\n buildComponents: buildComponentsTable,\n buildReviews: buildReviewsTable,\n siteSettings: siteSettingsTable,\n snapshots: snapshotsTable,\n baselines: baselinesTable,\n comments: commentsTable,\n labelTypes: labelTypesTable,\n buildLabels: buildLabelsTable,\n projectLinks: projectLinksTable,\n designLinks: designLinksTable,\n designCredentials: designCredentialsTable,\n userConnections: userConnectionsTable,\n designNodes: designNodesTable,\n buildPackageUsage: buildPackageUsageTable,\n tokens: tokensTable,\n webhooks: webhooksTable,\n insights: insightsTable,\n aiUsage: aiUsageTable,\n aiBudgetAlerts: aiBudgetAlertsTable,\n notificationChannels: notificationChannelsTable,\n notificationSubscriptions: notificationSubscriptionsTable,\n users: usersTable,\n userInviteTokens: userInviteTokensTable,\n projectMembers: projectMembersTable,\n projectGroupMappings: projectGroupMappingsTable,\n contentRefs: contentRefsTable,\n};\n\n/** The full database schema type. */\nexport type Schema = typeof schema;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsHA,MAAa,SAiCT;CACQA;CACFC;CACSC;CACJC;CACEC;CACFC;CACIC;CACHC;CACAC;CACHC;CACAC;CACDC;CACEC;CACCC;CACCC;CACDC;CACMC;CACFC;CACJC;CACMC;CACXC;CACEC;CACAC;CACDC;CACOC;CACMC;CACKC;CACpBC;CACWC;CACFC;CACMC;CACTC;AACf"}
|
package/dist/vercel.mjs
CHANGED
|
@@ -27,7 +27,7 @@ function createVercelDatabase(options = {}) {
|
|
|
27
27
|
return createDrizzlePgAdapter(db, {
|
|
28
28
|
metadata: {
|
|
29
29
|
name: "Vercel Postgres",
|
|
30
|
-
version:
|
|
30
|
+
version: "0.7.0",
|
|
31
31
|
description: "Vercel Postgres database adapter (@vercel/postgres + Drizzle)",
|
|
32
32
|
kind: "vercel",
|
|
33
33
|
category: "database"
|
package/dist/vercel.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vercel.mjs","names":[],"sources":["../src/vercel.ts"],"sourcesContent":["import type { DatabaseAdapter } from \"@storyshelf/core/adapter/database\";\n/**\n * Vercel Postgres preset for the Postgres database adapter.\n *\n * Same schema, DDL, and Drizzle factory as the `postgres.js` default;\n * only the driver differs (`@vercel/postgres`, zero-config on Vercel via\n * `POSTGRES_URL`). Requires the optional `@vercel/postgres` peer\n * (`nub add @vercel/postgres`).\n */\nimport { sql, type VercelClient } from \"@vercel/postgres\";\nimport { drizzle } from \"drizzle-orm/vercel-postgres\";\nimport { createDrizzlePgAdapter } from \"./drizzle-factory-pg.ts\";\nimport { runMigrations } from \"./migrate.ts\";\nimport { schema } from \"./schema/index.ts\";\n\ndeclare const __PKG_VERSION__: string | undefined;\n\n/**\n * Options for creating a Vercel-backed DatabaseAdapter.\n *\n * With no options, the platform default `sql` client (bound to\n * `POSTGRES_URL`) is used and the caller owns nothing. Pass `client` to\n * inject a preconfigured client instead (teardown stays a no-op either\n * way — the platform owns the connection).\n */\nexport interface VercelDatabaseOptions {\n client?: VercelClient;\n}\n\n/**\n * Create a Vercel-backed DatabaseAdapter using Drizzle ORM.\n *\n * @param options - Optionally a preconfigured `@vercel/postgres` client.\n * @returns A DatabaseAdapter backed by Vercel Postgres.\n */\nexport function createVercelDatabase(options: VercelDatabaseOptions = {}): DatabaseAdapter {\n const client = options.client ?? sql;\n const db = drizzle(client, { schema });\n\n return createDrizzlePgAdapter(db, {\n metadata: {\n name: \"Vercel Postgres\",\n version:
|
|
1
|
+
{"version":3,"file":"vercel.mjs","names":[],"sources":["../src/vercel.ts"],"sourcesContent":["import type { DatabaseAdapter } from \"@storyshelf/core/adapter/database\";\n/**\n * Vercel Postgres preset for the Postgres database adapter.\n *\n * Same schema, DDL, and Drizzle factory as the `postgres.js` default;\n * only the driver differs (`@vercel/postgres`, zero-config on Vercel via\n * `POSTGRES_URL`). Requires the optional `@vercel/postgres` peer\n * (`nub add @vercel/postgres`).\n */\nimport { sql, type VercelClient } from \"@vercel/postgres\";\nimport { drizzle } from \"drizzle-orm/vercel-postgres\";\nimport { createDrizzlePgAdapter } from \"./drizzle-factory-pg.ts\";\nimport { runMigrations } from \"./migrate.ts\";\nimport { schema } from \"./schema/index.ts\";\n\ndeclare const __PKG_VERSION__: string | undefined;\n\n/**\n * Options for creating a Vercel-backed DatabaseAdapter.\n *\n * With no options, the platform default `sql` client (bound to\n * `POSTGRES_URL`) is used and the caller owns nothing. Pass `client` to\n * inject a preconfigured client instead (teardown stays a no-op either\n * way — the platform owns the connection).\n */\nexport interface VercelDatabaseOptions {\n client?: VercelClient;\n}\n\n/**\n * Create a Vercel-backed DatabaseAdapter using Drizzle ORM.\n *\n * @param options - Optionally a preconfigured `@vercel/postgres` client.\n * @returns A DatabaseAdapter backed by Vercel Postgres.\n */\nexport function createVercelDatabase(options: VercelDatabaseOptions = {}): DatabaseAdapter {\n const client = options.client ?? sql;\n const db = drizzle(client, { schema });\n\n return createDrizzlePgAdapter(db, {\n metadata: {\n name: \"Vercel Postgres\",\n version: typeof __PKG_VERSION__ === \"string\" ? __PKG_VERSION__ : \"0.0.0\",\n description: \"Vercel Postgres database adapter (@vercel/postgres + Drizzle)\",\n kind: \"vercel\",\n category: \"database\",\n },\n tables: schema,\n migrate: async () => {\n await runMigrations(async (statement) => (await client.query(statement)).rows);\n },\n close: () => {\n // no-op: the platform owns the connection\n },\n ping: async () => {\n await client.query(\"SELECT 1\");\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAgB,qBAAqB,UAAiC,CAAC,GAAoB;CACzF,MAAM,SAAS,QAAQ,UAAU;CACjC,MAAM,KAAK,QAAQ,QAAQ,EAAE,OAAO,CAAC;CAErC,OAAO,uBAAuB,IAAI;EAChC,UAAU;GACR,MAAM;GACN,SAAA;GACA,aAAa;GACb,MAAM;GACN,UAAU;EACZ;EACA,QAAQ;EACR,SAAS,YAAY;GACnB,MAAM,cAAc,OAAO,eAAe,MAAM,OAAO,MAAM,SAAS,EAAA,CAAG,IAAI;EAC/E;EACA,aAAa,CAEb;EACA,MAAM,YAAY;GAChB,MAAM,OAAO,MAAM,UAAU;EAC/B;CACF,CAAC;AACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyshelf/db-postgres",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Postgres database adapter for StoryShelf (postgres.js + Drizzle, RDS/Cloud SQL/Supabase/Neon compatible).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"database",
|
|
@@ -26,9 +26,6 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"type": "module",
|
|
29
|
-
"engines": {
|
|
30
|
-
"node": ">=24"
|
|
31
|
-
},
|
|
32
29
|
"sideEffects": false,
|
|
33
30
|
"types": "./dist/index.d.mts",
|
|
34
31
|
"exports": {
|
|
@@ -89,7 +86,7 @@
|
|
|
89
86
|
"prepublishOnly": "nub run build"
|
|
90
87
|
},
|
|
91
88
|
"dependencies": {
|
|
92
|
-
"@storyshelf/core": "0.
|
|
89
|
+
"@storyshelf/core": "0.7.0",
|
|
93
90
|
"drizzle-orm": "^0.44.0",
|
|
94
91
|
"postgres": "^3.4.0"
|
|
95
92
|
},
|
|
@@ -127,6 +124,9 @@
|
|
|
127
124
|
"optional": true
|
|
128
125
|
}
|
|
129
126
|
},
|
|
127
|
+
"engines": {
|
|
128
|
+
"node": ">=24"
|
|
129
|
+
},
|
|
130
130
|
"jsr": {
|
|
131
131
|
"runtimeCompat": {
|
|
132
132
|
"node": true,
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import "node:path";
|
|
2
|
-
import "node:url";
|
|
3
|
-
import.meta.url;
|
|
4
|
-
import { projects } from "./project.mjs";
|
|
5
|
-
import { pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
|
6
|
-
//#region src/schema/status-config.ts
|
|
7
|
-
/** Narrow `project_status_configs` table definition. */
|
|
8
|
-
const projectStatusConfigs = pgTable("project_status_configs", {
|
|
9
|
-
id: text("id").primaryKey(),
|
|
10
|
-
projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
11
|
-
provider: text("provider").notNull(),
|
|
12
|
-
config: text("config").notNull(),
|
|
13
|
-
tokenEncrypted: text("token_encrypted").notNull(),
|
|
14
|
-
createdAt: timestamp("created_at", {
|
|
15
|
-
withTimezone: true,
|
|
16
|
-
mode: "string"
|
|
17
|
-
}).notNull(),
|
|
18
|
-
updatedAt: timestamp("updated_at", {
|
|
19
|
-
withTimezone: true,
|
|
20
|
-
mode: "string"
|
|
21
|
-
}).notNull()
|
|
22
|
-
});
|
|
23
|
-
//#endregion
|
|
24
|
-
export { projectStatusConfigs };
|
|
25
|
-
|
|
26
|
-
//# sourceMappingURL=status-config.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status-config.mjs","names":[],"sources":["../../src/schema/status-config.ts"],"sourcesContent":["import { pgTable, text, timestamp } from \"drizzle-orm/pg-core\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `project_status_configs` table definition. */\nexport const projectStatusConfigs = pgTable(\"project_status_configs\", {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n provider: text(\"provider\").notNull(),\n config: text(\"config\").notNull(),\n tokenEncrypted: text(\"token_encrypted\").notNull(),\n createdAt: timestamp(\"created_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true, mode: \"string\" }).notNull(),\n});\n\n/** A project status-config row. */\nexport interface ProjectStatusConfig {\n id: string;\n projectId: string;\n provider: string;\n config: string;\n tokenEncrypted: string;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;AAIA,MAAa,uBAAuB,QAAQ,0BAA0B;CACpE,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,UAAU,KAAK,UAAU,CAAC,CAAC,QAAQ;CACnC,QAAQ,KAAK,QAAQ,CAAC,CAAC,QAAQ;CAC/B,gBAAgB,KAAK,iBAAiB,CAAC,CAAC,QAAQ;CAChD,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;CACnF,WAAW,UAAU,cAAc;EAAE,cAAc;EAAM,MAAM;CAAS,CAAC,CAAC,CAAC,QAAQ;AACrF,CAAC"}
|