@abedmurrar/objection 4.0.0-alpha.0 → 4.0.0-beta.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/README.md +103 -67
- package/lib/index.mjs +6 -0
- package/lib/initialize.js +6 -9
- package/lib/model/AjvValidator.js +235 -282
- package/lib/model/Model.js +653 -823
- package/lib/model/ModifierNotFoundError.js +5 -7
- package/lib/model/NotFoundError.js +14 -18
- package/lib/model/RelationDoesNotExistError.js +6 -9
- package/lib/model/ValidationError.js +33 -41
- package/lib/model/Validator.js +15 -21
- package/lib/model/getModel.js +1 -3
- package/lib/model/graph/ModelGraph.js +44 -64
- package/lib/model/graph/ModelGraphBuilder.js +164 -217
- package/lib/model/graph/ModelGraphEdge.js +31 -43
- package/lib/model/graph/ModelGraphNode.js +192 -231
- package/lib/model/inheritModel.js +9 -18
- package/lib/model/modelBindKnex.js +48 -62
- package/lib/model/modelClone.js +79 -98
- package/lib/model/modelColPropMap.js +16 -26
- package/lib/model/modelConcurrency.js +24 -0
- package/lib/model/modelId.js +44 -49
- package/lib/model/modelJsonAttributes.js +56 -76
- package/lib/model/modelParseRelations.js +68 -67
- package/lib/model/modelQueryProps.js +76 -107
- package/lib/model/modelSet.js +92 -112
- package/lib/model/modelTableMetadata.js +60 -72
- package/lib/model/modelToJson.js +120 -150
- package/lib/model/modelUtils.js +30 -37
- package/lib/model/modelValidate.js +34 -42
- package/lib/model/modelValues.js +78 -91
- package/lib/model/modelVisitor.js +22 -29
- package/lib/objection.js +42 -67
- package/lib/queryBuilder/FunctionBuilder.js +231 -279
- package/lib/queryBuilder/InternalOptions.js +19 -24
- package/lib/queryBuilder/JoinBuilder.js +116 -149
- package/lib/queryBuilder/QueryBuilder.js +1009 -1271
- package/lib/queryBuilder/QueryBuilderBase.js +647 -865
- package/lib/queryBuilder/QueryBuilderContext.js +14 -21
- package/lib/queryBuilder/QueryBuilderContextBase.js +20 -29
- package/lib/queryBuilder/QueryBuilderOperationSupport.js +462 -536
- package/lib/queryBuilder/QueryBuilderUserContext.js +19 -25
- package/lib/queryBuilder/RawBuilder.js +58 -73
- package/lib/queryBuilder/ReferenceBuilder.js +232 -270
- package/lib/queryBuilder/RelationExpression.js +322 -380
- package/lib/queryBuilder/StaticHookArguments.js +94 -106
- package/lib/queryBuilder/ValueBuilder.js +100 -112
- package/lib/queryBuilder/expressions.js +86 -116
- package/lib/queryBuilder/functions/mysql.js +642 -697
- package/lib/queryBuilder/graph/GraphAction.js +44 -59
- package/lib/queryBuilder/graph/GraphData.js +7 -9
- package/lib/queryBuilder/graph/GraphFetcher.js +115 -151
- package/lib/queryBuilder/graph/GraphNodeDbExistence.js +114 -152
- package/lib/queryBuilder/graph/GraphOperation.js +16 -22
- package/lib/queryBuilder/graph/GraphOptions.js +143 -185
- package/lib/queryBuilder/graph/GraphUpsert.js +167 -241
- package/lib/queryBuilder/graph/delete/GraphDelete.js +8 -13
- package/lib/queryBuilder/graph/delete/GraphDeleteAction.js +44 -62
- package/lib/queryBuilder/graph/insert/GraphInsert.js +99 -128
- package/lib/queryBuilder/graph/insert/GraphInsertAction.js +151 -193
- package/lib/queryBuilder/graph/insert/JoinRowGraphInsertAction.js +57 -79
- package/lib/queryBuilder/graph/patch/GraphPatch.js +8 -13
- package/lib/queryBuilder/graph/patch/GraphPatchAction.js +181 -234
- package/lib/queryBuilder/graph/recursiveUpsert/GraphRecursiveUpsert.js +16 -21
- package/lib/queryBuilder/graph/recursiveUpsert/GraphRecursiveUpsertAction.js +80 -110
- package/lib/queryBuilder/join/JoinResultColumn.js +14 -18
- package/lib/queryBuilder/join/JoinResultParser.js +88 -101
- package/lib/queryBuilder/join/RelationJoiner.js +205 -288
- package/lib/queryBuilder/join/TableNode.js +117 -144
- package/lib/queryBuilder/join/TableTree.js +60 -76
- package/lib/queryBuilder/join/utils.js +10 -16
- package/lib/queryBuilder/operations/DelegateOperation.js +93 -133
- package/lib/queryBuilder/operations/DeleteOperation.js +33 -37
- package/lib/queryBuilder/operations/FindByIdOperation.js +20 -28
- package/lib/queryBuilder/operations/FindByIdsOperation.js +17 -23
- package/lib/queryBuilder/operations/FindOperation.js +114 -131
- package/lib/queryBuilder/operations/FirstOperation.js +14 -19
- package/lib/queryBuilder/operations/FromOperation.js +69 -88
- package/lib/queryBuilder/operations/InsertAndFetchOperation.js +28 -39
- package/lib/queryBuilder/operations/InsertGraphAndFetchOperation.js +25 -35
- package/lib/queryBuilder/operations/InsertGraphOperation.js +77 -98
- package/lib/queryBuilder/operations/InsertOperation.js +132 -165
- package/lib/queryBuilder/operations/InstanceDeleteOperation.js +27 -36
- package/lib/queryBuilder/operations/InstanceFindOperation.js +9 -13
- package/lib/queryBuilder/operations/InstanceInsertOperation.js +13 -17
- package/lib/queryBuilder/operations/InstanceUpdateOperation.js +32 -46
- package/lib/queryBuilder/operations/JoinRelatedOperation.js +66 -86
- package/lib/queryBuilder/operations/KnexOperation.js +4 -7
- package/lib/queryBuilder/operations/MergeOperation.js +32 -45
- package/lib/queryBuilder/operations/ObjectionToKnexConvertingOperation.js +131 -150
- package/lib/queryBuilder/operations/OnBuildKnexOperation.js +17 -23
- package/lib/queryBuilder/operations/OnBuildOperation.js +17 -23
- package/lib/queryBuilder/operations/OnErrorOperation.js +17 -23
- package/lib/queryBuilder/operations/QueryBuilderOperation.js +231 -270
- package/lib/queryBuilder/operations/RangeOperation.js +30 -40
- package/lib/queryBuilder/operations/RelateOperation.js +14 -21
- package/lib/queryBuilder/operations/ReturningOperation.js +12 -18
- package/lib/queryBuilder/operations/RunAfterOperation.js +17 -23
- package/lib/queryBuilder/operations/RunBeforeOperation.js +17 -23
- package/lib/queryBuilder/operations/UnrelateOperation.js +12 -17
- package/lib/queryBuilder/operations/UpdateAndFetchOperation.js +48 -65
- package/lib/queryBuilder/operations/UpdateOperation.js +104 -129
- package/lib/queryBuilder/operations/UpsertGraphAndFetchOperation.js +25 -35
- package/lib/queryBuilder/operations/UpsertGraphOperation.js +36 -55
- package/lib/queryBuilder/operations/WhereCompositeOperation.js +30 -39
- package/lib/queryBuilder/operations/WhereInOperation.js +34 -36
- package/lib/queryBuilder/operations/eager/EagerOperation.js +37 -52
- package/lib/queryBuilder/operations/eager/JoinEagerOperation.js +34 -44
- package/lib/queryBuilder/operations/eager/NaiveEagerOperation.js +4 -7
- package/lib/queryBuilder/operations/eager/WhereInEagerOperation.js +193 -251
- package/lib/queryBuilder/operations/jsonApi/WhereJsonHasOperation.js +18 -25
- package/lib/queryBuilder/operations/jsonApi/WhereJsonNotObjectOperation.js +25 -41
- package/lib/queryBuilder/operations/jsonApi/WhereJsonOperation.js +19 -20
- package/lib/queryBuilder/operations/jsonApi/WhereJsonOverlapsOperation.js +23 -21
- package/lib/queryBuilder/operations/jsonApi/mysqlJsonApi.js +106 -118
- package/lib/queryBuilder/operations/jsonApi/postgresJsonApi.js +79 -108
- package/lib/queryBuilder/operations/select/SelectOperation.js +37 -53
- package/lib/queryBuilder/operations/select/Selection.js +94 -105
- package/lib/queryBuilder/operations/whereInComposite/WhereInCompositeMsSqlOperation.js +68 -101
- package/lib/queryBuilder/operations/whereInComposite/WhereInCompositeOperation.js +65 -75
- package/lib/queryBuilder/operations/whereInComposite/WhereInCompositeSqliteOperation.js +75 -84
- package/lib/queryBuilder/parsers/jsonFieldExpressionParser.js +760 -859
- package/lib/queryBuilder/parsers/relationExpressionParser.js +840 -952
- package/lib/queryBuilder/transformations/CompositeQueryTransformation.js +10 -15
- package/lib/queryBuilder/transformations/QueryTransformation.js +4 -6
- package/lib/queryBuilder/transformations/WrapMysqlModifySubqueryTransformation.js +35 -49
- package/lib/queryBuilder/transformations/index.js +3 -9
- package/lib/queryBuilder/whereScopes.js +158 -186
- package/lib/relations/Relation.js +293 -375
- package/lib/relations/RelationDeleteOperation.js +24 -28
- package/lib/relations/RelationFindOperation.js +108 -138
- package/lib/relations/RelationInsertOperation.js +24 -32
- package/lib/relations/RelationOwner.js +175 -209
- package/lib/relations/RelationProperty.js +186 -223
- package/lib/relations/RelationUpdateOperation.js +23 -29
- package/lib/relations/belongsToOne/BelongsToOneDeleteOperation.js +16 -21
- package/lib/relations/belongsToOne/BelongsToOneInsertOperation.js +30 -41
- package/lib/relations/belongsToOne/BelongsToOneRelateOperation.js +36 -47
- package/lib/relations/belongsToOne/BelongsToOneRelation.js +42 -50
- package/lib/relations/belongsToOne/BelongsToOneUnrelateOperation.js +43 -58
- package/lib/relations/hasMany/HasManyInsertOperation.js +40 -56
- package/lib/relations/hasMany/HasManyRelateOperation.js +45 -61
- package/lib/relations/hasMany/HasManyRelation.js +38 -46
- package/lib/relations/hasMany/HasManyUnrelateOperation.js +25 -32
- package/lib/relations/hasOne/HasOneRelation.js +9 -12
- package/lib/relations/hasOneThrough/HasOneThroughRelation.js +9 -12
- package/lib/relations/manyToMany/ManyToManyModifyMixin.js +73 -95
- package/lib/relations/manyToMany/ManyToManyRelation.js +374 -473
- package/lib/relations/manyToMany/ManyToManySqliteModifyMixin.js +23 -30
- package/lib/relations/manyToMany/delete/ManyToManyDeleteOperation.js +8 -10
- package/lib/relations/manyToMany/delete/ManyToManyDeleteOperationBase.js +20 -25
- package/lib/relations/manyToMany/delete/ManyToManyDeleteSqliteOperation.js +8 -12
- package/lib/relations/manyToMany/find/ManyToManyFindOperation.js +77 -100
- package/lib/relations/manyToMany/insert/ManyToManyInsertOperation.js +37 -49
- package/lib/relations/manyToMany/relate/ManyToManyRelateOperation.js +58 -74
- package/lib/relations/manyToMany/unrelate/ManyToManyUnrelateOperation.js +10 -13
- package/lib/relations/manyToMany/unrelate/ManyToManyUnrelateOperationBase.js +26 -33
- package/lib/relations/manyToMany/unrelate/ManyToManyUnrelateSqliteOperation.js +10 -15
- package/lib/relations/manyToMany/update/ManyToManyUpdateOperation.js +8 -10
- package/lib/relations/manyToMany/update/ManyToManyUpdateOperationBase.js +61 -78
- package/lib/relations/manyToMany/update/ManyToManyUpdateSqliteOperation.js +8 -12
- package/lib/transaction.js +53 -83
- package/lib/utils/assert.js +15 -21
- package/lib/utils/buildUtils.js +17 -19
- package/lib/utils/classUtils.js +7 -11
- package/lib/utils/cloneDeep.js +365 -0
- package/lib/utils/createModifier.js +36 -41
- package/lib/utils/deprecate.js +8 -12
- package/lib/utils/identifierMapping.js +153 -192
- package/lib/utils/internalPropUtils.js +4 -8
- package/lib/utils/knexUtils.js +61 -56
- package/lib/utils/mixin.js +16 -23
- package/lib/utils/mysqlJsonPath.js +55 -40
- package/lib/utils/normalizeIds.js +110 -127
- package/lib/utils/objectUtils.js +236 -338
- package/lib/utils/parseFieldExpression.js +66 -44
- package/lib/utils/postgresJsonPath.js +48 -62
- package/lib/utils/promiseUtils/after.js +10 -13
- package/lib/utils/promiseUtils/afterReturn.js +10 -13
- package/lib/utils/promiseUtils/index.js +15 -17
- package/lib/utils/promiseUtils/isPromise.js +6 -9
- package/lib/utils/promiseUtils/map.js +75 -89
- package/lib/utils/promiseUtils/mapAfterAllReturn.js +17 -23
- package/lib/utils/promiseUtils/try.js +15 -18
- package/lib/utils/resolveModel.js +91 -94
- package/lib/utils/tmpColumnUtils.js +4 -13
- package/package.json +50 -23
- package/typings/objection/index.d.mts +362 -0
- package/typings/objection/index.d.ts +36 -9
- package/lib/.eslintrc.json +0 -8
- package/lib/queryBuilder/parsers/jsonFieldExpressionParser.pegjs +0 -97
- package/lib/queryBuilder/parsers/relationExpressionParser.pegjs +0 -141
- package/lib/utils/clone.js +0 -2329
|
@@ -1,107 +1,104 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.resolveModel = resolveModel;
|
|
7
|
+
exports.isModelClass = isModelClass;
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const objectUtils_1 = require("../utils/objectUtils");
|
|
10
|
+
class ResolveError extends Error {
|
|
11
|
+
}
|
|
8
12
|
function resolveModel(modelRef, modelPaths, errorPrefix) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return modelRef;
|
|
13
|
+
try {
|
|
14
|
+
if ((0, objectUtils_1.isString)(modelRef)) {
|
|
15
|
+
if (isAbsolutePath(modelRef)) {
|
|
16
|
+
return requireModel(modelRef);
|
|
17
|
+
}
|
|
18
|
+
else if (modelPaths) {
|
|
19
|
+
return requireUsingModelPaths(modelRef, modelPaths);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
if ((0, objectUtils_1.isFunction)(modelRef) && !isModelClass(modelRef)) {
|
|
24
|
+
modelRef = modelRef();
|
|
25
|
+
}
|
|
26
|
+
if (!isModelClass(modelRef)) {
|
|
27
|
+
throw new ResolveError(`is not a subclass of Model or a file path to a module that exports one. You may be dealing with a require loop. See the documentation section about require loops.`);
|
|
28
|
+
}
|
|
29
|
+
return modelRef;
|
|
30
|
+
}
|
|
28
31
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
catch (err) {
|
|
33
|
+
if (err instanceof ResolveError) {
|
|
34
|
+
throw new Error(`${errorPrefix}: ${err.message}`);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
throw err;
|
|
38
|
+
}
|
|
34
39
|
}
|
|
35
|
-
|
|
40
|
+
// A relative path without `modelPaths` doesn't resolve to anything.
|
|
41
|
+
return undefined;
|
|
36
42
|
}
|
|
37
|
-
|
|
38
43
|
function requireUsingModelPaths(modelRef, modelPaths) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
let firstError = null;
|
|
45
|
+
for (const modelPath of modelPaths) {
|
|
46
|
+
try {
|
|
47
|
+
return requireModel(node_path_1.default.join(modelPath, modelRef));
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
if (firstError === null) {
|
|
51
|
+
firstError = err;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (firstError) {
|
|
56
|
+
throw firstError;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
throw new ResolveError(`could not resolve ${modelRef} using modelPaths`);
|
|
48
60
|
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (firstError) {
|
|
52
|
-
throw firstError;
|
|
53
|
-
} else {
|
|
54
|
-
throw new ResolveError(`could not resolve ${modelRef} using modelPaths`);
|
|
55
|
-
}
|
|
56
61
|
}
|
|
57
|
-
|
|
58
62
|
function requireModel(modelPath) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
throw new ResolveError(`${modelPath} is an invalid file path to a model class`);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return modelClass;
|
|
63
|
+
/**
|
|
64
|
+
* Wrap path string in template literal to prevent
|
|
65
|
+
* warnings about Objection.JS being an expression
|
|
66
|
+
* in webpack builds.
|
|
67
|
+
* @link https://github.com/webpack/webpack/issues/196
|
|
68
|
+
*/
|
|
69
|
+
// The module is the user's, so its exports can be anything.
|
|
70
|
+
const mod = require(`${node_path_1.default.resolve(modelPath)}`);
|
|
71
|
+
let modelClass = null;
|
|
72
|
+
if (isModelClass(mod)) {
|
|
73
|
+
modelClass = mod;
|
|
74
|
+
}
|
|
75
|
+
else if (isModelClass(mod.default)) {
|
|
76
|
+
// Babel 6 style of exposing default export.
|
|
77
|
+
modelClass = mod.default;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
Object.keys(mod).forEach((exportName) => {
|
|
81
|
+
const exp = mod[exportName];
|
|
82
|
+
if (isModelClass(exp)) {
|
|
83
|
+
if (modelClass !== null) {
|
|
84
|
+
throw new ResolveError(`path ${modelPath} exports multiple models. Don't know which one to choose.`);
|
|
85
|
+
}
|
|
86
|
+
modelClass = exp;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (!isModelClass(modelClass)) {
|
|
91
|
+
throw new ResolveError(`${modelPath} is an invalid file path to a model class`);
|
|
92
|
+
}
|
|
93
|
+
return modelClass;
|
|
94
94
|
}
|
|
95
|
-
|
|
96
95
|
function isAbsolutePath(pth) {
|
|
97
|
-
|
|
96
|
+
return node_path_1.default.normalize(pth + '/') === node_path_1.default.normalize(node_path_1.default.resolve(pth) + '/');
|
|
98
97
|
}
|
|
99
|
-
|
|
98
|
+
// The `T &` keeps an `any` argument `any`.
|
|
100
99
|
function isModelClass(maybeModel) {
|
|
101
|
-
|
|
100
|
+
// This returns the value of `isObjectionModelClass` as is, like the
|
|
101
|
+
// JavaScript code did. It's `true` on model classes.
|
|
102
|
+
return ((0, objectUtils_1.isFunction)(maybeModel) &&
|
|
103
|
+
maybeModel.isObjectionModelClass);
|
|
102
104
|
}
|
|
103
|
-
|
|
104
|
-
module.exports = {
|
|
105
|
-
resolveModel,
|
|
106
|
-
isModelClass,
|
|
107
|
-
};
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTempColumn = getTempColumn;
|
|
3
4
|
const OWNER_JOIN_COLUMN_ALIAS_PREFIX = 'objectiontmpjoin';
|
|
4
|
-
|
|
5
5
|
function getTempColumn(index) {
|
|
6
|
-
|
|
6
|
+
return `${OWNER_JOIN_COLUMN_ALIAS_PREFIX}${index}`;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
function isTempColumn(col) {
|
|
10
|
-
return col.startsWith(OWNER_JOIN_COLUMN_ALIAS_PREFIX);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
module.exports = {
|
|
14
|
-
getTempColumn,
|
|
15
|
-
isTempColumn,
|
|
16
|
-
};
|
package/package.json
CHANGED
|
@@ -1,21 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abedmurrar/objection",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-beta.1",
|
|
4
4
|
"description": "An SQL-friendly ORM for Node.js. A fork of objection.js with strict TypeScript types and MySQL support.",
|
|
5
5
|
"main": "lib/objection.js",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"types": "./typings/objection/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./typings/objection/index.d.mts",
|
|
12
|
+
"default": "./lib/index.mjs"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./typings/objection/index.d.ts",
|
|
16
|
+
"default": "./lib/objection.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
6
21
|
"license": "MIT",
|
|
7
22
|
"scripts": {
|
|
8
|
-
"
|
|
23
|
+
"build": "tsc -p tsconfig.build.json",
|
|
24
|
+
"prepare": "npm run build",
|
|
25
|
+
"pretest": "npm run build",
|
|
26
|
+
"test": "npm run lint && mocha --slow 10 --timeout 15000 --reporter spec --recursive tests --exclude \"tests/unit/relations/files/**\" && npm run test:typings",
|
|
27
|
+
"pretest:fast": "npm run build",
|
|
9
28
|
"test:fast": "mocha --slow 10 --timeout 15000 --reporter spec --recursive tests --bail --exclude \"tests/unit/relations/files/**\"",
|
|
10
|
-
"test:typings": "node scripts/generate-fn-typings.js --check && tsc && tsc -p tests/ts/tsconfig.loose.json && node scripts/typings-errors.js",
|
|
11
|
-
"test:typings:ts7": "npx -y -p typescript@7 tsc -p tests/ts/tsconfig.ts7.json",
|
|
29
|
+
"test:typings": "npm run build && node scripts/generate-fn-typings.js --check && node scripts/generate-esm-typings.js --check && tsc && tsc -p tests/ts/tsconfig.loose.json && node scripts/typings-errors.js && attw --pack .",
|
|
12
30
|
"bench:typings": "node scripts/typings-bench.js",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
31
|
+
"prebench": "npm run build",
|
|
32
|
+
"bench": "node bench/run.js",
|
|
33
|
+
"prebench:compare": "npm run build",
|
|
34
|
+
"bench:compare": "node bench/compare.js",
|
|
35
|
+
"format": "biome check --write",
|
|
36
|
+
"lint": "biome check",
|
|
37
|
+
"docs:dev": "vitepress dev doc",
|
|
38
|
+
"docs:build": "vitepress build doc",
|
|
39
|
+
"docs:preview": "vitepress preview doc",
|
|
17
40
|
"release": "node scripts/release.js",
|
|
18
|
-
"prepublishOnly": "npm run
|
|
41
|
+
"prepublishOnly": "npm run build && npm run lint && npm run test:typings",
|
|
42
|
+
"sql-check": "npm run build && node bench/sql-check.js"
|
|
19
43
|
},
|
|
20
44
|
"publishConfig": {
|
|
21
45
|
"access": "public",
|
|
@@ -41,7 +65,7 @@
|
|
|
41
65
|
},
|
|
42
66
|
"homepage": "https://github.com/abedmurrar/objection.js#readme",
|
|
43
67
|
"engines": {
|
|
44
|
-
"node": ">=
|
|
68
|
+
"node": ">=24"
|
|
45
69
|
},
|
|
46
70
|
"keywords": [
|
|
47
71
|
"orm",
|
|
@@ -56,33 +80,36 @@
|
|
|
56
80
|
"files": [
|
|
57
81
|
"README.md",
|
|
58
82
|
"LICENSE",
|
|
59
|
-
"lib
|
|
83
|
+
"lib/**/*.js",
|
|
84
|
+
"lib/**/*.mjs",
|
|
60
85
|
"typings/*"
|
|
61
86
|
],
|
|
62
|
-
"types": "./typings/objection/index.d.ts",
|
|
63
87
|
"dependencies": {
|
|
64
88
|
"ajv": "^8.20.0",
|
|
65
89
|
"ajv-formats": "^3.0.1",
|
|
66
90
|
"db-errors": "^0.2.3"
|
|
67
91
|
},
|
|
68
92
|
"peerDependencies": {
|
|
69
|
-
"knex": ">=3.
|
|
93
|
+
"knex": ">=3.3.0"
|
|
70
94
|
},
|
|
71
95
|
"devDependencies": {
|
|
72
|
-
"@
|
|
73
|
-
"
|
|
96
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
97
|
+
"@biomejs/biome": "2.6.4",
|
|
98
|
+
"@types/node": "^24.19.2",
|
|
99
|
+
"chai": "^6.3.0",
|
|
74
100
|
"chai-subset": "^1.6.0",
|
|
75
|
-
"eslint": "^8.54.0",
|
|
76
|
-
"eslint-formatter-codeframe": "^7.32.1",
|
|
77
|
-
"eslint-plugin-prettier": "^5.3.1",
|
|
78
101
|
"expect.js": "^0.3.1",
|
|
79
102
|
"knex": "^3.3.0",
|
|
80
|
-
"
|
|
103
|
+
"mariadb": "^3.5.4",
|
|
104
|
+
"mocha": "^12.0.3",
|
|
81
105
|
"mysql2": "^3.24.6",
|
|
82
106
|
"pg": "^8.15.6",
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
|
|
107
|
+
"sqlite3": "^6.0.1",
|
|
108
|
+
"typescript": "^7.0.2",
|
|
109
|
+
"vitepress": "2.0.0-alpha.21"
|
|
110
|
+
},
|
|
111
|
+
"overrides": {
|
|
112
|
+
"glob": "^14.0.3",
|
|
113
|
+
"minimatch": "^11.0.3"
|
|
87
114
|
}
|
|
88
115
|
}
|