arkormx 2.6.1 → 2.7.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/cli.mjs +53 -7
- package/dist/{index-BTBfGF_o.d.mts → index-C77nMASp.d.mts} +402 -3
- package/dist/{index-CBh5Z2sS.d.cts → index-Dnn0lsDy.d.cts} +402 -3
- package/dist/index.cjs +729 -5
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +729 -6
- package/dist/relationship/index.cjs +1 -1
- package/dist/relationship/index.d.cts +1 -1
- package/dist/relationship/index.d.mts +1 -1
- package/dist/relationship/index.mjs +1 -1
- package/dist/{relationship-CxCQj_Pg.cjs → relationship-B8FaJYIx.cjs} +49 -7
- package/dist/{relationship-DT4myOWX.mjs → relationship-BuwKUTOb.mjs} +49 -7
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_relationship = require('../relationship-
|
|
2
|
+
const require_relationship = require('../relationship-B8FaJYIx.cjs');
|
|
3
3
|
|
|
4
4
|
exports.BelongsToManyRelation = require_relationship.BelongsToManyRelation;
|
|
5
5
|
exports.BelongsToRelation = require_relationship.BelongsToRelation;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ao as MorphManyRelation, Do as MorphToRelation, Eo as SetBasedEagerLoader, Fo as BelongsToRelation, Io as SingleResultRelation, Lo as BelongsToManyRelation, Mo as HasOneRelation, No as HasManyThroughRelation, Oo as MorphToManyRelation, Po as HasManyRelation, Ro as Relation, jo as HasOneThroughRelation, ko as MorphOneRelation, zo as RelationTableLoader } from "../index-Dnn0lsDy.cjs";
|
|
2
2
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, MorphToRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ao as MorphManyRelation, Do as MorphToRelation, Eo as SetBasedEagerLoader, Fo as BelongsToRelation, Io as SingleResultRelation, Lo as BelongsToManyRelation, Mo as HasOneRelation, No as HasManyThroughRelation, Oo as MorphToManyRelation, Po as HasManyRelation, Ro as Relation, jo as HasOneThroughRelation, ko as MorphOneRelation, zo as RelationTableLoader } from "../index-C77nMASp.mjs";
|
|
2
2
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, MorphToRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Nn as SetBasedEagerLoader, Pn as RelationTableLoader, a as HasOneThroughRelation, c as HasManyRelation, d as BelongsToManyRelation, f as Relation, i as MorphManyRelation, l as BelongsToRelation, n as MorphToManyRelation, o as HasOneRelation, r as MorphOneRelation, s as HasManyThroughRelation, t as MorphToRelation, u as SingleResultRelation } from "../relationship-
|
|
1
|
+
import { Nn as SetBasedEagerLoader, Pn as RelationTableLoader, a as HasOneThroughRelation, c as HasManyRelation, d as BelongsToManyRelation, f as Relation, i as MorphManyRelation, l as BelongsToRelation, n as MorphToManyRelation, o as HasOneRelation, r as MorphOneRelation, s as HasManyThroughRelation, t as MorphToRelation, u as SingleResultRelation } from "../relationship-BuwKUTOb.mjs";
|
|
2
2
|
|
|
3
3
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, MorphToRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|
|
@@ -1129,6 +1129,10 @@ var PrimaryKeyGenerationPlanner = class {
|
|
|
1129
1129
|
//#endregion
|
|
1130
1130
|
//#region src/database/TableBuilder.ts
|
|
1131
1131
|
const PRISMA_ENUM_MEMBER_REGEX$1 = /^[A-Za-z][A-Za-z0-9_]*$/;
|
|
1132
|
+
const defaultTimestampNames = {
|
|
1133
|
+
createdAt: "createdAt",
|
|
1134
|
+
updatedAt: "updatedAt"
|
|
1135
|
+
};
|
|
1132
1136
|
const normalizeEnumMember = (columnName, value) => {
|
|
1133
1137
|
const normalized = value.trim();
|
|
1134
1138
|
if (!normalized) throw new Error(`Enum column [${columnName}] must define only non-empty values.`);
|
|
@@ -1440,21 +1444,59 @@ var TableBuilder = class {
|
|
|
1440
1444
|
}
|
|
1441
1445
|
/**
|
|
1442
1446
|
* Defines both createdAt and updatedAt timestamp columns in the table.
|
|
1443
|
-
*
|
|
1444
|
-
*
|
|
1447
|
+
*
|
|
1448
|
+
* The attribute casing (the names exposed on the model) is controlled by the
|
|
1449
|
+
* first argument, while the optional second argument controls the casing used
|
|
1450
|
+
* for the persisted database column names via `.map()`.
|
|
1451
|
+
*
|
|
1452
|
+
* @example
|
|
1453
|
+
* table.timestamps() // createdAt / updatedAt
|
|
1454
|
+
* table.timestamps('snake') // created_at / updated_at
|
|
1455
|
+
* table.timestamps('camel', 'snake') // createdAt -> created_at (mapped)
|
|
1456
|
+
* table.timestamps({ createdAt: 'createdOn' })
|
|
1457
|
+
* table.timestamps('camel', { createdAt: 'created_on' })
|
|
1458
|
+
*
|
|
1459
|
+
* @param casing The casing (or explicit names) used for the attribute names.
|
|
1460
|
+
* @param mapCasing The casing (or explicit names) used for the mapped database columns.
|
|
1461
|
+
* @returns
|
|
1445
1462
|
*/
|
|
1446
|
-
timestamps() {
|
|
1447
|
-
this.
|
|
1463
|
+
timestamps(casing = "camel", mapCasing) {
|
|
1464
|
+
const names = this.resolveTimestampNames(casing, defaultTimestampNames);
|
|
1465
|
+
const maps = mapCasing === void 0 ? void 0 : this.resolveTimestampNames(mapCasing, names);
|
|
1466
|
+
this.timestamp(names.createdAt, {
|
|
1448
1467
|
nullable: false,
|
|
1449
|
-
default: "now()"
|
|
1468
|
+
default: "now()",
|
|
1469
|
+
...maps && maps.createdAt !== names.createdAt ? { map: maps.createdAt } : {}
|
|
1450
1470
|
});
|
|
1451
|
-
this.timestamp(
|
|
1471
|
+
this.timestamp(names.updatedAt, {
|
|
1452
1472
|
nullable: false,
|
|
1453
|
-
updatedAt: true
|
|
1473
|
+
updatedAt: true,
|
|
1474
|
+
...maps && maps.updatedAt !== names.updatedAt ? { map: maps.updatedAt } : {}
|
|
1454
1475
|
});
|
|
1455
1476
|
return this;
|
|
1456
1477
|
}
|
|
1457
1478
|
/**
|
|
1479
|
+
* Resolves a timestamp naming option into concrete createdAt / updatedAt names.
|
|
1480
|
+
*
|
|
1481
|
+
* @param naming The casing keyword or explicit name overrides.
|
|
1482
|
+
* @param fallback The names used when an explicit override is omitted.
|
|
1483
|
+
* @returns
|
|
1484
|
+
*/
|
|
1485
|
+
resolveTimestampNames(naming, fallback) {
|
|
1486
|
+
if (naming === "snake") return {
|
|
1487
|
+
createdAt: "created_at",
|
|
1488
|
+
updatedAt: "updated_at"
|
|
1489
|
+
};
|
|
1490
|
+
if (naming === "camel") return {
|
|
1491
|
+
createdAt: "createdAt",
|
|
1492
|
+
updatedAt: "updatedAt"
|
|
1493
|
+
};
|
|
1494
|
+
return {
|
|
1495
|
+
createdAt: naming.createdAt ?? fallback.createdAt,
|
|
1496
|
+
updatedAt: naming.updatedAt ?? fallback.updatedAt
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1458
1500
|
* Defines a soft delete timestamp column in the table.
|
|
1459
1501
|
*
|
|
1460
1502
|
* @param column The name of the soft delete column.
|
|
@@ -1101,6 +1101,10 @@ var PrimaryKeyGenerationPlanner = class {
|
|
|
1101
1101
|
//#endregion
|
|
1102
1102
|
//#region src/database/TableBuilder.ts
|
|
1103
1103
|
const PRISMA_ENUM_MEMBER_REGEX$1 = /^[A-Za-z][A-Za-z0-9_]*$/;
|
|
1104
|
+
const defaultTimestampNames = {
|
|
1105
|
+
createdAt: "createdAt",
|
|
1106
|
+
updatedAt: "updatedAt"
|
|
1107
|
+
};
|
|
1104
1108
|
const normalizeEnumMember = (columnName, value) => {
|
|
1105
1109
|
const normalized = value.trim();
|
|
1106
1110
|
if (!normalized) throw new Error(`Enum column [${columnName}] must define only non-empty values.`);
|
|
@@ -1412,21 +1416,59 @@ var TableBuilder = class {
|
|
|
1412
1416
|
}
|
|
1413
1417
|
/**
|
|
1414
1418
|
* Defines both createdAt and updatedAt timestamp columns in the table.
|
|
1415
|
-
*
|
|
1416
|
-
*
|
|
1419
|
+
*
|
|
1420
|
+
* The attribute casing (the names exposed on the model) is controlled by the
|
|
1421
|
+
* first argument, while the optional second argument controls the casing used
|
|
1422
|
+
* for the persisted database column names via `.map()`.
|
|
1423
|
+
*
|
|
1424
|
+
* @example
|
|
1425
|
+
* table.timestamps() // createdAt / updatedAt
|
|
1426
|
+
* table.timestamps('snake') // created_at / updated_at
|
|
1427
|
+
* table.timestamps('camel', 'snake') // createdAt -> created_at (mapped)
|
|
1428
|
+
* table.timestamps({ createdAt: 'createdOn' })
|
|
1429
|
+
* table.timestamps('camel', { createdAt: 'created_on' })
|
|
1430
|
+
*
|
|
1431
|
+
* @param casing The casing (or explicit names) used for the attribute names.
|
|
1432
|
+
* @param mapCasing The casing (or explicit names) used for the mapped database columns.
|
|
1433
|
+
* @returns
|
|
1417
1434
|
*/
|
|
1418
|
-
timestamps() {
|
|
1419
|
-
this.
|
|
1435
|
+
timestamps(casing = "camel", mapCasing) {
|
|
1436
|
+
const names = this.resolveTimestampNames(casing, defaultTimestampNames);
|
|
1437
|
+
const maps = mapCasing === void 0 ? void 0 : this.resolveTimestampNames(mapCasing, names);
|
|
1438
|
+
this.timestamp(names.createdAt, {
|
|
1420
1439
|
nullable: false,
|
|
1421
|
-
default: "now()"
|
|
1440
|
+
default: "now()",
|
|
1441
|
+
...maps && maps.createdAt !== names.createdAt ? { map: maps.createdAt } : {}
|
|
1422
1442
|
});
|
|
1423
|
-
this.timestamp(
|
|
1443
|
+
this.timestamp(names.updatedAt, {
|
|
1424
1444
|
nullable: false,
|
|
1425
|
-
updatedAt: true
|
|
1445
|
+
updatedAt: true,
|
|
1446
|
+
...maps && maps.updatedAt !== names.updatedAt ? { map: maps.updatedAt } : {}
|
|
1426
1447
|
});
|
|
1427
1448
|
return this;
|
|
1428
1449
|
}
|
|
1429
1450
|
/**
|
|
1451
|
+
* Resolves a timestamp naming option into concrete createdAt / updatedAt names.
|
|
1452
|
+
*
|
|
1453
|
+
* @param naming The casing keyword or explicit name overrides.
|
|
1454
|
+
* @param fallback The names used when an explicit override is omitted.
|
|
1455
|
+
* @returns
|
|
1456
|
+
*/
|
|
1457
|
+
resolveTimestampNames(naming, fallback) {
|
|
1458
|
+
if (naming === "snake") return {
|
|
1459
|
+
createdAt: "created_at",
|
|
1460
|
+
updatedAt: "updated_at"
|
|
1461
|
+
};
|
|
1462
|
+
if (naming === "camel") return {
|
|
1463
|
+
createdAt: "createdAt",
|
|
1464
|
+
updatedAt: "updatedAt"
|
|
1465
|
+
};
|
|
1466
|
+
return {
|
|
1467
|
+
createdAt: naming.createdAt ?? fallback.createdAt,
|
|
1468
|
+
updatedAt: naming.updatedAt ?? fallback.updatedAt
|
|
1469
|
+
};
|
|
1470
|
+
}
|
|
1471
|
+
/**
|
|
1430
1472
|
* Defines a soft delete timestamp column in the table.
|
|
1431
1473
|
*
|
|
1432
1474
|
* @param column The name of the soft delete column.
|