@navservice/core 1.123.0 → 1.127.0
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/README.md +55 -55
- package/build/es/helpers/_set_response.d.ts +20 -20
- package/build/es/helpers/_token.d.ts +4 -4
- package/build/es/helpers/index.d.ts +45 -45
- package/build/es/helpers.js +6 -6
- package/build/es/index.js +2 -2
- package/build/es/types/_usuario.d.ts +3 -3
- package/build/es/types/index.d.ts +4 -3
- package/build/lib/helpers/_set_response.d.ts +20 -20
- package/build/lib/helpers/_token.d.ts +4 -4
- package/build/lib/helpers/index.d.ts +45 -45
- package/build/lib/helpers.cjs +6 -6
- package/build/lib/types/_usuario.d.ts +3 -3
- package/build/lib/types/index.d.ts +4 -3
- package/package.json +49 -48
package/README.md
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
# PADRÕES DE COMMIT UTILIZADOS NO PROJETO
|
|
2
|
-
|
|
3
|
-
🎉 start: Inicial
|
|
4
|
-
📚 docs: Atualiza README
|
|
5
|
-
🐛 fix: Corrige
|
|
6
|
-
✨ feat: Adiciona login
|
|
7
|
-
💄 feat: Estiliza formulário
|
|
8
|
-
🧱 ci: Modifica Dockerfile
|
|
9
|
-
♻️ refactor: Refatora para arrow functions
|
|
10
|
-
⚡ perf: Melhora resposta
|
|
11
|
-
💥 fix: Reverte mudanças
|
|
12
|
-
🧪 test: Adiciona teste
|
|
13
|
-
💡 docs: Comenta função
|
|
14
|
-
🗃️ raw: Adiciona dados RAW
|
|
15
|
-
🧹 cleanup: Limpa validação
|
|
16
|
-
🗑️ remove: Remove arquivos
|
|
17
|
-
|
|
18
|
-
# COMMITS NO GIT HUB
|
|
19
|
-
|
|
20
|
-
bunx npm version minor --no-git-tag-version --no-git-checks
|
|
21
|
-
git pull
|
|
22
|
-
git init
|
|
23
|
-
git add .
|
|
24
|
-
git commit -m "✨ feat: "
|
|
25
|
-
git push -u origin producao
|
|
26
|
-
npm run lib
|
|
27
|
-
|
|
28
|
-
### DESCOBRIR O IP DA PESSOA
|
|
29
|
-
|
|
30
|
-
https://cloudflare.com/cdn-cgi/trace
|
|
31
|
-
|
|
32
|
-
# Versionamento semântico (SemVer): Use o padrão X.Y.Z (Major.Minor.Patch)
|
|
33
|
-
|
|
34
|
-
X (Major): Primeiro número - aumentado quando ocorrem mudanças incompatíveis com versões anteriores (breaking changes)
|
|
35
|
-
Y (Minor): Número do meio - aumentado quando adicionados novos recursos compatíveis com versões anteriores
|
|
36
|
-
Z (Patch): Último número - aumentado para correções de bugs e pequenos ajustes que não alteram a funcionalidade existente
|
|
37
|
-
|
|
38
|
-
# COMO FONGIGURAR O ENV
|
|
39
|
-
|
|
40
|
-
frontend:
|
|
41
|
-
SRC/FRONTEND/.dev
|
|
42
|
-
backend:
|
|
43
|
-
SRC/.dev
|
|
44
|
-
|
|
45
|
-
# LINK DE IMAGENS INFINITAS
|
|
46
|
-
|
|
47
|
-
https://i.pravatar.cc/100
|
|
48
|
-
|
|
49
|
-
# FALTA TRATAR NO APP PROCURAR POR:
|
|
50
|
-
|
|
51
|
-
//ERROR
|
|
52
|
-
|
|
53
|
-
//ERROR UI/UX
|
|
54
|
-
|
|
55
|
-
//FEET
|
|
1
|
+
# PADRÕES DE COMMIT UTILIZADOS NO PROJETO
|
|
2
|
+
|
|
3
|
+
🎉 start: Inicial
|
|
4
|
+
📚 docs: Atualiza README
|
|
5
|
+
🐛 fix: Corrige bug
|
|
6
|
+
✨ feat: Adiciona login
|
|
7
|
+
💄 feat: Estiliza formulário
|
|
8
|
+
🧱 ci: Modifica Dockerfile
|
|
9
|
+
♻️ refactor: Refatora para arrow functions
|
|
10
|
+
⚡ perf: Melhora resposta
|
|
11
|
+
💥 fix: Reverte mudanças
|
|
12
|
+
🧪 test: Adiciona teste
|
|
13
|
+
💡 docs: Comenta função
|
|
14
|
+
🗃️ raw: Adiciona dados RAW
|
|
15
|
+
🧹 cleanup: Limpa validação
|
|
16
|
+
🗑️ remove: Remove arquivos
|
|
17
|
+
|
|
18
|
+
# COMMITS NO GIT HUB
|
|
19
|
+
|
|
20
|
+
bunx npm version minor --no-git-tag-version --no-git-checks
|
|
21
|
+
git pull
|
|
22
|
+
git init
|
|
23
|
+
git add .
|
|
24
|
+
git commit -m "✨ feat: "
|
|
25
|
+
git push -u origin producao
|
|
26
|
+
npm run lib
|
|
27
|
+
|
|
28
|
+
### DESCOBRIR O IP DA PESSOA
|
|
29
|
+
|
|
30
|
+
https://cloudflare.com/cdn-cgi/trace
|
|
31
|
+
|
|
32
|
+
# Versionamento semântico (SemVer): Use o padrão X.Y.Z (Major.Minor.Patch)
|
|
33
|
+
|
|
34
|
+
X (Major): Primeiro número - aumentado quando ocorrem mudanças incompatíveis com versões anteriores (breaking changes)
|
|
35
|
+
Y (Minor): Número do meio - aumentado quando adicionados novos recursos compatíveis com versões anteriores
|
|
36
|
+
Z (Patch): Último número - aumentado para correções de bugs e pequenos ajustes que não alteram a funcionalidade existente
|
|
37
|
+
|
|
38
|
+
# COMO FONGIGURAR O ENV
|
|
39
|
+
|
|
40
|
+
frontend:
|
|
41
|
+
SRC/FRONTEND/.dev
|
|
42
|
+
backend:
|
|
43
|
+
SRC/.dev
|
|
44
|
+
|
|
45
|
+
# LINK DE IMAGENS INFINITAS
|
|
46
|
+
|
|
47
|
+
https://i.pravatar.cc/100
|
|
48
|
+
|
|
49
|
+
# FALTA TRATAR NO APP PROCURAR POR:
|
|
50
|
+
|
|
51
|
+
//ERROR
|
|
52
|
+
|
|
53
|
+
//ERROR UI/UX
|
|
54
|
+
|
|
55
|
+
//FEET
|
|
@@ -9,38 +9,38 @@ export type ResponseCPayload<T = unknown> = Omit<t.Geral.Response.C.Input<T>, "c
|
|
|
9
9
|
declare const set_response: {
|
|
10
10
|
c: {
|
|
11
11
|
SUCCESS<T>({ message, results, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
12
|
+
message?: string | undefined;
|
|
13
|
+
type: "error" | "success" | "warning";
|
|
12
14
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
13
15
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
14
|
-
type: "success" | "warning" | "error";
|
|
15
|
-
message?: string | undefined;
|
|
16
16
|
results: any;
|
|
17
17
|
}, 200, "json">;
|
|
18
18
|
ACTION_REQUIRED<T>({ message, results, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
19
|
+
message?: string | undefined;
|
|
20
|
+
type: "error" | "success" | "warning";
|
|
19
21
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
20
22
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
21
|
-
type: "success" | "warning" | "error";
|
|
22
|
-
message?: string | undefined;
|
|
23
23
|
results: any;
|
|
24
24
|
}, 428, "json">;
|
|
25
25
|
CREATED<T>({ message, results, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
26
|
+
message?: string | undefined;
|
|
27
|
+
type: "error" | "success" | "warning";
|
|
26
28
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
27
29
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
28
|
-
type: "success" | "warning" | "error";
|
|
29
|
-
message?: string | undefined;
|
|
30
30
|
results: any;
|
|
31
31
|
}, 201, "json">;
|
|
32
32
|
WARNING<T>({ message, results, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
33
|
+
message?: string | undefined;
|
|
34
|
+
type: "error" | "success" | "warning";
|
|
33
35
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
34
36
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
35
|
-
type: "success" | "warning" | "error";
|
|
36
|
-
message?: string | undefined;
|
|
37
37
|
results: any;
|
|
38
38
|
}, 400, "json">;
|
|
39
39
|
AUTHORIZATION_ERROR<T>({ message, results, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
40
|
+
message?: string | undefined;
|
|
41
|
+
type: "error" | "success" | "warning";
|
|
40
42
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
41
43
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
42
|
-
type: "success" | "warning" | "error";
|
|
43
|
-
message?: string | undefined;
|
|
44
44
|
results: any;
|
|
45
45
|
}, 405, "json">;
|
|
46
46
|
SERVER_ERROR<T>({ error, c, fn }: {
|
|
@@ -48,31 +48,31 @@ declare const set_response: {
|
|
|
48
48
|
c: t.Context;
|
|
49
49
|
fn: string;
|
|
50
50
|
}): Response & import("hono").TypedResponse<{
|
|
51
|
+
message?: string | undefined;
|
|
52
|
+
type: "error" | "success" | "warning";
|
|
51
53
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
52
54
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
53
|
-
type: "success" | "warning" | "error";
|
|
54
|
-
message?: string | undefined;
|
|
55
55
|
results: any;
|
|
56
56
|
}, any, "json">;
|
|
57
57
|
UNAUTHORIZED<T>({ message, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
58
|
+
message?: string | undefined;
|
|
59
|
+
type: "error" | "success" | "warning";
|
|
58
60
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
59
61
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
60
|
-
type: "success" | "warning" | "error";
|
|
61
|
-
message?: string | undefined;
|
|
62
62
|
results: any;
|
|
63
63
|
}, 401, "json">;
|
|
64
64
|
INVALID_TOKEN<T>({ message, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
65
|
+
message?: string | undefined;
|
|
66
|
+
type: "error" | "success" | "warning";
|
|
65
67
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
66
68
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
67
|
-
type: "success" | "warning" | "error";
|
|
68
|
-
message?: string | undefined;
|
|
69
69
|
results: any;
|
|
70
70
|
}, 409, "json">;
|
|
71
71
|
NOT_FOUND<T>({ message, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
72
|
+
message?: string | undefined;
|
|
73
|
+
type: "error" | "success" | "warning";
|
|
72
74
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
73
75
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
74
|
-
type: "success" | "warning" | "error";
|
|
75
|
-
message?: string | undefined;
|
|
76
76
|
results: any;
|
|
77
77
|
}, 404, "json">;
|
|
78
78
|
SUCCESS_FILE({ message, file_buffer, content_type, filename, c, fn }: t.Geral.Response.C.FileResponseParams): Promise<(Response & import("hono").TypedResponse<{
|
|
@@ -129,10 +129,10 @@ declare const set_response: {
|
|
|
129
129
|
toSorted: never;
|
|
130
130
|
with: never;
|
|
131
131
|
}, 200, "json">) | (Response & import("hono").TypedResponse<{
|
|
132
|
+
message?: string | undefined;
|
|
133
|
+
type: "error" | "success" | "warning";
|
|
132
134
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
133
135
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
134
|
-
type: "success" | "warning" | "error";
|
|
135
|
-
message?: string | undefined;
|
|
136
136
|
results: any;
|
|
137
137
|
}, 200, "json">)>;
|
|
138
138
|
};
|
|
@@ -2,20 +2,20 @@ import type { Next } from 'hono';
|
|
|
2
2
|
import t from '../types';
|
|
3
3
|
declare const _token: {
|
|
4
4
|
verificar_token(c: t.Context, next: Next): Promise<void | (Response & import("hono").TypedResponse<{
|
|
5
|
+
message?: string | undefined;
|
|
6
|
+
type: "error" | "success" | "warning";
|
|
5
7
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
6
8
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
7
|
-
type: "success" | "warning" | "error";
|
|
8
|
-
message?: string | undefined;
|
|
9
9
|
results: any;
|
|
10
10
|
}, 409, "json">)>;
|
|
11
11
|
criar_token_login_usuario(props: t.Controller.Usuario.TokenPayload & {
|
|
12
12
|
c: t.Context;
|
|
13
13
|
}): Promise<string>;
|
|
14
14
|
verificar_token_micro_servico(c: t.Context, next: Next): Promise<void | (Response & import("hono").TypedResponse<{
|
|
15
|
+
message?: string | undefined;
|
|
16
|
+
type: "error" | "success" | "warning";
|
|
15
17
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
16
18
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
17
|
-
type: "success" | "warning" | "error";
|
|
18
|
-
message?: string | undefined;
|
|
19
19
|
results: any;
|
|
20
20
|
}, 409, "json">)>;
|
|
21
21
|
criar_token_micro_servico({ c }: {
|
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
declare const helpers: {
|
|
2
2
|
set_response: {
|
|
3
3
|
c: {
|
|
4
|
-
SUCCESS<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
4
|
+
SUCCESS<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
5
5
|
fn: string;
|
|
6
6
|
}): Response & import("hono").TypedResponse<{
|
|
7
|
+
message?: string | undefined;
|
|
8
|
+
type: "error" | "success" | "warning";
|
|
7
9
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
8
10
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
9
|
-
type: "success" | "warning" | "error";
|
|
10
|
-
message?: string | undefined;
|
|
11
11
|
results: any;
|
|
12
12
|
}, 200, "json">;
|
|
13
|
-
ACTION_REQUIRED<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
13
|
+
ACTION_REQUIRED<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
14
14
|
fn: string;
|
|
15
15
|
}): Response & import("hono").TypedResponse<{
|
|
16
|
+
message?: string | undefined;
|
|
17
|
+
type: "error" | "success" | "warning";
|
|
16
18
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
17
19
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
18
|
-
type: "success" | "warning" | "error";
|
|
19
|
-
message?: string | undefined;
|
|
20
20
|
results: any;
|
|
21
21
|
}, 428, "json">;
|
|
22
|
-
CREATED<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
22
|
+
CREATED<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
23
23
|
fn: string;
|
|
24
24
|
}): Response & import("hono").TypedResponse<{
|
|
25
|
+
message?: string | undefined;
|
|
26
|
+
type: "error" | "success" | "warning";
|
|
25
27
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
26
28
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
27
|
-
type: "success" | "warning" | "error";
|
|
28
|
-
message?: string | undefined;
|
|
29
29
|
results: any;
|
|
30
30
|
}, 201, "json">;
|
|
31
|
-
WARNING<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
31
|
+
WARNING<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
32
32
|
fn: string;
|
|
33
33
|
}): Response & import("hono").TypedResponse<{
|
|
34
|
+
message?: string | undefined;
|
|
35
|
+
type: "error" | "success" | "warning";
|
|
34
36
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
35
37
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
36
|
-
type: "success" | "warning" | "error";
|
|
37
|
-
message?: string | undefined;
|
|
38
38
|
results: any;
|
|
39
39
|
}, 400, "json">;
|
|
40
|
-
AUTHORIZATION_ERROR<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
40
|
+
AUTHORIZATION_ERROR<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
41
41
|
fn: string;
|
|
42
42
|
}): Response & import("hono").TypedResponse<{
|
|
43
|
+
message?: string | undefined;
|
|
44
|
+
type: "error" | "success" | "warning";
|
|
43
45
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
44
46
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
45
|
-
type: "success" | "warning" | "error";
|
|
46
|
-
message?: string | undefined;
|
|
47
47
|
results: any;
|
|
48
48
|
}, 405, "json">;
|
|
49
49
|
SERVER_ERROR<T>({ error, c, fn }: {
|
|
@@ -51,37 +51,37 @@ declare const helpers: {
|
|
|
51
51
|
c: import("..").TypesCore.Context;
|
|
52
52
|
fn: string;
|
|
53
53
|
}): Response & import("hono").TypedResponse<{
|
|
54
|
+
message?: string | undefined;
|
|
55
|
+
type: "error" | "success" | "warning";
|
|
54
56
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
55
57
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
56
|
-
type: "success" | "warning" | "error";
|
|
57
|
-
message?: string | undefined;
|
|
58
58
|
results: any;
|
|
59
59
|
}, any, "json">;
|
|
60
|
-
UNAUTHORIZED<T>({ message, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
60
|
+
UNAUTHORIZED<T>({ message, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
61
61
|
fn: string;
|
|
62
62
|
}): Response & import("hono").TypedResponse<{
|
|
63
|
+
message?: string | undefined;
|
|
64
|
+
type: "error" | "success" | "warning";
|
|
63
65
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
64
66
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
65
|
-
type: "success" | "warning" | "error";
|
|
66
|
-
message?: string | undefined;
|
|
67
67
|
results: any;
|
|
68
68
|
}, 401, "json">;
|
|
69
|
-
INVALID_TOKEN<T>({ message, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
69
|
+
INVALID_TOKEN<T>({ message, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
70
70
|
fn: string;
|
|
71
71
|
}): Response & import("hono").TypedResponse<{
|
|
72
|
+
message?: string | undefined;
|
|
73
|
+
type: "error" | "success" | "warning";
|
|
72
74
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
73
75
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
74
|
-
type: "success" | "warning" | "error";
|
|
75
|
-
message?: string | undefined;
|
|
76
76
|
results: any;
|
|
77
77
|
}, 409, "json">;
|
|
78
|
-
NOT_FOUND<T>({ message, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
78
|
+
NOT_FOUND<T>({ message, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
79
79
|
fn: string;
|
|
80
80
|
}): Response & import("hono").TypedResponse<{
|
|
81
|
+
message?: string | undefined;
|
|
82
|
+
type: "error" | "success" | "warning";
|
|
81
83
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
82
84
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
83
|
-
type: "success" | "warning" | "error";
|
|
84
|
-
message?: string | undefined;
|
|
85
85
|
results: any;
|
|
86
86
|
}, 404, "json">;
|
|
87
87
|
SUCCESS_FILE({ message, file_buffer, content_type, filename, c, fn }: import("../types/_type_response").default.C.FileResponseParams): Promise<(Response & import("hono").TypedResponse<{
|
|
@@ -138,75 +138,75 @@ declare const helpers: {
|
|
|
138
138
|
toSorted: never;
|
|
139
139
|
with: never;
|
|
140
140
|
}, 200, "json">) | (Response & import("hono").TypedResponse<{
|
|
141
|
+
message?: string | undefined;
|
|
142
|
+
type: "error" | "success" | "warning";
|
|
141
143
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
142
144
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
143
|
-
type: "success" | "warning" | "error";
|
|
144
|
-
message?: string | undefined;
|
|
145
145
|
results: any;
|
|
146
146
|
}, 200, "json">)>;
|
|
147
147
|
};
|
|
148
148
|
error: {
|
|
149
|
-
ACTION_REQUIRED({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
149
|
+
ACTION_REQUIRED({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
150
150
|
fn: string;
|
|
151
151
|
}): void;
|
|
152
|
-
WARNING({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
152
|
+
WARNING({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
153
153
|
fn: string;
|
|
154
154
|
}): void;
|
|
155
|
-
ERROR({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
155
|
+
ERROR({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
156
156
|
fn: string;
|
|
157
157
|
}): void;
|
|
158
|
-
TOKEN_AUTH_USER({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
158
|
+
TOKEN_AUTH_USER({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
159
159
|
fn: string;
|
|
160
160
|
}): void;
|
|
161
|
-
AUTHORIZATION_ERROR({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
161
|
+
AUTHORIZATION_ERROR({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
162
162
|
fn: string;
|
|
163
163
|
}): void;
|
|
164
|
-
DATABASE_ERROR({ message, erro, fn }: (Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
164
|
+
DATABASE_ERROR({ message, erro, fn }: (Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
165
165
|
fn: string;
|
|
166
166
|
}) & {
|
|
167
167
|
erro: any;
|
|
168
168
|
}): void;
|
|
169
|
-
SCHEMA_VALIDATION({ results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
169
|
+
SCHEMA_VALIDATION({ results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
170
170
|
fn: string;
|
|
171
171
|
}): void;
|
|
172
|
-
UNAUTHORIZED({ message, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
172
|
+
UNAUTHORIZED({ message, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
173
173
|
fn: string;
|
|
174
174
|
}): void;
|
|
175
|
-
INTEGRATION_ERROR({ message, fn, erro }: (Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
175
|
+
INTEGRATION_ERROR({ message, fn, erro }: (Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
176
176
|
fn: string;
|
|
177
177
|
}) & {
|
|
178
178
|
erro: any;
|
|
179
179
|
}): void;
|
|
180
|
-
INVALID_TOKEN({ message, fn, results }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
180
|
+
INVALID_TOKEN({ message, fn, results }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
181
181
|
fn: string;
|
|
182
182
|
}): void;
|
|
183
|
-
NOT_FOUND({ message, fn, results }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
183
|
+
NOT_FOUND({ message, fn, results }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
184
184
|
fn: string;
|
|
185
185
|
}): void;
|
|
186
|
-
BUSINESS_RULE_VIOLATION({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
186
|
+
BUSINESS_RULE_VIOLATION({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
187
187
|
fn: string;
|
|
188
188
|
}): void;
|
|
189
|
-
PLAN_FORBIDDEN({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
189
|
+
PLAN_FORBIDDEN({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
190
190
|
fn: string;
|
|
191
191
|
}): void;
|
|
192
192
|
};
|
|
193
193
|
};
|
|
194
194
|
token: {
|
|
195
195
|
verificar_token(c: import("..").TypesCore.Context, next: import("hono").Next): Promise<void | (Response & import("hono").TypedResponse<{
|
|
196
|
+
message?: string | undefined;
|
|
197
|
+
type: "error" | "success" | "warning";
|
|
196
198
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
197
199
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
198
|
-
type: "success" | "warning" | "error";
|
|
199
|
-
message?: string | undefined;
|
|
200
200
|
results: any;
|
|
201
201
|
}, 409, "json">)>;
|
|
202
202
|
criar_token_login_usuario(props: import("../types/_usuario").default.TokenPayload & {
|
|
203
203
|
c: import("..").TypesCore.Context;
|
|
204
204
|
}): Promise<string>;
|
|
205
205
|
verificar_token_micro_servico(c: import("..").TypesCore.Context, next: import("hono").Next): Promise<void | (Response & import("hono").TypedResponse<{
|
|
206
|
+
message?: string | undefined;
|
|
207
|
+
type: "error" | "success" | "warning";
|
|
206
208
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
207
209
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
208
|
-
type: "success" | "warning" | "error";
|
|
209
|
-
message?: string | undefined;
|
|
210
210
|
results: any;
|
|
211
211
|
}, 409, "json">)>;
|
|
212
212
|
criar_token_micro_servico({ c }: {
|
package/build/es/helpers.js
CHANGED
|
@@ -525,7 +525,7 @@ const _token = new class {
|
|
|
525
525
|
results: [],
|
|
526
526
|
fn: _token_fn
|
|
527
527
|
});
|
|
528
|
-
const secret = new TextEncoder().encode(c.env.JSON_WEB_TOKEN_AUTH_USER);
|
|
528
|
+
const secret = new TextEncoder().encode(await c.env.JSON_WEB_TOKEN_AUTH_USER.get());
|
|
529
529
|
const { payload } = await jwtVerify(token, secret);
|
|
530
530
|
if (!payload._id || !payload.email) return _set_response.c.INVALID_TOKEN({
|
|
531
531
|
message: 'Token inválido!!!!',
|
|
@@ -574,7 +574,7 @@ const _token = new class {
|
|
|
574
574
|
plano_status: props?.plano_status
|
|
575
575
|
}).setProtectedHeader({
|
|
576
576
|
alg: "HS256"
|
|
577
|
-
}).setIssuedAt().setExpirationTime("1h").sign(new TextEncoder().encode(props?.c.env.JSON_WEB_TOKEN_AUTH_USER)).catch((error)=>_set_response.error.TOKEN_AUTH_USER({
|
|
577
|
+
}).setIssuedAt().setExpirationTime("1h").sign(new TextEncoder().encode(await props?.c.env.JSON_WEB_TOKEN_AUTH_USER.get())).catch((error)=>_set_response.error.TOKEN_AUTH_USER({
|
|
578
578
|
message: "Erro ao gerar token auth user!",
|
|
579
579
|
results: error?.message,
|
|
580
580
|
fn: _token_fn
|
|
@@ -597,7 +597,7 @@ const _token = new class {
|
|
|
597
597
|
results: [],
|
|
598
598
|
fn: _token_fn
|
|
599
599
|
});
|
|
600
|
-
const secret = new TextEncoder().encode(c.env.JSON_WEB_TOKEN_AUTH_MICRO_SERVICO);
|
|
600
|
+
const secret = new TextEncoder().encode(await c.env.JSON_WEB_TOKEN_AUTH_MICRO_SERVICO.get());
|
|
601
601
|
const { payload } = await jwtVerify(token, secret);
|
|
602
602
|
if (!payload._id || !payload.email) return _set_response.c.INVALID_TOKEN({
|
|
603
603
|
message: 'Token inválido para o serviço!',
|
|
@@ -646,7 +646,7 @@ const _token = new class {
|
|
|
646
646
|
plano_status: usuario_auth?.plano_status
|
|
647
647
|
}).setProtectedHeader({
|
|
648
648
|
alg: "HS256"
|
|
649
|
-
}).setIssuedAt().setExpirationTime("30s").sign(new TextEncoder().encode(c.env.JSON_WEB_TOKEN_AUTH_MICRO_SERVICO)).catch((error)=>_set_response.error.TOKEN_AUTH_USER({
|
|
649
|
+
}).setIssuedAt().setExpirationTime("30s").sign(new TextEncoder().encode(await c.env.JSON_WEB_TOKEN_AUTH_MICRO_SERVICO.get())).catch((error)=>_set_response.error.TOKEN_AUTH_USER({
|
|
650
650
|
message: "Erro ao gerar token micro serviço!",
|
|
651
651
|
results: error?.message,
|
|
652
652
|
fn: _token_fn
|
|
@@ -663,7 +663,7 @@ const _token = new class {
|
|
|
663
663
|
usuario_id: usuario_id
|
|
664
664
|
}).setProtectedHeader({
|
|
665
665
|
alg: "HS256"
|
|
666
|
-
}).setIssuedAt().setExpirationTime("2h").sign(new TextEncoder().encode(env.JSON_WEB_REFRESH_TOKEN_AUTH_USER)).catch((error)=>_set_response.error.TOKEN_AUTH_USER({
|
|
666
|
+
}).setIssuedAt().setExpirationTime("2h").sign(new TextEncoder().encode(await env.JSON_WEB_REFRESH_TOKEN_AUTH_USER?.get())).catch((error)=>_set_response.error.TOKEN_AUTH_USER({
|
|
667
667
|
message: "Erro ao gerar refresh token!",
|
|
668
668
|
fn: _token_fn
|
|
669
669
|
}));
|
|
@@ -671,7 +671,7 @@ const _token = new class {
|
|
|
671
671
|
}
|
|
672
672
|
async verificar_refresh_token({ env, refresh_token }) {
|
|
673
673
|
try {
|
|
674
|
-
const secret_verify = new TextEncoder().encode(env.JSON_WEB_REFRESH_TOKEN_AUTH_USER);
|
|
674
|
+
const secret_verify = new TextEncoder().encode(await env.JSON_WEB_REFRESH_TOKEN_AUTH_USER?.get());
|
|
675
675
|
const { payload } = await jwtVerify(refresh_token, secret_verify);
|
|
676
676
|
return payload;
|
|
677
677
|
} catch (error) {
|
package/build/es/index.js
CHANGED
|
@@ -175,7 +175,7 @@ const _session_storage = new class {
|
|
|
175
175
|
}
|
|
176
176
|
get_item_session_storage(chave) {
|
|
177
177
|
try {
|
|
178
|
-
if ("
|
|
178
|
+
if ("u" > typeof window) {
|
|
179
179
|
const valorAtual = window.sessionStorage.getItem(chave);
|
|
180
180
|
return valorAtual ? JSON.parse(valorAtual) : valorAtual;
|
|
181
181
|
}
|
|
@@ -534,7 +534,7 @@ const _local_storage = new class {
|
|
|
534
534
|
}
|
|
535
535
|
get_item_local_storage(chave) {
|
|
536
536
|
try {
|
|
537
|
-
if ("
|
|
537
|
+
if ("u" > typeof window) {
|
|
538
538
|
const valorAtual = window.localStorage.getItem(chave);
|
|
539
539
|
return valorAtual ? JSON.parse(valorAtual) : valorAtual;
|
|
540
540
|
}
|
|
@@ -17,12 +17,12 @@ declare namespace TypeControllerUsuario {
|
|
|
17
17
|
padrao: "padrao";
|
|
18
18
|
}>;
|
|
19
19
|
const AssinaturaStatusEnumZod: z4.ZodEnum<{
|
|
20
|
-
active: "active";
|
|
21
|
-
canceled: "canceled";
|
|
22
20
|
incomplete: "incomplete";
|
|
21
|
+
paused: "paused";
|
|
22
|
+
canceled: "canceled";
|
|
23
|
+
active: "active";
|
|
23
24
|
incomplete_expired: "incomplete_expired";
|
|
24
25
|
past_due: "past_due";
|
|
25
|
-
paused: "paused";
|
|
26
26
|
trialing: "trialing";
|
|
27
27
|
unpaid: "unpaid";
|
|
28
28
|
}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Context as HonoContext } from "hono";
|
|
2
|
+
import { SecretsStoreSecret } from "@cloudflare/workers-types";
|
|
2
3
|
import TypeControllerUsuario from "./_usuario";
|
|
3
4
|
import TypeControllerResponse from "./_type_response";
|
|
4
5
|
declare namespace t {
|
|
@@ -11,9 +12,9 @@ declare namespace t {
|
|
|
11
12
|
}
|
|
12
13
|
type Env = {
|
|
13
14
|
Bindings: {
|
|
14
|
-
JSON_WEB_TOKEN_AUTH_USER
|
|
15
|
-
JSON_WEB_TOKEN_AUTH_MICRO_SERVICO
|
|
16
|
-
JSON_WEB_REFRESH_TOKEN_AUTH_USER?:
|
|
15
|
+
JSON_WEB_TOKEN_AUTH_USER: SecretsStoreSecret;
|
|
16
|
+
JSON_WEB_TOKEN_AUTH_MICRO_SERVICO: SecretsStoreSecret;
|
|
17
|
+
JSON_WEB_REFRESH_TOKEN_AUTH_USER?: SecretsStoreSecret;
|
|
17
18
|
};
|
|
18
19
|
Variables: {
|
|
19
20
|
usuario_auth: TypeControllerUsuario.TokenPayload;
|
|
@@ -9,38 +9,38 @@ export type ResponseCPayload<T = unknown> = Omit<t.Geral.Response.C.Input<T>, "c
|
|
|
9
9
|
declare const set_response: {
|
|
10
10
|
c: {
|
|
11
11
|
SUCCESS<T>({ message, results, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
12
|
+
message?: string | undefined;
|
|
13
|
+
type: "error" | "success" | "warning";
|
|
12
14
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
13
15
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
14
|
-
type: "success" | "warning" | "error";
|
|
15
|
-
message?: string | undefined;
|
|
16
16
|
results: any;
|
|
17
17
|
}, 200, "json">;
|
|
18
18
|
ACTION_REQUIRED<T>({ message, results, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
19
|
+
message?: string | undefined;
|
|
20
|
+
type: "error" | "success" | "warning";
|
|
19
21
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
20
22
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
21
|
-
type: "success" | "warning" | "error";
|
|
22
|
-
message?: string | undefined;
|
|
23
23
|
results: any;
|
|
24
24
|
}, 428, "json">;
|
|
25
25
|
CREATED<T>({ message, results, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
26
|
+
message?: string | undefined;
|
|
27
|
+
type: "error" | "success" | "warning";
|
|
26
28
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
27
29
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
28
|
-
type: "success" | "warning" | "error";
|
|
29
|
-
message?: string | undefined;
|
|
30
30
|
results: any;
|
|
31
31
|
}, 201, "json">;
|
|
32
32
|
WARNING<T>({ message, results, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
33
|
+
message?: string | undefined;
|
|
34
|
+
type: "error" | "success" | "warning";
|
|
33
35
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
34
36
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
35
|
-
type: "success" | "warning" | "error";
|
|
36
|
-
message?: string | undefined;
|
|
37
37
|
results: any;
|
|
38
38
|
}, 400, "json">;
|
|
39
39
|
AUTHORIZATION_ERROR<T>({ message, results, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
40
|
+
message?: string | undefined;
|
|
41
|
+
type: "error" | "success" | "warning";
|
|
40
42
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
41
43
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
42
|
-
type: "success" | "warning" | "error";
|
|
43
|
-
message?: string | undefined;
|
|
44
44
|
results: any;
|
|
45
45
|
}, 405, "json">;
|
|
46
46
|
SERVER_ERROR<T>({ error, c, fn }: {
|
|
@@ -48,31 +48,31 @@ declare const set_response: {
|
|
|
48
48
|
c: t.Context;
|
|
49
49
|
fn: string;
|
|
50
50
|
}): Response & import("hono").TypedResponse<{
|
|
51
|
+
message?: string | undefined;
|
|
52
|
+
type: "error" | "success" | "warning";
|
|
51
53
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
52
54
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
53
|
-
type: "success" | "warning" | "error";
|
|
54
|
-
message?: string | undefined;
|
|
55
55
|
results: any;
|
|
56
56
|
}, any, "json">;
|
|
57
57
|
UNAUTHORIZED<T>({ message, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
58
|
+
message?: string | undefined;
|
|
59
|
+
type: "error" | "success" | "warning";
|
|
58
60
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
59
61
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
60
|
-
type: "success" | "warning" | "error";
|
|
61
|
-
message?: string | undefined;
|
|
62
62
|
results: any;
|
|
63
63
|
}, 401, "json">;
|
|
64
64
|
INVALID_TOKEN<T>({ message, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
65
|
+
message?: string | undefined;
|
|
66
|
+
type: "error" | "success" | "warning";
|
|
65
67
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
66
68
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
67
|
-
type: "success" | "warning" | "error";
|
|
68
|
-
message?: string | undefined;
|
|
69
69
|
results: any;
|
|
70
70
|
}, 409, "json">;
|
|
71
71
|
NOT_FOUND<T>({ message, c, fn }: ResponseCOmmit): Response & import("hono").TypedResponse<{
|
|
72
|
+
message?: string | undefined;
|
|
73
|
+
type: "error" | "success" | "warning";
|
|
72
74
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
73
75
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
74
|
-
type: "success" | "warning" | "error";
|
|
75
|
-
message?: string | undefined;
|
|
76
76
|
results: any;
|
|
77
77
|
}, 404, "json">;
|
|
78
78
|
SUCCESS_FILE({ message, file_buffer, content_type, filename, c, fn }: t.Geral.Response.C.FileResponseParams): Promise<(Response & import("hono").TypedResponse<{
|
|
@@ -129,10 +129,10 @@ declare const set_response: {
|
|
|
129
129
|
toSorted: never;
|
|
130
130
|
with: never;
|
|
131
131
|
}, 200, "json">) | (Response & import("hono").TypedResponse<{
|
|
132
|
+
message?: string | undefined;
|
|
133
|
+
type: "error" | "success" | "warning";
|
|
132
134
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
133
135
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
134
|
-
type: "success" | "warning" | "error";
|
|
135
|
-
message?: string | undefined;
|
|
136
136
|
results: any;
|
|
137
137
|
}, 200, "json">)>;
|
|
138
138
|
};
|
|
@@ -2,20 +2,20 @@ import type { Next } from 'hono';
|
|
|
2
2
|
import t from '../types';
|
|
3
3
|
declare const _token: {
|
|
4
4
|
verificar_token(c: t.Context, next: Next): Promise<void | (Response & import("hono").TypedResponse<{
|
|
5
|
+
message?: string | undefined;
|
|
6
|
+
type: "error" | "success" | "warning";
|
|
5
7
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
6
8
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
7
|
-
type: "success" | "warning" | "error";
|
|
8
|
-
message?: string | undefined;
|
|
9
9
|
results: any;
|
|
10
10
|
}, 409, "json">)>;
|
|
11
11
|
criar_token_login_usuario(props: t.Controller.Usuario.TokenPayload & {
|
|
12
12
|
c: t.Context;
|
|
13
13
|
}): Promise<string>;
|
|
14
14
|
verificar_token_micro_servico(c: t.Context, next: Next): Promise<void | (Response & import("hono").TypedResponse<{
|
|
15
|
+
message?: string | undefined;
|
|
16
|
+
type: "error" | "success" | "warning";
|
|
15
17
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
16
18
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
17
|
-
type: "success" | "warning" | "error";
|
|
18
|
-
message?: string | undefined;
|
|
19
19
|
results: any;
|
|
20
20
|
}, 409, "json">)>;
|
|
21
21
|
criar_token_micro_servico({ c }: {
|
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
declare const helpers: {
|
|
2
2
|
set_response: {
|
|
3
3
|
c: {
|
|
4
|
-
SUCCESS<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
4
|
+
SUCCESS<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
5
5
|
fn: string;
|
|
6
6
|
}): Response & import("hono").TypedResponse<{
|
|
7
|
+
message?: string | undefined;
|
|
8
|
+
type: "error" | "success" | "warning";
|
|
7
9
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
8
10
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
9
|
-
type: "success" | "warning" | "error";
|
|
10
|
-
message?: string | undefined;
|
|
11
11
|
results: any;
|
|
12
12
|
}, 200, "json">;
|
|
13
|
-
ACTION_REQUIRED<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
13
|
+
ACTION_REQUIRED<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
14
14
|
fn: string;
|
|
15
15
|
}): Response & import("hono").TypedResponse<{
|
|
16
|
+
message?: string | undefined;
|
|
17
|
+
type: "error" | "success" | "warning";
|
|
16
18
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
17
19
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
18
|
-
type: "success" | "warning" | "error";
|
|
19
|
-
message?: string | undefined;
|
|
20
20
|
results: any;
|
|
21
21
|
}, 428, "json">;
|
|
22
|
-
CREATED<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
22
|
+
CREATED<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
23
23
|
fn: string;
|
|
24
24
|
}): Response & import("hono").TypedResponse<{
|
|
25
|
+
message?: string | undefined;
|
|
26
|
+
type: "error" | "success" | "warning";
|
|
25
27
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
26
28
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
27
|
-
type: "success" | "warning" | "error";
|
|
28
|
-
message?: string | undefined;
|
|
29
29
|
results: any;
|
|
30
30
|
}, 201, "json">;
|
|
31
|
-
WARNING<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
31
|
+
WARNING<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
32
32
|
fn: string;
|
|
33
33
|
}): Response & import("hono").TypedResponse<{
|
|
34
|
+
message?: string | undefined;
|
|
35
|
+
type: "error" | "success" | "warning";
|
|
34
36
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
35
37
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
36
|
-
type: "success" | "warning" | "error";
|
|
37
|
-
message?: string | undefined;
|
|
38
38
|
results: any;
|
|
39
39
|
}, 400, "json">;
|
|
40
|
-
AUTHORIZATION_ERROR<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
40
|
+
AUTHORIZATION_ERROR<T>({ message, results, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
41
41
|
fn: string;
|
|
42
42
|
}): Response & import("hono").TypedResponse<{
|
|
43
|
+
message?: string | undefined;
|
|
44
|
+
type: "error" | "success" | "warning";
|
|
43
45
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
44
46
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
45
|
-
type: "success" | "warning" | "error";
|
|
46
|
-
message?: string | undefined;
|
|
47
47
|
results: any;
|
|
48
48
|
}, 405, "json">;
|
|
49
49
|
SERVER_ERROR<T>({ error, c, fn }: {
|
|
@@ -51,37 +51,37 @@ declare const helpers: {
|
|
|
51
51
|
c: import("..").TypesCore.Context;
|
|
52
52
|
fn: string;
|
|
53
53
|
}): Response & import("hono").TypedResponse<{
|
|
54
|
+
message?: string | undefined;
|
|
55
|
+
type: "error" | "success" | "warning";
|
|
54
56
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
55
57
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
56
|
-
type: "success" | "warning" | "error";
|
|
57
|
-
message?: string | undefined;
|
|
58
58
|
results: any;
|
|
59
59
|
}, any, "json">;
|
|
60
|
-
UNAUTHORIZED<T>({ message, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
60
|
+
UNAUTHORIZED<T>({ message, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
61
61
|
fn: string;
|
|
62
62
|
}): Response & import("hono").TypedResponse<{
|
|
63
|
+
message?: string | undefined;
|
|
64
|
+
type: "error" | "success" | "warning";
|
|
63
65
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
64
66
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
65
|
-
type: "success" | "warning" | "error";
|
|
66
|
-
message?: string | undefined;
|
|
67
67
|
results: any;
|
|
68
68
|
}, 401, "json">;
|
|
69
|
-
INVALID_TOKEN<T>({ message, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
69
|
+
INVALID_TOKEN<T>({ message, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
70
70
|
fn: string;
|
|
71
71
|
}): Response & import("hono").TypedResponse<{
|
|
72
|
+
message?: string | undefined;
|
|
73
|
+
type: "error" | "success" | "warning";
|
|
72
74
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
73
75
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
74
|
-
type: "success" | "warning" | "error";
|
|
75
|
-
message?: string | undefined;
|
|
76
76
|
results: any;
|
|
77
77
|
}, 409, "json">;
|
|
78
|
-
NOT_FOUND<T>({ message, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "
|
|
78
|
+
NOT_FOUND<T>({ message, c, fn }: Omit<import("../types/_type_response").default.C.Input<unknown>, "type" | "status" | "code"> & {
|
|
79
79
|
fn: string;
|
|
80
80
|
}): Response & import("hono").TypedResponse<{
|
|
81
|
+
message?: string | undefined;
|
|
82
|
+
type: "error" | "success" | "warning";
|
|
81
83
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
82
84
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
83
|
-
type: "success" | "warning" | "error";
|
|
84
|
-
message?: string | undefined;
|
|
85
85
|
results: any;
|
|
86
86
|
}, 404, "json">;
|
|
87
87
|
SUCCESS_FILE({ message, file_buffer, content_type, filename, c, fn }: import("../types/_type_response").default.C.FileResponseParams): Promise<(Response & import("hono").TypedResponse<{
|
|
@@ -138,75 +138,75 @@ declare const helpers: {
|
|
|
138
138
|
toSorted: never;
|
|
139
139
|
with: never;
|
|
140
140
|
}, 200, "json">) | (Response & import("hono").TypedResponse<{
|
|
141
|
+
message?: string | undefined;
|
|
142
|
+
type: "error" | "success" | "warning";
|
|
141
143
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
142
144
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
143
|
-
type: "success" | "warning" | "error";
|
|
144
|
-
message?: string | undefined;
|
|
145
145
|
results: any;
|
|
146
146
|
}, 200, "json">)>;
|
|
147
147
|
};
|
|
148
148
|
error: {
|
|
149
|
-
ACTION_REQUIRED({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
149
|
+
ACTION_REQUIRED({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
150
150
|
fn: string;
|
|
151
151
|
}): void;
|
|
152
|
-
WARNING({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
152
|
+
WARNING({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
153
153
|
fn: string;
|
|
154
154
|
}): void;
|
|
155
|
-
ERROR({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
155
|
+
ERROR({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
156
156
|
fn: string;
|
|
157
157
|
}): void;
|
|
158
|
-
TOKEN_AUTH_USER({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
158
|
+
TOKEN_AUTH_USER({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
159
159
|
fn: string;
|
|
160
160
|
}): void;
|
|
161
|
-
AUTHORIZATION_ERROR({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
161
|
+
AUTHORIZATION_ERROR({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
162
162
|
fn: string;
|
|
163
163
|
}): void;
|
|
164
|
-
DATABASE_ERROR({ message, erro, fn }: (Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
164
|
+
DATABASE_ERROR({ message, erro, fn }: (Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
165
165
|
fn: string;
|
|
166
166
|
}) & {
|
|
167
167
|
erro: any;
|
|
168
168
|
}): void;
|
|
169
|
-
SCHEMA_VALIDATION({ results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
169
|
+
SCHEMA_VALIDATION({ results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
170
170
|
fn: string;
|
|
171
171
|
}): void;
|
|
172
|
-
UNAUTHORIZED({ message, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
172
|
+
UNAUTHORIZED({ message, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
173
173
|
fn: string;
|
|
174
174
|
}): void;
|
|
175
|
-
INTEGRATION_ERROR({ message, fn, erro }: (Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
175
|
+
INTEGRATION_ERROR({ message, fn, erro }: (Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
176
176
|
fn: string;
|
|
177
177
|
}) & {
|
|
178
178
|
erro: any;
|
|
179
179
|
}): void;
|
|
180
|
-
INVALID_TOKEN({ message, fn, results }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
180
|
+
INVALID_TOKEN({ message, fn, results }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
181
181
|
fn: string;
|
|
182
182
|
}): void;
|
|
183
|
-
NOT_FOUND({ message, fn, results }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
183
|
+
NOT_FOUND({ message, fn, results }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
184
184
|
fn: string;
|
|
185
185
|
}): void;
|
|
186
|
-
BUSINESS_RULE_VIOLATION({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
186
|
+
BUSINESS_RULE_VIOLATION({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
187
187
|
fn: string;
|
|
188
188
|
}): void;
|
|
189
|
-
PLAN_FORBIDDEN({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "
|
|
189
|
+
PLAN_FORBIDDEN({ message, results, fn }: Omit<import("../types/_type_response").default.Error.Input<unknown>, "type" | "status" | "code"> & {
|
|
190
190
|
fn: string;
|
|
191
191
|
}): void;
|
|
192
192
|
};
|
|
193
193
|
};
|
|
194
194
|
token: {
|
|
195
195
|
verificar_token(c: import("..").TypesCore.Context, next: import("hono").Next): Promise<void | (Response & import("hono").TypedResponse<{
|
|
196
|
+
message?: string | undefined;
|
|
197
|
+
type: "error" | "success" | "warning";
|
|
196
198
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
197
199
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
198
|
-
type: "success" | "warning" | "error";
|
|
199
|
-
message?: string | undefined;
|
|
200
200
|
results: any;
|
|
201
201
|
}, 409, "json">)>;
|
|
202
202
|
criar_token_login_usuario(props: import("../types/_usuario").default.TokenPayload & {
|
|
203
203
|
c: import("..").TypesCore.Context;
|
|
204
204
|
}): Promise<string>;
|
|
205
205
|
verificar_token_micro_servico(c: import("..").TypesCore.Context, next: import("hono").Next): Promise<void | (Response & import("hono").TypedResponse<{
|
|
206
|
+
message?: string | undefined;
|
|
207
|
+
type: "error" | "success" | "warning";
|
|
206
208
|
status: 200 | 201 | 202 | 204 | 400 | 401 | 403 | 404 | 409 | 422 | 500 | 428 | 405;
|
|
207
209
|
code: "SUCCESS" | "ACTION_REQUIRED" | "CREATED" | "WARNING" | "ERROR" | "AUTHORIZATION_ERROR" | "SCHEMA_VALIDATION" | "SERVER_ERROR" | "UNAUTHORIZED" | "INVALID_TOKEN" | "NOT_FOUND" | "SUCCESS_FILE" | "DATABASE_ERROR" | "BUSINESS_RULE_VIOLATION" | "PLAN_FORBIDDEN" | "INTEGRATION_ERROR" | "TOKEN_AUTH_USER";
|
|
208
|
-
type: "success" | "warning" | "error";
|
|
209
|
-
message?: string | undefined;
|
|
210
210
|
results: any;
|
|
211
211
|
}, 409, "json">)>;
|
|
212
212
|
criar_token_micro_servico({ c }: {
|
package/build/lib/helpers.cjs
CHANGED
|
@@ -601,7 +601,7 @@ const _token = new class _token {
|
|
|
601
601
|
results: [],
|
|
602
602
|
fn: _token_fn
|
|
603
603
|
});
|
|
604
|
-
const secret = new TextEncoder().encode(c.env.JSON_WEB_TOKEN_AUTH_USER);
|
|
604
|
+
const secret = new TextEncoder().encode(await c.env.JSON_WEB_TOKEN_AUTH_USER.get());
|
|
605
605
|
const { payload } = await external_jose_namespaceObject.jwtVerify(token, secret);
|
|
606
606
|
if (!payload._id || !payload.email) {
|
|
607
607
|
return _set_response.c.INVALID_TOKEN({
|
|
@@ -654,7 +654,7 @@ const _token = new class _token {
|
|
|
654
654
|
plano_status: props?.plano_status
|
|
655
655
|
}).setProtectedHeader({
|
|
656
656
|
alg: "HS256"
|
|
657
|
-
}).setIssuedAt().setExpirationTime("1h").sign(new TextEncoder().encode(props?.c.env.JSON_WEB_TOKEN_AUTH_USER)).catch((error)=>{
|
|
657
|
+
}).setIssuedAt().setExpirationTime("1h").sign(new TextEncoder().encode(await props?.c.env.JSON_WEB_TOKEN_AUTH_USER.get())).catch((error)=>{
|
|
658
658
|
return _set_response.error.TOKEN_AUTH_USER({
|
|
659
659
|
message: "Erro ao gerar token auth user!",
|
|
660
660
|
results: error?.message,
|
|
@@ -679,7 +679,7 @@ const _token = new class _token {
|
|
|
679
679
|
results: [],
|
|
680
680
|
fn: _token_fn
|
|
681
681
|
});
|
|
682
|
-
const secret = new TextEncoder().encode(c.env.JSON_WEB_TOKEN_AUTH_MICRO_SERVICO);
|
|
682
|
+
const secret = new TextEncoder().encode(await c.env.JSON_WEB_TOKEN_AUTH_MICRO_SERVICO.get());
|
|
683
683
|
const { payload } = await external_jose_namespaceObject.jwtVerify(token, secret);
|
|
684
684
|
if (!payload._id || !payload.email) {
|
|
685
685
|
return _set_response.c.INVALID_TOKEN({
|
|
@@ -732,7 +732,7 @@ const _token = new class _token {
|
|
|
732
732
|
plano_status: usuario_auth?.plano_status
|
|
733
733
|
}).setProtectedHeader({
|
|
734
734
|
alg: "HS256"
|
|
735
|
-
}).setIssuedAt().setExpirationTime("30s").sign(new TextEncoder().encode(c.env.JSON_WEB_TOKEN_AUTH_MICRO_SERVICO)).catch((error)=>{
|
|
735
|
+
}).setIssuedAt().setExpirationTime("30s").sign(new TextEncoder().encode(await c.env.JSON_WEB_TOKEN_AUTH_MICRO_SERVICO.get())).catch((error)=>{
|
|
736
736
|
return _set_response.error.TOKEN_AUTH_USER({
|
|
737
737
|
message: "Erro ao gerar token micro serviço!",
|
|
738
738
|
results: error?.message,
|
|
@@ -753,7 +753,7 @@ const _token = new class _token {
|
|
|
753
753
|
usuario_id: usuario_id
|
|
754
754
|
}).setProtectedHeader({
|
|
755
755
|
alg: "HS256"
|
|
756
|
-
}).setIssuedAt().setExpirationTime("2h").sign(new TextEncoder().encode(env.JSON_WEB_REFRESH_TOKEN_AUTH_USER)).catch((error)=>{
|
|
756
|
+
}).setIssuedAt().setExpirationTime("2h").sign(new TextEncoder().encode(await env.JSON_WEB_REFRESH_TOKEN_AUTH_USER?.get())).catch((error)=>{
|
|
757
757
|
return _set_response.error.TOKEN_AUTH_USER({
|
|
758
758
|
message: "Erro ao gerar refresh token!",
|
|
759
759
|
fn: _token_fn
|
|
@@ -764,7 +764,7 @@ const _token = new class _token {
|
|
|
764
764
|
async verificar_refresh_token({ env, refresh_token }) {
|
|
765
765
|
try {
|
|
766
766
|
if (!refresh_token) false;
|
|
767
|
-
const secret_verify = new TextEncoder().encode(env.JSON_WEB_REFRESH_TOKEN_AUTH_USER);
|
|
767
|
+
const secret_verify = new TextEncoder().encode(await env.JSON_WEB_REFRESH_TOKEN_AUTH_USER?.get());
|
|
768
768
|
const { payload } = await external_jose_namespaceObject.jwtVerify(refresh_token, secret_verify);
|
|
769
769
|
return payload;
|
|
770
770
|
} catch (error) {
|
|
@@ -17,12 +17,12 @@ declare namespace TypeControllerUsuario {
|
|
|
17
17
|
padrao: "padrao";
|
|
18
18
|
}>;
|
|
19
19
|
const AssinaturaStatusEnumZod: z4.ZodEnum<{
|
|
20
|
-
active: "active";
|
|
21
|
-
canceled: "canceled";
|
|
22
20
|
incomplete: "incomplete";
|
|
21
|
+
paused: "paused";
|
|
22
|
+
canceled: "canceled";
|
|
23
|
+
active: "active";
|
|
23
24
|
incomplete_expired: "incomplete_expired";
|
|
24
25
|
past_due: "past_due";
|
|
25
|
-
paused: "paused";
|
|
26
26
|
trialing: "trialing";
|
|
27
27
|
unpaid: "unpaid";
|
|
28
28
|
}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Context as HonoContext } from "hono";
|
|
2
|
+
import { SecretsStoreSecret } from "@cloudflare/workers-types";
|
|
2
3
|
import TypeControllerUsuario from "./_usuario";
|
|
3
4
|
import TypeControllerResponse from "./_type_response";
|
|
4
5
|
declare namespace t {
|
|
@@ -11,9 +12,9 @@ declare namespace t {
|
|
|
11
12
|
}
|
|
12
13
|
type Env = {
|
|
13
14
|
Bindings: {
|
|
14
|
-
JSON_WEB_TOKEN_AUTH_USER
|
|
15
|
-
JSON_WEB_TOKEN_AUTH_MICRO_SERVICO
|
|
16
|
-
JSON_WEB_REFRESH_TOKEN_AUTH_USER?:
|
|
15
|
+
JSON_WEB_TOKEN_AUTH_USER: SecretsStoreSecret;
|
|
16
|
+
JSON_WEB_TOKEN_AUTH_MICRO_SERVICO: SecretsStoreSecret;
|
|
17
|
+
JSON_WEB_REFRESH_TOKEN_AUTH_USER?: SecretsStoreSecret;
|
|
17
18
|
};
|
|
18
19
|
Variables: {
|
|
19
20
|
usuario_auth: TypeControllerUsuario.TokenPayload;
|
package/package.json
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@navservice/core",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Service core de todos os micro serviços",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"exports": {
|
|
7
|
-
".": {
|
|
8
|
-
"import": "./build/es/index.js",
|
|
9
|
-
"default": "./build/es/index.js",
|
|
10
|
-
"types": "./build/es/index.d.ts"
|
|
11
|
-
},
|
|
12
|
-
"./helpers": {
|
|
13
|
-
"import": "./build/es/helpers.js",
|
|
14
|
-
"default": "./build/es/helpers.js",
|
|
15
|
-
"types": "./build/es/helpers/index.d.ts"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"build"
|
|
20
|
-
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "rslib build",
|
|
23
|
-
"lib": "npm run build && npm publish --access public"
|
|
24
|
-
},
|
|
25
|
-
"publishConfig": {
|
|
26
|
-
"access": "public",
|
|
27
|
-
"provenance": false
|
|
28
|
-
},
|
|
29
|
-
"peerDependencies": {
|
|
30
|
-
"axios": "^1.9.0",
|
|
31
|
-
"hono": "^4.9.7",
|
|
32
|
-
"react": "^19.0.0",
|
|
33
|
-
"zod": "^4",
|
|
34
|
-
"zustand": "^5"
|
|
35
|
-
},
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@types/
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@navservice/core",
|
|
3
|
+
"version": "1.127.0",
|
|
4
|
+
"description": "Service core de todos os micro serviços",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./build/es/index.js",
|
|
9
|
+
"default": "./build/es/index.js",
|
|
10
|
+
"types": "./build/es/index.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"./helpers": {
|
|
13
|
+
"import": "./build/es/helpers.js",
|
|
14
|
+
"default": "./build/es/helpers.js",
|
|
15
|
+
"types": "./build/es/helpers/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"build"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "rslib build",
|
|
23
|
+
"lib": "npm run build && npm publish --access public"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public",
|
|
27
|
+
"provenance": false
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"axios": "^1.9.0",
|
|
31
|
+
"hono": "^4.9.7",
|
|
32
|
+
"react": "^19.0.0",
|
|
33
|
+
"zod": "^4",
|
|
34
|
+
"zustand": "^5"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@cloudflare/workers-types": "^4.20260312.1",
|
|
38
|
+
"@rslib/core": "^0.18.4",
|
|
39
|
+
"@types/node": "^24.10.1",
|
|
40
|
+
"@types/react": "^19.2.7",
|
|
41
|
+
"typescript": "^5"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"jose": "^6.1.3"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=22"
|
|
48
|
+
}
|
|
49
|
+
}
|