@social.dev/server-sdk 0.0.1-alpha.30 → 0.0.1-alpha.32
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.
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { UserService } from './user.service';
|
|
2
2
|
import { UserResponseDto } from './dto/user-response.dto';
|
|
3
|
+
import { PaginatedResponseDto } from '~/common/dto/paginated-response.dto';
|
|
3
4
|
export declare class UserController {
|
|
4
5
|
private readonly userService;
|
|
5
6
|
constructor(userService: UserService);
|
|
6
|
-
findAll(): Promise<
|
|
7
|
+
findAll(): Promise<PaginatedResponseDto<UserResponseDto>>;
|
|
7
8
|
findOne(id: string): Promise<UserResponseDto>;
|
|
8
9
|
}
|
|
@@ -19,13 +19,20 @@ const user_service_1 = require("./user.service");
|
|
|
19
19
|
const class_transformer_1 = require("class-transformer");
|
|
20
20
|
const swagger_1 = require("@nestjs/swagger");
|
|
21
21
|
const user_response_dto_1 = require("./dto/user-response.dto");
|
|
22
|
+
const api_paginated_response_1 = require("../common/decorators/api-paginated-response");
|
|
22
23
|
let UserController = class UserController {
|
|
23
24
|
userService;
|
|
24
25
|
constructor(userService) {
|
|
25
26
|
this.userService = userService;
|
|
26
27
|
}
|
|
27
|
-
findAll() {
|
|
28
|
-
|
|
28
|
+
async findAll() {
|
|
29
|
+
const users = await this.userService.findAll();
|
|
30
|
+
return {
|
|
31
|
+
result: users.map((u) => (0, class_transformer_1.plainToInstance)(user_response_dto_1.UserResponseDto, u)),
|
|
32
|
+
count: Infinity,
|
|
33
|
+
next: '',
|
|
34
|
+
previous: '',
|
|
35
|
+
};
|
|
29
36
|
}
|
|
30
37
|
async findOne(id) {
|
|
31
38
|
if (isNaN(id)) {
|
|
@@ -40,11 +47,12 @@ __decorate([
|
|
|
40
47
|
summary: 'Lists users on the network',
|
|
41
48
|
description: 'Returns a list of user entities',
|
|
42
49
|
}),
|
|
50
|
+
(0, api_paginated_response_1.ApiPaginatedResponse)(user_response_dto_1.UserResponseDto),
|
|
43
51
|
(0, common_1.Get)('user.list'),
|
|
44
|
-
openapi.ApiResponse({ status: 200
|
|
52
|
+
openapi.ApiResponse({ status: 200 }),
|
|
45
53
|
__metadata("design:type", Function),
|
|
46
54
|
__metadata("design:paramtypes", []),
|
|
47
|
-
__metadata("design:returntype",
|
|
55
|
+
__metadata("design:returntype", Promise)
|
|
48
56
|
], UserController.prototype, "findAll", null);
|
|
49
57
|
__decorate([
|
|
50
58
|
(0, swagger_1.ApiOperation)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.controller.js","sourceRoot":"","sources":["../../src/user/user.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,iDAA6C;AAI7C,yDAAoD;AAEpD,6CAA+C;AAC/C,+DAA0D;
|
|
1
|
+
{"version":3,"file":"user.controller.js","sourceRoot":"","sources":["../../src/user/user.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,iDAA6C;AAI7C,yDAAoD;AAEpD,6CAA+C;AAC/C,+DAA0D;AAE1D,wFAAkF;AAG3E,IAAM,cAAc,GAApB,MAAM,cAAc;IACI;IAA7B,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAanD,AAAN,KAAK,CAAC,OAAO;QACX,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QAE/C,OAAO;YACL,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,mCAAe,EAAC,mCAAe,EAAE,CAAC,CAAC,CAAC;YAC7D,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,EAAE;YACR,QAAQ,EAAE,EAAE;SACb,CAAC;IACJ,CAAC;IAOK,AAAN,KAAK,CAAC,OAAO,CAAgB,EAAU;QACrC,IAAI,KAAK,CAAC,EAAS,CAAC,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