@navservice/core 1.58.0 → 1.59.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.
@@ -1,6 +1,6 @@
1
- import { AxiosResponse } from "axios";
1
+ import { AxiosInstance, AxiosResponse } from "axios";
2
2
  export default class api {
3
- private static axios;
3
+ static get axios(): AxiosInstance;
4
4
  private static withAuth;
5
5
  private static get_headers;
6
6
  static get<T = any>({ url, params, setToken }: {
package/build/es/utils.js CHANGED
@@ -52,12 +52,14 @@ class config_env {
52
52
  }
53
53
  const src_config_env = config_env;
54
54
  class api {
55
- static axios = axios.create({
56
- baseURL: src_config_env.PUBLIC_BASE_URL_BACKEND_PRINCIPAL,
57
- headers: {
58
- "Content-Type": "application/json"
59
- }
60
- });
55
+ static get axios() {
56
+ return axios.create({
57
+ baseURL: src_config_env.PUBLIC_BASE_URL_BACKEND_PRINCIPAL,
58
+ headers: {
59
+ "Content-Type": "application/json"
60
+ }
61
+ });
62
+ }
61
63
  static withAuth = true;
62
64
  static get_headers(setToken) {
63
65
  if (true === setToken && true === this.withAuth) {
@@ -1,6 +1,6 @@
1
- import { AxiosResponse } from "axios";
1
+ import { AxiosInstance, AxiosResponse } from "axios";
2
2
  export default class api {
3
- private static axios;
3
+ static get axios(): AxiosInstance;
4
4
  private static withAuth;
5
5
  private static get_headers;
6
6
  static get<T = any>({ url, params, setToken }: {
@@ -117,12 +117,14 @@ class config_env {
117
117
 
118
118
 
119
119
  class api {
120
- static axios = external_axios_default().create({
121
- baseURL: src_config_env.PUBLIC_BASE_URL_BACKEND_PRINCIPAL,
122
- headers: {
123
- "Content-Type": "application/json"
124
- }
125
- });
120
+ static get axios() {
121
+ return external_axios_default().create({
122
+ baseURL: src_config_env.PUBLIC_BASE_URL_BACKEND_PRINCIPAL,
123
+ headers: {
124
+ "Content-Type": "application/json"
125
+ }
126
+ });
127
+ }
126
128
  static withAuth = true;
127
129
  static get_headers(setToken) {
128
130
  if (setToken === true && this.withAuth === true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navservice/core",
3
- "version": "1.58.0",
3
+ "version": "1.59.0",
4
4
  "description": "Service core de todos os micro serviços",
5
5
  "type": "module",
6
6
  "exports": {