@emilgroup/accounting-sdk 1.34.1-beta.77 → 1.34.1-beta.78
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 +0 -50
- package/README.md +2 -2
- package/api/booking-entries-api.ts +10 -234
- package/api/financial-accounts-api.ts +24 -154
- package/api/financial-transactions-api.ts +4 -8
- package/api/number-ranges-api.ts +8 -16
- package/api/personal-accounts-api.ts +8 -16
- package/api.ts +0 -6
- package/base.ts +41 -174
- package/common.ts +2 -3
- package/configuration.ts +0 -20
- package/dist/api/booking-entries-api.d.ts +7 -121
- package/dist/api/booking-entries-api.js +14 -211
- package/dist/api/financial-accounts-api.d.ts +20 -86
- package/dist/api/financial-accounts-api.js +27 -137
- package/dist/api/financial-transactions-api.d.ts +2 -2
- package/dist/api/financial-transactions-api.js +6 -8
- package/dist/api/health-api.d.ts +1 -1
- package/dist/api/number-ranges-api.d.ts +4 -4
- package/dist/api/number-ranges-api.js +14 -22
- package/dist/api/personal-accounts-api.d.ts +4 -4
- package/dist/api/personal-accounts-api.js +14 -22
- package/dist/api.d.ts +0 -3
- package/dist/api.js +0 -3
- package/dist/base.d.ts +0 -24
- package/dist/base.js +59 -178
- package/dist/common.d.ts +1 -1
- package/dist/common.js +0 -1
- package/dist/configuration.d.ts +0 -17
- package/dist/configuration.js +0 -2
- package/dist/models/booking-entry-class.d.ts +0 -34
- package/dist/models/booking-entry-class.js +1 -10
- package/dist/models/create-booking-entry-request-dto.d.ts +2 -25
- package/dist/models/create-booking-entry-request-dto.js +0 -9
- package/dist/models/create-financial-account-request-dto.d.ts +5 -50
- package/dist/models/create-financial-account-request-dto.js +2 -26
- package/dist/models/create-number-range-request-dto.d.ts +4 -4
- package/dist/models/create-number-range-request-dto.js +4 -4
- package/dist/models/create-personal-account-request-dto.d.ts +6 -14
- package/dist/models/create-personal-account-request-dto.js +3 -3
- package/dist/models/financial-account-class.d.ts +2 -49
- package/dist/models/financial-account-class.js +2 -6
- package/dist/models/financial-transaction-class.d.ts +0 -6
- package/dist/models/financial-transaction-data-dto.d.ts +2 -11
- package/dist/models/financial-transaction-data-dto.js +0 -1
- package/dist/models/index.d.ts +0 -47
- package/dist/models/index.js +0 -47
- package/dist/models/personal-account-class.d.ts +2 -8
- package/dist/models/personal-account-class.js +1 -1
- package/models/booking-entry-class.ts +0 -35
- package/models/create-booking-entry-request-dto.ts +2 -26
- package/models/create-financial-account-request-dto.ts +5 -49
- package/models/create-number-range-request-dto.ts +4 -4
- package/models/create-personal-account-request-dto.ts +6 -12
- package/models/financial-account-class.ts +2 -50
- package/models/financial-transaction-class.ts +0 -6
- package/models/financial-transaction-data-dto.ts +2 -9
- package/models/index.ts +0 -47
- package/models/personal-account-class.ts +2 -8
- package/package.json +2 -2
- package/api/accounting-configs-api.ts +0 -862
- package/api/commission-account-mappings-api.ts +0 -1207
- package/api/product-account-mappings-api.ts +0 -1715
- package/dist/api/accounting-configs-api.d.ts +0 -451
- package/dist/api/accounting-configs-api.js +0 -881
- package/dist/api/commission-account-mappings-api.d.ts +0 -685
- package/dist/api/commission-account-mappings-api.js +0 -1022
- package/dist/api/product-account-mappings-api.d.ts +0 -972
- package/dist/api/product-account-mappings-api.js +0 -1447
- package/dist/models/account-mapping-class.d.ts +0 -73
- package/dist/models/account-mapping-class.js +0 -40
- package/dist/models/accounting-category-class.d.ts +0 -45
- package/dist/models/accounting-category-class.js +0 -24
- package/dist/models/accounting-config-class.d.ts +0 -78
- package/dist/models/accounting-config-class.js +0 -20
- package/dist/models/accounting-config-data-class.d.ts +0 -38
- package/dist/models/accounting-config-data-class.js +0 -15
- package/dist/models/accounting-config-data-dto-accounting-configuration.d.ts +0 -46
- package/dist/models/accounting-config-data-dto-accounting-configuration.js +0 -24
- package/dist/models/accounting-config-data-dto-default-account-mappings.d.ts +0 -79
- package/dist/models/accounting-config-data-dto-default-account-mappings.js +0 -40
- package/dist/models/accounting-config-data-dto.d.ts +0 -38
- package/dist/models/accounting-config-data-dto.js +0 -15
- package/dist/models/accounting-configuration-class.d.ts +0 -36
- package/dist/models/accounting-configuration-class.js +0 -15
- package/dist/models/commission-account-mapping-class.d.ts +0 -49
- package/dist/models/commission-account-mapping-class.js +0 -15
- package/dist/models/commission-agreement-account-mapping-detail-class.d.ts +0 -44
- package/dist/models/commission-agreement-account-mapping-detail-class.js +0 -15
- package/dist/models/commission-agreement-partner-class.d.ts +0 -30
- package/dist/models/commission-agreement-partner-class.js +0 -15
- package/dist/models/commission-agreement-with-account-mapping-class.d.ts +0 -43
- package/dist/models/commission-agreement-with-account-mapping-class.js +0 -15
- package/dist/models/commission-type-account-mapping-class.d.ts +0 -31
- package/dist/models/commission-type-account-mapping-class.js +0 -15
- package/dist/models/create-and-enable-subledger-request-dto.d.ts +0 -25
- package/dist/models/create-and-enable-subledger-request-dto.js +0 -15
- package/dist/models/create-and-enable-subledger-response-class.d.ts +0 -25
- package/dist/models/create-and-enable-subledger-response-class.js +0 -15
- package/dist/models/create-or-correct-opening-balance-dto.d.ts +0 -25
- package/dist/models/create-or-correct-opening-balance-dto.js +0 -15
- package/dist/models/create-or-correct-opening-balance-response-class.d.ts +0 -25
- package/dist/models/create-or-correct-opening-balance-response-class.js +0 -15
- package/dist/models/export-accounting-config-response-class.d.ts +0 -25
- package/dist/models/export-accounting-config-response-class.js +0 -15
- package/dist/models/get-accounting-categories-response-class.d.ts +0 -25
- package/dist/models/get-accounting-categories-response-class.js +0 -15
- package/dist/models/get-activation-snapshot-response-class.d.ts +0 -25
- package/dist/models/get-activation-snapshot-response-class.js +0 -15
- package/dist/models/list-commission-account-mappings-response-class.d.ts +0 -43
- package/dist/models/list-commission-account-mappings-response-class.js +0 -15
- package/dist/models/list-commission-agreements-with-account-mappings-response-class.d.ts +0 -43
- package/dist/models/list-commission-agreements-with-account-mappings-response-class.js +0 -15
- package/dist/models/list-commission-type-account-mappings-response-class.d.ts +0 -43
- package/dist/models/list-commission-type-account-mappings-response-class.js +0 -15
- package/dist/models/list-product-account-mappings-response-class.d.ts +0 -43
- package/dist/models/list-product-account-mappings-response-class.js +0 -15
- package/dist/models/list-products-with-account-mappings-response-class.d.ts +0 -43
- package/dist/models/list-products-with-account-mappings-response-class.js +0 -15
- package/dist/models/opening-balance-item-dto.d.ts +0 -41
- package/dist/models/opening-balance-item-dto.js +0 -20
- package/dist/models/post-financial-event-request-dto.d.ts +0 -45
- package/dist/models/post-financial-event-request-dto.js +0 -24
- package/dist/models/post-financial-event-response-class.d.ts +0 -25
- package/dist/models/post-financial-event-response-class.js +0 -15
- package/dist/models/premium-item-account-mapping-class.d.ts +0 -37
- package/dist/models/premium-item-account-mapping-class.js +0 -15
- package/dist/models/product-account-mapping-class.d.ts +0 -61
- package/dist/models/product-account-mapping-class.js +0 -15
- package/dist/models/product-account-mapping-detail-class.d.ts +0 -56
- package/dist/models/product-account-mapping-detail-class.js +0 -15
- package/dist/models/product-risk-carrier-class.d.ts +0 -42
- package/dist/models/product-risk-carrier-class.js +0 -15
- package/dist/models/product-version-account-mapping-detail-class.d.ts +0 -50
- package/dist/models/product-version-account-mapping-detail-class.js +0 -15
- package/dist/models/product-version-with-account-mappings-class.d.ts +0 -42
- package/dist/models/product-version-with-account-mappings-class.js +0 -15
- package/dist/models/product-with-account-mappings-class.d.ts +0 -49
- package/dist/models/product-with-account-mappings-class.js +0 -15
- package/dist/models/put-premium-item-account-body-dto.d.ts +0 -24
- package/dist/models/put-premium-item-account-body-dto.js +0 -15
- package/dist/models/put-product-category-account-body-dto.d.ts +0 -24
- package/dist/models/put-product-category-account-body-dto.js +0 -15
- package/dist/models/put-product-risk-carrier-body-dto.d.ts +0 -24
- package/dist/models/put-product-risk-carrier-body-dto.js +0 -15
- package/dist/models/put-product-version-category-account-body-dto.d.ts +0 -24
- package/dist/models/put-product-version-category-account-body-dto.js +0 -15
- package/dist/models/resolved-account-mapping-class.d.ts +0 -31
- package/dist/models/resolved-account-mapping-class.js +0 -15
- package/dist/models/resolved-commission-account-mapping-class.d.ts +0 -37
- package/dist/models/resolved-commission-account-mapping-class.js +0 -21
- package/dist/models/update-commission-agreement-account-body-dto.d.ts +0 -24
- package/dist/models/update-commission-agreement-account-body-dto.js +0 -15
- package/dist/models/update-commission-type-account-body-dto.d.ts +0 -24
- package/dist/models/update-commission-type-account-body-dto.js +0 -15
- package/dist/models/update-financial-account-body-dto.d.ts +0 -48
- package/dist/models/update-financial-account-body-dto.js +0 -15
- package/dist/models/update-financial-account-response-class.d.ts +0 -25
- package/dist/models/update-financial-account-response-class.js +0 -15
- package/dist/models/validate-accounting-config-request-dto.d.ts +0 -25
- package/dist/models/validate-accounting-config-request-dto.js +0 -15
- package/dist/models/validate-accounting-config-response-class.d.ts +0 -30
- package/dist/models/validate-accounting-config-response-class.js +0 -15
- package/models/account-mapping-class.ts +0 -82
- package/models/accounting-category-class.ts +0 -54
- package/models/accounting-config-class.ts +0 -87
- package/models/accounting-config-data-class.ts +0 -44
- package/models/accounting-config-data-dto-accounting-configuration.ts +0 -56
- package/models/accounting-config-data-dto-default-account-mappings.ts +0 -88
- package/models/accounting-config-data-dto.ts +0 -44
- package/models/accounting-configuration-class.ts +0 -42
- package/models/commission-account-mapping-class.ts +0 -55
- package/models/commission-agreement-account-mapping-detail-class.ts +0 -50
- package/models/commission-agreement-partner-class.ts +0 -36
- package/models/commission-agreement-with-account-mapping-class.ts +0 -49
- package/models/commission-type-account-mapping-class.ts +0 -37
- package/models/create-and-enable-subledger-request-dto.ts +0 -31
- package/models/create-and-enable-subledger-response-class.ts +0 -31
- package/models/create-or-correct-opening-balance-dto.ts +0 -31
- package/models/create-or-correct-opening-balance-response-class.ts +0 -31
- package/models/export-accounting-config-response-class.ts +0 -31
- package/models/get-accounting-categories-response-class.ts +0 -31
- package/models/get-activation-snapshot-response-class.ts +0 -31
- package/models/list-commission-account-mappings-response-class.ts +0 -49
- package/models/list-commission-agreements-with-account-mappings-response-class.ts +0 -49
- package/models/list-commission-type-account-mappings-response-class.ts +0 -49
- package/models/list-product-account-mappings-response-class.ts +0 -49
- package/models/list-products-with-account-mappings-response-class.ts +0 -49
- package/models/opening-balance-item-dto.ts +0 -50
- package/models/post-financial-event-request-dto.ts +0 -54
- package/models/post-financial-event-response-class.ts +0 -31
- package/models/premium-item-account-mapping-class.ts +0 -43
- package/models/product-account-mapping-class.ts +0 -67
- package/models/product-account-mapping-detail-class.ts +0 -62
- package/models/product-risk-carrier-class.ts +0 -48
- package/models/product-version-account-mapping-detail-class.ts +0 -56
- package/models/product-version-with-account-mappings-class.ts +0 -48
- package/models/product-with-account-mappings-class.ts +0 -55
- package/models/put-premium-item-account-body-dto.ts +0 -30
- package/models/put-product-category-account-body-dto.ts +0 -30
- package/models/put-product-risk-carrier-body-dto.ts +0 -30
- package/models/put-product-version-category-account-body-dto.ts +0 -30
- package/models/resolved-account-mapping-class.ts +0 -37
- package/models/resolved-commission-account-mapping-class.ts +0 -46
- package/models/update-commission-agreement-account-body-dto.ts +0 -30
- package/models/update-commission-type-account-body-dto.ts +0 -30
- package/models/update-financial-account-body-dto.ts +0 -54
- package/models/update-financial-account-response-class.ts +0 -31
- package/models/validate-accounting-config-request-dto.ts +0 -31
- package/models/validate-accounting-config-response-class.ts +0 -36
package/base.ts
CHANGED
|
@@ -32,20 +32,9 @@ export const COLLECTION_FORMATS = {
|
|
|
32
32
|
pipes: "|",
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
export interface SessionClass {
|
|
36
|
-
sub: string;
|
|
37
|
-
username?: string;
|
|
38
|
-
email?: string;
|
|
39
|
-
tenantSlug?: string;
|
|
40
|
-
permissions?: string;
|
|
41
|
-
expiresAt?: number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
35
|
export interface LoginClass {
|
|
45
36
|
accessToken: string;
|
|
46
37
|
permissions: string;
|
|
47
|
-
authMode?: string;
|
|
48
|
-
session?: SessionClass;
|
|
49
38
|
}
|
|
50
39
|
|
|
51
40
|
export interface SwitchWorkspaceRequest {
|
|
@@ -56,8 +45,6 @@ export interface SwitchWorkspaceRequest {
|
|
|
56
45
|
export interface SwitchWorkspaceResponseClass {
|
|
57
46
|
accessToken: string;
|
|
58
47
|
permissions: string;
|
|
59
|
-
authMode?: string;
|
|
60
|
-
session?: SessionClass;
|
|
61
48
|
}
|
|
62
49
|
|
|
63
50
|
export enum Environment {
|
|
@@ -90,19 +77,10 @@ interface TokenData {
|
|
|
90
77
|
accessToken?: string;
|
|
91
78
|
username?: string;
|
|
92
79
|
permissions?: string;
|
|
93
|
-
// 'both' or 'session' when authservice keeps the tokens in a server session.
|
|
94
|
-
authMode?: string;
|
|
95
|
-
sub?: string;
|
|
96
80
|
}
|
|
97
81
|
|
|
98
82
|
const NETWORK_ERROR_MESSAGE = "Network Error";
|
|
99
83
|
const TOKEN_DATA = 'APP_TOKEN';
|
|
100
|
-
// Sent only to authservice, to ask for a server session.
|
|
101
|
-
const AUTH_MODE_HEADER = 'X-Emil-Auth-Mode';
|
|
102
|
-
// Names the account on every call; one browser session can hold several.
|
|
103
|
-
const ACCOUNT_HEADER = 'X-Emil-Account';
|
|
104
|
-
const SESSION_MODES = ['both', 'session'];
|
|
105
|
-
const RESEND_SAFE_METHODS = ['get', 'head', 'options'];
|
|
106
84
|
|
|
107
85
|
/**
|
|
108
86
|
*
|
|
@@ -124,18 +102,10 @@ export class BaseAPI {
|
|
|
124
102
|
this.configuration = configuration;
|
|
125
103
|
this.basePath = configuration.basePath || this.basePath;
|
|
126
104
|
|
|
127
|
-
if
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (this.usesSession()) {
|
|
132
|
-
this.useSessionAuth();
|
|
133
|
-
} else {
|
|
134
|
-
// Use config token if provided, otherwise use tokenData token
|
|
135
|
-
const configToken = this.configuration.accessToken;
|
|
136
|
-
const storedToken = accessToken ? `Bearer ${accessToken}` : '';
|
|
137
|
-
this.configuration.accessToken = configToken || storedToken;
|
|
138
|
-
}
|
|
105
|
+
// Use config token if provided, otherwise use tokenData token
|
|
106
|
+
const configToken = this.configuration.accessToken;
|
|
107
|
+
const storedToken = accessToken ? `Bearer ${accessToken}` : '';
|
|
108
|
+
this.configuration.accessToken = configToken || storedToken;
|
|
139
109
|
} else {
|
|
140
110
|
const { accessToken, username } = this.tokenData;
|
|
141
111
|
|
|
@@ -149,107 +119,6 @@ export class BaseAPI {
|
|
|
149
119
|
this.attachInterceptor(axios);
|
|
150
120
|
}
|
|
151
121
|
|
|
152
|
-
// The app's own account wins over APP_TOKEN, which holds whichever tab wrote last.
|
|
153
|
-
private sessionAccount(): string | undefined {
|
|
154
|
-
return this.configuration.account || this.tokenData.sub;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Apps may pass the address as the second argument only; authservice is on the same host.
|
|
158
|
-
private authBasePath(): string {
|
|
159
|
-
return this.configuration.basePath || this.basePath;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
private usesSession(): boolean {
|
|
163
|
-
return !!this.configuration.cookieAuth && SESSION_MODES.indexOf(this.tokenData.authMode) !== -1 && !!this.sessionAccount();
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
private useSessionAuth() {
|
|
167
|
-
const { headers, ...baseOptions } = this.configuration.baseOptions || {};
|
|
168
|
-
this.configuration.accessToken = '';
|
|
169
|
-
this.configuration.baseOptions = {
|
|
170
|
-
...baseOptions,
|
|
171
|
-
withCredentials: true,
|
|
172
|
-
headers: { ...headers, [ACCOUNT_HEADER]: this.sessionAccount() },
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
private useHeaderAuth(accessToken: string) {
|
|
177
|
-
this.configuration.accessToken = accessToken ? `Bearer ${accessToken}` : '';
|
|
178
|
-
this.tokenData.accessToken = accessToken;
|
|
179
|
-
delete this.tokenData.authMode;
|
|
180
|
-
delete this.tokenData.sub;
|
|
181
|
-
if (this.configuration.cookieAuth) {
|
|
182
|
-
const { withCredentials, headers, ...baseOptions } = this.configuration.baseOptions || {};
|
|
183
|
-
const { [ACCOUNT_HEADER]: account, ...otherHeaders } = headers || {};
|
|
184
|
-
this.configuration.baseOptions = { ...baseOptions, headers: otherHeaders };
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
private applyTokenReply({ accessToken, authMode, session }: LoginClass) {
|
|
189
|
-
if (this.configuration.cookieAuth && SESSION_MODES.indexOf(authMode) !== -1 && session?.sub) {
|
|
190
|
-
this.tokenData.authMode = authMode;
|
|
191
|
-
this.tokenData.sub = session.sub;
|
|
192
|
-
if (this.configuration.account) {
|
|
193
|
-
// A workspace switch moves the app to another account.
|
|
194
|
-
this.configuration.account = session.sub;
|
|
195
|
-
}
|
|
196
|
-
// Both keeps the token for apps not moved yet; session mode keeps no token at all.
|
|
197
|
-
if (authMode === 'both' && accessToken) {
|
|
198
|
-
this.tokenData.accessToken = accessToken;
|
|
199
|
-
} else {
|
|
200
|
-
delete this.tokenData.accessToken;
|
|
201
|
-
}
|
|
202
|
-
this.useSessionAuth();
|
|
203
|
-
} else {
|
|
204
|
-
this.useHeaderAuth(accessToken);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
private sessionHeaders(): Record<string, string> {
|
|
209
|
-
if (!this.configuration.cookieAuth) {
|
|
210
|
-
return {};
|
|
211
|
-
}
|
|
212
|
-
return {
|
|
213
|
-
[AUTH_MODE_HEADER]: 'session',
|
|
214
|
-
...(this.usesSession() && { [ACCOUNT_HEADER]: this.sessionAccount() }),
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
private withCurrentAuth(config: AxiosRequestConfig): AxiosRequestConfig {
|
|
219
|
-
delete config.headers['Authorization'];
|
|
220
|
-
delete config.headers[ACCOUNT_HEADER];
|
|
221
|
-
if (this.usesSession()) {
|
|
222
|
-
config.headers[ACCOUNT_HEADER] = this.sessionAccount();
|
|
223
|
-
config.withCredentials = true;
|
|
224
|
-
} else if (this.configuration.accessToken) {
|
|
225
|
-
config.headers['Authorization'] = this.configuration.accessToken;
|
|
226
|
-
}
|
|
227
|
-
return config;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// Both keeps the token, so a session call the browser could not complete can be sent again with it.
|
|
231
|
-
private canRetryWithToken(config: AxiosRequestConfig): boolean {
|
|
232
|
-
return !!config.withCredentials && !!config.headers?.[ACCOUNT_HEADER]
|
|
233
|
-
&& !!this.tokenData.accessToken && this.tokenData.authMode !== 'session';
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// A network error can come after the server ran the call, so only a call that is safe to repeat is sent again.
|
|
237
|
-
private canResend(config: AxiosRequestConfig): boolean {
|
|
238
|
-
return RESEND_SAFE_METHODS.indexOf((config.method || 'get').toLowerCase()) !== -1
|
|
239
|
-
|| Object.keys(config.headers || {}).some((name) => name.toLowerCase() === 'idempotency-key');
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
private switchToToken() {
|
|
243
|
-
this.useHeaderAuth(this.tokenData.accessToken);
|
|
244
|
-
this.storeTokenData(this.tokenData);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
private retryWithToken(axios: AxiosInstance, config: AxiosRequestConfig) {
|
|
248
|
-
this.switchToToken();
|
|
249
|
-
config.withCredentials = false;
|
|
250
|
-
return axios(this.withCurrentAuth(config));
|
|
251
|
-
}
|
|
252
|
-
|
|
253
122
|
selectEnvironment(env: Environment) {
|
|
254
123
|
this.selectBasePath(env);
|
|
255
124
|
}
|
|
@@ -269,8 +138,8 @@ export class BaseAPI {
|
|
|
269
138
|
async authorize(username: string, password: string, targetWorkspace?: string): Promise<void> {
|
|
270
139
|
const options: AxiosRequestConfig = {
|
|
271
140
|
method: 'POST',
|
|
272
|
-
url: `${this.
|
|
273
|
-
headers: { 'Content-Type': 'application/json'
|
|
141
|
+
url: `${this.configuration.basePath}/authservice/v1/login`,
|
|
142
|
+
headers: { 'Content-Type': 'application/json' },
|
|
274
143
|
data: {
|
|
275
144
|
username,
|
|
276
145
|
password,
|
|
@@ -280,10 +149,13 @@ export class BaseAPI {
|
|
|
280
149
|
|
|
281
150
|
const response = await globalAxios.request<LoginClass>(options);
|
|
282
151
|
|
|
152
|
+
const { data: { accessToken, permissions } } = response;
|
|
153
|
+
|
|
283
154
|
this.configuration.username = username;
|
|
155
|
+
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
284
156
|
this.tokenData.username = username;
|
|
285
|
-
this.tokenData.
|
|
286
|
-
this.
|
|
157
|
+
this.tokenData.accessToken = accessToken;
|
|
158
|
+
this.tokenData.permissions = permissions;
|
|
287
159
|
|
|
288
160
|
// Switch workspace if provided
|
|
289
161
|
if (targetWorkspace) {
|
|
@@ -303,11 +175,10 @@ export class BaseAPI {
|
|
|
303
175
|
async switchWorkspace(targetWorkspace: string): Promise<void> {
|
|
304
176
|
const options: AxiosRequestConfig = {
|
|
305
177
|
method: 'POST',
|
|
306
|
-
url: `${this.
|
|
178
|
+
url: `${this.configuration.basePath}/authservice/v1/workspaces/switch`,
|
|
307
179
|
headers: {
|
|
308
180
|
'Content-Type': 'application/json',
|
|
309
|
-
|
|
310
|
-
...(!this.usesSession() && !!this.configuration.accessToken && { 'Authorization': this.configuration.accessToken as string }),
|
|
181
|
+
'Authorization': `Bearer ${this.configuration.accessToken}`,
|
|
311
182
|
},
|
|
312
183
|
data: {
|
|
313
184
|
username: this.configuration.username,
|
|
@@ -318,8 +189,11 @@ export class BaseAPI {
|
|
|
318
189
|
|
|
319
190
|
const response = await globalAxios.request<SwitchWorkspaceResponseClass>(options);
|
|
320
191
|
|
|
321
|
-
|
|
322
|
-
|
|
192
|
+
const { data: { accessToken, permissions } } = response;
|
|
193
|
+
|
|
194
|
+
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
195
|
+
this.tokenData.accessToken = accessToken;
|
|
196
|
+
this.tokenData.permissions = permissions;
|
|
323
197
|
|
|
324
198
|
this.storeTokenData({
|
|
325
199
|
...this.tokenData
|
|
@@ -345,10 +219,9 @@ export class BaseAPI {
|
|
|
345
219
|
|
|
346
220
|
const options: AxiosRequestConfig = {
|
|
347
221
|
method: 'POST',
|
|
348
|
-
url: `${this.
|
|
222
|
+
url: `${this.configuration.basePath}/authservice/v1/refresh-token`,
|
|
349
223
|
headers: {
|
|
350
224
|
'Content-Type': 'application/json',
|
|
351
|
-
...this.sessionHeaders(),
|
|
352
225
|
},
|
|
353
226
|
data: { username: username },
|
|
354
227
|
withCredentials: true,
|
|
@@ -389,22 +262,20 @@ export class BaseAPI {
|
|
|
389
262
|
&& !originalConfig._retry) {
|
|
390
263
|
originalConfig._retry = true;
|
|
391
264
|
try {
|
|
392
|
-
const
|
|
393
|
-
|
|
394
|
-
this.
|
|
395
|
-
this.storeTokenData(this.tokenData);
|
|
265
|
+
const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
|
|
266
|
+
const accessToken = `Bearer ${tokenString}`;
|
|
267
|
+
this.tokenData.permissions = permissions;
|
|
396
268
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
269
|
+
delete originalConfig.headers['Authorization']
|
|
270
|
+
|
|
271
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
400
272
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
});
|
|
273
|
+
this.configuration.accessToken = accessToken;
|
|
274
|
+
this.tokenData.accessToken = tokenString;
|
|
275
|
+
|
|
276
|
+
this.storeTokenData(this.tokenData);
|
|
277
|
+
|
|
278
|
+
return axios(originalConfig);
|
|
408
279
|
} catch (_error) {
|
|
409
280
|
if (_error.response && _error.response.data) {
|
|
410
281
|
return Promise.reject(_error.response.data);
|
|
@@ -412,30 +283,26 @@ export class BaseAPI {
|
|
|
412
283
|
return Promise.reject(_error);
|
|
413
284
|
}
|
|
414
285
|
}
|
|
415
|
-
} else if (err.message === NETWORK_ERROR_MESSAGE && this.canRetryWithToken(originalConfig)) {
|
|
416
|
-
// Both mode: the browser blocked the session call or hid its reply; later calls use the token.
|
|
417
|
-
if (!this.canResend(originalConfig)) {
|
|
418
|
-
this.switchToToken();
|
|
419
|
-
return Promise.reject(err);
|
|
420
|
-
}
|
|
421
|
-
return this.retryWithToken(axios, originalConfig);
|
|
422
286
|
} else if (err.message === NETWORK_ERROR_MESSAGE
|
|
423
|
-
&&
|
|
424
|
-
|| (this.configuration.cookieAuth && originalConfig.withCredentials && this.canResend(originalConfig)))
|
|
287
|
+
&& originalConfig.headers.hasOwnProperty('Authorization')
|
|
425
288
|
&& _retry_count < 4
|
|
426
289
|
) {
|
|
427
290
|
_retry_count++;
|
|
428
291
|
try {
|
|
429
|
-
|
|
430
|
-
const
|
|
431
|
-
this.tokenData.permissions =
|
|
292
|
+
const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
|
|
293
|
+
const accessToken = `Bearer ${tokenString}`;
|
|
294
|
+
this.tokenData.permissions = permissions;
|
|
432
295
|
|
|
433
296
|
_retry = true;
|
|
434
|
-
|
|
297
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
298
|
+
|
|
299
|
+
this.configuration.accessToken = accessToken;
|
|
300
|
+
this.tokenData.accessToken = tokenString;
|
|
301
|
+
|
|
435
302
|
this.storeTokenData(this.tokenData);
|
|
436
303
|
|
|
437
304
|
return axios.request({
|
|
438
|
-
...
|
|
305
|
+
...originalConfig,
|
|
439
306
|
});
|
|
440
307
|
} catch (_error) {
|
|
441
308
|
if (_error.response && _error.response.data) {
|
package/common.ts
CHANGED
|
@@ -130,10 +130,9 @@ export const toPathString = function (url: URL) {
|
|
|
130
130
|
* @export
|
|
131
131
|
*/
|
|
132
132
|
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
|
|
133
|
-
|
|
134
|
-
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH): Promise<R> => {
|
|
133
|
+
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
135
134
|
const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
|
|
136
|
-
return axios.request<T, R>(axiosRequestArgs)
|
|
135
|
+
return axios.request<T, R>(axiosRequestArgs);
|
|
137
136
|
};
|
|
138
137
|
}
|
|
139
138
|
|
package/configuration.ts
CHANGED
|
@@ -21,8 +21,6 @@ export interface ConfigurationParameters {
|
|
|
21
21
|
basePath?: string;
|
|
22
22
|
baseOptions?: any;
|
|
23
23
|
formDataCtor?: new () => any;
|
|
24
|
-
cookieAuth?: boolean;
|
|
25
|
-
account?: string;
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
export class Configuration {
|
|
@@ -76,22 +74,6 @@ export class Configuration {
|
|
|
76
74
|
*/
|
|
77
75
|
formDataCtor?: new () => any;
|
|
78
76
|
|
|
79
|
-
/**
|
|
80
|
-
* Use a server session when authservice makes one; otherwise the token, as without this option.
|
|
81
|
-
* Set `account` too, so each SDK object keeps its own account.
|
|
82
|
-
*
|
|
83
|
-
* @type {boolean}
|
|
84
|
-
* @memberof Configuration
|
|
85
|
-
*/
|
|
86
|
-
cookieAuth?: boolean;
|
|
87
|
-
/**
|
|
88
|
-
* The session account (Cognito sub) this app shows, so the SDK never takes another tab's account.
|
|
89
|
-
*
|
|
90
|
-
* @type {string}
|
|
91
|
-
* @memberof Configuration
|
|
92
|
-
*/
|
|
93
|
-
account?: string;
|
|
94
|
-
|
|
95
77
|
constructor(param: ConfigurationParameters = {}) {
|
|
96
78
|
this.apiKey = param.apiKey;
|
|
97
79
|
this.username = param.username;
|
|
@@ -100,8 +82,6 @@ export class Configuration {
|
|
|
100
82
|
this.basePath = param.basePath;
|
|
101
83
|
this.baseOptions = param.baseOptions;
|
|
102
84
|
this.formDataCtor = param.formDataCtor;
|
|
103
|
-
this.cookieAuth = param.cookieAuth;
|
|
104
|
-
this.account = param.account;
|
|
105
85
|
}
|
|
106
86
|
|
|
107
87
|
/**
|
|
@@ -14,12 +14,8 @@ import { Configuration } from '../configuration';
|
|
|
14
14
|
import { RequestArgs, BaseAPI } from '../base';
|
|
15
15
|
import { CreateBookingEntryRequestDto } from '../models';
|
|
16
16
|
import { CreateBookingEntryResponseClass } from '../models';
|
|
17
|
-
import { CreateOrCorrectOpeningBalanceDto } from '../models';
|
|
18
|
-
import { CreateOrCorrectOpeningBalanceResponseClass } from '../models';
|
|
19
17
|
import { GetBookingEntryResponseClass } from '../models';
|
|
20
18
|
import { ListBookingEntriesResponseClass } from '../models';
|
|
21
|
-
import { PostFinancialEventRequestDto } from '../models';
|
|
22
|
-
import { PostFinancialEventResponseClass } from '../models';
|
|
23
19
|
/**
|
|
24
20
|
* BookingEntriesApi - axios parameter creator
|
|
25
21
|
* @export
|
|
@@ -34,15 +30,6 @@ export declare const BookingEntriesApiAxiosParamCreator: (configuration?: Config
|
|
|
34
30
|
* @throws {RequiredError}
|
|
35
31
|
*/
|
|
36
32
|
createBookingEntry: (createBookingEntryRequestDto: CreateBookingEntryRequestDto, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
37
|
-
/**
|
|
38
|
-
* Enters or restates the confirmed opening balance for one or more accounts: a first-time entry for an account with no opening-balance history yet, a restatement for one that already has some. Each item carries the confirmed balance, not the delta; the service derives the delta itself and books it, per account, against the main-ledger bridge account. **Required Permissions** \"accounting-management.financial-accounts.create\"
|
|
39
|
-
* @summary Update the create or correct opening balance
|
|
40
|
-
* @param {CreateOrCorrectOpeningBalanceDto} createOrCorrectOpeningBalanceDto
|
|
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
|
-
createOrCorrectOpeningBalance: (createOrCorrectOpeningBalanceDto: CreateOrCorrectOpeningBalanceDto, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
46
33
|
/**
|
|
47
34
|
* This endpoint gets a booking entry. **Required Permissions** \"accounting-management.entries.view\"
|
|
48
35
|
* @summary Retrieve the booking entry
|
|
@@ -54,7 +41,7 @@ export declare const BookingEntriesApiAxiosParamCreator: (configuration?: Config
|
|
|
54
41
|
*/
|
|
55
42
|
getBookingEntry: (code: string, expand: string, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
56
43
|
/**
|
|
57
|
-
* This endpoint gets booking entries.
|
|
44
|
+
* This endpoint gets booking entries. **Required Permissions** \"accounting-management.entries.view\"
|
|
58
45
|
* @summary List booking entries
|
|
59
46
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
60
47
|
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
@@ -68,15 +55,6 @@ export declare const BookingEntriesApiAxiosParamCreator: (configuration?: Config
|
|
|
68
55
|
* @throws {RequiredError}
|
|
69
56
|
*/
|
|
70
57
|
listBookingEntries: (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
71
|
-
/**
|
|
72
|
-
* This endpoint posts the booking entry for an existing invoice, payment, exceeding credit or credit allocation on demand. The entity is fetched from the service that owns it and run through the same posting flow its domain event triggers, so the call is idempotent: an entity that is already posted returns its existing booking entry. When the flow deliberately posts nothing (subledger not active for the booking date, non-positive amount) the call fails with a precondition error carrying the reason. **Required Permissions** \"accounting-management.entries.create\"
|
|
73
|
-
* @summary Create the booking entry from a source entity
|
|
74
|
-
* @param {PostFinancialEventRequestDto} postFinancialEventRequestDto
|
|
75
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
76
|
-
* @param {*} [options] Override http request option.
|
|
77
|
-
* @throws {RequiredError}
|
|
78
|
-
*/
|
|
79
|
-
postFinancialEvent: (postFinancialEventRequestDto: PostFinancialEventRequestDto, authorization?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
80
58
|
};
|
|
81
59
|
/**
|
|
82
60
|
* BookingEntriesApi - functional programming interface
|
|
@@ -92,15 +70,6 @@ export declare const BookingEntriesApiFp: (configuration?: Configuration) => {
|
|
|
92
70
|
* @throws {RequiredError}
|
|
93
71
|
*/
|
|
94
72
|
createBookingEntry(createBookingEntryRequestDto: CreateBookingEntryRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateBookingEntryResponseClass>>;
|
|
95
|
-
/**
|
|
96
|
-
* Enters or restates the confirmed opening balance for one or more accounts: a first-time entry for an account with no opening-balance history yet, a restatement for one that already has some. Each item carries the confirmed balance, not the delta; the service derives the delta itself and books it, per account, against the main-ledger bridge account. **Required Permissions** \"accounting-management.financial-accounts.create\"
|
|
97
|
-
* @summary Update the create or correct opening balance
|
|
98
|
-
* @param {CreateOrCorrectOpeningBalanceDto} createOrCorrectOpeningBalanceDto
|
|
99
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
100
|
-
* @param {*} [options] Override http request option.
|
|
101
|
-
* @throws {RequiredError}
|
|
102
|
-
*/
|
|
103
|
-
createOrCorrectOpeningBalance(createOrCorrectOpeningBalanceDto: CreateOrCorrectOpeningBalanceDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateOrCorrectOpeningBalanceResponseClass>>;
|
|
104
73
|
/**
|
|
105
74
|
* This endpoint gets a booking entry. **Required Permissions** \"accounting-management.entries.view\"
|
|
106
75
|
* @summary Retrieve the booking entry
|
|
@@ -112,7 +81,7 @@ export declare const BookingEntriesApiFp: (configuration?: Configuration) => {
|
|
|
112
81
|
*/
|
|
113
82
|
getBookingEntry(code: string, expand: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetBookingEntryResponseClass>>;
|
|
114
83
|
/**
|
|
115
|
-
* This endpoint gets booking entries.
|
|
84
|
+
* This endpoint gets booking entries. **Required Permissions** \"accounting-management.entries.view\"
|
|
116
85
|
* @summary List booking entries
|
|
117
86
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
118
87
|
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
@@ -126,15 +95,6 @@ export declare const BookingEntriesApiFp: (configuration?: Configuration) => {
|
|
|
126
95
|
* @throws {RequiredError}
|
|
127
96
|
*/
|
|
128
97
|
listBookingEntries(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListBookingEntriesResponseClass>>;
|
|
129
|
-
/**
|
|
130
|
-
* This endpoint posts the booking entry for an existing invoice, payment, exceeding credit or credit allocation on demand. The entity is fetched from the service that owns it and run through the same posting flow its domain event triggers, so the call is idempotent: an entity that is already posted returns its existing booking entry. When the flow deliberately posts nothing (subledger not active for the booking date, non-positive amount) the call fails with a precondition error carrying the reason. **Required Permissions** \"accounting-management.entries.create\"
|
|
131
|
-
* @summary Create the booking entry from a source entity
|
|
132
|
-
* @param {PostFinancialEventRequestDto} postFinancialEventRequestDto
|
|
133
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
134
|
-
* @param {*} [options] Override http request option.
|
|
135
|
-
* @throws {RequiredError}
|
|
136
|
-
*/
|
|
137
|
-
postFinancialEvent(postFinancialEventRequestDto: PostFinancialEventRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostFinancialEventResponseClass>>;
|
|
138
98
|
};
|
|
139
99
|
/**
|
|
140
100
|
* BookingEntriesApi - factory interface
|
|
@@ -150,15 +110,6 @@ export declare const BookingEntriesApiFactory: (configuration?: Configuration, b
|
|
|
150
110
|
* @throws {RequiredError}
|
|
151
111
|
*/
|
|
152
112
|
createBookingEntry(createBookingEntryRequestDto: CreateBookingEntryRequestDto, authorization?: string, options?: any): AxiosPromise<CreateBookingEntryResponseClass>;
|
|
153
|
-
/**
|
|
154
|
-
* Enters or restates the confirmed opening balance for one or more accounts: a first-time entry for an account with no opening-balance history yet, a restatement for one that already has some. Each item carries the confirmed balance, not the delta; the service derives the delta itself and books it, per account, against the main-ledger bridge account. **Required Permissions** \"accounting-management.financial-accounts.create\"
|
|
155
|
-
* @summary Update the create or correct opening balance
|
|
156
|
-
* @param {CreateOrCorrectOpeningBalanceDto} createOrCorrectOpeningBalanceDto
|
|
157
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
158
|
-
* @param {*} [options] Override http request option.
|
|
159
|
-
* @throws {RequiredError}
|
|
160
|
-
*/
|
|
161
|
-
createOrCorrectOpeningBalance(createOrCorrectOpeningBalanceDto: CreateOrCorrectOpeningBalanceDto, authorization?: string, options?: any): AxiosPromise<CreateOrCorrectOpeningBalanceResponseClass>;
|
|
162
113
|
/**
|
|
163
114
|
* This endpoint gets a booking entry. **Required Permissions** \"accounting-management.entries.view\"
|
|
164
115
|
* @summary Retrieve the booking entry
|
|
@@ -170,7 +121,7 @@ export declare const BookingEntriesApiFactory: (configuration?: Configuration, b
|
|
|
170
121
|
*/
|
|
171
122
|
getBookingEntry(code: string, expand: string, authorization?: string, options?: any): AxiosPromise<GetBookingEntryResponseClass>;
|
|
172
123
|
/**
|
|
173
|
-
* This endpoint gets booking entries.
|
|
124
|
+
* This endpoint gets booking entries. **Required Permissions** \"accounting-management.entries.view\"
|
|
174
125
|
* @summary List booking entries
|
|
175
126
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
176
127
|
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
@@ -184,15 +135,6 @@ export declare const BookingEntriesApiFactory: (configuration?: Configuration, b
|
|
|
184
135
|
* @throws {RequiredError}
|
|
185
136
|
*/
|
|
186
137
|
listBookingEntries(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, search?: string, order?: string, expand?: string, filters?: string, options?: any): AxiosPromise<ListBookingEntriesResponseClass>;
|
|
187
|
-
/**
|
|
188
|
-
* This endpoint posts the booking entry for an existing invoice, payment, exceeding credit or credit allocation on demand. The entity is fetched from the service that owns it and run through the same posting flow its domain event triggers, so the call is idempotent: an entity that is already posted returns its existing booking entry. When the flow deliberately posts nothing (subledger not active for the booking date, non-positive amount) the call fails with a precondition error carrying the reason. **Required Permissions** \"accounting-management.entries.create\"
|
|
189
|
-
* @summary Create the booking entry from a source entity
|
|
190
|
-
* @param {PostFinancialEventRequestDto} postFinancialEventRequestDto
|
|
191
|
-
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
192
|
-
* @param {*} [options] Override http request option.
|
|
193
|
-
* @throws {RequiredError}
|
|
194
|
-
*/
|
|
195
|
-
postFinancialEvent(postFinancialEventRequestDto: PostFinancialEventRequestDto, authorization?: string, options?: any): AxiosPromise<PostFinancialEventResponseClass>;
|
|
196
138
|
};
|
|
197
139
|
/**
|
|
198
140
|
* Request parameters for createBookingEntry operation in BookingEntriesApi.
|
|
@@ -213,25 +155,6 @@ export interface BookingEntriesApiCreateBookingEntryRequest {
|
|
|
213
155
|
*/
|
|
214
156
|
readonly authorization?: string;
|
|
215
157
|
}
|
|
216
|
-
/**
|
|
217
|
-
* Request parameters for createOrCorrectOpeningBalance operation in BookingEntriesApi.
|
|
218
|
-
* @export
|
|
219
|
-
* @interface BookingEntriesApiCreateOrCorrectOpeningBalanceRequest
|
|
220
|
-
*/
|
|
221
|
-
export interface BookingEntriesApiCreateOrCorrectOpeningBalanceRequest {
|
|
222
|
-
/**
|
|
223
|
-
*
|
|
224
|
-
* @type {CreateOrCorrectOpeningBalanceDto}
|
|
225
|
-
* @memberof BookingEntriesApiCreateOrCorrectOpeningBalance
|
|
226
|
-
*/
|
|
227
|
-
readonly createOrCorrectOpeningBalanceDto: CreateOrCorrectOpeningBalanceDto;
|
|
228
|
-
/**
|
|
229
|
-
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
230
|
-
* @type {string}
|
|
231
|
-
* @memberof BookingEntriesApiCreateOrCorrectOpeningBalance
|
|
232
|
-
*/
|
|
233
|
-
readonly authorization?: string;
|
|
234
|
-
}
|
|
235
158
|
/**
|
|
236
159
|
* Request parameters for getBookingEntry operation in BookingEntriesApi.
|
|
237
160
|
* @export
|
|
@@ -312,25 +235,6 @@ export interface BookingEntriesApiListBookingEntriesRequest {
|
|
|
312
235
|
*/
|
|
313
236
|
readonly filters?: string;
|
|
314
237
|
}
|
|
315
|
-
/**
|
|
316
|
-
* Request parameters for postFinancialEvent operation in BookingEntriesApi.
|
|
317
|
-
* @export
|
|
318
|
-
* @interface BookingEntriesApiPostFinancialEventRequest
|
|
319
|
-
*/
|
|
320
|
-
export interface BookingEntriesApiPostFinancialEventRequest {
|
|
321
|
-
/**
|
|
322
|
-
*
|
|
323
|
-
* @type {PostFinancialEventRequestDto}
|
|
324
|
-
* @memberof BookingEntriesApiPostFinancialEvent
|
|
325
|
-
*/
|
|
326
|
-
readonly postFinancialEventRequestDto: PostFinancialEventRequestDto;
|
|
327
|
-
/**
|
|
328
|
-
* Bearer Token: provided by the login endpoint under the name accessToken.
|
|
329
|
-
* @type {string}
|
|
330
|
-
* @memberof BookingEntriesApiPostFinancialEvent
|
|
331
|
-
*/
|
|
332
|
-
readonly authorization?: string;
|
|
333
|
-
}
|
|
334
238
|
/**
|
|
335
239
|
* BookingEntriesApi - object-oriented interface
|
|
336
240
|
* @export
|
|
@@ -346,16 +250,7 @@ export declare class BookingEntriesApi extends BaseAPI {
|
|
|
346
250
|
* @throws {RequiredError}
|
|
347
251
|
* @memberof BookingEntriesApi
|
|
348
252
|
*/
|
|
349
|
-
createBookingEntry(requestParameters: BookingEntriesApiCreateBookingEntryRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateBookingEntryResponseClass, any, {}
|
|
350
|
-
/**
|
|
351
|
-
* Enters or restates the confirmed opening balance for one or more accounts: a first-time entry for an account with no opening-balance history yet, a restatement for one that already has some. Each item carries the confirmed balance, not the delta; the service derives the delta itself and books it, per account, against the main-ledger bridge account. **Required Permissions** \"accounting-management.financial-accounts.create\"
|
|
352
|
-
* @summary Update the create or correct opening balance
|
|
353
|
-
* @param {BookingEntriesApiCreateOrCorrectOpeningBalanceRequest} requestParameters Request parameters.
|
|
354
|
-
* @param {*} [options] Override http request option.
|
|
355
|
-
* @throws {RequiredError}
|
|
356
|
-
* @memberof BookingEntriesApi
|
|
357
|
-
*/
|
|
358
|
-
createOrCorrectOpeningBalance(requestParameters: BookingEntriesApiCreateOrCorrectOpeningBalanceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateOrCorrectOpeningBalanceResponseClass, any, {}, any>>;
|
|
253
|
+
createBookingEntry(requestParameters: BookingEntriesApiCreateBookingEntryRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateBookingEntryResponseClass, any, {}>>;
|
|
359
254
|
/**
|
|
360
255
|
* This endpoint gets a booking entry. **Required Permissions** \"accounting-management.entries.view\"
|
|
361
256
|
* @summary Retrieve the booking entry
|
|
@@ -364,23 +259,14 @@ export declare class BookingEntriesApi extends BaseAPI {
|
|
|
364
259
|
* @throws {RequiredError}
|
|
365
260
|
* @memberof BookingEntriesApi
|
|
366
261
|
*/
|
|
367
|
-
getBookingEntry(requestParameters: BookingEntriesApiGetBookingEntryRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetBookingEntryResponseClass, any, {}
|
|
262
|
+
getBookingEntry(requestParameters: BookingEntriesApiGetBookingEntryRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetBookingEntryResponseClass, any, {}>>;
|
|
368
263
|
/**
|
|
369
|
-
* This endpoint gets booking entries.
|
|
264
|
+
* This endpoint gets booking entries. **Required Permissions** \"accounting-management.entries.view\"
|
|
370
265
|
* @summary List booking entries
|
|
371
266
|
* @param {BookingEntriesApiListBookingEntriesRequest} requestParameters Request parameters.
|
|
372
267
|
* @param {*} [options] Override http request option.
|
|
373
268
|
* @throws {RequiredError}
|
|
374
269
|
* @memberof BookingEntriesApi
|
|
375
270
|
*/
|
|
376
|
-
listBookingEntries(requestParameters?: BookingEntriesApiListBookingEntriesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListBookingEntriesResponseClass, any, {}
|
|
377
|
-
/**
|
|
378
|
-
* This endpoint posts the booking entry for an existing invoice, payment, exceeding credit or credit allocation on demand. The entity is fetched from the service that owns it and run through the same posting flow its domain event triggers, so the call is idempotent: an entity that is already posted returns its existing booking entry. When the flow deliberately posts nothing (subledger not active for the booking date, non-positive amount) the call fails with a precondition error carrying the reason. **Required Permissions** \"accounting-management.entries.create\"
|
|
379
|
-
* @summary Create the booking entry from a source entity
|
|
380
|
-
* @param {BookingEntriesApiPostFinancialEventRequest} requestParameters Request parameters.
|
|
381
|
-
* @param {*} [options] Override http request option.
|
|
382
|
-
* @throws {RequiredError}
|
|
383
|
-
* @memberof BookingEntriesApi
|
|
384
|
-
*/
|
|
385
|
-
postFinancialEvent(requestParameters: BookingEntriesApiPostFinancialEventRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<PostFinancialEventResponseClass, any, {}, any>>;
|
|
271
|
+
listBookingEntries(requestParameters?: BookingEntriesApiListBookingEntriesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListBookingEntriesResponseClass, any, {}>>;
|
|
386
272
|
}
|