@emilgroup/billing-sdk-node 1.0.1 → 1.3.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/.openapi-generator/FILES +1 -0
- package/README.md +4 -6
- package/api/invoices-api.ts +170 -0
- package/base.ts +22 -32
- package/common.ts +61 -0
- package/dist/api/correction-invoices-api.js +1 -1
- package/dist/api/estimated-invoices-api.js +1 -1
- package/dist/api/initial-invoices-api.js +1 -1
- package/dist/api/invoices-api.d.ts +97 -0
- package/dist/api/invoices-api.js +120 -1
- package/dist/api/recurring-invoices-api.js +1 -1
- package/dist/base.d.ts +1 -2
- package/dist/base.js +19 -21
- package/dist/common.d.ts +26 -0
- package/dist/common.js +35 -2
- package/dist/models/create-custom-estimated-invoice-request-dto.d.ts +1 -1
- package/dist/models/create-invoice-request-dto.d.ts +1 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/list-policies-billing-dates-response-class.d.ts +30 -0
- package/dist/models/list-policies-billing-dates-response-class.js +15 -0
- package/models/index.ts +1 -0
- package/models/list-policies-billing-dates-response-class.ts +36 -0
- package/package.json +2 -3
package/.openapi-generator/FILES
CHANGED
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
This TypeScript/JavaScript client utilizes [axios](https://github.com/axios/axios). The generated Node module can be used with Nodejs based applications.
|
|
4
4
|
|
|
5
|
-
>For more information, you can go to [Emil Api documentation](https://emil.stoplight.io/docs/emil-api/).
|
|
6
|
-
|
|
7
5
|
Language level
|
|
8
6
|
* ES5 - you must have a Promises/A+ library installed
|
|
9
7
|
* ES6
|
|
@@ -12,18 +10,18 @@ Module system
|
|
|
12
10
|
* CommonJS
|
|
13
11
|
* ES6 module system
|
|
14
12
|
|
|
15
|
-
Although this package can be used in both TypeScript and JavaScript, it is intended to be used with TypeScript. The definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)).
|
|
13
|
+
Although this package can be used in both TypeScript and JavaScript, it is intended to be used with TypeScript. The definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html)). For more information, you can go to [Emil Api documentation](https://emil.stoplight.io/docs/emil-api/).
|
|
16
14
|
|
|
17
|
-
##
|
|
15
|
+
## Consuming
|
|
18
16
|
|
|
19
17
|
Navigate to the folder of your consuming project and run one of the following commands:
|
|
20
18
|
|
|
21
19
|
```
|
|
22
|
-
npm install @emilgroup/billing-sdk-node@1.0
|
|
20
|
+
npm install @emilgroup/billing-sdk-node@1.3.0 --save
|
|
23
21
|
```
|
|
24
22
|
or
|
|
25
23
|
```
|
|
26
|
-
yarn add @emilgroup/billing-sdk-node@1.0
|
|
24
|
+
yarn add @emilgroup/billing-sdk-node@1.3.0
|
|
27
25
|
```
|
|
28
26
|
|
|
29
27
|
And then you can import `InvoicesApi`.
|
package/api/invoices-api.ts
CHANGED
|
@@ -22,6 +22,8 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
|
|
|
22
22
|
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
import { ListInvoicesResponseClass } from '../models';
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import { ListPoliciesBillingDatesResponseClass } from '../models';
|
|
25
27
|
// URLSearchParams not necessarily used
|
|
26
28
|
// @ts-ignore
|
|
27
29
|
import { URL, URLSearchParams } from 'url';
|
|
@@ -93,6 +95,76 @@ export const InvoicesApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
93
95
|
|
|
94
96
|
|
|
95
97
|
|
|
98
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
99
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
100
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
url: toPathString(localVarUrlObj),
|
|
104
|
+
options: localVarRequestOptions,
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
/**
|
|
108
|
+
*
|
|
109
|
+
* @param {string} [authorization] Bearer Token
|
|
110
|
+
* @param {number} [pageSize] Page size
|
|
111
|
+
* @param {string} [pageToken] Page token
|
|
112
|
+
* @param {string} [filter] List filter
|
|
113
|
+
* @param {string} [search] Search query
|
|
114
|
+
* @param {string} [order] Ordering criteria
|
|
115
|
+
* @param {string} [expand] Extra fields to fetch
|
|
116
|
+
* @param {*} [options] Override http request option.
|
|
117
|
+
* @throws {RequiredError}
|
|
118
|
+
*/
|
|
119
|
+
listPoliciesBillingDates: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
120
|
+
const localVarPath = `/billingservice/v1/invoices/policies-billing-dates`;
|
|
121
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
122
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
123
|
+
let baseOptions;
|
|
124
|
+
let baseAccessToken;
|
|
125
|
+
if (configuration) {
|
|
126
|
+
baseOptions = configuration.baseOptions;
|
|
127
|
+
baseAccessToken = configuration.accessToken;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
131
|
+
const localVarHeaderParameter = {} as any;
|
|
132
|
+
const localVarQueryParameter = {} as any;
|
|
133
|
+
|
|
134
|
+
// authentication bearer required
|
|
135
|
+
// http bearer authentication required
|
|
136
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
137
|
+
|
|
138
|
+
if (pageSize !== undefined) {
|
|
139
|
+
localVarQueryParameter['pageSize'] = pageSize;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (pageToken !== undefined) {
|
|
143
|
+
localVarQueryParameter['pageToken'] = pageToken;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (filter !== undefined) {
|
|
147
|
+
localVarQueryParameter['filter'] = filter;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (search !== undefined) {
|
|
151
|
+
localVarQueryParameter['search'] = search;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (order !== undefined) {
|
|
155
|
+
localVarQueryParameter['order'] = order;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (expand !== undefined) {
|
|
159
|
+
localVarQueryParameter['expand'] = expand;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
163
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
96
168
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
97
169
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
98
170
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
@@ -128,6 +200,22 @@ export const InvoicesApiFp = function(configuration?: Configuration) {
|
|
|
128
200
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listInvoices(authorization, pageSize, pageToken, filter, search, order, expand, options);
|
|
129
201
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
130
202
|
},
|
|
203
|
+
/**
|
|
204
|
+
*
|
|
205
|
+
* @param {string} [authorization] Bearer Token
|
|
206
|
+
* @param {number} [pageSize] Page size
|
|
207
|
+
* @param {string} [pageToken] Page token
|
|
208
|
+
* @param {string} [filter] List filter
|
|
209
|
+
* @param {string} [search] Search query
|
|
210
|
+
* @param {string} [order] Ordering criteria
|
|
211
|
+
* @param {string} [expand] Extra fields to fetch
|
|
212
|
+
* @param {*} [options] Override http request option.
|
|
213
|
+
* @throws {RequiredError}
|
|
214
|
+
*/
|
|
215
|
+
async listPoliciesBillingDates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListPoliciesBillingDatesResponseClass>> {
|
|
216
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listPoliciesBillingDates(authorization, pageSize, pageToken, filter, search, order, expand, options);
|
|
217
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
218
|
+
},
|
|
131
219
|
}
|
|
132
220
|
};
|
|
133
221
|
|
|
@@ -153,6 +241,21 @@ export const InvoicesApiFactory = function (configuration?: Configuration, baseP
|
|
|
153
241
|
listInvoices(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListInvoicesResponseClass> {
|
|
154
242
|
return localVarFp.listInvoices(authorization, pageSize, pageToken, filter, search, order, expand, options).then((request) => request(axios, basePath));
|
|
155
243
|
},
|
|
244
|
+
/**
|
|
245
|
+
*
|
|
246
|
+
* @param {string} [authorization] Bearer Token
|
|
247
|
+
* @param {number} [pageSize] Page size
|
|
248
|
+
* @param {string} [pageToken] Page token
|
|
249
|
+
* @param {string} [filter] List filter
|
|
250
|
+
* @param {string} [search] Search query
|
|
251
|
+
* @param {string} [order] Ordering criteria
|
|
252
|
+
* @param {string} [expand] Extra fields to fetch
|
|
253
|
+
* @param {*} [options] Override http request option.
|
|
254
|
+
* @throws {RequiredError}
|
|
255
|
+
*/
|
|
256
|
+
listPoliciesBillingDates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListPoliciesBillingDatesResponseClass> {
|
|
257
|
+
return localVarFp.listPoliciesBillingDates(authorization, pageSize, pageToken, filter, search, order, expand, options).then((request) => request(axios, basePath));
|
|
258
|
+
},
|
|
156
259
|
};
|
|
157
260
|
};
|
|
158
261
|
|
|
@@ -212,6 +315,62 @@ export interface InvoicesApiListInvoicesRequest {
|
|
|
212
315
|
readonly expand?: string
|
|
213
316
|
}
|
|
214
317
|
|
|
318
|
+
/**
|
|
319
|
+
* Request parameters for listPoliciesBillingDates operation in InvoicesApi.
|
|
320
|
+
* @export
|
|
321
|
+
* @interface InvoicesApiListPoliciesBillingDatesRequest
|
|
322
|
+
*/
|
|
323
|
+
export interface InvoicesApiListPoliciesBillingDatesRequest {
|
|
324
|
+
/**
|
|
325
|
+
* Bearer Token
|
|
326
|
+
* @type {string}
|
|
327
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
328
|
+
*/
|
|
329
|
+
readonly authorization?: string
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Page size
|
|
333
|
+
* @type {number}
|
|
334
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
335
|
+
*/
|
|
336
|
+
readonly pageSize?: number
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Page token
|
|
340
|
+
* @type {string}
|
|
341
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
342
|
+
*/
|
|
343
|
+
readonly pageToken?: string
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* List filter
|
|
347
|
+
* @type {string}
|
|
348
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
349
|
+
*/
|
|
350
|
+
readonly filter?: string
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Search query
|
|
354
|
+
* @type {string}
|
|
355
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
356
|
+
*/
|
|
357
|
+
readonly search?: string
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Ordering criteria
|
|
361
|
+
* @type {string}
|
|
362
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
363
|
+
*/
|
|
364
|
+
readonly order?: string
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Extra fields to fetch
|
|
368
|
+
* @type {string}
|
|
369
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
370
|
+
*/
|
|
371
|
+
readonly expand?: string
|
|
372
|
+
}
|
|
373
|
+
|
|
215
374
|
/**
|
|
216
375
|
* InvoicesApi - object-oriented interface
|
|
217
376
|
* @export
|
|
@@ -229,4 +388,15 @@ export class InvoicesApi extends BaseAPI {
|
|
|
229
388
|
public listInvoices(requestParameters: InvoicesApiListInvoicesRequest = {}, options?: AxiosRequestConfig) {
|
|
230
389
|
return InvoicesApiFp(this.configuration).listInvoices(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
|
|
231
390
|
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
*
|
|
394
|
+
* @param {InvoicesApiListPoliciesBillingDatesRequest} requestParameters Request parameters.
|
|
395
|
+
* @param {*} [options] Override http request option.
|
|
396
|
+
* @throws {RequiredError}
|
|
397
|
+
* @memberof InvoicesApi
|
|
398
|
+
*/
|
|
399
|
+
public listPoliciesBillingDates(requestParameters: InvoicesApiListPoliciesBillingDatesRequest = {}, options?: AxiosRequestConfig) {
|
|
400
|
+
return InvoicesApiFp(this.configuration).listPoliciesBillingDates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
|
|
401
|
+
}
|
|
232
402
|
}
|
package/base.ts
CHANGED
|
@@ -42,7 +42,6 @@ export const COLLECTION_FORMATS = {
|
|
|
42
42
|
export interface LoginClass {
|
|
43
43
|
accessToken: string;
|
|
44
44
|
permissions: Array<string>;
|
|
45
|
-
newPasswordRequired: boolean;
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
export enum Environment {
|
|
@@ -50,6 +49,13 @@ export enum Environment {
|
|
|
50
49
|
Test = 'https://apiv2-test.emil.de',
|
|
51
50
|
}
|
|
52
51
|
|
|
52
|
+
let _retry_count = 0
|
|
53
|
+
let _retry = null
|
|
54
|
+
|
|
55
|
+
export function resetRetry() {
|
|
56
|
+
_retry_count = 0
|
|
57
|
+
}
|
|
58
|
+
|
|
53
59
|
/**
|
|
54
60
|
*
|
|
55
61
|
* @export
|
|
@@ -69,7 +75,6 @@ const NETWORK_ERROR_MESSAGE = "Network Error";
|
|
|
69
75
|
*/
|
|
70
76
|
export class BaseAPI {
|
|
71
77
|
protected configuration: Configuration;
|
|
72
|
-
private lastRequestConfig?: AxiosRequestConfig;
|
|
73
78
|
private username?: string;
|
|
74
79
|
private password?: string;
|
|
75
80
|
|
|
@@ -182,6 +187,7 @@ export class BaseAPI {
|
|
|
182
187
|
data: { username: username },
|
|
183
188
|
withCredentials: true,
|
|
184
189
|
};
|
|
190
|
+
|
|
185
191
|
const { data: { accessToken } } = await globalAxios.request<LoginClass>(options);
|
|
186
192
|
|
|
187
193
|
return accessToken;
|
|
@@ -202,13 +208,6 @@ export class BaseAPI {
|
|
|
202
208
|
}
|
|
203
209
|
|
|
204
210
|
private attachInterceptor(axios: AxiosInstance) {
|
|
205
|
-
axios.interceptors.request.use((config) => {
|
|
206
|
-
if (config.url?.indexOf('refresh-token') === -1) {
|
|
207
|
-
this.lastRequestConfig = config;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
return config;
|
|
211
|
-
});
|
|
212
211
|
axios.interceptors.response.use(
|
|
213
212
|
(res) => {
|
|
214
213
|
return res;
|
|
@@ -223,17 +222,11 @@ export class BaseAPI {
|
|
|
223
222
|
const tokenString = await this.refreshToken();
|
|
224
223
|
const accessToken = `Bearer ${tokenString}`;
|
|
225
224
|
|
|
226
|
-
|
|
227
|
-
localVarHeaderParameter['Authorization'] = accessToken;
|
|
228
|
-
|
|
229
|
-
originalConfig.headers = {
|
|
230
|
-
...originalConfig.headers,
|
|
231
|
-
...localVarHeaderParameter,
|
|
232
|
-
};
|
|
225
|
+
originalConfig.headers['Authorization'] = `Bearer ${accessToken}`
|
|
233
226
|
|
|
234
227
|
this.configuration.accessToken = accessToken;
|
|
235
228
|
|
|
236
|
-
return axios(originalConfig);
|
|
229
|
+
return axios.request(originalConfig);
|
|
237
230
|
} catch (_error) {
|
|
238
231
|
if (_error.response && _error.response.data) {
|
|
239
232
|
return Promise.reject(_error.response.data);
|
|
@@ -244,28 +237,24 @@ export class BaseAPI {
|
|
|
244
237
|
if (err.response.status === 403 && err.response.data) {
|
|
245
238
|
return Promise.reject(err.response.data);
|
|
246
239
|
}
|
|
247
|
-
} else if
|
|
240
|
+
} else if(err.message === NETWORK_ERROR_MESSAGE
|
|
241
|
+
&& err.isAxiosError
|
|
242
|
+
&& originalConfig.headers.hasOwnProperty('Authorization')
|
|
243
|
+
&& _retry_count < 4
|
|
244
|
+
){
|
|
245
|
+
_retry_count++;
|
|
248
246
|
try {
|
|
249
247
|
const tokenString = await this.refreshToken();
|
|
250
248
|
const accessToken = `Bearer ${tokenString}`;
|
|
251
249
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
this.lastRequestConfig.headers = {
|
|
256
|
-
...originalConfig.headers,
|
|
257
|
-
...localVarHeaderParameter,
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
originalConfig = {
|
|
261
|
-
...this.lastRequestConfig,
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
originalConfig._retry = true;
|
|
250
|
+
_retry = true;
|
|
251
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
265
252
|
|
|
266
253
|
this.configuration.accessToken = accessToken;
|
|
267
254
|
|
|
268
|
-
return axios(
|
|
255
|
+
return axios.request({
|
|
256
|
+
...originalConfig,
|
|
257
|
+
});
|
|
269
258
|
} catch (_error) {
|
|
270
259
|
if (_error.response && _error.response.data) {
|
|
271
260
|
return Promise.reject(_error.response.data);
|
|
@@ -291,3 +280,4 @@ export class RequiredError extends Error {
|
|
|
291
280
|
super(msg);
|
|
292
281
|
}
|
|
293
282
|
}
|
|
283
|
+
|
package/common.ts
CHANGED
|
@@ -136,3 +136,64 @@ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxi
|
|
|
136
136
|
return axios.request<T, R>(axiosRequestArgs);
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
+
|
|
140
|
+
/* tslint:disable */
|
|
141
|
+
/* eslint-disable */
|
|
142
|
+
/**
|
|
143
|
+
* EMIL BillingService
|
|
144
|
+
* The EMIL BillingService API description
|
|
145
|
+
*
|
|
146
|
+
* The version of the OpenAPI document: 1.0
|
|
147
|
+
*
|
|
148
|
+
*
|
|
149
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
150
|
+
* https://openapi-generator.tech
|
|
151
|
+
* Do not edit the class manually.
|
|
152
|
+
*/
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
export interface IStorageConverter<D, SD> {
|
|
156
|
+
toStorageData( data: D ): SD;
|
|
157
|
+
fromStorageData( storageData: SD ): D;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface IStorage {
|
|
161
|
+
get<T>( key: string, converter?: IStorageConverter<T, any> ): T | null;
|
|
162
|
+
set<T>( key: string, value: T, converter?: IStorageConverter<T, any> ): void;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export class LocalStorage implements IStorage {
|
|
166
|
+
readonly storage: Storage;
|
|
167
|
+
|
|
168
|
+
constructor() {
|
|
169
|
+
this.storage = localStorage;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
get<T>( key: string, converter?: IStorageConverter<T, any> ): T | null {
|
|
173
|
+
const jsonValue = this.storage.getItem( key );
|
|
174
|
+
if ( jsonValue === null ) {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
const value = JSON.parse( jsonValue );
|
|
178
|
+
if ( converter !== undefined ) {
|
|
179
|
+
return converter.fromStorageData( value );
|
|
180
|
+
} else {
|
|
181
|
+
return value as T;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
set<T>( key: string, value: T, converter?: IStorageConverter<T, any> ): void {
|
|
186
|
+
let valueToStore: any = value;
|
|
187
|
+
if ( converter !== undefined ) {
|
|
188
|
+
valueToStore = converter.toStorageData( value );
|
|
189
|
+
}
|
|
190
|
+
const jsonValue = JSON.stringify( valueToStore );
|
|
191
|
+
this.storage.setItem( key, jsonValue );
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
let _defaultStorage: IStorage = null;
|
|
196
|
+
|
|
197
|
+
export const defaultStorage = (): IStorage => {
|
|
198
|
+
return _defaultStorage || (_defaultStorage = new LocalStorage());
|
|
199
|
+
};
|
|
@@ -53,7 +53,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
53
53
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54
54
|
function step(op) {
|
|
55
55
|
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
-
while (_) try {
|
|
56
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
57
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
58
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
59
|
switch (op[0]) {
|
|
@@ -53,7 +53,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
53
53
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54
54
|
function step(op) {
|
|
55
55
|
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
-
while (_) try {
|
|
56
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
57
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
58
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
59
|
switch (op[0]) {
|
|
@@ -53,7 +53,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
53
53
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54
54
|
function step(op) {
|
|
55
55
|
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
-
while (_) try {
|
|
56
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
57
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
58
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
59
|
switch (op[0]) {
|
|
@@ -13,6 +13,7 @@ import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
|
13
13
|
import { Configuration } from '../configuration';
|
|
14
14
|
import { RequestArgs, BaseAPI } from '../base';
|
|
15
15
|
import { ListInvoicesResponseClass } from '../models';
|
|
16
|
+
import { ListPoliciesBillingDatesResponseClass } from '../models';
|
|
16
17
|
/**
|
|
17
18
|
* InvoicesApi - axios parameter creator
|
|
18
19
|
* @export
|
|
@@ -31,6 +32,19 @@ export declare const InvoicesApiAxiosParamCreator: (configuration?: Configuratio
|
|
|
31
32
|
* @throws {RequiredError}
|
|
32
33
|
*/
|
|
33
34
|
listInvoices: (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @param {string} [authorization] Bearer Token
|
|
38
|
+
* @param {number} [pageSize] Page size
|
|
39
|
+
* @param {string} [pageToken] Page token
|
|
40
|
+
* @param {string} [filter] List filter
|
|
41
|
+
* @param {string} [search] Search query
|
|
42
|
+
* @param {string} [order] Ordering criteria
|
|
43
|
+
* @param {string} [expand] Extra fields to fetch
|
|
44
|
+
* @param {*} [options] Override http request option.
|
|
45
|
+
* @throws {RequiredError}
|
|
46
|
+
*/
|
|
47
|
+
listPoliciesBillingDates: (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
34
48
|
};
|
|
35
49
|
/**
|
|
36
50
|
* InvoicesApi - functional programming interface
|
|
@@ -50,6 +64,19 @@ export declare const InvoicesApiFp: (configuration?: Configuration) => {
|
|
|
50
64
|
* @throws {RequiredError}
|
|
51
65
|
*/
|
|
52
66
|
listInvoices(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListInvoicesResponseClass>>;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @param {string} [authorization] Bearer Token
|
|
70
|
+
* @param {number} [pageSize] Page size
|
|
71
|
+
* @param {string} [pageToken] Page token
|
|
72
|
+
* @param {string} [filter] List filter
|
|
73
|
+
* @param {string} [search] Search query
|
|
74
|
+
* @param {string} [order] Ordering criteria
|
|
75
|
+
* @param {string} [expand] Extra fields to fetch
|
|
76
|
+
* @param {*} [options] Override http request option.
|
|
77
|
+
* @throws {RequiredError}
|
|
78
|
+
*/
|
|
79
|
+
listPoliciesBillingDates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListPoliciesBillingDatesResponseClass>>;
|
|
53
80
|
};
|
|
54
81
|
/**
|
|
55
82
|
* InvoicesApi - factory interface
|
|
@@ -69,6 +96,19 @@ export declare const InvoicesApiFactory: (configuration?: Configuration, basePat
|
|
|
69
96
|
* @throws {RequiredError}
|
|
70
97
|
*/
|
|
71
98
|
listInvoices(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListInvoicesResponseClass>;
|
|
99
|
+
/**
|
|
100
|
+
*
|
|
101
|
+
* @param {string} [authorization] Bearer Token
|
|
102
|
+
* @param {number} [pageSize] Page size
|
|
103
|
+
* @param {string} [pageToken] Page token
|
|
104
|
+
* @param {string} [filter] List filter
|
|
105
|
+
* @param {string} [search] Search query
|
|
106
|
+
* @param {string} [order] Ordering criteria
|
|
107
|
+
* @param {string} [expand] Extra fields to fetch
|
|
108
|
+
* @param {*} [options] Override http request option.
|
|
109
|
+
* @throws {RequiredError}
|
|
110
|
+
*/
|
|
111
|
+
listPoliciesBillingDates(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListPoliciesBillingDatesResponseClass>;
|
|
72
112
|
};
|
|
73
113
|
/**
|
|
74
114
|
* Request parameters for listInvoices operation in InvoicesApi.
|
|
@@ -119,6 +159,55 @@ export interface InvoicesApiListInvoicesRequest {
|
|
|
119
159
|
*/
|
|
120
160
|
readonly expand?: string;
|
|
121
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Request parameters for listPoliciesBillingDates operation in InvoicesApi.
|
|
164
|
+
* @export
|
|
165
|
+
* @interface InvoicesApiListPoliciesBillingDatesRequest
|
|
166
|
+
*/
|
|
167
|
+
export interface InvoicesApiListPoliciesBillingDatesRequest {
|
|
168
|
+
/**
|
|
169
|
+
* Bearer Token
|
|
170
|
+
* @type {string}
|
|
171
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
172
|
+
*/
|
|
173
|
+
readonly authorization?: string;
|
|
174
|
+
/**
|
|
175
|
+
* Page size
|
|
176
|
+
* @type {number}
|
|
177
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
178
|
+
*/
|
|
179
|
+
readonly pageSize?: number;
|
|
180
|
+
/**
|
|
181
|
+
* Page token
|
|
182
|
+
* @type {string}
|
|
183
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
184
|
+
*/
|
|
185
|
+
readonly pageToken?: string;
|
|
186
|
+
/**
|
|
187
|
+
* List filter
|
|
188
|
+
* @type {string}
|
|
189
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
190
|
+
*/
|
|
191
|
+
readonly filter?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Search query
|
|
194
|
+
* @type {string}
|
|
195
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
196
|
+
*/
|
|
197
|
+
readonly search?: string;
|
|
198
|
+
/**
|
|
199
|
+
* Ordering criteria
|
|
200
|
+
* @type {string}
|
|
201
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
202
|
+
*/
|
|
203
|
+
readonly order?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Extra fields to fetch
|
|
206
|
+
* @type {string}
|
|
207
|
+
* @memberof InvoicesApiListPoliciesBillingDates
|
|
208
|
+
*/
|
|
209
|
+
readonly expand?: string;
|
|
210
|
+
}
|
|
122
211
|
/**
|
|
123
212
|
* InvoicesApi - object-oriented interface
|
|
124
213
|
* @export
|
|
@@ -134,4 +223,12 @@ export declare class InvoicesApi extends BaseAPI {
|
|
|
134
223
|
* @memberof InvoicesApi
|
|
135
224
|
*/
|
|
136
225
|
listInvoices(requestParameters?: InvoicesApiListInvoicesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListInvoicesResponseClass, any>>;
|
|
226
|
+
/**
|
|
227
|
+
*
|
|
228
|
+
* @param {InvoicesApiListPoliciesBillingDatesRequest} requestParameters Request parameters.
|
|
229
|
+
* @param {*} [options] Override http request option.
|
|
230
|
+
* @throws {RequiredError}
|
|
231
|
+
* @memberof InvoicesApi
|
|
232
|
+
*/
|
|
233
|
+
listPoliciesBillingDates(requestParameters?: InvoicesApiListPoliciesBillingDatesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListPoliciesBillingDatesResponseClass, any>>;
|
|
137
234
|
}
|
package/dist/api/invoices-api.js
CHANGED
|
@@ -53,7 +53,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
53
53
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54
54
|
function step(op) {
|
|
55
55
|
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
-
while (_) try {
|
|
56
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
57
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
58
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
59
|
switch (op[0]) {
|
|
@@ -163,6 +163,73 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
|
|
|
163
163
|
});
|
|
164
164
|
});
|
|
165
165
|
},
|
|
166
|
+
/**
|
|
167
|
+
*
|
|
168
|
+
* @param {string} [authorization] Bearer Token
|
|
169
|
+
* @param {number} [pageSize] Page size
|
|
170
|
+
* @param {string} [pageToken] Page token
|
|
171
|
+
* @param {string} [filter] List filter
|
|
172
|
+
* @param {string} [search] Search query
|
|
173
|
+
* @param {string} [order] Ordering criteria
|
|
174
|
+
* @param {string} [expand] Extra fields to fetch
|
|
175
|
+
* @param {*} [options] Override http request option.
|
|
176
|
+
* @throws {RequiredError}
|
|
177
|
+
*/
|
|
178
|
+
listPoliciesBillingDates: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
|
|
179
|
+
if (options === void 0) { options = {}; }
|
|
180
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
181
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
182
|
+
return __generator(this, function (_a) {
|
|
183
|
+
switch (_a.label) {
|
|
184
|
+
case 0:
|
|
185
|
+
localVarPath = "/billingservice/v1/invoices/policies-billing-dates";
|
|
186
|
+
localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
187
|
+
if (configuration) {
|
|
188
|
+
baseOptions = configuration.baseOptions;
|
|
189
|
+
baseAccessToken = configuration.accessToken;
|
|
190
|
+
}
|
|
191
|
+
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
192
|
+
localVarHeaderParameter = {};
|
|
193
|
+
localVarQueryParameter = {};
|
|
194
|
+
// authentication bearer required
|
|
195
|
+
// http bearer authentication required
|
|
196
|
+
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
197
|
+
case 1:
|
|
198
|
+
// authentication bearer required
|
|
199
|
+
// http bearer authentication required
|
|
200
|
+
_a.sent();
|
|
201
|
+
if (pageSize !== undefined) {
|
|
202
|
+
localVarQueryParameter['pageSize'] = pageSize;
|
|
203
|
+
}
|
|
204
|
+
if (pageToken !== undefined) {
|
|
205
|
+
localVarQueryParameter['pageToken'] = pageToken;
|
|
206
|
+
}
|
|
207
|
+
if (filter !== undefined) {
|
|
208
|
+
localVarQueryParameter['filter'] = filter;
|
|
209
|
+
}
|
|
210
|
+
if (search !== undefined) {
|
|
211
|
+
localVarQueryParameter['search'] = search;
|
|
212
|
+
}
|
|
213
|
+
if (order !== undefined) {
|
|
214
|
+
localVarQueryParameter['order'] = order;
|
|
215
|
+
}
|
|
216
|
+
if (expand !== undefined) {
|
|
217
|
+
localVarQueryParameter['expand'] = expand;
|
|
218
|
+
}
|
|
219
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
220
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
221
|
+
}
|
|
222
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
223
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
224
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
225
|
+
return [2 /*return*/, {
|
|
226
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
227
|
+
options: localVarRequestOptions,
|
|
228
|
+
}];
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
},
|
|
166
233
|
};
|
|
167
234
|
};
|
|
168
235
|
exports.InvoicesApiAxiosParamCreator = InvoicesApiAxiosParamCreator;
|
|
@@ -198,6 +265,31 @@ var InvoicesApiFp = function (configuration) {
|
|
|
198
265
|
});
|
|
199
266
|
});
|
|
200
267
|
},
|
|
268
|
+
/**
|
|
269
|
+
*
|
|
270
|
+
* @param {string} [authorization] Bearer Token
|
|
271
|
+
* @param {number} [pageSize] Page size
|
|
272
|
+
* @param {string} [pageToken] Page token
|
|
273
|
+
* @param {string} [filter] List filter
|
|
274
|
+
* @param {string} [search] Search query
|
|
275
|
+
* @param {string} [order] Ordering criteria
|
|
276
|
+
* @param {string} [expand] Extra fields to fetch
|
|
277
|
+
* @param {*} [options] Override http request option.
|
|
278
|
+
* @throws {RequiredError}
|
|
279
|
+
*/
|
|
280
|
+
listPoliciesBillingDates: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
|
|
281
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
282
|
+
var localVarAxiosArgs;
|
|
283
|
+
return __generator(this, function (_a) {
|
|
284
|
+
switch (_a.label) {
|
|
285
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.listPoliciesBillingDates(authorization, pageSize, pageToken, filter, search, order, expand, options)];
|
|
286
|
+
case 1:
|
|
287
|
+
localVarAxiosArgs = _a.sent();
|
|
288
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
},
|
|
201
293
|
};
|
|
202
294
|
};
|
|
203
295
|
exports.InvoicesApiFp = InvoicesApiFp;
|
|
@@ -223,6 +315,21 @@ var InvoicesApiFactory = function (configuration, basePath, axios) {
|
|
|
223
315
|
listInvoices: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
|
|
224
316
|
return localVarFp.listInvoices(authorization, pageSize, pageToken, filter, search, order, expand, options).then(function (request) { return request(axios, basePath); });
|
|
225
317
|
},
|
|
318
|
+
/**
|
|
319
|
+
*
|
|
320
|
+
* @param {string} [authorization] Bearer Token
|
|
321
|
+
* @param {number} [pageSize] Page size
|
|
322
|
+
* @param {string} [pageToken] Page token
|
|
323
|
+
* @param {string} [filter] List filter
|
|
324
|
+
* @param {string} [search] Search query
|
|
325
|
+
* @param {string} [order] Ordering criteria
|
|
326
|
+
* @param {string} [expand] Extra fields to fetch
|
|
327
|
+
* @param {*} [options] Override http request option.
|
|
328
|
+
* @throws {RequiredError}
|
|
329
|
+
*/
|
|
330
|
+
listPoliciesBillingDates: function (authorization, pageSize, pageToken, filter, search, order, expand, options) {
|
|
331
|
+
return localVarFp.listPoliciesBillingDates(authorization, pageSize, pageToken, filter, search, order, expand, options).then(function (request) { return request(axios, basePath); });
|
|
332
|
+
},
|
|
226
333
|
};
|
|
227
334
|
};
|
|
228
335
|
exports.InvoicesApiFactory = InvoicesApiFactory;
|
|
@@ -249,6 +356,18 @@ var InvoicesApi = /** @class */ (function (_super) {
|
|
|
249
356
|
if (requestParameters === void 0) { requestParameters = {}; }
|
|
250
357
|
return (0, exports.InvoicesApiFp)(this.configuration).listInvoices(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
251
358
|
};
|
|
359
|
+
/**
|
|
360
|
+
*
|
|
361
|
+
* @param {InvoicesApiListPoliciesBillingDatesRequest} requestParameters Request parameters.
|
|
362
|
+
* @param {*} [options] Override http request option.
|
|
363
|
+
* @throws {RequiredError}
|
|
364
|
+
* @memberof InvoicesApi
|
|
365
|
+
*/
|
|
366
|
+
InvoicesApi.prototype.listPoliciesBillingDates = function (requestParameters, options) {
|
|
367
|
+
var _this = this;
|
|
368
|
+
if (requestParameters === void 0) { requestParameters = {}; }
|
|
369
|
+
return (0, exports.InvoicesApiFp)(this.configuration).listPoliciesBillingDates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
370
|
+
};
|
|
252
371
|
return InvoicesApi;
|
|
253
372
|
}(base_1.BaseAPI));
|
|
254
373
|
exports.InvoicesApi = InvoicesApi;
|
|
@@ -53,7 +53,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
53
53
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54
54
|
function step(op) {
|
|
55
55
|
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
-
while (_) try {
|
|
56
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
57
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
58
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
59
|
switch (op[0]) {
|
package/dist/base.d.ts
CHANGED
|
@@ -25,12 +25,12 @@ export declare const COLLECTION_FORMATS: {
|
|
|
25
25
|
export interface LoginClass {
|
|
26
26
|
accessToken: string;
|
|
27
27
|
permissions: Array<string>;
|
|
28
|
-
newPasswordRequired: boolean;
|
|
29
28
|
}
|
|
30
29
|
export declare enum Environment {
|
|
31
30
|
Production = "https://apiv2.emil.de",
|
|
32
31
|
Test = "https://apiv2-test.emil.de"
|
|
33
32
|
}
|
|
33
|
+
export declare function resetRetry(): void;
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
* @export
|
|
@@ -49,7 +49,6 @@ export declare class BaseAPI {
|
|
|
49
49
|
protected basePath: string;
|
|
50
50
|
protected axios: AxiosInstance;
|
|
51
51
|
protected configuration: Configuration;
|
|
52
|
-
private lastRequestConfig?;
|
|
53
52
|
private username?;
|
|
54
53
|
private password?;
|
|
55
54
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
package/dist/base.js
CHANGED
|
@@ -76,7 +76,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
76
76
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
77
77
|
function step(op) {
|
|
78
78
|
if (f) throw new TypeError("Generator is already executing.");
|
|
79
|
-
while (_) try {
|
|
79
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
80
80
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
81
81
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
82
82
|
switch (op[0]) {
|
|
@@ -101,7 +101,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
101
101
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
102
102
|
};
|
|
103
103
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
104
|
-
exports.RequiredError = exports.BaseAPI = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
104
|
+
exports.RequiredError = exports.BaseAPI = exports.resetRetry = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
105
105
|
var configuration_1 = require("./configuration");
|
|
106
106
|
// Some imports not used depending on template conditions
|
|
107
107
|
// @ts-ignore
|
|
@@ -130,6 +130,12 @@ var Environment;
|
|
|
130
130
|
Environment["Production"] = "https://apiv2.emil.de";
|
|
131
131
|
Environment["Test"] = "https://apiv2-test.emil.de";
|
|
132
132
|
})(Environment = exports.Environment || (exports.Environment = {}));
|
|
133
|
+
var _retry_count = 0;
|
|
134
|
+
var _retry = null;
|
|
135
|
+
function resetRetry() {
|
|
136
|
+
_retry_count = 0;
|
|
137
|
+
}
|
|
138
|
+
exports.resetRetry = resetRetry;
|
|
133
139
|
var NETWORK_ERROR_MESSAGE = "Network Error";
|
|
134
140
|
/**
|
|
135
141
|
*
|
|
@@ -303,17 +309,10 @@ var BaseAPI = /** @class */ (function () {
|
|
|
303
309
|
};
|
|
304
310
|
BaseAPI.prototype.attachInterceptor = function (axios) {
|
|
305
311
|
var _this = this;
|
|
306
|
-
axios.interceptors.request.use(function (config) {
|
|
307
|
-
var _a;
|
|
308
|
-
if (((_a = config.url) === null || _a === void 0 ? void 0 : _a.indexOf('refresh-token')) === -1) {
|
|
309
|
-
_this.lastRequestConfig = config;
|
|
310
|
-
}
|
|
311
|
-
return config;
|
|
312
|
-
});
|
|
313
312
|
axios.interceptors.response.use(function (res) {
|
|
314
313
|
return res;
|
|
315
314
|
}, function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
316
|
-
var originalConfig, tokenString, accessToken,
|
|
315
|
+
var originalConfig, tokenString, accessToken, _error_1, tokenString, accessToken, _error_2;
|
|
317
316
|
return __generator(this, function (_a) {
|
|
318
317
|
switch (_a.label) {
|
|
319
318
|
case 0:
|
|
@@ -328,11 +327,9 @@ var BaseAPI = /** @class */ (function () {
|
|
|
328
327
|
case 2:
|
|
329
328
|
tokenString = _a.sent();
|
|
330
329
|
accessToken = "Bearer ".concat(tokenString);
|
|
331
|
-
|
|
332
|
-
localVarHeaderParameter['Authorization'] = accessToken;
|
|
333
|
-
originalConfig.headers = __assign(__assign({}, originalConfig.headers), localVarHeaderParameter);
|
|
330
|
+
originalConfig.headers['Authorization'] = "Bearer ".concat(accessToken);
|
|
334
331
|
this.configuration.accessToken = accessToken;
|
|
335
|
-
return [2 /*return*/, axios(originalConfig)];
|
|
332
|
+
return [2 /*return*/, axios.request(originalConfig)];
|
|
336
333
|
case 3:
|
|
337
334
|
_error_1 = _a.sent();
|
|
338
335
|
if (_error_1.response && _error_1.response.data) {
|
|
@@ -345,7 +342,11 @@ var BaseAPI = /** @class */ (function () {
|
|
|
345
342
|
}
|
|
346
343
|
return [3 /*break*/, 9];
|
|
347
344
|
case 5:
|
|
348
|
-
if (!(err.message === NETWORK_ERROR_MESSAGE
|
|
345
|
+
if (!(err.message === NETWORK_ERROR_MESSAGE
|
|
346
|
+
&& err.isAxiosError
|
|
347
|
+
&& originalConfig.headers.hasOwnProperty('Authorization')
|
|
348
|
+
&& _retry_count < 4)) return [3 /*break*/, 9];
|
|
349
|
+
_retry_count++;
|
|
349
350
|
_a.label = 6;
|
|
350
351
|
case 6:
|
|
351
352
|
_a.trys.push([6, 8, , 9]);
|
|
@@ -353,13 +354,10 @@ var BaseAPI = /** @class */ (function () {
|
|
|
353
354
|
case 7:
|
|
354
355
|
tokenString = _a.sent();
|
|
355
356
|
accessToken = "Bearer ".concat(tokenString);
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
this.lastRequestConfig.headers = __assign(__assign({}, originalConfig.headers), localVarHeaderParameter);
|
|
359
|
-
originalConfig = __assign({}, this.lastRequestConfig);
|
|
360
|
-
originalConfig._retry = true;
|
|
357
|
+
_retry = true;
|
|
358
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
361
359
|
this.configuration.accessToken = accessToken;
|
|
362
|
-
return [2 /*return*/, axios(originalConfig)];
|
|
360
|
+
return [2 /*return*/, axios.request(__assign({}, originalConfig))];
|
|
363
361
|
case 8:
|
|
364
362
|
_error_2 = _a.sent();
|
|
365
363
|
if (_error_2.response && _error_2.response.data) {
|
package/dist/common.d.ts
CHANGED
|
@@ -64,3 +64,29 @@ export declare const toPathString: (url: URL) => string;
|
|
|
64
64
|
* @export
|
|
65
65
|
*/
|
|
66
66
|
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
|
67
|
+
/**
|
|
68
|
+
* EMIL BillingService
|
|
69
|
+
* The EMIL BillingService API description
|
|
70
|
+
*
|
|
71
|
+
* The version of the OpenAPI document: 1.0
|
|
72
|
+
*
|
|
73
|
+
*
|
|
74
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
75
|
+
* https://openapi-generator.tech
|
|
76
|
+
* Do not edit the class manually.
|
|
77
|
+
*/
|
|
78
|
+
export interface IStorageConverter<D, SD> {
|
|
79
|
+
toStorageData(data: D): SD;
|
|
80
|
+
fromStorageData(storageData: SD): D;
|
|
81
|
+
}
|
|
82
|
+
export interface IStorage {
|
|
83
|
+
get<T>(key: string, converter?: IStorageConverter<T, any>): T | null;
|
|
84
|
+
set<T>(key: string, value: T, converter?: IStorageConverter<T, any>): void;
|
|
85
|
+
}
|
|
86
|
+
export declare class LocalStorage implements IStorage {
|
|
87
|
+
readonly storage: Storage;
|
|
88
|
+
constructor();
|
|
89
|
+
get<T>(key: string, converter?: IStorageConverter<T, any>): T | null;
|
|
90
|
+
set<T>(key: string, value: T, converter?: IStorageConverter<T, any>): void;
|
|
91
|
+
}
|
|
92
|
+
export declare const defaultStorage: () => IStorage;
|
package/dist/common.js
CHANGED
|
@@ -38,7 +38,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
39
39
|
function step(op) {
|
|
40
40
|
if (f) throw new TypeError("Generator is already executing.");
|
|
41
|
-
while (_) try {
|
|
41
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
42
42
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
43
43
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
44
44
|
switch (op[0]) {
|
|
@@ -60,7 +60,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63
|
-
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
63
|
+
exports.defaultStorage = exports.LocalStorage = exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
64
64
|
var base_1 = require("./base");
|
|
65
65
|
var url_1 = require("url");
|
|
66
66
|
/**
|
|
@@ -242,3 +242,36 @@ var createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configu
|
|
|
242
242
|
};
|
|
243
243
|
};
|
|
244
244
|
exports.createRequestFunction = createRequestFunction;
|
|
245
|
+
var LocalStorage = /** @class */ (function () {
|
|
246
|
+
function LocalStorage() {
|
|
247
|
+
this.storage = localStorage;
|
|
248
|
+
}
|
|
249
|
+
LocalStorage.prototype.get = function (key, converter) {
|
|
250
|
+
var jsonValue = this.storage.getItem(key);
|
|
251
|
+
if (jsonValue === null) {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
var value = JSON.parse(jsonValue);
|
|
255
|
+
if (converter !== undefined) {
|
|
256
|
+
return converter.fromStorageData(value);
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
return value;
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
LocalStorage.prototype.set = function (key, value, converter) {
|
|
263
|
+
var valueToStore = value;
|
|
264
|
+
if (converter !== undefined) {
|
|
265
|
+
valueToStore = converter.toStorageData(value);
|
|
266
|
+
}
|
|
267
|
+
var jsonValue = JSON.stringify(valueToStore);
|
|
268
|
+
this.storage.setItem(key, jsonValue);
|
|
269
|
+
};
|
|
270
|
+
return LocalStorage;
|
|
271
|
+
}());
|
|
272
|
+
exports.LocalStorage = LocalStorage;
|
|
273
|
+
var _defaultStorage = null;
|
|
274
|
+
var defaultStorage = function () {
|
|
275
|
+
return _defaultStorage || (_defaultStorage = new LocalStorage());
|
|
276
|
+
};
|
|
277
|
+
exports.defaultStorage = defaultStorage;
|
|
@@ -32,4 +32,4 @@ export declare const CreateCustomEstimatedInvoiceRequestDtoProviderEnum: {
|
|
|
32
32
|
readonly Squarelife: "squarelife";
|
|
33
33
|
readonly Janitos: "janitos";
|
|
34
34
|
};
|
|
35
|
-
export
|
|
35
|
+
export type CreateCustomEstimatedInvoiceRequestDtoProviderEnum = typeof CreateCustomEstimatedInvoiceRequestDtoProviderEnum[keyof typeof CreateCustomEstimatedInvoiceRequestDtoProviderEnum];
|
|
@@ -72,4 +72,4 @@ export declare const CreateInvoiceRequestDtoTypeEnum: {
|
|
|
72
72
|
readonly Penalty: "penalty";
|
|
73
73
|
readonly Other: "other";
|
|
74
74
|
};
|
|
75
|
-
export
|
|
75
|
+
export type CreateInvoiceRequestDtoTypeEnum = typeof CreateInvoiceRequestDtoTypeEnum[keyof typeof CreateInvoiceRequestDtoTypeEnum];
|
package/dist/models/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './create-invoice-response-class';
|
|
|
8
8
|
export * from './invoice-class';
|
|
9
9
|
export * from './invoice-item-class';
|
|
10
10
|
export * from './list-invoices-response-class';
|
|
11
|
+
export * from './list-policies-billing-dates-response-class';
|
|
11
12
|
export * from './list-request-dto';
|
|
12
13
|
export * from './policy-dto';
|
|
13
14
|
export * from './policy-object-dto';
|
package/dist/models/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __exportStar(require("./create-invoice-response-class"), exports);
|
|
|
24
24
|
__exportStar(require("./invoice-class"), exports);
|
|
25
25
|
__exportStar(require("./invoice-item-class"), exports);
|
|
26
26
|
__exportStar(require("./list-invoices-response-class"), exports);
|
|
27
|
+
__exportStar(require("./list-policies-billing-dates-response-class"), exports);
|
|
27
28
|
__exportStar(require("./list-request-dto"), exports);
|
|
28
29
|
__exportStar(require("./policy-dto"), exports);
|
|
29
30
|
__exportStar(require("./policy-object-dto"), exports);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EMIL BillingService
|
|
3
|
+
* The EMIL BillingService API description
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface ListPoliciesBillingDatesResponseClass
|
|
16
|
+
*/
|
|
17
|
+
export interface ListPoliciesBillingDatesResponseClass {
|
|
18
|
+
/**
|
|
19
|
+
* Invoices list items
|
|
20
|
+
* @type {Array<string>}
|
|
21
|
+
* @memberof ListPoliciesBillingDatesResponseClass
|
|
22
|
+
*/
|
|
23
|
+
'items': Array<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Next page token
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof ListPoliciesBillingDatesResponseClass
|
|
28
|
+
*/
|
|
29
|
+
'nextPageToken': string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* EMIL BillingService
|
|
6
|
+
* The EMIL BillingService API description
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/models/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './create-invoice-response-class';
|
|
|
8
8
|
export * from './invoice-class';
|
|
9
9
|
export * from './invoice-item-class';
|
|
10
10
|
export * from './list-invoices-response-class';
|
|
11
|
+
export * from './list-policies-billing-dates-response-class';
|
|
11
12
|
export * from './list-request-dto';
|
|
12
13
|
export * from './policy-dto';
|
|
13
14
|
export * from './policy-object-dto';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* EMIL BillingService
|
|
5
|
+
* The EMIL BillingService API description
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface ListPoliciesBillingDatesResponseClass
|
|
21
|
+
*/
|
|
22
|
+
export interface ListPoliciesBillingDatesResponseClass {
|
|
23
|
+
/**
|
|
24
|
+
* Invoices list items
|
|
25
|
+
* @type {Array<string>}
|
|
26
|
+
* @memberof ListPoliciesBillingDatesResponseClass
|
|
27
|
+
*/
|
|
28
|
+
'items': Array<string>;
|
|
29
|
+
/**
|
|
30
|
+
* Next page token
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @memberof ListPoliciesBillingDatesResponseClass
|
|
33
|
+
*/
|
|
34
|
+
'nextPageToken': string;
|
|
35
|
+
}
|
|
36
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emilgroup/billing-sdk-node",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "OpenAPI client for @emilgroup/billing-sdk-node",
|
|
5
5
|
"author": "OpenAPI-Generator Contributors",
|
|
6
6
|
"keywords": [
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
"prepare": "npm run build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"axios": "^0.
|
|
22
|
-
,
|
|
21
|
+
"axios": "^0.27.2",
|
|
23
22
|
"form-data": "^4.0.0",
|
|
24
23
|
"url": "^0.11.0"
|
|
25
24
|
},
|