@authhero/drizzle 1.12.0 → 1.13.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/dist/drizzle-adapter.cjs +2 -2
- package/dist/drizzle-adapter.mjs +926 -729
- package/drizzle/0011_org_connections_log_streams_migration_sources.sql +39 -0
- package/drizzle/meta/0011_snapshot.json +7055 -0
- package/drizzle/meta/_journal.json +8 -1
- package/package.json +3 -3
- package/src/schema/sqlite/index.ts +6 -0
- package/src/schema/sqlite/logStreams.ts +18 -0
- package/src/schema/sqlite/migrationSources.ts +17 -0
- package/src/schema/sqlite/organizations.ts +23 -0
|
@@ -78,6 +78,13 @@
|
|
|
78
78
|
"when": 1791894544632,
|
|
79
79
|
"tag": "0010_prompt_partials",
|
|
80
80
|
"breakpoints": true
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"idx": 11,
|
|
84
|
+
"version": "6",
|
|
85
|
+
"when": 1792056769015,
|
|
86
|
+
"tag": "0011_org_connections_log_streams_migration_sources",
|
|
87
|
+
"breakpoints": true
|
|
81
88
|
}
|
|
82
89
|
]
|
|
83
|
-
}
|
|
90
|
+
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "https://github.com/sesamyab/authhero"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.13.0",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
17
|
"src/schema",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"drizzle-orm": "^0.45.2",
|
|
37
37
|
"nanoid": "^5.1.11",
|
|
38
|
-
"@authhero/
|
|
39
|
-
"@authhero/
|
|
38
|
+
"@authhero/proxy": "0.11.6",
|
|
39
|
+
"@authhero/adapter-interfaces": "4.20.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@hono/zod-openapi": "^1.4.0",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { sqliteTable, text, integer, index } from "drizzle-orm/sqlite-core";
|
|
2
|
+
|
|
3
|
+
export const logStreams = sqliteTable(
|
|
4
|
+
"log_streams",
|
|
5
|
+
{
|
|
6
|
+
id: text("id", { length: 64 }).primaryKey(),
|
|
7
|
+
tenant_id: text("tenant_id", { length: 191 }).notNull(),
|
|
8
|
+
name: text("name", { length: 255 }).notNull(),
|
|
9
|
+
type: text("type", { length: 64 }).notNull(),
|
|
10
|
+
status: text("status", { length: 32 }).notNull(),
|
|
11
|
+
sink: text("sink").notNull(),
|
|
12
|
+
filters: text("filters"),
|
|
13
|
+
is_priority: integer("is_priority"),
|
|
14
|
+
created_at: text("created_at", { length: 35 }).notNull(),
|
|
15
|
+
updated_at: text("updated_at", { length: 35 }).notNull(),
|
|
16
|
+
},
|
|
17
|
+
(table) => [index("idx_log_streams_tenant_id").on(table.tenant_id)],
|
|
18
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { sqliteTable, text, integer, index } from "drizzle-orm/sqlite-core";
|
|
2
|
+
|
|
3
|
+
export const migrationSources = sqliteTable(
|
|
4
|
+
"migration_sources",
|
|
5
|
+
{
|
|
6
|
+
id: text("id", { length: 64 }).primaryKey(),
|
|
7
|
+
tenant_id: text("tenant_id", { length: 191 }).notNull(),
|
|
8
|
+
name: text("name", { length: 255 }).notNull(),
|
|
9
|
+
provider: text("provider", { length: 32 }).notNull(),
|
|
10
|
+
connection: text("connection", { length: 255 }).notNull(),
|
|
11
|
+
enabled: integer("enabled").notNull(),
|
|
12
|
+
credentials: text("credentials").notNull(),
|
|
13
|
+
created_at: text("created_at", { length: 35 }).notNull(),
|
|
14
|
+
updated_at: text("updated_at", { length: 35 }).notNull(),
|
|
15
|
+
},
|
|
16
|
+
(table) => [index("idx_migration_sources_tenant_id").on(table.tenant_id)],
|
|
17
|
+
);
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
integer,
|
|
5
5
|
uniqueIndex,
|
|
6
6
|
index,
|
|
7
|
+
primaryKey,
|
|
7
8
|
} from "drizzle-orm/sqlite-core";
|
|
8
9
|
|
|
9
10
|
export const organizations = sqliteTable(
|
|
@@ -72,3 +73,25 @@ export const invites = sqliteTable(
|
|
|
72
73
|
index("idx_invites_tenant_created").on(table.tenant_id, table.created_at),
|
|
73
74
|
],
|
|
74
75
|
);
|
|
76
|
+
|
|
77
|
+
// Junction table: organizations ↔ connections ("enabled_connections").
|
|
78
|
+
export const organizationConnections = sqliteTable(
|
|
79
|
+
"organization_connections",
|
|
80
|
+
{
|
|
81
|
+
tenant_id: text("tenant_id", { length: 191 }).notNull(),
|
|
82
|
+
organization_id: text("organization_id", { length: 21 }).notNull(),
|
|
83
|
+
connection_id: text("connection_id", { length: 191 }).notNull(),
|
|
84
|
+
assign_membership_on_login: integer("assign_membership_on_login")
|
|
85
|
+
.notNull()
|
|
86
|
+
.default(0),
|
|
87
|
+
show_as_button: integer("show_as_button").notNull().default(1),
|
|
88
|
+
is_signup_enabled: integer("is_signup_enabled").notNull().default(1),
|
|
89
|
+
created_at: text("created_at", { length: 35 }).notNull(),
|
|
90
|
+
updated_at: text("updated_at", { length: 35 }).notNull(),
|
|
91
|
+
},
|
|
92
|
+
(table) => [
|
|
93
|
+
primaryKey({
|
|
94
|
+
columns: [table.tenant_id, table.organization_id, table.connection_id],
|
|
95
|
+
}),
|
|
96
|
+
],
|
|
97
|
+
);
|