@punks/backend-entity-manager 0.0.134 → 0.0.136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +14 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/templates/pipelines/instance/index.d.ts +1 -0
- package/dist/esm/index.js +14 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/templates/pipelines/instance/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export declare class PipelineInstance<TPipelineInput, TPipelineOutput, TContext>
|
|
|
5
5
|
private readonly input;
|
|
6
6
|
private readonly context;
|
|
7
7
|
private status;
|
|
8
|
+
private readonly logger;
|
|
8
9
|
constructor(definition: PipelineDefinition<TPipelineInput, TPipelineOutput, TContext>, input: TPipelineInput, context: TContext);
|
|
9
10
|
execute(): Promise<PipelineResult<TPipelineInput, TPipelineOutput>>;
|
|
10
11
|
private buildInitialStepState;
|
package/dist/esm/index.js
CHANGED
|
@@ -1492,7 +1492,7 @@ class EntitiesServiceLocator {
|
|
|
1492
1492
|
this.provider.registerEntityService(EntityServices.Queries.IEntitiesSearchQuery, entityName, instance);
|
|
1493
1493
|
}
|
|
1494
1494
|
resolveFindQuery(entityName) {
|
|
1495
|
-
return this.provider.resolveEntityService(EntityServices.Queries.
|
|
1495
|
+
return this.provider.resolveEntityService(EntityServices.Queries.IEntitiesFindQuery, entityName);
|
|
1496
1496
|
}
|
|
1497
1497
|
registerFindQuery(entityName, instance) {
|
|
1498
1498
|
this.provider.registerEntityService(EntityServices.Queries.IEntitiesFindQuery, entityName, instance);
|
|
@@ -21156,6 +21156,7 @@ class PipelineInstance {
|
|
|
21156
21156
|
this.input = input;
|
|
21157
21157
|
this.context = context;
|
|
21158
21158
|
this.status = PipelineStatus.Initializing;
|
|
21159
|
+
this.logger = Log.getLogger(PipelineInstance.name);
|
|
21159
21160
|
}
|
|
21160
21161
|
async execute() {
|
|
21161
21162
|
this.status = PipelineStatus.Running;
|
|
@@ -21288,6 +21289,9 @@ class PipelineInstance {
|
|
|
21288
21289
|
};
|
|
21289
21290
|
}
|
|
21290
21291
|
catch (error) {
|
|
21292
|
+
this.logger.exception(`Pipeline operation error -> operation:${operation.name}`, error, {
|
|
21293
|
+
input,
|
|
21294
|
+
});
|
|
21291
21295
|
return {
|
|
21292
21296
|
type: "error",
|
|
21293
21297
|
input,
|
|
@@ -21322,6 +21326,11 @@ class PipelineInstance {
|
|
|
21322
21326
|
};
|
|
21323
21327
|
}
|
|
21324
21328
|
catch (error) {
|
|
21329
|
+
this.logger.exception(`Pipeline operation rollback error -> rollbackOperation:${rollbackOperation.name}`, error, {
|
|
21330
|
+
operationInput,
|
|
21331
|
+
operationOutput,
|
|
21332
|
+
state,
|
|
21333
|
+
});
|
|
21325
21334
|
return {
|
|
21326
21335
|
type: "error",
|
|
21327
21336
|
error: toPipelineOperationError(error),
|
|
@@ -22234,7 +22243,7 @@ class TypeOrmRepository {
|
|
|
22234
22243
|
}
|
|
22235
22244
|
async get(id, options) {
|
|
22236
22245
|
if (isNullOrUndefined(id)) {
|
|
22237
|
-
throw new Error("
|
|
22246
|
+
throw new Error("Missing 'id' parameter.");
|
|
22238
22247
|
}
|
|
22239
22248
|
this.logger.debug("Getting entity by id", { id });
|
|
22240
22249
|
const result = await this.innerRepository.findOne({
|
|
@@ -22500,7 +22509,9 @@ class NestPipelineTemplate {
|
|
|
22500
22509
|
const instance = await this.controller.createInstance(this.getDefinition(), data.input, data.context);
|
|
22501
22510
|
const result = await instance.execute();
|
|
22502
22511
|
if (result.type === "error") {
|
|
22503
|
-
this.logger.error(`[ERROR] | ${this.metadata.name} -> ${result.exception
|
|
22512
|
+
this.logger.error(`[ERROR] | ${this.metadata.name} -> ${result.exception
|
|
22513
|
+
? `exception: ${result.exception.name}\n${result.exception.stack}`
|
|
22514
|
+
: ""}`, {
|
|
22504
22515
|
...logMetadata,
|
|
22505
22516
|
result,
|
|
22506
22517
|
});
|