tychat-contracts 1.3.7 → 1.3.8

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,3 +1,5 @@
1
+ export declare const ADMIN_NOTIFICATION_KINDS: readonly ["notification", "alert"];
2
+ export type AdminNotificationKind = (typeof ADMIN_NOTIFICATION_KINDS)[number];
1
3
  /**
2
4
  * Pedido de envio em massa de push (FCM) disparado pelo painel admin.
3
5
  * O tenant-service publica no Kafka; o notifications-service consome e envia.
@@ -9,6 +11,7 @@ export declare class AdminBroadcastPushDto {
9
11
  userIds?: string[];
10
12
  title: string;
11
13
  body: string;
14
+ notificationKind?: AdminNotificationKind;
12
15
  data?: Record<string, string>;
13
16
  }
14
17
  //# sourceMappingURL=admin-broadcast-push.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin-broadcast-push.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/admin-broadcast-push.dto.ts"],"names":[],"mappings":"AAaA;;;GAGG;AACH,qBAAa,qBAAqB;IAGhC,UAAU,EAAG,OAAO,CAAC;IAUrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAIvB,QAAQ,EAAG,OAAO,CAAC;IAUnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAKnB,KAAK,EAAG,MAAM,CAAC;IAKf,IAAI,EAAG,MAAM,CAAC;IASd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B"}
1
+ {"version":3,"file":"admin-broadcast-push.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/admin-broadcast-push.dto.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,wBAAwB,oCAAqC,CAAC;AAC3E,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E;;;GAGG;AACH,qBAAa,qBAAqB;IAGhC,UAAU,EAAG,OAAO,CAAC;IAUrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAIvB,QAAQ,EAAG,OAAO,CAAC;IAUnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAKnB,KAAK,EAAG,MAAM,CAAC;IAKf,IAAI,EAAG,MAAM,CAAC;IAUd,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;IASzC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B"}
@@ -9,9 +9,10 @@ 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.AdminBroadcastPushDto = void 0;
12
+ exports.AdminBroadcastPushDto = exports.ADMIN_NOTIFICATION_KINDS = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
14
  const class_validator_1 = require("class-validator");
15
+ exports.ADMIN_NOTIFICATION_KINDS = ['notification', 'alert'];
15
16
  /**
16
17
  * Pedido de envio em massa de push (FCM) disparado pelo painel admin.
17
18
  * O tenant-service publica no Kafka; o notifications-service consome e envia.
@@ -23,6 +24,7 @@ class AdminBroadcastPushDto {
23
24
  userIds;
24
25
  title;
25
26
  body;
27
+ notificationKind;
26
28
  data;
27
29
  }
28
30
  exports.AdminBroadcastPushDto = AdminBroadcastPushDto;
@@ -70,6 +72,17 @@ __decorate([
70
72
  (0, class_validator_1.MaxLength)(4000),
71
73
  __metadata("design:type", String)
72
74
  ], AdminBroadcastPushDto.prototype, "body", void 0);
75
+ __decorate([
76
+ (0, swagger_1.ApiPropertyOptional)({
77
+ description: 'Categoria de entrega no app (notification = centro; alert = modal no login).',
78
+ enum: exports.ADMIN_NOTIFICATION_KINDS,
79
+ default: 'notification',
80
+ }),
81
+ (0, class_validator_1.IsOptional)(),
82
+ (0, class_validator_1.IsString)(),
83
+ (0, class_validator_1.IsIn)(exports.ADMIN_NOTIFICATION_KINDS),
84
+ __metadata("design:type", String)
85
+ ], AdminBroadcastPushDto.prototype, "notificationKind", void 0);
73
86
  __decorate([
74
87
  (0, swagger_1.ApiPropertyOptional)({
75
88
  description: 'Payload FCM `data` (valores devem ser strings)',
@@ -1,6 +1,6 @@
1
1
  export { NotificationUserCreatedEventPayload, NotificationPasswordResetRequestedEventPayload, NotificationConversationChangeToHumanEventPayload, NotificationTenantAiTokensThresholdEventPayload, } from './notifications-kafka.payloads';
2
2
  export { TOPIC_NOTIFICATIONS_FIND_ALL, TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN, TOPIC_NOTIFICATIONS_UPDATE_VIEWED, EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH, EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH, EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD, } from './notifications-kafka-topics';
3
- export { AdminBroadcastPushDto } from './admin-broadcast-push.dto';
3
+ export { AdminBroadcastPushDto, ADMIN_NOTIFICATION_KINDS, type AdminNotificationKind, } from './admin-broadcast-push.dto';
4
4
  export { RegisterPushTokenDto, NotificationsRegisterPushTokenKafkaDto, } from './register-push-token.dto';
5
5
  export { ListNotificationsQueryDto, NOTIFICATION_PROVIDER_FILTERS, NOTIFICATION_STATUS_FILTERS, type NotificationProviderFilterDto, type NotificationStatusFilterDto, } from './list-notifications-query.dto';
6
6
  export { NotificationsFindAllKafkaDto } from './notifications-find-all-kafka.dto';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,8CAA8C,EAC9C,iDAAiD,EACjD,+CAA+C,GAChD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,iCAAiC,EACjC,wCAAwC,EACxC,6CAA6C,EAC7C,8CAA8C,GAC/C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,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,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mCAAmC,EACnC,8CAA8C,EAC9C,iDAAiD,EACjD,+CAA+C,GAChD,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,iCAAiC,EACjC,wCAAwC,EACxC,6CAA6C,EAC7C,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,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,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,kCAAkC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NotificationsUpdateViewedKafkaDto = exports.UpdateNotificationViewedDto = exports.NotificationListItemDto = exports.NotificationsFindAllKafkaDto = exports.NOTIFICATION_STATUS_FILTERS = exports.NOTIFICATION_PROVIDER_FILTERS = exports.ListNotificationsQueryDto = exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = exports.AdminBroadcastPushDto = exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = exports.NotificationTenantAiTokensThresholdEventPayload = exports.NotificationConversationChangeToHumanEventPayload = exports.NotificationPasswordResetRequestedEventPayload = exports.NotificationUserCreatedEventPayload = void 0;
3
+ exports.NotificationsUpdateViewedKafkaDto = exports.UpdateNotificationViewedDto = exports.NotificationListItemDto = exports.NotificationsFindAllKafkaDto = exports.NOTIFICATION_STATUS_FILTERS = exports.NOTIFICATION_PROVIDER_FILTERS = exports.ListNotificationsQueryDto = exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = exports.ADMIN_NOTIFICATION_KINDS = exports.AdminBroadcastPushDto = exports.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD = exports.EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = exports.NotificationTenantAiTokensThresholdEventPayload = exports.NotificationConversationChangeToHumanEventPayload = 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; } });
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH",
15
15
  Object.defineProperty(exports, "EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD", { enumerable: true, get: function () { return notifications_kafka_topics_1.EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD; } });
16
16
  var admin_broadcast_push_dto_1 = require("./admin-broadcast-push.dto");
17
17
  Object.defineProperty(exports, "AdminBroadcastPushDto", { enumerable: true, get: function () { return admin_broadcast_push_dto_1.AdminBroadcastPushDto; } });
18
+ Object.defineProperty(exports, "ADMIN_NOTIFICATION_KINDS", { enumerable: true, get: function () { return admin_broadcast_push_dto_1.ADMIN_NOTIFICATION_KINDS; } });
18
19
  var register_push_token_dto_1 = require("./register-push-token.dto");
19
20
  Object.defineProperty(exports, "RegisterPushTokenDto", { enumerable: true, get: function () { return register_push_token_dto_1.RegisterPushTokenDto; } });
20
21
  Object.defineProperty(exports, "NotificationsRegisterPushTokenKafkaDto", { enumerable: true, get: function () { return register_push_token_dto_1.NotificationsRegisterPushTokenKafkaDto; } });
@@ -1,9 +1,11 @@
1
+ import { type AdminNotificationKind } from './admin-broadcast-push.dto';
1
2
  /** Item retornado em GET /notifications (e RPC notifications.findAll). */
2
3
  export declare class NotificationListItemDto {
3
4
  id: string;
4
5
  notificationEvent: string;
5
6
  provider: string;
6
7
  status: string;
8
+ kind: AdminNotificationKind;
7
9
  createdAt: string;
8
10
  updatedAt: string;
9
11
  viewed: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"notification-list-item.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/notification-list-item.dto.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,qBAAa,uBAAuB;IAElC,EAAE,EAAE,MAAM,CAAC;IAGX,iBAAiB,EAAE,MAAM,CAAC;IAG1B,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,MAAM,CAAC;IAGf,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;IAMlB,MAAM,EAAE,OAAO,CAAC;IAOhB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAOxB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAOvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAOtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB"}
1
+ {"version":3,"file":"notification-list-item.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/notification-list-item.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAElG,0EAA0E;AAC1E,qBAAa,uBAAuB;IAElC,EAAE,EAAE,MAAM,CAAC;IAGX,iBAAiB,EAAE,MAAM,CAAC;IAG1B,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,MAAM,CAAC;IAOf,IAAI,EAAE,qBAAqB,CAAC;IAG5B,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;IAMlB,MAAM,EAAE,OAAO,CAAC;IAOhB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAOxB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAOvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAOtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB"}
@@ -11,12 +11,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.NotificationListItemDto = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
+ const admin_broadcast_push_dto_1 = require("./admin-broadcast-push.dto");
14
15
  /** Item retornado em GET /notifications (e RPC notifications.findAll). */
15
16
  class NotificationListItemDto {
16
17
  id;
17
18
  notificationEvent;
18
19
  provider;
19
20
  status;
21
+ kind;
20
22
  createdAt;
21
23
  updatedAt;
22
24
  viewed;
@@ -42,6 +44,14 @@ __decorate([
42
44
  (0, swagger_1.ApiProperty)({ enum: ['pending', 'sent', 'failed'] }),
43
45
  __metadata("design:type", String)
44
46
  ], NotificationListItemDto.prototype, "status", void 0);
47
+ __decorate([
48
+ (0, swagger_1.ApiProperty)({
49
+ description: 'Categoria de exibição no app.',
50
+ enum: admin_broadcast_push_dto_1.ADMIN_NOTIFICATION_KINDS,
51
+ default: 'notification',
52
+ }),
53
+ __metadata("design:type", String)
54
+ ], NotificationListItemDto.prototype, "kind", void 0);
45
55
  __decorate([
46
56
  (0, swagger_1.ApiProperty)({ example: '2026-04-08T12:00:00.000Z' }),
47
57
  __metadata("design:type", String)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
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",
@@ -3,6 +3,7 @@ import {
3
3
  ArrayMinSize,
4
4
  IsArray,
5
5
  IsBoolean,
6
+ IsIn,
6
7
  IsObject,
7
8
  IsOptional,
8
9
  IsString,
@@ -11,6 +12,9 @@ import {
11
12
  ValidateIf,
12
13
  } from 'class-validator';
13
14
 
15
+ export const ADMIN_NOTIFICATION_KINDS = ['notification', 'alert'] as const;
16
+ export type AdminNotificationKind = (typeof ADMIN_NOTIFICATION_KINDS)[number];
17
+
14
18
  /**
15
19
  * Pedido de envio em massa de push (FCM) disparado pelo painel admin.
16
20
  * O tenant-service publica no Kafka; o notifications-service consome e envia.
@@ -54,6 +58,16 @@ export class AdminBroadcastPushDto {
54
58
  @MaxLength(4000)
55
59
  body!: string;
56
60
 
61
+ @ApiPropertyOptional({
62
+ description: 'Categoria de entrega no app (notification = centro; alert = modal no login).',
63
+ enum: ADMIN_NOTIFICATION_KINDS,
64
+ default: 'notification',
65
+ })
66
+ @IsOptional()
67
+ @IsString()
68
+ @IsIn(ADMIN_NOTIFICATION_KINDS)
69
+ notificationKind?: AdminNotificationKind;
70
+
57
71
  @ApiPropertyOptional({
58
72
  description: 'Payload FCM `data` (valores devem ser strings)',
59
73
  type: 'object',
@@ -12,7 +12,11 @@ export {
12
12
  EVENT_NOTIFICATIONS_CONVERSATION_HANDOFF_PUSH,
13
13
  EVENT_NOTIFICATIONS_TENANT_AI_TOKENS_THRESHOLD,
14
14
  } from './notifications-kafka-topics';
15
- export { AdminBroadcastPushDto } from './admin-broadcast-push.dto';
15
+ export {
16
+ AdminBroadcastPushDto,
17
+ ADMIN_NOTIFICATION_KINDS,
18
+ type AdminNotificationKind,
19
+ } from './admin-broadcast-push.dto';
16
20
  export {
17
21
  RegisterPushTokenDto,
18
22
  NotificationsRegisterPushTokenKafkaDto,
@@ -1,4 +1,5 @@
1
1
  import { ApiProperty } from '@nestjs/swagger';
2
+ import { ADMIN_NOTIFICATION_KINDS, type AdminNotificationKind } from './admin-broadcast-push.dto';
2
3
 
3
4
  /** Item retornado em GET /notifications (e RPC notifications.findAll). */
4
5
  export class NotificationListItemDto {
@@ -14,6 +15,13 @@ export class NotificationListItemDto {
14
15
  @ApiProperty({ enum: ['pending', 'sent', 'failed'] })
15
16
  status: string;
16
17
 
18
+ @ApiProperty({
19
+ description: 'Categoria de exibição no app.',
20
+ enum: ADMIN_NOTIFICATION_KINDS,
21
+ default: 'notification',
22
+ })
23
+ kind: AdminNotificationKind;
24
+
17
25
  @ApiProperty({ example: '2026-04-08T12:00:00.000Z' })
18
26
  createdAt: string;
19
27