tychat-contracts 1.0.3 → 1.0.5

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.
@@ -0,0 +1,14 @@
1
+ export interface LoginPayload {
2
+ tenant: string;
3
+ username: string;
4
+ password: string;
5
+ }
6
+ export interface ValidatePayload {
7
+ access_token: string;
8
+ tenant?: string;
9
+ }
10
+ export interface RefreshPayload {
11
+ refresh_token: string;
12
+ tenant?: string;
13
+ }
14
+ //# sourceMappingURL=auth-kafka.payloads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-kafka.payloads.d.ts","sourceRoot":"","sources":["../../src/auth/auth-kafka.payloads.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,4 @@
1
1
  export { LoginDto } from './login.dto';
2
+ export { LoginPayload, ValidatePayload, RefreshPayload } from './auth-kafka.payloads';
3
+ export { RefreshTokenDto } from './refresh-token.dto';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -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"}
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,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoginDto = void 0;
3
+ exports.RefreshTokenDto = 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
+ var refresh_token_dto_1 = require("./refresh-token.dto");
7
+ Object.defineProperty(exports, "RefreshTokenDto", { enumerable: true, get: function () { return refresh_token_dto_1.RefreshTokenDto; } });
@@ -0,0 +1,4 @@
1
+ export declare class RefreshTokenDto {
2
+ refresh_token: string;
3
+ }
4
+ //# sourceMappingURL=refresh-token.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refresh-token.dto.d.ts","sourceRoot":"","sources":["../../src/auth/refresh-token.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,eAAe;IAI1B,aAAa,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RefreshTokenDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ class RefreshTokenDto {
16
+ refresh_token;
17
+ }
18
+ exports.RefreshTokenDto = RefreshTokenDto;
19
+ __decorate([
20
+ (0, swagger_1.ApiProperty)({ description: 'Token de refresh JWT', example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' }),
21
+ (0, class_validator_1.IsString)(),
22
+ (0, class_validator_1.MinLength)(1, { message: 'refresh_token não pode ser vazio' }),
23
+ __metadata("design:type", String)
24
+ ], RefreshTokenDto.prototype, "refresh_token", void 0);
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "name": "tychat-contracts",
3
- "version": "1.0.3",
4
- "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "private": false,
8
- "scripts": {
9
- "build": "tsc",
10
- "prepublishOnly": "npm run build"
11
- },
12
- "dependencies": {
13
- "class-validator": "^0.14.1",
14
- "reflect-metadata": "*"
15
- },
16
- "devDependencies": {
17
- "@nestjs/swagger": "^11.2.6",
18
- "typescript": "^5.7.3"
19
- },
20
- "peerDependencies": {
21
- "@nestjs/swagger": "^11.2.6",
22
- "reflect-metadata": "*"
23
- }
24
- }
1
+ {
2
+ "name": "tychat-contracts",
3
+ "version": "1.0.5",
4
+ "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "private": false,
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "prepublishOnly": "npm run build"
11
+ },
12
+ "dependencies": {
13
+ "class-validator": "^0.14.1",
14
+ "reflect-metadata": "*"
15
+ },
16
+ "devDependencies": {
17
+ "@nestjs/swagger": "^11.2.6",
18
+ "typescript": "^5.7.3"
19
+ },
20
+ "peerDependencies": {
21
+ "@nestjs/swagger": "^11.2.6",
22
+ "reflect-metadata": "*"
23
+ }
24
+ }
@@ -0,0 +1,16 @@
1
+ export interface LoginPayload {
2
+ tenant: string;
3
+ username: string;
4
+ password: string;
5
+ }
6
+
7
+ export interface ValidatePayload {
8
+ access_token: string;
9
+ tenant?: string;
10
+ }
11
+
12
+ export interface RefreshPayload {
13
+ refresh_token: string;
14
+ tenant?: string;
15
+ }
16
+
package/src/auth/index.ts CHANGED
@@ -1 +1,3 @@
1
1
  export { LoginDto } from './login.dto';
2
+ export { LoginPayload, ValidatePayload, RefreshPayload } from './auth-kafka.payloads';
3
+ export { RefreshTokenDto } from './refresh-token.dto';
@@ -0,0 +1,10 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsString, MinLength } from 'class-validator';
3
+
4
+ export class RefreshTokenDto {
5
+ @ApiProperty({ description: 'Token de refresh JWT', example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' })
6
+ @IsString()
7
+ @MinLength(1, { message: 'refresh_token não pode ser vazio' })
8
+ refresh_token: string;
9
+ }
10
+