@lenne.tech/nest-server 11.33.1 → 11.34.1
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/.claude/rules/testing.md +181 -3
- package/FRAMEWORK-API.md +1 -1
- package/dist/core/common/helpers/gridfs.helper.d.ts +1 -0
- package/dist/core/common/helpers/gridfs.helper.js +43 -5
- package/dist/core/common/helpers/gridfs.helper.js.map +1 -1
- package/dist/core/common/helpers/validation-message.helper.d.ts +3 -0
- package/dist/core/common/helpers/validation-message.helper.js +41 -0
- package/dist/core/common/helpers/validation-message.helper.js.map +1 -0
- package/dist/core/common/pipes/map-and-validate.pipe.js +16 -6
- package/dist/core/common/pipes/map-and-validate.pipe.js.map +1 -1
- package/dist/core/common/services/core-s3.service.d.ts +4 -0
- package/dist/core/common/services/core-s3.service.js +28 -1
- package/dist/core/common/services/core-s3.service.js.map +1 -1
- package/dist/core/modules/file/core-file.service.d.ts +4 -2
- package/dist/core/modules/file/core-file.service.js +46 -47
- package/dist/core/modules/file/core-file.service.js.map +1 -1
- package/dist/core/modules/hub/helpers/hub-client-js.helper.js +12 -1
- package/dist/core/modules/hub/helpers/hub-client-js.helper.js.map +1 -1
- package/dist/core/modules/hub/hub-action-messages.d.ts +1 -0
- package/dist/core/modules/hub/hub-action-messages.js +1 -0
- package/dist/core/modules/hub/hub-action-messages.js.map +1 -1
- package/dist/core/modules/hub/interfaces/hub-panels.interface.d.ts +9 -0
- package/dist/core/modules/hub/services/core-hub-actions.service.d.ts +2 -0
- package/dist/core/modules/hub/services/core-hub-actions.service.js.map +1 -1
- package/dist/core/modules/hub/services/core-hub-db.service.d.ts +10 -2
- package/dist/core/modules/hub/services/core-hub-db.service.js +85 -29
- package/dist/core/modules/hub/services/core-hub-db.service.js.map +1 -1
- package/dist/server/modules/file/file.service.d.ts +2 -1
- package/dist/server/modules/file/file.service.js +2 -2
- package/dist/server/modules/file/file.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/migration-guides/11.23.x-to-11.24.0.md +1 -1
- package/migration-guides/11.32.x-to-11.33.x.md +2 -0
- package/migration-guides/11.33.x-to-11.34.x.md +394 -0
- package/migration-guides/11.34.0-to-11.34.1.md +132 -0
- package/package.json +3 -1
- package/src/core/common/helpers/gridfs.helper.ts +92 -7
- package/src/core/common/helpers/validation-message.helper.ts +83 -0
- package/src/core/common/pipes/map-and-validate.pipe.ts +25 -7
- package/src/core/common/services/core-s3.service.ts +71 -9
- package/src/core/modules/file/README.md +42 -6
- package/src/core/modules/file/core-file.service.ts +131 -59
- package/src/core/modules/hub/README.md +35 -9
- package/src/core/modules/hub/helpers/hub-client-js.helper.ts +12 -1
- package/src/core/modules/hub/hub-action-messages.ts +9 -1
- package/src/core/modules/hub/interfaces/hub-panels.interface.ts +31 -1
- package/src/core/modules/hub/services/core-hub-actions.service.ts +10 -2
- package/src/core/modules/hub/services/core-hub-db.service.ts +155 -31
- package/src/server/modules/file/file.service.ts +20 -3
|
@@ -5,6 +5,7 @@ import { Connection } from 'mongoose';
|
|
|
5
5
|
import { RoleEnum } from '../../../core/common/enums/role.enum';
|
|
6
6
|
import { ConfigService } from '../../../core/common/services/config.service';
|
|
7
7
|
import { CoreS3Service } from '../../../core/common/services/core-s3.service';
|
|
8
|
+
import { CoreFileInfo } from '../../../core/modules/file/core-file-info.model';
|
|
8
9
|
import { CoreFileService, FileInputCheckType } from '../../../core/modules/file/core-file.service';
|
|
9
10
|
import { FileServiceOptions } from '../../../core/modules/file/interfaces/file-service-options.interface';
|
|
10
11
|
|
|
@@ -22,10 +23,26 @@ export class FileService extends CoreFileService {
|
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
|
-
* Duplicate file by name
|
|
26
|
+
* Duplicate file by name.
|
|
27
|
+
*
|
|
28
|
+
* Delegates instead of reaching into `this.files` directly. The direct GridFS
|
|
29
|
+
* pipe this used to be was wrong in four separate ways, and every one of them
|
|
30
|
+
* is the kind of thing a consuming project copies out of here:
|
|
31
|
+
*
|
|
32
|
+
* - it only ever worked on the GridFS driver — under `file.storage: 's3'` or
|
|
33
|
+
* `'filesystem'` the source is simply not in the bucket;
|
|
34
|
+
* - it bypassed `checkRights()` entirely, so the owner rule below did not apply
|
|
35
|
+
* to a duplicate at all;
|
|
36
|
+
* - it returned the write stream without awaiting it, so the caller was told the
|
|
37
|
+
* copy existed while it was still being written;
|
|
38
|
+
* - neither stream carried an error handler, and an unhandled stream `'error'`
|
|
39
|
+
* takes the whole process down.
|
|
40
|
+
*
|
|
41
|
+
* `duplicateByName()` answers all four. Forward the caller's context so the
|
|
42
|
+
* duplicate is COVERED by the ownership rule rather than exempt from it.
|
|
26
43
|
*/
|
|
27
|
-
async duplicate(fileName: string, newName: string): Promise<
|
|
28
|
-
return this.
|
|
44
|
+
async duplicate(fileName: string, newName: string, serviceOptions?: FileServiceOptions): Promise<CoreFileInfo> {
|
|
45
|
+
return this.duplicateByName(fileName, newName, serviceOptions);
|
|
29
46
|
}
|
|
30
47
|
|
|
31
48
|
/**
|