@storyshelf/db-mysql 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 +36 -0
- package/dist/ddl.d.mts +1 -3
- package/dist/ddl.mjs +391 -141
- package/dist/ddl.mjs.map +1 -1
- package/dist/drizzle-factory-mysql.mjs +15 -8
- package/dist/drizzle-factory-mysql.mjs.map +1 -1
- package/dist/drizzle-factory.mjs +1 -2
- package/dist/foreign-keys.mjs +338 -0
- package/dist/foreign-keys.mjs.map +1 -0
- package/dist/index.d.mts +0 -2
- package/dist/index.mjs +11 -7
- package/dist/index.mjs.map +1 -1
- package/dist/migrate.mjs +349 -73
- package/dist/migrate.mjs.map +1 -1
- package/dist/planetscale.d.mts +0 -2
- package/dist/planetscale.mjs +1 -2
- package/dist/schema/baseline.d.mts +89 -19
- package/dist/schema/baseline.mjs +8 -4
- package/dist/schema/baseline.mjs.map +1 -1
- package/dist/schema/{status-config.d.mts → build-component.d.mts} +47 -42
- package/dist/schema/build-component.mjs +25 -0
- package/dist/schema/build-component.mjs.map +1 -0
- package/dist/schema/build-review.d.mts +116 -0
- package/dist/schema/build-review.mjs +23 -0
- package/dist/schema/build-review.mjs.map +1 -0
- package/dist/schema/build.d.mts +65 -31
- package/dist/schema/build.mjs +6 -3
- package/dist/schema/build.mjs.map +1 -1
- package/dist/schema/capture-attempt.d.mts +43 -45
- package/dist/schema/capture-attempt.mjs +3 -3
- package/dist/schema/capture-attempt.mjs.map +1 -1
- package/dist/schema/capture-job.d.mts +328 -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 +255 -0
- package/dist/schema/capture-shard.mjs +40 -0
- package/dist/schema/capture-shard.mjs.map +1 -0
- package/dist/schema/comment.d.mts +35 -19
- package/dist/schema/comment.mjs +6 -5
- package/dist/schema/comment.mjs.map +1 -1
- package/dist/schema/connection.d.mts +171 -0
- package/dist/schema/connection.mjs +35 -0
- package/dist/schema/connection.mjs.map +1 -0
- package/dist/schema/content-refs.d.mts +11 -13
- package/dist/schema/content-refs.mjs +3 -3
- package/dist/schema/content-refs.mjs.map +1 -1
- package/dist/schema/datetime.mjs +46 -0
- package/dist/schema/datetime.mjs.map +1 -0
- package/dist/schema/design.d.mts +587 -0
- package/dist/schema/design.mjs +73 -0
- package/dist/schema/design.mjs.map +1 -0
- package/dist/schema/insight.d.mts +631 -0
- package/dist/schema/insight.mjs +68 -0
- package/dist/schema/insight.mjs.map +1 -0
- package/dist/schema/label.d.mts +21 -23
- package/dist/schema/label.mjs +3 -3
- package/dist/schema/label.mjs.map +1 -1
- package/dist/schema/member.d.mts +10 -12
- package/dist/schema/member.mjs +3 -3
- package/dist/schema/member.mjs.map +1 -1
- package/dist/schema/notification.d.mts +63 -29
- package/dist/schema/notification.mjs +8 -3
- package/dist/schema/notification.mjs.map +1 -1
- package/dist/schema/project-group-mapping.d.mts +9 -11
- package/dist/schema/project-group-mapping.mjs +3 -3
- package/dist/schema/project-group-mapping.mjs.map +1 -1
- package/dist/schema/project.d.mts +149 -25
- package/dist/schema/project.mjs +11 -4
- package/dist/schema/project.mjs.map +1 -1
- package/dist/schema/site-setting.d.mts +97 -0
- package/dist/schema/site-setting.mjs +23 -0
- package/dist/schema/site-setting.mjs.map +1 -0
- package/dist/schema/snapshot.d.mts +195 -35
- package/dist/schema/snapshot.mjs +17 -4
- package/dist/schema/snapshot.mjs.map +1 -1
- package/dist/schema/token.d.mts +14 -16
- package/dist/schema/token.mjs +3 -3
- package/dist/schema/token.mjs.map +1 -1
- package/dist/schema/usage.d.mts +265 -0
- package/dist/schema/usage.mjs +36 -0
- package/dist/schema/usage.mjs.map +1 -0
- package/dist/schema/user-invite.d.mts +16 -18
- package/dist/schema/user-invite.mjs +3 -3
- package/dist/schema/user-invite.mjs.map +1 -1
- package/dist/schema/user.d.mts +88 -16
- package/dist/schema/user.mjs +8 -4
- package/dist/schema/user.mjs.map +1 -1
- package/dist/schema/webhook.d.mts +14 -16
- package/dist/schema/webhook.mjs +3 -3
- package/dist/schema/webhook.mjs.map +1 -1
- package/dist/schema.d.mts +24 -5
- package/dist/schema.mjs +26 -6
- package/dist/schema.mjs.map +1 -1
- package/dist/tidb.d.mts +0 -2
- package/dist/tidb.mjs +1 -2
- package/package.json +7 -7
- package/dist/schema/status-config.mjs +0 -26
- package/dist/schema/status-config.mjs.map +0 -1
|
@@ -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/webhook.d.ts
|
|
4
3
|
/** Narrow `webhooks` table definition. */
|
|
5
|
-
declare const webhooks: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
4
|
+
declare const webhooks: import("drizzle-orm/mysql-core/table.js").MySqlTableWithColumns<{
|
|
6
5
|
name: "webhooks";
|
|
7
6
|
schema: undefined;
|
|
8
7
|
columns: {
|
|
9
|
-
id: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
8
|
+
id: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
10
9
|
name: "id";
|
|
11
10
|
tableName: "webhooks";
|
|
12
11
|
dataType: "string";
|
|
@@ -23,7 +22,7 @@ declare const webhooks: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
23
22
|
identity: undefined;
|
|
24
23
|
generated: undefined;
|
|
25
24
|
}, {}, {}>;
|
|
26
|
-
projectId: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
25
|
+
projectId: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
27
26
|
name: "project_id";
|
|
28
27
|
tableName: "webhooks";
|
|
29
28
|
dataType: "string";
|
|
@@ -40,7 +39,7 @@ declare const webhooks: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
40
39
|
identity: undefined;
|
|
41
40
|
generated: undefined;
|
|
42
41
|
}, {}, {}>;
|
|
43
|
-
url: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
42
|
+
url: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
44
43
|
name: "url";
|
|
45
44
|
tableName: "webhooks";
|
|
46
45
|
dataType: "string";
|
|
@@ -57,7 +56,7 @@ declare const webhooks: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
57
56
|
identity: undefined;
|
|
58
57
|
generated: undefined;
|
|
59
58
|
}, {}, {}>;
|
|
60
|
-
secretEncrypted: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
59
|
+
secretEncrypted: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
61
60
|
name: "secret_encrypted";
|
|
62
61
|
tableName: "webhooks";
|
|
63
62
|
dataType: "string";
|
|
@@ -74,7 +73,7 @@ declare const webhooks: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
74
73
|
identity: undefined;
|
|
75
74
|
generated: undefined;
|
|
76
75
|
}, {}, {}>;
|
|
77
|
-
events: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
76
|
+
events: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
78
77
|
name: "events";
|
|
79
78
|
tableName: "webhooks";
|
|
80
79
|
dataType: "string";
|
|
@@ -91,13 +90,13 @@ declare const webhooks: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
91
90
|
identity: undefined;
|
|
92
91
|
generated: undefined;
|
|
93
92
|
}, {}, {}>;
|
|
94
|
-
createdAt: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
93
|
+
createdAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
95
94
|
name: "created_at";
|
|
96
95
|
tableName: "webhooks";
|
|
97
|
-
dataType: "
|
|
98
|
-
columnType: "
|
|
96
|
+
dataType: "custom";
|
|
97
|
+
columnType: "MySqlCustomColumn";
|
|
99
98
|
data: string;
|
|
100
|
-
driverParam: string
|
|
99
|
+
driverParam: string;
|
|
101
100
|
notNull: true;
|
|
102
101
|
hasDefault: false;
|
|
103
102
|
isPrimaryKey: false;
|
|
@@ -108,13 +107,13 @@ declare const webhooks: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
|
|
|
108
107
|
identity: undefined;
|
|
109
108
|
generated: undefined;
|
|
110
109
|
}, {}, {}>;
|
|
111
|
-
updatedAt: import("drizzle-orm/mysql-core").MySqlColumn<{
|
|
110
|
+
updatedAt: import("drizzle-orm/mysql-core/index.js").MySqlColumn<{
|
|
112
111
|
name: "updated_at";
|
|
113
112
|
tableName: "webhooks";
|
|
114
|
-
dataType: "
|
|
115
|
-
columnType: "
|
|
113
|
+
dataType: "custom";
|
|
114
|
+
columnType: "MySqlCustomColumn";
|
|
116
115
|
data: string;
|
|
117
|
-
driverParam: string
|
|
116
|
+
driverParam: string;
|
|
118
117
|
notNull: true;
|
|
119
118
|
hasDefault: false;
|
|
120
119
|
isPrimaryKey: false;
|
|
@@ -138,6 +137,5 @@ interface Webhook {
|
|
|
138
137
|
createdAt: string;
|
|
139
138
|
updatedAt: string;
|
|
140
139
|
}
|
|
141
|
-
//#endregion
|
|
142
140
|
export { Webhook, webhooks };
|
|
143
141
|
//# sourceMappingURL=webhook.d.mts.map
|
package/dist/schema/webhook.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "node:path";
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
|
+
import { datetime } from "./datetime.mjs";
|
|
4
5
|
import { projects } from "./project.mjs";
|
|
5
|
-
import {
|
|
6
|
-
|
|
6
|
+
import { mysqlTable, text } from "drizzle-orm/mysql-core";
|
|
7
|
+
// src/schema/webhook.ts
|
|
7
8
|
/** Narrow `webhooks` table definition. */
|
|
8
9
|
const webhooks = mysqlTable("webhooks", {
|
|
9
10
|
id: text("id").primaryKey(),
|
|
@@ -20,7 +21,6 @@ const webhooks = mysqlTable("webhooks", {
|
|
|
20
21
|
fsp: 3
|
|
21
22
|
}).notNull()
|
|
22
23
|
});
|
|
23
|
-
//#endregion
|
|
24
24
|
export { webhooks };
|
|
25
25
|
|
|
26
26
|
//# sourceMappingURL=webhook.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.mjs","names":[],"sources":["../../src/schema/webhook.ts"],"sourcesContent":["import { mysqlTable, text
|
|
1
|
+
{"version":3,"file":"webhook.mjs","names":[],"sources":["../../src/schema/webhook.ts"],"sourcesContent":["import { mysqlTable, text } from \"drizzle-orm/mysql-core\";\nimport { datetime } from \"./datetime.ts\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `webhooks` table definition. */\nexport const webhooks = mysqlTable(\"webhooks\", {\n id: text(\"id\").primaryKey(),\n projectId: text(\"project_id\")\n .notNull()\n .references(() => projects.id, { onDelete: \"cascade\" }),\n url: text(\"url\").notNull(),\n secretEncrypted: text(\"secret_encrypted\").notNull(),\n events: text(\"events\"),\n createdAt: datetime(\"created_at\", { mode: \"string\", fsp: 3 }).notNull(),\n updatedAt: datetime(\"updated_at\", { mode: \"string\", fsp: 3 }).notNull(),\n});\n\n/** A webhook subscription row. */\nexport interface Webhook {\n id: string;\n projectId: string;\n url: string;\n secretEncrypted: string;\n events: string | null;\n createdAt: string;\n updatedAt: string;\n}\n"],"mappings":";;;;;;;;AAKA,MAAa,WAAW,WAAW,YAAY;CAC7C,IAAI,KAAK,IAAI,CAAC,CAAC,WAAW;CAC1B,WAAW,KAAK,YAAY,CAAC,CAC1B,QAAQ,CAAC,CACT,iBAAiB,SAAS,IAAI,EAAE,UAAU,UAAU,CAAC;CACxD,KAAK,KAAK,KAAK,CAAC,CAAC,QAAQ;CACzB,iBAAiB,KAAK,kBAAkB,CAAC,CAAC,QAAQ;CAClD,QAAQ,KAAK,QAAQ;CACrB,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;CACtE,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;AACxE,CAAC"}
|
package/dist/schema.d.mts
CHANGED
|
@@ -2,36 +2,56 @@ 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 { AnyMySqlTable } from "drizzle-orm/mysql-core";
|
|
20
|
-
//#region src/schema/index.d.ts
|
|
21
28
|
/** Full Drizzle schema object passed to the database client. */
|
|
22
29
|
declare const schema: {
|
|
23
30
|
projects: AnyMySqlTable;
|
|
24
|
-
projectStatusConfigs: AnyMySqlTable;
|
|
25
31
|
builds: AnyMySqlTable;
|
|
26
32
|
captureAttempts: AnyMySqlTable;
|
|
27
33
|
captureLogs: AnyMySqlTable;
|
|
34
|
+
captureShards: AnyMySqlTable;
|
|
35
|
+
captureJobs: AnyMySqlTable;
|
|
36
|
+
buildComponents: AnyMySqlTable;
|
|
37
|
+
buildReviews: AnyMySqlTable;
|
|
38
|
+
siteSettings: AnyMySqlTable;
|
|
28
39
|
snapshots: AnyMySqlTable;
|
|
29
40
|
baselines: AnyMySqlTable;
|
|
30
41
|
comments: AnyMySqlTable;
|
|
31
42
|
labelTypes: AnyMySqlTable;
|
|
32
43
|
buildLabels: AnyMySqlTable;
|
|
44
|
+
projectLinks: AnyMySqlTable;
|
|
45
|
+
designLinks: AnyMySqlTable;
|
|
46
|
+
designCredentials: AnyMySqlTable;
|
|
47
|
+
userConnections: AnyMySqlTable;
|
|
48
|
+
designNodes: AnyMySqlTable;
|
|
49
|
+
buildPackageUsage: AnyMySqlTable;
|
|
33
50
|
tokens: AnyMySqlTable;
|
|
34
51
|
webhooks: AnyMySqlTable;
|
|
52
|
+
insights: AnyMySqlTable;
|
|
53
|
+
aiUsage: AnyMySqlTable;
|
|
54
|
+
aiBudgetAlerts: AnyMySqlTable;
|
|
35
55
|
notificationChannels: AnyMySqlTable;
|
|
36
56
|
notificationSubscriptions: AnyMySqlTable;
|
|
37
57
|
users: AnyMySqlTable;
|
|
@@ -42,6 +62,5 @@ declare const schema: {
|
|
|
42
62
|
};
|
|
43
63
|
/** The full database schema type. */
|
|
44
64
|
type Schema = typeof schema;
|
|
45
|
-
|
|
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 ProjectMember, type ProjectStatusConfig, Schema, type Snapshot, type StorybookMeta, type Token, type User, type UserInviteToken, type Webhook, baselines, buildLabels, builds, captureAttempts, captureLogs, comments, contentRefs, labelTypes, notificationChannels, notificationSubscriptions, projectGroupMappings, projectMembers, projectStatusConfigs, projects, schema, snapshots, tokens, userInviteTokens, users, webhooks };
|
|
65
|
+
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
66
|
//# 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
|
+
// 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,
|
|
@@ -40,7 +61,6 @@ const schema = {
|
|
|
40
61
|
projectGroupMappings,
|
|
41
62
|
contentRefs
|
|
42
63
|
};
|
|
43
|
-
|
|
44
|
-
export { baselines, buildLabels, builds, captureAttempts, captureLogs, comments, contentRefs, labelTypes, notificationChannels, notificationSubscriptions, projectGroupMappings, projectMembers, projectStatusConfigs, projects, schema, snapshots, tokens, userInviteTokens, users, webhooks };
|
|
64
|
+
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
65
|
|
|
46
66
|
//# 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 { AnyMySqlTable } from \"drizzle-orm/mysql-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: AnyMySqlTable;\n builds: AnyMySqlTable;\n captureAttempts: AnyMySqlTable;\n captureLogs: AnyMySqlTable;\n captureShards: AnyMySqlTable;\n captureJobs: AnyMySqlTable;\n buildComponents: AnyMySqlTable;\n buildReviews: AnyMySqlTable;\n siteSettings: AnyMySqlTable;\n snapshots: AnyMySqlTable;\n baselines: AnyMySqlTable;\n comments: AnyMySqlTable;\n labelTypes: AnyMySqlTable;\n buildLabels: AnyMySqlTable;\n projectLinks: AnyMySqlTable;\n designLinks: AnyMySqlTable;\n designCredentials: AnyMySqlTable;\n userConnections: AnyMySqlTable;\n designNodes: AnyMySqlTable;\n buildPackageUsage: AnyMySqlTable;\n tokens: AnyMySqlTable;\n webhooks: AnyMySqlTable;\n insights: AnyMySqlTable;\n aiUsage: AnyMySqlTable;\n aiBudgetAlerts: AnyMySqlTable;\n notificationChannels: AnyMySqlTable;\n notificationSubscriptions: AnyMySqlTable;\n users: AnyMySqlTable;\n userInviteTokens: AnyMySqlTable;\n projectMembers: AnyMySqlTable;\n projectGroupMappings: AnyMySqlTable;\n contentRefs: AnyMySqlTable;\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/tidb.d.mts
CHANGED
|
@@ -2,7 +2,6 @@ import __tsdown_shims_path from 'node:path';
|
|
|
2
2
|
import __tsdown_shims_url from 'node:url';
|
|
3
3
|
import { MysqlDatabaseOptions } from "./index.mjs";
|
|
4
4
|
import { DatabaseAdapter } from "@storyshelf/core/adapter/database";
|
|
5
|
-
//#region src/tidb.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* TiDB Serverless (MySQL wire, serverless) preset.
|
|
8
7
|
* Alias over the mysql2 pool — TiDB's serverless driver
|
|
@@ -11,6 +10,5 @@ import { DatabaseAdapter } from "@storyshelf/core/adapter/database";
|
|
|
11
10
|
*/
|
|
12
11
|
type TidbDatabaseOptions = MysqlDatabaseOptions;
|
|
13
12
|
declare function createTidbDatabase(options: TidbDatabaseOptions): DatabaseAdapter;
|
|
14
|
-
//#endregion
|
|
15
13
|
export { TidbDatabaseOptions, createTidbDatabase };
|
|
16
14
|
//# sourceMappingURL=tidb.d.mts.map
|
package/dist/tidb.mjs
CHANGED
|
@@ -2,11 +2,10 @@ import "node:path";
|
|
|
2
2
|
import "node:url";
|
|
3
3
|
import.meta.url;
|
|
4
4
|
import { createMysqlDatabase } from "./index.mjs";
|
|
5
|
-
|
|
5
|
+
// src/tidb.ts
|
|
6
6
|
function createTidbDatabase(options) {
|
|
7
7
|
return createMysqlDatabase(options);
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { createTidbDatabase };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=tidb.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyshelf/db-mysql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "MySQL/MariaDB database adapter for StoryShelf (mysql2 + Drizzle, PlanetScale/TiDB compatible).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"database",
|
|
@@ -27,9 +27,6 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"type": "module",
|
|
30
|
-
"engines": {
|
|
31
|
-
"node": ">=24"
|
|
32
|
-
},
|
|
33
30
|
"sideEffects": false,
|
|
34
31
|
"types": "./dist/index.d.mts",
|
|
35
32
|
"exports": {
|
|
@@ -75,8 +72,8 @@
|
|
|
75
72
|
"prepublishOnly": "nub run build"
|
|
76
73
|
},
|
|
77
74
|
"dependencies": {
|
|
78
|
-
"@storyshelf/core": "0.
|
|
79
|
-
"drizzle-orm": "^0.
|
|
75
|
+
"@storyshelf/core": "0.8.0",
|
|
76
|
+
"drizzle-orm": "^0.45.4",
|
|
80
77
|
"mysql2": "^3.9.0"
|
|
81
78
|
},
|
|
82
79
|
"devDependencies": {
|
|
@@ -90,7 +87,7 @@
|
|
|
90
87
|
"oxlint-tsgolint": "^7.0.2001",
|
|
91
88
|
"tsdown": "^0.22.14",
|
|
92
89
|
"typescript": "^7.0.2",
|
|
93
|
-
"vitest": "^5.0.
|
|
90
|
+
"vitest": "^5.0.5"
|
|
94
91
|
},
|
|
95
92
|
"peerDependencies": {
|
|
96
93
|
"@planetscale/database": "^1.19.0",
|
|
@@ -104,6 +101,9 @@
|
|
|
104
101
|
"optional": true
|
|
105
102
|
}
|
|
106
103
|
},
|
|
104
|
+
"engines": {
|
|
105
|
+
"node": ">=24"
|
|
106
|
+
},
|
|
107
107
|
"jsr": {
|
|
108
108
|
"runtimeCompat": {
|
|
109
109
|
"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 { datetime, mysqlTable, text } from "drizzle-orm/mysql-core";
|
|
6
|
-
//#region src/schema/status-config.ts
|
|
7
|
-
/** Narrow `project_status_configs` table definition. */
|
|
8
|
-
const projectStatusConfigs = mysqlTable("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: datetime("created_at", {
|
|
15
|
-
mode: "string",
|
|
16
|
-
fsp: 3
|
|
17
|
-
}).notNull(),
|
|
18
|
-
updatedAt: datetime("updated_at", {
|
|
19
|
-
mode: "string",
|
|
20
|
-
fsp: 3
|
|
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 { mysqlTable, text, datetime } from \"drizzle-orm/mysql-core\";\nimport { projects } from \"./project.ts\";\n\n/** Narrow `project_status_configs` table definition. */\nexport const projectStatusConfigs = mysqlTable(\"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: datetime(\"created_at\", { mode: \"string\", fsp: 3 }).notNull(),\n updatedAt: datetime(\"updated_at\", { mode: \"string\", fsp: 3 }).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,WAAW,0BAA0B;CACvE,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,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;CACtE,WAAW,SAAS,cAAc;EAAE,MAAM;EAAU,KAAK;CAAE,CAAC,CAAC,CAAC,QAAQ;AACxE,CAAC"}
|