@fleettools/db 0.1.1 → 0.2.1
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/index.js +8 -8
- package/dist/schema/agents.d.ts +1948 -0
- package/dist/schema/agents.d.ts.map +1 -0
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __getProtoOf = Object.getPrototypeOf;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -24,7 +24,7 @@ var __export = (target, all) => {
|
|
|
24
24
|
set: (newValue) => all[name] = () => newValue
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
-
var __require = import.meta.
|
|
27
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
28
28
|
|
|
29
29
|
// src/schema.ts
|
|
30
30
|
var exports_schema = {};
|
|
@@ -4013,7 +4013,7 @@ function createFleetDb(options) {
|
|
|
4013
4013
|
const { projectPath, filename = "fleet.db", readonly = false } = options;
|
|
4014
4014
|
const fleetDir = `${projectPath}/.fleet`;
|
|
4015
4015
|
try {
|
|
4016
|
-
import("fs").then((fs) => {
|
|
4016
|
+
import("node:fs").then((fs) => {
|
|
4017
4017
|
fs.mkdirSync(fleetDir, { recursive: true });
|
|
4018
4018
|
});
|
|
4019
4019
|
} catch (error) {
|
|
@@ -4110,8 +4110,8 @@ class DatabasePool {
|
|
|
4110
4110
|
}
|
|
4111
4111
|
}
|
|
4112
4112
|
// ../../node_modules/drizzle-orm/migrator.js
|
|
4113
|
-
import crypto2 from "crypto";
|
|
4114
|
-
import fs from "fs";
|
|
4113
|
+
import crypto2 from "node:crypto";
|
|
4114
|
+
import fs from "node:fs";
|
|
4115
4115
|
function readMigrationFiles(config) {
|
|
4116
4116
|
const migrationFolderTo = config.migrationsFolder;
|
|
4117
4117
|
const migrationQueries = [];
|
|
@@ -4161,9 +4161,9 @@ var drizzle_config_default = {
|
|
|
4161
4161
|
async function runMigrations(db) {
|
|
4162
4162
|
try {
|
|
4163
4163
|
await migrate(db, { ...drizzle_config_default, migrationsFolder: "./drizzle/migrations" });
|
|
4164
|
-
console.log("
|
|
4164
|
+
console.log("✅ Migrations completed successfully");
|
|
4165
4165
|
} catch (error) {
|
|
4166
|
-
console.error("
|
|
4166
|
+
console.error("❌ Migration failed:", error);
|
|
4167
4167
|
throw error;
|
|
4168
4168
|
}
|
|
4169
4169
|
}
|
|
@@ -4207,7 +4207,7 @@ async function rollbackMigration(db, targetVersion) {
|
|
|
4207
4207
|
console.warn("For production, implement proper rollback using backup/restore");
|
|
4208
4208
|
throw new Error("Rollback not implemented in this simplified version");
|
|
4209
4209
|
} catch (error) {
|
|
4210
|
-
console.error("
|
|
4210
|
+
console.error("❌ Rollback failed:", error);
|
|
4211
4211
|
throw error;
|
|
4212
4212
|
}
|
|
4213
4213
|
}
|