@navservice/core 1.61.0 → 1.62.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/build/es/utils.js +108 -0
- package/build/lib/utils.cjs +182 -15
- package/package.json +1 -1
package/build/es/utils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
|
+
import v4 from "zod/v4";
|
|
2
3
|
import { useLayoutEffect, useState } from "react";
|
|
3
4
|
class config_env {
|
|
4
5
|
static SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
|
|
@@ -10,6 +11,113 @@ class config_env {
|
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
const src_config_env = config_env;
|
|
14
|
+
(function(TypeControllerUsuario) {
|
|
15
|
+
TypeControllerUsuario.AppEnum = [
|
|
16
|
+
"service-usuario",
|
|
17
|
+
"service-financeiro",
|
|
18
|
+
"service-pages-ai"
|
|
19
|
+
];
|
|
20
|
+
TypeControllerUsuario.UsuarioTipoEnum = [
|
|
21
|
+
"padrao"
|
|
22
|
+
];
|
|
23
|
+
v4["enum"]([
|
|
24
|
+
"service-usuario",
|
|
25
|
+
"service-financeiro",
|
|
26
|
+
"service-pages-ai"
|
|
27
|
+
]);
|
|
28
|
+
v4["enum"](TypeControllerUsuario.UsuarioTipoEnum);
|
|
29
|
+
})(_usuario_TypeControllerUsuario || (_usuario_TypeControllerUsuario = {}));
|
|
30
|
+
const _usuario = _usuario_TypeControllerUsuario;
|
|
31
|
+
var _usuario_TypeControllerUsuario;
|
|
32
|
+
(function(TypeControllerResponse) {
|
|
33
|
+
const StatusSchema = v4.union([
|
|
34
|
+
v4.literal(200),
|
|
35
|
+
v4.literal(201),
|
|
36
|
+
v4.literal(202),
|
|
37
|
+
v4.literal(204),
|
|
38
|
+
v4.literal(400),
|
|
39
|
+
v4.literal(401),
|
|
40
|
+
v4.literal(403),
|
|
41
|
+
v4.literal(404),
|
|
42
|
+
v4.literal(409),
|
|
43
|
+
v4.literal(422),
|
|
44
|
+
v4.literal(500),
|
|
45
|
+
v4.literal(428),
|
|
46
|
+
v4.literal(405)
|
|
47
|
+
]);
|
|
48
|
+
const TypeSchema = v4.union([
|
|
49
|
+
v4.literal("success"),
|
|
50
|
+
v4.literal("warning"),
|
|
51
|
+
v4.literal("error")
|
|
52
|
+
]).default("success");
|
|
53
|
+
const CodeSchema = v4.union([
|
|
54
|
+
v4.literal("SUCCESS"),
|
|
55
|
+
v4.literal("ACTION_REQUIRED"),
|
|
56
|
+
v4.literal("CREATED"),
|
|
57
|
+
v4.literal("WARNING"),
|
|
58
|
+
v4.literal("AUTHORIZATION_ERROR"),
|
|
59
|
+
v4.literal("SCHEMA_VALIDATION"),
|
|
60
|
+
v4.literal("SERVER_ERROR"),
|
|
61
|
+
v4.literal("UNAUTHORIZED"),
|
|
62
|
+
v4.literal("INVALID_TOKEN"),
|
|
63
|
+
v4.literal("NOT_FOUND"),
|
|
64
|
+
v4.literal("SUCCESS_FILE"),
|
|
65
|
+
v4.literal("DATABASE_ERROR")
|
|
66
|
+
]);
|
|
67
|
+
v4.object({
|
|
68
|
+
status: StatusSchema,
|
|
69
|
+
code: CodeSchema,
|
|
70
|
+
type: TypeSchema,
|
|
71
|
+
message: v4.string(),
|
|
72
|
+
results: v4.unknown().optional(),
|
|
73
|
+
error: v4.unknown().optional()
|
|
74
|
+
});
|
|
75
|
+
(function(C) {
|
|
76
|
+
C.InputSchema = v4.object({
|
|
77
|
+
status: StatusSchema,
|
|
78
|
+
code: CodeSchema,
|
|
79
|
+
type: TypeSchema.optional().default("success"),
|
|
80
|
+
message: v4.string().optional(),
|
|
81
|
+
results: v4.any(),
|
|
82
|
+
c: v4.custom()
|
|
83
|
+
});
|
|
84
|
+
v4.object({
|
|
85
|
+
status: StatusSchema,
|
|
86
|
+
message: v4.string().optional(),
|
|
87
|
+
file_buffer: v4.union([
|
|
88
|
+
v4["instanceof"](Blob),
|
|
89
|
+
v4["instanceof"](ArrayBuffer),
|
|
90
|
+
v4["instanceof"](Uint8Array)
|
|
91
|
+
]),
|
|
92
|
+
content_type: v4.string(),
|
|
93
|
+
filename: v4.string().optional(),
|
|
94
|
+
c: v4.custom().optional()
|
|
95
|
+
});
|
|
96
|
+
})(TypeControllerResponse.C || (TypeControllerResponse.C = {}));
|
|
97
|
+
(function(Error) {
|
|
98
|
+
Error.InputSchema = v4.object({
|
|
99
|
+
message: v4.string().optional(),
|
|
100
|
+
results: v4.union([
|
|
101
|
+
v4.array(v4.unknown()),
|
|
102
|
+
v4.unknown()
|
|
103
|
+
]).optional(),
|
|
104
|
+
type: TypeSchema.optional().default("success"),
|
|
105
|
+
code: CodeSchema,
|
|
106
|
+
status: v4.number().optional().default(200)
|
|
107
|
+
});
|
|
108
|
+
})(TypeControllerResponse.Error || (TypeControllerResponse.Error = {}));
|
|
109
|
+
})(_type_response_TypeControllerResponse || (_type_response_TypeControllerResponse = {}));
|
|
110
|
+
const _type_response = _type_response_TypeControllerResponse;
|
|
111
|
+
var _type_response_TypeControllerResponse;
|
|
112
|
+
(function(t) {
|
|
113
|
+
(function(Controller) {
|
|
114
|
+
Controller.Usuario = _usuario;
|
|
115
|
+
})(t.Controller || (t.Controller = {}));
|
|
116
|
+
(function(Geral) {
|
|
117
|
+
Geral.Response = _type_response;
|
|
118
|
+
})(t.Geral || (t.Geral = {}));
|
|
119
|
+
})(types_t || (types_t = {}));
|
|
120
|
+
var types_t;
|
|
13
121
|
const _session_storage = class {
|
|
14
122
|
static adicionar_item_session_storage({ chave, novoItem }) {
|
|
15
123
|
try {
|
package/build/lib/utils.cjs
CHANGED
|
@@ -6,8 +6,181 @@ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
|
6
6
|
new URL('main.js', document.baseURI).href;
|
|
7
7
|
})();
|
|
8
8
|
;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
var __webpack_modules__ = ({
|
|
10
|
+
"./src/index.browser.ts"(__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
11
|
+
|
|
12
|
+
// EXPORTS
|
|
13
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
14
|
+
config_env_core: () => (/* reexport */ src_config_env)
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// UNUSED EXPORTS: TypesCore
|
|
18
|
+
|
|
19
|
+
;// CONCATENATED MODULE: ./src/config_env/index.ts
|
|
20
|
+
class config_env {
|
|
21
|
+
static SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
|
|
22
|
+
static init(config) {
|
|
23
|
+
config_env.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL = config.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
|
|
24
|
+
}
|
|
25
|
+
static get PUBLIC_BASE_URL_BACKEND_PRINCIPAL() {
|
|
26
|
+
return this.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL?.trim();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/* export default */ const src_config_env = (config_env);
|
|
30
|
+
|
|
31
|
+
;// CONCATENATED MODULE: external "zod/v4"
|
|
32
|
+
const v4_namespaceObject = require("zod/v4");
|
|
33
|
+
var v4_default = /*#__PURE__*/__webpack_require__.n(v4_namespaceObject);
|
|
34
|
+
;// CONCATENATED MODULE: ./src/types/_usuario.ts
|
|
35
|
+
|
|
36
|
+
(function(TypeControllerUsuario) {
|
|
37
|
+
TypeControllerUsuario.AppEnum = [
|
|
38
|
+
"service-usuario",
|
|
39
|
+
"service-financeiro",
|
|
40
|
+
"service-pages-ai"
|
|
41
|
+
];
|
|
42
|
+
TypeControllerUsuario.UsuarioTipoEnum = [
|
|
43
|
+
"padrao"
|
|
44
|
+
];
|
|
45
|
+
const AppEnumZod = v4_default()["enum"]([
|
|
46
|
+
"service-usuario",
|
|
47
|
+
"service-financeiro",
|
|
48
|
+
"service-pages-ai"
|
|
49
|
+
]);
|
|
50
|
+
const UsuarioTipoEnumZod = v4_default()["enum"](TypeControllerUsuario.UsuarioTipoEnum);
|
|
51
|
+
})(_usuario_TypeControllerUsuario || (_usuario_TypeControllerUsuario = {}));
|
|
52
|
+
/* export default */ const _usuario = (_usuario_TypeControllerUsuario);
|
|
53
|
+
var _usuario_TypeControllerUsuario;
|
|
54
|
+
|
|
55
|
+
;// CONCATENATED MODULE: ./src/types/_type_response.ts
|
|
56
|
+
|
|
57
|
+
(function(TypeControllerResponse) {
|
|
58
|
+
const StatusSchema = v4_default().union([
|
|
59
|
+
v4_default().literal(200),
|
|
60
|
+
v4_default().literal(201),
|
|
61
|
+
v4_default().literal(202),
|
|
62
|
+
v4_default().literal(204),
|
|
63
|
+
v4_default().literal(400),
|
|
64
|
+
v4_default().literal(401),
|
|
65
|
+
v4_default().literal(403),
|
|
66
|
+
v4_default().literal(404),
|
|
67
|
+
v4_default().literal(409),
|
|
68
|
+
v4_default().literal(422),
|
|
69
|
+
v4_default().literal(500),
|
|
70
|
+
v4_default().literal(428),
|
|
71
|
+
v4_default().literal(405)
|
|
72
|
+
]);
|
|
73
|
+
const TypeSchema = v4_default().union([
|
|
74
|
+
v4_default().literal("success"),
|
|
75
|
+
v4_default().literal("warning"),
|
|
76
|
+
v4_default().literal("error")
|
|
77
|
+
]).default("success");
|
|
78
|
+
const CodeSchema = v4_default().union([
|
|
79
|
+
v4_default().literal("SUCCESS"),
|
|
80
|
+
v4_default().literal("ACTION_REQUIRED"),
|
|
81
|
+
v4_default().literal("CREATED"),
|
|
82
|
+
v4_default().literal("WARNING"),
|
|
83
|
+
v4_default().literal("AUTHORIZATION_ERROR"),
|
|
84
|
+
v4_default().literal("SCHEMA_VALIDATION"),
|
|
85
|
+
v4_default().literal("SERVER_ERROR"),
|
|
86
|
+
v4_default().literal("UNAUTHORIZED"),
|
|
87
|
+
v4_default().literal("INVALID_TOKEN"),
|
|
88
|
+
v4_default().literal("NOT_FOUND"),
|
|
89
|
+
v4_default().literal("SUCCESS_FILE"),
|
|
90
|
+
v4_default().literal("DATABASE_ERROR")
|
|
91
|
+
]);
|
|
92
|
+
const BaseResponseSchema = v4_default().object({
|
|
93
|
+
status: StatusSchema,
|
|
94
|
+
code: CodeSchema,
|
|
95
|
+
type: TypeSchema,
|
|
96
|
+
message: v4_default().string(),
|
|
97
|
+
results: v4_default().unknown().optional(),
|
|
98
|
+
error: v4_default().unknown().optional()
|
|
99
|
+
});
|
|
100
|
+
(function(C) {
|
|
101
|
+
C.InputSchema = v4_default().object({
|
|
102
|
+
status: StatusSchema,
|
|
103
|
+
code: CodeSchema,
|
|
104
|
+
type: TypeSchema.optional().default("success"),
|
|
105
|
+
message: v4_default().string().optional(),
|
|
106
|
+
results: v4_default().any(),
|
|
107
|
+
c: v4_default().custom()
|
|
108
|
+
});
|
|
109
|
+
const FileResponseParamsSchema = v4_default().object({
|
|
110
|
+
status: StatusSchema,
|
|
111
|
+
message: v4_default().string().optional(),
|
|
112
|
+
file_buffer: v4_default().union([
|
|
113
|
+
v4_default()["instanceof"](Blob),
|
|
114
|
+
v4_default()["instanceof"](ArrayBuffer),
|
|
115
|
+
v4_default()["instanceof"](Uint8Array)
|
|
116
|
+
]),
|
|
117
|
+
content_type: v4_default().string(),
|
|
118
|
+
filename: v4_default().string().optional(),
|
|
119
|
+
c: v4_default().custom().optional()
|
|
120
|
+
});
|
|
121
|
+
})(TypeControllerResponse.C || (TypeControllerResponse.C = {}));
|
|
122
|
+
(function(Error) {
|
|
123
|
+
Error.InputSchema = v4_default().object({
|
|
124
|
+
message: v4_default().string().optional(),
|
|
125
|
+
results: v4_default().union([
|
|
126
|
+
v4_default().array(v4_default().unknown()),
|
|
127
|
+
v4_default().unknown()
|
|
128
|
+
]).optional(),
|
|
129
|
+
type: TypeSchema.optional().default("success"),
|
|
130
|
+
code: CodeSchema,
|
|
131
|
+
status: v4_default().number().optional().default(200)
|
|
132
|
+
});
|
|
133
|
+
})(TypeControllerResponse.Error || (TypeControllerResponse.Error = {}));
|
|
134
|
+
})(_type_response_TypeControllerResponse || (_type_response_TypeControllerResponse = {}));
|
|
135
|
+
/* export default */ const _type_response = (_type_response_TypeControllerResponse);
|
|
136
|
+
var _type_response_TypeControllerResponse;
|
|
137
|
+
|
|
138
|
+
;// CONCATENATED MODULE: ./src/types/index.ts
|
|
139
|
+
// ENTIDADES TIPADAS
|
|
140
|
+
|
|
141
|
+
//GERAL
|
|
142
|
+
|
|
143
|
+
(function(t) {
|
|
144
|
+
(function(Controller) {
|
|
145
|
+
Controller.Usuario = _usuario;
|
|
146
|
+
})(t.Controller || (t.Controller = {}));
|
|
147
|
+
(function(Geral) {
|
|
148
|
+
Geral.Response = _type_response;
|
|
149
|
+
})(t.Geral || (t.Geral = {}));
|
|
150
|
+
})(types_t || (types_t = {}));
|
|
151
|
+
/* export default */ const types = ((/* unused pure expression or super */ null && (types_t)));
|
|
152
|
+
var types_t;
|
|
153
|
+
|
|
154
|
+
;// CONCATENATED MODULE: ./src/index.browser.ts
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
});
|
|
162
|
+
// The module cache
|
|
163
|
+
var __webpack_module_cache__ = {};
|
|
164
|
+
|
|
165
|
+
// The require function
|
|
166
|
+
function __webpack_require__(moduleId) {
|
|
167
|
+
|
|
168
|
+
// Check if module is in cache
|
|
169
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
170
|
+
if (cachedModule !== undefined) {
|
|
171
|
+
return cachedModule.exports;
|
|
172
|
+
}
|
|
173
|
+
// Create a new module (and put it into the cache)
|
|
174
|
+
var module = (__webpack_module_cache__[moduleId] = {
|
|
175
|
+
exports: {}
|
|
176
|
+
});
|
|
177
|
+
// Execute the module function
|
|
178
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
179
|
+
|
|
180
|
+
// Return the exports of the module
|
|
181
|
+
return module.exports;
|
|
182
|
+
|
|
183
|
+
}
|
|
11
184
|
|
|
12
185
|
// webpack/runtime/compat_get_default_export
|
|
13
186
|
(() => {
|
|
@@ -46,6 +219,8 @@ __webpack_require__.r = (exports) => {
|
|
|
46
219
|
};
|
|
47
220
|
})();
|
|
48
221
|
var __webpack_exports__ = {};
|
|
222
|
+
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
223
|
+
(() => {
|
|
49
224
|
// ESM COMPAT FLAG
|
|
50
225
|
__webpack_require__.r(__webpack_exports__);
|
|
51
226
|
|
|
@@ -57,18 +232,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
57
232
|
;// CONCATENATED MODULE: external "axios"
|
|
58
233
|
const external_axios_namespaceObject = require("axios");
|
|
59
234
|
var external_axios_default = /*#__PURE__*/__webpack_require__.n(external_axios_namespaceObject);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
static SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
|
|
63
|
-
static init(config) {
|
|
64
|
-
config_env.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL = config.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
|
|
65
|
-
}
|
|
66
|
-
static get PUBLIC_BASE_URL_BACKEND_PRINCIPAL() {
|
|
67
|
-
return this.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL?.trim();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/* export default */ const src_config_env = (config_env);
|
|
71
|
-
|
|
235
|
+
// EXTERNAL MODULE: ./src/index.browser.ts + 5 modules
|
|
236
|
+
var index_browser = __webpack_require__("./src/index.browser.ts");
|
|
72
237
|
;// CONCATENATED MODULE: ./src/utils/_session_storage.ts
|
|
73
238
|
const _session_storage = class _session_storage {
|
|
74
239
|
static adicionar_item_session_storage({ chave, novoItem }) {
|
|
@@ -120,7 +285,7 @@ const _api_api = class _api {
|
|
|
120
285
|
static servidor_pricipal = class servidor_pricipal {
|
|
121
286
|
static get #axios() {
|
|
122
287
|
return external_axios_default().create({
|
|
123
|
-
baseURL:
|
|
288
|
+
baseURL: index_browser.config_env_core.PUBLIC_BASE_URL_BACKEND_PRINCIPAL
|
|
124
289
|
});
|
|
125
290
|
}
|
|
126
291
|
static async post({ url, data, setToken = true }) {
|
|
@@ -696,6 +861,8 @@ const utils = {
|
|
|
696
861
|
};
|
|
697
862
|
/* export default */ const src_utils = (utils);
|
|
698
863
|
|
|
864
|
+
})();
|
|
865
|
+
|
|
699
866
|
exports["default"] = __webpack_exports__["default"];
|
|
700
867
|
for(var __rspack_i in __webpack_exports__) {
|
|
701
868
|
if(["default"].indexOf(__rspack_i) === -1) {
|