tychat-contracts 1.0.125 → 1.0.126
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/dist/notifications/index.d.ts +1 -0
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +3 -1
- package/dist/notifications/list-notifications-query.dto.d.ts +2 -1
- package/dist/notifications/list-notifications-query.dto.d.ts.map +1 -1
- package/dist/notifications/list-notifications-query.dto.js +2 -1
- package/dist/notifications/notifications-find-all-kafka.dto.d.ts +11 -0
- package/dist/notifications/notifications-find-all-kafka.dto.d.ts.map +1 -0
- package/dist/notifications/notifications-find-all-kafka.dto.js +47 -0
- package/dist/notifications/update-notification-viewed.dto.d.ts +1 -0
- package/dist/notifications/update-notification-viewed.dto.d.ts.map +1 -1
- package/dist/notifications/update-notification-viewed.dto.js +5 -0
- package/package.json +1 -1
- package/src/notifications/index.ts +1 -0
- package/src/notifications/list-notifications-query.dto.ts +2 -1
- package/src/notifications/notifications-find-all-kafka.dto.ts +34 -0
- package/src/notifications/update-notification-viewed.dto.ts +3 -0
|
@@ -3,6 +3,7 @@ export { TOPIC_NOTIFICATIONS_FIND_ALL, TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN,
|
|
|
3
3
|
export { AdminBroadcastPushDto } 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
|
+
export { NotificationsFindAllKafkaDto } from './notifications-find-all-kafka.dto';
|
|
6
7
|
export { NotificationListItemDto } from './notification-list-item.dto';
|
|
7
8
|
export { UpdateNotificationViewedDto, NotificationsUpdateViewedKafkaDto, } from './update-notification-viewed.dto';
|
|
8
9
|
//# 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,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,iCAAiC,EACjC,wCAAwC,GACzC,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,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,GAC/C,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,4BAA4B,EAC5B,uCAAuC,EACvC,iCAAiC,EACjC,wCAAwC,GACzC,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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NotificationsUpdateViewedKafkaDto = exports.UpdateNotificationViewedDto = exports.NotificationListItemDto = exports.NOTIFICATION_STATUS_FILTERS = exports.NOTIFICATION_PROVIDER_FILTERS = exports.ListNotificationsQueryDto = exports.NotificationsRegisterPushTokenKafkaDto = exports.RegisterPushTokenDto = exports.AdminBroadcastPushDto = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = exports.TOPIC_NOTIFICATIONS_REGISTER_PUSH_TOKEN = exports.TOPIC_NOTIFICATIONS_FIND_ALL = 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.AdminBroadcastPushDto = exports.EVENT_NOTIFICATIONS_ADMIN_BROADCAST_PUSH = exports.TOPIC_NOTIFICATIONS_UPDATE_VIEWED = 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; } });
|
|
@@ -18,6 +18,8 @@ var list_notifications_query_dto_1 = require("./list-notifications-query.dto");
|
|
|
18
18
|
Object.defineProperty(exports, "ListNotificationsQueryDto", { enumerable: true, get: function () { return list_notifications_query_dto_1.ListNotificationsQueryDto; } });
|
|
19
19
|
Object.defineProperty(exports, "NOTIFICATION_PROVIDER_FILTERS", { enumerable: true, get: function () { return list_notifications_query_dto_1.NOTIFICATION_PROVIDER_FILTERS; } });
|
|
20
20
|
Object.defineProperty(exports, "NOTIFICATION_STATUS_FILTERS", { enumerable: true, get: function () { return list_notifications_query_dto_1.NOTIFICATION_STATUS_FILTERS; } });
|
|
21
|
+
var notifications_find_all_kafka_dto_1 = require("./notifications-find-all-kafka.dto");
|
|
22
|
+
Object.defineProperty(exports, "NotificationsFindAllKafkaDto", { enumerable: true, get: function () { return notifications_find_all_kafka_dto_1.NotificationsFindAllKafkaDto; } });
|
|
21
23
|
var notification_list_item_dto_1 = require("./notification-list-item.dto");
|
|
22
24
|
Object.defineProperty(exports, "NotificationListItemDto", { enumerable: true, get: function () { return notification_list_item_dto_1.NotificationListItemDto; } });
|
|
23
25
|
var update_notification_viewed_dto_1 = require("./update-notification-viewed.dto");
|
|
@@ -3,7 +3,8 @@ export type NotificationProviderFilterDto = (typeof NOTIFICATION_PROVIDER_FILTER
|
|
|
3
3
|
export declare const NOTIFICATION_STATUS_FILTERS: readonly ["pending", "sent", "failed"];
|
|
4
4
|
export type NotificationStatusFilterDto = (typeof NOTIFICATION_STATUS_FILTERS)[number];
|
|
5
5
|
/**
|
|
6
|
-
* Query HTTP +
|
|
6
|
+
* Query HTTP + filhos de `payload` no Kafka `notifications.findAll`.
|
|
7
|
+
* A lista é sempre filtrada pelo `userId` enviado no envelope Kafka (JWT na API).
|
|
7
8
|
*/
|
|
8
9
|
export declare class ListNotificationsQueryDto {
|
|
9
10
|
page?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-notifications-query.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/list-notifications-query.dto.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,6BAA6B,+CAKhC,CAAC;AACX,MAAM,MAAM,6BAA6B,GACvC,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,eAAO,MAAM,2BAA2B,wCAI9B,CAAC;AACX,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"list-notifications-query.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/list-notifications-query.dto.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,6BAA6B,+CAKhC,CAAC;AACX,MAAM,MAAM,6BAA6B,GACvC,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,eAAO,MAAM,2BAA2B,wCAI9B,CAAC;AACX,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C;;;GAGG;AACH,qBAAa,yBAAyB;IAMpC,IAAI,CAAC,EAAE,MAAM,CAAC;IAQd,KAAK,CAAC,EAAE,MAAM,CAAC;IAQf,QAAQ,CAAC,EAAE,6BAA6B,CAAC;IAQzC,MAAM,CAAC,EAAE,2BAA2B,CAAC;IASrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -25,7 +25,8 @@ exports.NOTIFICATION_STATUS_FILTERS = [
|
|
|
25
25
|
'failed',
|
|
26
26
|
];
|
|
27
27
|
/**
|
|
28
|
-
* Query HTTP +
|
|
28
|
+
* Query HTTP + filhos de `payload` no Kafka `notifications.findAll`.
|
|
29
|
+
* A lista é sempre filtrada pelo `userId` enviado no envelope Kafka (JWT na API).
|
|
29
30
|
*/
|
|
30
31
|
class ListNotificationsQueryDto {
|
|
31
32
|
page;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ListNotificationsQueryDto } from './list-notifications-query.dto';
|
|
2
|
+
/**
|
|
3
|
+
* Payload Kafka `notifications.findAll`.
|
|
4
|
+
* O `userId` deve ser o sub do JWT — só esse utilizador vê as suas notificações.
|
|
5
|
+
*/
|
|
6
|
+
export declare class NotificationsFindAllKafkaDto {
|
|
7
|
+
tenant: string;
|
|
8
|
+
userId: string;
|
|
9
|
+
payload?: ListNotificationsQueryDto;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=notifications-find-all-kafka.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications-find-all-kafka.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/notifications-find-all-kafka.dto.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E;;;GAGG;AACH,qBAAa,4BAA4B;IAIvC,MAAM,EAAE,MAAM,CAAC;IAOf,MAAM,EAAE,MAAM,CAAC;IAMf,OAAO,CAAC,EAAE,yBAAyB,CAAC;CACrC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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.NotificationsFindAllKafkaDto = 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
|
+
const list_notifications_query_dto_1 = require("./list-notifications-query.dto");
|
|
17
|
+
/**
|
|
18
|
+
* Payload Kafka `notifications.findAll`.
|
|
19
|
+
* O `userId` deve ser o sub do JWT — só esse utilizador vê as suas notificações.
|
|
20
|
+
*/
|
|
21
|
+
class NotificationsFindAllKafkaDto {
|
|
22
|
+
tenant;
|
|
23
|
+
userId;
|
|
24
|
+
payload;
|
|
25
|
+
}
|
|
26
|
+
exports.NotificationsFindAllKafkaDto = NotificationsFindAllKafkaDto;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, swagger_1.ApiProperty)({ example: 'default' }),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], NotificationsFindAllKafkaDto.prototype, "tenant", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, swagger_1.ApiProperty)({
|
|
35
|
+
description: 'ID do utilizador (ex.: JWT sub). Lista apenas linhas com este user_id.',
|
|
36
|
+
format: 'uuid',
|
|
37
|
+
}),
|
|
38
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], NotificationsFindAllKafkaDto.prototype, "userId", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, swagger_1.ApiPropertyOptional)({ type: list_notifications_query_dto_1.ListNotificationsQueryDto }),
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.ValidateNested)(),
|
|
45
|
+
(0, class_transformer_1.Type)(() => list_notifications_query_dto_1.ListNotificationsQueryDto),
|
|
46
|
+
__metadata("design:type", list_notifications_query_dto_1.ListNotificationsQueryDto)
|
|
47
|
+
], NotificationsFindAllKafkaDto.prototype, "payload", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-notification-viewed.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/update-notification-viewed.dto.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,qBAAa,2BAA2B;IAMtC,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,iCAAiC;IAG5C,MAAM,EAAE,MAAM,CAAC;IAGf,EAAE,EAAE,MAAM,CAAC;IAIX,OAAO,EAAE,2BAA2B,CAAC;CACtC"}
|
|
1
|
+
{"version":3,"file":"update-notification-viewed.dto.d.ts","sourceRoot":"","sources":["../../src/notifications/update-notification-viewed.dto.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,qBAAa,2BAA2B;IAMtC,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,iCAAiC;IAG5C,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAGf,EAAE,EAAE,MAAM,CAAC;IAIX,OAAO,EAAE,2BAA2B,CAAC;CACtC"}
|
|
@@ -33,6 +33,7 @@ __decorate([
|
|
|
33
33
|
*/
|
|
34
34
|
class NotificationsUpdateViewedKafkaDto {
|
|
35
35
|
tenant;
|
|
36
|
+
userId;
|
|
36
37
|
id;
|
|
37
38
|
payload;
|
|
38
39
|
}
|
|
@@ -42,6 +43,10 @@ __decorate([
|
|
|
42
43
|
(0, class_validator_1.IsNotEmpty)(),
|
|
43
44
|
__metadata("design:type", String)
|
|
44
45
|
], NotificationsUpdateViewedKafkaDto.prototype, "tenant", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], NotificationsUpdateViewedKafkaDto.prototype, "userId", void 0);
|
|
45
50
|
__decorate([
|
|
46
51
|
(0, class_validator_1.IsUUID)('4'),
|
|
47
52
|
__metadata("design:type", String)
|
package/package.json
CHANGED
|
@@ -20,6 +20,7 @@ export {
|
|
|
20
20
|
type NotificationProviderFilterDto,
|
|
21
21
|
type NotificationStatusFilterDto,
|
|
22
22
|
} from './list-notifications-query.dto';
|
|
23
|
+
export { NotificationsFindAllKafkaDto } from './notifications-find-all-kafka.dto';
|
|
23
24
|
export { NotificationListItemDto } from './notification-list-item.dto';
|
|
24
25
|
export {
|
|
25
26
|
UpdateNotificationViewedDto,
|
|
@@ -20,7 +20,8 @@ export type NotificationStatusFilterDto =
|
|
|
20
20
|
(typeof NOTIFICATION_STATUS_FILTERS)[number];
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Query HTTP +
|
|
23
|
+
* Query HTTP + filhos de `payload` no Kafka `notifications.findAll`.
|
|
24
|
+
* A lista é sempre filtrada pelo `userId` enviado no envelope Kafka (JWT na API).
|
|
24
25
|
*/
|
|
25
26
|
export class ListNotificationsQueryDto {
|
|
26
27
|
@ApiPropertyOptional({ minimum: 1, default: 1 })
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { Type } from 'class-transformer';
|
|
3
|
+
import {
|
|
4
|
+
IsNotEmpty,
|
|
5
|
+
IsOptional,
|
|
6
|
+
IsString,
|
|
7
|
+
IsUUID,
|
|
8
|
+
ValidateNested,
|
|
9
|
+
} from 'class-validator';
|
|
10
|
+
import { ListNotificationsQueryDto } from './list-notifications-query.dto';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Payload Kafka `notifications.findAll`.
|
|
14
|
+
* O `userId` deve ser o sub do JWT — só esse utilizador vê as suas notificações.
|
|
15
|
+
*/
|
|
16
|
+
export class NotificationsFindAllKafkaDto {
|
|
17
|
+
@ApiProperty({ example: 'default' })
|
|
18
|
+
@IsString()
|
|
19
|
+
@IsNotEmpty()
|
|
20
|
+
tenant: string;
|
|
21
|
+
|
|
22
|
+
@ApiProperty({
|
|
23
|
+
description: 'ID do utilizador (ex.: JWT sub). Lista apenas linhas com este user_id.',
|
|
24
|
+
format: 'uuid',
|
|
25
|
+
})
|
|
26
|
+
@IsUUID('4')
|
|
27
|
+
userId: string;
|
|
28
|
+
|
|
29
|
+
@ApiPropertyOptional({ type: ListNotificationsQueryDto })
|
|
30
|
+
@IsOptional()
|
|
31
|
+
@ValidateNested()
|
|
32
|
+
@Type(() => ListNotificationsQueryDto)
|
|
33
|
+
payload?: ListNotificationsQueryDto;
|
|
34
|
+
}
|