@better-openclaw/db 1.0.0 → 1.0.25
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/chunk-CfYAbeIz.mjs +13 -0
- package/dist/index.cjs +10 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -6
- package/dist/index.mjs.map +1 -1
- package/dist/schema-C-ReM-az.cjs +176 -0
- package/dist/schema-C-ReM-az.cjs.map +1 -0
- package/dist/schema-DRI82y6I.d.cts +1143 -0
- package/dist/schema-DRI82y6I.d.cts.map +1 -0
- package/dist/schema.cjs +9 -86
- package/dist/schema.d.cts +2 -841
- package/dist/schema.d.mts +304 -2
- package/dist/schema.d.mts.map +1 -1
- package/dist/schema.mjs +24 -5
- package/dist/schema.mjs.map +1 -1
- package/package.json +11 -6
- package/src/schema.test.ts +27 -0
- package/src/schema.ts +32 -1
- package/tsdown.config.ts +1 -1
- package/dist/chunk-DQk6qfdC.mjs +0 -18
- package/dist/chunk-uaV2rQ02.cjs +0 -53
- package/dist/schema.cjs.map +0 -1
- package/dist/schema.d.cts.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll as t };
|
package/dist/index.cjs
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
const
|
|
3
|
-
const require_schema = require('./schema.cjs');
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_schema = require("./schema-C-ReM-az.cjs");
|
|
4
3
|
let drizzle_orm_postgres_js = require("drizzle-orm/postgres-js");
|
|
5
4
|
let postgres = require("postgres");
|
|
6
|
-
postgres =
|
|
7
|
-
|
|
5
|
+
postgres = require_schema.__toESM(postgres);
|
|
8
6
|
//#region src/index.ts
|
|
9
7
|
const connectionString = process.env.DATABASE_URL;
|
|
10
8
|
if (!connectionString) throw new Error("DATABASE_URL environment variable is required");
|
|
11
9
|
const client = (0, postgres.default)(connectionString, { max: 10 });
|
|
12
10
|
const db = (0, drizzle_orm_postgres_js.drizzle)(client, { schema: require_schema.schema_exports });
|
|
13
|
-
|
|
14
11
|
//#endregion
|
|
15
12
|
exports.account = require_schema.account;
|
|
13
|
+
exports.analyticsEvent = require_schema.analyticsEvent;
|
|
16
14
|
exports.db = db;
|
|
17
15
|
exports.favorite = require_schema.favorite;
|
|
18
16
|
exports.savedStack = require_schema.savedStack;
|
|
19
|
-
Object.defineProperty(exports,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
Object.defineProperty(exports, "schema", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return require_schema.schema_exports;
|
|
21
|
+
}
|
|
24
22
|
});
|
|
25
23
|
exports.session = require_schema.session;
|
|
26
24
|
exports.user = require_schema.user;
|
|
27
25
|
exports.verification = require_schema.verification;
|
|
26
|
+
|
|
28
27
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { drizzle } from \"drizzle-orm/postgres-js\";\nimport postgres from \"postgres\";\nimport * as schema from \"./schema.js\";\n\nconst connectionString = process.env.DATABASE_URL;\nif (!connectionString) {\n\tthrow new Error(\"DATABASE_URL environment variable is required\");\n}\n\nconst client = postgres(connectionString, { max: 10 });\nexport const db = drizzle(client, { schema });\n\nexport * from \"./schema.js\";\nexport { schema };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { drizzle } from \"drizzle-orm/postgres-js\";\nimport postgres from \"postgres\";\nimport * as schema from \"./schema.js\";\n\nconst connectionString = process.env.DATABASE_URL;\nif (!connectionString) {\n\tthrow new Error(\"DATABASE_URL environment variable is required\");\n}\n\nconst client = postgres(connectionString, { max: 10 });\nexport const db = drizzle(client, { schema });\n\nexport * from \"./schema.js\";\nexport { schema };\n"],"mappings":";;;;;;AAIA,MAAM,mBAAmB,QAAQ,IAAI;AACrC,IAAI,CAAC,iBACJ,OAAM,IAAI,MAAM,gDAAgD;AAGjE,MAAM,UAAA,GAAA,SAAA,SAAkB,kBAAkB,EAAE,KAAK,IAAI,CAAC;AACtD,MAAa,MAAA,GAAA,wBAAA,SAAa,QAAQ,EAAE,QAAA,eAAA,gBAAQ,CAAC"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as Session, c as analyticsEvent, d as schema_d_exports, f as session, i as SavedStack, l as favorite, m as verification, n as Favorite, o as User, p as user, r as NewAnalyticsEvent, s as account, t as AnalyticsEvent, u as savedStack } from "./schema-DRI82y6I.cjs";
|
|
2
2
|
import * as drizzle_orm_postgres_js0 from "drizzle-orm/postgres-js";
|
|
3
3
|
import postgres from "postgres";
|
|
4
4
|
|
|
@@ -7,5 +7,5 @@ declare const db: drizzle_orm_postgres_js0.PostgresJsDatabase<typeof schema_d_ex
|
|
|
7
7
|
$client: postgres.Sql<{}>;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
10
|
-
export { Favorite, SavedStack, Session, User, account, db, favorite, savedStack, schema_d_exports as schema, session, user, verification };
|
|
10
|
+
export { AnalyticsEvent, Favorite, NewAnalyticsEvent, SavedStack, Session, User, account, analyticsEvent, db, favorite, savedStack, schema_d_exports as schema, session, user, verification };
|
|
11
11
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Favorite, SavedStack, Session, User, account, favorite, savedStack, session, t as schema_d_exports, user, verification } from "./schema.mjs";
|
|
1
|
+
import { AnalyticsEvent, Favorite, NewAnalyticsEvent, SavedStack, Session, User, account, analyticsEvent, favorite, savedStack, session, t as schema_d_exports, user, verification } from "./schema.mjs";
|
|
2
2
|
import * as drizzle_orm_postgres_js0 from "drizzle-orm/postgres-js";
|
|
3
3
|
import postgres from "postgres";
|
|
4
4
|
|
|
@@ -7,5 +7,5 @@ declare const db: drizzle_orm_postgres_js0.PostgresJsDatabase<typeof schema_d_ex
|
|
|
7
7
|
$client: postgres.Sql<{}>;
|
|
8
8
|
};
|
|
9
9
|
//#endregion
|
|
10
|
-
export { Favorite, SavedStack, Session, User, account, db, favorite, savedStack, schema_d_exports as schema, session, user, verification };
|
|
10
|
+
export { AnalyticsEvent, Favorite, NewAnalyticsEvent, SavedStack, Session, User, account, analyticsEvent, db, favorite, savedStack, schema_d_exports as schema, session, user, verification };
|
|
11
11
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { account, favorite, savedStack, session, t as schema_exports, user, verification } from "./schema.mjs";
|
|
1
|
+
import { account, analyticsEvent, favorite, savedStack, session, t as schema_exports, user, verification } from "./schema.mjs";
|
|
2
2
|
import { drizzle } from "drizzle-orm/postgres-js";
|
|
3
3
|
import postgres from "postgres";
|
|
4
|
-
|
|
5
4
|
//#region src/index.ts
|
|
6
5
|
const connectionString = process.env.DATABASE_URL;
|
|
7
6
|
if (!connectionString) throw new Error("DATABASE_URL environment variable is required");
|
|
8
|
-
const
|
|
9
|
-
const db = drizzle(client, { schema: schema_exports });
|
|
10
|
-
|
|
7
|
+
const db = drizzle(postgres(connectionString, { max: 10 }), { schema: schema_exports });
|
|
11
8
|
//#endregion
|
|
12
|
-
export { account, db, favorite, savedStack, schema_exports as schema, session, user, verification };
|
|
9
|
+
export { account, analyticsEvent, db, favorite, savedStack, schema_exports as schema, session, user, verification };
|
|
10
|
+
|
|
13
11
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { drizzle } from \"drizzle-orm/postgres-js\";\nimport postgres from \"postgres\";\nimport * as schema from \"./schema.js\";\n\nconst connectionString = process.env.DATABASE_URL;\nif (!connectionString) {\n\tthrow new Error(\"DATABASE_URL environment variable is required\");\n}\n\nconst client = postgres(connectionString, { max: 10 });\nexport const db = drizzle(client, { schema });\n\nexport * from \"./schema.js\";\nexport { schema };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { drizzle } from \"drizzle-orm/postgres-js\";\nimport postgres from \"postgres\";\nimport * as schema from \"./schema.js\";\n\nconst connectionString = process.env.DATABASE_URL;\nif (!connectionString) {\n\tthrow new Error(\"DATABASE_URL environment variable is required\");\n}\n\nconst client = postgres(connectionString, { max: 10 });\nexport const db = drizzle(client, { schema });\n\nexport * from \"./schema.js\";\nexport { schema };\n"],"mappings":";;;;AAIA,MAAM,mBAAmB,QAAQ,IAAI;AACrC,IAAI,CAAC,iBACJ,OAAM,IAAI,MAAM,gDAAgD;AAIjE,MAAa,KAAK,QADH,SAAS,kBAAkB,EAAE,KAAK,IAAI,CAAC,EACpB,EAAE,QAAA,gBAAQ,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __exportAll = (all, no_symbols) => {
|
|
9
|
+
let target = {};
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
15
|
+
return target;
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
|
+
key = keys[i];
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
21
|
+
get: ((k) => from[k]).bind(null, key),
|
|
22
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
//#endregion
|
|
32
|
+
let drizzle_orm_pg_core = require("drizzle-orm/pg-core");
|
|
33
|
+
//#region src/schema.ts
|
|
34
|
+
var schema_exports = /* @__PURE__ */ __exportAll({
|
|
35
|
+
account: () => account,
|
|
36
|
+
analyticsEvent: () => analyticsEvent,
|
|
37
|
+
favorite: () => favorite,
|
|
38
|
+
savedStack: () => savedStack,
|
|
39
|
+
session: () => session,
|
|
40
|
+
user: () => user,
|
|
41
|
+
verification: () => verification
|
|
42
|
+
});
|
|
43
|
+
const user = (0, drizzle_orm_pg_core.pgTable)("user", {
|
|
44
|
+
id: (0, drizzle_orm_pg_core.text)("id").primaryKey(),
|
|
45
|
+
name: (0, drizzle_orm_pg_core.text)("name").notNull(),
|
|
46
|
+
email: (0, drizzle_orm_pg_core.text)("email").notNull().unique(),
|
|
47
|
+
emailVerified: (0, drizzle_orm_pg_core.boolean)("email_verified").notNull(),
|
|
48
|
+
image: (0, drizzle_orm_pg_core.text)("image"),
|
|
49
|
+
createdAt: (0, drizzle_orm_pg_core.timestamp)("created_at").notNull(),
|
|
50
|
+
updatedAt: (0, drizzle_orm_pg_core.timestamp)("updated_at").notNull()
|
|
51
|
+
});
|
|
52
|
+
const session = (0, drizzle_orm_pg_core.pgTable)("session", {
|
|
53
|
+
id: (0, drizzle_orm_pg_core.text)("id").primaryKey(),
|
|
54
|
+
expiresAt: (0, drizzle_orm_pg_core.timestamp)("expires_at").notNull(),
|
|
55
|
+
token: (0, drizzle_orm_pg_core.text)("token").notNull().unique(),
|
|
56
|
+
createdAt: (0, drizzle_orm_pg_core.timestamp)("created_at").notNull(),
|
|
57
|
+
updatedAt: (0, drizzle_orm_pg_core.timestamp)("updated_at").notNull(),
|
|
58
|
+
ipAddress: (0, drizzle_orm_pg_core.text)("ip_address"),
|
|
59
|
+
userAgent: (0, drizzle_orm_pg_core.text)("user_agent"),
|
|
60
|
+
userId: (0, drizzle_orm_pg_core.text)("user_id").notNull().references(() => user.id, { onDelete: "cascade" })
|
|
61
|
+
});
|
|
62
|
+
const account = (0, drizzle_orm_pg_core.pgTable)("account", {
|
|
63
|
+
id: (0, drizzle_orm_pg_core.text)("id").primaryKey(),
|
|
64
|
+
accountId: (0, drizzle_orm_pg_core.text)("account_id").notNull(),
|
|
65
|
+
providerId: (0, drizzle_orm_pg_core.text)("provider_id").notNull(),
|
|
66
|
+
userId: (0, drizzle_orm_pg_core.text)("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
67
|
+
accessToken: (0, drizzle_orm_pg_core.text)("access_token"),
|
|
68
|
+
refreshToken: (0, drizzle_orm_pg_core.text)("refresh_token"),
|
|
69
|
+
idToken: (0, drizzle_orm_pg_core.text)("id_token"),
|
|
70
|
+
accessTokenExpiresAt: (0, drizzle_orm_pg_core.timestamp)("access_token_expires_at"),
|
|
71
|
+
refreshTokenExpiresAt: (0, drizzle_orm_pg_core.timestamp)("refresh_token_expires_at"),
|
|
72
|
+
scope: (0, drizzle_orm_pg_core.text)("scope"),
|
|
73
|
+
password: (0, drizzle_orm_pg_core.text)("password"),
|
|
74
|
+
createdAt: (0, drizzle_orm_pg_core.timestamp)("created_at").notNull(),
|
|
75
|
+
updatedAt: (0, drizzle_orm_pg_core.timestamp)("updated_at").notNull()
|
|
76
|
+
});
|
|
77
|
+
const verification = (0, drizzle_orm_pg_core.pgTable)("verification", {
|
|
78
|
+
id: (0, drizzle_orm_pg_core.text)("id").primaryKey(),
|
|
79
|
+
identifier: (0, drizzle_orm_pg_core.text)("identifier").notNull(),
|
|
80
|
+
value: (0, drizzle_orm_pg_core.text)("value").notNull(),
|
|
81
|
+
expiresAt: (0, drizzle_orm_pg_core.timestamp)("expires_at").notNull(),
|
|
82
|
+
createdAt: (0, drizzle_orm_pg_core.timestamp)("created_at"),
|
|
83
|
+
updatedAt: (0, drizzle_orm_pg_core.timestamp)("updated_at")
|
|
84
|
+
});
|
|
85
|
+
const savedStack = (0, drizzle_orm_pg_core.pgTable)("saved_stack", {
|
|
86
|
+
id: (0, drizzle_orm_pg_core.uuid)("id").primaryKey().defaultRandom(),
|
|
87
|
+
userId: (0, drizzle_orm_pg_core.text)("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
88
|
+
name: (0, drizzle_orm_pg_core.text)("name").notNull(),
|
|
89
|
+
description: (0, drizzle_orm_pg_core.text)("description"),
|
|
90
|
+
services: (0, drizzle_orm_pg_core.jsonb)("services").notNull().$type().default([]),
|
|
91
|
+
config: (0, drizzle_orm_pg_core.jsonb)("config").notNull().$type().default({}),
|
|
92
|
+
createdAt: (0, drizzle_orm_pg_core.timestamp)("created_at").notNull().defaultNow(),
|
|
93
|
+
updatedAt: (0, drizzle_orm_pg_core.timestamp)("updated_at").notNull().defaultNow()
|
|
94
|
+
});
|
|
95
|
+
const favorite = (0, drizzle_orm_pg_core.pgTable)("favorite", {
|
|
96
|
+
id: (0, drizzle_orm_pg_core.uuid)("id").primaryKey().defaultRandom(),
|
|
97
|
+
userId: (0, drizzle_orm_pg_core.text)("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
98
|
+
stackId: (0, drizzle_orm_pg_core.uuid)("stack_id").notNull().references(() => savedStack.id, { onDelete: "cascade" }),
|
|
99
|
+
createdAt: (0, drizzle_orm_pg_core.timestamp)("created_at").notNull().defaultNow()
|
|
100
|
+
});
|
|
101
|
+
const analyticsEvent = (0, drizzle_orm_pg_core.pgTable)("analytics_event", {
|
|
102
|
+
id: (0, drizzle_orm_pg_core.uuid)("id").primaryKey().defaultRandom(),
|
|
103
|
+
source: (0, drizzle_orm_pg_core.text)("source").notNull(),
|
|
104
|
+
buildMethod: (0, drizzle_orm_pg_core.text)("build_method").notNull(),
|
|
105
|
+
presetId: (0, drizzle_orm_pg_core.text)("preset_id"),
|
|
106
|
+
services: (0, drizzle_orm_pg_core.jsonb)("services").notNull().$type(),
|
|
107
|
+
skillPacks: (0, drizzle_orm_pg_core.jsonb)("skill_packs").notNull().$type().default([]),
|
|
108
|
+
serviceCount: (0, drizzle_orm_pg_core.integer)("service_count").notNull(),
|
|
109
|
+
proxy: (0, drizzle_orm_pg_core.text)("proxy").notNull(),
|
|
110
|
+
deployment: (0, drizzle_orm_pg_core.text)("deployment").notNull(),
|
|
111
|
+
deploymentType: (0, drizzle_orm_pg_core.text)("deployment_type").notNull(),
|
|
112
|
+
platform: (0, drizzle_orm_pg_core.text)("platform").notNull(),
|
|
113
|
+
gpu: (0, drizzle_orm_pg_core.boolean)("gpu").notNull().default(false),
|
|
114
|
+
monitoring: (0, drizzle_orm_pg_core.boolean)("monitoring").notNull().default(false),
|
|
115
|
+
hasDomain: (0, drizzle_orm_pg_core.boolean)("has_domain").notNull().default(false),
|
|
116
|
+
openclawImage: (0, drizzle_orm_pg_core.text)("openclaw_image").notNull(),
|
|
117
|
+
estimatedMemoryMB: (0, drizzle_orm_pg_core.integer)("estimated_memory_mb").notNull(),
|
|
118
|
+
createdAt: (0, drizzle_orm_pg_core.timestamp)("created_at").notNull().defaultNow()
|
|
119
|
+
}, (table) => [(0, drizzle_orm_pg_core.index)("analytics_event_created_at_idx").on(table.createdAt), (0, drizzle_orm_pg_core.index)("analytics_event_source_idx").on(table.source)]);
|
|
120
|
+
//#endregion
|
|
121
|
+
Object.defineProperty(exports, "__toESM", {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: function() {
|
|
124
|
+
return __toESM;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
Object.defineProperty(exports, "account", {
|
|
128
|
+
enumerable: true,
|
|
129
|
+
get: function() {
|
|
130
|
+
return account;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(exports, "analyticsEvent", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: function() {
|
|
136
|
+
return analyticsEvent;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(exports, "favorite", {
|
|
140
|
+
enumerable: true,
|
|
141
|
+
get: function() {
|
|
142
|
+
return favorite;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
Object.defineProperty(exports, "savedStack", {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function() {
|
|
148
|
+
return savedStack;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
Object.defineProperty(exports, "schema_exports", {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
get: function() {
|
|
154
|
+
return schema_exports;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
Object.defineProperty(exports, "session", {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: function() {
|
|
160
|
+
return session;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
Object.defineProperty(exports, "user", {
|
|
164
|
+
enumerable: true,
|
|
165
|
+
get: function() {
|
|
166
|
+
return user;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
Object.defineProperty(exports, "verification", {
|
|
170
|
+
enumerable: true,
|
|
171
|
+
get: function() {
|
|
172
|
+
return verification;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
//# sourceMappingURL=schema-C-ReM-az.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-C-ReM-az.cjs","names":[],"sources":["../src/schema.ts"],"sourcesContent":["import { boolean, index, integer, jsonb, pgTable, text, timestamp, uuid } from \"drizzle-orm/pg-core\";\n\n// ── better-auth required tables ────────────────────────────────────────────────\n\nexport const user = pgTable(\"user\", {\n\tid: text(\"id\").primaryKey(),\n\tname: text(\"name\").notNull(),\n\temail: text(\"email\").notNull().unique(),\n\temailVerified: boolean(\"email_verified\").notNull(),\n\timage: text(\"image\"),\n\tcreatedAt: timestamp(\"created_at\").notNull(),\n\tupdatedAt: timestamp(\"updated_at\").notNull(),\n});\n\nexport const session = pgTable(\"session\", {\n\tid: text(\"id\").primaryKey(),\n\texpiresAt: timestamp(\"expires_at\").notNull(),\n\ttoken: text(\"token\").notNull().unique(),\n\tcreatedAt: timestamp(\"created_at\").notNull(),\n\tupdatedAt: timestamp(\"updated_at\").notNull(),\n\tipAddress: text(\"ip_address\"),\n\tuserAgent: text(\"user_agent\"),\n\tuserId: text(\"user_id\")\n\t\t.notNull()\n\t\t.references(() => user.id, { onDelete: \"cascade\" }),\n});\n\nexport const account = pgTable(\"account\", {\n\tid: text(\"id\").primaryKey(),\n\taccountId: text(\"account_id\").notNull(),\n\tproviderId: text(\"provider_id\").notNull(),\n\tuserId: text(\"user_id\")\n\t\t.notNull()\n\t\t.references(() => user.id, { onDelete: \"cascade\" }),\n\taccessToken: text(\"access_token\"),\n\trefreshToken: text(\"refresh_token\"),\n\tidToken: text(\"id_token\"),\n\taccessTokenExpiresAt: timestamp(\"access_token_expires_at\"),\n\trefreshTokenExpiresAt: timestamp(\"refresh_token_expires_at\"),\n\tscope: text(\"scope\"),\n\tpassword: text(\"password\"),\n\tcreatedAt: timestamp(\"created_at\").notNull(),\n\tupdatedAt: timestamp(\"updated_at\").notNull(),\n});\n\nexport const verification = pgTable(\"verification\", {\n\tid: text(\"id\").primaryKey(),\n\tidentifier: text(\"identifier\").notNull(),\n\tvalue: text(\"value\").notNull(),\n\texpiresAt: timestamp(\"expires_at\").notNull(),\n\tcreatedAt: timestamp(\"created_at\"),\n\tupdatedAt: timestamp(\"updated_at\"),\n});\n\n// ── App-specific tables ─────────────────────────────────────────────────────────\n\nexport const savedStack = pgTable(\"saved_stack\", {\n\tid: uuid(\"id\").primaryKey().defaultRandom(),\n\tuserId: text(\"user_id\")\n\t\t.notNull()\n\t\t.references(() => user.id, { onDelete: \"cascade\" }),\n\tname: text(\"name\").notNull(),\n\tdescription: text(\"description\"),\n\t/** Array of selected service IDs */\n\tservices: jsonb(\"services\").notNull().$type<string[]>().default([]),\n\t/** The full GenerationInput config stored as JSON */\n\tconfig: jsonb(\"config\").notNull().$type<Record<string, unknown>>().default({}),\n\tcreatedAt: timestamp(\"created_at\").notNull().defaultNow(),\n\tupdatedAt: timestamp(\"updated_at\").notNull().defaultNow(),\n});\n\nexport const favorite = pgTable(\"favorite\", {\n\tid: uuid(\"id\").primaryKey().defaultRandom(),\n\tuserId: text(\"user_id\")\n\t\t.notNull()\n\t\t.references(() => user.id, { onDelete: \"cascade\" }),\n\tstackId: uuid(\"stack_id\")\n\t\t.notNull()\n\t\t.references(() => savedStack.id, { onDelete: \"cascade\" }),\n\tcreatedAt: timestamp(\"created_at\").notNull().defaultNow(),\n});\n\n// ── Analytics ───────────────────────────────────────────────────────────────────\n\nexport const analyticsEvent = pgTable(\n\t\"analytics_event\",\n\t{\n\t\tid: uuid(\"id\").primaryKey().defaultRandom(),\n\t\tsource: text(\"source\").notNull(), // \"cli\" | \"web\" | \"api\" | \"mcp\"\n\t\tbuildMethod: text(\"build_method\").notNull(), // \"preset\" | \"custom\"\n\t\tpresetId: text(\"preset_id\"),\n\t\tservices: jsonb(\"services\").notNull().$type<string[]>(),\n\t\tskillPacks: jsonb(\"skill_packs\").notNull().$type<string[]>().default([]),\n\t\tserviceCount: integer(\"service_count\").notNull(),\n\t\tproxy: text(\"proxy\").notNull(),\n\t\tdeployment: text(\"deployment\").notNull(),\n\t\tdeploymentType: text(\"deployment_type\").notNull(),\n\t\tplatform: text(\"platform\").notNull(),\n\t\tgpu: boolean(\"gpu\").notNull().default(false),\n\t\tmonitoring: boolean(\"monitoring\").notNull().default(false),\n\t\thasDomain: boolean(\"has_domain\").notNull().default(false),\n\t\topenclawImage: text(\"openclaw_image\").notNull(),\n\t\testimatedMemoryMB: integer(\"estimated_memory_mb\").notNull(),\n\t\tcreatedAt: timestamp(\"created_at\").notNull().defaultNow(),\n\t},\n\t(table) => [\n\t\tindex(\"analytics_event_created_at_idx\").on(table.createdAt),\n\t\tindex(\"analytics_event_source_idx\").on(table.source),\n\t],\n);\n\nexport type User = typeof user.$inferSelect;\nexport type Session = typeof session.$inferSelect;\nexport type SavedStack = typeof savedStack.$inferSelect;\nexport type Favorite = typeof favorite.$inferSelect;\nexport type AnalyticsEvent = typeof analyticsEvent.$inferSelect;\nexport type NewAnalyticsEvent = typeof analyticsEvent.$inferInsert;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAa,QAAA,GAAA,oBAAA,SAAe,QAAQ;CACnC,KAAA,GAAA,oBAAA,MAAS,KAAK,CAAC,YAAY;CAC3B,OAAA,GAAA,oBAAA,MAAW,OAAO,CAAC,SAAS;CAC5B,QAAA,GAAA,oBAAA,MAAY,QAAQ,CAAC,SAAS,CAAC,QAAQ;CACvC,gBAAA,GAAA,oBAAA,SAAuB,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