@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
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { IApiBaseEntity } from '../../../interface/api-base-entity.interface';
|
|
2
|
+
import { IApiFunctionContext, IApiFunctionStepContext } from '../../../interface/class/api/function';
|
|
3
|
+
import { EntityManager, Repository } from 'typeorm';
|
|
4
|
+
export declare class ApiFunctionServiceContextFactory {
|
|
5
|
+
/**
|
|
6
|
+
* Creates a service-bound ApiFunction context for custom functions and internal steps.
|
|
7
|
+
* @template E - Entity type associated with the decorated function or step.
|
|
8
|
+
* @param {object} options - Context creation options.
|
|
9
|
+
* @param {new (...arguments_: Array<unknown>) => E} options.entity - Entity constructor associated with the service context.
|
|
10
|
+
* @param {EntityManager} [options.eventManager] - Active transaction manager, when available.
|
|
11
|
+
* @param {{ repository?: Repository<E> }} options.target - Service instance that owns the decorated method.
|
|
12
|
+
* @param {Repository<E>} [options.target.repository] - Service repository used to resolve non-transactional repositories.
|
|
13
|
+
* @returns {IApiFunctionContext<E>} Service-bound function context.
|
|
14
|
+
*/
|
|
15
|
+
static create<E extends IApiBaseEntity>(options: {
|
|
16
|
+
entity: new (...arguments_: Array<unknown>) => E;
|
|
17
|
+
eventManager?: EntityManager;
|
|
18
|
+
target: {
|
|
19
|
+
repository?: Repository<E>;
|
|
20
|
+
};
|
|
21
|
+
}): IApiFunctionContext<E>;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a narrow service-bound ApiFunctionStep context.
|
|
24
|
+
* @template E - Entity type associated with the decorated step.
|
|
25
|
+
* @param {object} options - Context creation options.
|
|
26
|
+
* @param {new (...arguments_: Array<unknown>) => E} options.entity - Entity constructor associated with the step context.
|
|
27
|
+
* @param {EntityManager} [options.eventManager] - Active transaction manager, when available.
|
|
28
|
+
* @param {{ repository?: Repository<E> }} options.target - Service instance that owns the decorated step.
|
|
29
|
+
* @param {Repository<E>} [options.target.repository] - Service repository used to resolve non-transactional repositories.
|
|
30
|
+
* @returns {IApiFunctionStepContext<E>} Service-bound step context.
|
|
31
|
+
*/
|
|
32
|
+
static createStep<E extends IApiBaseEntity>(options: {
|
|
33
|
+
entity: new (...arguments_: Array<unknown>) => E;
|
|
34
|
+
eventManager?: EntityManager;
|
|
35
|
+
target: {
|
|
36
|
+
repository?: Repository<E>;
|
|
37
|
+
};
|
|
38
|
+
}): IApiFunctionStepContext<E>;
|
|
39
|
+
/**
|
|
40
|
+
* Resolves repositories from the service repository manager when no transaction manager is active.
|
|
41
|
+
* @template T - Repository entity type.
|
|
42
|
+
* @param {{ repository?: Repository<IApiBaseEntity> }} target - Service instance with an optional repository.
|
|
43
|
+
* @param {Repository<IApiBaseEntity>} [target.repository] - Service repository used to resolve repositories.
|
|
44
|
+
* @param {new () => T} entity - Entity constructor to resolve.
|
|
45
|
+
* @returns {Repository<T>} Repository from the service manager.
|
|
46
|
+
*/
|
|
47
|
+
private static getManagerRepository;
|
|
48
|
+
/**
|
|
49
|
+
* Resolves a repository from the service repository manager if a service repository exists.
|
|
50
|
+
* @template T - Repository entity type.
|
|
51
|
+
* @param {{ repository?: Repository<IApiBaseEntity> }} target - Service instance with an optional repository.
|
|
52
|
+
* @param {Repository<IApiBaseEntity>} [target.repository] - Service repository used to resolve repositories.
|
|
53
|
+
* @param {new () => T} entity - Entity constructor to resolve.
|
|
54
|
+
* @returns {Repository<T> | undefined} Repository from the service manager, when available.
|
|
55
|
+
*/
|
|
56
|
+
private static resolveManagerRepository;
|
|
57
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ErrorException } from '../../../utility/error/exception.utility.js';
|
|
2
|
+
|
|
3
|
+
class ApiFunctionServiceContextFactory {
|
|
4
|
+
/**
|
|
5
|
+
* Creates a service-bound ApiFunction context for custom functions and internal steps.
|
|
6
|
+
* @template E - Entity type associated with the decorated function or step.
|
|
7
|
+
* @param {object} options - Context creation options.
|
|
8
|
+
* @param {new (...arguments_: Array<unknown>) => E} options.entity - Entity constructor associated with the service context.
|
|
9
|
+
* @param {EntityManager} [options.eventManager] - Active transaction manager, when available.
|
|
10
|
+
* @param {{ repository?: Repository<E> }} options.target - Service instance that owns the decorated method.
|
|
11
|
+
* @param {Repository<E>} [options.target.repository] - Service repository used to resolve non-transactional repositories.
|
|
12
|
+
* @returns {IApiFunctionContext<E>} Service-bound function context.
|
|
13
|
+
*/
|
|
14
|
+
static create(options) {
|
|
15
|
+
const repository = options.eventManager?.getRepository(options.entity) ?? ApiFunctionServiceContextFactory.resolveManagerRepository(options.target, options.entity);
|
|
16
|
+
if (!repository) {
|
|
17
|
+
throw ErrorException("Repository is not available in this context");
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
entity: options.entity,
|
|
21
|
+
eventManager: options.eventManager,
|
|
22
|
+
getRepository: (repositoryEntity) => options.eventManager?.getRepository(repositoryEntity) ?? ApiFunctionServiceContextFactory.getManagerRepository(options.target, repositoryEntity),
|
|
23
|
+
operations: {
|
|
24
|
+
create: async (properties) => await options.target.create(properties),
|
|
25
|
+
delete: async (criteria) => {
|
|
26
|
+
await options.target.delete(criteria);
|
|
27
|
+
},
|
|
28
|
+
get: async (properties) => await options.target.get(properties),
|
|
29
|
+
getList: async (properties) => await options.target.getList(properties),
|
|
30
|
+
getMany: async (properties) => await options.target.getMany(properties),
|
|
31
|
+
getRepository: (repositoryEntity) => options.eventManager?.getRepository(repositoryEntity) ?? ApiFunctionServiceContextFactory.getManagerRepository(options.target, repositoryEntity),
|
|
32
|
+
update: async (criteria, properties) => await options.target.update(criteria, properties),
|
|
33
|
+
},
|
|
34
|
+
repository,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a narrow service-bound ApiFunctionStep context.
|
|
39
|
+
* @template E - Entity type associated with the decorated step.
|
|
40
|
+
* @param {object} options - Context creation options.
|
|
41
|
+
* @param {new (...arguments_: Array<unknown>) => E} options.entity - Entity constructor associated with the step context.
|
|
42
|
+
* @param {EntityManager} [options.eventManager] - Active transaction manager, when available.
|
|
43
|
+
* @param {{ repository?: Repository<E> }} options.target - Service instance that owns the decorated step.
|
|
44
|
+
* @param {Repository<E>} [options.target.repository] - Service repository used to resolve non-transactional repositories.
|
|
45
|
+
* @returns {IApiFunctionStepContext<E>} Service-bound step context.
|
|
46
|
+
*/
|
|
47
|
+
static createStep(options) {
|
|
48
|
+
const repository = options.eventManager?.getRepository(options.entity) ?? ApiFunctionServiceContextFactory.resolveManagerRepository(options.target, options.entity);
|
|
49
|
+
if (!repository) {
|
|
50
|
+
throw ErrorException("Repository is not available in this context");
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
eventManager: options.eventManager,
|
|
54
|
+
getRepository: (repositoryEntity) => options.eventManager?.getRepository(repositoryEntity) ?? ApiFunctionServiceContextFactory.getManagerRepository(options.target, repositoryEntity),
|
|
55
|
+
repository,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Resolves repositories from the service repository manager when no transaction manager is active.
|
|
60
|
+
* @template T - Repository entity type.
|
|
61
|
+
* @param {{ repository?: Repository<IApiBaseEntity> }} target - Service instance with an optional repository.
|
|
62
|
+
* @param {Repository<IApiBaseEntity>} [target.repository] - Service repository used to resolve repositories.
|
|
63
|
+
* @param {new () => T} entity - Entity constructor to resolve.
|
|
64
|
+
* @returns {Repository<T>} Repository from the service manager.
|
|
65
|
+
*/
|
|
66
|
+
static getManagerRepository(target, entity) {
|
|
67
|
+
if (!target.repository) {
|
|
68
|
+
throw ErrorException("Repository is not available in this context");
|
|
69
|
+
}
|
|
70
|
+
return target.repository.manager.getRepository(entity);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Resolves a repository from the service repository manager if a service repository exists.
|
|
74
|
+
* @template T - Repository entity type.
|
|
75
|
+
* @param {{ repository?: Repository<IApiBaseEntity> }} target - Service instance with an optional repository.
|
|
76
|
+
* @param {Repository<IApiBaseEntity>} [target.repository] - Service repository used to resolve repositories.
|
|
77
|
+
* @param {new () => T} entity - Entity constructor to resolve.
|
|
78
|
+
* @returns {Repository<T> | undefined} Repository from the service manager, when available.
|
|
79
|
+
*/
|
|
80
|
+
static resolveManagerRepository(target, entity) {
|
|
81
|
+
return target.repository?.manager.getRepository(entity);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { ApiFunctionServiceContextFactory };
|
|
86
|
+
//# sourceMappingURL=service-context.factory.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-context.factory.class.js","sources":["../../../../../../src/class/api/function/service-context.factory.class.ts"],"sourcesContent":[null],"names":[],"mappings":";;MAQa,gCAAgC,CAAA;AAC5C;;;;;;;;;AASG;IACI,OAAO,MAAM,CAA2B,OAAmI,EAAA;QACjL,MAAM,UAAU,GAA8B,OAAO,CAAC,YAAY,EAAE,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,gCAAgC,CAAC,wBAAwB,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;QAE9L,IAAI,CAAC,UAAU,EAAE;AAChB,YAAA,MAAM,cAAc,CAAC,6CAA6C,CAAC;QACpE;QAEA,OAAO;YACN,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,aAAa,EAAE,CAA2B,gBAA6B,KAAoB,OAAO,CAAC,YAAY,EAAE,aAAa,CAAC,gBAAgB,CAAC,IAAI,gCAAgC,CAAC,oBAAoB,CAAC,OAAO,CAAC,MAAM,EAAE,gBAAgB,CAAC;AAC3O,YAAA,UAAU,EAAE;AACX,gBAAA,MAAM,EAAE,OAAO,UAA2C,KAAiB,MAAO,OAAO,CAAC,MAAiE,CAAC,MAAM,CAAC,UAAU,CAAC;AAC9K,gBAAA,MAAM,EAAE,OAAO,QAA8E,KAAmB;oBAC/G,MAAO,OAAO,CAAC,MAAkE,CAAC,MAAM,CAAC,QAAQ,CAAC;gBACnG,CAAC;AACD,gBAAA,GAAG,EAAE,OAAO,UAAwC,KAAiB,MAAO,OAAO,CAAC,MAA8D,CAAC,GAAG,CAAC,UAAU,CAAC;AAClK,gBAAA,OAAO,EAAE,OAAO,UAA4C,KAA4C,MAAO,OAAO,CAAC,MAA6F,CAAC,OAAO,CAAC,UAAU,CAAC;AACxO,gBAAA,OAAO,EAAE,OAAO,UAA4C,KAAwB,MAAO,OAAO,CAAC,MAAyE,CAAC,OAAO,CAAC,UAAU,CAAC;gBAChM,a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OAAO,CAAC,aAAa,CAAC,MAAM,CAAC;IACxD;AACA;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EApiFunctionTransactionMode } from '../../../enum/decorator/api';
|
|
2
|
+
import { IApiBaseEntity } from '../../../interface/api-base-entity.interface';
|
|
3
|
+
import { IApiFunctionStepProperties } from '../../../interface/decorator/api/function/step-properties.interface';
|
|
4
|
+
import { Repository } from 'typeorm';
|
|
5
|
+
export declare class ApiFunctionStepRuntime {
|
|
6
|
+
/**
|
|
7
|
+
* Executes an internal function step with Automator transaction semantics.
|
|
8
|
+
* @template E - Entity type associated with the decorated step.
|
|
9
|
+
* @param {object} options - Step execution options.
|
|
10
|
+
* @param {Array<unknown>} options.functionArguments - Original method arguments.
|
|
11
|
+
* @param {(...arguments_: Array<unknown>) => Promise<unknown>} options.originalMethod - Original step method.
|
|
12
|
+
* @param {IApiFunctionStepProperties<E>} options.properties - Step configuration.
|
|
13
|
+
* @param {{ repository?: Repository<E> }} options.target - Service instance that owns the step.
|
|
14
|
+
* @param {EApiFunctionTransactionMode} options.transactionMode - Resolved transaction mode.
|
|
15
|
+
* @returns {Promise<unknown>} Original step result.
|
|
16
|
+
*/
|
|
17
|
+
static execute<E extends IApiBaseEntity>(options: {
|
|
18
|
+
functionArguments: Array<unknown>;
|
|
19
|
+
originalMethod: (...arguments_: Array<unknown>) => Promise<unknown>;
|
|
20
|
+
properties: IApiFunctionStepProperties<E>;
|
|
21
|
+
target: {
|
|
22
|
+
repository?: Repository<E>;
|
|
23
|
+
};
|
|
24
|
+
transactionMode: EApiFunctionTransactionMode;
|
|
25
|
+
}): Promise<unknown>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ApiFunctionContextStorage } from './context-storage.class.js';
|
|
2
|
+
import { ApiFunctionServiceContextFactory } from './service-context.factory.class.js';
|
|
3
|
+
import { ApiFunctionExecuteWithTransaction } from '../../../utility/api/function-transaction.utility.js';
|
|
4
|
+
|
|
5
|
+
class ApiFunctionStepRuntime {
|
|
6
|
+
/**
|
|
7
|
+
* Executes an internal function step with Automator transaction semantics.
|
|
8
|
+
* @template E - Entity type associated with the decorated step.
|
|
9
|
+
* @param {object} options - Step execution options.
|
|
10
|
+
* @param {Array<unknown>} options.functionArguments - Original method arguments.
|
|
11
|
+
* @param {(...arguments_: Array<unknown>) => Promise<unknown>} options.originalMethod - Original step method.
|
|
12
|
+
* @param {IApiFunctionStepProperties<E>} options.properties - Step configuration.
|
|
13
|
+
* @param {{ repository?: Repository<E> }} options.target - Service instance that owns the step.
|
|
14
|
+
* @param {EApiFunctionTransactionMode} options.transactionMode - Resolved transaction mode.
|
|
15
|
+
* @returns {Promise<unknown>} Original step result.
|
|
16
|
+
*/
|
|
17
|
+
static async execute(options) {
|
|
18
|
+
return await ApiFunctionExecuteWithTransaction({
|
|
19
|
+
callback: async (eventManager) => {
|
|
20
|
+
const context = ApiFunctionServiceContextFactory.createStep({
|
|
21
|
+
entity: options.properties.entity,
|
|
22
|
+
eventManager,
|
|
23
|
+
target: options.target,
|
|
24
|
+
});
|
|
25
|
+
return await ApiFunctionContextStorage.runStep(context, async () => await options.originalMethod.apply(options.target, options.functionArguments));
|
|
26
|
+
},
|
|
27
|
+
entity: options.properties.entity,
|
|
28
|
+
label: "ApiFunctionStep",
|
|
29
|
+
mode: options.transactionMode,
|
|
30
|
+
repository: options.target.repository,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { ApiFunctionStepRuntime };
|
|
36
|
+
//# sourceMappingURL=step-runtime.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-runtime.class.js","sources":["../../../../../../src/class/api/function/step-runtime.class.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;MAUa,sBAAsB,CAAA;AAClC;;;;;;;;;;AAUG;AACI,IAAA,aAAa,OAAO,CAA2B,OAAoP,EAAA;QACzS,OAAO,MAAM,iCAAiC,CAAC;AAC9C,YAAA,QAAQ,EAAE,OAAO,YAAuC,KAAsB;AAC7E,gBAAA,MAAM,OAAO,GAA+B,gCAAgC,CAAC,UAAU,CAAC;AACvF,oBAAA,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;oBACjC,YAAY;oBACZ,MAAM,EAAE,OAAO,CAAC,MAAM;AACtB,iBAAA,CAAC;gBAEF,OAAO,MAAM,yBAAyB,CAAC,OAAO,CAAC,OAAO,EAAE,YAA8B,MAAM,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;YACrK,CAAC;AACD,YAAA,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;AACjC,YAAA,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,OAAO,CAAC,eAAe;AAC7B,YAAA,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU;AACrC,SAAA,CAAC;IACH;AACA;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IApiBaseEntity } from '../../interface/api-base-entity.interface';
|
|
2
|
-
import { IApiFunctionContext } from '../../interface/class/api/function';
|
|
2
|
+
import { IApiFunctionContext, IApiFunctionStepContext } from '../../interface/class/api/function';
|
|
3
3
|
import { IApiGetListResponseResult } from '../../interface/decorator/api';
|
|
4
4
|
import { TApiFunctionCreateProperties, TApiFunctionDeleteCriteria, TApiFunctionGetListProperties, TApiFunctionGetManyProperties, TApiFunctionGetProperties, TApiFunctionUpdateCriteria, TApiFunctionUpdateProperties } from '../../type/decorator/api/function';
|
|
5
5
|
/**
|
|
@@ -15,4 +15,5 @@ export declare class ApiServiceBase<E> {
|
|
|
15
15
|
getMany(properties: TApiFunctionGetManyProperties<E>): Promise<Array<E>>;
|
|
16
16
|
update(criteria: Array<TApiFunctionUpdateCriteria<E>> | TApiFunctionUpdateCriteria<E>, properties: TApiFunctionUpdateProperties<E>): Promise<E>;
|
|
17
17
|
protected getApiFunctionContext<T extends IApiBaseEntity>(): IApiFunctionContext<T>;
|
|
18
|
+
protected getApiFunctionStepContext<T extends IApiBaseEntity>(): IApiFunctionStepContext<T>;
|
|
18
19
|
}
|
|
@@ -28,11 +28,21 @@ class ApiServiceBase {
|
|
|
28
28
|
}
|
|
29
29
|
getApiFunctionContext() {
|
|
30
30
|
const context = ApiFunctionContextStorage.get();
|
|
31
|
+
if (!context && ApiFunctionContextStorage.getStep()) {
|
|
32
|
+
throw ErrorException("Api function context is not available inside a decorated ApiFunctionStep execution");
|
|
33
|
+
}
|
|
31
34
|
if (!context) {
|
|
32
35
|
throw ErrorException("Api function context is not available outside a decorated ApiFunction execution");
|
|
33
36
|
}
|
|
34
37
|
return context;
|
|
35
38
|
}
|
|
39
|
+
getApiFunctionStepContext() {
|
|
40
|
+
const context = ApiFunctionContextStorage.getStep();
|
|
41
|
+
if (!context) {
|
|
42
|
+
throw ErrorException("Api function step context is not available outside a decorated ApiFunctionStep execution");
|
|
43
|
+
}
|
|
44
|
+
return context;
|
|
45
|
+
}
|
|
36
46
|
}
|
|
37
47
|
|
|
38
48
|
export { ApiServiceBase };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-base.class.js","sources":["../../../../../src/class/api/service-base.class.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AASA;;;;AAIG;MACU,cAAc,CAAA;AAC1B,IAAA,MAAM,CAAC,UAA2C,EAAA;AAGjD,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,EAAO,CAAC;IAChC;AAEA,IAAA,MAAM,CAAC,QAA8E,EAAA;AAGpF,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE;IACzB;;AAGA,IAAA,GAAG,CAAC,UAAwC,EAAA;AAG3C,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC,EAAO,CAAC;IAChC;AAEA,IAAA,OAAO,CAAC,UAA4C,EAAA;AAGnD,QAAA,OAAO,OAAO,CAAC,OAAO,CAAC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AC;IAChC;IAEU,qBAAqB,GAAA;AAC9B,QAAA,MAAM,OAAO,GAAuC,yBAAyB,CAAC,GAAG,EAAK;QAEtF,IAAI,CAAC,OAAO,IAAI,yBAAyB,CAAC,OAAO,EAAK,EAAE;AACvD,YAAA,MAAM,cAAc,CAAC,oFAAoF,CAAC;QAC3G;QAEA,IAAI,CAAC,OAAO,EAAE;AACb,YAAA,MAAM,cAAc,CAAC,iFAAiF,CAAC;QACxG;AAEA,QAAA,OAAO,OAAO;IACf;IAEU,yBAAyB,GAAA;AAClC,QAAA,MAAM,OAAO,GAA2C,yBAAyB,CAAC,OAAO,EAAK;QAE9F,IAAI,CAAC,OAAO,EAAE;AACb,YAAA,MAAM,cAAc,CAAC,0FAA0F,CAAC;QACjH;AAEA,QAAA,OAAO,OAAO;IACf;AACA;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ApiFunctionContextStorage } from '../function/context-storage.class.js';
|
|
1
2
|
import { CONTROLLER_API_DECORATOR_CONSTANT } from '../../../constant/decorator/api/controller.constant.js';
|
|
2
3
|
import { SERVICE_API_DECORATOR_CONSTANT } from '../../../constant/decorator/api/service.constant.js';
|
|
3
4
|
import { EApiFunctionType } from '../../../enum/decorator/api/function-type.enum.js';
|
|
@@ -13,14 +14,16 @@ class ApiSubscriberExecutor {
|
|
|
13
14
|
}
|
|
14
15
|
const entityName = ApiSubscriberExecutor.resolveEntityName(entity, context);
|
|
15
16
|
const subscribers = apiSubscriberRegistry.getFunctionSubscribers(entityName, functionType, action ?? context.action);
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
await ApiFunctionContextStorage.runWithoutStepContext(async () => {
|
|
18
|
+
for (const subscriber of subscribers) {
|
|
19
|
+
const hookName = ApiSubscriberExecutor.resolveHookName(onType, functionType);
|
|
20
|
+
const hook = subscriber[hookName];
|
|
21
|
+
if (typeof hook === "function") {
|
|
22
|
+
subscriberLogger.verbose(`Executing function error hook ${hookName} from ${subscriber.constructor.name} for entity ${entityName}`);
|
|
23
|
+
await hook.call(subscriber, context, error);
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
|
-
}
|
|
26
|
+
});
|
|
24
27
|
}
|
|
25
28
|
static async executeFunctionSubscribers(constructor, entity, functionType, onType, context, action) {
|
|
26
29
|
if (!Reflect.hasMetadata(SERVICE_API_DECORATOR_CONSTANT.OBSERVABLE_METADATA_KEY, constructor)) {
|
|
@@ -29,17 +32,19 @@ class ApiSubscriberExecutor {
|
|
|
29
32
|
const entityName = ApiSubscriberExecutor.resolveEntityName(entity, context);
|
|
30
33
|
const subscribers = apiSubscriberRegistry.getFunctionSubscribers(entityName, functionType, action ?? context.action);
|
|
31
34
|
let result = context.result;
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
await ApiFunctionContextStorage.runWithoutStepContext(async () => {
|
|
36
|
+
for (const subscriber of subscribers) {
|
|
37
|
+
const hookName = ApiSubscriberExecutor.resolveHookName(onType, functionType);
|
|
38
|
+
const hook = subscriber[hookName];
|
|
39
|
+
if (typeof hook === "function") {
|
|
40
|
+
subscriberLogger.verbose(`Executing function hook ${hookName} from ${subscriber.constructor.name} for entity ${entityName}`);
|
|
41
|
+
const hookResult = (await hook.call(subscriber, { ...context, result }));
|
|
42
|
+
if (hookResult !== undefined) {
|
|
43
|
+
result = hookResult;
|
|
44
|
+
}
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
|
-
}
|
|
47
|
+
});
|
|
43
48
|
return result;
|
|
44
49
|
}
|
|
45
50
|
static async executeRouteErrorSubscribers(constructor, entity, routeType, onType, context, error, action) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.class.js","sources":["../../../../../../src/class/api/subscriber/executor.class.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"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,SAAS;QAE9L,IAAI,OAAO,kBAAkB,KAAK,QAAQ,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;AAC5E,YAAA,OAAO,kBAAkB;QAC1B;AAEA,QAAA,MAAM,cAAc,GAAY,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,YAAY,IAAI,IAAI,IAAK,IAAwF,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,IAAK,IAAyD,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,IAAI,SAAS;QAEpT,IAAI,OAAO,cAAc,KAAK,QAAQ,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;AACpE,YAAA,OAAO,cAAc;QACtB;AAEA,QAAA,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI;IAC/B;AAEQ,IAAA,OAAO,eAAe,CAAC,MAA4B,EAAE,aAA2D,EAAA;QACvH,OAAO,aAAa,KAAK,SAAS,IAAI,aAAa,KAAK,gBAAgB,CAAC,MAAM,GAAG,CAAA,EAAA,EAAK,MAAM,CAAA,MAAA,CAAQ,GAAG,CAAA,EAAA,EAAK,MAAM,CAAA,EAAG,eAAe,CAAC,aAAa,CAAC,CAAA,CAAE;IACvJ;AACA;;;;"}
|
|
@@ -96,7 +96,7 @@ function ApiFunctionCreate(properties) {
|
|
|
96
96
|
*/
|
|
97
97
|
async function executor(options) {
|
|
98
98
|
const { constructor, entity, properties, repository } = options;
|
|
99
|
-
const eventManager = ApiFunctionContextStorage.
|
|
99
|
+
const eventManager = ApiFunctionContextStorage.getEventManager();
|
|
100
100
|
try {
|
|
101
101
|
let result;
|
|
102
102
|
if (eventManager) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.decorator.js","sources":["../../../../../../src/decorator/api/function/create.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;;;;;;AAMG;AACG,SAAU,iBAAiB,CAA2B,UA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,EAAE,oBAAoB,CAAC,YAAY,EAAE,qBAAqB,EAAE,cAAc,CAAC,6CAA6C,CAAC,CAAC;AAEjS,wBAAA,MAAM,cAAc,CAAC,6CAA6C,CAAC;oBACpE;oBAEA,OAAO,QAAQ,CAAI,EAAE,WAAW,EAAE,IAAI,CAAC,WAA6D,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,CAAC,MAAM,IAAK,EAAiD,EAAE,UAAU,EAAE,CAAC;gBACvN,CAAC;gBACD,MAAM;AACN,gBAAA,IAAI,EAAE,eAAe;AACrB,gBAAA,gBAAgB,EAAE,OAAO,YAAuC,EAAE,KAAY,KAAmB;AAChG,oBAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,oBAAA,MAAM,qBAAqB,GAAkG;wBAC5H,IAAI,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AACnD,wBAAA,MAAM,EAAE,cAAc;wBACtB,aAAa,EAAE,gBAAgB,CAAC,MAAM;qBACtC;oBAED,MAAM,qBAAqB,CAAC,+BAA+B,CAAC,IAAI,CAAC,WAA6D,EAAE,cAAc,EAAE,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,CAAC,YAAY,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;IACjG,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAA4C,OAAO;
|
|
1
|
+
{"version":3,"file":"create.decorator.js","sources":["../../../../../../src/decorator/api/function/create.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;;;;;;AAMG;AACG,SAA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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;;;;"}
|
|
@@ -107,7 +107,7 @@ function ApiFunctionDelete(properties) {
|
|
|
107
107
|
*/
|
|
108
108
|
async function executor(options) {
|
|
109
109
|
const { constructor, criteria, entity, getFunction, repository } = options;
|
|
110
|
-
const eventManager = ApiFunctionContextStorage.
|
|
110
|
+
const eventManager = ApiFunctionContextStorage.getEventManager();
|
|
111
111
|
try {
|
|
112
112
|
const existingEntity = await getFunction({ where: criteria });
|
|
113
113
|
let result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.decorator.js","sources":["../../../../../../src/decorator/api/function/delete.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;;;;;;AAMG;AACG,SAAU,iBAAiB,CAA2B,UAAqC,EAAA;AAChG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;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BAC1O,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,GAA4C,OAAO;
|
|
1
|
+
{"version":3,"file":"delete.decorator.js","sources":["../../../../../../src/decorator/api/function/delete.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;;;;;;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,EAAA;YAC9G,OAAO,MAAM,iCAAiC,CAAC;AAC9C,gBAAA,QAAQ,EAAE,OAAO,YAAuC,KAAgB;AACvE,oBAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,oBAAA,MAAM,gBAAgB,GAA6E;wBAClG,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AAC7D,wBAAA,MAAM,EAAE,cAAc;wBACtB,aAAa,EAAE,gBAAgB,CAAC,MAAM;AACtC,wBAAA,MAAM,EAAE,QAAQ;qBACh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options) {
|
|
95
95
|
const { constructor, entity, properties, repository } = options;
|
|
96
|
-
const eventManager = ApiFunctionContextStorage.
|
|
96
|
+
const eventManager = ApiFunctionContextStorage.getEventManager();
|
|
97
97
|
try {
|
|
98
98
|
let item;
|
|
99
99
|
if (eventManager) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.js","sources":["../../../../../../../src/decorator/api/function/get/decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;AAMG;AACG,SAAU,cAAc,CAA2B,UAAqC,EAAA;AAC7F,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;IACxD,MAAM,eAAe,GAAgC,UAAU,CAAC,WAAW,EAAE,IAAI,IAAI,2BAA2B,CAAC,QAAQ;AAEzH,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AAMtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,aAA2C,EAAA;YAClH,OAAO,MAAM,iCAAiC,CAAC;AAC9C,gBAAA,QAAQ,EAAE,OAAO,YAAuC,KAAgB;AACvE,oBAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,oBAAA,MAAM,gBAAgB,GAA4E;wBACjG,IAAI,EAAE,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AAClE,wBAAA,MAAM,EAAE,cAAc;wBACtB,aAAa,EAAE,gBAAgB,CAAC,GAAG;AACnC,wBAAA,MAAM,EAAE,aAAa;qBACrB;oBAED,MAAM,MAAM,GAAkC,MAAM,qBAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAA6D,EAAE,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC;oBAE7P,IAAI,MAAM,EAAE;AACX,wBAAA,gBAAgB,CAAC,MAAM,GAAG,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,IAAI,CAAC,UAAU;AAC3B,aAAA,CAAC;AACH,QAAA,CAAC;AAED,QAAA,OAAO,UAAU;AAClB,IAAA,CAAC;AACF;AAEA;;;;;;;AAOG;AACH,eAAe,QAAQ,CAA2B,OAA6C,EAAA;IAC9F,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAyC,OAAO;
|
|
1
|
+
{"version":3,"file":"decorator.js","sources":["../../../../../../../src/decorator/api/function/get/decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;AAMG;AACG,SAAU,cAAc,CAA2B,UAAqC,EAAA;AAC7F,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;IACxD,MAAM,eAAe,GAAgC,UAAU,CAAC,WAAW,EAAE,IAAI,IAAI,2BAA2B,CAAC,QAAQ;AAEzH,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AAMtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,aAA2C,EAAA;YAClH,OAAO,MAAM,iCAAiC,CAAC;AAC9C,gBAAA,QAAQ,EAAE,OAAO,YAAuC,KAAgB;AACvE,oBAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,oBAAA,MAAM,gBAAgB,GAA4E;wBACjG,IAAI,EAAE,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AAClE,wBAAA,MAAM,EAAE,cAAc;wBACtB,aAAa,EAAE,gBAAgB,CAAC,GAAG;AACnC,wBAAA,MAAM,EAAE,aAAa;qBACrB;oBAED,MAAM,MAAM,GAAkC,MAAM,qBAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAA6D,EAAE,cAAc,EAAE,gBAAgB,CAAC,GAAG,EAAE,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC;oBAE7P,IAAI,MAAM,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;YACX,MAAM;YACN,IAAI,EAAE,kBAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,EACF,EAAE,KAAK,EAAE,WAAW,EAAE,CACtB;IACF;AACD;;;;"}
|
|
@@ -108,7 +108,7 @@ function calculateCurrentPage(properties, itemsLength) {
|
|
|
108
108
|
*/
|
|
109
109
|
async function executor(options) {
|
|
110
110
|
const { constructor, entity, properties, repository } = options;
|
|
111
|
-
const eventManager = ApiFunctionContextStorage.
|
|
111
|
+
const eventManager = ApiFunctionContextStorage.getEventManager();
|
|
112
112
|
try {
|
|
113
113
|
let items;
|
|
114
114
|
let totalCount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.decorator.js","sources":["../../../../../../../src/decorator/api/function/get/list.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA;;;;;;AAMG;AACG,SAAU,kBAAkB,CAA2B,UAAqC,EAAA;AACjG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;IACxD,MAAM,eAAe,GAAgC,UAAU,CAAC,WAAW,EAAE,IAAI,IAAI,2BAA2B,CAAC,QAAQ;AAEzH,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AACtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,iBAAmD,EAAA;YAC1H,OAAO,MAAM,iCAAiC,CAAC;AAC9C,gBAAA,QAAQ,EAAE,OAAO,YAAuC,KAA2C;AAClG,oBAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,oBAAA,MAAM,gBAAgB,GAAgF;wBACrG,IAAI,EAAE,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AACtE,wBAAA,MAAM,EAAE,cAAc;wBACtB,aAAa,EAAE,gBAAgB,CAAC,QAAQ;AACxC,wBAAA,MAAM,EAAE,iBAAiB;qBACzB;oBAED,M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ACtB,aAAa,EAAE,gBAAgB,CAAC,QAAQ;qBACxC;oBAED,MAAM,qBAAqB,CAAC,+BAA+B,CAAC,IAAI,CAAC,WAA6D,EAAE,cAAc,EAAE,gBAAgB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,YAAY,EAAE,qBAAqB,EAAE,KAAK,CAAC;gBAC5O,CAAC;gBACD,UAAU,EAAE,IAAI,CAAC,UAAU;AAC3B,aAAA,CAAC;AACH,QAAA,CAAC;AAED,QAAA,OAAO,UAAU;AAClB,IAAA,CAAC;AACF;AAEA;;;;;;AAMG;AACH,SAAS,oBAAoB,CAA2B,UAA4C,EAAE,WAAmB,EAAA;AACxH,IAAA,IAAI,WAAW,KAAK,CAAC,EAAE;AACtB,QAAA,OAAO,CAAC;IACT;AAEA,IAAA,IAAI,UAAU,CAAC,IAAI,EAAE;AACpB,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;IAC/D;AAEA,IAAA,OAAO,CAAC;AACT;AAEA;;;;;;AAMG;AACH,eAAe,QAAQ,CAA2B,OAAiD,EAAA;IAClG,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAA6C,OAAO;
|
|
1
|
+
{"version":3,"file":"list.decorator.js","sources":["../../../../../../../src/decorator/api/function/get/list.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA;;;;;;AAMG;AACG,SAAU,kBAAkB,CAA2B,UAAqC,EAAA;AACjG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;IACxD,MAAM,eAAe,GAAgC,UAAU,CAAC,WAAW,EAAE,IAAI,IAAI,2BAA2B,CAAC,QAAQ;AAEzH,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AACtF,QAAA,UAAU,CAAC,K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C5C,SAAA,CAAC,EACF,EAAE,KAAK,EAAE,WAAW,EAAE,CACtB;IACF;AACD;;;;"}
|
|
@@ -92,7 +92,7 @@ function ApiFunctionGetMany(properties) {
|
|
|
92
92
|
*/
|
|
93
93
|
async function executor(options) {
|
|
94
94
|
const { constructor, entity, properties, repository } = options;
|
|
95
|
-
const eventManager = ApiFunctionContextStorage.
|
|
95
|
+
const eventManager = ApiFunctionContextStorage.getEventManager();
|
|
96
96
|
try {
|
|
97
97
|
let items;
|
|
98
98
|
if (eventManager) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"many.decorator.js","sources":["../../../../../../../src/decorator/api/function/get/many.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA;;;;;;AAMG;AACG,SAAU,kBAAkB,CAA2B,UAAqC,EAAA;AACjG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;IACxD,MAAM,eAAe,GAAgC,UAAU,CAAC,WAAW,EAAE,IAAI,IAAI,2BAA2B,CAAC,QAAQ;AAEzH,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AAMtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,iBAAmD,EAAA;YAC1H,OAAO,MAAM,iCAAiC,CAAC;AAC9C,gBAAA,QAAQ,EAAE,OAAO,YAAuC,KAAuB;AAC9E,oBAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,oBAAA,MAAM,gBAAgB,GAAgF;wBACrG,IAAI,EAAE,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AACtE,wBAAA,MAAM,EAAE,cAAc;wBACtB,aAAa,EAAE,gBAAgB,CAAC,QAAQ;AACxC,wBAAA,MAAM,EAAE,iBAAiB;qBACzB;oBAED,MAAM,MAAM,GAAmC,MAAM,qBAAqB,CAAC,0BAA0B,CAA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,MAAM,qBAAqB,CAAC,+BAA+B,CAAC,IAAI,CAAC,WAA6D,EAAE,cAAc,EAAE,gBAAgB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,YAAY,EAAE,qBAAqB,EAAE,KAAK,CAAC;gBAC5O,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,OAAiD,EAAA;IAClG,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAA6C,OAAO;
|
|
1
|
+
{"version":3,"file":"many.decorator.js","sources":["../../../../../../../src/decorator/api/function/get/many.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA;;;;;;AAMG;AACG,SAAU,kBAAkB,CAA2B,UAAqC,EAAA;AACjG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;IACxD,MAAM,eAAe,GAAgC,UAAU,CAAC,WAAW,EAAE,IAAI,IAAI,2BAA2B,CAAC,QAAQ;AAEzH,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AAMtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,iBAAmD,EAAA;YAC1H,OAAO,MAAM,iCAAiC,CAAC;AAC9C,gBAAA,QAAQ,EAAE,OAAO,YAAuC,KAAuB;AAC9E,oBAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,oBAAA,MAAM,gBAAgB,GAAgF;wBACrG,IAAI,EAAE,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AACtE,wBAAA,MAAM,EAAE,cAAc;wBACtB,aAAa,EAAE,gBAAgB,CAAC,QAAQ;AACxC,wBAAA,MAAM,EAAE,iB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AAE,qBAAqB,EAAE,KAAc,CAAC;AAE5L,QAAA,MAAM,IAAI,4BAA4B,CACrC,WAAW,CAAC;YACX,MAAM;YACN,IAAI,EAAE,kBAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,EACF,EAAE,KAAK,EAAE,WAAW,EAAE,CACtB;IACF;AACD;;;;"}
|
|
@@ -3,4 +3,5 @@ export { ApiFunctionCustom } from './custom.decorator';
|
|
|
3
3
|
export { ApiFunction } from './decorator';
|
|
4
4
|
export { ApiFunctionDelete } from './delete.decorator';
|
|
5
5
|
export * from './get';
|
|
6
|
+
export { ApiFunctionStep } from './step.decorator';
|
|
6
7
|
export { ApiFunctionUpdate } from './update.decorator';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IApiBaseEntity } from '../../../interface/api-base-entity.interface';
|
|
2
|
+
import { IApiFunctionStepProperties } from '../../../interface/decorator/api/function/step-properties.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a decorator for internal transaction-aware ApiFunction steps.
|
|
5
|
+
* @template E - Entity type handled by the decorated service.
|
|
6
|
+
* @param {IApiFunctionStepProperties<E>} properties - Step transaction and entity configuration.
|
|
7
|
+
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A method decorator that wraps the original function.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ApiFunctionStep<E extends IApiBaseEntity>(properties: IApiFunctionStepProperties<E>): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ApiFunctionStepRuntime } from '../../../class/api/function/step-runtime.class.js';
|
|
2
|
+
import '../../../enum/decorator/api/action.enum.js';
|
|
3
|
+
import '../../../enum/decorator/api/authentication-type.enum.js';
|
|
4
|
+
import '../../../enum/decorator/api/controller/relation-reference-shape.enum.js';
|
|
5
|
+
import '../../../enum/decorator/api/controller/request/target.enum.js';
|
|
6
|
+
import '../../../enum/decorator/api/controller/request/transformer-type.enum.js';
|
|
7
|
+
import '../../../enum/decorator/api/controller/response-target.enum.js';
|
|
8
|
+
import '../../../enum/decorator/api/dto-type.enum.js';
|
|
9
|
+
import { EApiFunctionTransactionMode } from '../../../enum/decorator/api/function-transaction-mode.enum.js';
|
|
10
|
+
import '../../../enum/decorator/api/function-type.enum.js';
|
|
11
|
+
import '../../../enum/decorator/api/on-type.enum.js';
|
|
12
|
+
import '../../../enum/decorator/api/property/data-type.enum.js';
|
|
13
|
+
import '../../../enum/decorator/api/property/date/identifier.enum.js';
|
|
14
|
+
import '../../../enum/decorator/api/property/date/type.enum.js';
|
|
15
|
+
import '../../../enum/decorator/api/property/desribe-type.enum.js';
|
|
16
|
+
import '../../../enum/decorator/api/property/number-type.enum.js';
|
|
17
|
+
import '../../../enum/decorator/api/property/string-type.enum.js';
|
|
18
|
+
import '../../../enum/decorator/api/route-type.enum.js';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Creates a decorator for internal transaction-aware ApiFunction steps.
|
|
22
|
+
* @template E - Entity type handled by the decorated service.
|
|
23
|
+
* @param {IApiFunctionStepProperties<E>} properties - Step transaction and entity configuration.
|
|
24
|
+
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A method decorator that wraps the original function.
|
|
25
|
+
*/
|
|
26
|
+
function ApiFunctionStep(properties) {
|
|
27
|
+
const transactionMode = properties.transaction?.mode ?? EApiFunctionTransactionMode.SUPPORTS;
|
|
28
|
+
return function (_target, _propertyKey, descriptor) {
|
|
29
|
+
const originalMethod = descriptor.value;
|
|
30
|
+
descriptor.value = async function (...functionArguments) {
|
|
31
|
+
return await ApiFunctionStepRuntime.execute({
|
|
32
|
+
functionArguments,
|
|
33
|
+
originalMethod,
|
|
34
|
+
properties,
|
|
35
|
+
target: this,
|
|
36
|
+
transactionMode,
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
return descriptor;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { ApiFunctionStep };
|
|
44
|
+
//# sourceMappingURL=step.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.decorator.js","sources":["../../../../../../src/decorator/api/function/step.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAOA;;;;;AAKG;AACG,SAAU,eAAe,CAA2B,UAAyC,EAAA;IAClG,MAAM,eAAe,GAAgC,UAAU,CAAC,WAAW,EAAE,IAAI,IAAI,2BAA2B,CAAC,QAAQ;AAEzH,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AACtF,QAAA,MAAM,cAAc,GAAwD,UAAU,CAAC,KAA4D;AAEnJ,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAsD,GAAG,iBAAiC,EAAA;AAC5G,YAAA,OAAO,MAAM,sBAAsB,CAAC,OAAO,CAAC;gBAC3C,iBAAiB;gBACjB,cAAc;gBACd,UAAU;AACV,gBAAA,MAAM,EAAE,IAAI;gBACZ,eAAe;AACf,aAAA,CAAC;AACH,QAAA,CAAC;AAED,QAAA,OAAO,UAAU;AAClB,IAAA,CAAC;AACF;;;;"}
|
|
@@ -109,7 +109,7 @@ function ApiFunctionUpdate(properties) {
|
|
|
109
109
|
*/
|
|
110
110
|
async function executor(options) {
|
|
111
111
|
const { constructor, criteria, entity, getFunction, properties, repository } = options;
|
|
112
|
-
const eventManager = ApiFunctionContextStorage.
|
|
112
|
+
const eventManager = ApiFunctionContextStorage.getEventManager();
|
|
113
113
|
try {
|
|
114
114
|
const existingEntity = await getFunction({ where: criteria });
|
|
115
115
|
const updatedProperties = {};
|