tychat-contracts 1.6.52 → 1.6.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.
@@ -1,5 +1,5 @@
1
1
  export { NotificationUserCreatedEventPayload, NotificationPasswordResetRequestedEventPayload, NotificationNewDeviceLoginEventPayload, NotificationConversationChangeToHumanEventPayload, NotificationTenantAiTokensThresholdEventPayload, } from './notifications-kafka.payloads';
2
- export { TOPIC_NOTIFICATIONS_FIND_ALL, TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN, TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN, TOPIC_NOTIFICATIONS_UPDATE_VIEWED, TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER, EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH, EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH, EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH, EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD, } from './notifications-kafka-topics';
2
+ export { TOPIC_NOTIFICATIONS_FIND_ALL, TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN, TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN, TOPIC_NOTIFICATIONS_UPDATE_VIEWED, TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED, TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER, EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH, EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH, EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH, EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD, } from './notifications-kafka-topics';
3
3
  export { AdminBroadcastPushDto, ADMIN_NOTIFICATION_KINDS, type AdminNotificationKind, } from './admin-broadcast-push.dto';
4
4
  export { RegisterPushTokenDto, NotificationsRegisterPushTokenKafkaDto, NotificationsUnregisterPushTokenKafkaDto, } from './register-push-token.dto';
5
5
  export { ListNotificationsQueryDto, NOTIFICATION_PROVIDER_FILTERS, NOTIFICATION_STATUS_FILTERS, type NotificationProviderFilterDto, type NotificationStatusFilterDto, } from './list-notifications-query.dto';
@@ -7,4 +7,5 @@ export { NotificationsFindAllKafkaDto } from './notifications-find-all-kafka.dto
7
7
  export { NotificationListItemDto } from './notification-list-item.dto';
8
8
  export { UpdateNotificationViewedDto, NotificationsUpdateViewedKafkaDto, } from './update-notification-viewed.dto';
9
9
  export { NotificationsSendPushToUserKafkaDto } from './notifications-send-push-to-user.dto';
10
+ export { MarkAllNotificationsViewedResultDto, NotificationsMarkAllViewedKafkaDto, } from './mark-all-notifications-viewed.dto';
10
11
  //# 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,EAC9C,sCAAsC,EACtC,iDAAiD,EACjD,+CAA+C,GAChD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,yCAAyC,EACzC,iCAAiC,EACjC,qCAAqC,EACrC,wCAAwC,EACxC,6CAA6C,EAC7C,qDAAqD,EACrD,8CAA8C,GAC/C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,sCAAsC,EACtC,wCAAwC,GACzC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,8CAA8C,EAC9C,sCAAsC,EACtC,iDAAiD,EACjD,+CAA+C,GAChD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,yCAAyC,EACzC,iCAAiC,EACjC,mCAAmC,EACnC,qCAAqC,EACrC,wCAAwC,EACxC,6CAA6C,EAC7C,qDAAqD,EACrD,8CAA8C,GAC/C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,sCAAsC,EACtC,wCAAwC,GACzC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EACL,mCAAmC,EACnC,kCAAkC,GACnC,MAAM,qCAAqC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotificationsSendPushToUserKafkaDto = exports.NotificationsUpdateViewedKafkaDto = exports.UpdateNotificationViewedDto = exports.NotificationListItemDto = exports.NotificationsFindAllKafkaDto = exports.NOTIFICATION_STATUS_FILTERS = exports.NOTIFICATION_PROVIDER_FILTERS = exports.ListNotificationsQueryDto = exports.NotificationsUnregisterPushTokenKafkaDto = exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = exports.ADMIN_NOTIFICATION_KINDS = exports.AdminBroadcastPushDto = exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = exports.EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = exports.NotificationTenantAiTokensThresholdEventPayload = exports.NotificationConversationChangeToHumanEventPayload = exports.NotificationNewDeviceLoginEventPayload = exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
3
+ exports.NotificationsMarkAllViewedKafkaDto = exports.MarkAllNotificationsViewedResultDto = exports.NotificationsSendPushToUserKafkaDto = exports.NotificationsUpdateViewedKafkaDto = exports.UpdateNotificationViewedDto = exports.NotificationListItemDto = exports.NotificationsFindAllKafkaDto = exports.NOTIFICATION_STATUS_FILTERS = exports.NOTIFICATION_PROVIDER_FILTERS = exports.ListNotificationsQueryDto = exports.NotificationsUnregisterPushTokenKafkaDto = exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = exports.ADMIN_NOTIFICATION_KINDS = exports.AdminBroadcastPushDto = exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = exports.EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = exports.TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = exports.NotificationTenantAiTokensThresholdEventPayload = exports.NotificationConversationChangeToHumanEventPayload = exports.NotificationNewDeviceLoginEventPayload = 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; } });
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_FIND_ALL", { enumerable: tru
12
12
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN; } });
13
13
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN; } });
14
14
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_UPDATE_VIEWED", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_UPDATE_VIEWED; } });
15
+ Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED; } });
15
16
  Object.defineProperty(exports, "TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER", { enumerable: true, get: function () { return notifications_kafka_topics_1.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER; } });
16
17
  Object.defineProperty(exports, "EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH", { enumerable: true, get: function () { return notifications_kafka_topics_1.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH; } });
17
18
  Object.defineProperty(exports, "EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH", { enumerable: true, get: function () { return notifications_kafka_topics_1.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH; } });
@@ -37,3 +38,6 @@ Object.defineProperty(exports, "UpdateNotificationViewedDto", { enumerable: true
37
38
  Object.defineProperty(exports, "NotificationsUpdateViewedKafkaDto", { enumerable: true, get: function () { return update_notification_viewed_dto_1.NotificationsUpdateViewedKafkaDto; } });
38
39
  var notifications_send_push_to_user_dto_1 = require("./notifications-send-push-to-user.dto");
39
40
  Object.defineProperty(exports, "NotificationsSendPushToUserKafkaDto", { enumerable: true, get: function () { return notifications_send_push_to_user_dto_1.NotificationsSendPushToUserKafkaDto; } });
41
+ var mark_all_notifications_viewed_dto_1 = require("./mark-all-notifications-viewed.dto");
42
+ Object.defineProperty(exports, "MarkAllNotificationsViewedResultDto", { enumerable: true, get: function () { return mark_all_notifications_viewed_dto_1.MarkAllNotificationsViewedResultDto; } });
43
+ Object.defineProperty(exports, "NotificationsMarkAllViewedKafkaDto", { enumerable: true, get: function () { return mark_all_notifications_viewed_dto_1.NotificationsMarkAllViewedKafkaDto; } });
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Resposta HTTP PUT /notifications/mark-all-viewed e RPC `notifications.markAllViewed`.
3
+ */
4
+ export declare class MarkAllNotificationsViewedResultDto {
5
+ updatedCount: number;
6
+ }
7
+ /**
8
+ * Payload RPC `notifications.markAllViewed` (sem body HTTP — só tenant + utilizador).
9
+ */
10
+ export declare class NotificationsMarkAllViewedKafkaDto {
11
+ tenant: string;
12
+ userId: string;
13
+ }
14
+ //# sourceMappingURL=mark-all-notifications-viewed.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mark-all-notifications-viewed.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/mark-all-notifications-viewed.dto.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,mCAAmC;IAQ9C,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,qBAAa,kCAAkC;IAI7C,MAAM,EAAE,MAAM,CAAC;IAOf,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,53 @@
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.NotificationsMarkAllViewedKafkaDto = exports.MarkAllNotificationsViewedResultDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Resposta HTTP PUT /notifications/mark-all-viewed e RPC `notifications.markAllViewed`.
17
+ */
18
+ class MarkAllNotificationsViewedResultDto {
19
+ updatedCount;
20
+ }
21
+ exports.MarkAllNotificationsViewedResultDto = MarkAllNotificationsViewedResultDto;
22
+ __decorate([
23
+ (0, swagger_1.ApiProperty)({
24
+ description: 'Quantidade de notificações atualizadas (viewed_at preenchido).',
25
+ example: 12,
26
+ minimum: 0,
27
+ }),
28
+ (0, class_validator_1.IsInt)(),
29
+ (0, class_validator_1.Min)(0),
30
+ __metadata("design:type", Number)
31
+ ], MarkAllNotificationsViewedResultDto.prototype, "updatedCount", void 0);
32
+ /**
33
+ * Payload RPC `notifications.markAllViewed` (sem body HTTP — só tenant + utilizador).
34
+ */
35
+ class NotificationsMarkAllViewedKafkaDto {
36
+ tenant;
37
+ userId;
38
+ }
39
+ exports.NotificationsMarkAllViewedKafkaDto = NotificationsMarkAllViewedKafkaDto;
40
+ __decorate([
41
+ (0, swagger_1.ApiProperty)({ example: 'default' }),
42
+ (0, class_validator_1.IsString)(),
43
+ (0, class_validator_1.IsNotEmpty)(),
44
+ __metadata("design:type", String)
45
+ ], NotificationsMarkAllViewedKafkaDto.prototype, "tenant", void 0);
46
+ __decorate([
47
+ (0, swagger_1.ApiProperty)({
48
+ description: 'ID do utilizador (ex.: JWT sub).',
49
+ format: 'uuid',
50
+ }),
51
+ (0, class_validator_1.IsUUID)('4'),
52
+ __metadata("design:type", String)
53
+ ], NotificationsMarkAllViewedKafkaDto.prototype, "userId", void 0);
@@ -4,6 +4,8 @@ export declare const TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = "notifications.re
4
4
  export declare const TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = "notifications.unregisterPushToken";
5
5
  /** Kafka request–reply: atualizar visualização de uma notificação persistida. */
6
6
  export declare const TOPIC_NOTIFICATIONS_UPDATE_VIEWED = "notifications.updateViewed";
7
+ /** Kafka request–reply: marcar todas as notificações não visualizadas do utilizador. */
8
+ export declare const TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED = "notifications.markAllViewed";
7
9
  /** RabbitMQ request–reply: enviar push FCM a um utilizador (serviços internos). */
8
10
  export declare const TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = "notifications.sendPushToUser";
9
11
  /** Kafka event: push FCM em massa (painel administrativo). */
@@ -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;AAEpE,eAAO,MAAM,uCAAuC,oCACjB,CAAC;AAEpC,eAAO,MAAM,yCAAyC,sCACjB,CAAC;AAEtC,iFAAiF;AACjF,eAAO,MAAM,iCAAiC,+BAA+B,CAAC;AAE9E,mFAAmF;AACnF,eAAO,MAAM,qCAAqC,iCAAiC,CAAC;AAEpF,8DAA8D;AAC9D,eAAO,MAAM,wCAAwC,uCACf,CAAC;AAEvC,4FAA4F;AAC5F,eAAO,MAAM,6CAA6C,oDACP,CAAC;AAEpD,2FAA2F;AAC3F,eAAO,MAAM,qDAAqD,oDACf,CAAC;AAEpD,0FAA0F;AAC1F,eAAO,MAAM,8CAA8C,6CACf,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;AAEpC,eAAO,MAAM,yCAAyC,sCACjB,CAAC;AAEtC,iFAAiF;AACjF,eAAO,MAAM,iCAAiC,+BAA+B,CAAC;AAE9E,wFAAwF;AACxF,eAAO,MAAM,mCAAmC,gCAAgC,CAAC;AAEjF,mFAAmF;AACnF,eAAO,MAAM,qCAAqC,iCAAiC,CAAC;AAEpF,8DAA8D;AAC9D,eAAO,MAAM,wCAAwC,uCACf,CAAC;AAEvC,4FAA4F;AAC5F,eAAO,MAAM,6CAA6C,oDACP,CAAC;AAEpD,2FAA2F;AAC3F,eAAO,MAAM,qDAAqD,oDACf,CAAC;AAEpD,0FAA0F;AAC1F,eAAO,MAAM,8CAA8C,6CACf,CAAC"}
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = exports.EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = void 0;
3
+ exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = exports.EVENT_NOTIFICATIONS_HUMAN_ATTENDANT_IDLE_WARNING_PUSH = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = exports.TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = 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
6
  exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = 'notifications.registerPushToken';
7
7
  exports.TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN = 'notifications.unregisterPushToken';
8
8
  /** Kafka request–reply: atualizar visualização de uma notificação persistida. */
9
9
  exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = 'notifications.updateViewed';
10
+ /** Kafka request–reply: marcar todas as notificações não visualizadas do utilizador. */
11
+ exports.TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED = 'notifications.markAllViewed';
10
12
  /** RabbitMQ request–reply: enviar push FCM a um utilizador (serviços internos). */
11
13
  exports.TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = 'notifications.sendPushToUser';
12
14
  /** Kafka event: push FCM em massa (painel administrativo). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.6.52",
3
+ "version": "1.6.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",
@@ -10,6 +10,7 @@ export {
10
10
  TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN,
11
11
  TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN,
12
12
  TOPIC_NOTIFICATIONS_UPDATE_VIEWED,
13
+ TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED,
13
14
  TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER,
14
15
  EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH,
15
16
  EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH,
@@ -40,3 +41,7 @@ export {
40
41
  NotificationsUpdateViewedKafkaDto,
41
42
  } from './update-notification-viewed.dto';
42
43
  export { NotificationsSendPushToUserKafkaDto } from './notifications-send-push-to-user.dto';
44
+ export {
45
+ MarkAllNotificationsViewedResultDto,
46
+ NotificationsMarkAllViewedKafkaDto,
47
+ } from './mark-all-notifications-viewed.dto';
@@ -0,0 +1,33 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsInt, IsNotEmpty, IsString, IsUUID, Min } from 'class-validator';
3
+
4
+ /**
5
+ * Resposta HTTP PUT /notifications/mark-all-viewed e RPC `notifications.markAllViewed`.
6
+ */
7
+ export class MarkAllNotificationsViewedResultDto {
8
+ @ApiProperty({
9
+ description: 'Quantidade de notificações atualizadas (viewed_at preenchido).',
10
+ example: 12,
11
+ minimum: 0,
12
+ })
13
+ @IsInt()
14
+ @Min(0)
15
+ updatedCount: number;
16
+ }
17
+
18
+ /**
19
+ * Payload RPC `notifications.markAllViewed` (sem body HTTP — só tenant + utilizador).
20
+ */
21
+ export class NotificationsMarkAllViewedKafkaDto {
22
+ @ApiProperty({ example: 'default' })
23
+ @IsString()
24
+ @IsNotEmpty()
25
+ tenant: string;
26
+
27
+ @ApiProperty({
28
+ description: 'ID do utilizador (ex.: JWT sub).',
29
+ format: 'uuid',
30
+ })
31
+ @IsUUID('4')
32
+ userId: string;
33
+ }
@@ -10,6 +10,9 @@ export const TOPIC_NOTIFICATIONS_UNREGISTER_PUSH_TOKEN =
10
10
  /** Kafka request–reply: atualizar visualização de uma notificação persistida. */
11
11
  export const TOPIC_NOTIFICATIONS_UPDATE_VIEWED = 'notifications.updateViewed';
12
12
 
13
+ /** Kafka request–reply: marcar todas as notificações não visualizadas do utilizador. */
14
+ export const TOPIC_NOTIFICATIONS_MARK_ALL_VIEWED = 'notifications.markAllViewed';
15
+
13
16
  /** RabbitMQ request–reply: enviar push FCM a um utilizador (serviços internos). */
14
17
  export const TOPIC_NOTIFICATIONS_SEND_PUSH_TO_USER = 'notifications.sendPushToUser';
15
18