@navservice/core 1.52.0 → 1.54.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;
|
package/build/es/utils/_api.d.ts
CHANGED
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
|
}
|
|
@@ -63,18 +73,18 @@ class api {
|
|
|
63
73
|
return config;
|
|
64
74
|
});
|
|
65
75
|
}
|
|
66
|
-
get(url, params) {
|
|
76
|
+
async get(url, params) {
|
|
67
77
|
return this.axios.get(url, {
|
|
68
78
|
params
|
|
69
79
|
});
|
|
70
80
|
}
|
|
71
|
-
post(url, data) {
|
|
81
|
+
async post(url, data) {
|
|
72
82
|
return this.axios.post(url, data);
|
|
73
83
|
}
|
|
74
|
-
patch(url, data) {
|
|
84
|
+
async patch(url, data) {
|
|
75
85
|
return this.axios.patch(url, data);
|
|
76
86
|
}
|
|
77
|
-
delete(url) {
|
|
87
|
+
async delete(url) {
|
|
78
88
|
return this.axios.delete(url);
|
|
79
89
|
}
|
|
80
90
|
}
|
|
@@ -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);
|
package/build/lib/utils.cjs
CHANGED
|
@@ -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
|
}
|
|
@@ -127,18 +140,18 @@ class api {
|
|
|
127
140
|
return config;
|
|
128
141
|
});
|
|
129
142
|
}
|
|
130
|
-
get(url, params) {
|
|
143
|
+
async get(url, params) {
|
|
131
144
|
return this.axios.get(url, {
|
|
132
145
|
params
|
|
133
146
|
});
|
|
134
147
|
}
|
|
135
|
-
post(url, data) {
|
|
148
|
+
async post(url, data) {
|
|
136
149
|
return this.axios.post(url, data);
|
|
137
150
|
}
|
|
138
|
-
patch(url, data) {
|
|
151
|
+
async patch(url, data) {
|
|
139
152
|
return this.axios.patch(url, data);
|
|
140
153
|
}
|
|
141
|
-
delete(url) {
|
|
154
|
+
async delete(url) {
|
|
142
155
|
return this.axios.delete(url);
|
|
143
156
|
}
|
|
144
157
|
}
|