@emilgroup/accounting-sdk 1.0.1-beta.0 → 1.0.1-beta.1
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 +13 -4
- package/README.md +2 -2
- package/api/booking-processes-api.ts +165 -0
- package/api/financial-accounts-api.ts +16 -10
- package/api/{default-api.ts → health-api.ts} +13 -13
- package/api.ts +4 -4
- package/base.ts +20 -8
- package/dist/api/booking-processes-api.d.ts +97 -0
- package/dist/api/{transactions-api.js → booking-processes-api.js} +43 -43
- package/dist/api/financial-accounts-api.d.ts +16 -13
- package/dist/api/financial-accounts-api.js +4 -4
- package/dist/api/{default-api.d.ts → health-api.d.ts} +10 -10
- package/dist/api/{default-api.js → health-api.js} +22 -22
- package/dist/api.d.ts +2 -2
- package/dist/api.js +2 -2
- package/dist/base.d.ts +4 -1
- package/dist/base.js +31 -21
- package/dist/models/booking-entry-class.d.ts +123 -0
- package/dist/models/booking-entry-class.js +34 -0
- package/dist/models/booking-process-class.d.ts +94 -0
- package/dist/models/booking-process-class.js +29 -0
- package/dist/models/create-booking-entry-request-dto.d.ts +99 -0
- package/dist/models/create-booking-entry-request-dto.js +34 -0
- package/dist/models/create-booking-process-request-dto.d.ts +64 -0
- package/dist/models/create-booking-process-request-dto.js +29 -0
- package/dist/models/{entry-data-dto.d.ts → create-booking-process-response-class.d.ts} +7 -18
- package/dist/models/create-financial-account-request-dto.d.ts +16 -10
- package/dist/models/create-financial-account-request-dto.js +5 -5
- package/dist/models/create-financial-account-response-class.d.ts +25 -0
- package/dist/models/financial-account-class.d.ts +98 -0
- package/dist/models/financial-account-class.js +23 -0
- package/dist/models/financial-transaction-class.d.ts +108 -0
- package/dist/models/financial-transaction-class.js +15 -0
- package/dist/models/financial-transaction-data-dto.d.ts +71 -0
- package/dist/models/financial-transaction-data-dto.js +20 -0
- package/dist/models/get-financial-account-response-class.d.ts +25 -0
- package/dist/models/get-financial-account-response-class.js +15 -0
- package/dist/models/index.d.ts +11 -2
- package/dist/models/index.js +11 -2
- package/dist/models/list-financial-accounts-response-class.d.ts +31 -0
- package/dist/models/list-financial-accounts-response-class.js +15 -0
- package/models/booking-entry-class.ts +133 -0
- package/models/booking-process-class.ts +104 -0
- package/models/create-booking-entry-request-dto.ts +109 -0
- package/models/create-booking-process-request-dto.ts +74 -0
- package/models/{entry-data-dto.ts → create-booking-process-response-class.ts} +7 -18
- package/models/create-financial-account-request-dto.ts +16 -10
- package/models/create-financial-account-response-class.ts +31 -0
- package/models/financial-account-class.ts +107 -0
- package/models/financial-transaction-class.ts +114 -0
- package/models/financial-transaction-data-dto.ts +80 -0
- package/models/get-financial-account-response-class.ts +31 -0
- package/models/index.ts +11 -2
- package/models/list-financial-accounts-response-class.ts +37 -0
- package/package.json +1 -1
- package/api/transactions-api.ts +0 -163
- package/dist/api/transactions-api.d.ts +0 -96
- package/dist/models/create-transaction-request-dto.d.ts +0 -55
- package/models/create-transaction-request-dto.ts +0 -61
- /package/dist/models/{create-transaction-request-dto.js → create-booking-process-response-class.js} +0 -0
- /package/dist/models/{entry-data-dto.js → create-financial-account-response-class.js} +0 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -3,19 +3,28 @@
|
|
|
3
3
|
.openapi-generator-ignore
|
|
4
4
|
README.md
|
|
5
5
|
api.ts
|
|
6
|
-
api/
|
|
6
|
+
api/booking-processes-api.ts
|
|
7
7
|
api/financial-accounts-api.ts
|
|
8
|
-
api/
|
|
8
|
+
api/health-api.ts
|
|
9
9
|
base.ts
|
|
10
10
|
common.ts
|
|
11
11
|
configuration.ts
|
|
12
12
|
git_push.sh
|
|
13
13
|
index.ts
|
|
14
|
+
models/booking-entry-class.ts
|
|
15
|
+
models/booking-process-class.ts
|
|
16
|
+
models/create-booking-entry-request-dto.ts
|
|
17
|
+
models/create-booking-process-request-dto.ts
|
|
18
|
+
models/create-booking-process-response-class.ts
|
|
14
19
|
models/create-financial-account-request-dto.ts
|
|
15
|
-
models/create-
|
|
16
|
-
models/
|
|
20
|
+
models/create-financial-account-response-class.ts
|
|
21
|
+
models/financial-account-class.ts
|
|
22
|
+
models/financial-transaction-class.ts
|
|
23
|
+
models/financial-transaction-data-dto.ts
|
|
24
|
+
models/get-financial-account-response-class.ts
|
|
17
25
|
models/index.ts
|
|
18
26
|
models/inline-response200.ts
|
|
19
27
|
models/inline-response503.ts
|
|
28
|
+
models/list-financial-accounts-response-class.ts
|
|
20
29
|
package.json
|
|
21
30
|
tsconfig.json
|
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
|
|
|
17
17
|
Navigate to the folder of your consuming project and run one of the following commands:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
npm install @emilgroup/accounting-sdk@1.0.1-beta.
|
|
20
|
+
npm install @emilgroup/accounting-sdk@1.0.1-beta.1 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/accounting-sdk@1.0.1-beta.
|
|
24
|
+
yarn add @emilgroup/accounting-sdk@1.0.1-beta.1
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `FinancialAccountsApi`.
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* EMIL AccountingService
|
|
5
|
+
* The EMIL AccountingService API description
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
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
|
+
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
17
|
+
import { Configuration } from '../configuration';
|
|
18
|
+
// Some imports not used depending on template conditions
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
import { CreateBookingProcessRequestDto } from '../models';
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import { CreateBookingProcessResponseClass } from '../models';
|
|
27
|
+
/**
|
|
28
|
+
* BookingProcessesApi - axios parameter creator
|
|
29
|
+
* @export
|
|
30
|
+
*/
|
|
31
|
+
export const BookingProcessesApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
32
|
+
return {
|
|
33
|
+
/**
|
|
34
|
+
* This will create an account in the database. The account will be created with the provided name, type, and account number. Optionally, you can provide a parent account ID to create a sub-account.
|
|
35
|
+
* @summary Create the booking process
|
|
36
|
+
* @param {CreateBookingProcessRequestDto} createBookingProcessRequestDto
|
|
37
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
38
|
+
* @param {*} [options] Override http request option.
|
|
39
|
+
* @throws {RequiredError}
|
|
40
|
+
*/
|
|
41
|
+
createBookingProcess: async (createBookingProcessRequestDto: CreateBookingProcessRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
42
|
+
// verify required parameter 'createBookingProcessRequestDto' is not null or undefined
|
|
43
|
+
assertParamExists('createBookingProcess', 'createBookingProcessRequestDto', createBookingProcessRequestDto)
|
|
44
|
+
const localVarPath = `/accountingservice/v1/booking-processes`;
|
|
45
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
46
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
47
|
+
let baseOptions;
|
|
48
|
+
let baseAccessToken;
|
|
49
|
+
if (configuration) {
|
|
50
|
+
baseOptions = configuration.baseOptions;
|
|
51
|
+
baseAccessToken = configuration.accessToken;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
55
|
+
const localVarHeaderParameter = {} as any;
|
|
56
|
+
const localVarQueryParameter = {} as any;
|
|
57
|
+
|
|
58
|
+
// authentication bearer required
|
|
59
|
+
// http bearer authentication required
|
|
60
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
61
|
+
|
|
62
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
63
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
69
|
+
|
|
70
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
71
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
72
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
73
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createBookingProcessRequestDto, localVarRequestOptions, configuration)
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
url: toPathString(localVarUrlObj),
|
|
77
|
+
options: localVarRequestOptions,
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* BookingProcessesApi - functional programming interface
|
|
85
|
+
* @export
|
|
86
|
+
*/
|
|
87
|
+
export const BookingProcessesApiFp = function(configuration?: Configuration) {
|
|
88
|
+
const localVarAxiosParamCreator = BookingProcessesApiAxiosParamCreator(configuration)
|
|
89
|
+
return {
|
|
90
|
+
/**
|
|
91
|
+
* This will create an account in the database. The account will be created with the provided name, type, and account number. Optionally, you can provide a parent account ID to create a sub-account.
|
|
92
|
+
* @summary Create the booking process
|
|
93
|
+
* @param {CreateBookingProcessRequestDto} createBookingProcessRequestDto
|
|
94
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
95
|
+
* @param {*} [options] Override http request option.
|
|
96
|
+
* @throws {RequiredError}
|
|
97
|
+
*/
|
|
98
|
+
async createBookingProcess(createBookingProcessRequestDto: CreateBookingProcessRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateBookingProcessResponseClass>> {
|
|
99
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createBookingProcess(createBookingProcessRequestDto, authorization, options);
|
|
100
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
101
|
+
},
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* BookingProcessesApi - factory interface
|
|
107
|
+
* @export
|
|
108
|
+
*/
|
|
109
|
+
export const BookingProcessesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
110
|
+
const localVarFp = BookingProcessesApiFp(configuration)
|
|
111
|
+
return {
|
|
112
|
+
/**
|
|
113
|
+
* This will create an account in the database. The account will be created with the provided name, type, and account number. Optionally, you can provide a parent account ID to create a sub-account.
|
|
114
|
+
* @summary Create the booking process
|
|
115
|
+
* @param {CreateBookingProcessRequestDto} createBookingProcessRequestDto
|
|
116
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
117
|
+
* @param {*} [options] Override http request option.
|
|
118
|
+
* @throws {RequiredError}
|
|
119
|
+
*/
|
|
120
|
+
createBookingProcess(createBookingProcessRequestDto: CreateBookingProcessRequestDto, authorization?: string, options?: any): AxiosPromise<CreateBookingProcessResponseClass> {
|
|
121
|
+
return localVarFp.createBookingProcess(createBookingProcessRequestDto, authorization, options).then((request) => request(axios, basePath));
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Request parameters for createBookingProcess operation in BookingProcessesApi.
|
|
128
|
+
* @export
|
|
129
|
+
* @interface BookingProcessesApiCreateBookingProcessRequest
|
|
130
|
+
*/
|
|
131
|
+
export interface BookingProcessesApiCreateBookingProcessRequest {
|
|
132
|
+
/**
|
|
133
|
+
*
|
|
134
|
+
* @type {CreateBookingProcessRequestDto}
|
|
135
|
+
* @memberof BookingProcessesApiCreateBookingProcess
|
|
136
|
+
*/
|
|
137
|
+
readonly createBookingProcessRequestDto: CreateBookingProcessRequestDto
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
141
|
+
* @type {string}
|
|
142
|
+
* @memberof BookingProcessesApiCreateBookingProcess
|
|
143
|
+
*/
|
|
144
|
+
readonly authorization?: string
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* BookingProcessesApi - object-oriented interface
|
|
149
|
+
* @export
|
|
150
|
+
* @class BookingProcessesApi
|
|
151
|
+
* @extends {BaseAPI}
|
|
152
|
+
*/
|
|
153
|
+
export class BookingProcessesApi extends BaseAPI {
|
|
154
|
+
/**
|
|
155
|
+
* This will create an account in the database. The account will be created with the provided name, type, and account number. Optionally, you can provide a parent account ID to create a sub-account.
|
|
156
|
+
* @summary Create the booking process
|
|
157
|
+
* @param {BookingProcessesApiCreateBookingProcessRequest} requestParameters Request parameters.
|
|
158
|
+
* @param {*} [options] Override http request option.
|
|
159
|
+
* @throws {RequiredError}
|
|
160
|
+
* @memberof BookingProcessesApi
|
|
161
|
+
*/
|
|
162
|
+
public createBookingProcess(requestParameters: BookingProcessesApiCreateBookingProcessRequest, options?: AxiosRequestConfig) {
|
|
163
|
+
return BookingProcessesApiFp(this.configuration).createBookingProcess(requestParameters.createBookingProcessRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -22,6 +22,12 @@ 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 { CreateFinancialAccountRequestDto } from '../models';
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import { CreateFinancialAccountResponseClass } from '../models';
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import { GetFinancialAccountResponseClass } from '../models';
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
import { ListFinancialAccountsResponseClass } from '../models';
|
|
25
31
|
/**
|
|
26
32
|
* FinancialAccountsApi - axios parameter creator
|
|
27
33
|
* @export
|
|
@@ -121,7 +127,7 @@ export const FinancialAccountsApiAxiosParamCreator = function (configuration?: C
|
|
|
121
127
|
};
|
|
122
128
|
},
|
|
123
129
|
/**
|
|
124
|
-
* Retrieves the details of the account that was previously created. Supply the unique account code
|
|
130
|
+
* Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information.
|
|
125
131
|
* @summary Retrieve the account
|
|
126
132
|
* @param {string} code Unique identifier for the object.
|
|
127
133
|
* @param {string} expand
|
|
@@ -266,7 +272,7 @@ export const FinancialAccountsApiFp = function(configuration?: Configuration) {
|
|
|
266
272
|
* @param {*} [options] Override http request option.
|
|
267
273
|
* @throws {RequiredError}
|
|
268
274
|
*/
|
|
269
|
-
async createFinancialAccount(createFinancialAccountRequestDto: CreateFinancialAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<
|
|
275
|
+
async createFinancialAccount(createFinancialAccountRequestDto: CreateFinancialAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateFinancialAccountResponseClass>> {
|
|
270
276
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createFinancialAccount(createFinancialAccountRequestDto, authorization, options);
|
|
271
277
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
272
278
|
},
|
|
@@ -283,7 +289,7 @@ export const FinancialAccountsApiFp = function(configuration?: Configuration) {
|
|
|
283
289
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
284
290
|
},
|
|
285
291
|
/**
|
|
286
|
-
* Retrieves the details of the account that was previously created. Supply the unique account code
|
|
292
|
+
* Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information.
|
|
287
293
|
* @summary Retrieve the account
|
|
288
294
|
* @param {string} code Unique identifier for the object.
|
|
289
295
|
* @param {string} expand
|
|
@@ -291,7 +297,7 @@ export const FinancialAccountsApiFp = function(configuration?: Configuration) {
|
|
|
291
297
|
* @param {*} [options] Override http request option.
|
|
292
298
|
* @throws {RequiredError}
|
|
293
299
|
*/
|
|
294
|
-
async getFinancialAccount(code: string, expand: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<
|
|
300
|
+
async getFinancialAccount(code: string, expand: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetFinancialAccountResponseClass>> {
|
|
295
301
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getFinancialAccount(code, expand, authorization, options);
|
|
296
302
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
297
303
|
},
|
|
@@ -309,7 +315,7 @@ export const FinancialAccountsApiFp = function(configuration?: Configuration) {
|
|
|
309
315
|
* @param {*} [options] Override http request option.
|
|
310
316
|
* @throws {RequiredError}
|
|
311
317
|
*/
|
|
312
|
-
async listFinancialAccounts(authorization?: string, pageSize?: any, pageToken?: any, filter?: string, search?: any, order?: string, expand?: any, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<
|
|
318
|
+
async listFinancialAccounts(authorization?: string, pageSize?: any, pageToken?: any, filter?: string, search?: any, order?: string, expand?: any, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListFinancialAccountsResponseClass>> {
|
|
313
319
|
const localVarAxiosArgs = await localVarAxiosParamCreator.listFinancialAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options);
|
|
314
320
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
315
321
|
},
|
|
@@ -331,7 +337,7 @@ export const FinancialAccountsApiFactory = function (configuration?: Configurati
|
|
|
331
337
|
* @param {*} [options] Override http request option.
|
|
332
338
|
* @throws {RequiredError}
|
|
333
339
|
*/
|
|
334
|
-
createFinancialAccount(createFinancialAccountRequestDto: CreateFinancialAccountRequestDto, authorization?: string, options?: any): AxiosPromise<
|
|
340
|
+
createFinancialAccount(createFinancialAccountRequestDto: CreateFinancialAccountRequestDto, authorization?: string, options?: any): AxiosPromise<CreateFinancialAccountResponseClass> {
|
|
335
341
|
return localVarFp.createFinancialAccount(createFinancialAccountRequestDto, authorization, options).then((request) => request(axios, basePath));
|
|
336
342
|
},
|
|
337
343
|
/**
|
|
@@ -346,7 +352,7 @@ export const FinancialAccountsApiFactory = function (configuration?: Configurati
|
|
|
346
352
|
return localVarFp.deleteFinancialAccount(code, authorization, options).then((request) => request(axios, basePath));
|
|
347
353
|
},
|
|
348
354
|
/**
|
|
349
|
-
* Retrieves the details of the account that was previously created. Supply the unique account code
|
|
355
|
+
* Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information.
|
|
350
356
|
* @summary Retrieve the account
|
|
351
357
|
* @param {string} code Unique identifier for the object.
|
|
352
358
|
* @param {string} expand
|
|
@@ -354,7 +360,7 @@ export const FinancialAccountsApiFactory = function (configuration?: Configurati
|
|
|
354
360
|
* @param {*} [options] Override http request option.
|
|
355
361
|
* @throws {RequiredError}
|
|
356
362
|
*/
|
|
357
|
-
getFinancialAccount(code: string, expand: string, authorization?: string, options?: any): AxiosPromise<
|
|
363
|
+
getFinancialAccount(code: string, expand: string, authorization?: string, options?: any): AxiosPromise<GetFinancialAccountResponseClass> {
|
|
358
364
|
return localVarFp.getFinancialAccount(code, expand, authorization, options).then((request) => request(axios, basePath));
|
|
359
365
|
},
|
|
360
366
|
/**
|
|
@@ -371,7 +377,7 @@ export const FinancialAccountsApiFactory = function (configuration?: Configurati
|
|
|
371
377
|
* @param {*} [options] Override http request option.
|
|
372
378
|
* @throws {RequiredError}
|
|
373
379
|
*/
|
|
374
|
-
listFinancialAccounts(authorization?: string, pageSize?: any, pageToken?: any, filter?: string, search?: any, order?: string, expand?: any, filters?: string, options?: any): AxiosPromise<
|
|
380
|
+
listFinancialAccounts(authorization?: string, pageSize?: any, pageToken?: any, filter?: string, search?: any, order?: string, expand?: any, filters?: string, options?: any): AxiosPromise<ListFinancialAccountsResponseClass> {
|
|
375
381
|
return localVarFp.listFinancialAccounts(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then((request) => request(axios, basePath));
|
|
376
382
|
},
|
|
377
383
|
};
|
|
@@ -542,7 +548,7 @@ export class FinancialAccountsApi extends BaseAPI {
|
|
|
542
548
|
}
|
|
543
549
|
|
|
544
550
|
/**
|
|
545
|
-
* Retrieves the details of the account that was previously created. Supply the unique account code
|
|
551
|
+
* Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information.
|
|
546
552
|
* @summary Retrieve the account
|
|
547
553
|
* @param {FinancialAccountsApiGetFinancialAccountRequest} requestParameters Request parameters.
|
|
548
554
|
* @param {*} [options] Override http request option.
|
|
@@ -25,10 +25,10 @@ import { InlineResponse200 } from '../models';
|
|
|
25
25
|
// @ts-ignore
|
|
26
26
|
import { InlineResponse503 } from '../models';
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* HealthApi - axios parameter creator
|
|
29
29
|
* @export
|
|
30
30
|
*/
|
|
31
|
-
export const
|
|
31
|
+
export const HealthApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
32
32
|
return {
|
|
33
33
|
/**
|
|
34
34
|
* Returns the health status of the accounting service. This endpoint is used to monitor the operational status of the accounting service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
|
|
@@ -66,11 +66,11 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* HealthApi - functional programming interface
|
|
70
70
|
* @export
|
|
71
71
|
*/
|
|
72
|
-
export const
|
|
73
|
-
const localVarAxiosParamCreator =
|
|
72
|
+
export const HealthApiFp = function(configuration?: Configuration) {
|
|
73
|
+
const localVarAxiosParamCreator = HealthApiAxiosParamCreator(configuration)
|
|
74
74
|
return {
|
|
75
75
|
/**
|
|
76
76
|
* Returns the health status of the accounting service. This endpoint is used to monitor the operational status of the accounting service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
|
|
@@ -86,11 +86,11 @@ export const DefaultApiFp = function(configuration?: Configuration) {
|
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
89
|
+
* HealthApi - factory interface
|
|
90
90
|
* @export
|
|
91
91
|
*/
|
|
92
|
-
export const
|
|
93
|
-
const localVarFp =
|
|
92
|
+
export const HealthApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
93
|
+
const localVarFp = HealthApiFp(configuration)
|
|
94
94
|
return {
|
|
95
95
|
/**
|
|
96
96
|
* Returns the health status of the accounting service. This endpoint is used to monitor the operational status of the accounting service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
|
|
@@ -105,20 +105,20 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa
|
|
|
105
105
|
};
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
|
-
*
|
|
108
|
+
* HealthApi - object-oriented interface
|
|
109
109
|
* @export
|
|
110
|
-
* @class
|
|
110
|
+
* @class HealthApi
|
|
111
111
|
* @extends {BaseAPI}
|
|
112
112
|
*/
|
|
113
|
-
export class
|
|
113
|
+
export class HealthApi extends BaseAPI {
|
|
114
114
|
/**
|
|
115
115
|
* Returns the health status of the accounting service. This endpoint is used to monitor the operational status of the accounting service. It typically returns a simple status indicator, such as \'UP\' or \'OK\', confirming that the service is operational and available.
|
|
116
116
|
* @summary Health Check
|
|
117
117
|
* @param {*} [options] Override http request option.
|
|
118
118
|
* @throws {RequiredError}
|
|
119
|
-
* @memberof
|
|
119
|
+
* @memberof HealthApi
|
|
120
120
|
*/
|
|
121
121
|
public check(options?: AxiosRequestConfig) {
|
|
122
|
-
return
|
|
122
|
+
return HealthApiFp(this.configuration).check(options).then((request) => request(this.axios, this.basePath));
|
|
123
123
|
}
|
|
124
124
|
}
|
package/api.ts
CHANGED
|
@@ -20,12 +20,12 @@ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig, AxiosResp
|
|
|
20
20
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
|
|
21
21
|
// @ts-ignore
|
|
22
22
|
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
|
|
23
|
-
import {
|
|
23
|
+
import { BookingProcessesApi } from './api';
|
|
24
24
|
import { FinancialAccountsApi } from './api';
|
|
25
|
-
import {
|
|
25
|
+
import { HealthApi } from './api';
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
export * from './api/
|
|
28
|
+
export * from './api/booking-processes-api';
|
|
29
29
|
export * from './api/financial-accounts-api';
|
|
30
|
-
export * from './api/
|
|
30
|
+
export * from './api/health-api';
|
|
31
31
|
|
package/base.ts
CHANGED
|
@@ -77,6 +77,7 @@ const TOKEN_DATA = 'APP_TOKEN';
|
|
|
77
77
|
export class BaseAPI {
|
|
78
78
|
protected configuration: Configuration | undefined;
|
|
79
79
|
private tokenData?: TokenData;
|
|
80
|
+
private permissions: Array<string> = [];
|
|
80
81
|
|
|
81
82
|
constructor(configuration?: Configuration,
|
|
82
83
|
protected basePath: string = BASE_PATH,
|
|
@@ -102,7 +103,15 @@ export class BaseAPI {
|
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
selectEnvironment(env: Environment) {
|
|
105
|
-
this.
|
|
106
|
+
this.selectBasePath(env);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
selectBasePath(path: string) {
|
|
110
|
+
this.configuration.basePath = path;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
getPermissions(): Array<string> {
|
|
114
|
+
return this.permissions;
|
|
106
115
|
}
|
|
107
116
|
|
|
108
117
|
async authorize(username: string, password: string): Promise<void> {
|
|
@@ -119,23 +128,24 @@ export class BaseAPI {
|
|
|
119
128
|
|
|
120
129
|
const response = await globalAxios.request<LoginClass>(options);
|
|
121
130
|
|
|
122
|
-
const { data: { accessToken } } = response;
|
|
131
|
+
const { data: { accessToken, permissions } } = response;
|
|
123
132
|
|
|
124
133
|
this.configuration.username = username;
|
|
125
134
|
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
126
135
|
this.tokenData.username = username;
|
|
127
136
|
this.tokenData.accessToken = accessToken;
|
|
137
|
+
this.permissions = permissions;
|
|
128
138
|
|
|
129
139
|
this.storeTokenData({
|
|
130
140
|
...this.tokenData
|
|
131
141
|
});
|
|
132
142
|
}
|
|
133
143
|
|
|
134
|
-
async refreshTokenInternal(): Promise<
|
|
144
|
+
async refreshTokenInternal(): Promise<LoginClass> {
|
|
135
145
|
const { username } = this.configuration;
|
|
136
146
|
|
|
137
147
|
if (!username) {
|
|
138
|
-
|
|
148
|
+
throw new Error('Failed to refresh token.');
|
|
139
149
|
}
|
|
140
150
|
|
|
141
151
|
const options: AxiosRequestConfig = {
|
|
@@ -148,9 +158,9 @@ export class BaseAPI {
|
|
|
148
158
|
withCredentials: true,
|
|
149
159
|
};
|
|
150
160
|
|
|
151
|
-
const
|
|
161
|
+
const response = await globalAxios.request<LoginClass>(options);
|
|
152
162
|
|
|
153
|
-
return
|
|
163
|
+
return response.data;
|
|
154
164
|
}
|
|
155
165
|
|
|
156
166
|
private storeTokenData(tokenData?: TokenData) {
|
|
@@ -184,8 +194,9 @@ export class BaseAPI {
|
|
|
184
194
|
&& !originalConfig._retry) {
|
|
185
195
|
originalConfig._retry = true;
|
|
186
196
|
try {
|
|
187
|
-
|
|
197
|
+
const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
|
|
188
198
|
const accessToken = `Bearer ${tokenString}`;
|
|
199
|
+
this.permissions = permissions;
|
|
189
200
|
|
|
190
201
|
delete originalConfig.headers['Authorization']
|
|
191
202
|
|
|
@@ -210,8 +221,9 @@ export class BaseAPI {
|
|
|
210
221
|
) {
|
|
211
222
|
_retry_count++;
|
|
212
223
|
try {
|
|
213
|
-
|
|
224
|
+
const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
|
|
214
225
|
const accessToken = `Bearer ${tokenString}`;
|
|
226
|
+
this.permissions = permissions;
|
|
215
227
|
|
|
216
228
|
_retry = true;
|
|
217
229
|
originalConfig.headers['Authorization'] = accessToken;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EMIL AccountingService
|
|
3
|
+
* The EMIL AccountingService API description
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
* Contact: kontakt@emil.de
|
|
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
|
+
import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
13
|
+
import { Configuration } from '../configuration';
|
|
14
|
+
import { RequestArgs, BaseAPI } from '../base';
|
|
15
|
+
import { CreateBookingProcessRequestDto } from '../models';
|
|
16
|
+
import { CreateBookingProcessResponseClass } from '../models';
|
|
17
|
+
/**
|
|
18
|
+
* BookingProcessesApi - axios parameter creator
|
|
19
|
+
* @export
|
|
20
|
+
*/
|
|
21
|
+
export declare const BookingProcessesApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
22
|
+
/**
|
|
23
|
+
* This will create an account in the database. The account will be created with the provided name, type, and account number. Optionally, you can provide a parent account ID to create a sub-account.
|
|
24
|
+
* @summary Create the booking process
|
|
25
|
+
* @param {CreateBookingProcessRequestDto} createBookingProcessRequestDto
|
|
26
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
27
|
+
* @param {*} [options] Override http request option.
|
|
28
|
+
* @throws {RequiredError}
|
|
29
|
+
*/
|
|
30
|
+
createBookingProcess: (createBookingProcessRequestDto: CreateBookingProcessRequestDto, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* BookingProcessesApi - functional programming interface
|
|
34
|
+
* @export
|
|
35
|
+
*/
|
|
36
|
+
export declare const BookingProcessesApiFp: (configuration?: Configuration) => {
|
|
37
|
+
/**
|
|
38
|
+
* This will create an account in the database. The account will be created with the provided name, type, and account number. Optionally, you can provide a parent account ID to create a sub-account.
|
|
39
|
+
* @summary Create the booking process
|
|
40
|
+
* @param {CreateBookingProcessRequestDto} createBookingProcessRequestDto
|
|
41
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
42
|
+
* @param {*} [options] Override http request option.
|
|
43
|
+
* @throws {RequiredError}
|
|
44
|
+
*/
|
|
45
|
+
createBookingProcess(createBookingProcessRequestDto: CreateBookingProcessRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateBookingProcessResponseClass>>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* BookingProcessesApi - factory interface
|
|
49
|
+
* @export
|
|
50
|
+
*/
|
|
51
|
+
export declare const BookingProcessesApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
52
|
+
/**
|
|
53
|
+
* This will create an account in the database. The account will be created with the provided name, type, and account number. Optionally, you can provide a parent account ID to create a sub-account.
|
|
54
|
+
* @summary Create the booking process
|
|
55
|
+
* @param {CreateBookingProcessRequestDto} createBookingProcessRequestDto
|
|
56
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
57
|
+
* @param {*} [options] Override http request option.
|
|
58
|
+
* @throws {RequiredError}
|
|
59
|
+
*/
|
|
60
|
+
createBookingProcess(createBookingProcessRequestDto: CreateBookingProcessRequestDto, authorization?: string, options?: any): AxiosPromise<CreateBookingProcessResponseClass>;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Request parameters for createBookingProcess operation in BookingProcessesApi.
|
|
64
|
+
* @export
|
|
65
|
+
* @interface BookingProcessesApiCreateBookingProcessRequest
|
|
66
|
+
*/
|
|
67
|
+
export interface BookingProcessesApiCreateBookingProcessRequest {
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @type {CreateBookingProcessRequestDto}
|
|
71
|
+
* @memberof BookingProcessesApiCreateBookingProcess
|
|
72
|
+
*/
|
|
73
|
+
readonly createBookingProcessRequestDto: CreateBookingProcessRequestDto;
|
|
74
|
+
/**
|
|
75
|
+
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
76
|
+
* @type {string}
|
|
77
|
+
* @memberof BookingProcessesApiCreateBookingProcess
|
|
78
|
+
*/
|
|
79
|
+
readonly authorization?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* BookingProcessesApi - object-oriented interface
|
|
83
|
+
* @export
|
|
84
|
+
* @class BookingProcessesApi
|
|
85
|
+
* @extends {BaseAPI}
|
|
86
|
+
*/
|
|
87
|
+
export declare class BookingProcessesApi extends BaseAPI {
|
|
88
|
+
/**
|
|
89
|
+
* This will create an account in the database. The account will be created with the provided name, type, and account number. Optionally, you can provide a parent account ID to create a sub-account.
|
|
90
|
+
* @summary Create the booking process
|
|
91
|
+
* @param {BookingProcessesApiCreateBookingProcessRequest} requestParameters Request parameters.
|
|
92
|
+
* @param {*} [options] Override http request option.
|
|
93
|
+
* @throws {RequiredError}
|
|
94
|
+
* @memberof BookingProcessesApi
|
|
95
|
+
*/
|
|
96
|
+
createBookingProcess(requestParameters: BookingProcessesApiCreateBookingProcessRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateBookingProcessResponseClass, any>>;
|
|
97
|
+
}
|