@lenne.tech/nest-server 11.33.0 → 11.34.0
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/config.env.js +6 -0
- package/dist/config.env.js.map +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/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 +47 -48
- 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.controller.js +2 -2
- package/dist/server/modules/file/file.controller.js.map +1 -1
- package/dist/server/modules/file/file.resolver.js +2 -2
- package/dist/server/modules/file/file.resolver.js.map +1 -1
- package/dist/server/modules/file/file.service.d.ts +7 -2
- package/dist/server/modules/file/file.service.js +13 -2
- package/dist/server/modules/file/file.service.js.map +1 -1
- package/dist/server/modules/user/avatar.controller.js +1 -1
- package/dist/server/modules/user/avatar.controller.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/docs/REQUEST-LIFECYCLE.md +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 +39 -4
- package/migration-guides/11.33.x-to-11.34.x.md +394 -0
- package/package.json +3 -1
- package/src/config.env.ts +45 -0
- package/src/core/common/helpers/gridfs.helper.ts +92 -7
- package/src/core/common/services/core-s3.service.ts +71 -9
- package/src/core/modules/file/INTEGRATION-CHECKLIST.md +16 -4
- package/src/core/modules/file/README.md +77 -10
- package/src/core/modules/file/core-file.service.ts +170 -64
- 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.controller.ts +7 -2
- package/src/server/modules/file/file.resolver.ts +6 -2
- package/src/server/modules/file/file.service.ts +97 -34
- package/src/server/modules/user/avatar.controller.ts +8 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.resolver.js","sourceRoot":"","sources":["../../../../src/server/modules/file/file.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,iEAAkE;AAElE,qFAAwE;AACxE,oEAAgE;AAEhE,uDAA6C;AAC7C,iDAA6C;AAOtC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAIQ;IAA/B,YAA+B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAWrD,AAAN,KAAK,CAAC,WAAW,CAAiD,QAAgB;
|
|
1
|
+
{"version":3,"file":"file.resolver.js","sourceRoot":"","sources":["../../../../src/server/modules/file/file.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA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C;IACJ,WAAA,IAAA,cAAI,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAA;;;;8CAG/D;AAOK;IAFL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,0BAAQ,CAAC;IACxB,IAAA,uBAAK,EAAC,oBAAQ,CAAC,KAAK,CAAC;IACJ,WAAA,IAAA,cAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,CAAA;;;;8CAElE;AAOK;IAFL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC;IACvB,IAAA,uBAAK,EAAC,oBAAQ,CAAC,KAAK,CAAC;IACH,WAAA,IAAA,cAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAA;;;;+CAOtE;uBAzDU,YAAY;IAFxB,IAAA,kBAAQ,GAAE;IACV,IAAA,uBAAK,EAAC,oBAAQ,CAAC,KAAK,CAAC;qCAKwB,0BAAW;GAJ5C,YAAY,CA0DxB"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { Connection } from 'mongoose';
|
|
2
2
|
import { ConfigService } from '../../../core/common/services/config.service';
|
|
3
3
|
import { CoreS3Service } from '../../../core/common/services/core-s3.service';
|
|
4
|
-
import {
|
|
4
|
+
import { CoreFileInfo } from '../../../core/modules/file/core-file-info.model';
|
|
5
|
+
import { CoreFileService, FileInputCheckType } from '../../../core/modules/file/core-file.service';
|
|
6
|
+
import { FileServiceOptions } from '../../../core/modules/file/interfaces/file-service-options.interface';
|
|
5
7
|
export declare class FileService extends CoreFileService {
|
|
6
8
|
protected readonly connection: Connection;
|
|
7
9
|
protected readonly configService: ConfigService;
|
|
8
10
|
protected readonly s3Service?: CoreS3Service;
|
|
9
11
|
constructor(connection: Connection, configService: ConfigService, s3Service?: CoreS3Service);
|
|
10
|
-
duplicate(fileName: string, newName: string): Promise<
|
|
12
|
+
duplicate(fileName: string, newName: string, serviceOptions?: FileServiceOptions): Promise<CoreFileInfo>;
|
|
13
|
+
protected checkRights(input: any, options?: FileServiceOptions & {
|
|
14
|
+
checkInputType: FileInputCheckType;
|
|
15
|
+
}): Promise<boolean>;
|
|
11
16
|
}
|
|
@@ -16,6 +16,7 @@ exports.FileService = void 0;
|
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
18
18
|
const mongoose_2 = require("mongoose");
|
|
19
|
+
const role_enum_1 = require("../../../core/common/enums/role.enum");
|
|
19
20
|
const config_service_1 = require("../../../core/common/services/config.service");
|
|
20
21
|
const core_s3_service_1 = require("../../../core/common/services/core-s3.service");
|
|
21
22
|
const core_file_service_1 = require("../../../core/modules/file/core-file.service");
|
|
@@ -29,8 +30,18 @@ let FileService = class FileService extends core_file_service_1.CoreFileService
|
|
|
29
30
|
this.configService = configService;
|
|
30
31
|
this.s3Service = s3Service;
|
|
31
32
|
}
|
|
32
|
-
async duplicate(fileName, newName) {
|
|
33
|
-
return this.
|
|
33
|
+
async duplicate(fileName, newName, serviceOptions) {
|
|
34
|
+
return this.duplicateByName(fileName, newName, serviceOptions);
|
|
35
|
+
}
|
|
36
|
+
async checkRights(input, options) {
|
|
37
|
+
if (options?.force || (options?.checkInputType !== 'filename' && options?.checkInputType !== 'id')) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
if (options.currentUser?.hasRole?.([role_enum_1.RoleEnum.ADMIN])) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
const raw = options.checkInputType === 'id' ? await this.getRawFileInfo(input) : await this.getRawFileInfoByName(input);
|
|
44
|
+
return !!raw?.metadata?.ownerId && String(raw.metadata.ownerId) === String(options.currentUser?.id);
|
|
34
45
|
}
|
|
35
46
|
};
|
|
36
47
|
exports.FileService = FileService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.service.js","sourceRoot":"","sources":["../../../../src/server/modules/file/file.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,+CAAoD;AACpD,uCAAsC;AAEtC,iFAA6E;AAC7E,mFAA8E;
|
|
1
|
+
{"version":3,"file":"file.service.js","sourceRoot":"","sources":["../../../../src/server/modules/file/file.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,+CAAoD;AACpD,uCAAsC;AAEtC,oEAAgE;AAChE,iFAA6E;AAC7E,mFAA8E;AAE9E,oFAAmG;AAO5F,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,mCAAe;IAEI;IAC7B;IACY;IAHjC,YACkD,UAAsB,EACnD,aAA4B,EAChB,SAAyB;QAExD,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC;QAJN,eAAU,GAAV,UAAU,CAAY;QACnD,kBAAa,GAAb,aAAa,CAAe;QAChB,cAAS,GAAT,SAAS,CAAgB;IAG1D,CAAC;IAqBD,KAAK,CAAC,SAAS,CAAC,QAAgB,EAAE,OAAe,EAAE,cAAmC;QACpF,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;IACjE,CAAC;IAuDkB,KAAK,CAAC,WAAW,CAClC,KAAU,EACV,OAAqE;QAGrE,IAAI,OAAO,EAAE,KAAK,IAAI,CAAC,OAAO,EAAE,cAAc,KAAK,UAAU,IAAI,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC,EAAE,CAAC;YACnG,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,OAAO,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC,oBAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YACrD,OAAO,IAAI,CAAC;QACd,CAAC;QAID,MAAM,GAAG,GACP,OAAO,CAAC,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAK9G,OAAO,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACtG,CAAC;CACF,CAAA;AA5GY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,2BAAgB,GAAE,CAAA;IAElB,WAAA,IAAA,iBAAQ,GAAE,CAAA;qCAFiD,qBAAU;QACpC,8BAAa;QACJ,+BAAa;GAJ/C,WAAW,CA4GvB"}
|
|
@@ -40,7 +40,7 @@ let AvatarController = AvatarController_1 = class AvatarController {
|
|
|
40
40
|
const previousAvatar = await this.usersService.setAvatar(stored.id, user);
|
|
41
41
|
if (previousAvatar) {
|
|
42
42
|
try {
|
|
43
|
-
await this.fileService.deleteFile(previousAvatar);
|
|
43
|
+
await this.fileService.deleteFile(previousAvatar, { currentUser: user });
|
|
44
44
|
}
|
|
45
45
|
catch (error) {
|
|
46
46
|
this.logger.warn(`Could not remove previous avatar ${previousAvatar}: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.controller.js","sourceRoot":"","sources":["../../../../src/server/modules/user/avatar.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA6E;AAC7E,8FAAiF;AACjF,+DAA2D;AAE3D,mGAAqF;AACrF,qFAAwE;AACxE,oEAAgE;AAChE,sEAAsE;AACtE,0EAA2G;AAC3G,uDAAmD;AACnD,6CAAoC;AACpC,iDAA6C;AAOtC,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAON;IACA;IAPF,MAAM,GAAG,IAAI,eAAM,CAAC,kBAAgB,CAAC,IAAI,CAAC,CAAC;IAK9D,YACqB,YAAyB,EACzB,WAAwB;QADxB,iBAAY,GAAZ,YAAY,CAAa;QACzB,gBAAW,GAAX,WAAW,CAAa;IAC1C,CAAC;IAiBE,AAAN,KAAK,CAAC,UAAU,CAAiB,IAAyB,EAAiB,IAAU;QAKnF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAA,gCAAkB,EAAC,IAAI,CAAC,EAAE;YACzE,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAA,wBAAY,EAAC,IAAI,CAAC,EAAE,CAAC,EAAE;SAC7C,CAAC,CAAC;QACH,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"avatar.controller.js","sourceRoot":"","sources":["../../../../src/server/modules/user/avatar.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA6E;AAC7E,8FAAiF;AACjF,+DAA2D;AAE3D,mGAAqF;AACrF,qFAAwE;AACxE,oEAAgE;AAChE,sEAAsE;AACtE,0EAA2G;AAC3G,uDAAmD;AACnD,6CAAoC;AACpC,iDAA6C;AAOtC,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAON;IACA;IAPF,MAAM,GAAG,IAAI,eAAM,CAAC,kBAAgB,CAAC,IAAI,CAAC,CAAC;IAK9D,YACqB,YAAyB,EACzB,WAAwB;QADxB,iBAAY,GAAZ,YAAY,CAAa;QACzB,gBAAW,GAAX,WAAW,CAAa;IAC1C,CAAC;IAiBE,AAAN,KAAK,CAAC,UAAU,CAAiB,IAAyB,EAAiB,IAAU;QAKnF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAA,g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