@punks/backend-entity-manager 0.0.291 → 0.0.293
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 +18 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/errors.d.ts +6 -1
- package/dist/cjs/types/types/pipelines.d.ts +1 -0
- package/dist/esm/index.js +18 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/errors.d.ts +6 -1
- package/dist/esm/types/types/pipelines.d.ts +1 -0
- package/dist/index.d.ts +7 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -105,13 +105,19 @@ class EntityOperationUnauthorizedException extends EntityManagerUnauthorizedExce
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
class EntityNotFoundException extends EntityManagerException {
|
|
108
|
-
constructor(
|
|
109
|
-
super(
|
|
110
|
-
|
|
108
|
+
constructor(entityData) {
|
|
109
|
+
super(entityData
|
|
110
|
+
? `Entity ${entityData.type} with id ${entityData.id} not found`
|
|
111
|
+
: "Entity not found");
|
|
112
|
+
this.entityId = entityData.id;
|
|
113
|
+
this.entityType = entityData.type;
|
|
111
114
|
}
|
|
112
115
|
getEntityId() {
|
|
113
116
|
return this.entityId;
|
|
114
117
|
}
|
|
118
|
+
getEntityType() {
|
|
119
|
+
return this.entityType;
|
|
120
|
+
}
|
|
115
121
|
}
|
|
116
122
|
class MultipleEntitiesFoundException extends EntityManagerException {
|
|
117
123
|
constructor() {
|
|
@@ -687,7 +693,10 @@ class EntityDeleteCommand {
|
|
|
687
693
|
}
|
|
688
694
|
const entity = await this.services.resolveRepository().get(id);
|
|
689
695
|
if (entity == null) {
|
|
690
|
-
throw new EntityNotFoundException(
|
|
696
|
+
throw new EntityNotFoundException({
|
|
697
|
+
id,
|
|
698
|
+
type: this.services.getEntityName(),
|
|
699
|
+
});
|
|
691
700
|
}
|
|
692
701
|
const contextService = this.services.resolveAuthenticationContextProvider();
|
|
693
702
|
const context = await contextService?.getContext();
|
|
@@ -912,7 +921,10 @@ class EntityUpdateCommand {
|
|
|
912
921
|
}
|
|
913
922
|
const currentEntity = await this.services.resolveRepository().get(id);
|
|
914
923
|
if (currentEntity == null) {
|
|
915
|
-
throw new EntityNotFoundException(
|
|
924
|
+
throw new EntityNotFoundException({
|
|
925
|
+
id,
|
|
926
|
+
type: this.services.getEntityName(),
|
|
927
|
+
});
|
|
916
928
|
}
|
|
917
929
|
const context = await this.getContext();
|
|
918
930
|
if (!context) {
|
|
@@ -2690,6 +2702,7 @@ exports.PipelineStatus = void 0;
|
|
|
2690
2702
|
|
|
2691
2703
|
const toPipelineOperationError = (error) => ({
|
|
2692
2704
|
message: error.message,
|
|
2705
|
+
stackTrace: error.stack,
|
|
2693
2706
|
exception: error,
|
|
2694
2707
|
});
|
|
2695
2708
|
const getStepOutput = (result) => {
|