@navservice/core 1.52.0 → 1.53.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.
@@ -5,7 +5,7 @@ class config_env {
5
5
  config_env.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL = config.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
6
6
  }
7
7
  static get PUBLIC_BASE_URL_BACKEND_PRINCIPAL() {
8
- return this.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
8
+ return this.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL?.trim();
9
9
  }
10
10
  }
11
11
  const src_config_env = config_env;
@@ -1,6 +1,6 @@
1
1
  import { AxiosResponse } from "axios";
2
2
  interface ApiClientOptions {
3
- baseURL: string;
3
+ baseURL?: string;
4
4
  withAuth?: boolean;
5
5
  }
6
6
  export default class api {
package/build/es/utils.js CHANGED
@@ -41,13 +41,23 @@ const _session_storage = class {
41
41
  }
42
42
  };
43
43
  const utils_session_storage = _session_storage;
44
+ class config_env {
45
+ static SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
46
+ static init(config) {
47
+ config_env.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL = config.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
48
+ }
49
+ static get PUBLIC_BASE_URL_BACKEND_PRINCIPAL() {
50
+ return this.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL?.trim();
51
+ }
52
+ }
53
+ const src_config_env = config_env;
44
54
  class api {
45
55
  axios;
46
56
  withAuth;
47
57
  constructor({ baseURL, withAuth = true }){
48
58
  this.withAuth = withAuth;
49
59
  this.axios = axios.create({
50
- baseURL: baseURL,
60
+ baseURL: src_config_env.PUBLIC_BASE_URL_BACKEND_PRINCIPAL ?? baseURL,
51
61
  headers: {
52
62
  "Content-Type": "application/json"
53
63
  }
@@ -62,7 +62,7 @@ class config_env {
62
62
  config_env.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL = config.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
63
63
  }
64
64
  static get PUBLIC_BASE_URL_BACKEND_PRINCIPAL() {
65
- return this.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
65
+ return this.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL?.trim();
66
66
  }
67
67
  }
68
68
  /* export default */ const src_config_env = (config_env);
@@ -1,6 +1,6 @@
1
1
  import { AxiosResponse } from "axios";
2
2
  interface ApiClientOptions {
3
- baseURL: string;
3
+ baseURL?: string;
4
4
  withAuth?: boolean;
5
5
  }
6
6
  export default class api {
@@ -100,16 +100,29 @@ const _session_storage = class _session_storage {
100
100
  };
101
101
  /* export default */ const utils_session_storage = (_session_storage);
102
102
 
103
+ ;// CONCATENATED MODULE: ./src/config_env/index.ts
104
+ class config_env {
105
+ static SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
106
+ static init(config) {
107
+ config_env.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL = config.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL;
108
+ }
109
+ static get PUBLIC_BASE_URL_BACKEND_PRINCIPAL() {
110
+ return this.SET_PUBLIC_BASE_URL_BACKEND_PRINCIPAL?.trim();
111
+ }
112
+ }
113
+ /* export default */ const src_config_env = (config_env);
114
+
103
115
  ;// CONCATENATED MODULE: ./src/utils/_api.ts
104
116
 
105
117
 
118
+
106
119
  class api {
107
120
  axios;
108
121
  withAuth;
109
122
  constructor({ baseURL, withAuth = true }){
110
123
  this.withAuth = withAuth;
111
124
  this.axios = external_axios_default().create({
112
- baseURL: baseURL,
125
+ baseURL: src_config_env.PUBLIC_BASE_URL_BACKEND_PRINCIPAL ?? baseURL,
113
126
  headers: {
114
127
  "Content-Type": "application/json"
115
128
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navservice/core",
3
- "version": "1.52.0",
3
+ "version": "1.53.0",
4
4
  "description": "Service core de todos os micro serviços",
5
5
  "type": "module",
6
6
  "exports": {