@navservice/core 1.60.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 +198 -102
- package/build/lib/utils.cjs +223 -56
- 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,202 @@ 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;
|
|
121
|
+
const _session_storage = class {
|
|
122
|
+
static adicionar_item_session_storage({ chave, novoItem }) {
|
|
123
|
+
try {
|
|
124
|
+
const valorAtual = window.sessionStorage.getItem(chave);
|
|
125
|
+
const listaAtual = valorAtual ? JSON.parse(valorAtual) : [];
|
|
126
|
+
const newDataItem = {
|
|
127
|
+
...listaAtual,
|
|
128
|
+
...novoItem
|
|
129
|
+
};
|
|
130
|
+
window.sessionStorage.setItem(chave, JSON.stringify(newDataItem));
|
|
131
|
+
} catch (error) {
|
|
132
|
+
console.error(error);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
static set_session_storage_sem_incremento({ chave, novoItem }) {
|
|
136
|
+
try {
|
|
137
|
+
window.sessionStorage.setItem(chave, JSON.stringify(novoItem));
|
|
138
|
+
} catch (error) {
|
|
139
|
+
console.error(error);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
static get_item_session_storage(chave) {
|
|
143
|
+
try {
|
|
144
|
+
if ("undefined" != typeof window) {
|
|
145
|
+
const valorAtual = window.sessionStorage.getItem(chave);
|
|
146
|
+
return valorAtual ? JSON.parse(valorAtual) : valorAtual;
|
|
147
|
+
}
|
|
148
|
+
return;
|
|
149
|
+
} catch (error) {
|
|
150
|
+
console.error(error);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
static remover_item_session_storage(chave) {
|
|
154
|
+
try {
|
|
155
|
+
window.sessionStorage.removeItem(chave);
|
|
156
|
+
} catch (error) {
|
|
157
|
+
console.error(error);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const utils_session_storage = _session_storage;
|
|
162
|
+
const _api_api = class _api {
|
|
163
|
+
static servidor_pricipal = class {
|
|
164
|
+
static get #axios() {
|
|
165
|
+
return axios.create({
|
|
166
|
+
baseURL: src_config_env.PUBLIC_BASE_URL_BACKEND_PRINCIPAL
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
static async post({ url, data, setToken = true }) {
|
|
170
|
+
return await this.#axios.post(url, data, _api.headers({
|
|
171
|
+
setToken: setToken
|
|
172
|
+
}));
|
|
173
|
+
}
|
|
174
|
+
static async get({ url, params, setToken = true }) {
|
|
175
|
+
const queryParams = new URLSearchParams();
|
|
176
|
+
if (params) Object.entries(params).forEach(([key, value])=>{
|
|
177
|
+
if (null != value) queryParams.append(key, value);
|
|
178
|
+
});
|
|
179
|
+
const queryString = queryParams.toString();
|
|
180
|
+
const fullUrl = queryString ? `${url}?${queryString}` : url;
|
|
181
|
+
return await this.#axios.get(fullUrl, _api.headers({
|
|
182
|
+
setToken: setToken
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
static async patch({ url, data, setToken = true }) {
|
|
186
|
+
return await this.#axios.patch(url, data, _api.headers({
|
|
187
|
+
setToken: setToken
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
static async delete({ url }) {
|
|
191
|
+
return await this.#axios.delete(url);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
static headers({ setToken = true }) {
|
|
195
|
+
const get_auth_user = utils_session_storage.get_item_session_storage("auth_user");
|
|
196
|
+
if (true === setToken) return {
|
|
197
|
+
headers: {
|
|
198
|
+
Authorization: `Bearer ${get_auth_user?.data?.usuario?.token}`,
|
|
199
|
+
"Content-type": "application/json"
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
return {
|
|
203
|
+
headers: {
|
|
204
|
+
"Content-type": "application/json"
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
const utils_api = _api_api;
|
|
13
210
|
const _data = class {
|
|
14
211
|
static YYYY_MM_DD_00_00_00(newData) {
|
|
15
212
|
let dataAtual = new Date();
|
|
@@ -355,47 +552,6 @@ const _update_context = class {
|
|
|
355
552
|
}
|
|
356
553
|
};
|
|
357
554
|
const utils_update_context = _update_context;
|
|
358
|
-
const _session_storage = class {
|
|
359
|
-
static adicionar_item_session_storage({ chave, novoItem }) {
|
|
360
|
-
try {
|
|
361
|
-
const valorAtual = window.sessionStorage.getItem(chave);
|
|
362
|
-
const listaAtual = valorAtual ? JSON.parse(valorAtual) : [];
|
|
363
|
-
const newDataItem = {
|
|
364
|
-
...listaAtual,
|
|
365
|
-
...novoItem
|
|
366
|
-
};
|
|
367
|
-
window.sessionStorage.setItem(chave, JSON.stringify(newDataItem));
|
|
368
|
-
} catch (error) {
|
|
369
|
-
console.error(error);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
static set_session_storage_sem_incremento({ chave, novoItem }) {
|
|
373
|
-
try {
|
|
374
|
-
window.sessionStorage.setItem(chave, JSON.stringify(novoItem));
|
|
375
|
-
} catch (error) {
|
|
376
|
-
console.error(error);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
static get_item_session_storage(chave) {
|
|
380
|
-
try {
|
|
381
|
-
if ("undefined" != typeof window) {
|
|
382
|
-
const valorAtual = window.sessionStorage.getItem(chave);
|
|
383
|
-
return valorAtual ? JSON.parse(valorAtual) : valorAtual;
|
|
384
|
-
}
|
|
385
|
-
return;
|
|
386
|
-
} catch (error) {
|
|
387
|
-
console.error(error);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
static remover_item_session_storage(chave) {
|
|
391
|
-
try {
|
|
392
|
-
window.sessionStorage.removeItem(chave);
|
|
393
|
-
} catch (error) {
|
|
394
|
-
console.error(error);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
|
-
const utils_session_storage = _session_storage;
|
|
399
555
|
const _sistema = {
|
|
400
556
|
empresa: {
|
|
401
557
|
nome: "Nav Software",
|
|
@@ -479,64 +635,4 @@ const utils = {
|
|
|
479
635
|
hooks: utils_hooks
|
|
480
636
|
};
|
|
481
637
|
const src_utils = utils;
|
|
482
|
-
|
|
483
|
-
static servidor_pricipal = class {
|
|
484
|
-
static get #axios() {
|
|
485
|
-
return axios.create({
|
|
486
|
-
baseURL: src_config_env.PUBLIC_BASE_URL_BACKEND_PRINCIPAL
|
|
487
|
-
});
|
|
488
|
-
}
|
|
489
|
-
static async post({ url, data, setToken = true }) {
|
|
490
|
-
return await this.#axios.post(url, data, _api.headers({
|
|
491
|
-
setToken: setToken
|
|
492
|
-
}));
|
|
493
|
-
}
|
|
494
|
-
static async get({ url, params, setToken = true }) {
|
|
495
|
-
const queryParams = new URLSearchParams();
|
|
496
|
-
if (params) Object.entries(params).forEach(([key, value])=>{
|
|
497
|
-
if (null != value) queryParams.append(key, value);
|
|
498
|
-
});
|
|
499
|
-
const queryString = queryParams.toString();
|
|
500
|
-
const fullUrl = queryString ? `${url}?${queryString}` : url;
|
|
501
|
-
return await this.#axios.get(fullUrl, _api.headers({
|
|
502
|
-
setToken: setToken
|
|
503
|
-
}));
|
|
504
|
-
}
|
|
505
|
-
static async patch({ url, data, setToken = true }) {
|
|
506
|
-
return await this.#axios.patch(url, data, _api.headers({
|
|
507
|
-
setToken: setToken
|
|
508
|
-
}));
|
|
509
|
-
}
|
|
510
|
-
static async delete({ url }) {
|
|
511
|
-
return await this.#axios.delete(url);
|
|
512
|
-
}
|
|
513
|
-
};
|
|
514
|
-
static headers({ setToken = true }) {
|
|
515
|
-
const get_auth_user = src_utils.session_sorage.get_item_session_storage("auth_user");
|
|
516
|
-
if (true === setToken) return {
|
|
517
|
-
headers: {
|
|
518
|
-
Authorization: `Bearer ${get_auth_user?.data?.usuario?.token}`,
|
|
519
|
-
"Content-type": "application/json"
|
|
520
|
-
}
|
|
521
|
-
};
|
|
522
|
-
return {
|
|
523
|
-
headers: {
|
|
524
|
-
"Content-type": "application/json"
|
|
525
|
-
}
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
};
|
|
529
|
-
const utils_api = _api_api;
|
|
530
|
-
const utils_utils = {
|
|
531
|
-
api: utils_api,
|
|
532
|
-
data: utils_data,
|
|
533
|
-
form: utils_form,
|
|
534
|
-
geral: _geral,
|
|
535
|
-
local_storage: utils_local_storage,
|
|
536
|
-
update_context: utils_update_context,
|
|
537
|
-
session_sorage: utils_session_storage,
|
|
538
|
-
sistema: utils_sistema,
|
|
539
|
-
hooks: utils_hooks
|
|
540
|
-
};
|
|
541
|
-
const src_utils_0 = utils_utils;
|
|
542
|
-
export { src_utils_0 as default };
|
|
638
|
+
export { src_utils as default };
|
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,17 +232,50 @@ __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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
235
|
+
// EXTERNAL MODULE: ./src/index.browser.ts + 5 modules
|
|
236
|
+
var index_browser = __webpack_require__("./src/index.browser.ts");
|
|
237
|
+
;// CONCATENATED MODULE: ./src/utils/_session_storage.ts
|
|
238
|
+
const _session_storage = class _session_storage {
|
|
239
|
+
static adicionar_item_session_storage({ chave, novoItem }) {
|
|
240
|
+
try {
|
|
241
|
+
const valorAtual = window.sessionStorage.getItem(chave);
|
|
242
|
+
const listaAtual = valorAtual ? JSON.parse(valorAtual) : [];
|
|
243
|
+
const newDataItem = {
|
|
244
|
+
...listaAtual,
|
|
245
|
+
...novoItem
|
|
246
|
+
};
|
|
247
|
+
window.sessionStorage.setItem(chave, JSON.stringify(newDataItem));
|
|
248
|
+
} catch (error) {
|
|
249
|
+
console.error(error);
|
|
250
|
+
}
|
|
65
251
|
}
|
|
66
|
-
static
|
|
67
|
-
|
|
252
|
+
static set_session_storage_sem_incremento({ chave, novoItem }) {
|
|
253
|
+
try {
|
|
254
|
+
window.sessionStorage.setItem(chave, JSON.stringify(novoItem));
|
|
255
|
+
} catch (error) {
|
|
256
|
+
console.error(error);
|
|
257
|
+
}
|
|
68
258
|
}
|
|
69
|
-
|
|
70
|
-
|
|
259
|
+
static get_item_session_storage(chave) {
|
|
260
|
+
try {
|
|
261
|
+
if (typeof window !== "undefined") {
|
|
262
|
+
const valorAtual = window.sessionStorage.getItem(chave);
|
|
263
|
+
return valorAtual ? JSON.parse(valorAtual) : valorAtual;
|
|
264
|
+
}
|
|
265
|
+
return;
|
|
266
|
+
} catch (error) {
|
|
267
|
+
console.error(error);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
static remover_item_session_storage(chave) {
|
|
271
|
+
try {
|
|
272
|
+
window.sessionStorage.removeItem(chave);
|
|
273
|
+
} catch (error) {
|
|
274
|
+
console.error(error);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
/* export default */ const utils_session_storage = (_session_storage);
|
|
71
279
|
|
|
72
280
|
;// CONCATENATED MODULE: ./src/utils/_api.ts
|
|
73
281
|
|
|
@@ -77,7 +285,7 @@ const _api_api = class _api {
|
|
|
77
285
|
static servidor_pricipal = class servidor_pricipal {
|
|
78
286
|
static get #axios() {
|
|
79
287
|
return external_axios_default().create({
|
|
80
|
-
baseURL:
|
|
288
|
+
baseURL: index_browser.config_env_core.PUBLIC_BASE_URL_BACKEND_PRINCIPAL
|
|
81
289
|
});
|
|
82
290
|
}
|
|
83
291
|
static async post({ url, data, setToken = true }) {
|
|
@@ -110,7 +318,7 @@ const _api_api = class _api {
|
|
|
110
318
|
}
|
|
111
319
|
};
|
|
112
320
|
static headers({ setToken = true }) {
|
|
113
|
-
const get_auth_user =
|
|
321
|
+
const get_auth_user = utils_session_storage.get_item_session_storage("auth_user");
|
|
114
322
|
if (setToken === true) {
|
|
115
323
|
return {
|
|
116
324
|
headers: {
|
|
@@ -552,49 +760,6 @@ const _update_context = class _update_context {
|
|
|
552
760
|
};
|
|
553
761
|
/* export default */ const utils_update_context = (_update_context);
|
|
554
762
|
|
|
555
|
-
;// CONCATENATED MODULE: ./src/utils/_session_storage.ts
|
|
556
|
-
const _session_storage = class _session_storage {
|
|
557
|
-
static adicionar_item_session_storage({ chave, novoItem }) {
|
|
558
|
-
try {
|
|
559
|
-
const valorAtual = window.sessionStorage.getItem(chave);
|
|
560
|
-
const listaAtual = valorAtual ? JSON.parse(valorAtual) : [];
|
|
561
|
-
const newDataItem = {
|
|
562
|
-
...listaAtual,
|
|
563
|
-
...novoItem
|
|
564
|
-
};
|
|
565
|
-
window.sessionStorage.setItem(chave, JSON.stringify(newDataItem));
|
|
566
|
-
} catch (error) {
|
|
567
|
-
console.error(error);
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
static set_session_storage_sem_incremento({ chave, novoItem }) {
|
|
571
|
-
try {
|
|
572
|
-
window.sessionStorage.setItem(chave, JSON.stringify(novoItem));
|
|
573
|
-
} catch (error) {
|
|
574
|
-
console.error(error);
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
static get_item_session_storage(chave) {
|
|
578
|
-
try {
|
|
579
|
-
if (typeof window !== "undefined") {
|
|
580
|
-
const valorAtual = window.sessionStorage.getItem(chave);
|
|
581
|
-
return valorAtual ? JSON.parse(valorAtual) : valorAtual;
|
|
582
|
-
}
|
|
583
|
-
return;
|
|
584
|
-
} catch (error) {
|
|
585
|
-
console.error(error);
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
static remover_item_session_storage(chave) {
|
|
589
|
-
try {
|
|
590
|
-
window.sessionStorage.removeItem(chave);
|
|
591
|
-
} catch (error) {
|
|
592
|
-
console.error(error);
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
};
|
|
596
|
-
/* export default */ const utils_session_storage = (_session_storage);
|
|
597
|
-
|
|
598
763
|
;// CONCATENATED MODULE: ./src/utils/_sistema.ts
|
|
599
764
|
const _sistema = {
|
|
600
765
|
empresa: {
|
|
@@ -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) {
|