tychat-contracts 1.0.52 → 1.0.53

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/README.md CHANGED
@@ -5,7 +5,7 @@ DTOs compartilhados com **class-validator** usados pela **tychat-api** e pelos m
5
5
  ## Estrutura
6
6
 
7
7
  - **auth**: `LoginDto`, `RefreshTokenDto`, `RequestPasswordResetDto`, `ConfirmPasswordResetDto`, `AuthLoginResponseDto`, payloads Kafka (`LoginPayload`, `RequestPasswordResetPayload`, etc.)
8
- - **users**: `CreateUserDto` (sem password para criação por admin), `UserListItemDto`, `UpdateSelfUserDto`, `UpdateUserByAdminDto`, `UpdatedUserDto`, `ChangeForcePasswordDto`
8
+ - **users**: `CreateUserDto` (sem password para criação por admin), `UserListItemDto`, `UpdateSelfUserDto` (name/email), `UpdateUserByAdminDto` (name/email/role), `UpdatedUserDto`, `ChangeForcePasswordDto`
9
9
  - **professionals**: `ProfessionalProfileDto`, `UpdateProfessionalProfileDto`, `CreateProfessionalWithProfileDto`
10
10
 
11
11
  ## Uso
package/dist/index.d.ts CHANGED
@@ -10,4 +10,5 @@ export * from './payments';
10
10
  export * from './billing';
11
11
  export * from './ai';
12
12
  export * from './storage';
13
+ export * from './notifications';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -26,3 +26,4 @@ __exportStar(require("./payments"), exports);
26
26
  __exportStar(require("./billing"), exports);
27
27
  __exportStar(require("./ai"), exports);
28
28
  __exportStar(require("./storage"), exports);
29
+ __exportStar(require("./notifications"), exports);
@@ -0,0 +1,2 @@
1
+ export { NotificationUserCreatedEventPayload, NotificationPasswordResetRequestedEventPayload, } from './notifications-kafka.payloads';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,8CAA8C,GAC/C,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
4
+ var notifications_kafka_payloads_1 = require("./notifications-kafka.payloads");
5
+ Object.defineProperty(exports, "NotificationUserCreatedEventPayload", { enumerable: true, get: function () { return notifications_kafka_payloads_1.NotificationUserCreatedEventPayload; } });
6
+ Object.defineProperty(exports, "NotificationPasswordResetRequestedEventPayload", { enumerable: true, get: function () { return notifications_kafka_payloads_1.NotificationPasswordResetRequestedEventPayload; } });
@@ -0,0 +1,16 @@
1
+ export declare class NotificationUserCreatedEventPayload {
2
+ eventId: string;
3
+ tenant: string;
4
+ email: string;
5
+ name: string;
6
+ password: string;
7
+ occurredAt: string;
8
+ }
9
+ export declare class NotificationPasswordResetRequestedEventPayload {
10
+ eventId: string;
11
+ tenant: string;
12
+ email: string;
13
+ verifyToken: string;
14
+ occurredAt: string;
15
+ }
16
+ //# sourceMappingURL=notifications-kafka.payloads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications-kafka.payloads.d.ts","sourceRoot":"","sources":["../../src/notifications/notifications-kafka.payloads.ts"],"names":[],"mappings":"AAGA,qBAAa,mCAAmC;IAM9C,OAAO,EAAE,MAAM,CAAC;IAShB,MAAM,EAAE,MAAM,CAAC;IAQf,KAAK,EAAE,MAAM,CAAC;IASd,IAAI,EAAE,MAAM,CAAC;IASb,QAAQ,EAAE,MAAM,CAAC;IAOjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,8CAA8C;IAMzD,OAAO,EAAE,MAAM,CAAC;IAShB,MAAM,EAAE,MAAM,CAAC;IAQf,KAAK,EAAE,MAAM,CAAC;IASd,WAAW,EAAE,MAAM,CAAC;IAOpB,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,131 @@
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.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ class NotificationUserCreatedEventPayload {
16
+ eventId;
17
+ tenant;
18
+ email;
19
+ name;
20
+ password;
21
+ occurredAt;
22
+ }
23
+ exports.NotificationUserCreatedEventPayload = NotificationUserCreatedEventPayload;
24
+ __decorate([
25
+ (0, swagger_1.ApiProperty)({
26
+ description: 'Unique event id used for idempotent processing',
27
+ example: '2d3ecf0d-8d38-4b95-95c8-d3e903e6f1fe',
28
+ }),
29
+ (0, class_validator_1.IsUUID)(),
30
+ __metadata("design:type", String)
31
+ ], NotificationUserCreatedEventPayload.prototype, "eventId", void 0);
32
+ __decorate([
33
+ (0, swagger_1.ApiProperty)({
34
+ description: 'Tenant slug that owns the user',
35
+ example: 'default',
36
+ }),
37
+ (0, class_validator_1.IsString)(),
38
+ (0, class_validator_1.MinLength)(1),
39
+ (0, class_validator_1.MaxLength)(255),
40
+ __metadata("design:type", String)
41
+ ], NotificationUserCreatedEventPayload.prototype, "tenant", void 0);
42
+ __decorate([
43
+ (0, swagger_1.ApiProperty)({
44
+ description: 'Created user email address',
45
+ example: 'maria.silva@example.com',
46
+ }),
47
+ (0, class_validator_1.IsEmail)(),
48
+ (0, class_validator_1.MaxLength)(255),
49
+ __metadata("design:type", String)
50
+ ], NotificationUserCreatedEventPayload.prototype, "email", void 0);
51
+ __decorate([
52
+ (0, swagger_1.ApiProperty)({
53
+ description: 'Created user display name',
54
+ example: 'Maria Silva',
55
+ }),
56
+ (0, class_validator_1.IsString)(),
57
+ (0, class_validator_1.MinLength)(1),
58
+ (0, class_validator_1.MaxLength)(255),
59
+ __metadata("design:type", String)
60
+ ], NotificationUserCreatedEventPayload.prototype, "name", void 0);
61
+ __decorate([
62
+ (0, swagger_1.ApiProperty)({
63
+ description: 'Temporary generated password',
64
+ example: 'tmp-9f2adce',
65
+ }),
66
+ (0, class_validator_1.IsString)(),
67
+ (0, class_validator_1.MinLength)(6),
68
+ (0, class_validator_1.MaxLength)(255),
69
+ __metadata("design:type", String)
70
+ ], NotificationUserCreatedEventPayload.prototype, "password", void 0);
71
+ __decorate([
72
+ (0, swagger_1.ApiProperty)({
73
+ description: 'Timestamp when the event was created',
74
+ example: '2026-03-22T12:30:00.000Z',
75
+ }),
76
+ (0, class_validator_1.IsISO8601)(),
77
+ __metadata("design:type", String)
78
+ ], NotificationUserCreatedEventPayload.prototype, "occurredAt", void 0);
79
+ class NotificationPasswordResetRequestedEventPayload {
80
+ eventId;
81
+ tenant;
82
+ email;
83
+ verifyToken;
84
+ occurredAt;
85
+ }
86
+ exports.NotificationPasswordResetRequestedEventPayload = NotificationPasswordResetRequestedEventPayload;
87
+ __decorate([
88
+ (0, swagger_1.ApiProperty)({
89
+ description: 'Unique event id used for idempotent processing',
90
+ example: 'f5b3790a-1134-4db2-b4e0-ff40ce59d047',
91
+ }),
92
+ (0, class_validator_1.IsUUID)(),
93
+ __metadata("design:type", String)
94
+ ], NotificationPasswordResetRequestedEventPayload.prototype, "eventId", void 0);
95
+ __decorate([
96
+ (0, swagger_1.ApiProperty)({
97
+ description: 'Tenant slug that owns the user',
98
+ example: 'default',
99
+ }),
100
+ (0, class_validator_1.IsString)(),
101
+ (0, class_validator_1.MinLength)(1),
102
+ (0, class_validator_1.MaxLength)(255),
103
+ __metadata("design:type", String)
104
+ ], NotificationPasswordResetRequestedEventPayload.prototype, "tenant", void 0);
105
+ __decorate([
106
+ (0, swagger_1.ApiProperty)({
107
+ description: 'User email that requested password reset',
108
+ example: 'maria.silva@example.com',
109
+ }),
110
+ (0, class_validator_1.IsEmail)(),
111
+ (0, class_validator_1.MaxLength)(255),
112
+ __metadata("design:type", String)
113
+ ], NotificationPasswordResetRequestedEventPayload.prototype, "email", void 0);
114
+ __decorate([
115
+ (0, swagger_1.ApiProperty)({
116
+ description: 'Password reset verification token',
117
+ example: 'a3b5f3c1f3c6ef',
118
+ }),
119
+ (0, class_validator_1.IsString)(),
120
+ (0, class_validator_1.MinLength)(1),
121
+ (0, class_validator_1.MaxLength)(255),
122
+ __metadata("design:type", String)
123
+ ], NotificationPasswordResetRequestedEventPayload.prototype, "verifyToken", void 0);
124
+ __decorate([
125
+ (0, swagger_1.ApiProperty)({
126
+ description: 'Timestamp when the event was created',
127
+ example: '2026-03-22T12:30:00.000Z',
128
+ }),
129
+ (0, class_validator_1.IsISO8601)(),
130
+ __metadata("design:type", String)
131
+ ], NotificationPasswordResetRequestedEventPayload.prototype, "occurredAt", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
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",
package/src/index.ts CHANGED
@@ -10,3 +10,4 @@ export * from './payments';
10
10
  export * from './billing';
11
11
  export * from './ai';
12
12
  export * from './storage';
13
+ export * from './notifications';
@@ -0,0 +1,4 @@
1
+ export {
2
+ NotificationUserCreatedEventPayload,
3
+ NotificationPasswordResetRequestedEventPayload,
4
+ } from './notifications-kafka.payloads';
@@ -0,0 +1,95 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsEmail, IsISO8601, IsString, IsUUID, MaxLength, MinLength } from 'class-validator';
3
+
4
+ export class NotificationUserCreatedEventPayload {
5
+ @ApiProperty({
6
+ description: 'Unique event id used for idempotent processing',
7
+ example: '2d3ecf0d-8d38-4b95-95c8-d3e903e6f1fe',
8
+ })
9
+ @IsUUID()
10
+ eventId: string;
11
+
12
+ @ApiProperty({
13
+ description: 'Tenant slug that owns the user',
14
+ example: 'default',
15
+ })
16
+ @IsString()
17
+ @MinLength(1)
18
+ @MaxLength(255)
19
+ tenant: string;
20
+
21
+ @ApiProperty({
22
+ description: 'Created user email address',
23
+ example: 'maria.silva@example.com',
24
+ })
25
+ @IsEmail()
26
+ @MaxLength(255)
27
+ email: string;
28
+
29
+ @ApiProperty({
30
+ description: 'Created user display name',
31
+ example: 'Maria Silva',
32
+ })
33
+ @IsString()
34
+ @MinLength(1)
35
+ @MaxLength(255)
36
+ name: string;
37
+
38
+ @ApiProperty({
39
+ description: 'Temporary generated password',
40
+ example: 'tmp-9f2adce',
41
+ })
42
+ @IsString()
43
+ @MinLength(6)
44
+ @MaxLength(255)
45
+ password: string;
46
+
47
+ @ApiProperty({
48
+ description: 'Timestamp when the event was created',
49
+ example: '2026-03-22T12:30:00.000Z',
50
+ })
51
+ @IsISO8601()
52
+ occurredAt: string;
53
+ }
54
+
55
+ export class NotificationPasswordResetRequestedEventPayload {
56
+ @ApiProperty({
57
+ description: 'Unique event id used for idempotent processing',
58
+ example: 'f5b3790a-1134-4db2-b4e0-ff40ce59d047',
59
+ })
60
+ @IsUUID()
61
+ eventId: string;
62
+
63
+ @ApiProperty({
64
+ description: 'Tenant slug that owns the user',
65
+ example: 'default',
66
+ })
67
+ @IsString()
68
+ @MinLength(1)
69
+ @MaxLength(255)
70
+ tenant: string;
71
+
72
+ @ApiProperty({
73
+ description: 'User email that requested password reset',
74
+ example: 'maria.silva@example.com',
75
+ })
76
+ @IsEmail()
77
+ @MaxLength(255)
78
+ email: string;
79
+
80
+ @ApiProperty({
81
+ description: 'Password reset verification token',
82
+ example: 'a3b5f3c1f3c6ef',
83
+ })
84
+ @IsString()
85
+ @MinLength(1)
86
+ @MaxLength(255)
87
+ verifyToken: string;
88
+
89
+ @ApiProperty({
90
+ description: 'Timestamp when the event was created',
91
+ example: '2026-03-22T12:30:00.000Z',
92
+ })
93
+ @IsISO8601()
94
+ occurredAt: string;
95
+ }