@abedmurrar/objection 4.0.0-beta.0 → 4.0.0-beta.10
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 +1 -1
- package/lib/initialize.js +4 -5
- package/lib/model/AjvValidator.js +24 -21
- package/lib/model/Model.js +116 -114
- package/lib/model/ModifierNotFoundError.js +4 -4
- package/lib/model/NotFoundError.js +4 -4
- package/lib/model/RelationDoesNotExistError.js +4 -4
- package/lib/model/ValidationError.js +8 -8
- package/lib/model/Validator.js +7 -6
- package/lib/model/getModel.js +4 -4
- package/lib/model/graph/ModelGraph.js +9 -7
- package/lib/model/graph/ModelGraphBuilder.js +24 -24
- package/lib/model/graph/ModelGraphEdge.js +4 -4
- package/lib/model/graph/ModelGraphNode.js +17 -11
- package/lib/model/inheritModel.js +3 -4
- package/lib/model/modelBindKnex.js +12 -13
- package/lib/model/modelClone.js +15 -16
- package/lib/model/modelColPropMap.js +7 -8
- package/lib/model/modelConcurrency.js +6 -7
- package/lib/model/modelId.js +4 -5
- package/lib/model/modelJsonAttributes.js +10 -11
- package/lib/model/modelParseRelations.js +5 -6
- package/lib/model/modelQueryProps.js +12 -13
- package/lib/model/modelSet.js +17 -18
- package/lib/model/modelTableMetadata.js +9 -10
- package/lib/model/modelToJson.js +13 -14
- package/lib/model/modelUtils.js +7 -7
- package/lib/model/modelValidate.js +5 -6
- package/lib/model/modelValues.js +10 -10
- package/lib/model/modelVisitor.js +3 -4
- package/lib/objection.js +4 -26
- package/lib/queryBuilder/FunctionBuilder.js +35 -31
- package/lib/queryBuilder/InternalOptions.js +4 -4
- package/lib/queryBuilder/JoinBuilder.js +46 -45
- package/lib/queryBuilder/QueryBuilder.js +161 -135
- package/lib/queryBuilder/QueryBuilderBase.js +203 -203
- package/lib/queryBuilder/QueryBuilderContext.js +6 -6
- package/lib/queryBuilder/QueryBuilderContextBase.js +12 -8
- package/lib/queryBuilder/QueryBuilderOperationSupport.js +30 -25
- package/lib/queryBuilder/QueryBuilderUserContext.js +4 -4
- package/lib/queryBuilder/RawBuilder.js +15 -13
- package/lib/queryBuilder/ReferenceBuilder.js +25 -23
- package/lib/queryBuilder/RelationExpression.js +29 -20
- package/lib/queryBuilder/StaticHookArguments.js +11 -11
- package/lib/queryBuilder/ValueBuilder.js +20 -19
- package/lib/queryBuilder/expressions.js +8 -18
- package/lib/queryBuilder/functions/mysql.js +18 -42
- package/lib/queryBuilder/graph/GraphAction.js +7 -7
- package/lib/queryBuilder/graph/GraphData.js +4 -4
- package/lib/queryBuilder/graph/GraphFetcher.js +18 -17
- package/lib/queryBuilder/graph/GraphNodeDbExistence.js +45 -12
- package/lib/queryBuilder/graph/GraphOperation.js +4 -4
- package/lib/queryBuilder/graph/GraphOptions.js +5 -5
- package/lib/queryBuilder/graph/GraphUpsert.js +36 -36
- package/lib/queryBuilder/graph/delete/GraphDelete.js +8 -8
- package/lib/queryBuilder/graph/delete/GraphDeleteAction.js +46 -11
- package/lib/queryBuilder/graph/insert/GraphInsert.js +12 -12
- package/lib/queryBuilder/graph/insert/GraphInsertAction.js +59 -21
- package/lib/queryBuilder/graph/insert/JoinRowGraphInsertAction.js +49 -11
- package/lib/queryBuilder/graph/patch/GraphPatch.js +8 -8
- package/lib/queryBuilder/graph/patch/GraphPatchAction.js +52 -19
- package/lib/queryBuilder/graph/recursiveUpsert/GraphRecursiveUpsert.js +8 -8
- package/lib/queryBuilder/graph/recursiveUpsert/GraphRecursiveUpsertAction.js +54 -18
- package/lib/queryBuilder/join/JoinResultColumn.js +6 -4
- package/lib/queryBuilder/join/JoinResultParser.js +10 -8
- package/lib/queryBuilder/join/RelationJoiner.js +40 -35
- package/lib/queryBuilder/join/TableNode.js +7 -5
- package/lib/queryBuilder/join/TableTree.js +13 -9
- package/lib/queryBuilder/join/utils.js +8 -8
- package/lib/queryBuilder/operations/DelegateOperation.js +6 -6
- package/lib/queryBuilder/operations/DeleteOperation.js +11 -11
- package/lib/queryBuilder/operations/FindByIdOperation.js +8 -8
- package/lib/queryBuilder/operations/FindByIdsOperation.js +6 -6
- package/lib/queryBuilder/operations/FindOperation.js +23 -23
- package/lib/queryBuilder/operations/FirstOperation.js +6 -6
- package/lib/queryBuilder/operations/FromOperation.js +13 -13
- package/lib/queryBuilder/operations/InsertAndFetchOperation.js +12 -12
- package/lib/queryBuilder/operations/InsertGraphAndFetchOperation.js +10 -10
- package/lib/queryBuilder/operations/InsertGraphOperation.js +11 -11
- package/lib/queryBuilder/operations/InsertOperation.js +23 -22
- package/lib/queryBuilder/operations/InstanceDeleteOperation.js +12 -12
- package/lib/queryBuilder/operations/InstanceFindOperation.js +10 -10
- package/lib/queryBuilder/operations/InstanceInsertOperation.js +6 -6
- package/lib/queryBuilder/operations/InstanceUpdateOperation.js +14 -14
- package/lib/queryBuilder/operations/JoinRelatedOperation.js +13 -13
- package/lib/queryBuilder/operations/KnexOperation.js +6 -6
- package/lib/queryBuilder/operations/MergeOperation.js +11 -11
- package/lib/queryBuilder/operations/ObjectionToKnexConvertingOperation.js +26 -22
- package/lib/queryBuilder/operations/OnBuildKnexOperation.js +6 -6
- package/lib/queryBuilder/operations/OnBuildOperation.js +6 -6
- package/lib/queryBuilder/operations/OnErrorOperation.js +6 -6
- package/lib/queryBuilder/operations/QueryBuilderOperation.js +6 -4
- package/lib/queryBuilder/operations/RangeOperation.js +7 -6
- package/lib/queryBuilder/operations/RelateOperation.js +6 -6
- package/lib/queryBuilder/operations/ReturningOperation.js +8 -8
- package/lib/queryBuilder/operations/RunAfterOperation.js +6 -6
- package/lib/queryBuilder/operations/RunBeforeOperation.js +6 -6
- package/lib/queryBuilder/operations/UnrelateOperation.js +6 -6
- package/lib/queryBuilder/operations/UpdateAndFetchOperation.js +12 -12
- package/lib/queryBuilder/operations/UpdateOperation.js +24 -24
- package/lib/queryBuilder/operations/UpsertGraphAndFetchOperation.js +10 -10
- package/lib/queryBuilder/operations/UpsertGraphOperation.js +10 -10
- package/lib/queryBuilder/operations/WhereCompositeOperation.js +8 -8
- package/lib/queryBuilder/operations/WhereInOperation.js +11 -9
- package/lib/queryBuilder/operations/eager/EagerOperation.js +11 -9
- package/lib/queryBuilder/operations/eager/JoinEagerOperation.js +10 -12
- package/lib/queryBuilder/operations/eager/NaiveEagerOperation.js +6 -6
- package/lib/queryBuilder/operations/eager/WhereInEagerOperation.js +64 -28
- package/lib/queryBuilder/operations/jsonApi/WhereJsonHasOperation.js +45 -12
- package/lib/queryBuilder/operations/jsonApi/WhereJsonNotObjectOperation.js +45 -12
- package/lib/queryBuilder/operations/jsonApi/WhereJsonOperation.js +45 -12
- package/lib/queryBuilder/operations/jsonApi/WhereJsonOverlapsOperation.js +46 -13
- package/lib/queryBuilder/operations/jsonApi/mysqlJsonApi.js +22 -27
- package/lib/queryBuilder/operations/jsonApi/postgresJsonApi.js +51 -17
- package/lib/queryBuilder/operations/select/SelectOperation.js +12 -12
- package/lib/queryBuilder/operations/select/Selection.js +23 -19
- package/lib/queryBuilder/operations/types.js +8 -0
- package/lib/queryBuilder/operations/whereInComposite/WhereInCompositeMsSqlOperation.js +13 -12
- package/lib/queryBuilder/operations/whereInComposite/WhereInCompositeOperation.js +11 -11
- package/lib/queryBuilder/operations/whereInComposite/WhereInCompositeSqliteOperation.js +10 -10
- package/lib/queryBuilder/transformations/CompositeQueryTransformation.js +6 -6
- package/lib/queryBuilder/transformations/QueryTransformation.js +4 -4
- package/lib/queryBuilder/transformations/WrapMysqlModifySubqueryTransformation.js +11 -8
- package/lib/queryBuilder/transformations/index.js +8 -8
- package/lib/queryBuilder/whereScopes.js +15 -21
- package/lib/relations/Relation.js +31 -29
- package/lib/relations/RelationDeleteOperation.js +8 -8
- package/lib/relations/RelationFindOperation.js +8 -6
- package/lib/relations/RelationInsertOperation.js +6 -6
- package/lib/relations/RelationOwner.js +16 -13
- package/lib/relations/RelationProperty.js +18 -15
- package/lib/relations/RelationUpdateOperation.js +8 -8
- package/lib/relations/belongsToOne/BelongsToOneDeleteOperation.js +6 -6
- package/lib/relations/belongsToOne/BelongsToOneInsertOperation.js +8 -8
- package/lib/relations/belongsToOne/BelongsToOneRelateOperation.js +8 -8
- package/lib/relations/belongsToOne/BelongsToOneRelation.js +14 -14
- package/lib/relations/belongsToOne/BelongsToOneUnrelateOperation.js +6 -6
- package/lib/relations/hasMany/HasManyInsertOperation.js +6 -6
- package/lib/relations/hasMany/HasManyRelateOperation.js +11 -11
- package/lib/relations/hasMany/HasManyRelation.js +12 -12
- package/lib/relations/hasMany/HasManyUnrelateOperation.js +9 -9
- package/lib/relations/hasOne/HasOneRelation.js +6 -6
- package/lib/relations/hasOneThrough/HasOneThroughRelation.js +6 -6
- package/lib/relations/manyToMany/ManyToManyModifyMixin.js +9 -8
- package/lib/relations/manyToMany/ManyToManyRelation.js +52 -49
- package/lib/relations/manyToMany/ManyToManySqliteModifyMixin.js +6 -6
- package/lib/relations/manyToMany/delete/ManyToManyDeleteOperation.js +7 -7
- package/lib/relations/manyToMany/delete/ManyToManyDeleteOperationBase.js +6 -6
- package/lib/relations/manyToMany/delete/ManyToManyDeleteSqliteOperation.js +7 -7
- package/lib/relations/manyToMany/find/ManyToManyFindOperation.js +8 -8
- package/lib/relations/manyToMany/insert/ManyToManyInsertOperation.js +8 -8
- package/lib/relations/manyToMany/relate/ManyToManyRelateOperation.js +11 -10
- package/lib/relations/manyToMany/unrelate/ManyToManyUnrelateOperation.js +7 -7
- package/lib/relations/manyToMany/unrelate/ManyToManyUnrelateOperationBase.js +8 -8
- package/lib/relations/manyToMany/unrelate/ManyToManyUnrelateSqliteOperation.js +7 -7
- package/lib/relations/manyToMany/update/ManyToManyUpdateOperation.js +7 -7
- package/lib/relations/manyToMany/update/ManyToManyUpdateOperationBase.js +8 -8
- package/lib/relations/manyToMany/update/ManyToManyUpdateSqliteOperation.js +7 -7
- package/lib/transaction.js +44 -12
- package/lib/utils/objectUtils.js +6 -1
- package/lib/utils/parseFieldExpression.js +4 -35
- package/lib/utils/promiseUtils/index.js +19 -9
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KnexOperation = void 0;
|
|
4
|
+
const ObjectionToKnexConvertingOperation_1 = require("./ObjectionToKnexConvertingOperation");
|
|
3
5
|
// An operation that simply calls the equivalent knex method.
|
|
4
|
-
class KnexOperation extends ObjectionToKnexConvertingOperation {
|
|
6
|
+
class KnexOperation extends ObjectionToKnexConvertingOperation_1.ObjectionToKnexConvertingOperation {
|
|
5
7
|
onBuildKnex(knexBuilder, builder) {
|
|
6
8
|
return knexBuilder[this.name].apply(knexBuilder, this.getKnexArgs(builder));
|
|
7
9
|
}
|
|
8
10
|
}
|
|
9
|
-
|
|
10
|
-
KnexOperation,
|
|
11
|
-
};
|
|
11
|
+
exports.KnexOperation = KnexOperation;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MergeOperation = void 0;
|
|
4
|
+
const objectUtils_1 = require("../../utils/objectUtils");
|
|
5
|
+
const QueryBuilderOperation_1 = require("./QueryBuilderOperation");
|
|
6
|
+
const UpdateOperation_1 = require("./UpdateOperation");
|
|
7
|
+
class MergeOperation extends QueryBuilderOperation_1.QueryBuilderOperation {
|
|
6
8
|
constructor(name, opt) {
|
|
7
9
|
super(name, opt);
|
|
8
10
|
this.model = null;
|
|
@@ -10,7 +12,7 @@ class MergeOperation extends QueryBuilderOperation {
|
|
|
10
12
|
}
|
|
11
13
|
onAdd(builder, args) {
|
|
12
14
|
this.args = args;
|
|
13
|
-
if (!isEmpty(args) && isObject(args[0]) && !Array.isArray(args[0])) {
|
|
15
|
+
if (!(0, objectUtils_1.isEmpty)(args) && (0, objectUtils_1.isObject)(args[0]) && !Array.isArray(args[0])) {
|
|
14
16
|
const json = args[0];
|
|
15
17
|
const modelClass = builder.modelClass();
|
|
16
18
|
this.model = modelClass.ensureModel(json, { patch: true });
|
|
@@ -18,12 +20,12 @@ class MergeOperation extends QueryBuilderOperation {
|
|
|
18
20
|
return true;
|
|
19
21
|
}
|
|
20
22
|
onBuildKnex(knexBuilder, builder) {
|
|
21
|
-
if (!isFunction(knexBuilder.merge)) {
|
|
23
|
+
if (!(0, objectUtils_1.isFunction)(knexBuilder.merge)) {
|
|
22
24
|
throw new Error('merge method can only be chained right after onConflict method');
|
|
23
25
|
}
|
|
24
26
|
if (this.model) {
|
|
25
27
|
const json = this.model.$toDatabaseJson(builder);
|
|
26
|
-
const convertedJson = convertFieldExpressionsToRaw(builder, this.model, json);
|
|
28
|
+
const convertedJson = (0, UpdateOperation_1.convertFieldExpressionsToRaw)(builder, this.model, json);
|
|
27
29
|
return knexBuilder.merge(convertedJson);
|
|
28
30
|
}
|
|
29
31
|
return knexBuilder.merge(...this.args);
|
|
@@ -38,6 +40,4 @@ class MergeOperation extends QueryBuilderOperation {
|
|
|
38
40
|
return clone;
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
MergeOperation,
|
|
43
|
-
};
|
|
43
|
+
exports.MergeOperation = MergeOperation;
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObjectionToKnexConvertingOperation = void 0;
|
|
4
|
+
const QueryBuilderOperation_1 = require("./QueryBuilderOperation");
|
|
5
|
+
const objectUtils_1 = require("../../utils/objectUtils");
|
|
6
|
+
const knexUtils_1 = require("../../utils/knexUtils");
|
|
7
|
+
const transformations_1 = require("../transformations");
|
|
8
|
+
const resolveModel_1 = require("../../utils/resolveModel");
|
|
9
|
+
// `JoinBuilder` requires this file, so it's required lazily.
|
|
10
|
+
const getJoinBuilder = (0, objectUtils_1.once)(() => require('../JoinBuilder').JoinBuilder);
|
|
8
11
|
// An abstract operation base class that converts all arguments from objection types
|
|
9
12
|
// to knex types. For example objection query builders are converted into knex query
|
|
10
13
|
// builders and objection RawBuilder instances are converted into knex Raw instances.
|
|
11
|
-
class ObjectionToKnexConvertingOperation extends QueryBuilderOperation {
|
|
14
|
+
class ObjectionToKnexConvertingOperation extends QueryBuilderOperation_1.QueryBuilderOperation {
|
|
12
15
|
constructor(name, opt) {
|
|
13
16
|
super(name, opt);
|
|
14
17
|
this.args = null;
|
|
15
18
|
}
|
|
19
|
+
// The arguments converted for knex. `any`: they are arbitrary user values
|
|
20
|
+
// that the subclasses pass on to knex.
|
|
16
21
|
getKnexArgs(builder) {
|
|
17
22
|
return convertArgs(this.name, builder, this.args);
|
|
18
23
|
}
|
|
@@ -26,6 +31,7 @@ class ObjectionToKnexConvertingOperation extends QueryBuilderOperation {
|
|
|
26
31
|
return clone;
|
|
27
32
|
}
|
|
28
33
|
}
|
|
34
|
+
exports.ObjectionToKnexConvertingOperation = ObjectionToKnexConvertingOperation;
|
|
29
35
|
function shouldBeAdded(opName, builder, args) {
|
|
30
36
|
const skipUndefined = builder.internalOptions().skipUndefined;
|
|
31
37
|
for (let i = 0, l = args.length; i < l; ++i) {
|
|
@@ -53,18 +59,18 @@ function convertArgs(opName, builder, args) {
|
|
|
53
59
|
else if (isArray(arg)) {
|
|
54
60
|
return convertArray(arg, builder, i, opName, skipUndefined);
|
|
55
61
|
}
|
|
56
|
-
else if (isModelClass(arg)) {
|
|
62
|
+
else if ((0, resolveModel_1.isModelClass)(arg)) {
|
|
57
63
|
// Model classes can be used in place of their table names, for example
|
|
58
64
|
// `join(Pet, ...)`. They are functions, so this check must come first.
|
|
59
65
|
return arg.getTableName();
|
|
60
66
|
}
|
|
61
|
-
else if (isFunction(arg)) {
|
|
67
|
+
else if ((0, objectUtils_1.isFunction)(arg)) {
|
|
62
68
|
return convertFunction(arg, builder);
|
|
63
69
|
}
|
|
64
70
|
else if (isModel(arg)) {
|
|
65
71
|
return convertModel(arg);
|
|
66
72
|
}
|
|
67
|
-
else if (isPlainObject(arg)) {
|
|
73
|
+
else if ((0, objectUtils_1.isPlainObject)(arg)) {
|
|
68
74
|
return convertPlainObject(arg, builder, i, opName, skipUndefined);
|
|
69
75
|
}
|
|
70
76
|
else {
|
|
@@ -76,16 +82,17 @@ function isUndefined(item) {
|
|
|
76
82
|
return item === undefined;
|
|
77
83
|
}
|
|
78
84
|
function hasToKnexRawMethod(item) {
|
|
79
|
-
return isObject(item) && isFunction(item.toKnexRaw);
|
|
85
|
+
return (0, objectUtils_1.isObject)(item) && (0, objectUtils_1.isFunction)(item.toKnexRaw);
|
|
80
86
|
}
|
|
81
87
|
function convertToKnexRaw(item, builder) {
|
|
82
88
|
return item.toKnexRaw(builder);
|
|
83
89
|
}
|
|
84
90
|
function isObjectionQueryBuilderBase(item) {
|
|
85
|
-
return isObject(item) &&
|
|
91
|
+
return ((0, objectUtils_1.isObject)(item) &&
|
|
92
|
+
item.isObjectionQueryBuilderBase === true);
|
|
86
93
|
}
|
|
87
94
|
function convertQueryBuilderBase(item, builder) {
|
|
88
|
-
item = transformation.onConvertQueryBuilderBase(item, builder);
|
|
95
|
+
item = transformations_1.transformation.onConvertQueryBuilderBase(item, builder);
|
|
89
96
|
return item.subqueryOf(builder).toKnexQuery();
|
|
90
97
|
}
|
|
91
98
|
function isArray(item) {
|
|
@@ -104,7 +111,7 @@ function convertArray(arr, builder, i, opName, skipUndefined) {
|
|
|
104
111
|
else if (isObjectionQueryBuilderBase(item)) {
|
|
105
112
|
return convertQueryBuilderBase(item, builder);
|
|
106
113
|
}
|
|
107
|
-
else if (isModelClass(item)) {
|
|
114
|
+
else if ((0, resolveModel_1.isModelClass)(item)) {
|
|
108
115
|
return item.getTableName();
|
|
109
116
|
}
|
|
110
117
|
else {
|
|
@@ -114,10 +121,10 @@ function convertArray(arr, builder, i, opName, skipUndefined) {
|
|
|
114
121
|
}
|
|
115
122
|
function convertFunction(func, builder) {
|
|
116
123
|
return function convertedKnexArgumentFunction(...args) {
|
|
117
|
-
if (isKnexQueryBuilder(this)) {
|
|
124
|
+
if ((0, knexUtils_1.isKnexQueryBuilder)(this)) {
|
|
118
125
|
convertQueryBuilderFunction(this, func, builder);
|
|
119
126
|
}
|
|
120
|
-
else if (isKnexJoinBuilder(this)) {
|
|
127
|
+
else if ((0, knexUtils_1.isKnexJoinBuilder)(this)) {
|
|
121
128
|
convertJoinBuilderFunction(this, func, builder);
|
|
122
129
|
}
|
|
123
130
|
else {
|
|
@@ -139,7 +146,7 @@ function convertJoinBuilderFunction(knexJoinBuilder, func, builder) {
|
|
|
139
146
|
joinClauseBuilder.toKnexQuery(knexJoinBuilder);
|
|
140
147
|
}
|
|
141
148
|
function isModel(item) {
|
|
142
|
-
return isObject(item) && item.$isObjectionModel;
|
|
149
|
+
return (0, objectUtils_1.isObject)(item) && item.$isObjectionModel;
|
|
143
150
|
}
|
|
144
151
|
function convertModel(model) {
|
|
145
152
|
return model.$toDatabaseJson();
|
|
@@ -158,7 +165,7 @@ function convertPlainObject(obj, builder, i, opName, skipUndefined) {
|
|
|
158
165
|
else if (isObjectionQueryBuilderBase(item)) {
|
|
159
166
|
out[key] = convertQueryBuilderBase(item, builder);
|
|
160
167
|
}
|
|
161
|
-
else if (isModelClass(item)) {
|
|
168
|
+
else if ((0, resolveModel_1.isModelClass)(item)) {
|
|
162
169
|
// `{ alias: ModelClass }`.
|
|
163
170
|
out[key] = item.getTableName();
|
|
164
171
|
}
|
|
@@ -168,6 +175,3 @@ function convertPlainObject(obj, builder, i, opName, skipUndefined) {
|
|
|
168
175
|
return out;
|
|
169
176
|
}, {});
|
|
170
177
|
}
|
|
171
|
-
module.exports = {
|
|
172
|
-
ObjectionToKnexConvertingOperation,
|
|
173
|
-
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OnBuildKnexOperation = void 0;
|
|
4
|
+
const QueryBuilderOperation_1 = require("./QueryBuilderOperation");
|
|
5
|
+
class OnBuildKnexOperation extends QueryBuilderOperation_1.QueryBuilderOperation {
|
|
4
6
|
constructor(name, opt) {
|
|
5
7
|
super(name, opt);
|
|
6
8
|
this.func = null;
|
|
@@ -18,6 +20,4 @@ class OnBuildKnexOperation extends QueryBuilderOperation {
|
|
|
18
20
|
return clone;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
OnBuildKnexOperation,
|
|
23
|
-
};
|
|
23
|
+
exports.OnBuildKnexOperation = OnBuildKnexOperation;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OnBuildOperation = void 0;
|
|
4
|
+
const QueryBuilderOperation_1 = require("./QueryBuilderOperation");
|
|
5
|
+
class OnBuildOperation extends QueryBuilderOperation_1.QueryBuilderOperation {
|
|
4
6
|
constructor(name, opt) {
|
|
5
7
|
super(name, opt);
|
|
6
8
|
this.func = null;
|
|
@@ -18,6 +20,4 @@ class OnBuildOperation extends QueryBuilderOperation {
|
|
|
18
20
|
return clone;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
OnBuildOperation,
|
|
23
|
-
};
|
|
23
|
+
exports.OnBuildOperation = OnBuildOperation;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OnErrorOperation = void 0;
|
|
4
|
+
const QueryBuilderOperation_1 = require("./QueryBuilderOperation");
|
|
5
|
+
class OnErrorOperation extends QueryBuilderOperation_1.QueryBuilderOperation {
|
|
4
6
|
constructor(name, opt) {
|
|
5
7
|
super(name, opt);
|
|
6
8
|
this.func = null;
|
|
@@ -18,6 +20,4 @@ class OnErrorOperation extends QueryBuilderOperation {
|
|
|
18
20
|
return clone;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
OnErrorOperation,
|
|
23
|
-
};
|
|
23
|
+
exports.OnErrorOperation = OnErrorOperation;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryBuilderOperation = void 0;
|
|
2
4
|
const hookNameToHasMethodName = {
|
|
3
5
|
onAdd: 'hasOnAdd',
|
|
4
6
|
onBefore1: 'hasOnBefore1',
|
|
@@ -55,6 +57,8 @@ class QueryBuilderOperation {
|
|
|
55
57
|
hasOnAdd() {
|
|
56
58
|
return true;
|
|
57
59
|
}
|
|
60
|
+
// The hooks below that do nothing return `void`. That allows the overrides to
|
|
61
|
+
// return anything.
|
|
58
62
|
// This is called as the first thing when the query is executed but before
|
|
59
63
|
// the actual database operation (knex query) is executed.
|
|
60
64
|
//
|
|
@@ -246,6 +250,7 @@ class QueryBuilderOperation {
|
|
|
246
250
|
return true;
|
|
247
251
|
}
|
|
248
252
|
}
|
|
253
|
+
exports.QueryBuilderOperation = QueryBuilderOperation;
|
|
249
254
|
Object.defineProperties(QueryBuilderOperation, {
|
|
250
255
|
isObjectionQueryBuilderOperationClass: {
|
|
251
256
|
enumerable: false,
|
|
@@ -253,6 +258,3 @@ Object.defineProperties(QueryBuilderOperation, {
|
|
|
253
258
|
value: true,
|
|
254
259
|
},
|
|
255
260
|
});
|
|
256
|
-
module.exports = {
|
|
257
|
-
QueryBuilderOperation,
|
|
258
|
-
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RangeOperation = void 0;
|
|
4
|
+
const QueryBuilderOperation_1 = require("./QueryBuilderOperation");
|
|
5
|
+
class RangeOperation extends QueryBuilderOperation_1.QueryBuilderOperation {
|
|
4
6
|
constructor(name, opt) {
|
|
5
7
|
super(name, opt);
|
|
6
8
|
this.resultSizeBuilder = null;
|
|
@@ -23,6 +25,7 @@ class RangeOperation extends QueryBuilderOperation {
|
|
|
23
25
|
const resultSize = await this.resultSizeBuilder.resultSize();
|
|
24
26
|
return {
|
|
25
27
|
results,
|
|
28
|
+
// `parseInt` converts the number to a string first, as it always has.
|
|
26
29
|
total: parseInt(resultSize, 10),
|
|
27
30
|
};
|
|
28
31
|
}
|
|
@@ -32,6 +35,4 @@ class RangeOperation extends QueryBuilderOperation {
|
|
|
32
35
|
return clone;
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
|
-
|
|
36
|
-
RangeOperation,
|
|
37
|
-
};
|
|
38
|
+
exports.RangeOperation = RangeOperation;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelateOperation = void 0;
|
|
4
|
+
const QueryBuilderOperation_1 = require("./QueryBuilderOperation");
|
|
5
|
+
class RelateOperation extends QueryBuilderOperation_1.QueryBuilderOperation {
|
|
4
6
|
constructor(name, opt) {
|
|
5
7
|
super(name, opt);
|
|
6
8
|
this.relation = opt.relation;
|
|
@@ -15,6 +17,4 @@ class RelateOperation extends QueryBuilderOperation {
|
|
|
15
17
|
return clone;
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
|
-
|
|
19
|
-
RelateOperation,
|
|
20
|
-
};
|
|
20
|
+
exports.RelateOperation = RelateOperation;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReturningOperation = void 0;
|
|
4
|
+
const objectUtils_1 = require("../../utils/objectUtils");
|
|
5
|
+
const ObjectionToKnexConvertingOperation_1 = require("./ObjectionToKnexConvertingOperation");
|
|
4
6
|
// This class's only purpose is to normalize the arguments into an array.
|
|
5
7
|
//
|
|
6
8
|
// In knex, if a single column is given to `returning` it returns an array with the that column's value
|
|
7
9
|
// in it. If an array is given with a one item inside, the return value is an object.
|
|
8
|
-
class ReturningOperation extends ObjectionToKnexConvertingOperation {
|
|
10
|
+
class ReturningOperation extends ObjectionToKnexConvertingOperation_1.ObjectionToKnexConvertingOperation {
|
|
9
11
|
onAdd(builder, args) {
|
|
10
|
-
args = flatten(args);
|
|
12
|
+
args = (0, objectUtils_1.flatten)(args);
|
|
11
13
|
// Don't add an empty returning list.
|
|
12
14
|
if (args.length === 0) {
|
|
13
15
|
return false;
|
|
@@ -19,6 +21,4 @@ class ReturningOperation extends ObjectionToKnexConvertingOperation {
|
|
|
19
21
|
return knexBuilder.returning(this.getKnexArgs(builder));
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
ReturningOperation,
|
|
24
|
-
};
|
|
24
|
+
exports.ReturningOperation = ReturningOperation;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RunAfterOperation = void 0;
|
|
4
|
+
const QueryBuilderOperation_1 = require("./QueryBuilderOperation");
|
|
5
|
+
class RunAfterOperation extends QueryBuilderOperation_1.QueryBuilderOperation {
|
|
4
6
|
constructor(name, opt) {
|
|
5
7
|
super(name, opt);
|
|
6
8
|
this.func = null;
|
|
@@ -18,6 +20,4 @@ class RunAfterOperation extends QueryBuilderOperation {
|
|
|
18
20
|
return clone;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
RunAfterOperation,
|
|
23
|
-
};
|
|
23
|
+
exports.RunAfterOperation = RunAfterOperation;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RunBeforeOperation = void 0;
|
|
4
|
+
const QueryBuilderOperation_1 = require("./QueryBuilderOperation");
|
|
5
|
+
class RunBeforeOperation extends QueryBuilderOperation_1.QueryBuilderOperation {
|
|
4
6
|
constructor(name, opt) {
|
|
5
7
|
super(name, opt);
|
|
6
8
|
this.func = null;
|
|
@@ -18,6 +20,4 @@ class RunBeforeOperation extends QueryBuilderOperation {
|
|
|
18
20
|
return clone;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
RunBeforeOperation,
|
|
23
|
-
};
|
|
23
|
+
exports.RunBeforeOperation = RunBeforeOperation;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnrelateOperation = void 0;
|
|
4
|
+
const QueryBuilderOperation_1 = require("./QueryBuilderOperation");
|
|
5
|
+
class UnrelateOperation extends QueryBuilderOperation_1.QueryBuilderOperation {
|
|
4
6
|
constructor(name, opt) {
|
|
5
7
|
super(name, opt);
|
|
6
8
|
this.relation = opt.relation;
|
|
@@ -13,6 +15,4 @@ class UnrelateOperation extends QueryBuilderOperation {
|
|
|
13
15
|
return clone;
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
UnrelateOperation,
|
|
18
|
-
};
|
|
18
|
+
exports.UnrelateOperation = UnrelateOperation;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateAndFetchOperation = void 0;
|
|
4
|
+
const whereScopes_1 = require("../whereScopes");
|
|
5
|
+
const DelegateOperation_1 = require("./DelegateOperation");
|
|
6
|
+
const FindByIdOperation_1 = require("./FindByIdOperation");
|
|
7
|
+
const UpdateOperation_1 = require("./UpdateOperation");
|
|
8
|
+
class UpdateAndFetchOperation extends DelegateOperation_1.DelegateOperation {
|
|
7
9
|
constructor(name, opt) {
|
|
8
10
|
super(name, opt);
|
|
9
|
-
if (!this.delegate.is(UpdateOperation)) {
|
|
11
|
+
if (!this.delegate.is(UpdateOperation_1.UpdateOperation)) {
|
|
10
12
|
throw new Error('Invalid delegate');
|
|
11
13
|
}
|
|
12
14
|
this.id = null;
|
|
@@ -21,7 +23,7 @@ class UpdateAndFetchOperation extends DelegateOperation {
|
|
|
21
23
|
}
|
|
22
24
|
onBuild(builder) {
|
|
23
25
|
if (!this.skipIdWhere) {
|
|
24
|
-
withWhereScope(builder, () => builder.findById(this.id));
|
|
26
|
+
(0, whereScopes_1.withWhereScope)(builder, () => builder.findById(this.id));
|
|
25
27
|
}
|
|
26
28
|
super.onBuild(builder);
|
|
27
29
|
}
|
|
@@ -47,7 +49,7 @@ class UpdateAndFetchOperation extends DelegateOperation {
|
|
|
47
49
|
return fetched ? this.model : undefined;
|
|
48
50
|
}
|
|
49
51
|
toFindOperation() {
|
|
50
|
-
return new FindByIdOperation('findById', {
|
|
52
|
+
return new FindByIdOperation_1.FindByIdOperation('findById', {
|
|
51
53
|
id: this.id,
|
|
52
54
|
});
|
|
53
55
|
}
|
|
@@ -58,6 +60,4 @@ class UpdateAndFetchOperation extends DelegateOperation {
|
|
|
58
60
|
return clone;
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
|
-
|
|
62
|
-
UpdateAndFetchOperation,
|
|
63
|
-
};
|
|
63
|
+
exports.UpdateAndFetchOperation = UpdateAndFetchOperation;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateOperation = void 0;
|
|
4
|
+
exports.convertFieldExpressionsToRaw = convertFieldExpressionsToRaw;
|
|
5
|
+
const ReferenceBuilder_1 = require("../../queryBuilder/ReferenceBuilder");
|
|
6
|
+
const objectUtils_1 = require("../../utils/objectUtils");
|
|
7
|
+
const knexUtils_1 = require("../../utils/knexUtils");
|
|
8
|
+
const postgresJsonPath_1 = require("../../utils/postgresJsonPath");
|
|
9
|
+
const mysqlJsonPath_1 = require("../../utils/mysqlJsonPath");
|
|
10
|
+
const QueryBuilderOperation_1 = require("./QueryBuilderOperation");
|
|
11
|
+
const StaticHookArguments_1 = require("../StaticHookArguments");
|
|
12
|
+
class UpdateOperation extends QueryBuilderOperation_1.QueryBuilderOperation {
|
|
10
13
|
constructor(name, opt) {
|
|
11
14
|
super(name, opt);
|
|
12
15
|
this.model = null;
|
|
@@ -24,7 +27,7 @@ class UpdateOperation extends QueryBuilderOperation {
|
|
|
24
27
|
}
|
|
25
28
|
onBefore3(builder) {
|
|
26
29
|
const row = this.model.$toDatabaseJson(builder);
|
|
27
|
-
if (isEmpty(row)) {
|
|
30
|
+
if ((0, objectUtils_1.isEmpty)(row)) {
|
|
28
31
|
// Resolve the query if there is nothing to update.
|
|
29
32
|
builder.resolve(0);
|
|
30
33
|
}
|
|
@@ -46,6 +49,7 @@ class UpdateOperation extends QueryBuilderOperation {
|
|
|
46
49
|
return clone;
|
|
47
50
|
}
|
|
48
51
|
}
|
|
52
|
+
exports.UpdateOperation = UpdateOperation;
|
|
49
53
|
async function callBeforeUpdate(builder, model, modelOptions) {
|
|
50
54
|
await callInstanceBeforeUpdate(builder, model, modelOptions);
|
|
51
55
|
return callStaticBeforeUpdate(builder);
|
|
@@ -54,10 +58,10 @@ function callInstanceBeforeUpdate(builder, model, modelOptions) {
|
|
|
54
58
|
return model.$beforeUpdate(modelOptions, builder.context());
|
|
55
59
|
}
|
|
56
60
|
function callStaticBeforeUpdate(builder) {
|
|
57
|
-
if (!hasStaticHook(builder.modelClass(), 'beforeUpdate')) {
|
|
61
|
+
if (!(0, StaticHookArguments_1.hasStaticHook)(builder.modelClass(), 'beforeUpdate')) {
|
|
58
62
|
return undefined;
|
|
59
63
|
}
|
|
60
|
-
const args = StaticHookArguments.create({ builder });
|
|
64
|
+
const args = StaticHookArguments_1.StaticHookArguments.create({ builder });
|
|
61
65
|
return builder.modelClass().beforeUpdate(args);
|
|
62
66
|
}
|
|
63
67
|
async function callAfterUpdate(builder, model, modelOptions, result) {
|
|
@@ -68,10 +72,10 @@ function callInstanceAfterUpdate(builder, model, modelOptions) {
|
|
|
68
72
|
return model.$afterUpdate(modelOptions, builder.context());
|
|
69
73
|
}
|
|
70
74
|
async function callStaticAfterUpdate(builder, result) {
|
|
71
|
-
if (!hasStaticHook(builder.modelClass(), 'afterUpdate')) {
|
|
75
|
+
if (!(0, StaticHookArguments_1.hasStaticHook)(builder.modelClass(), 'afterUpdate')) {
|
|
72
76
|
return result;
|
|
73
77
|
}
|
|
74
|
-
const args = StaticHookArguments.create({ builder, result });
|
|
78
|
+
const args = StaticHookArguments_1.StaticHookArguments.create({ builder, result });
|
|
75
79
|
const maybeResult = await builder.modelClass().afterUpdate(args);
|
|
76
80
|
if (maybeResult === undefined) {
|
|
77
81
|
return result;
|
|
@@ -91,22 +95,22 @@ function convertFieldExpressionsToRaw(builder, model, json) {
|
|
|
91
95
|
// on postgres and to
|
|
92
96
|
// `col` : raw("JSON_SET(COALESCE(`col`, JSON_OBJECT()), '$.\"attr\"', JSON_EXTRACT(`other`, '$.\"lol\"'))")
|
|
93
97
|
// on mysql. A NULL column is treated as an empty object (or array).
|
|
94
|
-
const parsed = ref(key);
|
|
98
|
+
const parsed = (0, ReferenceBuilder_1.ref)(key);
|
|
95
99
|
const access = parsed.parsedExpr.access;
|
|
96
|
-
const isSqlValue = isKnexQueryBuilder(val) || isKnexRaw(val);
|
|
100
|
+
const isSqlValue = (0, knexUtils_1.isKnexQueryBuilder)(val) || (0, knexUtils_1.isKnexRaw)(val);
|
|
97
101
|
// When the column is set by an earlier key, that expression is used instead.
|
|
98
102
|
const target = convertedJson[parsed.column] || parsed.column;
|
|
99
103
|
const isFirstSet = !convertedJson[parsed.column];
|
|
100
104
|
if (!isSqlValue) {
|
|
101
105
|
val = JSON.stringify(val);
|
|
102
106
|
}
|
|
103
|
-
if (getJsonDialect(knex, key) === 'mysql') {
|
|
107
|
+
if ((0, postgresJsonPath_1.getJsonDialect)(knex, key) === 'mysql') {
|
|
104
108
|
const empty = access[0].type === 'array' ? 'JSON_ARRAY()' : 'JSON_OBJECT()';
|
|
105
109
|
const column = isFirstSet ? `COALESCE(??, ${empty})` : '??';
|
|
106
|
-
const value = isSqlValue ? '?' : toJsonSql('?', knex);
|
|
110
|
+
const value = isSqlValue ? '?' : (0, mysqlJsonPath_1.toJsonSql)('?', knex);
|
|
107
111
|
convertedJson[parsed.column] = knex.raw(`JSON_SET(${column}, ?, ${value})`, [
|
|
108
112
|
target,
|
|
109
|
-
toMySqlJsonPath(access),
|
|
113
|
+
(0, mysqlJsonPath_1.toMySqlJsonPath)(access),
|
|
110
114
|
val,
|
|
111
115
|
]);
|
|
112
116
|
}
|
|
@@ -114,7 +118,7 @@ function convertFieldExpressionsToRaw(builder, model, json) {
|
|
|
114
118
|
const empty = access[0].type === 'array' ? `'[]'::jsonb` : `'{}'::jsonb`;
|
|
115
119
|
const column = isFirstSet ? `COALESCE(??, ${empty})` : '??';
|
|
116
120
|
const value = isSqlValue ? 'to_jsonb(?)' : '?';
|
|
117
|
-
convertedJson[parsed.column] = knex.raw(`jsonb_set(${column}, ${toPgJsonPathLiteral(access)}, ${value}, true)`, [target, val]);
|
|
121
|
+
convertedJson[parsed.column] = knex.raw(`jsonb_set(${column}, ${(0, postgresJsonPath_1.toPgJsonPathLiteral)(access)}, ${value}, true)`, [target, val]);
|
|
118
122
|
}
|
|
119
123
|
delete model[key];
|
|
120
124
|
}
|
|
@@ -124,7 +128,3 @@ function convertFieldExpressionsToRaw(builder, model, json) {
|
|
|
124
128
|
}
|
|
125
129
|
return convertedJson;
|
|
126
130
|
}
|
|
127
|
-
module.exports = {
|
|
128
|
-
UpdateOperation,
|
|
129
|
-
convertFieldExpressionsToRaw,
|
|
130
|
-
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpsertGraphAndFetchOperation = void 0;
|
|
4
|
+
const DelegateOperation_1 = require("./DelegateOperation");
|
|
5
|
+
const UpsertGraphOperation_1 = require("./UpsertGraphOperation");
|
|
6
|
+
const RelationExpression_1 = require("../RelationExpression");
|
|
7
|
+
class UpsertGraphAndFetchOperation extends DelegateOperation_1.DelegateOperation {
|
|
6
8
|
constructor(name, opt) {
|
|
7
9
|
super(name, opt);
|
|
8
|
-
if (!this.delegate.is(UpsertGraphOperation)) {
|
|
10
|
+
if (!this.delegate.is(UpsertGraphOperation_1.UpsertGraphOperation)) {
|
|
9
11
|
throw new Error('Invalid delegate');
|
|
10
12
|
}
|
|
11
13
|
}
|
|
@@ -19,7 +21,7 @@ class UpsertGraphAndFetchOperation extends DelegateOperation {
|
|
|
19
21
|
if (this.models.length === 0) {
|
|
20
22
|
return this.isArray ? [] : null;
|
|
21
23
|
}
|
|
22
|
-
const eager = RelationExpression.fromModelGraph(this.models);
|
|
24
|
+
const eager = RelationExpression_1.RelationExpression.fromModelGraph(this.models);
|
|
23
25
|
const modelClass = this.models[0].constructor;
|
|
24
26
|
const ids = this.models.map((model) => model.$id());
|
|
25
27
|
const models = await modelClass
|
|
@@ -30,6 +32,4 @@ class UpsertGraphAndFetchOperation extends DelegateOperation {
|
|
|
30
32
|
return this.isArray ? models : models[0] || null;
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
|
-
|
|
34
|
-
UpsertGraphAndFetchOperation,
|
|
35
|
-
};
|
|
35
|
+
exports.UpsertGraphAndFetchOperation = UpsertGraphAndFetchOperation;
|