@rasadov/lumoar-sdk 1.0.1 → 1.0.3
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/.openapi-generator/FILES +2 -4
- package/api.ts +461 -423
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +90 -103
- package/dist/api.d.ts +230 -222
- package/dist/api.js +439 -378
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/configuration.d.ts +4 -9
- package/dist/configuration.js +6 -18
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/AuthApi.md +4 -4
- package/docs/CompanyApi.md +6 -6
- package/docs/HealthApi.md +227 -0
- package/docs/PaymentsApi.md +21 -18
- package/docs/PoliciesApi.md +6 -6
- package/docs/ResponseGetCustomerManagementSessionV1PaymentsCustomerManagementGet.md +22 -0
- package/index.ts +1 -1
- package/package.json +8 -3
package/base.ts
CHANGED
package/common.ts
CHANGED
package/configuration.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Lumoar API
|
|
5
5
|
* Compliance as a service
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document:
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
|
|
15
15
|
import axios, { AxiosInstance, AxiosResponse } from 'axios';
|
|
16
16
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} from './api';
|
|
17
|
+
HealthApi,
|
|
18
|
+
AuthApi,
|
|
19
|
+
CompanyApi,
|
|
20
|
+
ControlsApi,
|
|
21
|
+
EvidenceApi,
|
|
22
|
+
PaymentsApi,
|
|
23
|
+
PoliciesApi,
|
|
24
|
+
RolesApi,
|
|
25
|
+
UserApi
|
|
26
|
+
} from './api';
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
export interface ConfigurationParameters {
|
|
@@ -128,101 +128,88 @@ export class Configuration {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
|
|
131
|
+
|
|
131
132
|
export class ApiSDK {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
133
|
+
private helthApi: HealthApi;
|
|
134
|
+
private authApi: AuthApi;
|
|
135
|
+
private companyApi: CompanyApi;
|
|
136
|
+
private controlsApi: ControlsApi;
|
|
137
|
+
private evidenceApi: EvidenceApi;
|
|
138
|
+
private paymentsApi: PaymentsApi;
|
|
139
|
+
private policiesApi: PoliciesApi;
|
|
140
|
+
private rolesApi: RolesApi;
|
|
141
|
+
private userApi: UserApi;
|
|
142
|
+
private token: string | null = null;
|
|
143
|
+
private axiosInstance: AxiosInstance;
|
|
143
144
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
145
|
+
constructor(basePath?: string) {
|
|
146
|
+
this.axiosInstance = axios.create({
|
|
147
|
+
baseURL: basePath,
|
|
148
|
+
withCredentials: true
|
|
149
|
+
});
|
|
150
|
+
this.setupInterceptors();
|
|
151
|
+
const config = new Configuration({
|
|
152
|
+
basePath,
|
|
153
|
+
apiKey: () => this.getAuthHeader(),
|
|
154
|
+
baseOptions: {
|
|
155
|
+
axios: this.axiosInstance
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
this.helthApi = new HealthApi(config, undefined, this.axiosInstance);
|
|
160
|
+
this.authApi = new AuthApi(config, undefined, this.axiosInstance);
|
|
161
|
+
this.companyApi = new CompanyApi(config, undefined, this.axiosInstance);
|
|
162
|
+
this.controlsApi = new ControlsApi(config, undefined, this.axiosInstance);
|
|
163
|
+
this.evidenceApi = new EvidenceApi(config, undefined, this.axiosInstance);
|
|
164
|
+
this.paymentsApi = new PaymentsApi(config, undefined, this.axiosInstance);
|
|
165
|
+
this.policiesApi = new PoliciesApi(config, undefined, this.axiosInstance);
|
|
166
|
+
this.rolesApi = new RolesApi(config, undefined, this.axiosInstance);
|
|
167
|
+
this.userApi = new UserApi(config, undefined, this.axiosInstance);
|
|
168
|
+
}
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
public setToken(newToken: string) {
|
|
171
|
+
this.token = newToken;
|
|
172
|
+
}
|
|
173
|
+
private getAuthHeader(): string {
|
|
174
|
+
if (!this.token) {
|
|
175
|
+
throw new Error('No token set. Call setToken() first.');
|
|
173
176
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
return `Bearer ${this.token}`;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
private setupInterceptors() {
|
|
181
|
+
this.axiosInstance.interceptors.request.use((config) => {
|
|
182
|
+
if (this.token) {
|
|
183
|
+
config.headers['Authorization'] = this.getAuthHeader();
|
|
179
184
|
}
|
|
180
|
-
return
|
|
181
|
-
|
|
185
|
+
return config;
|
|
186
|
+
});
|
|
182
187
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
return {
|
|
212
|
-
defaultApi: this.defaultApi,
|
|
213
|
-
authApi: this.authApi,
|
|
214
|
-
companyApi: this.companyApi,
|
|
215
|
-
controlsApi: this.controlsApi,
|
|
216
|
-
evidenceApi: this.evidenceApi,
|
|
217
|
-
paymentsApi: this.paymentsApi,
|
|
218
|
-
policiesApi: this.policiesApi,
|
|
219
|
-
rolesApi: this.rolesApi,
|
|
220
|
-
userApi: this.userApi,
|
|
221
|
-
// Legacy support - keep the old health check methods accessible
|
|
222
|
-
getRedisHealthHealthRedisGet: () => this.defaultApi.getRedisHealthHealthRedisGet(),
|
|
223
|
-
getHealthHealthGet: () => this.defaultApi.getHealthHealthGet(),
|
|
224
|
-
getDbHealthHealthDbGet: () => this.defaultApi.getDbHealthHealthDbGet(),
|
|
225
|
-
getListmonkHealthHealthListmonkGet: () => this.defaultApi.getListmonkHealthHealthListmonkGet(),
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
}
|
|
188
|
+
this.axiosInstance.interceptors.response.use((response: AxiosResponse) => {
|
|
189
|
+
const newToken = response.data.newToken || response.headers['Authorization'];
|
|
190
|
+
if (newToken) {
|
|
191
|
+
this.setToken(newToken.replace('Bearer ', ''));
|
|
192
|
+
console.log('Token automatically updated via backend refresh');
|
|
193
|
+
}
|
|
194
|
+
return response;
|
|
195
|
+
}, (error) => {
|
|
196
|
+
if (error.response?.status === 401) {
|
|
197
|
+
console.error('Authentication failed - session expired');
|
|
198
|
+
}
|
|
199
|
+
return Promise.reject(error);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
public getApi() {
|
|
203
|
+
return {
|
|
204
|
+
helthApi: this.helthApi,
|
|
205
|
+
authApi: this.authApi,
|
|
206
|
+
companyApi: this.companyApi,
|
|
207
|
+
controlsApi: this.controlsApi,
|
|
208
|
+
evidenceApi: this.evidenceApi,
|
|
209
|
+
paymentsApi: this.paymentsApi,
|
|
210
|
+
policiesApi: this.policiesApi,
|
|
211
|
+
rolesApi: this.rolesApi,
|
|
212
|
+
userApi: this.userApi,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
}
|