@emilgroup/account-sdk-node 1.45.1-beta.19 → 1.45.1-beta.21
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/README.md +2 -2
- package/api/accounts-api.ts +42 -24
- package/api/health-api.ts +1 -1
- package/base.ts +4 -0
- package/dist/api/accounts-api.js +66 -45
- package/dist/api/health-api.js +1 -1
- package/dist/base.d.ts +1 -0
- package/dist/base.js +3 -0
- package/package.json +1 -1
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/account-sdk-node@1.45.1-beta.
|
|
20
|
+
npm install @emilgroup/account-sdk-node@1.45.1-beta.21 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/account-sdk-node@1.45.1-beta.
|
|
24
|
+
yarn add @emilgroup/account-sdk-node@1.45.1-beta.21
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `AccountsApi`.
|
package/api/accounts-api.ts
CHANGED
|
@@ -71,9 +71,12 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
71
71
|
// http bearer authentication required
|
|
72
72
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
73
73
|
|
|
74
|
-
// Only Authorization falls back to the configured token
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
75
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
76
|
+
const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
77
|
+
const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
78
|
+
const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
|
|
79
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
77
80
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
78
81
|
}
|
|
79
82
|
|
|
@@ -121,9 +124,12 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
121
124
|
// http bearer authentication required
|
|
122
125
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
123
126
|
|
|
124
|
-
// Only Authorization falls back to the configured token
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
128
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
129
|
+
const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
130
|
+
const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
131
|
+
const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
|
|
132
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
127
133
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
128
134
|
}
|
|
129
135
|
|
|
@@ -173,9 +179,12 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
173
179
|
localVarQueryParameter['expand'] = expand;
|
|
174
180
|
}
|
|
175
181
|
|
|
176
|
-
// Only Authorization falls back to the configured token
|
|
177
|
-
|
|
178
|
-
|
|
182
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
183
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
184
|
+
const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
185
|
+
const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
186
|
+
const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
|
|
187
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
179
188
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
180
189
|
}
|
|
181
190
|
|
|
@@ -225,9 +234,12 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
225
234
|
localVarQueryParameter['expand'] = expand;
|
|
226
235
|
}
|
|
227
236
|
|
|
228
|
-
// Only Authorization falls back to the configured token
|
|
229
|
-
|
|
230
|
-
|
|
237
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
238
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
239
|
+
const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
240
|
+
const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
241
|
+
const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
|
|
242
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
231
243
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
232
244
|
}
|
|
233
245
|
|
|
@@ -303,9 +315,12 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
303
315
|
localVarQueryParameter['filters'] = filters;
|
|
304
316
|
}
|
|
305
317
|
|
|
306
|
-
// Only Authorization falls back to the configured token
|
|
307
|
-
|
|
308
|
-
|
|
318
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
319
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
320
|
+
const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
321
|
+
const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
322
|
+
const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
|
|
323
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
309
324
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
310
325
|
}
|
|
311
326
|
|
|
@@ -353,9 +368,12 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
353
368
|
// http bearer authentication required
|
|
354
369
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
355
370
|
|
|
356
|
-
// Only Authorization falls back to the configured token
|
|
357
|
-
|
|
358
|
-
|
|
371
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
372
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
373
|
+
const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
374
|
+
const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
375
|
+
const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
|
|
376
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
359
377
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
360
378
|
}
|
|
361
379
|
|
|
@@ -757,7 +775,7 @@ export class AccountsApi extends BaseAPI {
|
|
|
757
775
|
* @memberof AccountsApi
|
|
758
776
|
*/
|
|
759
777
|
public createAccount(requestParameters: AccountsApiCreateAccountRequest, options?: AxiosRequestConfig) {
|
|
760
|
-
return AccountsApiFp(this.configuration).createAccount(requestParameters.createAccountRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
778
|
+
return AccountsApiFp(this.configuration).createAccount(requestParameters.createAccountRequestDto, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
|
|
761
779
|
}
|
|
762
780
|
|
|
763
781
|
/**
|
|
@@ -769,7 +787,7 @@ export class AccountsApi extends BaseAPI {
|
|
|
769
787
|
* @memberof AccountsApi
|
|
770
788
|
*/
|
|
771
789
|
public deleteAccount(requestParameters: AccountsApiDeleteAccountRequest, options?: AxiosRequestConfig) {
|
|
772
|
-
return AccountsApiFp(this.configuration).deleteAccount(requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
790
|
+
return AccountsApiFp(this.configuration).deleteAccount(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
|
|
773
791
|
}
|
|
774
792
|
|
|
775
793
|
/**
|
|
@@ -781,7 +799,7 @@ export class AccountsApi extends BaseAPI {
|
|
|
781
799
|
* @memberof AccountsApi
|
|
782
800
|
*/
|
|
783
801
|
public getAccount(requestParameters: AccountsApiGetAccountRequest, options?: AxiosRequestConfig) {
|
|
784
|
-
return AccountsApiFp(this.configuration).getAccount(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
|
|
802
|
+
return AccountsApiFp(this.configuration).getAccount(requestParameters.code, requestParameters.authorization, requestParameters.expand, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
|
|
785
803
|
}
|
|
786
804
|
|
|
787
805
|
/**
|
|
@@ -793,7 +811,7 @@ export class AccountsApi extends BaseAPI {
|
|
|
793
811
|
* @memberof AccountsApi
|
|
794
812
|
*/
|
|
795
813
|
public getAccountByEmail(requestParameters: AccountsApiGetAccountByEmailRequest, options?: AxiosRequestConfig) {
|
|
796
|
-
return AccountsApiFp(this.configuration).getAccountByEmail(requestParameters.email, requestParameters.authorization, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
|
|
814
|
+
return AccountsApiFp(this.configuration).getAccountByEmail(requestParameters.email, requestParameters.authorization, requestParameters.expand, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
|
|
797
815
|
}
|
|
798
816
|
|
|
799
817
|
/**
|
|
@@ -805,7 +823,7 @@ export class AccountsApi extends BaseAPI {
|
|
|
805
823
|
* @memberof AccountsApi
|
|
806
824
|
*/
|
|
807
825
|
public listAccounts(requestParameters: AccountsApiListAccountsRequest = {}, options?: AxiosRequestConfig) {
|
|
808
|
-
return AccountsApiFp(this.configuration).listAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
|
|
826
|
+
return AccountsApiFp(this.configuration).listAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
|
|
809
827
|
}
|
|
810
828
|
|
|
811
829
|
/**
|
|
@@ -817,6 +835,6 @@ export class AccountsApi extends BaseAPI {
|
|
|
817
835
|
* @memberof AccountsApi
|
|
818
836
|
*/
|
|
819
837
|
public updateAccount(requestParameters: AccountsApiUpdateAccountRequest, options?: AxiosRequestConfig) {
|
|
820
|
-
return AccountsApiFp(this.configuration).updateAccount(requestParameters.code, requestParameters.updateAccountRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
|
|
838
|
+
return AccountsApiFp(this.configuration).updateAccount(requestParameters.code, requestParameters.updateAccountRequestDto, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
|
|
821
839
|
}
|
|
822
840
|
}
|
package/api/health-api.ts
CHANGED
|
@@ -123,6 +123,6 @@ export class HealthApi extends BaseAPI {
|
|
|
123
123
|
* @memberof HealthApi
|
|
124
124
|
*/
|
|
125
125
|
public check(options?: AxiosRequestConfig) {
|
|
126
|
-
return HealthApiFp(this.configuration).check(options).then((request) => request(this.axios, this.basePath));
|
|
126
|
+
return HealthApiFp(this.configuration).check(this.withOwner(options)).then((request) => request(this.axios, this.basePath));
|
|
127
127
|
}
|
|
128
128
|
}
|
package/base.ts
CHANGED
|
@@ -92,6 +92,10 @@ export class BaseAPI {
|
|
|
92
92
|
private username?: string;
|
|
93
93
|
private password?: string;
|
|
94
94
|
|
|
95
|
+
protected withOwner(options?: AxiosRequestConfig): AxiosRequestConfig {
|
|
96
|
+
return { ...options };
|
|
97
|
+
}
|
|
98
|
+
|
|
95
99
|
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
|
96
100
|
if (configuration) {
|
|
97
101
|
this.configuration = configuration;
|
package/dist/api/accounts-api.js
CHANGED
|
@@ -107,9 +107,10 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
107
107
|
createAccount: function (createAccountRequestDto, authorization, options) {
|
|
108
108
|
if (options === void 0) { options = {}; }
|
|
109
109
|
return __awaiter(_this, void 0, void 0, function () {
|
|
110
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
111
|
+
var _a;
|
|
112
|
+
return __generator(this, function (_b) {
|
|
113
|
+
switch (_b.label) {
|
|
113
114
|
case 0:
|
|
114
115
|
// verify required parameter 'createAccountRequestDto' is not null or undefined
|
|
115
116
|
(0, common_1.assertParamExists)('createAccount', 'createAccountRequestDto', createAccountRequestDto);
|
|
@@ -125,14 +126,17 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
125
126
|
// authentication bearer required
|
|
126
127
|
// http bearer authentication required
|
|
127
128
|
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
128
|
-
// Only Authorization falls back to the configured token
|
|
129
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
130
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
129
131
|
];
|
|
130
132
|
case 1:
|
|
131
133
|
// authentication bearer required
|
|
132
134
|
// http bearer authentication required
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
_b.sent();
|
|
136
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
137
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
138
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
139
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
136
140
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
137
141
|
}
|
|
138
142
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
@@ -159,9 +163,10 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
159
163
|
deleteAccount: function (code, authorization, options) {
|
|
160
164
|
if (options === void 0) { options = {}; }
|
|
161
165
|
return __awaiter(_this, void 0, void 0, function () {
|
|
162
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
163
|
-
|
|
164
|
-
|
|
166
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
167
|
+
var _a;
|
|
168
|
+
return __generator(this, function (_b) {
|
|
169
|
+
switch (_b.label) {
|
|
165
170
|
case 0:
|
|
166
171
|
// verify required parameter 'code' is not null or undefined
|
|
167
172
|
(0, common_1.assertParamExists)('deleteAccount', 'code', code);
|
|
@@ -178,14 +183,17 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
178
183
|
// authentication bearer required
|
|
179
184
|
// http bearer authentication required
|
|
180
185
|
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
181
|
-
// Only Authorization falls back to the configured token
|
|
186
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
187
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
182
188
|
];
|
|
183
189
|
case 1:
|
|
184
190
|
// authentication bearer required
|
|
185
191
|
// http bearer authentication required
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
192
|
+
_b.sent();
|
|
193
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
194
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
195
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
196
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
189
197
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
190
198
|
}
|
|
191
199
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
@@ -211,9 +219,10 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
211
219
|
getAccount: function (code, authorization, expand, options) {
|
|
212
220
|
if (options === void 0) { options = {}; }
|
|
213
221
|
return __awaiter(_this, void 0, void 0, function () {
|
|
214
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
215
|
-
|
|
216
|
-
|
|
222
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
223
|
+
var _a;
|
|
224
|
+
return __generator(this, function (_b) {
|
|
225
|
+
switch (_b.label) {
|
|
217
226
|
case 0:
|
|
218
227
|
// verify required parameter 'code' is not null or undefined
|
|
219
228
|
(0, common_1.assertParamExists)('getAccount', 'code', code);
|
|
@@ -233,12 +242,14 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
233
242
|
case 1:
|
|
234
243
|
// authentication bearer required
|
|
235
244
|
// http bearer authentication required
|
|
236
|
-
|
|
245
|
+
_b.sent();
|
|
237
246
|
if (expand !== undefined) {
|
|
238
247
|
localVarQueryParameter['expand'] = expand;
|
|
239
248
|
}
|
|
240
|
-
|
|
241
|
-
|
|
249
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
250
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
251
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
252
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
242
253
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
243
254
|
}
|
|
244
255
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
@@ -264,9 +275,10 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
264
275
|
getAccountByEmail: function (email, authorization, expand, options) {
|
|
265
276
|
if (options === void 0) { options = {}; }
|
|
266
277
|
return __awaiter(_this, void 0, void 0, function () {
|
|
267
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
268
|
-
|
|
269
|
-
|
|
278
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
279
|
+
var _a;
|
|
280
|
+
return __generator(this, function (_b) {
|
|
281
|
+
switch (_b.label) {
|
|
270
282
|
case 0:
|
|
271
283
|
// verify required parameter 'email' is not null or undefined
|
|
272
284
|
(0, common_1.assertParamExists)('getAccountByEmail', 'email', email);
|
|
@@ -286,12 +298,14 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
286
298
|
case 1:
|
|
287
299
|
// authentication bearer required
|
|
288
300
|
// http bearer authentication required
|
|
289
|
-
|
|
301
|
+
_b.sent();
|
|
290
302
|
if (expand !== undefined) {
|
|
291
303
|
localVarQueryParameter['expand'] = expand;
|
|
292
304
|
}
|
|
293
|
-
|
|
294
|
-
|
|
305
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
306
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
307
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
308
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
295
309
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
296
310
|
}
|
|
297
311
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
@@ -322,9 +336,10 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
322
336
|
listAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
|
|
323
337
|
if (options === void 0) { options = {}; }
|
|
324
338
|
return __awaiter(_this, void 0, void 0, function () {
|
|
325
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
326
|
-
|
|
327
|
-
|
|
339
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
340
|
+
var _a;
|
|
341
|
+
return __generator(this, function (_b) {
|
|
342
|
+
switch (_b.label) {
|
|
328
343
|
case 0:
|
|
329
344
|
localVarPath = "/accountservice/v1/accounts";
|
|
330
345
|
localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
@@ -341,7 +356,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
341
356
|
case 1:
|
|
342
357
|
// authentication bearer required
|
|
343
358
|
// http bearer authentication required
|
|
344
|
-
|
|
359
|
+
_b.sent();
|
|
345
360
|
if (pageSize !== undefined) {
|
|
346
361
|
localVarQueryParameter['pageSize'] = pageSize;
|
|
347
362
|
}
|
|
@@ -363,8 +378,10 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
363
378
|
if (filters !== undefined) {
|
|
364
379
|
localVarQueryParameter['filters'] = filters;
|
|
365
380
|
}
|
|
366
|
-
|
|
367
|
-
|
|
381
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
382
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
383
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
384
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
368
385
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
369
386
|
}
|
|
370
387
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
@@ -390,9 +407,10 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
390
407
|
updateAccount: function (code, updateAccountRequestDto, authorization, options) {
|
|
391
408
|
if (options === void 0) { options = {}; }
|
|
392
409
|
return __awaiter(_this, void 0, void 0, function () {
|
|
393
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
394
|
-
|
|
395
|
-
|
|
410
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
|
|
411
|
+
var _a;
|
|
412
|
+
return __generator(this, function (_b) {
|
|
413
|
+
switch (_b.label) {
|
|
396
414
|
case 0:
|
|
397
415
|
// verify required parameter 'code' is not null or undefined
|
|
398
416
|
(0, common_1.assertParamExists)('updateAccount', 'code', code);
|
|
@@ -411,14 +429,17 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
411
429
|
// authentication bearer required
|
|
412
430
|
// http bearer authentication required
|
|
413
431
|
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
414
|
-
// Only Authorization falls back to the configured token
|
|
432
|
+
// Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
|
|
433
|
+
// no token is stored, so a refused call still refreshes; a session call (account header) sends none.
|
|
415
434
|
];
|
|
416
435
|
case 1:
|
|
417
436
|
// authentication bearer required
|
|
418
437
|
// http bearer authentication required
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
438
|
+
_b.sent();
|
|
439
|
+
authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
|
|
440
|
+
authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
|
|
441
|
+
authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
|
|
442
|
+
if (authorizationValue || authorizationKeepEmpty) {
|
|
422
443
|
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
423
444
|
}
|
|
424
445
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
@@ -688,7 +709,7 @@ var AccountsApi = /** @class */ (function (_super) {
|
|
|
688
709
|
*/
|
|
689
710
|
AccountsApi.prototype.createAccount = function (requestParameters, options) {
|
|
690
711
|
var _this = this;
|
|
691
|
-
return (0, exports.AccountsApiFp)(this.configuration).createAccount(requestParameters.createAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
712
|
+
return (0, exports.AccountsApiFp)(this.configuration).createAccount(requestParameters.createAccountRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
692
713
|
};
|
|
693
714
|
/**
|
|
694
715
|
* Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it. **Required Permissions** \"partner-management.partners.delete\"
|
|
@@ -700,7 +721,7 @@ var AccountsApi = /** @class */ (function (_super) {
|
|
|
700
721
|
*/
|
|
701
722
|
AccountsApi.prototype.deleteAccount = function (requestParameters, options) {
|
|
702
723
|
var _this = this;
|
|
703
|
-
return (0, exports.AccountsApiFp)(this.configuration).deleteAccount(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
724
|
+
return (0, exports.AccountsApiFp)(this.configuration).deleteAccount(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
704
725
|
};
|
|
705
726
|
/**
|
|
706
727
|
* 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. **Required Permissions** \"partner-management.partners.view\"
|
|
@@ -712,7 +733,7 @@ var AccountsApi = /** @class */ (function (_super) {
|
|
|
712
733
|
*/
|
|
713
734
|
AccountsApi.prototype.getAccount = function (requestParameters, options) {
|
|
714
735
|
var _this = this;
|
|
715
|
-
return (0, exports.AccountsApiFp)(this.configuration).getAccount(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
736
|
+
return (0, exports.AccountsApiFp)(this.configuration).getAccount(requestParameters.code, requestParameters.authorization, requestParameters.expand, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
716
737
|
};
|
|
717
738
|
/**
|
|
718
739
|
* Retrieves the details of the account that was previously created. Supply the email that was returned when you created it and Emil Api will return the corresponding account information. Email matching is case-insensitive. **Required Permissions** \"partner-management.partners.view\"
|
|
@@ -724,7 +745,7 @@ var AccountsApi = /** @class */ (function (_super) {
|
|
|
724
745
|
*/
|
|
725
746
|
AccountsApi.prototype.getAccountByEmail = function (requestParameters, options) {
|
|
726
747
|
var _this = this;
|
|
727
|
-
return (0, exports.AccountsApiFp)(this.configuration).getAccountByEmail(requestParameters.email, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
748
|
+
return (0, exports.AccountsApiFp)(this.configuration).getAccountByEmail(requestParameters.email, requestParameters.authorization, requestParameters.expand, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
728
749
|
};
|
|
729
750
|
/**
|
|
730
751
|
* Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"partner-management.partners.view\"
|
|
@@ -737,7 +758,7 @@ var AccountsApi = /** @class */ (function (_super) {
|
|
|
737
758
|
AccountsApi.prototype.listAccounts = function (requestParameters, options) {
|
|
738
759
|
var _this = this;
|
|
739
760
|
if (requestParameters === void 0) { requestParameters = {}; }
|
|
740
|
-
return (0, exports.AccountsApiFp)(this.configuration).listAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
761
|
+
return (0, exports.AccountsApiFp)(this.configuration).listAccounts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
741
762
|
};
|
|
742
763
|
/**
|
|
743
764
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
@@ -749,7 +770,7 @@ var AccountsApi = /** @class */ (function (_super) {
|
|
|
749
770
|
*/
|
|
750
771
|
AccountsApi.prototype.updateAccount = function (requestParameters, options) {
|
|
751
772
|
var _this = this;
|
|
752
|
-
return (0, exports.AccountsApiFp)(this.configuration).updateAccount(requestParameters.code, requestParameters.updateAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
773
|
+
return (0, exports.AccountsApiFp)(this.configuration).updateAccount(requestParameters.code, requestParameters.updateAccountRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
753
774
|
};
|
|
754
775
|
return AccountsApi;
|
|
755
776
|
}(base_1.BaseAPI));
|
package/dist/api/health-api.js
CHANGED
|
@@ -197,7 +197,7 @@ var HealthApi = /** @class */ (function (_super) {
|
|
|
197
197
|
*/
|
|
198
198
|
HealthApi.prototype.check = function (options) {
|
|
199
199
|
var _this = this;
|
|
200
|
-
return (0, exports.HealthApiFp)(this.configuration).check(options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
200
|
+
return (0, exports.HealthApiFp)(this.configuration).check(this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
201
201
|
};
|
|
202
202
|
return HealthApi;
|
|
203
203
|
}(base_1.BaseAPI));
|
package/dist/base.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export declare class BaseAPI {
|
|
|
63
63
|
protected configuration: Configuration;
|
|
64
64
|
private username?;
|
|
65
65
|
private password?;
|
|
66
|
+
protected withOwner(options?: AxiosRequestConfig): AxiosRequestConfig;
|
|
66
67
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
67
68
|
initialize(env?: Environment, targetWorkspace?: string): Promise<void>;
|
|
68
69
|
private loadCredentials;
|
package/dist/base.js
CHANGED
|
@@ -163,6 +163,9 @@ var BaseAPI = /** @class */ (function () {
|
|
|
163
163
|
}
|
|
164
164
|
this.attachInterceptor(axios);
|
|
165
165
|
}
|
|
166
|
+
BaseAPI.prototype.withOwner = function (options) {
|
|
167
|
+
return __assign({}, options);
|
|
168
|
+
};
|
|
166
169
|
BaseAPI.prototype.initialize = function (env, targetWorkspace) {
|
|
167
170
|
if (env === void 0) { env = Environment.Production; }
|
|
168
171
|
return __awaiter(this, void 0, void 0, function () {
|