@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,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gridHtmlComponent = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
5
|
+
class GridHtmlComponent extends component_1.HtmlComponent {
|
|
6
|
+
constructor() {
|
|
7
|
+
const content = `
|
|
8
|
+
<div class="{{#if card}}card{{/if}} {{class}}">
|
|
9
|
+
<table
|
|
10
|
+
role="presentation"
|
|
11
|
+
cellpadding="0"
|
|
12
|
+
cellspacing="0"
|
|
13
|
+
class="table"
|
|
14
|
+
style="border: none;"
|
|
15
|
+
>
|
|
16
|
+
{{#each content}}
|
|
17
|
+
<tr>
|
|
18
|
+
{{#each this}}
|
|
19
|
+
<td
|
|
20
|
+
{{#if colspan}}colspan="{{colspan}}"{{/if}}
|
|
21
|
+
{{#if style}}style="{{style}}"{{/if}}
|
|
22
|
+
>
|
|
23
|
+
{{{content}}}
|
|
24
|
+
</td>
|
|
25
|
+
{{/each}}
|
|
26
|
+
</tr>
|
|
27
|
+
{{/each}}
|
|
28
|
+
</table>
|
|
29
|
+
</div>
|
|
30
|
+
`;
|
|
31
|
+
super('', content);
|
|
32
|
+
}
|
|
33
|
+
compile(content) {
|
|
34
|
+
let card = content.card ?? true;
|
|
35
|
+
const normalized = {
|
|
36
|
+
content: content.content.map((row) => row.map((cell) => (typeof cell === 'string' ? { content: cell } : cell))),
|
|
37
|
+
columns: Math.max(...content.content.map((row) => row.reduce((acc, cell) => acc + (typeof cell === 'string' ? 1 : (cell.colspan ?? 1)), 0))),
|
|
38
|
+
card: card,
|
|
39
|
+
class: content.class,
|
|
40
|
+
};
|
|
41
|
+
return super.compile(normalized);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.gridHtmlComponent = new GridHtmlComponent();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IDefaultHeaderHtmlContent } from './default/default-header';
|
|
2
|
+
export declare const styleTag: string;
|
|
3
|
+
export interface IHtmlShellContent {
|
|
4
|
+
nomeEmpresa: string;
|
|
5
|
+
header?: string;
|
|
6
|
+
headerParams: IDefaultHeaderHtmlContent;
|
|
7
|
+
body: string;
|
|
8
|
+
footer?: string;
|
|
9
|
+
watermarkUrl: string;
|
|
10
|
+
cssVariables: string;
|
|
11
|
+
}
|
|
12
|
+
declare class ShellHtmlComponent {
|
|
13
|
+
constructor();
|
|
14
|
+
private template;
|
|
15
|
+
compile(content: IHtmlShellContent, options?: CompileOptions): string;
|
|
16
|
+
}
|
|
17
|
+
export declare const shellHtmlComponent: ShellHtmlComponent;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,423 @@
|
|
|
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.shellHtmlComponent = exports.styleTag = void 0;
|
|
7
|
+
const colors_1 = require("./colors");
|
|
8
|
+
const default_footer_1 = require("./default/default-footer");
|
|
9
|
+
const default_header_1 = require("./default/default-header");
|
|
10
|
+
const handlebars_1 = __importDefault(require("handlebars"));
|
|
11
|
+
const juice_1 = __importDefault(require("juice"));
|
|
12
|
+
const lstColorSwatch = [950, 900, 800, 700, 600, 500, 400, 300, 200, 100, 50];
|
|
13
|
+
// Escala de espaçamento do Tailwind (1 = 0.25rem). Sem valores fracionados para evitar seletores com escape.
|
|
14
|
+
const lstSpacing = [0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16];
|
|
15
|
+
// Tokens semânticos do shadcn que não fazem parte do enum Color
|
|
16
|
+
const lstSemanticColor = ['background', 'foreground', 'card', 'muted', 'accent', 'destructive', 'border', 'input'];
|
|
17
|
+
const lstForegroundColor = ['primary', 'secondary', 'card', 'muted', 'accent', 'destructive'];
|
|
18
|
+
const spacingUtilities = lstSpacing
|
|
19
|
+
.map((n) => {
|
|
20
|
+
const v = `${n * 0.25}rem`;
|
|
21
|
+
return `
|
|
22
|
+
/* ${n} */
|
|
23
|
+
.m-${n}, .mt-${n}, .my-${n} { margin-top: ${v}; }
|
|
24
|
+
.m-${n}, .mr-${n}, .mx-${n} { margin-right: ${v}; }
|
|
25
|
+
.m-${n}, .mb-${n}, .my-${n} { margin-bottom: ${v}; }
|
|
26
|
+
.m-${n}, .ml-${n}, .mx-${n} { margin-left: ${v}; }
|
|
27
|
+
|
|
28
|
+
.p-${n}, .pt-${n}, .py-${n} { padding-top: ${v}; }
|
|
29
|
+
.p-${n}, .pr-${n}, .px-${n} { padding-right: ${v}; }
|
|
30
|
+
.p-${n}, .pb-${n}, .py-${n} { padding-bottom: ${v}; }
|
|
31
|
+
.p-${n}, .pl-${n}, .px-${n} { padding-left: ${v}; }
|
|
32
|
+
|
|
33
|
+
.gap-${n} { gap: ${v}; }
|
|
34
|
+
`;
|
|
35
|
+
})
|
|
36
|
+
.join('\n');
|
|
37
|
+
const colorUtilities = `
|
|
38
|
+
${[...Object.values(colors_1.Color), ...lstSemanticColor]
|
|
39
|
+
.map((color) => `
|
|
40
|
+
.bg-${color} { background-color: var(--${color}); }
|
|
41
|
+
.text-${color} { color: var(--${color}); }
|
|
42
|
+
.border-${color} { border-color: var(--${color}); }
|
|
43
|
+
`)
|
|
44
|
+
.join('\n')}
|
|
45
|
+
|
|
46
|
+
${lstForegroundColor.map((color) => `.text-${color}-foreground { color: var(--${color}-foreground); }`).join('\n')}
|
|
47
|
+
|
|
48
|
+
${Object.values(colors_1.Color)
|
|
49
|
+
.map((color) => lstColorSwatch
|
|
50
|
+
.map((v) => `
|
|
51
|
+
.bg-${color}-${v} { background-color: var(--${color}-${v}); }
|
|
52
|
+
.text-${color}-${v} { color: var(--${color}-${v}); }
|
|
53
|
+
.border-${color}-${v} { border-color: var(--${color}-${v}); }
|
|
54
|
+
`)
|
|
55
|
+
.join('\n'))
|
|
56
|
+
.join('\n')}
|
|
57
|
+
`;
|
|
58
|
+
exports.styleTag = `
|
|
59
|
+
<style>
|
|
60
|
+
/* Tokens do shadcn (tema neutral, modo claro por padrão) */
|
|
61
|
+
:root {
|
|
62
|
+
color-scheme: light;
|
|
63
|
+
--radius: 0.5rem;
|
|
64
|
+
|
|
65
|
+
--background: #FFFFFF;
|
|
66
|
+
--foreground: #0A0A0A;
|
|
67
|
+
--card: #FFFFFF;
|
|
68
|
+
--card-foreground: #0A0A0A;
|
|
69
|
+
--muted: #F5F5F5;
|
|
70
|
+
--muted-foreground: #737373;
|
|
71
|
+
--accent: #F5F5F5;
|
|
72
|
+
--accent-foreground: #171717;
|
|
73
|
+
--border: #E5E5E5;
|
|
74
|
+
--input: #E5E5E5;
|
|
75
|
+
--ring: #0A0A0A;
|
|
76
|
+
|
|
77
|
+
--primary-foreground: #FAFAFA;
|
|
78
|
+
--secondary: #EEFF79;
|
|
79
|
+
--secondary-foreground: #171717;
|
|
80
|
+
--destructive: #DC2626;
|
|
81
|
+
--destructive-foreground: #FAFAFA;
|
|
82
|
+
|
|
83
|
+
--warning: #F8F2C9;
|
|
84
|
+
--danger: #D52D2D;
|
|
85
|
+
--success: #E5FEE7;
|
|
86
|
+
--neutral: #F5F5F5;
|
|
87
|
+
--info: #E0F2FE;
|
|
88
|
+
--light: #FAFAFA;
|
|
89
|
+
--dark: #171717;
|
|
90
|
+
|
|
91
|
+
--link: var(--primary);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:root {
|
|
95
|
+
--neutral-50: #FAFAFA;
|
|
96
|
+
--neutral-100: #F5F5F5;
|
|
97
|
+
--neutral-200: #E5E5E5;
|
|
98
|
+
--neutral-300: #D4D4D4;
|
|
99
|
+
--neutral-400: #A3A3A3;
|
|
100
|
+
--neutral-500: #737373;
|
|
101
|
+
--neutral-600: #525252;
|
|
102
|
+
--neutral-700: #404040;
|
|
103
|
+
--neutral-800: #262626;
|
|
104
|
+
--neutral-900: #171717;
|
|
105
|
+
--neutral-950: #0A0A0A;
|
|
106
|
+
|
|
107
|
+
--success-50: #F9FEF9;
|
|
108
|
+
--success-100: #E5FEE7;
|
|
109
|
+
--success-200: #C5EDC9;
|
|
110
|
+
--success-300: #8ADB93;
|
|
111
|
+
--success-400: #4ECF5D;
|
|
112
|
+
--success-500: #28B538;
|
|
113
|
+
--success-600: #1A9128;
|
|
114
|
+
--success-700: #1A7A26;
|
|
115
|
+
--success-800: #195E22;
|
|
116
|
+
--success-900: #154A1D;
|
|
117
|
+
--success-950: #07310F;
|
|
118
|
+
|
|
119
|
+
--info-50: #F0F9FF;
|
|
120
|
+
--info-100: #E0F2FE;
|
|
121
|
+
--info-200: #BAE6FD;
|
|
122
|
+
--info-300: #7DD3FC;
|
|
123
|
+
--info-400: #38BDF8;
|
|
124
|
+
--info-500: #0EA5E9;
|
|
125
|
+
--info-600: #0284C7;
|
|
126
|
+
--info-700: #0369A1;
|
|
127
|
+
--info-800: #075985;
|
|
128
|
+
--info-900: #0C4A6E;
|
|
129
|
+
--info-950: #082F49;
|
|
130
|
+
|
|
131
|
+
--warning-50: #FCF9EA;
|
|
132
|
+
--warning-100: #F8F2C9;
|
|
133
|
+
--warning-200: #F3E395;
|
|
134
|
+
--warning-300: #ECCD58;
|
|
135
|
+
--warning-400: #E7BD40;
|
|
136
|
+
--warning-500: #D59F1D;
|
|
137
|
+
--warning-600: #B77B17;
|
|
138
|
+
--warning-700: #925916;
|
|
139
|
+
--warning-800: #7A4719;
|
|
140
|
+
--warning-900: #683B1B;
|
|
141
|
+
--warning-950: #3C1F0C;
|
|
142
|
+
|
|
143
|
+
--danger-50: #FEF2F2;
|
|
144
|
+
--danger-100: #FDE3E3;
|
|
145
|
+
--danger-200: #FCCCCC;
|
|
146
|
+
--danger-300: #F9A8A8;
|
|
147
|
+
--danger-400: #F37676;
|
|
148
|
+
--danger-500: #E74040;
|
|
149
|
+
--danger-600: #D52D2D;
|
|
150
|
+
--danger-700: #B32222;
|
|
151
|
+
--danger-800: #942020;
|
|
152
|
+
--danger-900: #7B2121;
|
|
153
|
+
--danger-950: #430C0C;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* Variáveis da empresa (sobrescrevem os tokens acima) */
|
|
157
|
+
:root {
|
|
158
|
+
{{cssVariables}}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* Base */
|
|
162
|
+
* {
|
|
163
|
+
margin: 0;
|
|
164
|
+
padding: 0;
|
|
165
|
+
box-sizing: border-box;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
body {
|
|
169
|
+
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
170
|
+
font-size: 14px;
|
|
171
|
+
line-height: 20px;
|
|
172
|
+
color: var(--foreground);
|
|
173
|
+
background-color: var(--background);
|
|
174
|
+
-webkit-font-smoothing: antialiased;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
h1, h2, h3, h4, h5, h6, .font-garamond {
|
|
178
|
+
font-family: 'EB Garamond', Garamond, Georgia, serif;
|
|
179
|
+
}
|
|
180
|
+
h1 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.025em; }
|
|
181
|
+
h2 { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.025em; }
|
|
182
|
+
h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
|
|
183
|
+
|
|
184
|
+
a {
|
|
185
|
+
color: var(--link);
|
|
186
|
+
font-weight: 500;
|
|
187
|
+
text-decoration: underline;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
hr {
|
|
191
|
+
border: none;
|
|
192
|
+
border-top: 1px solid var(--border);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* Layout */
|
|
196
|
+
.block { display: block; }
|
|
197
|
+
.inline-block { display: inline-block; }
|
|
198
|
+
.flex { display: flex; }
|
|
199
|
+
.inline-flex { display: inline-flex; }
|
|
200
|
+
.hidden { display: none; }
|
|
201
|
+
.flex-col { flex-direction: column; }
|
|
202
|
+
.flex-wrap { flex-wrap: wrap; }
|
|
203
|
+
.items-center { align-items: center; }
|
|
204
|
+
.justify-start { justify-content: flex-start; }
|
|
205
|
+
.justify-center { justify-content: center; }
|
|
206
|
+
.justify-between { justify-content: space-between; }
|
|
207
|
+
.justify-end { justify-content: flex-end; }
|
|
208
|
+
.overflow-hidden { overflow: hidden; }
|
|
209
|
+
.relative { position: relative; }
|
|
210
|
+
|
|
211
|
+
.w-full { width: 100%; }
|
|
212
|
+
.h-full { height: 100%; }
|
|
213
|
+
.h-10 { height: 2.5rem; }
|
|
214
|
+
.h-20 { height: 5rem; }
|
|
215
|
+
.max-w-xl { max-width: 36rem; }
|
|
216
|
+
.max-w-2xl { max-width: 42rem; }
|
|
217
|
+
.mx-auto { margin-left: auto; margin-right: auto; }
|
|
218
|
+
|
|
219
|
+
/* Espaçamento */
|
|
220
|
+
${spacingUtilities}
|
|
221
|
+
|
|
222
|
+
/* Tipografia */
|
|
223
|
+
.text-xs { font-size: 12px; line-height: 16px; }
|
|
224
|
+
.text-sm { font-size: 14px; line-height: 20px; }
|
|
225
|
+
.text-base { font-size: 16px; line-height: 24px; }
|
|
226
|
+
.text-lg { font-size: 18px; line-height: 28px; }
|
|
227
|
+
.text-xl { font-size: 20px; line-height: 28px; }
|
|
228
|
+
.text-2xl { font-size: 24px; line-height: 32px; }
|
|
229
|
+
.font-normal { font-weight: 400; }
|
|
230
|
+
.font-medium { font-weight: 500; }
|
|
231
|
+
.font-semibold { font-weight: 600; }
|
|
232
|
+
.font-bold { font-weight: 700; }
|
|
233
|
+
.leading-none { line-height: 1; }
|
|
234
|
+
.leading-tight { line-height: 1.25; }
|
|
235
|
+
.leading-normal { line-height: 1.5; }
|
|
236
|
+
.tracking-tight { letter-spacing: -0.025em; }
|
|
237
|
+
.text-left { text-align: left; }
|
|
238
|
+
.text-center { text-align: center; }
|
|
239
|
+
.text-right { text-align: right; }
|
|
240
|
+
.align-top { vertical-align: top; }
|
|
241
|
+
.align-middle { vertical-align: middle; }
|
|
242
|
+
.uppercase { text-transform: uppercase; }
|
|
243
|
+
.underline { text-decoration: underline; }
|
|
244
|
+
.no-underline { text-decoration: none; }
|
|
245
|
+
.whitespace-nowrap { white-space: nowrap; }
|
|
246
|
+
.list-disc { list-style-type: disc; }
|
|
247
|
+
.list-inside { list-style-position: inside; }
|
|
248
|
+
|
|
249
|
+
/* Bordas */
|
|
250
|
+
.border { border-width: 1px; border-style: solid; border-color: var(--border); }
|
|
251
|
+
.border-0 { border-width: 0; }
|
|
252
|
+
.border-t { border-top-width: 1px; border-top-style: solid; border-top-color: var(--border); }
|
|
253
|
+
.border-b { border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: var(--border); }
|
|
254
|
+
.rounded-none { border-radius: 0; }
|
|
255
|
+
.rounded-sm { border-radius: 4px; }
|
|
256
|
+
.rounded-md { border-radius: 6px; }
|
|
257
|
+
.rounded-lg { border-radius: 8px; }
|
|
258
|
+
.rounded-xl { border-radius: 12px; }
|
|
259
|
+
.rounded-full { border-radius: 9999px; }
|
|
260
|
+
.border-transparent { border-color: transparent; }
|
|
261
|
+
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
|
|
262
|
+
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
|
|
263
|
+
|
|
264
|
+
/* Componentes (equivalentes aos do shadcn) */
|
|
265
|
+
.card {
|
|
266
|
+
background-color: var(--card);
|
|
267
|
+
color: var(--card-foreground);
|
|
268
|
+
border: 1px solid var(--border);
|
|
269
|
+
border-radius: 8px;
|
|
270
|
+
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
271
|
+
overflow: hidden;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.btn {
|
|
275
|
+
display: inline-block;
|
|
276
|
+
text-align: center;
|
|
277
|
+
white-space: nowrap;
|
|
278
|
+
background-color: var(--primary);
|
|
279
|
+
color: var(--primary-foreground);
|
|
280
|
+
border: 1px solid var(--primary);
|
|
281
|
+
text-decoration: none;
|
|
282
|
+
font-size: 14px;
|
|
283
|
+
line-height: 20px;
|
|
284
|
+
font-weight: 500;
|
|
285
|
+
padding: 8px 16px;
|
|
286
|
+
border-radius: 6px;
|
|
287
|
+
}
|
|
288
|
+
.btn-secondary {
|
|
289
|
+
background-color: var(--secondary);
|
|
290
|
+
color: var(--secondary-foreground);
|
|
291
|
+
border-color: var(--secondary);
|
|
292
|
+
}
|
|
293
|
+
.btn-outline {
|
|
294
|
+
background-color: var(--background);
|
|
295
|
+
color: var(--foreground);
|
|
296
|
+
border-color: var(--input);
|
|
297
|
+
}
|
|
298
|
+
.btn-destructive {
|
|
299
|
+
background-color: var(--destructive);
|
|
300
|
+
color: var(--destructive-foreground);
|
|
301
|
+
border-color: var(--destructive);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.badge {
|
|
305
|
+
display: inline-block;
|
|
306
|
+
width: fit-content;
|
|
307
|
+
font-size: 12px;
|
|
308
|
+
line-height: 16px;
|
|
309
|
+
font-weight: 600;
|
|
310
|
+
padding: 2px 10px;
|
|
311
|
+
border-radius: 6px;
|
|
312
|
+
border: 1px solid transparent;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.table {
|
|
316
|
+
width: 100%;
|
|
317
|
+
font-size: 14px;
|
|
318
|
+
border-collapse: separate;
|
|
319
|
+
border-spacing: 0;
|
|
320
|
+
border: 1px solid var(--border);
|
|
321
|
+
border-radius: 8px;
|
|
322
|
+
overflow: hidden;
|
|
323
|
+
}
|
|
324
|
+
.table th {
|
|
325
|
+
height: 2.5rem;
|
|
326
|
+
padding: 0 .5rem;
|
|
327
|
+
text-align: left;
|
|
328
|
+
vertical-align: middle;
|
|
329
|
+
font-weight: 500;
|
|
330
|
+
color: var(--muted-foreground);
|
|
331
|
+
border-bottom: 1px solid var(--border);
|
|
332
|
+
}
|
|
333
|
+
.table td {
|
|
334
|
+
padding: .5rem;
|
|
335
|
+
vertical-align: top;
|
|
336
|
+
color: var(--foreground);
|
|
337
|
+
border-bottom: 1px solid var(--border);
|
|
338
|
+
}
|
|
339
|
+
.table td strong,
|
|
340
|
+
.table td b {
|
|
341
|
+
display: block;
|
|
342
|
+
font-weight: 500;
|
|
343
|
+
color: var(--foreground);
|
|
344
|
+
margin-bottom: 2px;
|
|
345
|
+
}
|
|
346
|
+
.table tr:last-child td {
|
|
347
|
+
border-bottom: none;
|
|
348
|
+
}
|
|
349
|
+
/* Remove a borda externa quando a tabela está dentro de um card */
|
|
350
|
+
.card .table {
|
|
351
|
+
border: none;
|
|
352
|
+
border-radius: 0;
|
|
353
|
+
overflow: visible;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/* Cores (os utilitários vêm por último para sobrescrever os componentes) */
|
|
357
|
+
${colorUtilities}
|
|
358
|
+
|
|
359
|
+
/* juice start ignore */
|
|
360
|
+
.watermark-container {
|
|
361
|
+
background-size: 70%;
|
|
362
|
+
background-position: 100% 0;
|
|
363
|
+
background-repeat: no-repeat;
|
|
364
|
+
background-image: url('{{{watermark}}}');
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
@media (max-width: 520px) {
|
|
368
|
+
thead { display: none; }
|
|
369
|
+
}
|
|
370
|
+
/* juice end ignore */
|
|
371
|
+
</style>
|
|
372
|
+
`;
|
|
373
|
+
const htmlShellTemplate = `
|
|
374
|
+
<!DOCTYPE html>
|
|
375
|
+
<html lang="pt-BR">
|
|
376
|
+
<head>
|
|
377
|
+
<meta charset="UTF-8" />
|
|
378
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
379
|
+
<meta name="color-scheme" content="light" />
|
|
380
|
+
<meta name="supported-color-schemes" content="light" />
|
|
381
|
+
<title>{{nomeEmpresa}} - Atualização de pedido</title>
|
|
382
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
383
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
384
|
+
<link href="https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap" rel="stylesheet" />
|
|
385
|
+
${exports.styleTag}
|
|
386
|
+
</head>
|
|
387
|
+
<body class="bg-background py-8">
|
|
388
|
+
<div class="max-w-2xl mx-auto text-card-foreground border rounded-lg shadow-sm overflow-hidden">
|
|
389
|
+
{{{header}}}
|
|
390
|
+
|
|
391
|
+
<!-- Content -->
|
|
392
|
+
<main class="watermark-container">
|
|
393
|
+
<div class="px-6 py-6">
|
|
394
|
+
{{{body}}}
|
|
395
|
+
</div>
|
|
396
|
+
</main>
|
|
397
|
+
|
|
398
|
+
{{{footer}}}
|
|
399
|
+
</div>
|
|
400
|
+
</body>
|
|
401
|
+
</html>
|
|
402
|
+
|
|
403
|
+
`;
|
|
404
|
+
class ShellHtmlComponent {
|
|
405
|
+
constructor() {
|
|
406
|
+
this.template = handlebars_1.default.compile(htmlShellTemplate);
|
|
407
|
+
}
|
|
408
|
+
template = handlebars_1.default.compile(htmlShellTemplate);
|
|
409
|
+
compile(content, options) {
|
|
410
|
+
if (!content.header) {
|
|
411
|
+
content.header = default_header_1.defaultHeaderHtmlComponent.compile(content.headerParams);
|
|
412
|
+
}
|
|
413
|
+
if (!content.footer) {
|
|
414
|
+
content.footer = default_footer_1.defaultFooterHtmlComponent.compile();
|
|
415
|
+
}
|
|
416
|
+
const html = this.template({
|
|
417
|
+
...content,
|
|
418
|
+
watermark: content.watermarkUrl,
|
|
419
|
+
}, options);
|
|
420
|
+
return (0, juice_1.default)(html);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
exports.shellHtmlComponent = new ShellHtmlComponent();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HtmlComponent } from './component';
|
|
2
|
+
export interface ITableProp<T> {
|
|
3
|
+
mapper: ((item: T) => string) | string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ITableHtmlContent<T = any> {
|
|
7
|
+
data: T[];
|
|
8
|
+
columns: ITableProp<T>[];
|
|
9
|
+
lstCustomRows?: string[];
|
|
10
|
+
}
|
|
11
|
+
declare class TableHtmlComponent extends HtmlComponent<ITableHtmlContent> {
|
|
12
|
+
constructor();
|
|
13
|
+
compile<T extends ITableHtmlContent>(content: T): string;
|
|
14
|
+
}
|
|
15
|
+
export declare const tableHtmlComponent: TableHtmlComponent;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tableHtmlComponent = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
5
|
+
class TableHtmlComponent extends component_1.HtmlComponent {
|
|
6
|
+
constructor() {
|
|
7
|
+
const content = `
|
|
8
|
+
<table class="table">
|
|
9
|
+
<thead>
|
|
10
|
+
<tr>
|
|
11
|
+
{{#each columns}}
|
|
12
|
+
<th>{{this}}</th>
|
|
13
|
+
{{/each}}
|
|
14
|
+
</tr>
|
|
15
|
+
</thead>
|
|
16
|
+
<tbody>
|
|
17
|
+
{{#each data}}
|
|
18
|
+
<tr>
|
|
19
|
+
{{#each ../columns}}
|
|
20
|
+
<td>{{{lookup ../this this}}}</td>
|
|
21
|
+
{{/each}}
|
|
22
|
+
</tr>
|
|
23
|
+
{{/each}}
|
|
24
|
+
{{#each lstCustomRows}}
|
|
25
|
+
<tr>
|
|
26
|
+
{{{this}}}
|
|
27
|
+
</tr>
|
|
28
|
+
{{/each}}
|
|
29
|
+
</tbody>
|
|
30
|
+
</table>
|
|
31
|
+
`;
|
|
32
|
+
super('', content);
|
|
33
|
+
}
|
|
34
|
+
compile(content) {
|
|
35
|
+
const columns = content.columns.map((c) => c.name);
|
|
36
|
+
return super.compile({
|
|
37
|
+
columns,
|
|
38
|
+
data: content.data.map((item) => {
|
|
39
|
+
const row = {};
|
|
40
|
+
content.columns.forEach((col) => {
|
|
41
|
+
if (typeof col.mapper === 'function') {
|
|
42
|
+
row[col.name] = col.mapper(item);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
// typing pra acalmar o eslint
|
|
46
|
+
row[col.name] = String(item[col.mapper]);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return row;
|
|
50
|
+
}),
|
|
51
|
+
lstCustomRows: content.lstCustomRows || [],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.tableHtmlComponent = new TableHtmlComponent();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unorderedListHtmlComponent = void 0;
|
|
4
|
+
const component_1 = require("./component");
|
|
5
|
+
class UnorderedListHtmlComponent extends component_1.HtmlComponent {
|
|
6
|
+
constructor() {
|
|
7
|
+
const content = `
|
|
8
|
+
<div class="card my-2 px-4 py-3">
|
|
9
|
+
<ul class="list-disc list-inside text-sm">
|
|
10
|
+
{{#each this}}
|
|
11
|
+
<li class="py-1">
|
|
12
|
+
{{{this}}}
|
|
13
|
+
</li>
|
|
14
|
+
{{/each}}
|
|
15
|
+
</ul>
|
|
16
|
+
</div>
|
|
17
|
+
`;
|
|
18
|
+
super('', content);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.unorderedListHtmlComponent = new UnorderedListHtmlComponent();
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import './schema/typeorm-extensions';
|
|
2
|
+
export * from './schema-kit.module';
|
|
3
|
+
export * from './schema/schema.service';
|
|
4
|
+
export * from './context-logger.service';
|
|
5
|
+
export * from './config/naming-strategy';
|
|
6
|
+
export * from './config/redis.constants';
|
|
7
|
+
export * from './monitoramento';
|
|
8
|
+
export * from './monitoramento/index';
|
|
9
|
+
export * from './modules/auth/access-token';
|
|
10
|
+
export * from './modules/auth/known-module';
|
|
11
|
+
export * from './modules/auth/refresh-token';
|
|
12
|
+
export * from './modules/auth/token-type';
|
|
13
|
+
export * from './modules/pubsub/pubsub.methods';
|
|
14
|
+
export * from './modules/pubsub/pubsub.constants';
|
|
15
|
+
export * from './modules/pubsub/pubsub-dynamic-topic.service';
|
|
16
|
+
export * from './modules/redis/redis.module';
|
|
17
|
+
export * from './modules/redis/redis.options';
|
|
18
|
+
export * from './modules/storage/storage.service';
|
|
19
|
+
export * from './modules/encrypted-column/encrypted-column.module';
|
|
20
|
+
export * from './schema/abstract.entity';
|
|
21
|
+
export * from './schema/schema-builder';
|
|
22
|
+
export * from './schema/schema.controller';
|
|
23
|
+
export * from './schema/schema.service';
|
|
24
|
+
export * from './schema/zod-extensions';
|
|
25
|
+
export * from './decorators/luxon';
|
|
26
|
+
export * from './decorators/date-range';
|
|
27
|
+
export * from './decorators/file-column';
|
|
28
|
+
export * from './decorators/get-user.decorator';
|
|
29
|
+
export * from './decorators/encrypted';
|
|
30
|
+
export * from './decorators/multipart.decorator';
|
|
31
|
+
export * from './decorators/post-get.decorator';
|
|
32
|
+
export * from './decorators/query-or-body.decorator';
|
|
33
|
+
export * from './interfaces/paginated-result';
|
|
34
|
+
export * from './transformers/encrypted.transformer';
|
|
35
|
+
export * from './validators/uuid-validator';
|
|
36
|
+
export * from './validators/pubsub-delete.validator';
|
|
37
|
+
export * from './validators/ip-validator';
|
|
38
|
+
export * from './validators/url-validator';
|
|
39
|
+
export * from './utils/utils';
|
|
40
|
+
export * from './html/components/component';
|
|
41
|
+
export * from './html/components/colors';
|
|
42
|
+
export * from './html/components/shell';
|
|
43
|
+
export * from './html/components/badge';
|
|
44
|
+
export * from './html/components/env-badge';
|
|
45
|
+
export * from './html/components/grid';
|
|
46
|
+
export * from './html/components/table';
|
|
47
|
+
export * from './html/components/unordered-list';
|
|
48
|
+
export * from './html/components/default/default-header';
|
|
49
|
+
export * from './html/components/default/default-footer';
|