@builder6/core 0.13.1 → 0.13.3
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.
|
@@ -52,20 +52,33 @@ __decorate([
|
|
|
52
52
|
(0, swagger_1.ApiQuery)({
|
|
53
53
|
name: 'redirect_to',
|
|
54
54
|
required: false,
|
|
55
|
-
description: '
|
|
55
|
+
description: 'The URL to redirect to after successful login',
|
|
56
|
+
}),
|
|
57
|
+
(0, swagger_1.ApiOperation)({
|
|
58
|
+
summary: 'Login with username and password.',
|
|
56
59
|
}),
|
|
57
60
|
(0, swagger_1.ApiBody)({
|
|
61
|
+
description: 'Login with username and password. When a `space_id` is specified, log in to the specified tenant.',
|
|
58
62
|
schema: {
|
|
59
63
|
type: 'object',
|
|
60
64
|
properties: {
|
|
61
65
|
username: { type: 'string' },
|
|
62
66
|
password: { type: 'string' },
|
|
63
|
-
space_id: {
|
|
67
|
+
space_id: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
},
|
|
64
70
|
},
|
|
65
71
|
},
|
|
66
72
|
examples: {
|
|
67
|
-
|
|
68
|
-
summary: '
|
|
73
|
+
login: {
|
|
74
|
+
summary: 'Login with username and password',
|
|
75
|
+
value: {
|
|
76
|
+
username: 'test',
|
|
77
|
+
password: 'test',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
tenantLogin: {
|
|
81
|
+
summary: 'Login with tenant id',
|
|
69
82
|
value: {
|
|
70
83
|
username: 'test',
|
|
71
84
|
password: 'test',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../src/auth/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAWwB;AACxB,iDAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../src/auth/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAWwB;AACxB,iDAA6C;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6
6
|
me(req: Request): Promise<any>;
|
|
7
|
-
meAvatar(req: Request, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
7
|
+
meAvatar(userId: string, req: Request, res: Response): Promise<Response<any, Record<string, any>>>;
|
|
8
8
|
}
|
|
@@ -25,10 +25,10 @@ let UsersController = class UsersController {
|
|
|
25
25
|
const user = req['user'];
|
|
26
26
|
return user;
|
|
27
27
|
}
|
|
28
|
-
async meAvatar(req, res) {
|
|
28
|
+
async meAvatar(userId, req, res) {
|
|
29
29
|
const me = req['user'];
|
|
30
30
|
const space = me.space;
|
|
31
|
-
const user = await this.authService.getSpaceUser(
|
|
31
|
+
const user = await this.authService.getSpaceUser(userId, space);
|
|
32
32
|
if (!user) {
|
|
33
33
|
return res.status(404).json({ message: 'User not found' });
|
|
34
34
|
}
|
|
@@ -66,6 +66,9 @@ let UsersController = class UsersController {
|
|
|
66
66
|
};
|
|
67
67
|
__decorate([
|
|
68
68
|
(0, common_1.Get)('me'),
|
|
69
|
+
(0, swagger_1.ApiOperation)({
|
|
70
|
+
summary: 'Retrieve the current user profile.',
|
|
71
|
+
}),
|
|
69
72
|
__param(0, (0, common_1.Req)()),
|
|
70
73
|
__metadata("design:type", Function),
|
|
71
74
|
__metadata("design:paramtypes", [Object]),
|
|
@@ -73,10 +76,14 @@ __decorate([
|
|
|
73
76
|
], UsersController.prototype, "me", null);
|
|
74
77
|
__decorate([
|
|
75
78
|
(0, common_1.Get)(':userId/avatar'),
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
(0, swagger_1.ApiOperation)({
|
|
80
|
+
summary: 'Retrieve the avatar for a specific user.',
|
|
81
|
+
}),
|
|
82
|
+
__param(0, (0, common_1.Param)('userId')),
|
|
83
|
+
__param(1, (0, common_1.Req)()),
|
|
84
|
+
__param(2, (0, common_1.Res)()),
|
|
78
85
|
__metadata("design:type", Function),
|
|
79
|
-
__metadata("design:paramtypes", [Object, Object]),
|
|
86
|
+
__metadata("design:paramtypes", [String, Object, Object]),
|
|
80
87
|
__metadata("design:returntype", Promise)
|
|
81
88
|
], UsersController.prototype, "meAvatar", null);
|
|
82
89
|
UsersController = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.controller.js","sourceRoot":"","sources":["../../src/auth/users.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"users.controller.js","sourceRoot":"","sources":["../../src/auth/users.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAYwB;AACxB,iDAA6C;AAC7C,6CAKyB;AAEzB,6CAAyC;AAKlC,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAM1C,AAAN,KAAK,CAAC,EAAE,CAAQ,GAAY;QAC1B,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAMK,AAAN,KAAK,CAAC,QAAQ,CACK,MAAc,EACxB,GAAY,EACZ,GAAa;QAEpB,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;QACvB,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC;QACvB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAChE,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC,CAAC;SAC5D;QAED,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;KAqBrB,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,GAAG,CAAC,QAAQ,CAAC,wCAAwC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;SACrE;aAAM,IAAI,IAAI,CAAC,UAAU,EAAE;YAC1B,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAC/B;QAED,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;QACzC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC1B,CAAC;CACF,CAAA;AArDO;IAJL,IAAA,YAAG,EAAC,IAAI,CAAC;IACT,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,oCAAoC;KAC9C,CAAC;IACQ,WAAA,IAAA,YAAG,GAAE,CAAA;;;;yCAGd;AAMK;IAJL,IAAA,YAAG,EAAC,gBAAgB,CAAC;IACrB,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,0CAA0C;KACpD,CAAC;IAEC,WAAA,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAA;IACf,WAAA,IAAA,YAAG,GAAE,CAAA;IACL,WAAA,IAAA,YAAG,GAAE,CAAA;;;;+CAwCP;AA3DU,eAAe;IAH3B,IAAA,uBAAa,GAAE;IACf,IAAA,kBAAS,EAAC,sBAAS,CAAC;IACpB,IAAA,mBAAU,EAAC,cAAc,CAAC;qCAEQ,0BAAW;GADjC,eAAe,CA4D3B;AA5DY,0CAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder6/core",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
],
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@aws-sdk/client-cloudwatch-logs": "^3.721.0",
|
|
11
|
-
"@builder6/query-mongodb": "0.13.
|
|
11
|
+
"@builder6/query-mongodb": "0.13.3",
|
|
12
12
|
"moleculer": "^0.14.35",
|
|
13
13
|
"pino-http": "^10.3.0",
|
|
14
14
|
"pino-pretty": "^13.0.0"
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "08a745b0b9d3b6373d99a8f7e9be99180b494ad9"
|
|
25
25
|
}
|