@emilgroup/tenant-sdk-node 1.16.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/api/custom-schema-api.ts +4 -4
- package/api/data-report-api.ts +4 -4
- package/api/invite-users-api.ts +31 -31
- package/api/settings-api.ts +4 -4
- package/api/users-api.ts +31 -31
- package/base.ts +16 -8
- package/dist/api/custom-schema-api.d.ts +4 -4
- package/dist/api/custom-schema-api.js +4 -4
- package/dist/api/data-report-api.d.ts +4 -4
- package/dist/api/data-report-api.js +4 -4
- package/dist/api/invite-users-api.d.ts +31 -31
- package/dist/api/invite-users-api.js +16 -16
- package/dist/api/settings-api.d.ts +4 -4
- package/dist/api/settings-api.js +4 -4
- package/dist/api/users-api.d.ts +31 -31
- package/dist/api/users-api.js +16 -16
- package/dist/base.d.ts +4 -2
- package/dist/base.js +26 -20
- package/dist/models/create-custom-schema-request-dto.d.ts +1 -0
- package/dist/models/create-custom-schema-request-dto.js +2 -1
- package/dist/models/invite-class.d.ts +6 -0
- package/dist/models/update-custom-schema-request-dto.d.ts +1 -0
- package/dist/models/update-custom-schema-request-dto.js +2 -1
- package/dist/models/user-class.d.ts +6 -0
- package/models/create-custom-schema-request-dto.ts +2 -1
- package/models/invite-class.ts +6 -0
- package/models/update-custom-schema-request-dto.ts +2 -1
- package/models/user-class.ts +6 -0
- package/package.json +1 -1
package/dist/api/users-api.js
CHANGED
|
@@ -491,16 +491,16 @@ var UsersApiAxiosParamCreator = function (configuration) {
|
|
|
491
491
|
});
|
|
492
492
|
},
|
|
493
493
|
/**
|
|
494
|
-
* Returns a list of users you have previously created.
|
|
494
|
+
* Returns a list of users you have previously created. The users are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
495
495
|
* @summary List users
|
|
496
496
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
497
497
|
* @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
498
498
|
* @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
499
|
-
* @param {
|
|
499
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, code, email, sub, status, organizationId, ern</i>
|
|
500
500
|
* @param {any} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
501
|
-
* @param {
|
|
502
|
-
* @param {
|
|
503
|
-
* @param {
|
|
501
|
+
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: email</i>
|
|
502
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: roles, subscriptions, organizations<i>
|
|
503
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, code, email, sub, status, organizationId, ern</i>
|
|
504
504
|
* @param {*} [options] Override http request option.
|
|
505
505
|
* @throws {RequiredError}
|
|
506
506
|
*/
|
|
@@ -736,16 +736,16 @@ var UsersApiFp = function (configuration) {
|
|
|
736
736
|
});
|
|
737
737
|
},
|
|
738
738
|
/**
|
|
739
|
-
* Returns a list of users you have previously created.
|
|
739
|
+
* Returns a list of users you have previously created. The users are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
740
740
|
* @summary List users
|
|
741
741
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
742
742
|
* @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
743
743
|
* @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
744
|
-
* @param {
|
|
744
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, code, email, sub, status, organizationId, ern</i>
|
|
745
745
|
* @param {any} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
746
|
-
* @param {
|
|
747
|
-
* @param {
|
|
748
|
-
* @param {
|
|
746
|
+
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: email</i>
|
|
747
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: roles, subscriptions, organizations<i>
|
|
748
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, code, email, sub, status, organizationId, ern</i>
|
|
749
749
|
* @param {*} [options] Override http request option.
|
|
750
750
|
* @throws {RequiredError}
|
|
751
751
|
*/
|
|
@@ -856,16 +856,16 @@ var UsersApiFactory = function (configuration, basePath, axios) {
|
|
|
856
856
|
return localVarFp.getUser(code, code2, authorization, expand, options).then(function (request) { return request(axios, basePath); });
|
|
857
857
|
},
|
|
858
858
|
/**
|
|
859
|
-
* Returns a list of users you have previously created.
|
|
859
|
+
* Returns a list of users you have previously created. The users are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
860
860
|
* @summary List users
|
|
861
861
|
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
862
862
|
* @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
|
|
863
863
|
* @param {any} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
864
|
-
* @param {
|
|
864
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: id, code, email, sub, status, organizationId, ern</i>
|
|
865
865
|
* @param {any} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
866
|
-
* @param {
|
|
867
|
-
* @param {
|
|
868
|
-
* @param {
|
|
866
|
+
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: email</i>
|
|
867
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: roles, subscriptions, organizations<i>
|
|
868
|
+
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: id, code, email, sub, status, organizationId, ern</i>
|
|
869
869
|
* @param {*} [options] Override http request option.
|
|
870
870
|
* @throws {RequiredError}
|
|
871
871
|
*/
|
|
@@ -975,7 +975,7 @@ var UsersApi = /** @class */ (function (_super) {
|
|
|
975
975
|
return (0, exports.UsersApiFp)(this.configuration).getUser(requestParameters.code, requestParameters.code2, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
976
976
|
};
|
|
977
977
|
/**
|
|
978
|
-
* Returns a list of users you have previously created.
|
|
978
|
+
* Returns a list of users you have previously created. The users are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
|
|
979
979
|
* @summary List users
|
|
980
980
|
* @param {UsersApiListUsersRequest} requestParameters Request parameters.
|
|
981
981
|
* @param {*} [options] Override http request option.
|
package/dist/base.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const COLLECTION_FORMATS: {
|
|
|
24
24
|
};
|
|
25
25
|
export interface LoginClass {
|
|
26
26
|
accessToken: string;
|
|
27
|
-
permissions:
|
|
27
|
+
permissions: string;
|
|
28
28
|
}
|
|
29
29
|
export declare enum Environment {
|
|
30
30
|
Production = "https://apiv2.emil.de",
|
|
@@ -53,14 +53,16 @@ export declare class BaseAPI {
|
|
|
53
53
|
protected configuration: Configuration;
|
|
54
54
|
private username?;
|
|
55
55
|
private password?;
|
|
56
|
+
private permissions?;
|
|
56
57
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
57
58
|
initialize(env?: Environment): Promise<void>;
|
|
58
59
|
private loadCredentials;
|
|
59
60
|
private readConfigFile;
|
|
60
61
|
private readEnvVariables;
|
|
61
62
|
selectEnvironment(env: Environment): void;
|
|
63
|
+
getPermissions(): Array<string>;
|
|
62
64
|
authorize(username: string, password: string): Promise<void>;
|
|
63
|
-
refreshTokenInternal(): Promise<
|
|
65
|
+
refreshTokenInternal(): Promise<LoginClass>;
|
|
64
66
|
private extractRefreshToken;
|
|
65
67
|
getConfiguration(): Configuration;
|
|
66
68
|
private attachInterceptor;
|
package/dist/base.js
CHANGED
|
@@ -242,11 +242,14 @@ var BaseAPI = /** @class */ (function () {
|
|
|
242
242
|
BaseAPI.prototype.selectEnvironment = function (env) {
|
|
243
243
|
this.configuration.basePath = env;
|
|
244
244
|
};
|
|
245
|
+
BaseAPI.prototype.getPermissions = function () {
|
|
246
|
+
return this.permissions.split(',');
|
|
247
|
+
};
|
|
245
248
|
BaseAPI.prototype.authorize = function (username, password) {
|
|
246
249
|
return __awaiter(this, void 0, void 0, function () {
|
|
247
|
-
var options, response, accessToken, refreshToken;
|
|
248
|
-
return __generator(this, function (
|
|
249
|
-
switch (
|
|
250
|
+
var options, response, _a, accessToken, permissions, refreshToken;
|
|
251
|
+
return __generator(this, function (_b) {
|
|
252
|
+
switch (_b.label) {
|
|
250
253
|
case 0:
|
|
251
254
|
options = {
|
|
252
255
|
method: 'POST',
|
|
@@ -260,10 +263,11 @@ var BaseAPI = /** @class */ (function () {
|
|
|
260
263
|
};
|
|
261
264
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
262
265
|
case 1:
|
|
263
|
-
response =
|
|
264
|
-
|
|
266
|
+
response = _b.sent();
|
|
267
|
+
_a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
|
|
265
268
|
this.configuration.username = username;
|
|
266
269
|
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
270
|
+
this.permissions = permissions;
|
|
267
271
|
refreshToken = this.extractRefreshToken(response);
|
|
268
272
|
this.configuration.refreshToken = refreshToken;
|
|
269
273
|
return [2 /*return*/];
|
|
@@ -273,13 +277,13 @@ var BaseAPI = /** @class */ (function () {
|
|
|
273
277
|
};
|
|
274
278
|
BaseAPI.prototype.refreshTokenInternal = function () {
|
|
275
279
|
return __awaiter(this, void 0, void 0, function () {
|
|
276
|
-
var _a, username, refreshToken, options,
|
|
280
|
+
var _a, username, refreshToken, options, response;
|
|
277
281
|
return __generator(this, function (_b) {
|
|
278
282
|
switch (_b.label) {
|
|
279
283
|
case 0:
|
|
280
284
|
_a = this.configuration, username = _a.username, refreshToken = _a.refreshToken;
|
|
281
285
|
if (!username || !refreshToken) {
|
|
282
|
-
|
|
286
|
+
throw new Error('Failed to refresh token.');
|
|
283
287
|
}
|
|
284
288
|
options = {
|
|
285
289
|
method: 'POST',
|
|
@@ -293,8 +297,8 @@ var BaseAPI = /** @class */ (function () {
|
|
|
293
297
|
};
|
|
294
298
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
295
299
|
case 1:
|
|
296
|
-
|
|
297
|
-
return [2 /*return*/,
|
|
300
|
+
response = _b.sent();
|
|
301
|
+
return [2 /*return*/, response.data];
|
|
298
302
|
}
|
|
299
303
|
});
|
|
300
304
|
});
|
|
@@ -314,26 +318,27 @@ var BaseAPI = /** @class */ (function () {
|
|
|
314
318
|
axios.interceptors.response.use(function (res) {
|
|
315
319
|
return res;
|
|
316
320
|
}, function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
317
|
-
var originalConfig, tokenString, accessToken, _error_1, tokenString, accessToken, _error_2;
|
|
318
|
-
return __generator(this, function (
|
|
319
|
-
switch (
|
|
321
|
+
var originalConfig, _a, tokenString, permissions, accessToken, _error_1, _b, tokenString, permissions, accessToken, _error_2;
|
|
322
|
+
return __generator(this, function (_c) {
|
|
323
|
+
switch (_c.label) {
|
|
320
324
|
case 0:
|
|
321
325
|
originalConfig = err.config;
|
|
322
326
|
if (!err.response) return [3 /*break*/, 5];
|
|
323
327
|
if (!(err.response.status === 401 && !originalConfig._retry)) return [3 /*break*/, 4];
|
|
324
328
|
originalConfig._retry = true;
|
|
325
|
-
|
|
329
|
+
_c.label = 1;
|
|
326
330
|
case 1:
|
|
327
|
-
|
|
331
|
+
_c.trys.push([1, 3, , 4]);
|
|
328
332
|
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
329
333
|
case 2:
|
|
330
|
-
|
|
334
|
+
_a = _c.sent(), tokenString = _a.accessToken, permissions = _a.permissions;
|
|
331
335
|
accessToken = "Bearer ".concat(tokenString);
|
|
336
|
+
this.permissions = permissions;
|
|
332
337
|
originalConfig.headers['Authorization'] = "Bearer ".concat(accessToken);
|
|
333
338
|
this.configuration.accessToken = accessToken;
|
|
334
339
|
return [2 /*return*/, axios.request(originalConfig)];
|
|
335
340
|
case 3:
|
|
336
|
-
_error_1 =
|
|
341
|
+
_error_1 = _c.sent();
|
|
337
342
|
if (_error_1.response && _error_1.response.data) {
|
|
338
343
|
return [2 /*return*/, Promise.reject(_error_1.response.data)];
|
|
339
344
|
}
|
|
@@ -349,19 +354,20 @@ var BaseAPI = /** @class */ (function () {
|
|
|
349
354
|
&& originalConfig.headers.hasOwnProperty('Authorization')
|
|
350
355
|
&& _retry_count < 4)) return [3 /*break*/, 9];
|
|
351
356
|
_retry_count++;
|
|
352
|
-
|
|
357
|
+
_c.label = 6;
|
|
353
358
|
case 6:
|
|
354
|
-
|
|
359
|
+
_c.trys.push([6, 8, , 9]);
|
|
355
360
|
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
356
361
|
case 7:
|
|
357
|
-
|
|
362
|
+
_b = _c.sent(), tokenString = _b.accessToken, permissions = _b.permissions;
|
|
358
363
|
accessToken = "Bearer ".concat(tokenString);
|
|
364
|
+
this.permissions = permissions;
|
|
359
365
|
_retry = true;
|
|
360
366
|
originalConfig.headers['Authorization'] = accessToken;
|
|
361
367
|
this.configuration.accessToken = accessToken;
|
|
362
368
|
return [2 /*return*/, axios.request(__assign({}, originalConfig))];
|
|
363
369
|
case 8:
|
|
364
|
-
_error_2 =
|
|
370
|
+
_error_2 = _c.sent();
|
|
365
371
|
if (_error_2.response && _error_2.response.data) {
|
|
366
372
|
return [2 /*return*/, Promise.reject(_error_2.response.data)];
|
|
367
373
|
}
|
|
@@ -41,5 +41,6 @@ export declare const CreateCustomSchemaRequestDtoEntityEnum: {
|
|
|
41
41
|
readonly Invoice: "invoice";
|
|
42
42
|
readonly Payment: "payment";
|
|
43
43
|
readonly Organization: "organization";
|
|
44
|
+
readonly PayoutDetails: "payout_details";
|
|
44
45
|
};
|
|
45
46
|
export type CreateCustomSchemaRequestDtoEntityEnum = typeof CreateCustomSchemaRequestDtoEntityEnum[keyof typeof CreateCustomSchemaRequestDtoEntityEnum];
|
|
@@ -53,6 +53,12 @@ export interface InviteClass {
|
|
|
53
53
|
* @memberof InviteClass
|
|
54
54
|
*/
|
|
55
55
|
'updatedAt': string;
|
|
56
|
+
/**
|
|
57
|
+
* Emil Resources Names (ERN) identifies the most specific owner of a resource.
|
|
58
|
+
* @type {string}
|
|
59
|
+
* @memberof InviteClass
|
|
60
|
+
*/
|
|
61
|
+
'ern': string;
|
|
56
62
|
/**
|
|
57
63
|
* Organization associated with the user
|
|
58
64
|
* @type {OrganizationClass}
|
|
@@ -41,5 +41,6 @@ export declare const UpdateCustomSchemaRequestDtoEntityEnum: {
|
|
|
41
41
|
readonly Invoice: "invoice";
|
|
42
42
|
readonly Payment: "payment";
|
|
43
43
|
readonly Organization: "organization";
|
|
44
|
+
readonly PayoutDetails: "payout_details";
|
|
44
45
|
};
|
|
45
46
|
export type UpdateCustomSchemaRequestDtoEntityEnum = typeof UpdateCustomSchemaRequestDtoEntityEnum[keyof typeof UpdateCustomSchemaRequestDtoEntityEnum];
|
|
@@ -90,6 +90,12 @@ export interface UserClass {
|
|
|
90
90
|
* @memberof UserClass
|
|
91
91
|
*/
|
|
92
92
|
'updatedAt': string;
|
|
93
|
+
/**
|
|
94
|
+
* Emil Resources Names (ERN) identifies the most specific owner of a resource.
|
|
95
|
+
* @type {string}
|
|
96
|
+
* @memberof UserClass
|
|
97
|
+
*/
|
|
98
|
+
'ern': string;
|
|
93
99
|
/**
|
|
94
100
|
* Organization associated with the user
|
|
95
101
|
* @type {OrganizationClass}
|
|
@@ -46,7 +46,8 @@ export const CreateCustomSchemaRequestDtoEntityEnum = {
|
|
|
46
46
|
Claim: 'claim',
|
|
47
47
|
Invoice: 'invoice',
|
|
48
48
|
Payment: 'payment',
|
|
49
|
-
Organization: 'organization'
|
|
49
|
+
Organization: 'organization',
|
|
50
|
+
PayoutDetails: 'payout_details'
|
|
50
51
|
} as const;
|
|
51
52
|
|
|
52
53
|
export type CreateCustomSchemaRequestDtoEntityEnum = typeof CreateCustomSchemaRequestDtoEntityEnum[keyof typeof CreateCustomSchemaRequestDtoEntityEnum];
|
package/models/invite-class.ts
CHANGED
|
@@ -58,6 +58,12 @@ export interface InviteClass {
|
|
|
58
58
|
* @memberof InviteClass
|
|
59
59
|
*/
|
|
60
60
|
'updatedAt': string;
|
|
61
|
+
/**
|
|
62
|
+
* Emil Resources Names (ERN) identifies the most specific owner of a resource.
|
|
63
|
+
* @type {string}
|
|
64
|
+
* @memberof InviteClass
|
|
65
|
+
*/
|
|
66
|
+
'ern': string;
|
|
61
67
|
/**
|
|
62
68
|
* Organization associated with the user
|
|
63
69
|
* @type {OrganizationClass}
|
|
@@ -46,7 +46,8 @@ export const UpdateCustomSchemaRequestDtoEntityEnum = {
|
|
|
46
46
|
Claim: 'claim',
|
|
47
47
|
Invoice: 'invoice',
|
|
48
48
|
Payment: 'payment',
|
|
49
|
-
Organization: 'organization'
|
|
49
|
+
Organization: 'organization',
|
|
50
|
+
PayoutDetails: 'payout_details'
|
|
50
51
|
} as const;
|
|
51
52
|
|
|
52
53
|
export type UpdateCustomSchemaRequestDtoEntityEnum = typeof UpdateCustomSchemaRequestDtoEntityEnum[keyof typeof UpdateCustomSchemaRequestDtoEntityEnum];
|
package/models/user-class.ts
CHANGED
|
@@ -95,6 +95,12 @@ export interface UserClass {
|
|
|
95
95
|
* @memberof UserClass
|
|
96
96
|
*/
|
|
97
97
|
'updatedAt': string;
|
|
98
|
+
/**
|
|
99
|
+
* Emil Resources Names (ERN) identifies the most specific owner of a resource.
|
|
100
|
+
* @type {string}
|
|
101
|
+
* @memberof UserClass
|
|
102
|
+
*/
|
|
103
|
+
'ern': string;
|
|
98
104
|
/**
|
|
99
105
|
* Organization associated with the user
|
|
100
106
|
* @type {OrganizationClass}
|