@elsikora/nestjs-crud-automator 2.6.0-dev.1 → 2.7.0-dev.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 +18 -0
- package/dist/cjs/class/api/function/context-storage.class.d.ts +6 -1
- package/dist/cjs/class/api/function/context-storage.class.js +20 -2
- package/dist/cjs/class/api/function/context-storage.class.js.map +1 -1
- package/dist/cjs/class/api/function/custom-runtime.class.d.ts +0 -2
- package/dist/cjs/class/api/function/custom-runtime.class.js +17 -43
- package/dist/cjs/class/api/function/custom-runtime.class.js.map +1 -1
- package/dist/cjs/class/api/function/service-context.factory.class.d.ts +57 -0
- package/dist/cjs/class/api/function/service-context.factory.class.js +88 -0
- package/dist/cjs/class/api/function/service-context.factory.class.js.map +1 -0
- package/dist/cjs/class/api/function/step-runtime.class.d.ts +26 -0
- package/dist/cjs/class/api/function/step-runtime.class.js +38 -0
- package/dist/cjs/class/api/function/step-runtime.class.js.map +1 -0
- package/dist/cjs/class/api/service-base.class.d.ts +2 -1
- package/dist/cjs/class/api/service-base.class.js +10 -0
- package/dist/cjs/class/api/service-base.class.js.map +1 -1
- package/dist/cjs/class/api/subscriber/executor.class.js +21 -16
- package/dist/cjs/class/api/subscriber/executor.class.js.map +1 -1
- package/dist/cjs/decorator/api/function/create.decorator.js +1 -1
- package/dist/cjs/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/delete.decorator.js +1 -1
- package/dist/cjs/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get/decorator.js +1 -1
- package/dist/cjs/decorator/api/function/get/decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get/list.decorator.js +1 -1
- package/dist/cjs/decorator/api/function/get/list.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get/many.decorator.js +1 -1
- package/dist/cjs/decorator/api/function/get/many.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/index.d.ts +1 -0
- package/dist/cjs/decorator/api/function/step.decorator.d.ts +9 -0
- package/dist/cjs/decorator/api/function/step.decorator.js +46 -0
- package/dist/cjs/decorator/api/function/step.decorator.js.map +1 -0
- package/dist/cjs/decorator/api/function/update.decorator.js +1 -1
- package/dist/cjs/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interface/class/api/function/context/index.d.ts +1 -0
- package/dist/cjs/interface/class/api/function/context/step.interface.d.ts +7 -0
- package/dist/cjs/interface/decorator/api/function/index.d.ts +1 -0
- package/dist/cjs/interface/decorator/api/function/step-properties.interface.d.ts +8 -0
- package/dist/cjs/type/class/api/function/context-storage-entry.type.d.ts +15 -0
- package/dist/cjs/utility/api/function-transaction.utility.d.ts +4 -0
- package/dist/cjs/utility/api/function-transaction.utility.js +12 -4
- package/dist/cjs/utility/api/function-transaction.utility.js.map +1 -1
- package/dist/esm/class/api/function/context-storage.class.d.ts +6 -1
- package/dist/esm/class/api/function/context-storage.class.js +20 -2
- package/dist/esm/class/api/function/context-storage.class.js.map +1 -1
- package/dist/esm/class/api/function/custom-runtime.class.d.ts +0 -2
- package/dist/esm/class/api/function/custom-runtime.class.js +17 -43
- package/dist/esm/class/api/function/custom-runtime.class.js.map +1 -1
- package/dist/esm/class/api/function/service-context.factory.class.d.ts +57 -0
- package/dist/esm/class/api/function/service-context.factory.class.js +86 -0
- package/dist/esm/class/api/function/service-context.factory.class.js.map +1 -0
- package/dist/esm/class/api/function/step-runtime.class.d.ts +26 -0
- package/dist/esm/class/api/function/step-runtime.class.js +36 -0
- package/dist/esm/class/api/function/step-runtime.class.js.map +1 -0
- package/dist/esm/class/api/service-base.class.d.ts +2 -1
- package/dist/esm/class/api/service-base.class.js +10 -0
- package/dist/esm/class/api/service-base.class.js.map +1 -1
- package/dist/esm/class/api/subscriber/executor.class.js +21 -16
- package/dist/esm/class/api/subscriber/executor.class.js.map +1 -1
- package/dist/esm/decorator/api/function/create.decorator.js +1 -1
- package/dist/esm/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/delete.decorator.js +1 -1
- package/dist/esm/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get/decorator.js +1 -1
- package/dist/esm/decorator/api/function/get/decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get/list.decorator.js +1 -1
- package/dist/esm/decorator/api/function/get/list.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get/many.decorator.js +1 -1
- package/dist/esm/decorator/api/function/get/many.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/index.d.ts +1 -0
- package/dist/esm/decorator/api/function/step.decorator.d.ts +9 -0
- package/dist/esm/decorator/api/function/step.decorator.js +44 -0
- package/dist/esm/decorator/api/function/step.decorator.js.map +1 -0
- package/dist/esm/decorator/api/function/update.decorator.js +1 -1
- package/dist/esm/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interface/class/api/function/context/index.d.ts +1 -0
- package/dist/esm/interface/class/api/function/context/step.interface.d.ts +7 -0
- package/dist/esm/interface/decorator/api/function/index.d.ts +1 -0
- package/dist/esm/interface/decorator/api/function/step-properties.interface.d.ts +8 -0
- package/dist/esm/type/class/api/function/context-storage-entry.type.d.ts +15 -0
- package/dist/esm/utility/api/function-transaction.utility.d.ts +4 -0
- package/dist/esm/utility/api/function-transaction.utility.js +12 -4
- package/dist/esm/utility/api/function-transaction.utility.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.decorator.js","sources":["../../../../../../src/decorator/api/function/update.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;;;;;;AAMG;AACG,SAAU,iBAAiB,CAA2B,UAAqC,EAAA;AAChG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA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AAY,EAAE,qBAAqB,EAAE,KAAK,CAAC;gBAC1O,CAAC;gBACD,UAAU,EAAE,IAAI,CAAC,UAAU;AAC3B,aAAA,CAAC;AACH,QAAA,CAAC;AAED,QAAA,OAAO,UAAU;AAClB,IAAA,CAAC;AACF;AAEA;;;;;;AAMG;AACH,eAAe,QAAQ,CAA2B,OAAgD,EAAA;AACjG,IAAA,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,GAA4C,OAAO;
|
|
1
|
+
{"version":3,"file":"update.decorator.js","sources":["../../../../../../src/decorator/api/function/update.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;;;;;;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,WAAqE;AAEzE,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AACtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,QAAuC,EAAE,gBAAiD,EAAA;YACjK,OAAO,MAAM,iCAAiC,CAAC;AAC9C,gBAAA,QAAQ,EAAE,OAAO,YAAuC,KAAgB;AACvE,oBAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,oBAAA,MAAM,gBAAgB,GAA+E;wBACpG,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AAC7D,wBAAA,MAAM,EAAE,cAAc;wBACtB,aAAa,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wB,CAAC,gBAAgB,EAAE;YAC/J,KAAK,GAAG,IAAI,iBAAiB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QAChI;AAEA,QAAA,IAAI,KAAK,YAAY,aAAa,EAAE;YACnC,MAAM,qBAAqB,CAAC,+BAA+B,CAAC,WAAW,EAAE,cAAc,EAAE,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAK,CAAC;AAEjL,YAAA,MAAM,KAAK;QACZ;AAEA,QAAA,aAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAA,sBAAA,EAAyB,MAAM,CAAC,IAAI,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;QACpG,MAAM,qBAAqB,CAAC,+BAA+B,CAAC,WAAW,EAAE,cAAc,EAAE,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAc,CAAC;AAE1L,QAAA,MAAM,IAAI,4BAA4B,CACrC,WAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,EACF,EAAE,KAAK,EAAE,WAAW,EAAE,CACtB;IACF;AACD;;;;"}
|
package/dist/esm/index.js
CHANGED
|
@@ -83,6 +83,7 @@ export { ApiFunctionDelete } from './decorator/api/function/delete.decorator.js'
|
|
|
83
83
|
export { ApiFunctionGet } from './decorator/api/function/get/decorator.js';
|
|
84
84
|
export { ApiFunctionGetList } from './decorator/api/function/get/list.decorator.js';
|
|
85
85
|
export { ApiFunctionGetMany } from './decorator/api/function/get/many.decorator.js';
|
|
86
|
+
export { ApiFunctionStep } from './decorator/api/function/step.decorator.js';
|
|
86
87
|
export { ApiFunctionUpdate } from './decorator/api/function/update.decorator.js';
|
|
87
88
|
export { ApiMethod } from './decorator/api/method.decorator.js';
|
|
88
89
|
export { ApiPropertyBoolean } from './decorator/api/property/boolean.decorator.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IApiBaseEntity } from '../../../../api-base-entity.interface';
|
|
2
|
+
import { EntityManager, Repository } from 'typeorm';
|
|
3
|
+
export interface IApiFunctionStepContext<E extends IApiBaseEntity> {
|
|
4
|
+
eventManager?: EntityManager;
|
|
5
|
+
getRepository: <T extends IApiBaseEntity>(entity: new () => T) => Repository<T>;
|
|
6
|
+
repository: Repository<E>;
|
|
7
|
+
}
|
|
@@ -3,4 +3,5 @@ export { type IApiFunctionCustomProperties } from './custom-properties.interface
|
|
|
3
3
|
export { type IApiFunctionDeleteExecutorProperties } from './delete-executor-properties.interface';
|
|
4
4
|
export type * from './get';
|
|
5
5
|
export { type IApiFunctionProperties } from './properties.interface';
|
|
6
|
+
export { type IApiFunctionStepProperties } from './step-properties.interface';
|
|
6
7
|
export { type IApiFunctionUpdateExecutorProperties } from './update-executor-properties.interface';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EApiFunctionTransactionMode } from '../../../../enum/decorator/api';
|
|
2
|
+
import { IApiBaseEntity } from '../../../api-base-entity.interface';
|
|
3
|
+
export interface IApiFunctionStepProperties<E extends IApiBaseEntity> {
|
|
4
|
+
entity: new (...arguments_: Array<unknown>) => E;
|
|
5
|
+
transaction?: {
|
|
6
|
+
mode: EApiFunctionTransactionMode;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IApiBaseEntity } from '../../../../interface/api-base-entity.interface';
|
|
2
|
+
import { IApiFunctionContext, IApiFunctionStepContext } from '../../../../interface/class/api/function';
|
|
3
|
+
import { EntityManager } from 'typeorm';
|
|
4
|
+
export type TApiFunctionContextStorageEntry<E extends IApiBaseEntity> = {
|
|
5
|
+
context: {
|
|
6
|
+
eventManager?: EntityManager;
|
|
7
|
+
};
|
|
8
|
+
kind: "transaction";
|
|
9
|
+
} | {
|
|
10
|
+
context: IApiFunctionContext<E>;
|
|
11
|
+
kind: "function";
|
|
12
|
+
} | {
|
|
13
|
+
context: IApiFunctionStepContext<E>;
|
|
14
|
+
kind: "step";
|
|
15
|
+
};
|
|
@@ -8,15 +8,19 @@ import { EApiFunctionTransactionMode } from '../../enum/decorator/api';
|
|
|
8
8
|
* @param {object} options - Transaction execution options.
|
|
9
9
|
* @param {(eventManager: EntityManager | undefined) => Promise<R>} options.callback - Function body to run with the resolved transaction manager.
|
|
10
10
|
* @param {new (...arguments_: Array<unknown>) => E} options.entity - Entity constructor associated with the function.
|
|
11
|
+
* @param {string} [options.label] - Error message label for the decorated function primitive.
|
|
11
12
|
* @param {EApiFunctionTransactionMode} options.mode - Transaction mode to enforce.
|
|
12
13
|
* @param {(eventManager: EntityManager | undefined, error: Error) => Promise<void>} [options.onPreflightError] - Error hook for transaction mode conflicts before the function body starts.
|
|
13
14
|
* @param {Repository<E>} [options.repository] - Repository used to open new transactions when required.
|
|
15
|
+
* @param {boolean} [options.shouldBindTransactionScope] - Whether REQUIRED-created transactions should install an ApiFunctionTransactionScope context.
|
|
14
16
|
* @returns {Promise<R>} Callback result.
|
|
15
17
|
*/
|
|
16
18
|
export declare function ApiFunctionExecuteWithTransaction<E extends IApiBaseEntity, R>(options: {
|
|
17
19
|
callback: (eventManager: EntityManager | undefined) => Promise<R>;
|
|
18
20
|
entity: new (...arguments_: Array<unknown>) => E;
|
|
21
|
+
label?: string;
|
|
19
22
|
mode: EApiFunctionTransactionMode;
|
|
20
23
|
onPreflightError?: (eventManager: EntityManager | undefined, error: Error) => Promise<void>;
|
|
21
24
|
repository?: Repository<E>;
|
|
25
|
+
shouldBindTransactionScope?: boolean;
|
|
22
26
|
}): Promise<R>;
|
|
@@ -26,20 +26,23 @@ import { ErrorException } from '../error/exception.utility.js';
|
|
|
26
26
|
* @param {object} options - Transaction execution options.
|
|
27
27
|
* @param {(eventManager: EntityManager | undefined) => Promise<R>} options.callback - Function body to run with the resolved transaction manager.
|
|
28
28
|
* @param {new (...arguments_: Array<unknown>) => E} options.entity - Entity constructor associated with the function.
|
|
29
|
+
* @param {string} [options.label] - Error message label for the decorated function primitive.
|
|
29
30
|
* @param {EApiFunctionTransactionMode} options.mode - Transaction mode to enforce.
|
|
30
31
|
* @param {(eventManager: EntityManager | undefined, error: Error) => Promise<void>} [options.onPreflightError] - Error hook for transaction mode conflicts before the function body starts.
|
|
31
32
|
* @param {Repository<E>} [options.repository] - Repository used to open new transactions when required.
|
|
33
|
+
* @param {boolean} [options.shouldBindTransactionScope] - Whether REQUIRED-created transactions should install an ApiFunctionTransactionScope context.
|
|
32
34
|
* @returns {Promise<R>} Callback result.
|
|
33
35
|
*/
|
|
34
36
|
async function ApiFunctionExecuteWithTransaction(options) {
|
|
35
|
-
const activeEventManager = ApiFunctionContextStorage.
|
|
37
|
+
const activeEventManager = ApiFunctionContextStorage.getEventManager();
|
|
38
|
+
const label = options.label ?? "ApiFunction";
|
|
36
39
|
if (options.mode === EApiFunctionTransactionMode.NONE && activeEventManager) {
|
|
37
|
-
const error = ErrorException(
|
|
40
|
+
const error = ErrorException(`${label} transaction mode NONE cannot run inside an active transaction`);
|
|
38
41
|
await options.onPreflightError?.(activeEventManager, error);
|
|
39
42
|
throw error;
|
|
40
43
|
}
|
|
41
44
|
if (options.mode === EApiFunctionTransactionMode.MANDATORY && !activeEventManager) {
|
|
42
|
-
const error = ErrorException(
|
|
45
|
+
const error = ErrorException(`${label} transaction mode MANDATORY requires an active transaction`);
|
|
43
46
|
await options.onPreflightError?.(undefined, error);
|
|
44
47
|
throw error;
|
|
45
48
|
}
|
|
@@ -50,7 +53,12 @@ async function ApiFunctionExecuteWithTransaction(options) {
|
|
|
50
53
|
await options.onPreflightError?.(undefined, error);
|
|
51
54
|
throw error;
|
|
52
55
|
}
|
|
53
|
-
return await options.repository.manager.transaction(async (transactionManager) =>
|
|
56
|
+
return await options.repository.manager.transaction(async (transactionManager) => {
|
|
57
|
+
if (options.shouldBindTransactionScope === false) {
|
|
58
|
+
return await options.callback(transactionManager);
|
|
59
|
+
}
|
|
60
|
+
return await ApiFunctionTransactionScope.runWithEntityManager(transactionManager, async () => await options.callback(transactionManager));
|
|
61
|
+
});
|
|
54
62
|
}
|
|
55
63
|
return await options.callback(eventManager);
|
|
56
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-transaction.utility.js","sources":["../../../../../src/utility/api/function-transaction.utility.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA
|
|
1
|
+
{"version":3,"file":"function-transaction.utility.js","sources":["../../../../../src/utility/api/function-transaction.utility.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA;;;;;;;;;;;;;AAaG;AACI,eAAe,iCAAiC,CAA8B,OAAkV,EAAA;AACta,IAAA,MAAM,kBAAkB,GAA8B,yBAAyB,CAAC,eAAe,EAAE;AACjG,IAAA,MAAM,KAAK,GAAW,OAAO,CAAC,KAAK,IAAI,aAAa;IAEpD,IAAI,OAAO,CAAC,IAAI,KAAK,2BAA2B,CAAC,IAAI,IAAI,kBAAkB,EAAE;QAC5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