tychat-contracts 1.0.93 → 1.0.95

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,5 +1,6 @@
1
1
  export { NotificationUserCreatedEventPayload, NotificationPasswordResetRequestedEventPayload, } from './notifications-kafka.payloads';
2
- export { TOPIC_NOTIFICATIONS_FIND_ALL } from './notifications-kafka-topics';
2
+ export { TOPIC_NOTIFICATIONS_FIND_ALL, TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN, } from './notifications-kafka-topics';
3
+ export { RegisterPushTokenDto, NotificationsRegisterPushTokenKafkaDto, } from './register-push-token.dto';
3
4
  export { ListNotificationsQueryDto, NOTIFICATION_PROVIDER_FILTERS, NOTIFICATION_STATUS_FILTERS, type NotificationProviderFilterDto, type NotificationStatusFilterDto, } from './list-notifications-query.dto';
4
5
  export { NotificationListItemDto } from './notification-list-item.dto';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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;AACxC,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
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;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,GACxC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,oBAAoB,EACpB,sCAAsC,GACvC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1,11 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotificationListItemDto = exports.NOTIFICATION_STATUS_FILTERS = exports.NOTIFICATION_PROVIDER_FILTERS = exports.ListNotificationsQueryDto = exports.TOPIC_NOTIFICATIONS_FIND_ALL = exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
3
+ exports.NotificationListItemDto = exports.NOTIFICATION_STATUS_FILTERS = exports.NOTIFICATION_PROVIDER_FILTERS = exports.ListNotificationsQueryDto = exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
4
4
  var notifications_kafka_payloads_1 = require("./notifications-kafka.payloads");
5
5
  Object.defineProperty(exports, "NotificationUserCreatedEventPayload", { enumerable: true, get: function () { return notifications_kafka_payloads_1.NotificationUserCreatedEventPayload; } });
6
6
  Object.defineProperty(exports, "NotificationPasswordResetRequestedEventPayload", { enumerable: true, get: function () { return notifications_kafka_payloads_1.NotificationPasswordResetRequestedEventPayload; } });
7
7
  var notifications_kafka_topics_1 = require("./notifications-kafka-topics");
8
8
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_FIND_ALL", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_FIND_ALL; } });
9
+ Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN; } });
10
+ var register_push_token_dto_1 = require("./register-push-token.dto");
11
+ Object.defineProperty(exports, "RegisterPushTokenDto", { enumerable: true, get: function () { return register_push_token_dto_1.RegisterPushTokenDto; } });
12
+ Object.defineProperty(exports, "NotificationsRegisterPushTokenKafkaDto", { enumerable: true, get: function () { return register_push_token_dto_1.NotificationsRegisterPushTokenKafkaDto; } });
9
13
  var list_notifications_query_dto_1 = require("./list-notifications-query.dto");
10
14
  Object.defineProperty(exports, "ListNotificationsQueryDto", { enumerable: true, get: function () { return list_notifications_query_dto_1.ListNotificationsQueryDto; } });
11
15
  Object.defineProperty(exports, "NOTIFICATION_PROVIDER_FILTERS", { enumerable: true, get: function () { return list_notifications_query_dto_1.NOTIFICATION_PROVIDER_FILTERS; } });
@@ -1,3 +1,4 @@
1
1
  /** Kafka request–reply: lista notificações persistidas no banco do tenant. */
2
2
  export declare const TOPIC_NOTIFICATIONS_FIND_ALL = "notifications.findAll";
3
+ export declare const TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = "notifications.registerPushToken";
3
4
  //# sourceMappingURL=notifications-kafka-topics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications-kafka-topics.d.ts","sourceRoot":"","sources":["../../src/notifications/notifications-kafka-topics.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,4BAA4B,0BAA0B,CAAC"}
1
+ {"version":3,"file":"notifications-kafka-topics.d.ts","sourceRoot":"","sources":["../../src/notifications/notifications-kafka-topics.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,4BAA4B,0BAA0B,CAAC;AAEpE,eAAO,MAAM,uCAAuC,oCACjB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TOPIC_NOTIFICATIONS_FIND_ALL = void 0;
3
+ exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = void 0;
4
4
  /** Kafka request–reply: lista notificações persistidas no banco do tenant. */
5
5
  exports.TOPIC_NOTIFICATIONS_FIND_ALL = 'notifications.findAll';
6
+ exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = 'notifications.registerPushToken';
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Corpo HTTP e campo `payload` no RPC Kafka para registrar token FCM do utilizador autenticado.
3
+ */
4
+ export declare class RegisterPushTokenDto {
5
+ token: string;
6
+ }
7
+ /**
8
+ * Payload Kafka `notifications.registerPushToken`.
9
+ */
10
+ export declare class NotificationsRegisterPushTokenKafkaDto {
11
+ tenant: string;
12
+ userId: string;
13
+ payload: RegisterPushTokenDto;
14
+ }
15
+ //# sourceMappingURL=register-push-token.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-push-token.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/register-push-token.dto.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,qBAAa,oBAAoB;IAS/B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,qBAAa,sCAAsC;IAGjD,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAIf,OAAO,EAAE,oBAAoB,CAAC;CAC/B"}
@@ -0,0 +1,56 @@
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.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const class_validator_1 = require("class-validator");
16
+ /**
17
+ * Corpo HTTP e campo `payload` no RPC Kafka para registrar token FCM do utilizador autenticado.
18
+ */
19
+ class RegisterPushTokenDto {
20
+ token;
21
+ }
22
+ exports.RegisterPushTokenDto = RegisterPushTokenDto;
23
+ __decorate([
24
+ (0, swagger_1.ApiProperty)({
25
+ description: 'Token FCM (Firebase Cloud Messaging) do dispositivo',
26
+ example: 'dK3p...',
27
+ maxLength: 4096,
28
+ }),
29
+ (0, class_validator_1.IsString)(),
30
+ (0, class_validator_1.IsNotEmpty)(),
31
+ (0, class_validator_1.MaxLength)(4096),
32
+ __metadata("design:type", String)
33
+ ], RegisterPushTokenDto.prototype, "token", void 0);
34
+ /**
35
+ * Payload Kafka `notifications.registerPushToken`.
36
+ */
37
+ class NotificationsRegisterPushTokenKafkaDto {
38
+ tenant;
39
+ userId;
40
+ payload;
41
+ }
42
+ exports.NotificationsRegisterPushTokenKafkaDto = NotificationsRegisterPushTokenKafkaDto;
43
+ __decorate([
44
+ (0, class_validator_1.IsString)(),
45
+ (0, class_validator_1.IsNotEmpty)(),
46
+ __metadata("design:type", String)
47
+ ], NotificationsRegisterPushTokenKafkaDto.prototype, "tenant", void 0);
48
+ __decorate([
49
+ (0, class_validator_1.IsUUID)('4'),
50
+ __metadata("design:type", String)
51
+ ], NotificationsRegisterPushTokenKafkaDto.prototype, "userId", void 0);
52
+ __decorate([
53
+ (0, class_validator_1.ValidateNested)(),
54
+ (0, class_transformer_1.Type)(() => RegisterPushTokenDto),
55
+ __metadata("design:type", RegisterPushTokenDto)
56
+ ], NotificationsRegisterPushTokenKafkaDto.prototype, "payload", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.93",
3
+ "version": "1.0.95",
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",
@@ -2,7 +2,14 @@ export {
2
2
  NotificationUserCreatedEventPayload,
3
3
  NotificationPasswordResetRequestedEventPayload,
4
4
  } from './notifications-kafka.payloads';
5
- export { TOPIC_NOTIFICATIONS_FIND_ALL } from './notifications-kafka-topics';
5
+ export {
6
+ TOPIC_NOTIFICATIONS_FIND_ALL,
7
+ TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN,
8
+ } from './notifications-kafka-topics';
9
+ export {
10
+ RegisterPushTokenDto,
11
+ NotificationsRegisterPushTokenKafkaDto,
12
+ } from './register-push-token.dto';
6
13
  export {
7
14
  ListNotificationsQueryDto,
8
15
  NOTIFICATION_PROVIDER_FILTERS,
@@ -1,2 +1,5 @@
1
1
  /** Kafka request–reply: lista notificações persistidas no banco do tenant. */
2
2
  export const TOPIC_NOTIFICATIONS_FIND_ALL = 'notifications.findAll';
3
+
4
+ export const TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN =
5
+ 'notifications.registerPushToken';
@@ -0,0 +1,40 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { Type } from 'class-transformer';
3
+ import {
4
+ IsNotEmpty,
5
+ IsString,
6
+ IsUUID,
7
+ MaxLength,
8
+ ValidateNested,
9
+ } from 'class-validator';
10
+
11
+ /**
12
+ * Corpo HTTP e campo `payload` no RPC Kafka para registrar token FCM do utilizador autenticado.
13
+ */
14
+ export class RegisterPushTokenDto {
15
+ @ApiProperty({
16
+ description: 'Token FCM (Firebase Cloud Messaging) do dispositivo',
17
+ example: 'dK3p...',
18
+ maxLength: 4096,
19
+ })
20
+ @IsString()
21
+ @IsNotEmpty()
22
+ @MaxLength(4096)
23
+ token: string;
24
+ }
25
+
26
+ /**
27
+ * Payload Kafka `notifications.registerPushToken`.
28
+ */
29
+ export class NotificationsRegisterPushTokenKafkaDto {
30
+ @IsString()
31
+ @IsNotEmpty()
32
+ tenant: string;
33
+
34
+ @IsUUID('4')
35
+ userId: string;
36
+
37
+ @ValidateNested()
38
+ @Type(() => RegisterPushTokenDto)
39
+ payload: RegisterPushTokenDto;
40
+ }