@grupo-argenta/schema-kit-nest 0.0.20 → 0.0.21
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/config/naming-strategy.d.ts +6 -0
- package/config/naming-strategy.js +17 -0
- package/config/redis.constants.d.ts +1 -0
- package/config/redis.constants.js +4 -0
- package/context-logger.service.d.ts +4 -0
- package/context-logger.service.js +23 -0
- package/decorators/date-range.d.ts +4 -0
- package/decorators/date-range.js +17 -0
- package/decorators/encrypted.d.ts +10 -0
- package/decorators/encrypted.js +15 -0
- package/decorators/file-column.d.ts +17 -0
- package/decorators/file-column.js +20 -0
- package/decorators/get-user.decorator.d.ts +6 -0
- package/decorators/get-user.decorator.js +12 -0
- package/decorators/luxon.d.ts +6 -0
- package/decorators/luxon.js +20 -0
- package/decorators/multipart.decorator.d.ts +4 -0
- package/decorators/multipart.decorator.js +51 -0
- package/decorators/post-get.decorator.d.ts +10 -0
- package/decorators/post-get.decorator.js +25 -0
- package/decorators/query-or-body.decorator.d.ts +8 -0
- package/decorators/query-or-body.decorator.js +15 -0
- package/decorators/when.decorator.d.ts +8 -0
- package/decorators/when.decorator.js +16 -0
- package/html/components/badge.d.ts +13 -0
- package/html/components/badge.js +29 -0
- package/html/components/colors.d.ts +11 -0
- package/html/components/colors.js +15 -0
- package/html/components/component.d.ts +11 -0
- package/html/components/component.js +35 -0
- package/html/components/default/default-footer.d.ts +6 -0
- package/html/components/default/default-footer.js +18 -0
- package/html/components/default/default-header.d.ts +13 -0
- package/html/components/default/default-header.js +30 -0
- package/html/components/env-badge.d.ts +7 -0
- package/html/components/env-badge.js +29 -0
- package/html/components/grid.d.ts +17 -0
- package/html/components/grid.js +44 -0
- package/html/components/shell.d.ts +18 -0
- package/html/components/shell.js +423 -0
- package/html/components/table.d.ts +16 -0
- package/html/components/table.js +55 -0
- package/html/components/unordered-list.d.ts +6 -0
- package/html/components/unordered-list.js +21 -0
- package/index.d.ts +49 -0
- package/index.js +65 -0
- package/interfaces/paginated-result.d.ts +21 -0
- package/interfaces/paginated-result.js +12 -0
- package/modules/auth/access-token.d.ts +27 -0
- package/modules/auth/access-token.js +14 -0
- package/modules/auth/known-module.d.ts +45 -0
- package/modules/auth/known-module.js +46 -0
- package/modules/auth/refresh-token.d.ts +18 -0
- package/modules/auth/refresh-token.js +2 -0
- package/modules/auth/token-type.d.ts +4 -0
- package/modules/auth/token-type.js +8 -0
- package/modules/encrypted-column/encrypted-column.module.d.ts +16 -0
- package/modules/encrypted-column/encrypted-column.module.js +35 -0
- package/modules/pubsub/pubsub-dynamic-topic.service.d.ts +77 -0
- package/modules/pubsub/pubsub-dynamic-topic.service.js +324 -0
- package/modules/pubsub/pubsub-redeliver-subscriber.service.d.ts +14 -0
- package/modules/pubsub/pubsub-redeliver-subscriber.service.js +77 -0
- package/modules/pubsub/pubsub-redeliver.service.d.ts +22 -0
- package/modules/pubsub/pubsub-redeliver.service.js +48 -0
- package/modules/pubsub/pubsub.constants.d.ts +2 -0
- package/modules/pubsub/pubsub.constants.js +5 -0
- package/modules/pubsub/pubsub.methods.d.ts +18 -0
- package/modules/pubsub/pubsub.methods.js +18 -0
- package/modules/pubsub/pubsub.methods.redelivery.d.ts +3 -0
- package/modules/pubsub/pubsub.methods.redelivery.js +2 -0
- package/modules/redis/redis.module.d.ts +10 -0
- package/modules/redis/redis.module.js +59 -0
- package/modules/redis/redis.options.d.ts +7 -0
- package/modules/redis/redis.options.js +4 -0
- package/modules/storage/storage.service.d.ts +16 -0
- package/modules/storage/storage.service.js +61 -0
- package/monitoramento/http-request-log/http-request-log.controller.d.ts +184 -0
- package/monitoramento/http-request-log/http-request-log.controller.js +32 -0
- package/monitoramento/http-request-log/http-request-log.dto.d.ts +220 -0
- package/monitoramento/http-request-log/http-request-log.dto.js +42 -0
- package/monitoramento/http-request-log/http-request-log.entity.d.ts +17 -0
- package/monitoramento/http-request-log/http-request-log.entity.js +87 -0
- package/monitoramento/http-request-log/http-request-log.module.d.ts +2 -0
- package/monitoramento/http-request-log/http-request-log.module.js +26 -0
- package/monitoramento/http-request-log/http-request-log.service.d.ts +8 -0
- package/monitoramento/http-request-log/http-request-log.service.js +35 -0
- package/monitoramento/index.d.ts +17 -0
- package/monitoramento/index.js +33 -0
- package/monitoramento/migrations/1792689106394-create_http_request_logs_table.d.ts +5 -0
- package/monitoramento/migrations/1792689106394-create_http_request_logs_table.js +96 -0
- package/monitoramento/migrations/1792689106395-create_pubsub_message_logs_table.d.ts +5 -0
- package/monitoramento/migrations/1792689106395-create_pubsub_message_logs_table.js +157 -0
- package/monitoramento/monitoramento.constants.d.ts +2 -0
- package/monitoramento/monitoramento.constants.js +5 -0
- package/monitoramento/monitoramento.entities.d.ts +1 -0
- package/monitoramento/monitoramento.entities.js +7 -0
- package/monitoramento/monitoramento.module.d.ts +6 -0
- package/monitoramento/monitoramento.module.js +61 -0
- package/monitoramento/monitoramento.options.d.ts +15 -0
- package/monitoramento/monitoramento.options.js +2 -0
- package/monitoramento/outbound-request.interceptor.d.ts +14 -0
- package/monitoramento/outbound-request.interceptor.js +113 -0
- package/monitoramento/pubsub-message-log/pubsub-message-log.controller.d.ts +257 -0
- package/monitoramento/pubsub-message-log/pubsub-message-log.controller.js +34 -0
- package/monitoramento/pubsub-message-log/pubsub-message-log.dto.d.ts +320 -0
- package/monitoramento/pubsub-message-log/pubsub-message-log.dto.js +57 -0
- package/monitoramento/pubsub-message-log/pubsub-message-log.entity.d.ts +44 -0
- package/monitoramento/pubsub-message-log/pubsub-message-log.entity.js +152 -0
- package/monitoramento/pubsub-message-log/pubsub-message-log.module.d.ts +2 -0
- package/monitoramento/pubsub-message-log/pubsub-message-log.module.js +26 -0
- package/monitoramento/pubsub-message-log/pubsub-message-log.service.d.ts +20 -0
- package/monitoramento/pubsub-message-log/pubsub-message-log.service.js +99 -0
- package/monitoramento/pubsub-self-check/pubsub-self-check.controller.d.ts +9 -0
- package/monitoramento/pubsub-self-check/pubsub-self-check.controller.js +45 -0
- package/monitoramento/pubsub-self-check/pubsub-self-check.module.d.ts +11 -0
- package/monitoramento/pubsub-self-check/pubsub-self-check.module.js +41 -0
- package/monitoramento/pubsub-self-check/pubsub-self-check.options.d.ts +10 -0
- package/monitoramento/pubsub-self-check/pubsub-self-check.options.js +4 -0
- package/monitoramento/pubsub-self-check/pubsub-self-check.service.d.ts +68 -0
- package/monitoramento/pubsub-self-check/pubsub-self-check.service.js +213 -0
- package/package.json +1 -1
- package/schema/abstract.entity.d.ts +28 -0
- package/schema/abstract.entity.js +68 -0
- package/schema/schema-builder.d.ts +131 -0
- package/schema/schema-builder.js +162 -0
- package/schema/schema.controller.d.ts +51 -0
- package/schema/schema.controller.js +121 -0
- package/schema/schema.service.d.ts +81 -0
- package/schema/schema.service.js +305 -0
- package/schema/typeorm-extensions.d.ts +6 -0
- package/schema/typeorm-extensions.js +6 -0
- package/schema/zod-extensions/cnpj.validator.d.ts +28 -0
- package/schema/zod-extensions/cnpj.validator.js +133 -0
- package/schema/zod-extensions/cpf-cnpj.validator.d.ts +2 -0
- package/schema/zod-extensions/cpf-cnpj.validator.js +8 -0
- package/schema/zod-extensions/cpf.validator.d.ts +18 -0
- package/schema/zod-extensions/cpf.validator.js +166 -0
- package/schema/zod-extensions.d.ts +50 -0
- package/schema/zod-extensions.js +144 -0
- package/schema-kit.module.d.ts +2 -0
- package/schema-kit.module.js +23 -0
- package/transformers/date-range.transformer.d.ts +6 -0
- package/transformers/date-range.transformer.js +44 -0
- package/transformers/encrypted.transformer.d.ts +11 -0
- package/transformers/encrypted.transformer.js +35 -0
- package/transformers/luxon.transformer.d.ts +3 -0
- package/transformers/luxon.transformer.js +12 -0
- package/utils/utils.d.ts +49 -0
- package/utils/utils.js +79 -0
- package/validators/ip-validator.d.ts +3 -0
- package/validators/ip-validator.js +8 -0
- package/validators/pubsub-delete.validator.d.ts +6 -0
- package/validators/pubsub-delete.validator.js +11 -0
- package/validators/url-validator.d.ts +3 -0
- package/validators/url-validator.js +8 -0
- package/validators/uuid-validator.d.ts +3 -0
- package/validators/uuid-validator.js +8 -0
|
@@ -0,0 +1,61 @@
|
|
|
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.StorageService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const config_1 = require("@nestjs/config");
|
|
15
|
+
const storage_1 = require("@google-cloud/storage");
|
|
16
|
+
const crypto_1 = require("crypto");
|
|
17
|
+
const context_logger_service_1 = require("../../context-logger.service");
|
|
18
|
+
/** Validade das URLs assinadas devolvidas ao front */
|
|
19
|
+
const SIGNED_URL_TTL_MS = 60 * 60 * 1000;
|
|
20
|
+
/**
|
|
21
|
+
* Arquivos no bucket privado do Cloud Storage (`GOOGLE_CLOUD_STORAGE_BUCKET`), autenticado por `GOOGLE_APPLICATION_CREDENTIALS`.
|
|
22
|
+
* O banco guarda o caminho do objeto; o front recebe URLs assinadas de leitura.
|
|
23
|
+
*/
|
|
24
|
+
let StorageService = class StorageService {
|
|
25
|
+
bucket;
|
|
26
|
+
logger;
|
|
27
|
+
constructor(config) {
|
|
28
|
+
this.logger = new context_logger_service_1.ContextLogger();
|
|
29
|
+
if (!config.get('GOOGLE_CLOUD_STORAGE_BUCKET')) {
|
|
30
|
+
this.logger.warn('GOOGLE_CLOUD_STORAGE_BUCKET não configurado. O StorageService não funcionará.');
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.bucket = new storage_1.Storage().bucket(config.getOrThrow('GOOGLE_CLOUD_STORAGE_BUCKET'));
|
|
34
|
+
}
|
|
35
|
+
/** Envia o arquivo para `<prefix>/<uuid>/<nome do arquivo>` e retorna esse caminho */
|
|
36
|
+
async upload(file, prefix) {
|
|
37
|
+
const path = `${prefix}/${(0, crypto_1.randomUUID)()}/${file.name}`;
|
|
38
|
+
await this.bucket.file(path).save(Buffer.from(await file.arrayBuffer()), {
|
|
39
|
+
contentType: file.type || undefined,
|
|
40
|
+
resumable: false,
|
|
41
|
+
});
|
|
42
|
+
return path;
|
|
43
|
+
}
|
|
44
|
+
/** URL de leitura temporária do objeto */
|
|
45
|
+
async signedUrl(path) {
|
|
46
|
+
const [url] = await this.bucket.file(path).getSignedUrl({
|
|
47
|
+
version: 'v4',
|
|
48
|
+
action: 'read',
|
|
49
|
+
expires: Date.now() + SIGNED_URL_TTL_MS,
|
|
50
|
+
});
|
|
51
|
+
return url;
|
|
52
|
+
}
|
|
53
|
+
async delete(path) {
|
|
54
|
+
await this.bucket.file(path).delete({ ignoreNotFound: true });
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
exports.StorageService = StorageService;
|
|
58
|
+
exports.StorageService = StorageService = __decorate([
|
|
59
|
+
(0, common_1.Injectable)(),
|
|
60
|
+
__metadata("design:paramtypes", [config_1.ConfigService])
|
|
61
|
+
], StorageService);
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { HttpRequestLogService } from './http-request-log.service';
|
|
2
|
+
import { HttpRequestLog } from './http-request-log.entity';
|
|
3
|
+
declare const HttpRequestLogController_base: abstract new (_service: import("../..").SchemaService<HttpRequestLog, Omit<{
|
|
4
|
+
url: string;
|
|
5
|
+
method: string;
|
|
6
|
+
requestHeaders?: Record<string, unknown> | null | undefined;
|
|
7
|
+
requestBody?: unknown;
|
|
8
|
+
responseStatus?: number | null | undefined;
|
|
9
|
+
responseHeaders?: Record<string, unknown> | null | undefined;
|
|
10
|
+
responseBody?: unknown;
|
|
11
|
+
startedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | undefined;
|
|
12
|
+
finishedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | null | undefined;
|
|
13
|
+
durationMs?: number | null | undefined;
|
|
14
|
+
errorMessage?: string | null | undefined;
|
|
15
|
+
errorStack?: string | null | undefined;
|
|
16
|
+
uuid?: string | null | undefined;
|
|
17
|
+
}, "uuid"> & {
|
|
18
|
+
uuid?: string;
|
|
19
|
+
}, {
|
|
20
|
+
url?: string | undefined;
|
|
21
|
+
method?: string | undefined;
|
|
22
|
+
requestHeaders?: Record<string, unknown> | null | undefined;
|
|
23
|
+
requestBody?: unknown;
|
|
24
|
+
responseStatus?: number | null | undefined;
|
|
25
|
+
responseHeaders?: Record<string, unknown> | null | undefined;
|
|
26
|
+
responseBody?: unknown;
|
|
27
|
+
startedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | undefined;
|
|
28
|
+
finishedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | null | undefined;
|
|
29
|
+
durationMs?: number | null | undefined;
|
|
30
|
+
errorMessage?: string | null | undefined;
|
|
31
|
+
errorStack?: string | null | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
page: number;
|
|
34
|
+
size: number;
|
|
35
|
+
sort: {
|
|
36
|
+
index: string;
|
|
37
|
+
order: "ASC" | "DESC";
|
|
38
|
+
}[];
|
|
39
|
+
query?: string | undefined;
|
|
40
|
+
lstUuids?: string[] | undefined;
|
|
41
|
+
lstFilter?: {
|
|
42
|
+
value: unknown;
|
|
43
|
+
index: string;
|
|
44
|
+
}[] | undefined;
|
|
45
|
+
}>) => {
|
|
46
|
+
readonly _service: import("../..").SchemaService<HttpRequestLog, Omit<{
|
|
47
|
+
url: string;
|
|
48
|
+
method: string;
|
|
49
|
+
requestHeaders?: Record<string, unknown> | null | undefined;
|
|
50
|
+
requestBody?: unknown;
|
|
51
|
+
responseStatus?: number | null | undefined;
|
|
52
|
+
responseHeaders?: Record<string, unknown> | null | undefined;
|
|
53
|
+
responseBody?: unknown;
|
|
54
|
+
startedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | undefined;
|
|
55
|
+
finishedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | null | undefined;
|
|
56
|
+
durationMs?: number | null | undefined;
|
|
57
|
+
errorMessage?: string | null | undefined;
|
|
58
|
+
errorStack?: string | null | undefined;
|
|
59
|
+
uuid?: string | null | undefined;
|
|
60
|
+
}, "uuid"> & {
|
|
61
|
+
uuid?: string;
|
|
62
|
+
}, {
|
|
63
|
+
url?: string | undefined;
|
|
64
|
+
method?: string | undefined;
|
|
65
|
+
requestHeaders?: Record<string, unknown> | null | undefined;
|
|
66
|
+
requestBody?: unknown;
|
|
67
|
+
responseStatus?: number | null | undefined;
|
|
68
|
+
responseHeaders?: Record<string, unknown> | null | undefined;
|
|
69
|
+
responseBody?: unknown;
|
|
70
|
+
startedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | undefined;
|
|
71
|
+
finishedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | null | undefined;
|
|
72
|
+
durationMs?: number | null | undefined;
|
|
73
|
+
errorMessage?: string | null | undefined;
|
|
74
|
+
errorStack?: string | null | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
page: number;
|
|
77
|
+
size: number;
|
|
78
|
+
sort: {
|
|
79
|
+
index: string;
|
|
80
|
+
order: "ASC" | "DESC";
|
|
81
|
+
}[];
|
|
82
|
+
query?: string | undefined;
|
|
83
|
+
lstUuids?: string[] | undefined;
|
|
84
|
+
lstFilter?: {
|
|
85
|
+
value: unknown;
|
|
86
|
+
index: string;
|
|
87
|
+
}[] | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
beforeRoute(route: import("../../schema/schema.controller").BaseRoute, args: import("../../schema/schema.controller").BeforeRouteArgs<Omit<{
|
|
90
|
+
url: string;
|
|
91
|
+
method: string;
|
|
92
|
+
requestHeaders?: Record<string, unknown> | null | undefined;
|
|
93
|
+
requestBody?: unknown;
|
|
94
|
+
responseStatus?: number | null | undefined;
|
|
95
|
+
responseHeaders?: Record<string, unknown> | null | undefined;
|
|
96
|
+
responseBody?: unknown;
|
|
97
|
+
startedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | undefined;
|
|
98
|
+
finishedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | null | undefined;
|
|
99
|
+
durationMs?: number | null | undefined;
|
|
100
|
+
errorMessage?: string | null | undefined;
|
|
101
|
+
errorStack?: string | null | undefined;
|
|
102
|
+
uuid?: string | null | undefined;
|
|
103
|
+
}, "uuid"> & {
|
|
104
|
+
uuid?: string;
|
|
105
|
+
}, {
|
|
106
|
+
url?: string | undefined;
|
|
107
|
+
method?: string | undefined;
|
|
108
|
+
requestHeaders?: Record<string, unknown> | null | undefined;
|
|
109
|
+
requestBody?: unknown;
|
|
110
|
+
responseStatus?: number | null | undefined;
|
|
111
|
+
responseHeaders?: Record<string, unknown> | null | undefined;
|
|
112
|
+
responseBody?: unknown;
|
|
113
|
+
startedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | undefined;
|
|
114
|
+
finishedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | null | undefined;
|
|
115
|
+
durationMs?: number | null | undefined;
|
|
116
|
+
errorMessage?: string | null | undefined;
|
|
117
|
+
errorStack?: string | null | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
page: number;
|
|
120
|
+
size: number;
|
|
121
|
+
sort: {
|
|
122
|
+
index: string;
|
|
123
|
+
order: "ASC" | "DESC";
|
|
124
|
+
}[];
|
|
125
|
+
query?: string | undefined;
|
|
126
|
+
lstUuids?: string[] | undefined;
|
|
127
|
+
lstFilter?: {
|
|
128
|
+
value: unknown;
|
|
129
|
+
index: string;
|
|
130
|
+
}[] | undefined;
|
|
131
|
+
}>): void | Promise<void>;
|
|
132
|
+
afterRoute<R>(route: import("../../schema/schema.controller").BaseRoute, result: R): R | Promise<R>;
|
|
133
|
+
index(query: {
|
|
134
|
+
page: number;
|
|
135
|
+
size: number;
|
|
136
|
+
sort: {
|
|
137
|
+
index: string;
|
|
138
|
+
order: "ASC" | "DESC";
|
|
139
|
+
}[];
|
|
140
|
+
query?: string | undefined;
|
|
141
|
+
lstUuids?: string[] | undefined;
|
|
142
|
+
lstFilter?: {
|
|
143
|
+
value: unknown;
|
|
144
|
+
index: string;
|
|
145
|
+
}[] | undefined;
|
|
146
|
+
}, req?: import("express").Request): Promise<import("../..").IPaginatedResult<HttpRequestLog>>;
|
|
147
|
+
findOne(uuid: string, req?: import("express").Request): Promise<HttpRequestLog>;
|
|
148
|
+
create(dto: Omit<{
|
|
149
|
+
url: string;
|
|
150
|
+
method: string;
|
|
151
|
+
requestHeaders?: Record<string, unknown> | null | undefined;
|
|
152
|
+
requestBody?: unknown;
|
|
153
|
+
responseStatus?: number | null | undefined;
|
|
154
|
+
responseHeaders?: Record<string, unknown> | null | undefined;
|
|
155
|
+
responseBody?: unknown;
|
|
156
|
+
startedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | undefined;
|
|
157
|
+
finishedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | null | undefined;
|
|
158
|
+
durationMs?: number | null | undefined;
|
|
159
|
+
errorMessage?: string | null | undefined;
|
|
160
|
+
errorStack?: string | null | undefined;
|
|
161
|
+
uuid?: string | null | undefined;
|
|
162
|
+
}, "uuid"> & {
|
|
163
|
+
uuid?: string;
|
|
164
|
+
}, req?: import("express").Request): Promise<HttpRequestLog>;
|
|
165
|
+
patch(uuid: string, dto: {
|
|
166
|
+
url?: string | undefined;
|
|
167
|
+
method?: string | undefined;
|
|
168
|
+
requestHeaders?: Record<string, unknown> | null | undefined;
|
|
169
|
+
requestBody?: unknown;
|
|
170
|
+
responseStatus?: number | null | undefined;
|
|
171
|
+
responseHeaders?: Record<string, unknown> | null | undefined;
|
|
172
|
+
responseBody?: unknown;
|
|
173
|
+
startedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | undefined;
|
|
174
|
+
finishedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | null | undefined;
|
|
175
|
+
durationMs?: number | null | undefined;
|
|
176
|
+
errorMessage?: string | null | undefined;
|
|
177
|
+
errorStack?: string | null | undefined;
|
|
178
|
+
}, req?: import("express").Request): Promise<HttpRequestLog>;
|
|
179
|
+
remove(uuid: string, req?: import("express").Request): Promise<void>;
|
|
180
|
+
};
|
|
181
|
+
export declare class HttpRequestLogController extends HttpRequestLogController_base {
|
|
182
|
+
constructor(httpRequestLogService: HttpRequestLogService);
|
|
183
|
+
}
|
|
184
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
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.HttpRequestLogController = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const schema_controller_1 = require("../../schema/schema.controller");
|
|
15
|
+
const http_request_log_service_1 = require("./http-request-log.service");
|
|
16
|
+
const http_request_log_dto_1 = require("./http-request-log.dto");
|
|
17
|
+
// Logs são gravados pela aplicação (via service); a API expõe apenas consulta
|
|
18
|
+
let HttpRequestLogController = class HttpRequestLogController extends (0, schema_controller_1.SchemaController)({
|
|
19
|
+
createSchema: http_request_log_dto_1.CreateHttpRequestLogSchema,
|
|
20
|
+
patchSchema: http_request_log_dto_1.PatchHttpRequestLogSchema,
|
|
21
|
+
indexParamsSchema: http_request_log_dto_1.IndexHttpRequestLogSchema,
|
|
22
|
+
routes: ['index'],
|
|
23
|
+
}) {
|
|
24
|
+
constructor(httpRequestLogService) {
|
|
25
|
+
super(httpRequestLogService);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.HttpRequestLogController = HttpRequestLogController;
|
|
29
|
+
exports.HttpRequestLogController = HttpRequestLogController = __decorate([
|
|
30
|
+
(0, common_1.Controller)('monitoramento/http-request-log'),
|
|
31
|
+
__metadata("design:paramtypes", [http_request_log_service_1.HttpRequestLogService])
|
|
32
|
+
], HttpRequestLogController);
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { IIndexSchema } from '../../schema/schema-builder';
|
|
2
|
+
import z from 'zod';
|
|
3
|
+
export declare const modelSchemaHttpRequestLog: z.ZodObject<{
|
|
4
|
+
uuid: z.ZodUUID;
|
|
5
|
+
method: z.ZodString;
|
|
6
|
+
url: z.ZodString;
|
|
7
|
+
requestHeaders: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
8
|
+
requestBody: z.ZodOptional<z.ZodUnknown>;
|
|
9
|
+
responseStatus: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
10
|
+
responseHeaders: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
11
|
+
responseBody: z.ZodOptional<z.ZodUnknown>;
|
|
12
|
+
startedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>;
|
|
13
|
+
finishedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>>;
|
|
14
|
+
durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
15
|
+
errorMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
errorStack: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export declare const indexSchemaHttpRequestLog: IIndexSchema;
|
|
19
|
+
declare const createValidator: z.ZodPipe<z.ZodObject<{
|
|
20
|
+
url: z.ZodString;
|
|
21
|
+
method: z.ZodString;
|
|
22
|
+
requestHeaders: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
23
|
+
requestBody: z.ZodOptional<z.ZodUnknown>;
|
|
24
|
+
responseStatus: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
25
|
+
responseHeaders: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
26
|
+
responseBody: z.ZodOptional<z.ZodUnknown>;
|
|
27
|
+
startedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>;
|
|
28
|
+
finishedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>>;
|
|
29
|
+
durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
30
|
+
errorMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
errorStack: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
uuid: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
33
|
+
}, z.core.$strip>, z.ZodTransform<Omit<{
|
|
34
|
+
url: string;
|
|
35
|
+
method: string;
|
|
36
|
+
requestHeaders?: Record<string, unknown> | null | undefined;
|
|
37
|
+
requestBody?: unknown;
|
|
38
|
+
responseStatus?: number | null | undefined;
|
|
39
|
+
responseHeaders?: Record<string, unknown> | null | undefined;
|
|
40
|
+
responseBody?: unknown;
|
|
41
|
+
startedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | undefined;
|
|
42
|
+
finishedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | null | undefined;
|
|
43
|
+
durationMs?: number | null | undefined;
|
|
44
|
+
errorMessage?: string | null | undefined;
|
|
45
|
+
errorStack?: string | null | undefined;
|
|
46
|
+
uuid?: string | null | undefined;
|
|
47
|
+
}, "uuid"> & {
|
|
48
|
+
uuid?: string;
|
|
49
|
+
}, {
|
|
50
|
+
url: string;
|
|
51
|
+
method: string;
|
|
52
|
+
requestHeaders?: Record<string, unknown> | null | undefined;
|
|
53
|
+
requestBody?: unknown;
|
|
54
|
+
responseStatus?: number | null | undefined;
|
|
55
|
+
responseHeaders?: Record<string, unknown> | null | undefined;
|
|
56
|
+
responseBody?: unknown;
|
|
57
|
+
startedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | undefined;
|
|
58
|
+
finishedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | null | undefined;
|
|
59
|
+
durationMs?: number | null | undefined;
|
|
60
|
+
errorMessage?: string | null | undefined;
|
|
61
|
+
errorStack?: string | null | undefined;
|
|
62
|
+
uuid?: string | null | undefined;
|
|
63
|
+
}>>, saveValidator: z.ZodObject<{
|
|
64
|
+
method: z.ZodString;
|
|
65
|
+
url: z.ZodString;
|
|
66
|
+
requestHeaders: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
67
|
+
requestBody: z.ZodOptional<z.ZodUnknown>;
|
|
68
|
+
responseStatus: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
69
|
+
responseHeaders: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
70
|
+
responseBody: z.ZodOptional<z.ZodUnknown>;
|
|
71
|
+
startedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>;
|
|
72
|
+
finishedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>>;
|
|
73
|
+
durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
74
|
+
errorMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
errorStack: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
|
+
uuid: z.ZodUUID;
|
|
77
|
+
}, z.core.$strip>, patchValidator: z.ZodObject<{
|
|
78
|
+
url: z.ZodOptional<z.ZodString>;
|
|
79
|
+
method: z.ZodOptional<z.ZodString>;
|
|
80
|
+
requestHeaders: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
81
|
+
requestBody: z.ZodOptional<z.ZodOptional<z.ZodUnknown>>;
|
|
82
|
+
responseStatus: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
83
|
+
responseHeaders: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
84
|
+
responseBody: z.ZodOptional<z.ZodOptional<z.ZodUnknown>>;
|
|
85
|
+
startedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>>;
|
|
86
|
+
finishedAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>>>;
|
|
87
|
+
durationMs: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
88
|
+
errorMessage: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
89
|
+
errorStack: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
90
|
+
}, z.core.$strip>, indexValidator: z.ZodObject<{
|
|
91
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
92
|
+
size: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
93
|
+
sort: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
94
|
+
index: z.ZodString;
|
|
95
|
+
order: z.ZodEnum<{
|
|
96
|
+
ASC: "ASC";
|
|
97
|
+
DESC: "DESC";
|
|
98
|
+
}>;
|
|
99
|
+
}, z.core.$strip>, z.ZodPreprocess<z.ZodObject<{
|
|
100
|
+
index: z.ZodString;
|
|
101
|
+
order: z.ZodEnum<{
|
|
102
|
+
ASC: "ASC";
|
|
103
|
+
DESC: "DESC";
|
|
104
|
+
}>;
|
|
105
|
+
}, z.core.$strip>, unknown>]>>, unknown>>>;
|
|
106
|
+
query: z.ZodOptional<z.ZodString>;
|
|
107
|
+
lstUuids: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodString, unknown>]>>, unknown>>;
|
|
108
|
+
lstFilter: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<z.ZodObject<{
|
|
109
|
+
value: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
110
|
+
index: z.ZodLiteral<string>;
|
|
111
|
+
}, z.core.$strip>[]>, z.ZodPreprocess<z.ZodUnion<z.ZodObject<{
|
|
112
|
+
value: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
113
|
+
index: z.ZodLiteral<string>;
|
|
114
|
+
}, z.core.$strip>[]>, unknown>]>>, unknown>>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
export type SaveHttpRequestLogDto = z.infer<typeof saveValidator>;
|
|
117
|
+
export type CreateHttpRequestLogDto = z.infer<typeof createValidator>;
|
|
118
|
+
export type PatchHttpRequestLogDto = z.infer<typeof patchValidator>;
|
|
119
|
+
export type IndexHttpRequestLogParamsDto = z.infer<typeof indexValidator>;
|
|
120
|
+
export declare const CreateHttpRequestLogSchema: z.ZodPipe<z.ZodObject<{
|
|
121
|
+
url: z.ZodString;
|
|
122
|
+
method: z.ZodString;
|
|
123
|
+
requestHeaders: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
124
|
+
requestBody: z.ZodOptional<z.ZodUnknown>;
|
|
125
|
+
responseStatus: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
126
|
+
responseHeaders: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
127
|
+
responseBody: z.ZodOptional<z.ZodUnknown>;
|
|
128
|
+
startedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>;
|
|
129
|
+
finishedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>>;
|
|
130
|
+
durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
131
|
+
errorMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
errorStack: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
133
|
+
uuid: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
134
|
+
}, z.core.$strip>, z.ZodTransform<Omit<{
|
|
135
|
+
url: string;
|
|
136
|
+
method: string;
|
|
137
|
+
requestHeaders?: Record<string, unknown> | null | undefined;
|
|
138
|
+
requestBody?: unknown;
|
|
139
|
+
responseStatus?: number | null | undefined;
|
|
140
|
+
responseHeaders?: Record<string, unknown> | null | undefined;
|
|
141
|
+
responseBody?: unknown;
|
|
142
|
+
startedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | undefined;
|
|
143
|
+
finishedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | null | undefined;
|
|
144
|
+
durationMs?: number | null | undefined;
|
|
145
|
+
errorMessage?: string | null | undefined;
|
|
146
|
+
errorStack?: string | null | undefined;
|
|
147
|
+
uuid?: string | null | undefined;
|
|
148
|
+
}, "uuid"> & {
|
|
149
|
+
uuid?: string;
|
|
150
|
+
}, {
|
|
151
|
+
url: string;
|
|
152
|
+
method: string;
|
|
153
|
+
requestHeaders?: Record<string, unknown> | null | undefined;
|
|
154
|
+
requestBody?: unknown;
|
|
155
|
+
responseStatus?: number | null | undefined;
|
|
156
|
+
responseHeaders?: Record<string, unknown> | null | undefined;
|
|
157
|
+
responseBody?: unknown;
|
|
158
|
+
startedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | undefined;
|
|
159
|
+
finishedAt?: import("luxon").DateTime<boolean> | import("luxon").DateTime<true> | import("luxon").DateTime<false> | null | undefined;
|
|
160
|
+
durationMs?: number | null | undefined;
|
|
161
|
+
errorMessage?: string | null | undefined;
|
|
162
|
+
errorStack?: string | null | undefined;
|
|
163
|
+
uuid?: string | null | undefined;
|
|
164
|
+
}>>;
|
|
165
|
+
export declare const SaveHttpRequestLogSchema: z.ZodObject<{
|
|
166
|
+
method: z.ZodString;
|
|
167
|
+
url: z.ZodString;
|
|
168
|
+
requestHeaders: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
169
|
+
requestBody: z.ZodOptional<z.ZodUnknown>;
|
|
170
|
+
responseStatus: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
171
|
+
responseHeaders: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
172
|
+
responseBody: z.ZodOptional<z.ZodUnknown>;
|
|
173
|
+
startedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>;
|
|
174
|
+
finishedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>>;
|
|
175
|
+
durationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
176
|
+
errorMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
177
|
+
errorStack: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
178
|
+
uuid: z.ZodUUID;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
export declare const PatchHttpRequestLogSchema: z.ZodObject<{
|
|
181
|
+
url: z.ZodOptional<z.ZodString>;
|
|
182
|
+
method: z.ZodOptional<z.ZodString>;
|
|
183
|
+
requestHeaders: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
184
|
+
requestBody: z.ZodOptional<z.ZodOptional<z.ZodUnknown>>;
|
|
185
|
+
responseStatus: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
186
|
+
responseHeaders: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
187
|
+
responseBody: z.ZodOptional<z.ZodOptional<z.ZodUnknown>>;
|
|
188
|
+
startedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>>;
|
|
189
|
+
finishedAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodCustom<import("luxon").DateTime<boolean>, import("luxon").DateTime<boolean>>, z.ZodPipe<z.ZodISODateTime, z.ZodTransform<import("luxon").DateTime<true> | import("luxon").DateTime<false>, string>>]>>>>;
|
|
190
|
+
durationMs: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
191
|
+
errorMessage: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
192
|
+
errorStack: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
193
|
+
}, z.core.$strip>;
|
|
194
|
+
export declare const IndexHttpRequestLogSchema: z.ZodObject<{
|
|
195
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
196
|
+
size: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
197
|
+
sort: z.ZodDefault<z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
198
|
+
index: z.ZodString;
|
|
199
|
+
order: z.ZodEnum<{
|
|
200
|
+
ASC: "ASC";
|
|
201
|
+
DESC: "DESC";
|
|
202
|
+
}>;
|
|
203
|
+
}, z.core.$strip>, z.ZodPreprocess<z.ZodObject<{
|
|
204
|
+
index: z.ZodString;
|
|
205
|
+
order: z.ZodEnum<{
|
|
206
|
+
ASC: "ASC";
|
|
207
|
+
DESC: "DESC";
|
|
208
|
+
}>;
|
|
209
|
+
}, z.core.$strip>, unknown>]>>, unknown>>>;
|
|
210
|
+
query: z.ZodOptional<z.ZodString>;
|
|
211
|
+
lstUuids: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodPreprocess<z.ZodString, unknown>]>>, unknown>>;
|
|
212
|
+
lstFilter: z.ZodOptional<z.ZodPreprocess<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<z.ZodObject<{
|
|
213
|
+
value: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
214
|
+
index: z.ZodLiteral<string>;
|
|
215
|
+
}, z.core.$strip>[]>, z.ZodPreprocess<z.ZodUnion<z.ZodObject<{
|
|
216
|
+
value: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
217
|
+
index: z.ZodLiteral<string>;
|
|
218
|
+
}, z.core.$strip>[]>, unknown>]>>, unknown>>;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IndexHttpRequestLogSchema = exports.PatchHttpRequestLogSchema = exports.SaveHttpRequestLogSchema = exports.CreateHttpRequestLogSchema = exports.indexSchemaHttpRequestLog = exports.modelSchemaHttpRequestLog = void 0;
|
|
7
|
+
const schema_builder_1 = require("../../schema/schema-builder");
|
|
8
|
+
const zod_extensions_1 = require("../../schema/zod-extensions");
|
|
9
|
+
const zod_1 = __importDefault(require("zod"));
|
|
10
|
+
const jsonObject = zod_1.default.record(zod_1.default.string(), zod_1.default.unknown()).nullable().optional();
|
|
11
|
+
exports.modelSchemaHttpRequestLog = zod_1.default.object({
|
|
12
|
+
uuid: zod_1.default.uuidv7(),
|
|
13
|
+
method: zod_1.default.string().min(1, 'Método é obrigatório').max(10),
|
|
14
|
+
url: zod_1.default.string().min(1, 'URL é obrigatória'),
|
|
15
|
+
requestHeaders: jsonObject,
|
|
16
|
+
requestBody: zod_1.default.unknown().optional(),
|
|
17
|
+
responseStatus: zod_1.default.number().int().nullable().optional(),
|
|
18
|
+
responseHeaders: jsonObject,
|
|
19
|
+
responseBody: zod_1.default.unknown().optional(),
|
|
20
|
+
startedAt: zod_extensions_1.zExt.dateTime().optional(),
|
|
21
|
+
finishedAt: zod_extensions_1.zExt.dateTime().nullable().optional(),
|
|
22
|
+
durationMs: zod_1.default.number().int().nullable().optional(),
|
|
23
|
+
errorMessage: zod_1.default.string().nullable().optional(),
|
|
24
|
+
errorStack: zod_1.default.string().nullable().optional(),
|
|
25
|
+
});
|
|
26
|
+
exports.indexSchemaHttpRequestLog = {
|
|
27
|
+
uuid: { type: schema_builder_1.FieldType.UUID },
|
|
28
|
+
method: { type: schema_builder_1.FieldType.String },
|
|
29
|
+
url: { type: schema_builder_1.FieldType.String },
|
|
30
|
+
responseStatus: { type: schema_builder_1.FieldType.Number },
|
|
31
|
+
startedAt: { type: schema_builder_1.FieldType.DateTime },
|
|
32
|
+
durationMs: { type: schema_builder_1.FieldType.Number },
|
|
33
|
+
errorMessage: { type: schema_builder_1.FieldType.TextArea },
|
|
34
|
+
};
|
|
35
|
+
const { createValidator, saveValidator, patchValidator, indexValidator } = schema_builder_1.SchemaBuilder.build({
|
|
36
|
+
modelSchema: exports.modelSchemaHttpRequestLog,
|
|
37
|
+
indexSchema: exports.indexSchemaHttpRequestLog,
|
|
38
|
+
});
|
|
39
|
+
exports.CreateHttpRequestLogSchema = createValidator;
|
|
40
|
+
exports.SaveHttpRequestLogSchema = saveValidator;
|
|
41
|
+
exports.PatchHttpRequestLogSchema = patchValidator;
|
|
42
|
+
exports.IndexHttpRequestLogSchema = indexValidator;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DateTime } from 'luxon';
|
|
2
|
+
import { UuidEntity } from '../../schema/abstract.entity';
|
|
3
|
+
export declare class HttpRequestLog extends UuidEntity {
|
|
4
|
+
method: string;
|
|
5
|
+
url: string;
|
|
6
|
+
requestHeaders: Record<string, unknown> | null;
|
|
7
|
+
requestBody: unknown;
|
|
8
|
+
responseStatus: number | null;
|
|
9
|
+
responseHeaders: Record<string, unknown> | null;
|
|
10
|
+
responseBody: unknown;
|
|
11
|
+
startedAt: DateTime;
|
|
12
|
+
finishedAt: DateTime | null;
|
|
13
|
+
durationMs: number | null;
|
|
14
|
+
errorMessage: string | null;
|
|
15
|
+
errorStack: string | null;
|
|
16
|
+
createdAt: DateTime;
|
|
17
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
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.HttpRequestLog = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const luxon_1 = require("luxon");
|
|
15
|
+
const abstract_entity_1 = require("../../schema/abstract.entity");
|
|
16
|
+
const luxon_2 = require("../../decorators/luxon");
|
|
17
|
+
let HttpRequestLog = class HttpRequestLog extends abstract_entity_1.UuidEntity {
|
|
18
|
+
method;
|
|
19
|
+
url;
|
|
20
|
+
requestHeaders;
|
|
21
|
+
requestBody;
|
|
22
|
+
responseStatus;
|
|
23
|
+
responseHeaders;
|
|
24
|
+
responseBody;
|
|
25
|
+
startedAt;
|
|
26
|
+
finishedAt;
|
|
27
|
+
durationMs;
|
|
28
|
+
errorMessage;
|
|
29
|
+
errorStack;
|
|
30
|
+
createdAt;
|
|
31
|
+
};
|
|
32
|
+
exports.HttpRequestLog = HttpRequestLog;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 10 }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], HttpRequestLog.prototype, "method", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)('text'),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], HttpRequestLog.prototype, "url", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], HttpRequestLog.prototype, "requestHeaders", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], HttpRequestLog.prototype, "requestBody", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ type: 'smallint', nullable: true }),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], HttpRequestLog.prototype, "responseStatus", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], HttpRequestLog.prototype, "responseHeaders", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], HttpRequestLog.prototype, "responseBody", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, luxon_2.DateTimeColumn)({ default: () => 'now()' }),
|
|
63
|
+
__metadata("design:type", luxon_1.DateTime)
|
|
64
|
+
], HttpRequestLog.prototype, "startedAt", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, luxon_2.DateTimeColumn)({ nullable: true }),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], HttpRequestLog.prototype, "finishedAt", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], HttpRequestLog.prototype, "durationMs", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
75
|
+
__metadata("design:type", Object)
|
|
76
|
+
], HttpRequestLog.prototype, "errorMessage", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
79
|
+
__metadata("design:type", Object)
|
|
80
|
+
], HttpRequestLog.prototype, "errorStack", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, luxon_2.CreateDateTimeColumn)(),
|
|
83
|
+
__metadata("design:type", luxon_1.DateTime)
|
|
84
|
+
], HttpRequestLog.prototype, "createdAt", void 0);
|
|
85
|
+
exports.HttpRequestLog = HttpRequestLog = __decorate([
|
|
86
|
+
(0, typeorm_1.Entity)('http_request_logs')
|
|
87
|
+
], HttpRequestLog);
|