c2-mongoose 2.1.270 → 2.1.274
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/flow/C2Flow.js +6 -6
- package/package.json +1 -1
- package/src/flow/C2Flow.ts +6 -6
package/dist/flow/C2Flow.js
CHANGED
|
@@ -85,7 +85,7 @@ var C2Flow = /** @class */ (function () {
|
|
|
85
85
|
case 0: return [4 /*yield*/, this.repository.create(data, { session: options.session })];
|
|
86
86
|
case 1:
|
|
87
87
|
dataAfter = _a.sent();
|
|
88
|
-
if (options.logger === false) {
|
|
88
|
+
if (options.logger === false || (0, Utils_1.isEmpty)(dataAfter)) {
|
|
89
89
|
return [2 /*return*/, dataAfter];
|
|
90
90
|
}
|
|
91
91
|
log = BuildLogFlowItem_1.default.build(options, dataAfter[0]._doc, Logger_1.TypeOfOperation.CREATE, this.repository);
|
|
@@ -109,7 +109,7 @@ var C2Flow = /** @class */ (function () {
|
|
|
109
109
|
if ((0, Utils_1.isEmpty)(dataAfter)) {
|
|
110
110
|
return [2 /*return*/, dataAfter];
|
|
111
111
|
}
|
|
112
|
-
return [2 /*return*/, dataAfter._doc];
|
|
112
|
+
return [2 /*return*/, dataAfter === null || dataAfter === void 0 ? void 0 : dataAfter._doc];
|
|
113
113
|
}
|
|
114
114
|
if ((0, Utils_1.isEmpty)(dataAfter)) {
|
|
115
115
|
return [2 /*return*/, dataAfter];
|
|
@@ -121,7 +121,7 @@ var C2Flow = /** @class */ (function () {
|
|
|
121
121
|
if ((0, Utils_1.isEmpty)(dataAfter)) {
|
|
122
122
|
return [2 /*return*/, dataAfter];
|
|
123
123
|
}
|
|
124
|
-
return [2 /*return*/, dataAfter._doc];
|
|
124
|
+
return [2 /*return*/, dataAfter === null || dataAfter === void 0 ? void 0 : dataAfter._doc];
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
});
|
|
@@ -138,7 +138,7 @@ var C2Flow = /** @class */ (function () {
|
|
|
138
138
|
if ((0, Utils_1.isEmpty)(dataAfter)) {
|
|
139
139
|
return [2 /*return*/, dataAfter];
|
|
140
140
|
}
|
|
141
|
-
return [2 /*return*/, dataAfter._doc];
|
|
141
|
+
return [2 /*return*/, dataAfter === null || dataAfter === void 0 ? void 0 : dataAfter._doc];
|
|
142
142
|
}
|
|
143
143
|
if ((0, Utils_1.isEmpty)(dataAfter)) {
|
|
144
144
|
return [2 /*return*/, dataAfter];
|
|
@@ -150,7 +150,7 @@ var C2Flow = /** @class */ (function () {
|
|
|
150
150
|
if ((0, Utils_1.isEmpty)(dataAfter)) {
|
|
151
151
|
return [2 /*return*/, dataAfter];
|
|
152
152
|
}
|
|
153
|
-
return [2 /*return*/, dataAfter._doc];
|
|
153
|
+
return [2 /*return*/, dataAfter === null || dataAfter === void 0 ? void 0 : dataAfter._doc];
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
});
|
|
@@ -224,7 +224,7 @@ var C2Flow = /** @class */ (function () {
|
|
|
224
224
|
if (options.logger === false) {
|
|
225
225
|
return [2 /*return*/];
|
|
226
226
|
}
|
|
227
|
-
log = BuildLogFlowItem_1.default.build(options, __assign({ _id: _id }, dataAfter._doc), Logger_1.TypeOfOperation.DELETE, this.repository);
|
|
227
|
+
log = BuildLogFlowItem_1.default.build(options, __assign({ _id: _id }, dataAfter === null || dataAfter === void 0 ? void 0 : dataAfter._doc), Logger_1.TypeOfOperation.DELETE, this.repository);
|
|
228
228
|
return [4 /*yield*/, global.LoggerRepository.create([log], { session: options.session })];
|
|
229
229
|
case 2:
|
|
230
230
|
_a.sent();
|
package/package.json
CHANGED
package/src/flow/C2Flow.ts
CHANGED
|
@@ -30,7 +30,7 @@ class C2Flow<D> {
|
|
|
30
30
|
async createMany(data: Partial<D>[], options: Partial<Options>): Promise<Partial<D>[]> {
|
|
31
31
|
let dataAfter = await this.repository.create(data, { session: options.session })
|
|
32
32
|
|
|
33
|
-
if (options.logger === false) {
|
|
33
|
+
if (options.logger === false || isEmpty(dataAfter)) {
|
|
34
34
|
return dataAfter
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -47,7 +47,7 @@ class C2Flow<D> {
|
|
|
47
47
|
if (isEmpty(dataAfter)) {
|
|
48
48
|
return dataAfter
|
|
49
49
|
}
|
|
50
|
-
return dataAfter
|
|
50
|
+
return dataAfter?._doc
|
|
51
51
|
}
|
|
52
52
|
if (isEmpty(dataAfter)) {
|
|
53
53
|
return dataAfter
|
|
@@ -58,7 +58,7 @@ class C2Flow<D> {
|
|
|
58
58
|
if (isEmpty(dataAfter)) {
|
|
59
59
|
return dataAfter
|
|
60
60
|
}
|
|
61
|
-
return dataAfter
|
|
61
|
+
return dataAfter?._doc
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
async updateByModel(searcher: SearchFlow, data: Partial<D>, options: Partial<Options>): Promise<Partial<D>> {
|
|
@@ -68,7 +68,7 @@ class C2Flow<D> {
|
|
|
68
68
|
if (isEmpty(dataAfter)) {
|
|
69
69
|
return dataAfter
|
|
70
70
|
}
|
|
71
|
-
return dataAfter
|
|
71
|
+
return dataAfter?._doc
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
if (isEmpty(dataAfter)) {
|
|
@@ -80,7 +80,7 @@ class C2Flow<D> {
|
|
|
80
80
|
if (isEmpty(dataAfter)) {
|
|
81
81
|
return dataAfter
|
|
82
82
|
}
|
|
83
|
-
return dataAfter
|
|
83
|
+
return dataAfter?._doc
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
async updateByFilters(filters: any, data: D, options: Partial<Options>): Promise<any> {
|
|
@@ -135,7 +135,7 @@ class C2Flow<D> {
|
|
|
135
135
|
return
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
let log: Partial<ILogger> = BuildLogFlowItem.build(options, { _id, ...dataAfter
|
|
138
|
+
let log: Partial<ILogger> = BuildLogFlowItem.build(options, { _id, ...dataAfter?._doc }, TypeOfOperation.DELETE, this.repository)
|
|
139
139
|
await (global as any).LoggerRepository.create([log], { session: options.session })
|
|
140
140
|
}
|
|
141
141
|
|