@arkstack/database 0.1.2 → 0.5.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/LICENSE +21 -0
- package/README.md +1 -1
- package/dist/ValidatorDBDriver-DUvJ-_jF.js +18 -0
- package/dist/ValidatorDBDriver-DUvJ-_jF.js.map +1 -0
- package/dist/commands/MakeFactoryCommand.js +15 -0
- package/dist/commands/MakeMigrationCommand.js +15 -0
- package/dist/commands/MakeModelCommand.js +15 -0
- package/dist/commands/MakeSeederCommand.js +15 -0
- package/dist/commands/MigrateCommand.js +11 -0
- package/dist/commands/MigrateFreshCommand.js +11 -0
- package/dist/commands/MigrateRollbackCommand.js +11 -0
- package/dist/commands/MigrationHistoryCommand.js +11 -0
- package/dist/commands/ModelsSyncCommand.js +11 -0
- package/dist/commands/Rebuilder-DMFg_sP7.js +62 -0
- package/dist/commands/SeedCommand.js +11 -0
- package/dist/index.d.ts +30 -18
- package/dist/index.js +21 -8
- package/dist/index.js.map +1 -1
- package/dist/setup.d.ts +1 -0
- package/dist/setup.js +11 -0
- package/dist/setup.js.map +1 -0
- package/package.json +35 -13
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Toneflix Technologies Limited
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DB } from "arkormx";
|
|
2
|
+
import { IDatabaseDriver } from "kanun";
|
|
3
|
+
//#region src/ValidatorDBDriver.ts
|
|
4
|
+
var ValidatorDBDriver = class extends IDatabaseDriver {
|
|
5
|
+
async exists({ table, column, value, ignore }) {
|
|
6
|
+
try {
|
|
7
|
+
const query = DB.table(table).where({ [column]: value });
|
|
8
|
+
if (ignore) query.whereNot({ [column]: ignore });
|
|
9
|
+
return await query.exists();
|
|
10
|
+
} catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ValidatorDBDriver as t };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=ValidatorDBDriver-DUvJ-_jF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidatorDBDriver-DUvJ-_jF.js","names":[],"sources":["../src/ValidatorDBDriver.ts"],"sourcesContent":["import { IDatabaseDriver, ValidationDatabaseExistsInput } from 'kanun'\n\nimport { DB } from 'arkormx'\n\nexport class ValidatorDBDriver extends IDatabaseDriver {\n async exists ({ table, column, value, ignore }: ValidationDatabaseExistsInput) {\n try {\n const query = DB.table<{ id: string }>(table).where({ [column]: value })\n\n if (ignore) {\n query.whereNot({ [column]: ignore })\n }\n\n return await query.exists()\n } catch {\n return false\n }\n }\n}"],"mappings":";;;AAIA,IAAa,oBAAb,cAAuC,gBAAgB;CACnD,MAAM,OAAQ,EAAE,OAAO,QAAQ,OAAO,UAAyC;EAC3E,IAAI;GACA,MAAM,QAAQ,GAAG,MAAsB,MAAM,CAAC,MAAM,GAAG,SAAS,OAAO,CAAC;GAExE,IAAI,QACA,MAAM,SAAS,GAAG,SAAS,QAAQ,CAAC;GAGxC,OAAO,MAAM,MAAM,QAAQ;UACvB;GACJ,OAAO"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { t as Rebuilder } from "./Rebuilder-DMFg_sP7.js";
|
|
2
|
+
import { CliApp, MakeFactoryCommand as MakeFactoryCommand$1 } from "arkormx";
|
|
3
|
+
//#region src/commands/MakeFactoryCommand.ts
|
|
4
|
+
var MakeFactoryCommand = class extends MakeFactoryCommand$1 {
|
|
5
|
+
async handle() {
|
|
6
|
+
this.app.command = this;
|
|
7
|
+
this.app = new CliApp();
|
|
8
|
+
const name = this.argument("name");
|
|
9
|
+
const handle = super.handle();
|
|
10
|
+
Rebuilder.build(this.app, `${str(name.replace(/Factory$/, "")).append("Factory").pascal()}`, "factories");
|
|
11
|
+
return handle;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { MakeFactoryCommand };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { t as Rebuilder } from "./Rebuilder-DMFg_sP7.js";
|
|
2
|
+
import { CliApp, MakeMigrationCommand as MakeMigrationCommand$1 } from "arkormx";
|
|
3
|
+
//#region src/commands/MakeMigrationCommand.ts
|
|
4
|
+
var MakeMigrationCommand = class extends MakeMigrationCommand$1 {
|
|
5
|
+
async handle() {
|
|
6
|
+
this.app.command = this;
|
|
7
|
+
this.app = new CliApp();
|
|
8
|
+
const name = this.argument("name");
|
|
9
|
+
const handle = super.handle();
|
|
10
|
+
Rebuilder.build(this.app, name, "migrations");
|
|
11
|
+
return handle;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { MakeMigrationCommand };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { t as Rebuilder } from "./Rebuilder-DMFg_sP7.js";
|
|
2
|
+
import { CliApp, MakeModelCommand as MakeModelCommand$1 } from "arkormx";
|
|
3
|
+
//#region src/commands/MakeModelCommand.ts
|
|
4
|
+
var MakeModelCommand = class extends MakeModelCommand$1 {
|
|
5
|
+
async handle() {
|
|
6
|
+
this.app.command = this;
|
|
7
|
+
this.app = new CliApp();
|
|
8
|
+
const name = this.argument("name");
|
|
9
|
+
const handle = super.handle();
|
|
10
|
+
Rebuilder.build(this.app, str(name.replace(/Model$/, "")).pascal().toString(), "models");
|
|
11
|
+
return handle;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { MakeModelCommand };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { t as Rebuilder } from "./Rebuilder-DMFg_sP7.js";
|
|
2
|
+
import { CliApp, MakeSeederCommand as MakeSeederCommand$1 } from "arkormx";
|
|
3
|
+
//#region src/commands/MakeSeederCommand.ts
|
|
4
|
+
var MakeSeederCommand = class extends MakeSeederCommand$1 {
|
|
5
|
+
async handle() {
|
|
6
|
+
this.app.command = this;
|
|
7
|
+
this.app = new CliApp();
|
|
8
|
+
const name = this.argument("name");
|
|
9
|
+
const handle = super.handle();
|
|
10
|
+
Rebuilder.build(this.app, `${str(name.replace(/Seeder$/, "")).append("Seeder").pascal()}`, "seeders");
|
|
11
|
+
return handle;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { MakeSeederCommand };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CliApp, MigrateCommand as MigrateCommand$1 } from "arkormx";
|
|
2
|
+
//#region src/commands/MigrateCommand.ts
|
|
3
|
+
var MigrateCommand = class extends MigrateCommand$1 {
|
|
4
|
+
async handle() {
|
|
5
|
+
this.app.command = this;
|
|
6
|
+
this.app = new CliApp();
|
|
7
|
+
return super.handle();
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { MigrateCommand };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CliApp, MigrateFreshCommand as MigrateFreshCommand$1 } from "arkormx";
|
|
2
|
+
//#region src/commands/MigrateFreshCommand.ts
|
|
3
|
+
var MigrateFreshCommand = class extends MigrateFreshCommand$1 {
|
|
4
|
+
async handle() {
|
|
5
|
+
this.app.command = this;
|
|
6
|
+
this.app = new CliApp();
|
|
7
|
+
return super.handle();
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { MigrateFreshCommand };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CliApp, MigrateRollbackCommand as MigrateRollbackCommand$1 } from "arkormx";
|
|
2
|
+
//#region src/commands/MigrateRollbackCommand.ts
|
|
3
|
+
var MigrateRollbackCommand = class extends MigrateRollbackCommand$1 {
|
|
4
|
+
async handle() {
|
|
5
|
+
this.app.command = this;
|
|
6
|
+
this.app = new CliApp();
|
|
7
|
+
return super.handle();
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { MigrateRollbackCommand };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CliApp, MigrationHistoryCommand as MigrationHistoryCommand$1 } from "arkormx";
|
|
2
|
+
//#region src/commands/MigrationHistoryCommand.ts
|
|
3
|
+
var MigrationHistoryCommand = class extends MigrationHistoryCommand$1 {
|
|
4
|
+
async handle() {
|
|
5
|
+
this.app.command = this;
|
|
6
|
+
this.app = new CliApp();
|
|
7
|
+
return super.handle();
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { MigrationHistoryCommand };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CliApp, ModelsSyncCommand as ModelsSyncCommand$1 } from "arkormx";
|
|
2
|
+
//#region src/commands/ModelsSyncCommand.ts
|
|
3
|
+
var ModelsSyncCommand = class extends ModelsSyncCommand$1 {
|
|
4
|
+
async handle() {
|
|
5
|
+
this.app.command = this;
|
|
6
|
+
this.app = new CliApp();
|
|
7
|
+
return super.handle();
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ModelsSyncCommand };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { Logger } from "@arkstack/common";
|
|
4
|
+
import { globSync } from "node:fs";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
//#region src/extensions/Rebuilder.ts
|
|
7
|
+
var Rebuilder = class Rebuilder {
|
|
8
|
+
app;
|
|
9
|
+
constructor(app) {
|
|
10
|
+
this.app = app;
|
|
11
|
+
}
|
|
12
|
+
static async build(app, name, type = "models") {
|
|
13
|
+
try {
|
|
14
|
+
const inst = new Rebuilder(app);
|
|
15
|
+
const dir = inst.paths()[type] ?? join(process.cwd(), "src", type);
|
|
16
|
+
let outputPath = join(dir, `${name}.${inst.resolveOutputExt()}`);
|
|
17
|
+
if (type === "migrations") outputPath = globSync(`${join(dir, inst.date())}*_${name}.ts`, {
|
|
18
|
+
cwd: process.cwd(),
|
|
19
|
+
withFileTypes: false
|
|
20
|
+
}).sort().at(-1);
|
|
21
|
+
const content = inst.content(await readFile(outputPath, "utf8"), type);
|
|
22
|
+
await writeFile(outputPath, content, "utf8");
|
|
23
|
+
} catch (error) {
|
|
24
|
+
Logger.error(error.message, false);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
paths() {
|
|
28
|
+
return this.app.getConfig("paths") ?? {};
|
|
29
|
+
}
|
|
30
|
+
content(content, type) {
|
|
31
|
+
const replacement = {
|
|
32
|
+
models: [/import\s*{\s*Model\s*}\s*from\s*['"]\s*arkormx\s*['"]\s*;?/g, "import { Model } from '@arkstack/database'\n\n"],
|
|
33
|
+
seeders: [/import\s*{\s*Seeder\s*}\s*from\s*['"]\s*arkormx\s*['"]\s*;?/g, "import { Seeder } from '@arkstack/database'\n\n"],
|
|
34
|
+
factories: [/import\s*{\s*ModelFactory\s*}\s*from\s*['"]\s*arkormx\s*['"]\s*;?/g, "import { ModelFactory } from '@arkstack/database'\n"],
|
|
35
|
+
migrations: [/import\s*{\s*(.*?)\s*}\s*from\s*['"]\s*arkormx\s*['"]\s*;?/g, (_, val) => `import { ${val.trim()} } from '@arkstack/database'\n\n`]
|
|
36
|
+
}[type];
|
|
37
|
+
return content.replace(replacement[0], replacement[1]);
|
|
38
|
+
}
|
|
39
|
+
resolveOutputExt() {
|
|
40
|
+
const preferred = this.app.getConfig("outputExt") === "js" ? "js" : "ts";
|
|
41
|
+
if (preferred === "ts" && !this.hasTypeScriptInstalled()) return "js";
|
|
42
|
+
return preferred;
|
|
43
|
+
}
|
|
44
|
+
hasTypeScriptInstalled() {
|
|
45
|
+
try {
|
|
46
|
+
createRequire(import.meta.url).resolve("typescript", { paths: [process.cwd()] });
|
|
47
|
+
return true;
|
|
48
|
+
} catch {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
date() {
|
|
53
|
+
const now = /* @__PURE__ */ new Date();
|
|
54
|
+
return [
|
|
55
|
+
now.getFullYear(),
|
|
56
|
+
String(now.getMonth() + 1).padStart(2, "0"),
|
|
57
|
+
String(now.getDate()).padStart(2, "0")
|
|
58
|
+
].join("");
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { Rebuilder as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CliApp, SeedCommand as SeedCommand$1 } from "arkormx";
|
|
2
|
+
//#region src/commands/SeedCommand.ts
|
|
3
|
+
var SeedCommand = class extends SeedCommand$1 {
|
|
4
|
+
async handle() {
|
|
5
|
+
this.app.command = this;
|
|
6
|
+
this.app = new CliApp();
|
|
7
|
+
return super.handle();
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { SeedCommand };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { DB as DB$1, FactoryAttributes, Migration as Migration$1, Model as Model$1, ModelAttributes, ModelAttributesOf, ModelFactory as ModelFactory$1, ModelQuerySchemaLike, SchemaBuilder as SchemaBuilder$1, Seeder as Seeder$1 } from "arkormx";
|
|
2
|
+
import { IDatabaseDriver, ValidationDatabaseExistsInput } from "kanun";
|
|
3
|
+
|
|
4
|
+
//#region src/extensions/DB.d.ts
|
|
5
|
+
declare class DB extends DB$1 {}
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/extensions/Factory.d.ts
|
|
8
|
+
declare abstract class ModelFactory<TModel, TAttributes extends FactoryAttributes = Partial<ModelAttributes<TModel>>> extends ModelFactory$1<TModel, TAttributes> {}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/extensions/Migration.d.ts
|
|
11
|
+
declare abstract class Migration extends Migration$1 {}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/extensions/Model.d.ts
|
|
14
|
+
declare abstract class Model<TSchema extends ModelQuerySchemaLike | Record<string, unknown> | string = Record<string, any>, TAttributes extends Record<string, unknown> = ModelAttributesOf<TSchema>> extends Model$1<TSchema, TAttributes> {}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/extensions/SchemaBuilder.d.ts
|
|
17
|
+
declare class SchemaBuilder extends SchemaBuilder$1 {}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/extensions/Seeder.d.ts
|
|
20
|
+
declare abstract class Seeder extends Seeder$1 {}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/ValidatorDBDriver.d.ts
|
|
23
|
+
declare class ValidatorDBDriver extends IDatabaseDriver {
|
|
24
|
+
exists({
|
|
25
|
+
table,
|
|
26
|
+
column,
|
|
27
|
+
value,
|
|
28
|
+
ignore
|
|
29
|
+
}: ValidationDatabaseExistsInput): Promise<boolean>;
|
|
17
30
|
}
|
|
18
|
-
declare const createDatabaseClient: <TAdapter, TClient>(options: CreateDatabaseClientOptions<TAdapter, TClient>) => TClient;
|
|
19
31
|
//#endregion
|
|
20
|
-
export {
|
|
32
|
+
export { DB, Migration, Model, ModelFactory, SchemaBuilder, Seeder, ValidatorDBDriver };
|
|
21
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { t as ValidatorDBDriver } from "./ValidatorDBDriver-DUvJ-_jF.js";
|
|
2
|
+
import { DB as DB$1, Migration as Migration$1, Model as Model$1, ModelFactory as ModelFactory$1, SchemaBuilder as SchemaBuilder$1, Seeder as Seeder$1 } from "arkormx";
|
|
3
|
+
//#region src/extensions/DB.ts
|
|
4
|
+
var DB = class extends DB$1 {};
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/extensions/Factory.ts
|
|
7
|
+
var ModelFactory = class extends ModelFactory$1 {};
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/extensions/Migration.ts
|
|
10
|
+
var Migration = class extends Migration$1 {};
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/extensions/Model.ts
|
|
13
|
+
var Model = class extends Model$1 {};
|
|
8
14
|
//#endregion
|
|
9
|
-
|
|
15
|
+
//#region src/extensions/SchemaBuilder.ts
|
|
16
|
+
var SchemaBuilder = class extends SchemaBuilder$1 {};
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/extensions/Seeder.ts
|
|
19
|
+
var Seeder = class extends Seeder$1 {};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { DB, Migration, Model, ModelFactory, SchemaBuilder, Seeder, ValidatorDBDriver };
|
|
22
|
+
|
|
10
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.js","names":["BaseDB","BaseModelFactory","BaseMigration","BaseModel","BaseSchemaBuilder","BaseSeeder"],"sources":["../src/extensions/DB.ts","../src/extensions/Factory.ts","../src/extensions/Migration.ts","../src/extensions/Model.ts","../src/extensions/SchemaBuilder.ts","../src/extensions/Seeder.ts"],"sourcesContent":["import { DB as BaseDB } from 'arkormx'\n\nexport class DB extends BaseDB {\n}","import { ModelFactory as BaseModelFactory, FactoryAttributes, ModelAttributes } from 'arkormx'\n\nexport abstract class ModelFactory<TModel, TAttributes extends FactoryAttributes = Partial<ModelAttributes<TModel>>> extends BaseModelFactory<TModel, TAttributes> {\n}","import { Migration as BaseMigration } from 'arkormx'\n\nexport abstract class Migration extends BaseMigration {\n}","import { Model as BaseModel, ModelAttributesOf, ModelQuerySchemaLike } from 'arkormx'\n\nexport abstract class Model<TSchema extends ModelQuerySchemaLike | Record<string, unknown> | string = Record<string, any>, TAttributes extends Record<string, unknown> = ModelAttributesOf<TSchema>> extends BaseModel<TSchema, TAttributes> {\n}","import { SchemaBuilder as BaseSchemaBuilder } from 'arkormx'\n\nexport class SchemaBuilder extends BaseSchemaBuilder {\n}","import { Seeder as BaseSeeder } from 'arkormx'\n\nexport abstract class Seeder extends BaseSeeder {\n}"],"mappings":";;;AAEA,IAAa,KAAb,cAAwBA,KAAO;;;ACA/B,IAAsB,eAAtB,cAA6HC,eAAsC;;;ACAnK,IAAsB,YAAtB,cAAwCC,YAAc;;;ACAtD,IAAsB,QAAtB,cAA6MC,QAAgC;;;ACA7O,IAAa,gBAAb,cAAmCC,gBAAkB;;;ACArD,IAAsB,SAAtB,cAAqCC,SAAW"}
|
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/setup.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { t as ValidatorDBDriver } from "./ValidatorDBDriver-DUvJ-_jF.js";
|
|
2
|
+
import { Validator } from "kanun";
|
|
3
|
+
import { CoreRouter } from "clear-router/core";
|
|
4
|
+
import { clearRouterPlugin } from "@arkormx/plugin-clear-router";
|
|
5
|
+
//#region src/setup.ts
|
|
6
|
+
CoreRouter.use(clearRouterPlugin);
|
|
7
|
+
Validator.useDatabase(new ValidatorDBDriver());
|
|
8
|
+
//#endregion
|
|
9
|
+
export {};
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","names":[],"sources":["../src/setup.ts"],"sourcesContent":["import { CoreRouter } from 'clear-router/core'\nimport { Validator } from 'kanun'\nimport { ValidatorDBDriver } from './ValidatorDBDriver'\nimport { clearRouterPlugin } from '@arkormx/plugin-clear-router'\n\nCoreRouter.use(clearRouterPlugin)\nValidator.useDatabase(new ValidatorDBDriver())"],"mappings":";;;;;AAKA,WAAW,IAAI,kBAAkB;AACjC,UAAU,YAAY,IAAI,mBAAmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkstack/database",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Database
|
|
5
|
+
"description": "Database module for Arkstack, providing core database integration and data layer features.",
|
|
6
6
|
"homepage": "https://arkstack.toneflix.net",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
},
|
|
12
12
|
"keywords": [
|
|
13
13
|
"database",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"query",
|
|
18
|
-
"execution",
|
|
19
|
-
"arkstack",
|
|
14
|
+
"arkorm",
|
|
15
|
+
"models",
|
|
16
|
+
"eloquent",
|
|
20
17
|
"prisma",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
18
|
+
"kysely",
|
|
19
|
+
"mysql",
|
|
20
|
+
"mariadb",
|
|
21
|
+
"sql",
|
|
22
|
+
"postgresql",
|
|
23
|
+
"h3ravel"
|
|
24
24
|
],
|
|
25
25
|
"files": [
|
|
26
26
|
"dist"
|
|
@@ -30,10 +30,32 @@
|
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
".": "./dist/index.js",
|
|
33
|
+
"./MakeFactoryCommand": "./dist/commands/MakeFactoryCommand.js",
|
|
34
|
+
"./MakeMigrationCommand": "./dist/commands/MakeMigrationCommand.js",
|
|
35
|
+
"./MakeModelCommand": "./dist/commands/MakeModelCommand.js",
|
|
36
|
+
"./MakeSeederCommand": "./dist/commands/MakeSeederCommand.js",
|
|
37
|
+
"./MigrateCommand": "./dist/commands/MigrateCommand.js",
|
|
38
|
+
"./MigrateFreshCommand": "./dist/commands/MigrateFreshCommand.js",
|
|
39
|
+
"./MigrateRollbackCommand": "./dist/commands/MigrateRollbackCommand.js",
|
|
40
|
+
"./MigrationHistoryCommand": "./dist/commands/MigrationHistoryCommand.js",
|
|
41
|
+
"./ModelsSyncCommand": "./dist/commands/ModelsSyncCommand.js",
|
|
42
|
+
"./SeedCommand": "./dist/commands/SeedCommand.js",
|
|
43
|
+
"./setup": "./dist/setup.js",
|
|
33
44
|
"./package.json": "./package.json"
|
|
34
45
|
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"kanun": "^1.1.0",
|
|
48
|
+
"clear-router": "^2.6.4"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@arkormx/plugin-clear-router": "^0.1.9",
|
|
52
|
+
"arkormx": "^2.0.11",
|
|
53
|
+
"@arkstack/common": "^0.5.1",
|
|
54
|
+
"@arkstack/contract": "^0.5.1"
|
|
55
|
+
},
|
|
35
56
|
"scripts": {
|
|
36
|
-
"build": "tsdown --config-loader
|
|
37
|
-
"
|
|
57
|
+
"build": "tsdown --config-loader unrun",
|
|
58
|
+
"test": "vitest",
|
|
59
|
+
"version:patch": "pnpm version patch"
|
|
38
60
|
}
|
|
39
61
|
}
|