tychat-contracts 1.0.126 → 1.0.127

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.
@@ -10,6 +10,11 @@ export declare class ValidatePayload {
10
10
  export declare class RefreshPayload extends RefreshTokenDto {
11
11
  tenant: string;
12
12
  }
13
+ /** Pedido Kafka: perfil do utilizador autenticado (dados atuais na BD do auth-service). */
14
+ export declare class GetProfilePayload {
15
+ tenant: string;
16
+ userId: string;
17
+ }
13
18
  export declare class RequestPasswordResetPayload {
14
19
  tenant: string;
15
20
  email: string;
@@ -1 +1 @@
1
- {"version":3,"file":"auth-kafka.payloads.d.ts","sourceRoot":"","sources":["../../src/auth/auth-kafka.payloads.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,qBAAa,YAAa,SAAQ,QAAQ;IAKxC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,eAAe;IAK1B,MAAM,EAAE,MAAM,CAAC;IAMf,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,cAAe,SAAQ,eAAe;IAKjD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,2BAA2B;IAKtC,MAAM,EAAE,MAAM,CAAC;IAMf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,2BAA2B;IAKtC,MAAM,EAAE,MAAM,CAAC;IAMf,YAAY,EAAE,MAAM,CAAC;IAMrB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
1
+ {"version":3,"file":"auth-kafka.payloads.d.ts","sourceRoot":"","sources":["../../src/auth/auth-kafka.payloads.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,qBAAa,YAAa,SAAQ,QAAQ;IAKxC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,eAAe;IAK1B,MAAM,EAAE,MAAM,CAAC;IAMf,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,cAAe,SAAQ,eAAe;IAKjD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,2FAA2F;AAC3F,qBAAa,iBAAiB;IAK5B,MAAM,EAAE,MAAM,CAAC;IAQf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,2BAA2B;IAKtC,MAAM,EAAE,MAAM,CAAC;IAMf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,2BAA2B;IAKtC,MAAM,EAAE,MAAM,CAAC;IAMf,YAAY,EAAE,MAAM,CAAC;IAMrB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ConfirmPasswordResetPayload = exports.RequestPasswordResetPayload = exports.RefreshPayload = exports.ValidatePayload = exports.LoginPayload = void 0;
12
+ exports.ConfirmPasswordResetPayload = exports.RequestPasswordResetPayload = exports.GetProfilePayload = exports.RefreshPayload = exports.ValidatePayload = exports.LoginPayload = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
15
  const login_dto_1 = require("./login.dto");
@@ -55,6 +55,28 @@ __decorate([
55
55
  (0, class_validator_1.MaxLength)(255),
56
56
  __metadata("design:type", String)
57
57
  ], RefreshPayload.prototype, "tenant", void 0);
58
+ /** Pedido Kafka: perfil do utilizador autenticado (dados atuais na BD do auth-service). */
59
+ class GetProfilePayload {
60
+ tenant;
61
+ userId;
62
+ }
63
+ exports.GetProfilePayload = GetProfilePayload;
64
+ __decorate([
65
+ (0, swagger_1.ApiProperty)({ description: 'ID do tenant', example: 'tenant1' }),
66
+ (0, class_validator_1.IsString)(),
67
+ (0, class_validator_1.MinLength)(1, { message: 'tenant não pode ser vazio' }),
68
+ (0, class_validator_1.MaxLength)(255),
69
+ __metadata("design:type", String)
70
+ ], GetProfilePayload.prototype, "tenant", void 0);
71
+ __decorate([
72
+ (0, swagger_1.ApiProperty)({
73
+ format: 'uuid',
74
+ description: 'ID do utilizador (JWT sub)',
75
+ example: '550e8400-e29b-41d4-a716-446655440000',
76
+ }),
77
+ (0, class_validator_1.IsUUID)('4', { message: 'userId deve ser um UUID válido' }),
78
+ __metadata("design:type", String)
79
+ ], GetProfilePayload.prototype, "userId", void 0);
58
80
  class RequestPasswordResetPayload {
59
81
  tenant;
60
82
  email;
@@ -1,5 +1,5 @@
1
1
  export { LoginDto } from './login.dto';
2
- export { LoginPayload, ValidatePayload, RefreshPayload, RequestPasswordResetPayload, ConfirmPasswordResetPayload, } from './auth-kafka.payloads';
2
+ export { LoginPayload, ValidatePayload, RefreshPayload, GetProfilePayload, RequestPasswordResetPayload, ConfirmPasswordResetPayload, } from './auth-kafka.payloads';
3
3
  export { RefreshTokenDto } from './refresh-token.dto';
4
4
  export { RequestPasswordResetDto } from './request-password-reset.dto';
5
5
  export { ConfirmPasswordResetDto } from './confirm-password-reset.dto';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,cAAc,EACd,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AuthLoginResponseDto = exports.ConfirmPasswordResetDto = exports.RequestPasswordResetDto = exports.RefreshTokenDto = exports.ConfirmPasswordResetPayload = exports.RequestPasswordResetPayload = exports.RefreshPayload = exports.ValidatePayload = exports.LoginPayload = exports.LoginDto = void 0;
3
+ exports.AuthLoginResponseDto = exports.ConfirmPasswordResetDto = exports.RequestPasswordResetDto = exports.RefreshTokenDto = exports.ConfirmPasswordResetPayload = exports.RequestPasswordResetPayload = exports.GetProfilePayload = exports.RefreshPayload = exports.ValidatePayload = exports.LoginPayload = exports.LoginDto = void 0;
4
4
  var login_dto_1 = require("./login.dto");
5
5
  Object.defineProperty(exports, "LoginDto", { enumerable: true, get: function () { return login_dto_1.LoginDto; } });
6
6
  var auth_kafka_payloads_1 = require("./auth-kafka.payloads");
7
7
  Object.defineProperty(exports, "LoginPayload", { enumerable: true, get: function () { return auth_kafka_payloads_1.LoginPayload; } });
8
8
  Object.defineProperty(exports, "ValidatePayload", { enumerable: true, get: function () { return auth_kafka_payloads_1.ValidatePayload; } });
9
9
  Object.defineProperty(exports, "RefreshPayload", { enumerable: true, get: function () { return auth_kafka_payloads_1.RefreshPayload; } });
10
+ Object.defineProperty(exports, "GetProfilePayload", { enumerable: true, get: function () { return auth_kafka_payloads_1.GetProfilePayload; } });
10
11
  Object.defineProperty(exports, "RequestPasswordResetPayload", { enumerable: true, get: function () { return auth_kafka_payloads_1.RequestPasswordResetPayload; } });
11
12
  Object.defineProperty(exports, "ConfirmPasswordResetPayload", { enumerable: true, get: function () { return auth_kafka_payloads_1.ConfirmPasswordResetPayload; } });
12
13
  var refresh_token_dto_1 = require("./refresh-token.dto");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.126",
3
+ "version": "1.0.127",
4
4
  "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,5 @@
1
1
  import { ApiProperty } from '@nestjs/swagger';
2
- import { IsString, MaxLength, MinLength } from 'class-validator';
2
+ import { IsString, IsUUID, MaxLength, MinLength } from 'class-validator';
3
3
  import { LoginDto } from './login.dto';
4
4
  import { RefreshTokenDto } from './refresh-token.dto';
5
5
 
@@ -33,6 +33,23 @@ export class RefreshPayload extends RefreshTokenDto {
33
33
  tenant: string;
34
34
  }
35
35
 
36
+ /** Pedido Kafka: perfil do utilizador autenticado (dados atuais na BD do auth-service). */
37
+ export class GetProfilePayload {
38
+ @ApiProperty({ description: 'ID do tenant', example: 'tenant1' })
39
+ @IsString()
40
+ @MinLength(1, { message: 'tenant não pode ser vazio' })
41
+ @MaxLength(255)
42
+ tenant: string;
43
+
44
+ @ApiProperty({
45
+ format: 'uuid',
46
+ description: 'ID do utilizador (JWT sub)',
47
+ example: '550e8400-e29b-41d4-a716-446655440000',
48
+ })
49
+ @IsUUID('4', { message: 'userId deve ser um UUID válido' })
50
+ userId: string;
51
+ }
52
+
36
53
  export class RequestPasswordResetPayload {
37
54
  @ApiProperty({ description: 'ID do tenant', example: 'tenant1' })
38
55
  @IsString()
package/src/auth/index.ts CHANGED
@@ -3,6 +3,7 @@ export {
3
3
  LoginPayload,
4
4
  ValidatePayload,
5
5
  RefreshPayload,
6
+ GetProfilePayload,
6
7
  RequestPasswordResetPayload,
7
8
  ConfirmPasswordResetPayload,
8
9
  } from './auth-kafka.payloads';