@punks/backend-entity-manager 0.0.80 → 0.0.81
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 +11 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +11 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -21028,7 +21028,7 @@ class TypeOrmRepository {
|
|
|
21028
21028
|
return this.innerRepository;
|
|
21029
21029
|
}
|
|
21030
21030
|
async exists(id) {
|
|
21031
|
-
if (
|
|
21031
|
+
if (backendCore.isNullOrUndefined(id)) {
|
|
21032
21032
|
throw new Error("Invalid 'id' parameter.");
|
|
21033
21033
|
}
|
|
21034
21034
|
return await this.innerRepository.exist({
|
|
@@ -21041,7 +21041,7 @@ class TypeOrmRepository {
|
|
|
21041
21041
|
return await this.innerRepository.exist(condition);
|
|
21042
21042
|
}
|
|
21043
21043
|
async get(id) {
|
|
21044
|
-
if (
|
|
21044
|
+
if (backendCore.isNullOrUndefined(id)) {
|
|
21045
21045
|
throw new Error("Invalid 'id' parameter.");
|
|
21046
21046
|
}
|
|
21047
21047
|
const result = await this.innerRepository.findOne({
|
|
@@ -21070,6 +21070,9 @@ class TypeOrmRepository {
|
|
|
21070
21070
|
});
|
|
21071
21071
|
}
|
|
21072
21072
|
async delete(id) {
|
|
21073
|
+
if (backendCore.isNullOrUndefined(id)) {
|
|
21074
|
+
throw new Error("Invalid 'id' parameter.");
|
|
21075
|
+
}
|
|
21073
21076
|
await this.innerRepository.delete({
|
|
21074
21077
|
id: id,
|
|
21075
21078
|
});
|
|
@@ -21089,6 +21092,9 @@ class TypeOrmRepository {
|
|
|
21089
21092
|
return current;
|
|
21090
21093
|
}
|
|
21091
21094
|
async update(id, entity) {
|
|
21095
|
+
if (backendCore.isNullOrUndefined(id)) {
|
|
21096
|
+
throw new Error("Invalid 'id' parameter.");
|
|
21097
|
+
}
|
|
21092
21098
|
await this.innerRepository.update(id, entity);
|
|
21093
21099
|
const current = await this.get(id);
|
|
21094
21100
|
if (!current) {
|
|
@@ -21101,6 +21107,9 @@ class TypeOrmRepository {
|
|
|
21101
21107
|
return await this.findById(updateResult.generatedMaps.map((x) => x.id));
|
|
21102
21108
|
}
|
|
21103
21109
|
async upsert(id, entity) {
|
|
21110
|
+
if (backendCore.isNullOrUndefined(id)) {
|
|
21111
|
+
throw new Error("Invalid 'id' parameter.");
|
|
21112
|
+
}
|
|
21104
21113
|
if (await this.exists(id)) {
|
|
21105
21114
|
return await this.update(id, entity);
|
|
21106
21115
|
}
|