qarpeo 0.1.12 → 0.1.14
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 +7 -13
- package/dist/chunks/auth-schema.mjs +119 -147
- package/dist/chunks/wrangler.mjs +1 -1
- package/dist/cli/index.mjs +2 -2
- package/dist/module.mjs +146 -38
- package/dist/runtime/ai.d.ts +4 -2
- package/dist/runtime/ai.mjs +8 -2
- package/dist/runtime/app/components/FileUpload.vue +5 -5
- package/dist/runtime/app/composables/ai.d.ts +74 -0
- package/dist/runtime/app/composables/ai.mjs +148 -0
- package/dist/runtime/app/composables/auth.d.ts +16 -1
- package/dist/runtime/app/composables/auth.mjs +23 -34
- package/dist/runtime/app/composables/storage.d.ts +47 -2
- package/dist/runtime/app/composables/storage.mjs +204 -1
- package/dist/runtime/app/composables/void-client.d.ts +3 -0
- package/dist/runtime/app/composables/void-client.mjs +4 -0
- package/dist/runtime/blob.mjs +1 -1
- package/dist/runtime/db.mjs +1 -1
- package/dist/runtime/server/routes/agents/[agent]/history.get.d.ts +1 -1
- package/dist/runtime/server/routes/auth/handler.d.ts +2 -0
- package/dist/runtime/server/routes/auth/handler.mjs +11 -0
- package/dist/runtime/server/utils/auth.d.ts +66 -0
- package/dist/runtime/server/utils/auth.mjs +58 -0
- package/dist/runtime/server/utils/realtime.mjs +1 -1
- package/dist/runtime/server/utils/storage.d.ts +29 -0
- package/dist/runtime/server/utils/storage.mjs +79 -0
- package/dist/runtime/server/utils/void-ai.d.ts +7 -0
- package/dist/runtime/server/utils/void-ai.mjs +47 -0
- package/dist/runtime/server/utils/void-auth.d.ts +2 -0
- package/dist/runtime/server/utils/void-auth.mjs +9 -0
- package/dist/runtime/server/utils/void-db.d.ts +8 -0
- package/dist/runtime/server/utils/void-db.mjs +38 -0
- package/dist/runtime/server/utils/void-seed.d.ts +11 -0
- package/dist/runtime/server/utils/void-seed.mjs +3 -0
- package/dist/runtime/types/ai.d.ts +2 -0
- package/dist/runtime/types/imports.d.ts +65 -6
- package/dist/types.d.ts +1 -1
- package/dist/utils/auth-schema.d.ts +3 -5
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -29,14 +29,9 @@ Documentation: [https://qarpeo.com](https://qarpeo.com)
|
|
|
29
29
|
### 1. Install
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
# Using Vite+
|
|
33
32
|
vp add qarpeo
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
pnpm add qarpeo
|
|
37
|
-
|
|
38
|
-
# Using npm
|
|
39
|
-
npm install qarpeo
|
|
33
|
+
# or
|
|
34
|
+
vp i qarpeo
|
|
40
35
|
```
|
|
41
36
|
|
|
42
37
|
### 2. Configure
|
|
@@ -84,15 +79,14 @@ Qarpeo includes an integrated CLI for health diagnostics, database migrations, a
|
|
|
84
79
|
|
|
85
80
|
```bash
|
|
86
81
|
# Validate Cloudflare bindings, migrations, and secrets
|
|
87
|
-
|
|
82
|
+
vpx qp doctor
|
|
88
83
|
|
|
89
84
|
# Validate against production/remote deployment criteria
|
|
90
|
-
|
|
85
|
+
vpx qp doctor --remote
|
|
91
86
|
|
|
92
|
-
#
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
pnpm qp migrate --remote
|
|
87
|
+
# List, create, and push D1 migrations
|
|
88
|
+
vpx qp db list
|
|
89
|
+
vpx qp db push
|
|
96
90
|
```
|
|
97
91
|
|
|
98
92
|
---
|
|
@@ -1,218 +1,190 @@
|
|
|
1
1
|
const ALL_AUTH_TABLE_NAMES = [
|
|
2
|
+
"user",
|
|
3
|
+
"account",
|
|
4
|
+
"session",
|
|
5
|
+
"verification",
|
|
6
|
+
"twoFactor",
|
|
7
|
+
"passkey",
|
|
8
|
+
"organization",
|
|
9
|
+
"member",
|
|
10
|
+
"invitation",
|
|
2
11
|
"_qarpeo_users",
|
|
3
12
|
"_qarpeo_accounts",
|
|
4
|
-
"_qarpeo_sessions"
|
|
5
|
-
"_qarpeo_two_factor",
|
|
6
|
-
"_qarpeo_authenticators",
|
|
7
|
-
"_qarpeo_organizations",
|
|
8
|
-
"_qarpeo_members",
|
|
9
|
-
"_qarpeo_invitations",
|
|
10
|
-
"_qarpeo_api_tokens"
|
|
13
|
+
"_qarpeo_sessions"
|
|
11
14
|
];
|
|
12
15
|
function getActiveAuthTableNames(auth) {
|
|
13
16
|
if (!auth) return [];
|
|
14
17
|
const opts = typeof auth === "object" ? auth : {};
|
|
15
|
-
const tables = ["
|
|
16
|
-
if (opts.twoFactor) tables.push("
|
|
17
|
-
if (opts.webauthn) tables.push("
|
|
18
|
-
if (opts.organizations)
|
|
19
|
-
tables.push("_qarpeo_organizations", "_qarpeo_members", "_qarpeo_invitations");
|
|
20
|
-
if (opts.apiTokens) tables.push("_qarpeo_api_tokens");
|
|
21
|
-
if (opts.sso) tables.push("_qarpeo_sso_connections");
|
|
18
|
+
const tables = ["user", "account", "session", "verification"];
|
|
19
|
+
if (opts.twoFactor) tables.push("twoFactor");
|
|
20
|
+
if (opts.webauthn || opts.webAuthn) tables.push("passkey");
|
|
21
|
+
if (opts.organizations) tables.push("organization", "member", "invitation");
|
|
22
22
|
return tables;
|
|
23
23
|
}
|
|
24
24
|
function compileExtendedField(key, def) {
|
|
25
25
|
switch (def.type) {
|
|
26
26
|
case "string": {
|
|
27
|
-
let chain = `text()`;
|
|
27
|
+
let chain = `text("${key}")`;
|
|
28
28
|
if (def.default !== void 0) chain += `.default(${JSON.stringify(def.default)})`;
|
|
29
29
|
if (def.nullable === false) chain += `.notNull()`;
|
|
30
|
-
if (def.enum) chain += ` /* enum: ${def.enum.join("|")} */`;
|
|
31
30
|
return ` ${key}: ${chain},`;
|
|
32
31
|
}
|
|
33
32
|
case "number": {
|
|
34
|
-
let chain = `integer()`;
|
|
33
|
+
let chain = `integer("${key}")`;
|
|
35
34
|
if (def.default !== void 0) chain += `.default(${Number(def.default)})`;
|
|
36
35
|
return ` ${key}: ${chain},`;
|
|
37
36
|
}
|
|
38
37
|
case "boolean": {
|
|
39
|
-
let chain = `integer({ mode: "boolean" })`;
|
|
38
|
+
let chain = `integer("${key}", { mode: "boolean" })`;
|
|
40
39
|
if (def.default !== void 0) chain += `.default(${def.default ? 1 : 0})`;
|
|
41
40
|
return ` ${key}: ${chain},`;
|
|
42
41
|
}
|
|
43
42
|
case "json": {
|
|
44
|
-
return ` ${key}: text({ mode: "json" }),`;
|
|
43
|
+
return ` ${key}: text("${key}", { mode: "json" }),`;
|
|
45
44
|
}
|
|
46
45
|
default:
|
|
47
|
-
return ` ${key}: text(),`;
|
|
46
|
+
return ` ${key}: text("${key}"),`;
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
function generateAuthSchema(auth) {
|
|
51
50
|
const opts = typeof auth === "object" ? auth : {};
|
|
52
51
|
const extendsFields = opts.fields?.extends || {};
|
|
53
52
|
const lines = [
|
|
54
|
-
`// Auto-generated by Qarpeo
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
`// Auto-generated by Qarpeo for Better Auth & void/auth on Cloudflare D1`,
|
|
54
|
+
`import { sql } from "drizzle-orm";
|
|
55
|
+
import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core";`,
|
|
57
56
|
``,
|
|
58
|
-
`// \u2500\u2500\u2500 1.
|
|
59
|
-
`export const
|
|
60
|
-
` id: text().primaryKey(),`,
|
|
61
|
-
`
|
|
62
|
-
`
|
|
63
|
-
`
|
|
64
|
-
`
|
|
57
|
+
`// \u2500\u2500\u2500 1. User Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
58
|
+
`export const user = sqliteTable("user", {`,
|
|
59
|
+
` id: text("id").primaryKey(),`,
|
|
60
|
+
` name: text("name").notNull(),`,
|
|
61
|
+
` email: text("email").notNull().unique(),`,
|
|
62
|
+
` emailVerified: integer("email_verified", { mode: "boolean" }).notNull().default(false),`,
|
|
63
|
+
` image: text("image"),`
|
|
65
64
|
];
|
|
66
65
|
if (!extendsFields.role) {
|
|
67
|
-
lines.push(` role: text().default("user"),`);
|
|
66
|
+
lines.push(` role: text("role").default("user"),`);
|
|
68
67
|
}
|
|
69
68
|
for (const [key, fieldDef] of Object.entries(extendsFields)) {
|
|
70
69
|
lines.push(compileExtendedField(key, fieldDef));
|
|
71
70
|
}
|
|
72
71
|
lines.push(
|
|
73
|
-
` createdAt: integer().notNull(),`,
|
|
74
|
-
` updatedAt: integer().notNull(),`,
|
|
72
|
+
` createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`),`,
|
|
73
|
+
` updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`).$onUpdate(() => new Date()),`,
|
|
75
74
|
`});`,
|
|
76
75
|
``,
|
|
77
|
-
`// \u2500\u2500\u2500 2.
|
|
78
|
-
`export const
|
|
79
|
-
` id: text().primaryKey(),`,
|
|
80
|
-
`
|
|
81
|
-
`
|
|
82
|
-
`
|
|
83
|
-
`
|
|
84
|
-
`
|
|
85
|
-
`
|
|
86
|
-
`
|
|
87
|
-
` expiresAt: integer(),`,
|
|
88
|
-
` createdAt: integer().notNull(),`,
|
|
76
|
+
`// \u2500\u2500\u2500 2. Session Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
77
|
+
`export const session = sqliteTable("session", {`,
|
|
78
|
+
` id: text("id").primaryKey(),`,
|
|
79
|
+
` expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull(),`,
|
|
80
|
+
` token: text("token").notNull().unique(),`,
|
|
81
|
+
` createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`),`,
|
|
82
|
+
` updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`).$onUpdate(() => new Date()),`,
|
|
83
|
+
` ipAddress: text("ip_address"),`,
|
|
84
|
+
` userAgent: text("user_agent"),`,
|
|
85
|
+
` userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),`,
|
|
89
86
|
`}, (table) => [`,
|
|
90
|
-
` index("
|
|
87
|
+
` index("session_user_id_idx").on(table.userId),`,
|
|
88
|
+
` index("session_token_idx").on(table.token),`,
|
|
91
89
|
`]);`,
|
|
92
90
|
``,
|
|
93
|
-
`// \u2500\u2500\u2500 3.
|
|
94
|
-
`export const
|
|
95
|
-
` id: text().primaryKey(),`,
|
|
96
|
-
`
|
|
97
|
-
`
|
|
98
|
-
`
|
|
99
|
-
`
|
|
100
|
-
`
|
|
101
|
-
`
|
|
102
|
-
`
|
|
91
|
+
`// \u2500\u2500\u2500 3. Account Table (OAuth & Passwords) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
92
|
+
`export const account = sqliteTable("account", {`,
|
|
93
|
+
` id: text("id").primaryKey(),`,
|
|
94
|
+
` accountId: text("account_id").notNull(),`,
|
|
95
|
+
` providerId: text("provider_id").notNull(),`,
|
|
96
|
+
` userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),`,
|
|
97
|
+
` accessToken: text("access_token"),`,
|
|
98
|
+
` refreshToken: text("refresh_token"),`,
|
|
99
|
+
` idToken: text("id_token"),`,
|
|
100
|
+
` accessTokenExpiresAt: integer("access_token_expires_at", { mode: "timestamp_ms" }),`,
|
|
101
|
+
` refreshTokenExpiresAt: integer("refresh_token_expires_at", { mode: "timestamp_ms" }),`,
|
|
102
|
+
` scope: text("scope"),`,
|
|
103
|
+
` password: text("password"),`,
|
|
104
|
+
` createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`),`,
|
|
105
|
+
` updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`).$onUpdate(() => new Date()),`,
|
|
103
106
|
`}, (table) => [`,
|
|
104
|
-
` index("
|
|
105
|
-
`
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
` index("account_user_id_idx").on(table.userId),`,
|
|
108
|
+
`]);`,
|
|
109
|
+
``,
|
|
110
|
+
`// \u2500\u2500\u2500 4. Verification Table (Tokens & OTP) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
111
|
+
`export const verification = sqliteTable("verification", {`,
|
|
112
|
+
` id: text("id").primaryKey(),`,
|
|
113
|
+
` identifier: text("identifier").notNull(),`,
|
|
114
|
+
` value: text("value").notNull(),`,
|
|
115
|
+
` expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull(),`,
|
|
116
|
+
` createdAt: integer("created_at", { mode: "timestamp_ms" }),`,
|
|
117
|
+
` updatedAt: integer("updated_at", { mode: "timestamp_ms" }),`,
|
|
118
|
+
`});`
|
|
108
119
|
);
|
|
109
120
|
if (opts.twoFactor) {
|
|
110
121
|
lines.push(
|
|
111
122
|
``,
|
|
112
|
-
`// \u2500\u2500\u2500
|
|
113
|
-
`export const twoFactor =
|
|
114
|
-
` id: text().primaryKey(),`,
|
|
115
|
-
` userId: text().notNull().unique().references(() =>
|
|
116
|
-
` secret: text().notNull(),`,
|
|
117
|
-
` backupCodes: text().notNull(),`,
|
|
118
|
-
`
|
|
119
|
-
` createdAt: integer().notNull(),`,
|
|
123
|
+
`// \u2500\u2500\u2500 5. Two-Factor Authentication Table (TOTP) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
124
|
+
`export const twoFactor = sqliteTable("two_factor", {`,
|
|
125
|
+
` id: text("id").primaryKey(),`,
|
|
126
|
+
` userId: text("user_id").notNull().unique().references(() => user.id, { onDelete: "cascade" }),`,
|
|
127
|
+
` secret: text("secret").notNull(),`,
|
|
128
|
+
` backupCodes: text("backup_codes").notNull(),`,
|
|
129
|
+
` createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`),`,
|
|
120
130
|
`});`
|
|
121
131
|
);
|
|
122
132
|
}
|
|
123
|
-
if (opts.webauthn) {
|
|
133
|
+
if (opts.webauthn || opts.webAuthn) {
|
|
124
134
|
lines.push(
|
|
125
135
|
``,
|
|
126
|
-
`// \u2500\u2500\u2500
|
|
127
|
-
`export const
|
|
128
|
-
` id: text().primaryKey(),`,
|
|
129
|
-
`
|
|
130
|
-
`
|
|
131
|
-
`
|
|
132
|
-
`
|
|
133
|
-
`
|
|
134
|
-
`
|
|
136
|
+
`// \u2500\u2500\u2500 6. Passkeys Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
137
|
+
`export const passkey = sqliteTable("passkey", {`,
|
|
138
|
+
` id: text("id").primaryKey(),`,
|
|
139
|
+
` name: text("name"),`,
|
|
140
|
+
` publicKey: text("public_key").notNull(),`,
|
|
141
|
+
` userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),`,
|
|
142
|
+
` credentialId: text("credential_id").notNull().unique(),`,
|
|
143
|
+
` counter: integer("counter").notNull().default(0),`,
|
|
144
|
+
` deviceType: text("device_type").notNull(),`,
|
|
145
|
+
` backedUp: integer("backed_up", { mode: "boolean" }).notNull().default(false),`,
|
|
146
|
+
` transports: text("transports"),`,
|
|
147
|
+
` createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`),`,
|
|
135
148
|
`});`
|
|
136
149
|
);
|
|
137
150
|
}
|
|
138
151
|
if (opts.organizations) {
|
|
139
152
|
lines.push(
|
|
140
153
|
``,
|
|
141
|
-
`// \u2500\u2500\u2500
|
|
142
|
-
`export const
|
|
143
|
-
` id: text().primaryKey(),`,
|
|
144
|
-
` name: text().notNull(),`,
|
|
145
|
-
` slug: text().notNull().unique(),`,
|
|
146
|
-
`
|
|
147
|
-
`
|
|
154
|
+
`// \u2500\u2500\u2500 7. Organizations & Members Tables \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
155
|
+
`export const organization = sqliteTable("organization", {`,
|
|
156
|
+
` id: text("id").primaryKey(),`,
|
|
157
|
+
` name: text("name").notNull(),`,
|
|
158
|
+
` slug: text("slug").notNull().unique(),`,
|
|
159
|
+
` logo: text("logo"),`,
|
|
160
|
+
` metadata: text("metadata"),`,
|
|
161
|
+
` createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`),`,
|
|
148
162
|
`});`,
|
|
149
163
|
``,
|
|
150
|
-
`export const
|
|
151
|
-
` id: text().primaryKey(),`,
|
|
152
|
-
` organizationId: text().notNull().references(() =>
|
|
153
|
-
` userId: text().notNull().references(() =>
|
|
154
|
-
` role: text().notNull().default("member"),`,
|
|
155
|
-
` createdAt: integer().notNull(),`,
|
|
156
|
-
`}
|
|
157
|
-
` index("_qarpeo_members_user_id_idx").on(table.userId),`,
|
|
158
|
-
` index("_qarpeo_members_org_id_idx").on(table.organizationId),`,
|
|
159
|
-
`]);`,
|
|
164
|
+
`export const member = sqliteTable("member", {`,
|
|
165
|
+
` id: text("id").primaryKey(),`,
|
|
166
|
+
` organizationId: text("organization_id").notNull().references(() => organization.id, { onDelete: "cascade" }),`,
|
|
167
|
+
` userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),`,
|
|
168
|
+
` role: text("role").notNull().default("member"),`,
|
|
169
|
+
` createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`),`,
|
|
170
|
+
`});`,
|
|
160
171
|
``,
|
|
161
|
-
`export const
|
|
162
|
-
` id: text().primaryKey(),`,
|
|
163
|
-
` organizationId: text().notNull().references(() =>
|
|
164
|
-
` email: text().notNull(),`,
|
|
165
|
-
` role: text().notNull().default("member"),`,
|
|
166
|
-
`
|
|
167
|
-
` expiresAt: integer().notNull(),`,
|
|
168
|
-
`
|
|
172
|
+
`export const invitation = sqliteTable("invitation", {`,
|
|
173
|
+
` id: text("id").primaryKey(),`,
|
|
174
|
+
` organizationId: text("organization_id").notNull().references(() => organization.id, { onDelete: "cascade" }),`,
|
|
175
|
+
` email: text("email").notNull(),`,
|
|
176
|
+
` role: text("role").notNull().default("member"),`,
|
|
177
|
+
` status: text("status").notNull().default("pending"),`,
|
|
178
|
+
` expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull(),`,
|
|
179
|
+
` inviterId: text("inviter_id").notNull().references(() => user.id, { onDelete: "cascade" }),`,
|
|
169
180
|
`});`
|
|
170
181
|
);
|
|
171
182
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
` id: text().primaryKey(),`,
|
|
178
|
-
` userId: text().notNull().references(() => users.id, { onDelete: "cascade" }),`,
|
|
179
|
-
` name: text().notNull(),`,
|
|
180
|
-
` tokenHash: text().notNull(),`,
|
|
181
|
-
` scopes: text().default('["*"]'),`,
|
|
182
|
-
` lastUsedAt: integer(),`,
|
|
183
|
-
` expiresAt: integer(),`,
|
|
184
|
-
` createdAt: integer().notNull(),`,
|
|
185
|
-
`}, (table) => [`,
|
|
186
|
-
` index("_qarpeo_api_tokens_user_id_idx").on(table.userId),`,
|
|
187
|
-
`]);`
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
if (opts.sso) {
|
|
191
|
-
lines.push(
|
|
192
|
-
``,
|
|
193
|
-
`// \u2500\u2500\u2500 8. Enterprise SSO (SAML 2.0 & OIDC) Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
194
|
-
`export const ssoConnections = snakeCase.table("_qarpeo_sso_connections", {`,
|
|
195
|
-
` id: text().primaryKey(),`,
|
|
196
|
-
` organizationId: text().references(() => organizations.id, { onDelete: "cascade" }),`,
|
|
197
|
-
` providerType: text().notNull(),`,
|
|
198
|
-
` name: text().notNull(),`,
|
|
199
|
-
` domain: text().unique(),`,
|
|
200
|
-
` clientId: text(),`,
|
|
201
|
-
` clientSecret: text(),`,
|
|
202
|
-
` issuer: text(),`,
|
|
203
|
-
` ssoUrl: text().notNull(),`,
|
|
204
|
-
` tokenUrl: text(),`,
|
|
205
|
-
` userinfoUrl: text(),`,
|
|
206
|
-
` cert: text(),`,
|
|
207
|
-
` enabled: integer().default(1),`,
|
|
208
|
-
` createdAt: integer().notNull(),`,
|
|
209
|
-
` updatedAt: integer().notNull(),`,
|
|
210
|
-
`}, (table) => [`,
|
|
211
|
-
` index("_qarpeo_sso_org_id_idx").on(table.organizationId),`,
|
|
212
|
-
` index("_qarpeo_sso_domain_idx").on(table.domain),`,
|
|
213
|
-
`]);`
|
|
214
|
-
);
|
|
215
|
-
}
|
|
183
|
+
lines.push(
|
|
184
|
+
``,
|
|
185
|
+
`// Backwards compatibility aliases`,
|
|
186
|
+
`export { user as users, session as sessions, account as accounts, verification as verifications };`
|
|
187
|
+
);
|
|
216
188
|
return lines.join("\n") + "\n";
|
|
217
189
|
}
|
|
218
190
|
|
package/dist/chunks/wrangler.mjs
CHANGED
|
@@ -784,4 +784,4 @@ const wrangler = {
|
|
|
784
784
|
resolveProjectName: resolveProjectName
|
|
785
785
|
};
|
|
786
786
|
|
|
787
|
-
export {
|
|
787
|
+
export { resolveBindingName as a, checkDrizzleVersion as b, createWranglerConfig as c, findJobFiles as d, applyD1Migrations as e, findQueueFiles as f, generateDevWranglerConfig as g, findSchemaFiles as h, resolveBinaryPath as i, ensurePackage as j, getLocalDatabaseContext as k, getJiti as l, findLocalD1Database as m, localDb as n, resolveProjectName as r, scanSchemaExports as s, wrangler as w };
|
package/dist/cli/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { spawnSync } from 'node:child_process';
|
|
|
4
4
|
import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
5
5
|
import { loadNuxtConfig } from '@nuxt/kit';
|
|
6
6
|
import { resolve, join } from 'pathe';
|
|
7
|
-
import { h as findSchemaFiles, i as resolveBinaryPath, j as ensurePackage, k as getLocalDatabaseContext, l as getJiti,
|
|
7
|
+
import { h as findSchemaFiles, i as resolveBinaryPath, j as ensurePackage, k as getLocalDatabaseContext, l as getJiti, r as resolveProjectName, b as checkDrizzleVersion, m as findLocalD1Database } from '../chunks/wrangler.mjs';
|
|
8
8
|
import { reset, seed } from 'drizzle-seed';
|
|
9
9
|
import { stdin, stdout } from 'node:process';
|
|
10
10
|
import readline from 'node:readline/promises';
|
|
@@ -2209,7 +2209,7 @@ const whoami = defineCommand({
|
|
|
2209
2209
|
const main = defineCommand({
|
|
2210
2210
|
meta: {
|
|
2211
2211
|
name: "qp",
|
|
2212
|
-
version: "0.1.
|
|
2212
|
+
version: "0.1.14",
|
|
2213
2213
|
description: "Cloudflare-native powerhouse module for Nuxt"
|
|
2214
2214
|
},
|
|
2215
2215
|
subCommands: {
|