@navservice/core 1.87.0 → 1.89.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/index.js +12 -1
- package/build/es/types/index.d.ts +1 -0
- package/build/es/utils/_api.d.ts +9 -2
- package/build/es/utils/index.d.ts +7 -1
- package/build/lib/index.cjs +14 -2
- package/build/lib/types/index.d.ts +1 -0
- package/build/lib/utils/_api.d.ts +9 -2
- package/build/lib/utils/index.d.ts +7 -1
- package/package.json +1 -1
package/build/es/index.js
CHANGED
|
@@ -183,7 +183,7 @@ const _api_api = class _api {
|
|
|
183
183
|
static async delete({ baseURLKey, url }) {
|
|
184
184
|
return await this.axios(baseURLKey).delete(url);
|
|
185
185
|
}
|
|
186
|
-
static async
|
|
186
|
+
static async post_form_data({ baseURLKey, url, data, setToken = true }) {
|
|
187
187
|
const formData = new FormData();
|
|
188
188
|
Object.entries(data).forEach(([key, value])=>{
|
|
189
189
|
if (null != value) formData.append(key, value);
|
|
@@ -194,6 +194,17 @@ const _api_api = class _api {
|
|
|
194
194
|
}).headers
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
+
static async put_form_data({ baseURLKey, url, data, setToken = true }) {
|
|
198
|
+
const formData = new FormData();
|
|
199
|
+
Object.entries(data).forEach(([key, value])=>{
|
|
200
|
+
if (null != value) formData.append(key, value);
|
|
201
|
+
});
|
|
202
|
+
return await this.axios(baseURLKey).put(url, formData, {
|
|
203
|
+
headers: _api.headers_form({
|
|
204
|
+
setToken
|
|
205
|
+
}).headers
|
|
206
|
+
});
|
|
207
|
+
}
|
|
197
208
|
};
|
|
198
209
|
static headers({ setToken = true }) {
|
|
199
210
|
const get_auth_user = utils_session_storage.get_item_session_storage("auth_user");
|
|
@@ -7,6 +7,7 @@ declare namespace t {
|
|
|
7
7
|
}
|
|
8
8
|
namespace Geral {
|
|
9
9
|
export import Response = TypeControllerResponse;
|
|
10
|
+
type BaseUrl = "PUBLIC_BASE_URL_BACKEND_FINANCEIRO" | "PUBLIC_BASE_URL_BACKEND_USUARIO" | "PUBLIC_BASE_URL_BACKEND_BUCKET";
|
|
10
11
|
}
|
|
11
12
|
interface Context extends HonoContext {
|
|
12
13
|
env: {
|
package/build/es/utils/_api.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AxiosResponse } from "axios";
|
|
2
|
-
|
|
2
|
+
import t from "../types";
|
|
3
|
+
export type BaseUrl = t.Geral.BaseUrl;
|
|
3
4
|
declare const _api: {
|
|
4
5
|
new (): {};
|
|
5
6
|
servidor_pricipal: {
|
|
@@ -28,7 +29,13 @@ declare const _api: {
|
|
|
28
29
|
url: string;
|
|
29
30
|
setToken?: boolean;
|
|
30
31
|
}): Promise<AxiosResponse<any, any, {}>>;
|
|
31
|
-
|
|
32
|
+
post_form_data({ baseURLKey, url, data, setToken }: {
|
|
33
|
+
baseURLKey: BaseUrl;
|
|
34
|
+
url: string;
|
|
35
|
+
data: any;
|
|
36
|
+
setToken?: boolean;
|
|
37
|
+
}): Promise<AxiosResponse<any, any, {}>>;
|
|
38
|
+
put_form_data({ baseURLKey, url, data, setToken }: {
|
|
32
39
|
baseURLKey: BaseUrl;
|
|
33
40
|
url: string;
|
|
34
41
|
data: any;
|
|
@@ -28,7 +28,13 @@ declare const utils: {
|
|
|
28
28
|
url: string;
|
|
29
29
|
setToken?: boolean;
|
|
30
30
|
}): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
31
|
-
|
|
31
|
+
post_form_data({ baseURLKey, url, data, setToken }: {
|
|
32
|
+
baseURLKey: import("./_api").BaseUrl;
|
|
33
|
+
url: string;
|
|
34
|
+
data: any;
|
|
35
|
+
setToken?: boolean;
|
|
36
|
+
}): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
37
|
+
put_form_data({ baseURLKey, url, data, setToken }: {
|
|
32
38
|
baseURLKey: import("./_api").BaseUrl;
|
|
33
39
|
url: string;
|
|
34
40
|
data: any;
|
package/build/lib/index.cjs
CHANGED
|
@@ -165,7 +165,6 @@ var _type_response_TypeControllerResponse;
|
|
|
165
165
|
;// CONCATENATED MODULE: ./src/types/index.ts
|
|
166
166
|
// ENTIDADES TIPADAS
|
|
167
167
|
|
|
168
|
-
//GERAL
|
|
169
168
|
|
|
170
169
|
(function(t) {
|
|
171
170
|
(function(Controller) {
|
|
@@ -264,7 +263,7 @@ const _api_api = class _api {
|
|
|
264
263
|
static async delete({ baseURLKey, url }) {
|
|
265
264
|
return await this.axios(baseURLKey).delete(url);
|
|
266
265
|
}
|
|
267
|
-
static async
|
|
266
|
+
static async post_form_data({ baseURLKey, url, data, setToken = true }) {
|
|
268
267
|
const formData = new FormData();
|
|
269
268
|
Object.entries(data).forEach(([key, value])=>{
|
|
270
269
|
if (value !== undefined && value !== null) {
|
|
@@ -277,6 +276,19 @@ const _api_api = class _api {
|
|
|
277
276
|
}).headers
|
|
278
277
|
});
|
|
279
278
|
}
|
|
279
|
+
static async put_form_data({ baseURLKey, url, data, setToken = true }) {
|
|
280
|
+
const formData = new FormData();
|
|
281
|
+
Object.entries(data).forEach(([key, value])=>{
|
|
282
|
+
if (value !== undefined && value !== null) {
|
|
283
|
+
formData.append(key, value);
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
return await this.axios(baseURLKey).put(url, formData, {
|
|
287
|
+
headers: _api.headers_form({
|
|
288
|
+
setToken
|
|
289
|
+
}).headers
|
|
290
|
+
});
|
|
291
|
+
}
|
|
280
292
|
};
|
|
281
293
|
static headers({ setToken = true }) {
|
|
282
294
|
const get_auth_user = utils_session_storage.get_item_session_storage("auth_user");
|
|
@@ -7,6 +7,7 @@ declare namespace t {
|
|
|
7
7
|
}
|
|
8
8
|
namespace Geral {
|
|
9
9
|
export import Response = TypeControllerResponse;
|
|
10
|
+
type BaseUrl = "PUBLIC_BASE_URL_BACKEND_FINANCEIRO" | "PUBLIC_BASE_URL_BACKEND_USUARIO" | "PUBLIC_BASE_URL_BACKEND_BUCKET";
|
|
10
11
|
}
|
|
11
12
|
interface Context extends HonoContext {
|
|
12
13
|
env: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AxiosResponse } from "axios";
|
|
2
|
-
|
|
2
|
+
import t from "../types";
|
|
3
|
+
export type BaseUrl = t.Geral.BaseUrl;
|
|
3
4
|
declare const _api: {
|
|
4
5
|
new (): {};
|
|
5
6
|
servidor_pricipal: {
|
|
@@ -28,7 +29,13 @@ declare const _api: {
|
|
|
28
29
|
url: string;
|
|
29
30
|
setToken?: boolean;
|
|
30
31
|
}): Promise<AxiosResponse<any, any, {}>>;
|
|
31
|
-
|
|
32
|
+
post_form_data({ baseURLKey, url, data, setToken }: {
|
|
33
|
+
baseURLKey: BaseUrl;
|
|
34
|
+
url: string;
|
|
35
|
+
data: any;
|
|
36
|
+
setToken?: boolean;
|
|
37
|
+
}): Promise<AxiosResponse<any, any, {}>>;
|
|
38
|
+
put_form_data({ baseURLKey, url, data, setToken }: {
|
|
32
39
|
baseURLKey: BaseUrl;
|
|
33
40
|
url: string;
|
|
34
41
|
data: any;
|
|
@@ -28,7 +28,13 @@ declare const utils: {
|
|
|
28
28
|
url: string;
|
|
29
29
|
setToken?: boolean;
|
|
30
30
|
}): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
31
|
-
|
|
31
|
+
post_form_data({ baseURLKey, url, data, setToken }: {
|
|
32
|
+
baseURLKey: import("./_api").BaseUrl;
|
|
33
|
+
url: string;
|
|
34
|
+
data: any;
|
|
35
|
+
setToken?: boolean;
|
|
36
|
+
}): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
37
|
+
put_form_data({ baseURLKey, url, data, setToken }: {
|
|
32
38
|
baseURLKey: import("./_api").BaseUrl;
|
|
33
39
|
url: string;
|
|
34
40
|
data: any;
|