@elsikora/nestjs-crud-automator 4.3.3 → 4.3.5
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/dist/cjs/decorator/api/function/update.decorator.js +37 -3
- package/dist/cjs/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/update.decorator.js +37 -3
- package/dist/esm/decorator/api/function/update.decorator.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -637,7 +637,7 @@ Steps do not dispatch function subscribers, create route metadata, or define Swa
|
|
|
637
637
|
|
|
638
638
|
`REQUIRED` opens one Automator-owned `QueryRunner` transaction when none exists. Nested `REQUIRED`, `MANDATORY`, and transactional `SUPPORTS` calls join the same manager and register ordered transaction events; only the outer route, function, or named scope owner commits, rolls back, and flushes post-transaction subscribers. `NONE` and nontransactional `SUPPORTS` do not produce post-transaction lifecycle work.
|
|
639
639
|
|
|
640
|
-
Before `onBeforeUpdate` runs, `ApiFunctionUpdate` performs one ordinary decorated GET through the active transaction manager when present. Update subscribers receive the incoming patch in `context.result`, the active manager repository when a transaction exists (otherwise the service base repository) in `context.DATA.repository`, and a top-level detached and frozen snapshot in `context.DATA.currentEntity: Readonly<TEntity>`. The snapshot is shallow: nested relations, arrays, JSON, dates, buffers, and lazy values retain aliases to the internal loaded entity, so mutating them can affect persistence. Automator merges the subscriber-returned patch into its internal loaded entity and does not issue a second explicit GET. A missing row keeps the GET error lifecycle, skips `onBeforeUpdate`, and then enters the UPDATE error lifecycle.
|
|
640
|
+
Before `onBeforeUpdate` runs, `ApiFunctionUpdate` performs one ordinary decorated GET through the active transaction manager when present. Update subscribers receive the incoming patch in `context.result`, the active manager repository when a transaction exists (otherwise the service base repository) in `context.DATA.repository`, and a top-level detached and frozen snapshot in `context.DATA.currentEntity: Readonly<TEntity>`. Enumerable own patch fields whose value is `undefined` are treated as omitted before subscribers and persistence, while `null` remains an explicit value; patches without such fields retain their original object identity. The same normalization is applied to a subscriber-replaced patch before it is saved. The snapshot is shallow: nested relations, arrays, JSON, dates, buffers, and lazy values retain aliases to the internal loaded entity, so mutating them can affect persistence. Automator merges the subscriber-returned patch into its internal loaded entity and does not issue a second explicit GET. A missing row keeps the GET error lifecycle, skips `onBeforeUpdate`, and then enters the UPDATE error lifecycle.
|
|
641
641
|
|
|
642
642
|
Use a named scope when application code, rather than a decorated function, must own the transaction:
|
|
643
643
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var node_util = require('node:util');
|
|
3
4
|
var functionCapability_class = require('../../../class/api/controller/generated/function-capability.class.js');
|
|
4
5
|
var readScopeStorage_class = require('../../../class/api/controller/generated/read-scope-storage.class.js');
|
|
5
6
|
var contextStorage_class = require('../../../class/api/function/context-storage.class.js');
|
|
@@ -66,6 +67,7 @@ function ApiFunctionUpdate(properties) {
|
|
|
66
67
|
return function (_target, propertyKey, descriptor) {
|
|
67
68
|
descriptor.value = async function (criteria, updateProperties) {
|
|
68
69
|
const mandatoryWhere = readScopeStorage_class.ApiControllerGeneratedReadScopeStorage.claim(type_enum.EApiFunctionType.UPDATE, criteria);
|
|
70
|
+
const normalizedUpdateProperties = normalizeUpdateProperties(updateProperties);
|
|
69
71
|
return await functionTransaction_utility.ApiFunctionExecuteWithTransaction({
|
|
70
72
|
callback: async (eventManager) => {
|
|
71
73
|
const entityInstance = new entity();
|
|
@@ -95,7 +97,7 @@ function ApiFunctionUpdate(properties) {
|
|
|
95
97
|
}
|
|
96
98
|
catch (caughtError) {
|
|
97
99
|
const errorExecutionContext = {
|
|
98
|
-
DATA: { criteria, eventManager, properties:
|
|
100
|
+
DATA: { criteria, eventManager, properties: normalizedUpdateProperties, repository },
|
|
99
101
|
ENTITY: entityInstance,
|
|
100
102
|
FUNCTION_TYPE: type_enum.EApiFunctionType.UPDATE,
|
|
101
103
|
};
|
|
@@ -107,13 +109,14 @@ function ApiFunctionUpdate(properties) {
|
|
|
107
109
|
DATA: { criteria, currentEntity, eventManager, repository },
|
|
108
110
|
ENTITY: entityInstance,
|
|
109
111
|
FUNCTION_TYPE: type_enum.EApiFunctionType.UPDATE,
|
|
110
|
-
result:
|
|
112
|
+
result: normalizedUpdateProperties,
|
|
111
113
|
};
|
|
112
114
|
const result = await executor_class.ApiSubscriberExecutor.executeFunctionBeforeSubscribers(this.constructor, entityInstance, type_enum.EApiFunctionType.UPDATE, executionContext);
|
|
113
115
|
if (result) {
|
|
114
116
|
executionContext.result = result;
|
|
115
117
|
}
|
|
116
|
-
|
|
118
|
+
const executorProperties = normalizeUpdateProperties(executionContext.result ?? {});
|
|
119
|
+
return await executor({ constructor: this.constructor, criteria, entity, existingEntity, properties: executorProperties, repository });
|
|
117
120
|
},
|
|
118
121
|
entity,
|
|
119
122
|
functionType: type_enum.EApiFunctionType.UPDATE,
|
|
@@ -221,6 +224,37 @@ async function executor(options) {
|
|
|
221
224
|
}), { cause: caughtError });
|
|
222
225
|
}
|
|
223
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* Treats enumerable own properties with an undefined value as omitted update fields.
|
|
229
|
+
* Returns the original patch when no normalization is needed so subscriber identity remains stable.
|
|
230
|
+
* @template E The entity type
|
|
231
|
+
* @param {TApiFunctionUpdateProperties<E>} properties - Update patch to normalize
|
|
232
|
+
* @returns {TApiFunctionUpdateProperties<E>} The original patch or a shallow normalized copy
|
|
233
|
+
*/
|
|
234
|
+
function normalizeUpdateProperties(properties) {
|
|
235
|
+
const propertiesCandidate = properties;
|
|
236
|
+
if (typeof propertiesCandidate !== "object" || propertiesCandidate === null || node_util.types.isProxy(propertiesCandidate) || Array.isArray(propertiesCandidate)) {
|
|
237
|
+
return properties;
|
|
238
|
+
}
|
|
239
|
+
const descriptors = Object.getOwnPropertyDescriptors(propertiesCandidate);
|
|
240
|
+
const keys = Reflect.ownKeys(descriptors);
|
|
241
|
+
const hasEnumerableUndefinedField = keys.some((key) => {
|
|
242
|
+
const descriptor = descriptors[key];
|
|
243
|
+
return typeof key === "string" && descriptor?.enumerable === true && "value" in descriptor && descriptor.value === undefined;
|
|
244
|
+
});
|
|
245
|
+
if (!hasEnumerableUndefinedField) {
|
|
246
|
+
return properties;
|
|
247
|
+
}
|
|
248
|
+
const normalizedProperties = Object.create(Object.getPrototypeOf(propertiesCandidate));
|
|
249
|
+
for (const key of keys) {
|
|
250
|
+
const descriptor = descriptors[key];
|
|
251
|
+
if (!descriptor || (typeof key === "string" && descriptor.enumerable && "value" in descriptor && descriptor.value === undefined)) {
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
Object.defineProperty(normalizedProperties, key, descriptor);
|
|
255
|
+
}
|
|
256
|
+
return normalizedProperties;
|
|
257
|
+
}
|
|
224
258
|
|
|
225
259
|
exports.ApiFunctionUpdate = ApiFunctionUpdate;
|
|
226
260
|
//# sourceMappingURL=update.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.decorator.js","sources":["../../../../../../src/decorator/api/function/update.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionTransactionMode","ApiFunctionGet","ApiControllerGeneratedReadScopeStorage","EApiFunctionType","ApiFunctionExecuteWithTransaction","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","ApiControllerGeneratedFunctionCapability","ApiFunctionContextStorage","DatabaseTypeOrmIsEntityNotFound","NotFoundException","ErrorString","EErrorStringAction","DatabaseTypeOrmIsEntityMetadataNotFound","InternalServerErrorException","DatabaseTypeOrmIsForeignKeyViolation","DatabaseTypeOrmGetForeignKeyViolationDetails","EApiExceptionDetailsType","BadRequestException","HttpStatus","DatabaseTypeOrmIsUniqueViolation","DatabaseTypeOrmGetUniqueViolationDetails","ConflictException","HttpException","LoggerUtility","FormatErrorEvidenceForLog"],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.decorator.js","sources":["../../../../../../src/decorator/api/function/update.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionTransactionMode","ApiFunctionGet","ApiControllerGeneratedReadScopeStorage","EApiFunctionType","ApiFunctionExecuteWithTransaction","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","ApiControllerGeneratedFunctionCapability","ApiFunctionContextStorage","DatabaseTypeOrmIsEntityNotFound","NotFoundException","ErrorString","EErrorStringAction","DatabaseTypeOrmIsEntityMetadataNotFound","InternalServerErrorException","DatabaseTypeOrmIsForeignKeyViolation","DatabaseTypeOrmGetForeignKeyViolationDetails","EApiExceptionDetailsType","BadRequestException","HttpStatus","DatabaseTypeOrmIsUniqueViolation","DatabaseTypeOrmGetUniqueViolationDetails","ConflictException","HttpException","LoggerUtility","FormatErrorEvidenceForLog","utilityTypes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA;;;;;;AAMG;AACG,SAAU,iBAAiB,CAA2B,UAAqC,EAAA;AAChG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;IACxD,MAAM,eAAe,GAAgC,UAAU,CAAC,WAAW,EAAE,IAAI,IAAIA,qCAA2B,CAAC,QAAQ;AACzH,IAAA,MAAM,YAAY,GAAiGC,wBAAc,CAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC;AACrL,IAAA,IAAI,WAAwH;AAE5H,IAAA,OAAO,UAAU,OAAgB,EAAE,WAAmB,EAAE,UAA8B,EAAA;AACrF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,QAAuC,EAAE,gBAAiD,EAAA;AACjK,YAAA,MAAM,cAAc,GAA+CC,6DAAsC,CAAC,KAAK,CAACC,0BAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC;AAClJ,YAAA,MAAM,0BAA0B,GAAoC,yBAAyB,CAAC,gBAAgB,CAAC;YAE/G,OAAO,MAAMC,6DAAiC,CAAC;AAC9C,gBAAA,QAAQ,EAAE,OAAO,YAAuC,KAAgB;AACvE,oBAAA,MAAM,cAAc,GAA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-capability.class.js';
|
|
2
3
|
import { ApiControllerGeneratedReadScopeStorage } from '../../../class/api/controller/generated/read-scope-storage.class.js';
|
|
3
4
|
import { ApiFunctionContextStorage } from '../../../class/api/function/context-storage.class.js';
|
|
@@ -64,6 +65,7 @@ function ApiFunctionUpdate(properties) {
|
|
|
64
65
|
return function (_target, propertyKey, descriptor) {
|
|
65
66
|
descriptor.value = async function (criteria, updateProperties) {
|
|
66
67
|
const mandatoryWhere = ApiControllerGeneratedReadScopeStorage.claim(EApiFunctionType.UPDATE, criteria);
|
|
68
|
+
const normalizedUpdateProperties = normalizeUpdateProperties(updateProperties);
|
|
67
69
|
return await ApiFunctionExecuteWithTransaction({
|
|
68
70
|
callback: async (eventManager) => {
|
|
69
71
|
const entityInstance = new entity();
|
|
@@ -93,7 +95,7 @@ function ApiFunctionUpdate(properties) {
|
|
|
93
95
|
}
|
|
94
96
|
catch (caughtError) {
|
|
95
97
|
const errorExecutionContext = {
|
|
96
|
-
DATA: { criteria, eventManager, properties:
|
|
98
|
+
DATA: { criteria, eventManager, properties: normalizedUpdateProperties, repository },
|
|
97
99
|
ENTITY: entityInstance,
|
|
98
100
|
FUNCTION_TYPE: EApiFunctionType.UPDATE,
|
|
99
101
|
};
|
|
@@ -105,13 +107,14 @@ function ApiFunctionUpdate(properties) {
|
|
|
105
107
|
DATA: { criteria, currentEntity, eventManager, repository },
|
|
106
108
|
ENTITY: entityInstance,
|
|
107
109
|
FUNCTION_TYPE: EApiFunctionType.UPDATE,
|
|
108
|
-
result:
|
|
110
|
+
result: normalizedUpdateProperties,
|
|
109
111
|
};
|
|
110
112
|
const result = await ApiSubscriberExecutor.executeFunctionBeforeSubscribers(this.constructor, entityInstance, EApiFunctionType.UPDATE, executionContext);
|
|
111
113
|
if (result) {
|
|
112
114
|
executionContext.result = result;
|
|
113
115
|
}
|
|
114
|
-
|
|
116
|
+
const executorProperties = normalizeUpdateProperties(executionContext.result ?? {});
|
|
117
|
+
return await executor({ constructor: this.constructor, criteria, entity, existingEntity, properties: executorProperties, repository });
|
|
115
118
|
},
|
|
116
119
|
entity,
|
|
117
120
|
functionType: EApiFunctionType.UPDATE,
|
|
@@ -219,6 +222,37 @@ async function executor(options) {
|
|
|
219
222
|
}), { cause: caughtError });
|
|
220
223
|
}
|
|
221
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Treats enumerable own properties with an undefined value as omitted update fields.
|
|
227
|
+
* Returns the original patch when no normalization is needed so subscriber identity remains stable.
|
|
228
|
+
* @template E The entity type
|
|
229
|
+
* @param {TApiFunctionUpdateProperties<E>} properties - Update patch to normalize
|
|
230
|
+
* @returns {TApiFunctionUpdateProperties<E>} The original patch or a shallow normalized copy
|
|
231
|
+
*/
|
|
232
|
+
function normalizeUpdateProperties(properties) {
|
|
233
|
+
const propertiesCandidate = properties;
|
|
234
|
+
if (typeof propertiesCandidate !== "object" || propertiesCandidate === null || types.isProxy(propertiesCandidate) || Array.isArray(propertiesCandidate)) {
|
|
235
|
+
return properties;
|
|
236
|
+
}
|
|
237
|
+
const descriptors = Object.getOwnPropertyDescriptors(propertiesCandidate);
|
|
238
|
+
const keys = Reflect.ownKeys(descriptors);
|
|
239
|
+
const hasEnumerableUndefinedField = keys.some((key) => {
|
|
240
|
+
const descriptor = descriptors[key];
|
|
241
|
+
return typeof key === "string" && descriptor?.enumerable === true && "value" in descriptor && descriptor.value === undefined;
|
|
242
|
+
});
|
|
243
|
+
if (!hasEnumerableUndefinedField) {
|
|
244
|
+
return properties;
|
|
245
|
+
}
|
|
246
|
+
const normalizedProperties = Object.create(Object.getPrototypeOf(propertiesCandidate));
|
|
247
|
+
for (const key of keys) {
|
|
248
|
+
const descriptor = descriptors[key];
|
|
249
|
+
if (!descriptor || (typeof key === "string" && descriptor.enumerable && "value" in descriptor && descriptor.value === undefined)) {
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
Object.defineProperty(normalizedProperties, key, descriptor);
|
|
253
|
+
}
|
|
254
|
+
return normalizedProperties;
|
|
255
|
+
}
|
|
222
256
|
|
|
223
257
|
export { ApiFunctionUpdate };
|
|
224
258
|
//# sourceMappingURL=update.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.decorator.js","sources":["../../../../../../src/decorator/api/function/update.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.decorator.js","sources":["../../../../../../src/decorator/api/function/update.decorator.ts"],"sourcesContent":[null],"names":["utilityTypes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA;;;;;;AAMG;AACG,SAAU,iBAAiB,CAA2B,UAAqC,EAAA;AAChG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;IACxD,MAAM,eAAe,GAAgC,UAAU,CAAC,WAAW,EAAE,IAAI,IAAI,2BAA2B,CAAC,QAAQ;AACzH,IAAA,MAAM,YAAY,GAAiG,cAAc,CAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC;AACrL,IAAA,IAAI,WAAwH;AAE5H,IAAA,OAAO,UAAU,OAAgB,EAAE,WAAmB,EAAE,UAA8B,EAAA;AACrF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,QAAuC,EAAE,gBAAiD,EAAA;AACjK,YAAA,MAAM,cAAc,GAA+C,sCAAsC,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC;AAClJ,YAAA,MAAM,0BAA0B,GAAoC,yBAAyB,CAAC,gBAAgB,CAAC;YAE/G,OAAO,MAAM,iCAAiC,CAAC;AAC9C,gBAAA,QAAQ,EAAE,OAAO,YAAuC,KAAgB;AACvE,oBAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AACtC,oBAAA,MAAM,UAAU,GAAkB,YAAY,GAAG,YAAY,CAAC,aAAa,CAAI,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU;o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