arkormx 2.0.9 → 2.0.11
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 +74 -54
- package/dist/{URLDriver-BpGqakSw.d.cts → index-BJDRQWuc.d.mts} +13 -3
- package/dist/{URLDriver-DMJkuKOm.d.mts → index-D2xzn3OX.d.cts} +13 -3
- package/dist/index.cjs +421 -388
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +138 -105
- package/dist/relationship/index.cjs +14 -14
- 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/{MorphToManyRelation-CYo17sC0.cjs → relationship-CG78rqWf.cjs} +24 -40
- package/dist/{MorphToManyRelation-DWmrAkT8.mjs → relationship-RG9V2vgd.mjs} +23 -39
- package/package.json +18 -11
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Aa as MorphToManyRelation, Ba as Relation, Fa as HasManyThroughRelation, Ia as HasManyRelation, La as BelongsToRelation, Ma as MorphManyRelation, Na as HasOneThroughRelation, Pa as HasOneRelation, Ra as SingleResultRelation, Va as RelationTableLoader, ja as MorphOneRelation, ka as SetBasedEagerLoader, za as BelongsToManyRelation } from "../
|
|
1
|
+
import { Aa as MorphToManyRelation, Ba as Relation, Fa as HasManyThroughRelation, Ia as HasManyRelation, La as BelongsToRelation, Ma as MorphManyRelation, Na as HasOneThroughRelation, Pa as HasOneRelation, Ra as SingleResultRelation, Va as RelationTableLoader, ja as MorphOneRelation, ka as SetBasedEagerLoader, za as BelongsToManyRelation } from "../index-BJDRQWuc.mjs";
|
|
2
2
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as HasOneRelation, c as BelongsToRelation, d as Relation, i as HasOneThroughRelation, l as SingleResultRelation, mn as RelationTableLoader, n as MorphOneRelation, o as HasManyThroughRelation, pn as SetBasedEagerLoader, r as MorphManyRelation, s as HasManyRelation, t as MorphToManyRelation, u as BelongsToManyRelation } from "../
|
|
1
|
+
import { a as HasOneRelation, c as BelongsToRelation, d as Relation, i as HasOneThroughRelation, l as SingleResultRelation, mn as RelationTableLoader, n as MorphOneRelation, o as HasManyThroughRelation, pn as SetBasedEagerLoader, r as MorphManyRelation, s as HasManyRelation, t as MorphToManyRelation, u as BelongsToManyRelation } from "../relationship-RG9V2vgd.mjs";
|
|
2
2
|
|
|
3
3
|
export { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, HasOneThroughRelation, MorphManyRelation, MorphOneRelation, MorphToManyRelation, Relation, RelationTableLoader, SetBasedEagerLoader, SingleResultRelation };
|
|
@@ -34,7 +34,7 @@ let module$1 = require("module");
|
|
|
34
34
|
let fs = require("fs");
|
|
35
35
|
let url = require("url");
|
|
36
36
|
let path = require("path");
|
|
37
|
-
path = __toESM(path);
|
|
37
|
+
path = __toESM(path, 1);
|
|
38
38
|
let node_fs = require("node:fs");
|
|
39
39
|
let node_crypto = require("node:crypto");
|
|
40
40
|
let node_child_process = require("node:child_process");
|
|
@@ -42,13 +42,6 @@ let _h3ravel_support = require("@h3ravel/support");
|
|
|
42
42
|
|
|
43
43
|
//#region src/Exceptions/ArkormException.ts
|
|
44
44
|
var ArkormException = class extends Error {
|
|
45
|
-
code;
|
|
46
|
-
operation;
|
|
47
|
-
model;
|
|
48
|
-
delegate;
|
|
49
|
-
relation;
|
|
50
|
-
scope;
|
|
51
|
-
meta;
|
|
52
45
|
constructor(message, context = {}) {
|
|
53
46
|
super(message, context.cause === void 0 ? void 0 : { cause: context.cause });
|
|
54
47
|
this.name = "ArkormException";
|
|
@@ -722,13 +715,13 @@ var UnsupportedAdapterFeatureException = class extends ArkormException {
|
|
|
722
715
|
//#endregion
|
|
723
716
|
//#region src/helpers/runtime-module-loader.ts
|
|
724
717
|
var RuntimeModuleLoader = class {
|
|
725
|
-
static async load(filePath) {
|
|
718
|
+
static async load(filePath, useDefault = false) {
|
|
726
719
|
const resolvedPath = (0, node_path.resolve)(filePath);
|
|
727
720
|
return await (0, jiti.createJiti)((0, node_url.pathToFileURL)(resolvedPath).href, {
|
|
728
721
|
interopDefault: false,
|
|
729
722
|
tsconfigPaths: true,
|
|
730
723
|
sourceMaps: true
|
|
731
|
-
}).import(resolvedPath, { default: true });
|
|
724
|
+
}).import(resolvedPath, useDefault ? { default: true } : {});
|
|
732
725
|
}
|
|
733
726
|
};
|
|
734
727
|
|
|
@@ -890,7 +883,6 @@ var PrimaryKeyGenerationPlanner = class {
|
|
|
890
883
|
* @since 0.2.2
|
|
891
884
|
*/
|
|
892
885
|
var ForeignKeyBuilder = class {
|
|
893
|
-
foreignKey;
|
|
894
886
|
constructor(foreignKey) {
|
|
895
887
|
this.foreignKey = foreignKey;
|
|
896
888
|
}
|
|
@@ -977,8 +969,6 @@ const normalizeEnumMembers = (columnName, values) => {
|
|
|
977
969
|
* @since 0.2.3
|
|
978
970
|
*/
|
|
979
971
|
var EnumBuilder = class {
|
|
980
|
-
tableBuilder;
|
|
981
|
-
columnName;
|
|
982
972
|
constructor(tableBuilder, columnName) {
|
|
983
973
|
this.tableBuilder = tableBuilder;
|
|
984
974
|
this.columnName = columnName;
|
|
@@ -1050,11 +1040,12 @@ var EnumBuilder = class {
|
|
|
1050
1040
|
* @since 0.1.0
|
|
1051
1041
|
*/
|
|
1052
1042
|
var TableBuilder = class {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1043
|
+
constructor() {
|
|
1044
|
+
this.columns = [];
|
|
1045
|
+
this.dropColumnNames = [];
|
|
1046
|
+
this.indexes = [];
|
|
1047
|
+
this.foreignKeys = [];
|
|
1048
|
+
}
|
|
1058
1049
|
/**
|
|
1059
1050
|
* Defines a primary key column in the table.
|
|
1060
1051
|
*
|
|
@@ -1468,7 +1459,9 @@ var TableBuilder = class {
|
|
|
1468
1459
|
* @since 0.1.0
|
|
1469
1460
|
*/
|
|
1470
1461
|
var SchemaBuilder = class {
|
|
1471
|
-
|
|
1462
|
+
constructor() {
|
|
1463
|
+
this.operations = [];
|
|
1464
|
+
}
|
|
1472
1465
|
/**
|
|
1473
1466
|
* Defines a new table to be created in the migration.
|
|
1474
1467
|
*
|
|
@@ -3033,11 +3026,9 @@ loadArkormConfig();
|
|
|
3033
3026
|
* @since 0.1.0
|
|
3034
3027
|
*/
|
|
3035
3028
|
var URLDriver = class URLDriver {
|
|
3036
|
-
static
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
fragment;
|
|
3040
|
-
pageName;
|
|
3029
|
+
static {
|
|
3030
|
+
this.DEFAULT_PAGE_NAME = "page";
|
|
3031
|
+
}
|
|
3041
3032
|
constructor(options = {}) {
|
|
3042
3033
|
this.path = options.path ?? "/";
|
|
3043
3034
|
this.query = options.query ?? {};
|
|
@@ -3079,9 +3070,6 @@ var URLDriver = class URLDriver {
|
|
|
3079
3070
|
* @since 0.1.0
|
|
3080
3071
|
*/
|
|
3081
3072
|
var LengthAwarePaginator = class {
|
|
3082
|
-
data;
|
|
3083
|
-
meta;
|
|
3084
|
-
urlDriver;
|
|
3085
3073
|
/**
|
|
3086
3074
|
* Creates a new LengthAwarePaginator instance.
|
|
3087
3075
|
*
|
|
@@ -3151,9 +3139,6 @@ var LengthAwarePaginator = class {
|
|
|
3151
3139
|
* @template T The type of the data being paginated.
|
|
3152
3140
|
*/
|
|
3153
3141
|
var Paginator = class {
|
|
3154
|
-
data;
|
|
3155
|
-
meta;
|
|
3156
|
-
urlDriver;
|
|
3157
3142
|
/**
|
|
3158
3143
|
* Creates a new simple Paginator instance.
|
|
3159
3144
|
*
|
|
@@ -3213,7 +3198,9 @@ var Paginator = class {
|
|
|
3213
3198
|
* @since 0.1.0
|
|
3214
3199
|
*/
|
|
3215
3200
|
var Relation = class {
|
|
3216
|
-
|
|
3201
|
+
constructor() {
|
|
3202
|
+
this.constraint = null;
|
|
3203
|
+
}
|
|
3217
3204
|
getRelationAdapter() {
|
|
3218
3205
|
const adapter = this.getRelatedModel().getAdapter();
|
|
3219
3206
|
if (!adapter) throw new UnsupportedAdapterFeatureException("Relationship resolution requires a configured adapter.", { operation: "relation.adapter" });
|
|
@@ -3454,14 +3441,9 @@ var Relation = class {
|
|
|
3454
3441
|
* @since 0.1.0
|
|
3455
3442
|
*/
|
|
3456
3443
|
var BelongsToManyRelation = class BelongsToManyRelation extends Relation {
|
|
3457
|
-
static
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
pivotCreatedAtColumn;
|
|
3461
|
-
pivotUpdatedAtColumn;
|
|
3462
|
-
pivotWhere;
|
|
3463
|
-
pivotModel;
|
|
3464
|
-
shouldAttachPivot = false;
|
|
3444
|
+
static {
|
|
3445
|
+
this.queryDecorationMarker = Symbol("belongsToManyQueryDecoration");
|
|
3446
|
+
}
|
|
3465
3447
|
constructor(parent, related, throughTable, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {
|
|
3466
3448
|
super();
|
|
3467
3449
|
this.parent = parent;
|
|
@@ -3471,6 +3453,9 @@ var BelongsToManyRelation = class BelongsToManyRelation extends Relation {
|
|
|
3471
3453
|
this.relatedPivotKey = relatedPivotKey;
|
|
3472
3454
|
this.parentKey = parentKey;
|
|
3473
3455
|
this.relatedKey = relatedKey;
|
|
3456
|
+
this.pivotColumns = /* @__PURE__ */ new Set();
|
|
3457
|
+
this.pivotAccessor = "pivot";
|
|
3458
|
+
this.shouldAttachPivot = false;
|
|
3474
3459
|
}
|
|
3475
3460
|
/**
|
|
3476
3461
|
* Specifies additional pivot columns to include on the related models.
|
|
@@ -4042,7 +4027,6 @@ var BelongsToManyRelation = class BelongsToManyRelation extends Relation {
|
|
|
4042
4027
|
* @since 1.3.0
|
|
4043
4028
|
*/
|
|
4044
4029
|
var SingleResultRelation = class extends Relation {
|
|
4045
|
-
defaultValue;
|
|
4046
4030
|
constructor(parent, related) {
|
|
4047
4031
|
super();
|
|
4048
4032
|
this.parent = parent;
|
|
@@ -14,13 +14,6 @@ import { str } from "@h3ravel/support";
|
|
|
14
14
|
|
|
15
15
|
//#region src/Exceptions/ArkormException.ts
|
|
16
16
|
var ArkormException = class extends Error {
|
|
17
|
-
code;
|
|
18
|
-
operation;
|
|
19
|
-
model;
|
|
20
|
-
delegate;
|
|
21
|
-
relation;
|
|
22
|
-
scope;
|
|
23
|
-
meta;
|
|
24
17
|
constructor(message, context = {}) {
|
|
25
18
|
super(message, context.cause === void 0 ? void 0 : { cause: context.cause });
|
|
26
19
|
this.name = "ArkormException";
|
|
@@ -694,13 +687,13 @@ var UnsupportedAdapterFeatureException = class extends ArkormException {
|
|
|
694
687
|
//#endregion
|
|
695
688
|
//#region src/helpers/runtime-module-loader.ts
|
|
696
689
|
var RuntimeModuleLoader = class {
|
|
697
|
-
static async load(filePath) {
|
|
690
|
+
static async load(filePath, useDefault = false) {
|
|
698
691
|
const resolvedPath = resolve(filePath);
|
|
699
692
|
return await createJiti(pathToFileURL(resolvedPath).href, {
|
|
700
693
|
interopDefault: false,
|
|
701
694
|
tsconfigPaths: true,
|
|
702
695
|
sourceMaps: true
|
|
703
|
-
}).import(resolvedPath, { default: true });
|
|
696
|
+
}).import(resolvedPath, useDefault ? { default: true } : {});
|
|
704
697
|
}
|
|
705
698
|
};
|
|
706
699
|
|
|
@@ -862,7 +855,6 @@ var PrimaryKeyGenerationPlanner = class {
|
|
|
862
855
|
* @since 0.2.2
|
|
863
856
|
*/
|
|
864
857
|
var ForeignKeyBuilder = class {
|
|
865
|
-
foreignKey;
|
|
866
858
|
constructor(foreignKey) {
|
|
867
859
|
this.foreignKey = foreignKey;
|
|
868
860
|
}
|
|
@@ -949,8 +941,6 @@ const normalizeEnumMembers = (columnName, values) => {
|
|
|
949
941
|
* @since 0.2.3
|
|
950
942
|
*/
|
|
951
943
|
var EnumBuilder = class {
|
|
952
|
-
tableBuilder;
|
|
953
|
-
columnName;
|
|
954
944
|
constructor(tableBuilder, columnName) {
|
|
955
945
|
this.tableBuilder = tableBuilder;
|
|
956
946
|
this.columnName = columnName;
|
|
@@ -1022,11 +1012,12 @@ var EnumBuilder = class {
|
|
|
1022
1012
|
* @since 0.1.0
|
|
1023
1013
|
*/
|
|
1024
1014
|
var TableBuilder = class {
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1015
|
+
constructor() {
|
|
1016
|
+
this.columns = [];
|
|
1017
|
+
this.dropColumnNames = [];
|
|
1018
|
+
this.indexes = [];
|
|
1019
|
+
this.foreignKeys = [];
|
|
1020
|
+
}
|
|
1030
1021
|
/**
|
|
1031
1022
|
* Defines a primary key column in the table.
|
|
1032
1023
|
*
|
|
@@ -1440,7 +1431,9 @@ var TableBuilder = class {
|
|
|
1440
1431
|
* @since 0.1.0
|
|
1441
1432
|
*/
|
|
1442
1433
|
var SchemaBuilder = class {
|
|
1443
|
-
|
|
1434
|
+
constructor() {
|
|
1435
|
+
this.operations = [];
|
|
1436
|
+
}
|
|
1444
1437
|
/**
|
|
1445
1438
|
* Defines a new table to be created in the migration.
|
|
1446
1439
|
*
|
|
@@ -3005,11 +2998,9 @@ loadArkormConfig();
|
|
|
3005
2998
|
* @since 0.1.0
|
|
3006
2999
|
*/
|
|
3007
3000
|
var URLDriver = class URLDriver {
|
|
3008
|
-
static
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
fragment;
|
|
3012
|
-
pageName;
|
|
3001
|
+
static {
|
|
3002
|
+
this.DEFAULT_PAGE_NAME = "page";
|
|
3003
|
+
}
|
|
3013
3004
|
constructor(options = {}) {
|
|
3014
3005
|
this.path = options.path ?? "/";
|
|
3015
3006
|
this.query = options.query ?? {};
|
|
@@ -3051,9 +3042,6 @@ var URLDriver = class URLDriver {
|
|
|
3051
3042
|
* @since 0.1.0
|
|
3052
3043
|
*/
|
|
3053
3044
|
var LengthAwarePaginator = class {
|
|
3054
|
-
data;
|
|
3055
|
-
meta;
|
|
3056
|
-
urlDriver;
|
|
3057
3045
|
/**
|
|
3058
3046
|
* Creates a new LengthAwarePaginator instance.
|
|
3059
3047
|
*
|
|
@@ -3123,9 +3111,6 @@ var LengthAwarePaginator = class {
|
|
|
3123
3111
|
* @template T The type of the data being paginated.
|
|
3124
3112
|
*/
|
|
3125
3113
|
var Paginator = class {
|
|
3126
|
-
data;
|
|
3127
|
-
meta;
|
|
3128
|
-
urlDriver;
|
|
3129
3114
|
/**
|
|
3130
3115
|
* Creates a new simple Paginator instance.
|
|
3131
3116
|
*
|
|
@@ -3185,7 +3170,9 @@ var Paginator = class {
|
|
|
3185
3170
|
* @since 0.1.0
|
|
3186
3171
|
*/
|
|
3187
3172
|
var Relation = class {
|
|
3188
|
-
|
|
3173
|
+
constructor() {
|
|
3174
|
+
this.constraint = null;
|
|
3175
|
+
}
|
|
3189
3176
|
getRelationAdapter() {
|
|
3190
3177
|
const adapter = this.getRelatedModel().getAdapter();
|
|
3191
3178
|
if (!adapter) throw new UnsupportedAdapterFeatureException("Relationship resolution requires a configured adapter.", { operation: "relation.adapter" });
|
|
@@ -3426,14 +3413,9 @@ var Relation = class {
|
|
|
3426
3413
|
* @since 0.1.0
|
|
3427
3414
|
*/
|
|
3428
3415
|
var BelongsToManyRelation = class BelongsToManyRelation extends Relation {
|
|
3429
|
-
static
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
pivotCreatedAtColumn;
|
|
3433
|
-
pivotUpdatedAtColumn;
|
|
3434
|
-
pivotWhere;
|
|
3435
|
-
pivotModel;
|
|
3436
|
-
shouldAttachPivot = false;
|
|
3416
|
+
static {
|
|
3417
|
+
this.queryDecorationMarker = Symbol("belongsToManyQueryDecoration");
|
|
3418
|
+
}
|
|
3437
3419
|
constructor(parent, related, throughTable, foreignPivotKey, relatedPivotKey, parentKey, relatedKey) {
|
|
3438
3420
|
super();
|
|
3439
3421
|
this.parent = parent;
|
|
@@ -3443,6 +3425,9 @@ var BelongsToManyRelation = class BelongsToManyRelation extends Relation {
|
|
|
3443
3425
|
this.relatedPivotKey = relatedPivotKey;
|
|
3444
3426
|
this.parentKey = parentKey;
|
|
3445
3427
|
this.relatedKey = relatedKey;
|
|
3428
|
+
this.pivotColumns = /* @__PURE__ */ new Set();
|
|
3429
|
+
this.pivotAccessor = "pivot";
|
|
3430
|
+
this.shouldAttachPivot = false;
|
|
3446
3431
|
}
|
|
3447
3432
|
/**
|
|
3448
3433
|
* Specifies additional pivot columns to include on the related models.
|
|
@@ -4014,7 +3999,6 @@ var BelongsToManyRelation = class BelongsToManyRelation extends Relation {
|
|
|
4014
3999
|
* @since 1.3.0
|
|
4015
4000
|
*/
|
|
4016
4001
|
var SingleResultRelation = class extends Relation {
|
|
4017
|
-
defaultValue;
|
|
4018
4002
|
constructor(parent, related) {
|
|
4019
4003
|
super();
|
|
4020
4004
|
this.parent = parent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arkormx",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"description": "Modern TypeScript-first ORM for Node.js.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"orm",
|
|
@@ -51,19 +51,27 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@eslint/js": "^10.0.1",
|
|
54
|
-
"@eslint/markdown": "^
|
|
54
|
+
"@eslint/markdown": "^8.0.1",
|
|
55
55
|
"@prisma/adapter-pg": "^7.6.0",
|
|
56
56
|
"@prisma/client": "^7.8",
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@types/
|
|
57
|
+
"@swc/core": "^1.15.33",
|
|
58
|
+
"@swc/helpers": "^0.5.21",
|
|
59
|
+
"@types/express": "^5.0.6",
|
|
60
|
+
"@types/node": "^25.6.2",
|
|
61
|
+
"@types/pg": "^8.16.0",
|
|
62
|
+
"@viteplus/versions": "^2.0.6",
|
|
60
63
|
"@vitest/coverage-v8": "^4.1.5",
|
|
61
64
|
"barrelize": "^1.7.3",
|
|
62
|
-
"
|
|
65
|
+
"dotenv": "^17.3.1",
|
|
66
|
+
"eslint": "^10.3.0",
|
|
63
67
|
"prisma": "^7.6.0",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"typescript
|
|
68
|
+
"reflect-metadata": "^0.2.2",
|
|
69
|
+
"tsdown": "^0.22.0",
|
|
70
|
+
"typescript": "^6.0.0",
|
|
71
|
+
"typescript-eslint": "^8.59.2",
|
|
72
|
+
"unplugin-swc": "^1.5.9",
|
|
73
|
+
"unrun": "^0.3.0",
|
|
74
|
+
"vite-plugin-swc-transform": "^1.1.1",
|
|
67
75
|
"vitepress": "^2.0.0-alpha.17",
|
|
68
76
|
"vitest": "^4.1.5"
|
|
69
77
|
},
|
|
@@ -75,9 +83,8 @@
|
|
|
75
83
|
"@h3ravel/musket": "^0.10.1",
|
|
76
84
|
"@h3ravel/shared": "^0.27.13",
|
|
77
85
|
"@h3ravel/support": "^0.15.11",
|
|
78
|
-
"@viteplus/versions": "^2.0.6",
|
|
79
|
-
"jiti": "^2.7.0",
|
|
80
86
|
"dotenv": "^17.3.1",
|
|
87
|
+
"jiti": "^2.7.0",
|
|
81
88
|
"kysely": "^0.28.15",
|
|
82
89
|
"pg": "^8.19.0"
|
|
83
90
|
},
|