@punks/backend-entity-manager 0.0.455 → 0.0.457
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 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/files.d.ts +1 -0
- package/dist/cjs/types/abstractions/index.d.ts +1 -1
- package/dist/cjs/types/platforms/nest/services/files/index.d.ts +1 -0
- package/dist/esm/index.js +14 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/files.d.ts +1 -0
- package/dist/esm/types/abstractions/index.d.ts +1 -1
- package/dist/esm/types/platforms/nest/services/files/index.d.ts +1 -0
- package/dist/index.d.ts +3 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -141,6 +141,12 @@ class MissingEntityIdError extends EntityManagerException {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
exports.InvalidEntityHandling = void 0;
|
|
145
|
+
(function (InvalidEntityHandling) {
|
|
146
|
+
InvalidEntityHandling["Skip"] = "skip";
|
|
147
|
+
InvalidEntityHandling["Fail"] = "fail";
|
|
148
|
+
})(exports.InvalidEntityHandling || (exports.InvalidEntityHandling = {}));
|
|
149
|
+
|
|
144
150
|
class LockNotFoundError extends Error {
|
|
145
151
|
}
|
|
146
152
|
class ExclusiveOperationResult {
|
|
@@ -952,12 +958,6 @@ class EntitiesExportCommand {
|
|
|
952
958
|
}
|
|
953
959
|
}
|
|
954
960
|
|
|
955
|
-
var InvalidEntityHandling;
|
|
956
|
-
(function (InvalidEntityHandling) {
|
|
957
|
-
InvalidEntityHandling["Skip"] = "skip";
|
|
958
|
-
InvalidEntityHandling["Fail"] = "fail";
|
|
959
|
-
})(InvalidEntityHandling || (InvalidEntityHandling = {}));
|
|
960
|
-
|
|
961
961
|
class EntitiesImportCommand {
|
|
962
962
|
constructor(services, settings) {
|
|
963
963
|
this.services = services;
|
|
@@ -973,7 +973,7 @@ class EntitiesImportCommand {
|
|
|
973
973
|
const validEntities = importEntities.filter((x) => x.status.isValid);
|
|
974
974
|
const invalidEntities = importEntities.filter((x) => !x.status.isValid);
|
|
975
975
|
if (invalidEntities.length > 0 &&
|
|
976
|
-
input.options?.invalidEntitiesHandling !== InvalidEntityHandling.Skip) {
|
|
976
|
+
input.options?.invalidEntitiesHandling !== exports.InvalidEntityHandling.Skip) {
|
|
977
977
|
throw new Error(`Cannot import file due to invalid entities: ${invalidEntities
|
|
978
978
|
.map((x) => x.id)
|
|
979
979
|
.join(", ")}`);
|
|
@@ -23026,6 +23026,13 @@ exports.FilesManager = class FilesManager {
|
|
|
23026
23026
|
reference: record.reference,
|
|
23027
23027
|
};
|
|
23028
23028
|
}
|
|
23029
|
+
async removeFile(fileId) {
|
|
23030
|
+
const ref = await this.referencesRepo.getReference(fileId);
|
|
23031
|
+
await this.getFileProvider(ref.providerId).deleteFile({
|
|
23032
|
+
reference: ref.reference,
|
|
23033
|
+
});
|
|
23034
|
+
await this.referencesRepo.deleteReference(fileId);
|
|
23035
|
+
}
|
|
23029
23036
|
async getFileContent(fileId) {
|
|
23030
23037
|
const ref = await this.referencesRepo.getReference(fileId);
|
|
23031
23038
|
const content = await this.getFileProvider(ref.providerId).downloadFile({
|