@elsikora/nestjs-crud-automator 2.6.0 → 2.7.0
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
|
@@ -109,7 +109,7 @@ function ApiFunctionDelete(properties) {
|
|
|
109
109
|
*/
|
|
110
110
|
async function executor(options) {
|
|
111
111
|
const { constructor, criteria, entity, getFunction, repository } = options;
|
|
112
|
-
const eventManager = contextStorage_class.ApiFunctionContextStorage.
|
|
112
|
+
const eventManager = contextStorage_class.ApiFunctionContextStorage.getEventManager();
|
|
113
113
|
try {
|
|
114
114
|
const existingEntity = await getFunction({ where: criteria });
|
|
115
115
|
let result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.decorator.js","sources":["../../../../../../src/decorator/api/function/delete.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionTransactionMode","ApiFunctionGet","ApiFunctionExecuteWithTransaction","EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","ApiFunctionContextStorage","DatabaseTypeOrmIsEntityNotFound","NotFoundException","ErrorString","EErrorStringAction","DatabaseTypeOrmIsEntityMetadataNotFound","InternalServerErrorException","DatabaseTypeOrmIsForeignKeyViolation","DatabaseTypeOrmGetForeignKeyViolationDetails","EApiExceptionDetailsType","BadRequestException","HttpStatus","HttpException","LoggerUtility"],"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,IAAIA,wDAA2B,CAAC,QAAQ;AACzH,IAAA,MAAM,YAAY,GAAiGC,wBAAc,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,MAAMC,6DAAiC,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,c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6D,EAAE,QAAQ,EAAE,gBAAgB,CAAC,MAAM,IAAI,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;gBAClL,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,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AAC7D,wBAAA,MAAM,EAAE,cAAc;wBACtB,aAAa,EAAEH,kCAAgB,CAAC,MAAM;qBACtC;oBAED,MAAMC,oCAAqB,CAAC,+BAA+B,CAAC,IAAI,CAAC,WAA6D,EAAE,cAAc,EAAED,kCAAgB,CAAC,MAAM,EAAEE,gCAAoB,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;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":["EApiFunctionTransactionMode","ApiFunctionGet","ApiFunctionExecuteWithTransaction","EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","ApiFunctionContextStorage","DatabaseTypeOrmIsEntityNotFound","NotFoundException","ErrorString","EErrorStringAction","DatabaseTypeOrmIsEntityMetadataNotFound","InternalServerErrorException","DatabaseTypeOrmIsForeignKeyViolation","DatabaseTypeOrmGetForeignKeyViolationDetails","EApiExceptionDetailsType","BadRequestException","HttpStatus","HttpException","LoggerUtility"],"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,IAAIA,wDAA2B,CAAC,QAAQ;AACzH,IAAA,MAAM,YAAY,GAAiGC,wBAAc,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,MAAMC,6DAAiC,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,EAAEC,kCAAgB,CAAC,MAAM;AACtC,wBAAA,MAAM,EAAE,QAAQ;qBAChB;oBAED,MAAM,MAAM,GAA8C,MAAMC,oCAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAA6D,EAAE,cAAc,EAAED,kCAAgB,CAAC,MAAM,EAAEE,gCAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC;oBAE5Q,IAAI,MAAM,EAAE;AACX,wBAAA,gBAAgB,CAAC,MAAM,GAAG,MAAM;oBACjC;AAEA,oBAAA,MAAM,UAAU,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AE,IAAI,EAAEA,kDAAwB,CAAC,qBAAqB,EAAE;YACzK,KAAK,GAAG,IAAIC,0BAAmB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAAEC,iBAAU,CAAC,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QACxI;AAEA,QAAA,IAAI,KAAK,YAAYC,oBAAa,EAAE;YACnC,MAAMf,oCAAqB,CAAC,+BAA+B,CAAC,WAAW,EAAE,cAAc,EAAED,kCAAgB,CAAC,MAAM,EAAEE,gCAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAK,CAAC;AAEjL,YAAA,MAAM,KAAK;QACZ;AAEA,QAAAe,4BAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAA,sBAAA,EAAyB,MAAM,CAAC,IAAI,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;QACpG,MAAMhB,oCAAqB,CAAC,+BAA+B,CAAC,WAAW,EAAE,cAAc,EAAED,kCAAgB,CAAC,MAAM,EAAEE,gCAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAc,CAAC;AAE1L,QAAA,MAAM,IAAIQ,mCAA4B,CACrCH,0BAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAEC,8BAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,EACF,EAAE,KAAK,EAAE,WAAW,EAAE,CACtB;IACF;AACD;;;;"}
|
|
@@ -95,7 +95,7 @@ function ApiFunctionGet(properties) {
|
|
|
95
95
|
*/
|
|
96
96
|
async function executor(options) {
|
|
97
97
|
const { constructor, entity, properties, repository } = options;
|
|
98
|
-
const eventManager = contextStorage_class.ApiFunctionContextStorage.
|
|
98
|
+
const eventManager = contextStorage_class.ApiFunctionContextStorage.getEventManager();
|
|
99
99
|
try {
|
|
100
100
|
let item;
|
|
101
101
|
if (eventManager) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.js","sources":["../../../../../../../src/decorator/api/function/get/decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionTransactionMode","ApiFunctionExecuteWithTransaction","EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","ApiFunctionContextStorage","NotFoundException","ErrorString","EErrorStringAction","DatabaseTypeOrmIsEntityNotFound","DatabaseTypeOrmIsEntityMetadataNotFound","InternalServerErrorException","HttpException","LoggerUtility"],"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,IAAIA,wDAA2B,CAAC,QAAQ;AAEzH,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AAMtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,aAA2C,EAAA;YAClH,OAAO,MAAMC,6DAAiC,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,EAAEC,kCAAgB,CAAC,GAAG;AACnC,wBAAA,MAAM,EAAE,aAAa;qBACrB;oBAED,MAAM,MAAM,GAAkC,MAAMC,oCAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAA6D,EAAE,cAAc,EAAED,kCAAgB,CAAC,GAAG,EAAEE,gCAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC;oBAE7P,IAAI,MAAM,EAAE;AACX,wBAA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AAK,CAAC;gBACvO,CAAC;gBACD,UAAU,EAAE,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":["EApiFunctionTransactionMode","ApiFunctionExecuteWithTransaction","EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","ApiFunctionContextStorage","NotFoundException","ErrorString","EErrorStringAction","DatabaseTypeOrmIsEntityNotFound","DatabaseTypeOrmIsEntityMetadataNotFound","InternalServerErrorException","HttpException","LoggerUtility"],"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,IAAIA,wDAA2B,CAAC,QAAQ;AAEzH,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AAMtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,aAA2C,EAAA;YAClH,OAAO,MAAMC,6DAAiC,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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gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAA,sBAAA,EAAyB,MAAM,CAAC,IAAI,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;QACjG,MAAMX,oCAAqB,CAAC,+BAA+B,CAAC,WAAW,EAAE,cAAc,EAAED,kCAAgB,CAAC,GAAG,EAAEE,gCAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAc,CAAC;AAEvL,QAAA,MAAM,IAAIQ,mCAA4B,CACrCJ,0BAAW,CAAC;YACX,MAAM;YACN,IAAI,EAAEC,8BAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,EACF,EAAE,KAAK,EAAE,WAAW,EAAE,CACtB;IACF;AACD;;;;"}
|
|
@@ -110,7 +110,7 @@ function calculateCurrentPage(properties, itemsLength) {
|
|
|
110
110
|
*/
|
|
111
111
|
async function executor(options) {
|
|
112
112
|
const { constructor, entity, properties, repository } = options;
|
|
113
|
-
const eventManager = contextStorage_class.ApiFunctionContextStorage.
|
|
113
|
+
const eventManager = contextStorage_class.ApiFunctionContextStorage.getEventManager();
|
|
114
114
|
try {
|
|
115
115
|
let items;
|
|
116
116
|
let totalCount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.decorator.js","sources":["../../../../../../../src/decorator/api/function/get/list.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionTransactionMode","ApiFunctionExecuteWithTransaction","EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","ApiFunctionContextStorage","DatabaseTypeOrmIsEntityNotFound","NotFoundException","ErrorString","EErrorStringAction","DatabaseTypeOrmIsEntityMetadataNotFound","InternalServerErrorException","HttpException","LoggerUtility"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA;;;;;;AAMG;AACG,SAAU,kBAAkB,CAA2B,UAAqC,EAAA;AACjG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;IACxD,MAAM,eAAe,GAAgC,UAAU,CAAC,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AC;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":["EApiFunctionTransactionMode","ApiFunctionExecuteWithTransaction","EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","ApiFunctionContextStorage","DatabaseTypeOrmIsEntityNotFound","NotFoundException","ErrorString","EErrorStringAction","DatabaseTypeOrmIsEntityMetadataNotFound","InternalServerErrorException","HttpException","LoggerUtility"],"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,IAAIA,wDAA2B,CAAC,QAAQ;AAEzH,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AACtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,iBAAmD,EAAA;YAC1H,OAAO,MAAMC,6DAAiC,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,EAAEC,kCAAgB,CAAC,QAAQ;AACxC,wBAAA,MAAM,EAAE,iBAAiB;qBACzB;oBAED,MAAM,MAAM,GAAmC,MAAMC,oCAAqB,CAAC,0B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AW,CAAC,EAAE;YACzD,KAAK,GAAG,IAAIC,mCAA4B,CAACH,0BAAW,CAAC,EAAE,MAAM,EAAE,IAAI,EAAEC,8BAAkB,CAAC,cAAc,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QACnI;AAEA,QAAA,IAAI,KAAK,YAAYG,oBAAa,EAAE;YACnC,MAAMV,oCAAqB,CAAC,+BAA+B,CAAC,WAAW,EAAE,cAAc,EAAED,kCAAgB,CAAC,QAAQ,EAAEE,gCAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAK,CAAC;AAEnL,YAAA,MAAM,KAAK;QACZ;AAEA,QAAAU,4BAAa,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAA,+BAAA,EAAkC,MAAM,CAAC,IAAI,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;QAC9G,MAAMX,oCAAqB,CAAC,+BAA+B,CAAC,WAAW,EAAE,cAAc,EAAED,kCAAgB,CAAC,QAAQ,EAAEE,gCAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAc,CAAC;AAE5L,QAAA,MAAM,IAAIQ,mCAA4B,CACrCH,0BAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAEC,8BAAkB,CAAC,mBAAmB;AAC5C,SAAA,CAAC,EACF,EAAE,KAAK,EAAE,WAAW,EAAE,CACtB;IACF;AACD;;;;"}
|
|
@@ -94,7 +94,7 @@ function ApiFunctionGetMany(properties) {
|
|
|
94
94
|
*/
|
|
95
95
|
async function executor(options) {
|
|
96
96
|
const { constructor, entity, properties, repository } = options;
|
|
97
|
-
const eventManager = contextStorage_class.ApiFunctionContextStorage.
|
|
97
|
+
const eventManager = contextStorage_class.ApiFunctionContextStorage.getEventManager();
|
|
98
98
|
try {
|
|
99
99
|
let items;
|
|
100
100
|
if (eventManager) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"many.decorator.js","sources":["../../../../../../../src/decorator/api/function/get/many.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionTransactionMode","ApiFunctionExecuteWithTransaction","EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","ApiFunctionContextStorage","DatabaseTypeOrmIsEntityNotFound","NotFoundException","ErrorString","EErrorStringAction","DatabaseTypeOrmIsEntityMetadataNotFound","InternalServerErrorException","HttpException","LoggerUtility"],"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,IAAIA,wDAA2B,CAAC,QAAQ;AAEzH,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AAMtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,iBAAmD,EAAA;YAC1H,OAAO,MAAMC,6DAAiC,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,EAAEC,kCAAgB,CAAC,QAAQ;AACxC,wBAAA,MAAM,EAAE,iBAAiB;qBACzB;oBAED,MAAM,MAAM,GAAmC,MAAMC,oCAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAA6D,EAAE,cAAc,EAAED,kCAAgB,CAAC,QAAQ,EAAEE,gCAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC;oBAEnQ,IAAI,MAAM,EAAE;AACX,wBAAA,gBAAgB,CAAC,MA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;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":["EApiFunctionTransactionMode","ApiFunctionExecuteWithTransaction","EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","ApiFunctionContextStorage","DatabaseTypeOrmIsEntityNotFound","NotFoundException","ErrorString","EErrorStringAction","DatabaseTypeOrmIsEntityMetadataNotFound","InternalServerErrorException","HttpException","LoggerUtility"],"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,IAAIA,wDAA2B,CAAC,QAAQ;AAEzH,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AAMtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,iBAAmD,EAAA;YAC1H,OAAO,MAAMC,6DAAiC,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;wBACt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X,oCAAqB,CAAC,+BAA+B,CAAC,WAAW,EAAE,cAAc,EAAED,kCAAgB,CAAC,QAAQ,EAAEE,gCAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAc,CAAC;AAE5L,QAAA,MAAM,IAAIQ,mCAA4B,CACrCH,0BAAW,CAAC;YACX,MAAM;YACN,IAAI,EAAEC,8BAAkB,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,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var stepRuntime_class = require('../../../class/api/function/step-runtime.class.js');
|
|
4
|
+
require('../../../enum/decorator/api/action.enum.js');
|
|
5
|
+
require('../../../enum/decorator/api/authentication-type.enum.js');
|
|
6
|
+
require('../../../enum/decorator/api/controller/relation-reference-shape.enum.js');
|
|
7
|
+
require('../../../enum/decorator/api/controller/request/target.enum.js');
|
|
8
|
+
require('../../../enum/decorator/api/controller/request/transformer-type.enum.js');
|
|
9
|
+
require('../../../enum/decorator/api/controller/response-target.enum.js');
|
|
10
|
+
require('../../../enum/decorator/api/dto-type.enum.js');
|
|
11
|
+
var functionTransactionMode_enum = require('../../../enum/decorator/api/function-transaction-mode.enum.js');
|
|
12
|
+
require('../../../enum/decorator/api/function-type.enum.js');
|
|
13
|
+
require('../../../enum/decorator/api/on-type.enum.js');
|
|
14
|
+
require('../../../enum/decorator/api/property/data-type.enum.js');
|
|
15
|
+
require('../../../enum/decorator/api/property/date/identifier.enum.js');
|
|
16
|
+
require('../../../enum/decorator/api/property/date/type.enum.js');
|
|
17
|
+
require('../../../enum/decorator/api/property/desribe-type.enum.js');
|
|
18
|
+
require('../../../enum/decorator/api/property/number-type.enum.js');
|
|
19
|
+
require('../../../enum/decorator/api/property/string-type.enum.js');
|
|
20
|
+
require('../../../enum/decorator/api/route-type.enum.js');
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Creates a decorator for internal transaction-aware ApiFunction steps.
|
|
24
|
+
* @template E - Entity type handled by the decorated service.
|
|
25
|
+
* @param {IApiFunctionStepProperties<E>} properties - Step transaction and entity configuration.
|
|
26
|
+
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A method decorator that wraps the original function.
|
|
27
|
+
*/
|
|
28
|
+
function ApiFunctionStep(properties) {
|
|
29
|
+
const transactionMode = properties.transaction?.mode ?? functionTransactionMode_enum.EApiFunctionTransactionMode.SUPPORTS;
|
|
30
|
+
return function (_target, _propertyKey, descriptor) {
|
|
31
|
+
const originalMethod = descriptor.value;
|
|
32
|
+
descriptor.value = async function (...functionArguments) {
|
|
33
|
+
return await stepRuntime_class.ApiFunctionStepRuntime.execute({
|
|
34
|
+
functionArguments,
|
|
35
|
+
originalMethod,
|
|
36
|
+
properties,
|
|
37
|
+
target: this,
|
|
38
|
+
transactionMode,
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
return descriptor;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
exports.ApiFunctionStep = ApiFunctionStep;
|
|
46
|
+
//# 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":["EApiFunctionTransactionMode","ApiFunctionStepRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA;;;;;AAKG;AACG,SAAU,eAAe,CAA2B,UAAyC,EAAA;IAClG,MAAM,eAAe,GAAgC,UAAU,CAAC,WAAW,EAAE,IAAI,IAAIA,wDAA2B,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,MAAMC,wCAAsB,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;;;;"}
|
|
@@ -111,7 +111,7 @@ function ApiFunctionUpdate(properties) {
|
|
|
111
111
|
*/
|
|
112
112
|
async function executor(options) {
|
|
113
113
|
const { constructor, criteria, entity, getFunction, properties, repository } = options;
|
|
114
|
-
const eventManager = contextStorage_class.ApiFunctionContextStorage.
|
|
114
|
+
const eventManager = contextStorage_class.ApiFunctionContextStorage.getEventManager();
|
|
115
115
|
try {
|
|
116
116
|
const existingEntity = await getFunction({ where: criteria });
|
|
117
117
|
const updatedProperties = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.decorator.js","sources":["../../../../../../src/decorator/api/function/update.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionTransactionMode","ApiFunctionGet","ApiFunctionExecuteWithTransaction","EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","ApiFunctionContextStorage","DatabaseTypeOrmIsEntityNotFound","NotFoundException","ErrorString","EErrorStringAction","DatabaseTypeOrmIsEntityMetadataNotFound","InternalServerErrorException","DatabaseTypeOrmIsForeignKeyViolation","DatabaseTypeOrmGetForeignKeyViolationDetails","EApiExceptionDetailsType","BadRequestException","HttpStatus","DatabaseTypeOrmIsUniqueViolation","DatabaseTypeOrmGetUniqueViolationDetails","ConflictException","HttpException","LoggerUtility"],"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,IAAIA,wDAA2B,CAAC,QAAQ;AACzH,IAAA,MAAM,YAAY,GAAiGC,wBAAc,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,MAAMC,6DAAiC,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,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,wCAAwC,CAAC;wBAC/D;oBACD;oBAEA,OAAO,QAAQ,CAAI,EAAE,WAAW,EAAE,IAAI,CAAC,WAA6D,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,CAAC,MAAM,IAAK,EAAiD,EAAE,UAAU,EAAE,CAAC;gBAC9O,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,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AAC7D,wBAAA,MAAM,EAAE,cAAc;wBACtB,aAAa,EAAEH,kCAAgB,CAAC,MAAM;qBACtC;oBAED,MAAMC,oCAAqB,CAAC,+BAA+B,CAAC,IAAI,CAAC,WAA6D,EAAE,cAAc,EAAED,kCAAgB,CAAC,MAAM,EAAEE,gCAAoB,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;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":["EApiFunctionTransactionMode","ApiFunctionGet","ApiFunctionExecuteWithTransaction","EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","ApiFunctionContextStorage","DatabaseTypeOrmIsEntityNotFound","NotFoundException","ErrorString","EErrorStringAction","DatabaseTypeOrmIsEntityMetadataNotFound","InternalServerErrorException","DatabaseTypeOrmIsForeignKeyViolation","DatabaseTypeOrmGetForeignKeyViolationDetails","EApiExceptionDetailsType","BadRequestException","HttpStatus","DatabaseTypeOrmIsUniqueViolation","DatabaseTypeOrmGetUniqueViolationDetails","ConflictException","HttpException","LoggerUtility"],"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,IAAIA,wDAA2B,CAAC,QAAQ;AACzH,IAAA,MAAM,YAAY,GAAiGC,wBAAc,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,MAAMC,6DAAiC,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,EAAEC,kCAAgB,CAAC,MAAM;AACtC,wBAAA,MAAM,EAAE,gBAAgB;qBACxB;oBAED,MAAM,MAAM,GAAgD,MAAMC,oCAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAA6D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AE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAEH,iBAAU,CAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QAChI;AAEA,QAAA,IAAI,KAAK,YAAYI,oBAAa,EAAE;YACnC,MAAMlB,oCAAqB,CAAC,+BAA+B,CAAC,WAAW,EAAE,cAAc,EAAED,kCAAgB,CAAC,MAAM,EAAEE,gCAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAK,CAAC;AAEjL,YAAA,MAAM,KAAK;QACZ;AAEA,QAAAkB,4BAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAA,sBAAA,EAAyB,MAAM,CAAC,IAAI,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;QACpG,MAAMnB,oCAAqB,CAAC,+BAA+B,CAAC,WAAW,EAAE,cAAc,EAAED,kCAAgB,CAAC,MAAM,EAAEE,gCAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAc,CAAC;AAE1L,QAAA,MAAM,IAAIQ,mCAA4B,CACrCH,0BAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAEC,8BAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,EACF,EAAE,KAAK,EAAE,WAAW,EAAE,CACtB;IACF;AACD;;;;"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -85,6 +85,7 @@ var delete_decorator = require('./decorator/api/function/delete.decorator.js');
|
|
|
85
85
|
var decorator$2 = require('./decorator/api/function/get/decorator.js');
|
|
86
86
|
var list_decorator = require('./decorator/api/function/get/list.decorator.js');
|
|
87
87
|
var many_decorator = require('./decorator/api/function/get/many.decorator.js');
|
|
88
|
+
var step_decorator = require('./decorator/api/function/step.decorator.js');
|
|
88
89
|
var update_decorator = require('./decorator/api/function/update.decorator.js');
|
|
89
90
|
var method_decorator = require('./decorator/api/method.decorator.js');
|
|
90
91
|
var boolean_decorator = require('./decorator/api/property/boolean.decorator.js');
|
|
@@ -364,6 +365,7 @@ exports.ApiFunctionDelete = delete_decorator.ApiFunctionDelete;
|
|
|
364
365
|
exports.ApiFunctionGet = decorator$2.ApiFunctionGet;
|
|
365
366
|
exports.ApiFunctionGetList = list_decorator.ApiFunctionGetList;
|
|
366
367
|
exports.ApiFunctionGetMany = many_decorator.ApiFunctionGetMany;
|
|
368
|
+
exports.ApiFunctionStep = step_decorator.ApiFunctionStep;
|
|
367
369
|
exports.ApiFunctionUpdate = update_decorator.ApiFunctionUpdate;
|
|
368
370
|
exports.ApiMethod = method_decorator.ApiMethod;
|
|
369
371
|
exports.ApiPropertyBoolean = boolean_decorator.ApiPropertyBoolean;
|
package/dist/cjs/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>;
|
|
@@ -28,20 +28,23 @@ var exception_utility = require('../error/exception.utility.js');
|
|
|
28
28
|
* @param {object} options - Transaction execution options.
|
|
29
29
|
* @param {(eventManager: EntityManager | undefined) => Promise<R>} options.callback - Function body to run with the resolved transaction manager.
|
|
30
30
|
* @param {new (...arguments_: Array<unknown>) => E} options.entity - Entity constructor associated with the function.
|
|
31
|
+
* @param {string} [options.label] - Error message label for the decorated function primitive.
|
|
31
32
|
* @param {EApiFunctionTransactionMode} options.mode - Transaction mode to enforce.
|
|
32
33
|
* @param {(eventManager: EntityManager | undefined, error: Error) => Promise<void>} [options.onPreflightError] - Error hook for transaction mode conflicts before the function body starts.
|
|
33
34
|
* @param {Repository<E>} [options.repository] - Repository used to open new transactions when required.
|
|
35
|
+
* @param {boolean} [options.shouldBindTransactionScope] - Whether REQUIRED-created transactions should install an ApiFunctionTransactionScope context.
|
|
34
36
|
* @returns {Promise<R>} Callback result.
|
|
35
37
|
*/
|
|
36
38
|
async function ApiFunctionExecuteWithTransaction(options) {
|
|
37
|
-
const activeEventManager = contextStorage_class.ApiFunctionContextStorage.
|
|
39
|
+
const activeEventManager = contextStorage_class.ApiFunctionContextStorage.getEventManager();
|
|
40
|
+
const label = options.label ?? "ApiFunction";
|
|
38
41
|
if (options.mode === functionTransactionMode_enum.EApiFunctionTransactionMode.NONE && activeEventManager) {
|
|
39
|
-
const error = exception_utility.ErrorException(
|
|
42
|
+
const error = exception_utility.ErrorException(`${label} transaction mode NONE cannot run inside an active transaction`);
|
|
40
43
|
await options.onPreflightError?.(activeEventManager, error);
|
|
41
44
|
throw error;
|
|
42
45
|
}
|
|
43
46
|
if (options.mode === functionTransactionMode_enum.EApiFunctionTransactionMode.MANDATORY && !activeEventManager) {
|
|
44
|
-
const error = exception_utility.ErrorException(
|
|
47
|
+
const error = exception_utility.ErrorException(`${label} transaction mode MANDATORY requires an active transaction`);
|
|
45
48
|
await options.onPreflightError?.(undefined, error);
|
|
46
49
|
throw error;
|
|
47
50
|
}
|
|
@@ -52,7 +55,12 @@ async function ApiFunctionExecuteWithTransaction(options) {
|
|
|
52
55
|
await options.onPreflightError?.(undefined, error);
|
|
53
56
|
throw error;
|
|
54
57
|
}
|
|
55
|
-
return await options.repository.manager.transaction(async (transactionManager) =>
|
|
58
|
+
return await options.repository.manager.transaction(async (transactionManager) => {
|
|
59
|
+
if (options.shouldBindTransactionScope === false) {
|
|
60
|
+
return await options.callback(transactionManager);
|
|
61
|
+
}
|
|
62
|
+
return await transactionScope_class.ApiFunctionTransactionScope.runWithEntityManager(transactionManager, async () => await options.callback(transactionManager));
|
|
63
|
+
});
|
|
56
64
|
}
|
|
57
65
|
return await options.callback(eventManager);
|
|
58
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-transaction.utility.js","sources":["../../../../../src/utility/api/function-transaction.utility.ts"],"sourcesContent":[null],"names":["ApiFunctionContextStorage","EApiFunctionTransactionMode","ErrorException","ApiFunctionTransactionScope"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAQA
|
|
1
|
+
{"version":3,"file":"function-transaction.utility.js","sources":["../../../../../src/utility/api/function-transaction.utility.ts"],"sourcesContent":[null],"names":["ApiFunctionContextStorage","EApiFunctionTransactionMode","ErrorException","ApiFunctionTransactionScope"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAQA;;;;;;;;;;;;;AAaG;AACI,eAAe,iCAAiC,CAA8B,OAAkV,EAAA;AACta,IAAA,MAAM,kBAAkB,GAA8BA,8CAAyB,CAAC,eAAe,EAAE;AACjG,IAAA,MAAM,KAAK,GAAW,OAAO,CAAC,KAAK,IAAI,aAAa;IAEpD,IAAI,OAAO,CAAC,IAAI,KAAKC,wDAA2B,CAAC,IAAI,IAAI,kBAAkB,EAAE;QAC5E,MAAM,KAAK,GAAUC,gCAAc,CAAC,GAAG,KAAK,CAAA,8DAAA,CAAgE,CAAC;QAE7G,MAAM,OAAO,CAAC,gBAAgB,GAAG,kBAAkB,EAAE,KAAK,CAAC;AAE3D,QAAA,MAAM,KAAK;IACZ;IAEA,IAAI,OAAO,CAAC,IAAI,KAAKD,wDAA2B,CAAC,SAAS,IAAI,CAAC,kBAAkB,EAAE;QAClF,MAAM,KAAK,GAAUC,gCAAc,CAAC,GAAG,KAAK,CAAA,0DAAA,CAA4D,CAAC;QAEzG,MAAM,OAAO,CAAC,gBAAgB,GAAG,SAAS,EAAE,KAAK,CAAC;AAElD,QAAA,MAAM,KAAK;IACZ;AAEA,IAAA,MAAM,YAAY,GAA8B,OAAO,CAAC,IAAI,KAAKD,wDAA2B,CAAC,IAAI,GAAG,SAAS,GAAG,kBAAkB;IAElI,IAAI,OAAO,CAAC,IAAI,KAAKA,wDAA2B,CAAC,QAAQ,IAAI,CAAC,YAAY,EAAE;AAC3E,QAAA,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;AACxB,YAAA,MAAM,KAAK,GAAUC,gCAAc,CAAC,6CAA6C,CAAC;YAElF,MAAM,OAAO,CAAC,gBAAgB,GAAG,SAAS,EAAE,KAAK,CAAC;AAElD,YAAA,MAAM,KAAK;QACZ;AAEA,QAAA,OAAO,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,kBAAiC,KAAgB;AAC3G,YAAA,IAAI,OAAO,CAAC,0BAA0B,KAAK,KAAK,EAAE;AACjD,gBAAA,OAAO,MAAM,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YAClD;AAEA,YAAA,OAAO,MAAMC,kDAA2B,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,YAAwB,MAAM,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AACtJ,QAAA,CAAC,CAAC;IACH;AAEA,IAAA,OAAO,MAAM,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;AAC5C;;;;"}
|
|
@@ -1,7 +1,12 @@
|
|
|
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
|
+
import { EntityManager } from 'typeorm';
|
|
3
4
|
export declare class ApiFunctionContextStorage {
|
|
4
5
|
private static readonly STORAGE;
|
|
5
6
|
static get<E extends IApiBaseEntity>(): IApiFunctionContext<E> | undefined;
|
|
7
|
+
static getEventManager(): EntityManager | undefined;
|
|
8
|
+
static getStep<E extends IApiBaseEntity>(): IApiFunctionStepContext<E> | undefined;
|
|
6
9
|
static run<E extends IApiBaseEntity, R>(context: IApiFunctionContext<E>, callback: () => Promise<R>): Promise<R>;
|
|
10
|
+
static runStep<E extends IApiBaseEntity, R>(context: IApiFunctionStepContext<E>, callback: () => Promise<R>): Promise<R>;
|
|
11
|
+
static runWithoutStepContext<R>(callback: () => Promise<R>): Promise<R>;
|
|
7
12
|
}
|
|
@@ -3,10 +3,28 @@ import { AsyncLocalStorage } from 'node:async_hooks';
|
|
|
3
3
|
class ApiFunctionContextStorage {
|
|
4
4
|
static STORAGE = new AsyncLocalStorage();
|
|
5
5
|
static get() {
|
|
6
|
-
|
|
6
|
+
const entry = ApiFunctionContextStorage.STORAGE.getStore();
|
|
7
|
+
return entry?.kind === "function" ? entry.context : undefined;
|
|
8
|
+
}
|
|
9
|
+
static getEventManager() {
|
|
10
|
+
return ApiFunctionContextStorage.STORAGE.getStore()?.context.eventManager;
|
|
11
|
+
}
|
|
12
|
+
static getStep() {
|
|
13
|
+
const entry = ApiFunctionContextStorage.STORAGE.getStore();
|
|
14
|
+
return entry?.kind === "step" ? entry.context : undefined;
|
|
7
15
|
}
|
|
8
16
|
static run(context, callback) {
|
|
9
|
-
return ApiFunctionContextStorage.STORAGE.run(context, callback);
|
|
17
|
+
return ApiFunctionContextStorage.STORAGE.run({ context: context, kind: "function" }, callback);
|
|
18
|
+
}
|
|
19
|
+
static runStep(context, callback) {
|
|
20
|
+
return ApiFunctionContextStorage.STORAGE.run({ context, kind: "step" }, callback);
|
|
21
|
+
}
|
|
22
|
+
static runWithoutStepContext(callback) {
|
|
23
|
+
const entry = ApiFunctionContextStorage.STORAGE.getStore();
|
|
24
|
+
if (entry?.kind !== "step") {
|
|
25
|
+
return callback();
|
|
26
|
+
}
|
|
27
|
+
return ApiFunctionContextStorage.STORAGE.run({ context: { eventManager: entry.context.eventManager }, kind: "transaction" }, callback);
|
|
10
28
|
}
|
|
11
29
|
}
|
|
12
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-storage.class.js","sources":["../../../../../../src/class/api/function/context-storage.class.ts"],"sourcesContent":[null],"names":["NodeAsyncLocalStorage"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"context-storage.class.js","sources":["../../../../../../src/class/api/function/context-storage.class.ts"],"sourcesContent":[null],"names":["NodeAsyncLocalStorage"],"mappings":";;MASa,yBAAyB,CAAA;AAC7B,IAAA,OAAgB,OAAO,GAAuE,IAAIA,iBAAqB,EAAmD;AAE3K,IAAA,OAAO,GAAG,GAAA;QAChB,MAAM,KAAK,GAAgE,yBAAyB,CAAC,OAAO,CAAC,QAAQ,EAAE;AAEvH,QAAA,OAAO,KAAK,EAAE,IAAI,KAAK,UAAU,GAAI,KAAK,CAAC,OAA6C,GAAG,SAAS;IACrG;AAEO,IAAA,OAAO,eAAe,GAAA;QAC5B,OAAO,yBAAyB,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,YAAY;IAC1E;AAEO,IAAA,OAAO,OAAO,GAAA;QACpB,MAAM,KAAK,GAAgE,yBAAyB,CAAC,OAAO,CAAC,QAAQ,EAAE;AAEvH,QAAA,OAAO,KAAK,EAAE,IAAI,KAAK,MAAM,GAAI,KAAK,CAAC,OAAsC,GAAG,SAAS;IAC1F;AAEO,IAAA,OAAO,GAAG,CAA8B,OAA+B,EAAE,QAA0B,EAAA;AACzG,QAAA,OAAO,yBAAyB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,OAAyD,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,QAAQ,CAAC;IACjJ;AAEO,IAAA,OAAO,OAAO,CAA8B,OAAmC,EAAE,QAA0B,EAAA;AACjH,QAAA,OAAO,yBAAyB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC;IAClF;IAEO,OAAO,qBAAqB,CAAI,QAA0B,EAAA;QAChE,MAAM,KAAK,GAAgE,yBAAyB,CAAC,OAAO,CAAC,QAAQ,EAAE;AAEvH,QAAA,IAAI,KAAK,EAAE,IAAI,KAAK,MAAM,EAAE;YAC3B,OAAO,QAAQ,EAAE;QAClB;QAEA,OAAO,yBAAyB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,EAAE,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,QAAQ,CAAC;IACvI;;;;;"}
|
|
@@ -12,8 +12,6 @@ export declare class ApiFunctionCustomRuntime {
|
|
|
12
12
|
};
|
|
13
13
|
transactionMode: EApiFunctionTransactionMode;
|
|
14
14
|
}): Promise<unknown>;
|
|
15
|
-
private static createContext;
|
|
16
15
|
private static executeErrorSubscribers;
|
|
17
16
|
private static executeWithEventManager;
|
|
18
|
-
private static resolveEventManager;
|
|
19
17
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiFunctionContextStorage } from './context-storage.class.js';
|
|
2
|
+
import { ApiFunctionServiceContextFactory } from './service-context.factory.class.js';
|
|
2
3
|
import { ApiSubscriberExecutor } from '../subscriber/executor.class.js';
|
|
3
4
|
import '../../../enum/decorator/api/action.enum.js';
|
|
4
5
|
import '../../../enum/decorator/api/authentication-type.enum.js';
|
|
@@ -7,7 +8,7 @@ import '../../../enum/decorator/api/controller/request/target.enum.js';
|
|
|
7
8
|
import '../../../enum/decorator/api/controller/request/transformer-type.enum.js';
|
|
8
9
|
import '../../../enum/decorator/api/controller/response-target.enum.js';
|
|
9
10
|
import '../../../enum/decorator/api/dto-type.enum.js';
|
|
10
|
-
import
|
|
11
|
+
import '../../../enum/decorator/api/function-transaction-mode.enum.js';
|
|
11
12
|
import { EApiFunctionType } from '../../../enum/decorator/api/function-type.enum.js';
|
|
12
13
|
import { EApiSubscriberOnType } from '../../../enum/decorator/api/on-type.enum.js';
|
|
13
14
|
import '../../../enum/decorator/api/property/data-type.enum.js';
|
|
@@ -17,43 +18,21 @@ import '../../../enum/decorator/api/property/desribe-type.enum.js';
|
|
|
17
18
|
import '../../../enum/decorator/api/property/number-type.enum.js';
|
|
18
19
|
import '../../../enum/decorator/api/property/string-type.enum.js';
|
|
19
20
|
import '../../../enum/decorator/api/route-type.enum.js';
|
|
20
|
-
import {
|
|
21
|
+
import { ApiFunctionExecuteWithTransaction } from '../../../utility/api/function-transaction.utility.js';
|
|
21
22
|
|
|
22
23
|
class ApiFunctionCustomRuntime {
|
|
23
24
|
static async execute(options) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
try {
|
|
27
|
-
eventManager = ApiFunctionCustomRuntime.resolveEventManager(options.transactionMode, activeContext);
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
await ApiFunctionCustomRuntime.executeErrorSubscribers(options, undefined, EApiSubscriberOnType.BEFORE_ERROR, error);
|
|
31
|
-
throw error;
|
|
32
|
-
}
|
|
33
|
-
if (options.transactionMode === EApiFunctionTransactionMode.REQUIRED && !eventManager) {
|
|
34
|
-
return await options.target.repository.manager.transaction(async (transactionManager) => await ApiFunctionCustomRuntime.executeWithEventManager({ ...options, eventManager: transactionManager }));
|
|
35
|
-
}
|
|
36
|
-
return await ApiFunctionCustomRuntime.executeWithEventManager({ ...options, eventManager });
|
|
37
|
-
}
|
|
38
|
-
static createContext(options) {
|
|
39
|
-
const repository = options.eventManager?.getRepository(options.properties.entity) ?? options.target.repository;
|
|
40
|
-
return {
|
|
25
|
+
return await ApiFunctionExecuteWithTransaction({
|
|
26
|
+
callback: async (eventManager) => await ApiFunctionCustomRuntime.executeWithEventManager({ ...options, eventManager }),
|
|
41
27
|
entity: options.properties.entity,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
delete: async (criteria) => {
|
|
47
|
-
await options.target.delete(criteria);
|
|
48
|
-
},
|
|
49
|
-
get: async (properties) => await options.target.get(properties),
|
|
50
|
-
getList: async (properties) => await options.target.getList(properties),
|
|
51
|
-
getMany: async (properties) => await options.target.getMany(properties),
|
|
52
|
-
getRepository: (repositoryEntity) => options.eventManager?.getRepository(repositoryEntity) ?? options.target.repository.manager.getRepository(repositoryEntity),
|
|
53
|
-
update: async (criteria, properties) => await options.target.update(criteria, properties),
|
|
28
|
+
label: "ApiFunctionCustom",
|
|
29
|
+
mode: options.transactionMode,
|
|
30
|
+
onPreflightError: async (eventManager, error) => {
|
|
31
|
+
await ApiFunctionCustomRuntime.executeErrorSubscribers(options, eventManager, EApiSubscriberOnType.BEFORE_ERROR, error);
|
|
54
32
|
},
|
|
55
|
-
repository,
|
|
56
|
-
|
|
33
|
+
repository: options.target.repository,
|
|
34
|
+
shouldBindTransactionScope: false,
|
|
35
|
+
});
|
|
57
36
|
}
|
|
58
37
|
static async executeErrorSubscribers(options, eventManager, onType, error) {
|
|
59
38
|
const entityInstance = new options.properties.entity();
|
|
@@ -67,7 +46,11 @@ class ApiFunctionCustomRuntime {
|
|
|
67
46
|
}
|
|
68
47
|
static async executeWithEventManager(options) {
|
|
69
48
|
const entityInstance = new options.properties.entity();
|
|
70
|
-
const context =
|
|
49
|
+
const context = ApiFunctionServiceContextFactory.create({
|
|
50
|
+
entity: options.properties.entity,
|
|
51
|
+
eventManager: options.eventManager,
|
|
52
|
+
target: options.target,
|
|
53
|
+
});
|
|
71
54
|
const executionContext = {
|
|
72
55
|
action: options.properties.action,
|
|
73
56
|
DATA: { eventManager: options.eventManager, repository: options.target.repository },
|
|
@@ -100,15 +83,6 @@ class ApiFunctionCustomRuntime {
|
|
|
100
83
|
throw error;
|
|
101
84
|
}
|
|
102
85
|
}
|
|
103
|
-
static resolveEventManager(transactionMode, activeContext) {
|
|
104
|
-
if (transactionMode === EApiFunctionTransactionMode.NONE && activeContext?.eventManager) {
|
|
105
|
-
throw ErrorException("ApiFunctionCustom transaction mode NONE cannot run inside an active transaction");
|
|
106
|
-
}
|
|
107
|
-
if (transactionMode === EApiFunctionTransactionMode.MANDATORY && !activeContext?.eventManager) {
|
|
108
|
-
throw ErrorException("ApiFunctionCustom transaction mode MANDATORY requires an active transaction");
|
|
109
|
-
}
|
|
110
|
-
return transactionMode === EApiFunctionTransactionMode.NONE ? undefined : activeContext?.eventManager;
|
|
111
|
-
}
|
|
112
86
|
}
|
|
113
87
|
|
|
114
88
|
export { ApiFunctionCustomRuntime };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-runtime.class.js","sources":["../../../../../../src/class/api/function/custom-runtime.class.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"custom-runtime.class.js","sources":["../../../../../../src/class/api/function/custom-runtime.class.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAYa,wBAAwB,CAAA;AAC7B,IAAA,aAAa,OAAO,CAA2B,OAAqP,EAAA;QAC1S,OAAO,MAAM,iCAAiC,CAAC;AAC9C,YAAA,QAAQ,EAAE,OAAO,YAAuC,KAAuB,MAAM,wBAAwB,CAAC,uBAAuB,CAAC,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,CAAC;AACnK,YAAA,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;AACjC,YAAA,KAAK,EAAE,mBAAmB;YAC1B,IAAI,EAAE,OAAO,CAAC,eAAe;AAC7B,YAAA,gBAAgB,EAAE,OAAO,YAAuC,EAAE,KAAY,KAAmB;AAChG,gBAAA,MAAM,wBAAwB,CAAC,uBAAuB,CAAC,OAAO,EAAE,YAAY,EAAE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