@thelllabs/winehaus-sdk 0.0.1 → 0.0.4
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/dist/cjs/api/api.js +97 -7
- package/dist/cjs/sdk.js +1 -1
- package/dist/esm/api/api.js +96 -6
- package/dist/esm/sdk.js +1 -1
- package/dist/types/api/api.d.ts +255 -18
- package/dist/umd/index.ts +28332 -0
- package/package.json +3 -3
- package/dist/umd/index.js +0 -2
- package/dist/umd/index.js.LICENSE.txt +0 -17
package/dist/cjs/api/api.js
CHANGED
|
@@ -85,13 +85,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
85
85
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
86
86
|
};
|
|
87
87
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
88
|
-
exports.Api = exports.HttpClient = exports.ContentType = exports.TenantUserEntityDtoStatusEnum = exports.TenantUserEntityDtoRolesEnum = exports.CreateTenantUserDtoRolesEnum = void 0;
|
|
88
|
+
exports.Api = exports.HttpClient = exports.ContentType = exports.TenantUserEntityDtoStatusEnum = exports.TenantUserEntityDtoRolesEnum = exports.OrderByEnum = exports.ListTenantUsersParamsStatusEnum = exports.ListTenantUsersParamsRolesEnum = exports.CreateTenantUserDtoRolesEnum = void 0;
|
|
89
89
|
var CreateTenantUserDtoRolesEnum;
|
|
90
90
|
(function (CreateTenantUserDtoRolesEnum) {
|
|
91
91
|
CreateTenantUserDtoRolesEnum["Operator"] = "operator";
|
|
92
92
|
CreateTenantUserDtoRolesEnum["Admin"] = "admin";
|
|
93
93
|
CreateTenantUserDtoRolesEnum["Owner"] = "owner";
|
|
94
94
|
})(CreateTenantUserDtoRolesEnum = exports.CreateTenantUserDtoRolesEnum || (exports.CreateTenantUserDtoRolesEnum = {}));
|
|
95
|
+
var ListTenantUsersParamsRolesEnum;
|
|
96
|
+
(function (ListTenantUsersParamsRolesEnum) {
|
|
97
|
+
ListTenantUsersParamsRolesEnum["Operator"] = "operator";
|
|
98
|
+
ListTenantUsersParamsRolesEnum["Admin"] = "admin";
|
|
99
|
+
ListTenantUsersParamsRolesEnum["Owner"] = "owner";
|
|
100
|
+
})(ListTenantUsersParamsRolesEnum = exports.ListTenantUsersParamsRolesEnum || (exports.ListTenantUsersParamsRolesEnum = {}));
|
|
101
|
+
var ListTenantUsersParamsStatusEnum;
|
|
102
|
+
(function (ListTenantUsersParamsStatusEnum) {
|
|
103
|
+
ListTenantUsersParamsStatusEnum["Enabled"] = "enabled";
|
|
104
|
+
ListTenantUsersParamsStatusEnum["Blocked"] = "blocked";
|
|
105
|
+
})(ListTenantUsersParamsStatusEnum = exports.ListTenantUsersParamsStatusEnum || (exports.ListTenantUsersParamsStatusEnum = {}));
|
|
106
|
+
var OrderByEnum;
|
|
107
|
+
(function (OrderByEnum) {
|
|
108
|
+
OrderByEnum["ASC"] = "ASC";
|
|
109
|
+
OrderByEnum["DESC"] = "DESC";
|
|
110
|
+
})(OrderByEnum = exports.OrderByEnum || (exports.OrderByEnum = {}));
|
|
95
111
|
var TenantUserEntityDtoRolesEnum;
|
|
96
112
|
(function (TenantUserEntityDtoRolesEnum) {
|
|
97
113
|
TenantUserEntityDtoRolesEnum["Operator"] = "operator";
|
|
@@ -152,7 +168,9 @@ var HttpClient = /** @class */ (function () {
|
|
|
152
168
|
typeof body !== "string") {
|
|
153
169
|
body = JSON.stringify(body);
|
|
154
170
|
}
|
|
155
|
-
return [2 /*return*/, this.instance
|
|
171
|
+
return [2 /*return*/, this.instance
|
|
172
|
+
.request(__assign(__assign({}, requestParams), { headers: __assign(__assign({}, (requestParams.headers || {})), (type ? { "Content-Type": type } : {})), params: query, responseType: responseFormat, data: body, url: path }))
|
|
173
|
+
.then(function (response) { return response.data; })];
|
|
156
174
|
}
|
|
157
175
|
});
|
|
158
176
|
}); };
|
|
@@ -270,21 +288,93 @@ var Api = /** @class */ (function (_super) {
|
|
|
270
288
|
return _this.request(__assign({ path: "/auth/signin", method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
|
|
271
289
|
},
|
|
272
290
|
};
|
|
291
|
+
_this.users = {
|
|
292
|
+
/**
|
|
293
|
+
* No description
|
|
294
|
+
*
|
|
295
|
+
* @tags Users
|
|
296
|
+
* @name UpdateUserPassword
|
|
297
|
+
* @request PATCH:/users/{userId}/password
|
|
298
|
+
* @secure
|
|
299
|
+
* @response `200` `UserEntityDto`
|
|
300
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
301
|
+
*/
|
|
302
|
+
updateUserPassword: function (userId, data, params) {
|
|
303
|
+
if (params === void 0) { params = {}; }
|
|
304
|
+
return _this.request(__assign({ path: "/users/".concat(userId, "/password"), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
|
|
305
|
+
},
|
|
306
|
+
/**
|
|
307
|
+
* No description
|
|
308
|
+
*
|
|
309
|
+
* @tags Users
|
|
310
|
+
* @name UpdateUserProfile
|
|
311
|
+
* @request PATCH:/users/{userId}
|
|
312
|
+
* @secure
|
|
313
|
+
* @response `200` `UserEntityDto`
|
|
314
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
315
|
+
*/
|
|
316
|
+
updateUserProfile: function (userId, data, params) {
|
|
317
|
+
if (params === void 0) { params = {}; }
|
|
318
|
+
return _this.request(__assign({ path: "/users/".concat(userId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
|
|
319
|
+
},
|
|
320
|
+
};
|
|
273
321
|
_this.admin = {
|
|
274
322
|
/**
|
|
275
|
-
* @description Gives some user access to the tenant. If there's no account attached to this users, it creates a new one
|
|
323
|
+
* @description Gives some user access to the tenant. If there's no user account attached to this users, it creates a new one
|
|
276
324
|
*
|
|
277
|
-
* @tags Admin Users
|
|
278
|
-
* @name
|
|
325
|
+
* @tags Admin Tenant Users
|
|
326
|
+
* @name CreateOrUpdateTenantUserAndPermissionsByUserEmail
|
|
279
327
|
* @request POST:/admin/tenants/{tenantId}/users
|
|
280
328
|
* @secure
|
|
281
|
-
* @response `
|
|
329
|
+
* @response `200` `TenantUserEntityDto`
|
|
282
330
|
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
283
331
|
*/
|
|
284
|
-
|
|
332
|
+
createOrUpdateTenantUserAndPermissionsByUserEmail: function (tenantId, data, params) {
|
|
285
333
|
if (params === void 0) { params = {}; }
|
|
286
334
|
return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/users"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
|
|
287
335
|
},
|
|
336
|
+
/**
|
|
337
|
+
* No description
|
|
338
|
+
*
|
|
339
|
+
* @tags Admin Tenant Users
|
|
340
|
+
* @name DisableTenantUser
|
|
341
|
+
* @request PATCH:/admin/tenants/{tenantId}/users/{userId}/disable
|
|
342
|
+
* @secure
|
|
343
|
+
* @response `204` `void`
|
|
344
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
345
|
+
*/
|
|
346
|
+
disableTenantUser: function (tenantId, userId, params) {
|
|
347
|
+
if (params === void 0) { params = {}; }
|
|
348
|
+
return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/users/").concat(userId, "/disable"), method: "PATCH", secure: true }, params));
|
|
349
|
+
},
|
|
350
|
+
/**
|
|
351
|
+
* No description
|
|
352
|
+
*
|
|
353
|
+
* @tags Admin Tenant Users
|
|
354
|
+
* @name EnableTenantUser
|
|
355
|
+
* @request PATCH:/admin/tenants/{tenantId}/users/{userId}/enable
|
|
356
|
+
* @secure
|
|
357
|
+
* @response `204` `void`
|
|
358
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
359
|
+
*/
|
|
360
|
+
enableTenantUser: function (tenantId, userId, params) {
|
|
361
|
+
if (params === void 0) { params = {}; }
|
|
362
|
+
return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/users/").concat(userId, "/enable"), method: "PATCH", secure: true }, params));
|
|
363
|
+
},
|
|
364
|
+
/**
|
|
365
|
+
* No description
|
|
366
|
+
*
|
|
367
|
+
* @tags Admin Tenant Users
|
|
368
|
+
* @name ListTenantUsers
|
|
369
|
+
* @request GET:/admin/tenants/{tenantId}/users
|
|
370
|
+
* @secure
|
|
371
|
+
* @response `200` `TenantUserEntityPaginationDto`
|
|
372
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
373
|
+
*/
|
|
374
|
+
listTenantUsers: function (tenantId, query, params) {
|
|
375
|
+
if (params === void 0) { params = {}; }
|
|
376
|
+
return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/users"), method: "GET", query: query, secure: true, format: "json" }, params));
|
|
377
|
+
},
|
|
288
378
|
};
|
|
289
379
|
return _this;
|
|
290
380
|
}
|
package/dist/cjs/sdk.js
CHANGED
|
@@ -299,7 +299,7 @@ var WinehausSDK = /** @class */ (function () {
|
|
|
299
299
|
switch (_a.label) {
|
|
300
300
|
case 0: return [4 /*yield*/, this.api.auth.signIn(credential)];
|
|
301
301
|
case 1:
|
|
302
|
-
data =
|
|
302
|
+
data = _a.sent();
|
|
303
303
|
if (!data.token) {
|
|
304
304
|
throw new Error('Authentication failed. Please check your credentials.');
|
|
305
305
|
}
|
package/dist/esm/api/api.js
CHANGED
|
@@ -86,6 +86,22 @@ export var CreateTenantUserDtoRolesEnum;
|
|
|
86
86
|
CreateTenantUserDtoRolesEnum["Admin"] = "admin";
|
|
87
87
|
CreateTenantUserDtoRolesEnum["Owner"] = "owner";
|
|
88
88
|
})(CreateTenantUserDtoRolesEnum || (CreateTenantUserDtoRolesEnum = {}));
|
|
89
|
+
export var ListTenantUsersParamsRolesEnum;
|
|
90
|
+
(function (ListTenantUsersParamsRolesEnum) {
|
|
91
|
+
ListTenantUsersParamsRolesEnum["Operator"] = "operator";
|
|
92
|
+
ListTenantUsersParamsRolesEnum["Admin"] = "admin";
|
|
93
|
+
ListTenantUsersParamsRolesEnum["Owner"] = "owner";
|
|
94
|
+
})(ListTenantUsersParamsRolesEnum || (ListTenantUsersParamsRolesEnum = {}));
|
|
95
|
+
export var ListTenantUsersParamsStatusEnum;
|
|
96
|
+
(function (ListTenantUsersParamsStatusEnum) {
|
|
97
|
+
ListTenantUsersParamsStatusEnum["Enabled"] = "enabled";
|
|
98
|
+
ListTenantUsersParamsStatusEnum["Blocked"] = "blocked";
|
|
99
|
+
})(ListTenantUsersParamsStatusEnum || (ListTenantUsersParamsStatusEnum = {}));
|
|
100
|
+
export var OrderByEnum;
|
|
101
|
+
(function (OrderByEnum) {
|
|
102
|
+
OrderByEnum["ASC"] = "ASC";
|
|
103
|
+
OrderByEnum["DESC"] = "DESC";
|
|
104
|
+
})(OrderByEnum || (OrderByEnum = {}));
|
|
89
105
|
export var TenantUserEntityDtoRolesEnum;
|
|
90
106
|
(function (TenantUserEntityDtoRolesEnum) {
|
|
91
107
|
TenantUserEntityDtoRolesEnum["Operator"] = "operator";
|
|
@@ -146,7 +162,9 @@ var HttpClient = /** @class */ (function () {
|
|
|
146
162
|
typeof body !== "string") {
|
|
147
163
|
body = JSON.stringify(body);
|
|
148
164
|
}
|
|
149
|
-
return [2 /*return*/, this.instance
|
|
165
|
+
return [2 /*return*/, this.instance
|
|
166
|
+
.request(__assign(__assign({}, requestParams), { headers: __assign(__assign({}, (requestParams.headers || {})), (type ? { "Content-Type": type } : {})), params: query, responseType: responseFormat, data: body, url: path }))
|
|
167
|
+
.then(function (response) { return response.data; })];
|
|
150
168
|
}
|
|
151
169
|
});
|
|
152
170
|
}); };
|
|
@@ -264,21 +282,93 @@ var Api = /** @class */ (function (_super) {
|
|
|
264
282
|
return _this.request(__assign({ path: "/auth/signin", method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
|
|
265
283
|
},
|
|
266
284
|
};
|
|
285
|
+
_this.users = {
|
|
286
|
+
/**
|
|
287
|
+
* No description
|
|
288
|
+
*
|
|
289
|
+
* @tags Users
|
|
290
|
+
* @name UpdateUserPassword
|
|
291
|
+
* @request PATCH:/users/{userId}/password
|
|
292
|
+
* @secure
|
|
293
|
+
* @response `200` `UserEntityDto`
|
|
294
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
295
|
+
*/
|
|
296
|
+
updateUserPassword: function (userId, data, params) {
|
|
297
|
+
if (params === void 0) { params = {}; }
|
|
298
|
+
return _this.request(__assign({ path: "/users/".concat(userId, "/password"), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
|
|
299
|
+
},
|
|
300
|
+
/**
|
|
301
|
+
* No description
|
|
302
|
+
*
|
|
303
|
+
* @tags Users
|
|
304
|
+
* @name UpdateUserProfile
|
|
305
|
+
* @request PATCH:/users/{userId}
|
|
306
|
+
* @secure
|
|
307
|
+
* @response `200` `UserEntityDto`
|
|
308
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
309
|
+
*/
|
|
310
|
+
updateUserProfile: function (userId, data, params) {
|
|
311
|
+
if (params === void 0) { params = {}; }
|
|
312
|
+
return _this.request(__assign({ path: "/users/".concat(userId), method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
|
|
313
|
+
},
|
|
314
|
+
};
|
|
267
315
|
_this.admin = {
|
|
268
316
|
/**
|
|
269
|
-
* @description Gives some user access to the tenant. If there's no account attached to this users, it creates a new one
|
|
317
|
+
* @description Gives some user access to the tenant. If there's no user account attached to this users, it creates a new one
|
|
270
318
|
*
|
|
271
|
-
* @tags Admin Users
|
|
272
|
-
* @name
|
|
319
|
+
* @tags Admin Tenant Users
|
|
320
|
+
* @name CreateOrUpdateTenantUserAndPermissionsByUserEmail
|
|
273
321
|
* @request POST:/admin/tenants/{tenantId}/users
|
|
274
322
|
* @secure
|
|
275
|
-
* @response `
|
|
323
|
+
* @response `200` `TenantUserEntityDto`
|
|
276
324
|
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
277
325
|
*/
|
|
278
|
-
|
|
326
|
+
createOrUpdateTenantUserAndPermissionsByUserEmail: function (tenantId, data, params) {
|
|
279
327
|
if (params === void 0) { params = {}; }
|
|
280
328
|
return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/users"), method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
|
|
281
329
|
},
|
|
330
|
+
/**
|
|
331
|
+
* No description
|
|
332
|
+
*
|
|
333
|
+
* @tags Admin Tenant Users
|
|
334
|
+
* @name DisableTenantUser
|
|
335
|
+
* @request PATCH:/admin/tenants/{tenantId}/users/{userId}/disable
|
|
336
|
+
* @secure
|
|
337
|
+
* @response `204` `void`
|
|
338
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
339
|
+
*/
|
|
340
|
+
disableTenantUser: function (tenantId, userId, params) {
|
|
341
|
+
if (params === void 0) { params = {}; }
|
|
342
|
+
return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/users/").concat(userId, "/disable"), method: "PATCH", secure: true }, params));
|
|
343
|
+
},
|
|
344
|
+
/**
|
|
345
|
+
* No description
|
|
346
|
+
*
|
|
347
|
+
* @tags Admin Tenant Users
|
|
348
|
+
* @name EnableTenantUser
|
|
349
|
+
* @request PATCH:/admin/tenants/{tenantId}/users/{userId}/enable
|
|
350
|
+
* @secure
|
|
351
|
+
* @response `204` `void`
|
|
352
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
353
|
+
*/
|
|
354
|
+
enableTenantUser: function (tenantId, userId, params) {
|
|
355
|
+
if (params === void 0) { params = {}; }
|
|
356
|
+
return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/users/").concat(userId, "/enable"), method: "PATCH", secure: true }, params));
|
|
357
|
+
},
|
|
358
|
+
/**
|
|
359
|
+
* No description
|
|
360
|
+
*
|
|
361
|
+
* @tags Admin Tenant Users
|
|
362
|
+
* @name ListTenantUsers
|
|
363
|
+
* @request GET:/admin/tenants/{tenantId}/users
|
|
364
|
+
* @secure
|
|
365
|
+
* @response `200` `TenantUserEntityPaginationDto`
|
|
366
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
367
|
+
*/
|
|
368
|
+
listTenantUsers: function (tenantId, query, params) {
|
|
369
|
+
if (params === void 0) { params = {}; }
|
|
370
|
+
return _this.request(__assign({ path: "/admin/tenants/".concat(tenantId, "/users"), method: "GET", query: query, secure: true, format: "json" }, params));
|
|
371
|
+
},
|
|
282
372
|
};
|
|
283
373
|
return _this;
|
|
284
374
|
}
|
package/dist/esm/sdk.js
CHANGED
|
@@ -270,7 +270,7 @@ var WinehausSDK = /** @class */ (function () {
|
|
|
270
270
|
switch (_a.label) {
|
|
271
271
|
case 0: return [4 /*yield*/, this.api.auth.signIn(credential)];
|
|
272
272
|
case 1:
|
|
273
|
-
data =
|
|
273
|
+
data = _a.sent();
|
|
274
274
|
if (!data.token) {
|
|
275
275
|
throw new Error('Authentication failed. Please check your credentials.');
|
|
276
276
|
}
|
package/dist/types/api/api.d.ts
CHANGED
|
@@ -27,6 +27,41 @@ export interface HttpExceptionDto {
|
|
|
27
27
|
/** @example "2022-07-25T17:24:07.042Z" */
|
|
28
28
|
timestamp: string;
|
|
29
29
|
}
|
|
30
|
+
export declare enum ListTenantUsersParamsRolesEnum {
|
|
31
|
+
Operator = "operator",
|
|
32
|
+
Admin = "admin",
|
|
33
|
+
Owner = "owner"
|
|
34
|
+
}
|
|
35
|
+
export declare enum ListTenantUsersParamsStatusEnum {
|
|
36
|
+
Enabled = "enabled",
|
|
37
|
+
Blocked = "blocked"
|
|
38
|
+
}
|
|
39
|
+
export declare enum OrderByEnum {
|
|
40
|
+
ASC = "ASC",
|
|
41
|
+
DESC = "DESC"
|
|
42
|
+
}
|
|
43
|
+
export interface PaginationLinksDto {
|
|
44
|
+
/** @example "http://example.com?page=1" */
|
|
45
|
+
first?: string;
|
|
46
|
+
/** @example "http://example.com?page=3" */
|
|
47
|
+
last?: string;
|
|
48
|
+
/** @example "http://example.com?page=2" */
|
|
49
|
+
next?: string;
|
|
50
|
+
/** @example "http://example.com?page=1" */
|
|
51
|
+
prev?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface PaginationMetaDto {
|
|
54
|
+
/** @example 1 */
|
|
55
|
+
currentPage: number;
|
|
56
|
+
/** @example 1 */
|
|
57
|
+
itemCount: number;
|
|
58
|
+
/** @example 1 */
|
|
59
|
+
itemsPerPage: number;
|
|
60
|
+
/** @example 1 */
|
|
61
|
+
totalItems?: number;
|
|
62
|
+
/** @example 1 */
|
|
63
|
+
totalPages?: number;
|
|
64
|
+
}
|
|
30
65
|
export interface RequestPasswordResetDto {
|
|
31
66
|
email: string;
|
|
32
67
|
}
|
|
@@ -72,6 +107,25 @@ export declare enum TenantUserEntityDtoStatusEnum {
|
|
|
72
107
|
Enabled = "enabled",
|
|
73
108
|
Blocked = "blocked"
|
|
74
109
|
}
|
|
110
|
+
export interface TenantUserEntityPaginationDto {
|
|
111
|
+
items: TenantUserEntityDto[];
|
|
112
|
+
links?: PaginationLinksDto;
|
|
113
|
+
meta: PaginationMetaDto;
|
|
114
|
+
}
|
|
115
|
+
export interface UpdateUserPasswordDto {
|
|
116
|
+
/** @example "P@ssw0rd" */
|
|
117
|
+
currentPassword: string;
|
|
118
|
+
/**
|
|
119
|
+
* Password should include lowercase, uppercase and digits and have between 8 and 32 digits
|
|
120
|
+
* @example "P@ssw0rd"
|
|
121
|
+
*/
|
|
122
|
+
password: string;
|
|
123
|
+
/** @example "P@ssw0rd" */
|
|
124
|
+
passwordConfirmation: string;
|
|
125
|
+
}
|
|
126
|
+
export interface UpdateUserProfileDto {
|
|
127
|
+
name: string;
|
|
128
|
+
}
|
|
75
129
|
export interface UserEntityDto {
|
|
76
130
|
/** @format date-time */
|
|
77
131
|
createdAt?: string;
|
|
@@ -80,7 +134,7 @@ export interface UserEntityDto {
|
|
|
80
134
|
email: string;
|
|
81
135
|
/** @format uuid */
|
|
82
136
|
id: string;
|
|
83
|
-
name
|
|
137
|
+
name?: string | null;
|
|
84
138
|
/** @format date-time */
|
|
85
139
|
updatedAt: string;
|
|
86
140
|
}
|
|
@@ -146,17 +200,55 @@ export declare namespace Auth {
|
|
|
146
200
|
type ResponseBody = SigninResponseDto;
|
|
147
201
|
}
|
|
148
202
|
}
|
|
203
|
+
export declare namespace Users {
|
|
204
|
+
/**
|
|
205
|
+
* No description
|
|
206
|
+
* @tags Users
|
|
207
|
+
* @name UpdateUserPassword
|
|
208
|
+
* @request PATCH:/users/{userId}/password
|
|
209
|
+
* @secure
|
|
210
|
+
* @response `200` `UserEntityDto`
|
|
211
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
212
|
+
*/
|
|
213
|
+
namespace UpdateUserPassword {
|
|
214
|
+
type RequestParams = {
|
|
215
|
+
userId: string;
|
|
216
|
+
};
|
|
217
|
+
type RequestQuery = {};
|
|
218
|
+
type RequestBody = UpdateUserPasswordDto;
|
|
219
|
+
type RequestHeaders = {};
|
|
220
|
+
type ResponseBody = UserEntityDto;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* No description
|
|
224
|
+
* @tags Users
|
|
225
|
+
* @name UpdateUserProfile
|
|
226
|
+
* @request PATCH:/users/{userId}
|
|
227
|
+
* @secure
|
|
228
|
+
* @response `200` `UserEntityDto`
|
|
229
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
230
|
+
*/
|
|
231
|
+
namespace UpdateUserProfile {
|
|
232
|
+
type RequestParams = {
|
|
233
|
+
userId: string;
|
|
234
|
+
};
|
|
235
|
+
type RequestQuery = {};
|
|
236
|
+
type RequestBody = UpdateUserProfileDto;
|
|
237
|
+
type RequestHeaders = {};
|
|
238
|
+
type ResponseBody = UserEntityDto;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
149
241
|
export declare namespace Admin {
|
|
150
242
|
/**
|
|
151
|
-
* @description Gives some user access to the tenant. If there's no account attached to this users, it creates a new one
|
|
152
|
-
* @tags Admin Users
|
|
153
|
-
* @name
|
|
243
|
+
* @description Gives some user access to the tenant. If there's no user account attached to this users, it creates a new one
|
|
244
|
+
* @tags Admin Tenant Users
|
|
245
|
+
* @name CreateOrUpdateTenantUserAndPermissionsByUserEmail
|
|
154
246
|
* @request POST:/admin/tenants/{tenantId}/users
|
|
155
247
|
* @secure
|
|
156
|
-
* @response `
|
|
248
|
+
* @response `200` `TenantUserEntityDto`
|
|
157
249
|
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
158
250
|
*/
|
|
159
|
-
namespace
|
|
251
|
+
namespace CreateOrUpdateTenantUserAndPermissionsByUserEmail {
|
|
160
252
|
type RequestParams = {
|
|
161
253
|
tenantId: string;
|
|
162
254
|
};
|
|
@@ -165,8 +257,80 @@ export declare namespace Admin {
|
|
|
165
257
|
type RequestHeaders = {};
|
|
166
258
|
type ResponseBody = TenantUserEntityDto;
|
|
167
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* No description
|
|
262
|
+
* @tags Admin Tenant Users
|
|
263
|
+
* @name DisableTenantUser
|
|
264
|
+
* @request PATCH:/admin/tenants/{tenantId}/users/{userId}/disable
|
|
265
|
+
* @secure
|
|
266
|
+
* @response `204` `void`
|
|
267
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
268
|
+
*/
|
|
269
|
+
namespace DisableTenantUser {
|
|
270
|
+
type RequestParams = {
|
|
271
|
+
tenantId: string;
|
|
272
|
+
userId: string;
|
|
273
|
+
};
|
|
274
|
+
type RequestQuery = {};
|
|
275
|
+
type RequestBody = never;
|
|
276
|
+
type RequestHeaders = {};
|
|
277
|
+
type ResponseBody = void;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* No description
|
|
281
|
+
* @tags Admin Tenant Users
|
|
282
|
+
* @name EnableTenantUser
|
|
283
|
+
* @request PATCH:/admin/tenants/{tenantId}/users/{userId}/enable
|
|
284
|
+
* @secure
|
|
285
|
+
* @response `204` `void`
|
|
286
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
287
|
+
*/
|
|
288
|
+
namespace EnableTenantUser {
|
|
289
|
+
type RequestParams = {
|
|
290
|
+
tenantId: string;
|
|
291
|
+
userId: string;
|
|
292
|
+
};
|
|
293
|
+
type RequestQuery = {};
|
|
294
|
+
type RequestBody = never;
|
|
295
|
+
type RequestHeaders = {};
|
|
296
|
+
type ResponseBody = void;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* No description
|
|
300
|
+
* @tags Admin Tenant Users
|
|
301
|
+
* @name ListTenantUsers
|
|
302
|
+
* @request GET:/admin/tenants/{tenantId}/users
|
|
303
|
+
* @secure
|
|
304
|
+
* @response `200` `TenantUserEntityPaginationDto`
|
|
305
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
306
|
+
*/
|
|
307
|
+
namespace ListTenantUsers {
|
|
308
|
+
type RequestParams = {
|
|
309
|
+
tenantId: string;
|
|
310
|
+
};
|
|
311
|
+
type RequestQuery = {
|
|
312
|
+
/**
|
|
313
|
+
* @default 10
|
|
314
|
+
* @example 10
|
|
315
|
+
*/
|
|
316
|
+
limit?: number;
|
|
317
|
+
orderBy?: OrderByEnum;
|
|
318
|
+
/**
|
|
319
|
+
* @default 1
|
|
320
|
+
* @example 1
|
|
321
|
+
*/
|
|
322
|
+
page?: number;
|
|
323
|
+
roles?: ListTenantUsersParamsRolesEnum[];
|
|
324
|
+
search?: string;
|
|
325
|
+
sortBy?: string[];
|
|
326
|
+
status?: ListTenantUsersParamsStatusEnum[];
|
|
327
|
+
};
|
|
328
|
+
type RequestBody = never;
|
|
329
|
+
type RequestHeaders = {};
|
|
330
|
+
type ResponseBody = TenantUserEntityPaginationDto;
|
|
331
|
+
}
|
|
168
332
|
}
|
|
169
|
-
import type { AxiosInstance, AxiosRequestConfig,
|
|
333
|
+
import type { AxiosInstance, AxiosRequestConfig, ResponseType } from "axios";
|
|
170
334
|
export type QueryParamsType = Record<string | number, any>;
|
|
171
335
|
export interface FullRequestParams extends Omit<AxiosRequestConfig, "data" | "params" | "url" | "responseType"> {
|
|
172
336
|
/** set parameter to `true` for call `securityWorker` for this request */
|
|
@@ -206,7 +370,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
206
370
|
protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
|
|
207
371
|
protected stringifyFormItem(formItem: unknown): string;
|
|
208
372
|
protected createFormData(input: Record<string, unknown>): FormData;
|
|
209
|
-
request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<
|
|
373
|
+
request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<T>;
|
|
210
374
|
}
|
|
211
375
|
/**
|
|
212
376
|
* @title winehaus-api
|
|
@@ -223,7 +387,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
223
387
|
* @request GET:/
|
|
224
388
|
* @response `200` `void`
|
|
225
389
|
*/
|
|
226
|
-
index: (params?: RequestParams) => Promise<
|
|
390
|
+
index: (params?: RequestParams) => Promise<void>;
|
|
227
391
|
auth: {
|
|
228
392
|
/**
|
|
229
393
|
* No description
|
|
@@ -234,7 +398,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
234
398
|
* @secure
|
|
235
399
|
* @response `204` `void`
|
|
236
400
|
*/
|
|
237
|
-
logout: (params?: RequestParams) => Promise<
|
|
401
|
+
logout: (params?: RequestParams) => Promise<void>;
|
|
238
402
|
/**
|
|
239
403
|
* No description
|
|
240
404
|
*
|
|
@@ -244,7 +408,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
244
408
|
* @secure
|
|
245
409
|
* @response `204` `void`
|
|
246
410
|
*/
|
|
247
|
-
requestPasswordReset: (data: RequestPasswordResetDto, params?: RequestParams) => Promise<
|
|
411
|
+
requestPasswordReset: (data: RequestPasswordResetDto, params?: RequestParams) => Promise<void>;
|
|
248
412
|
/**
|
|
249
413
|
* No description
|
|
250
414
|
*
|
|
@@ -254,7 +418,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
254
418
|
* @secure
|
|
255
419
|
* @response `200` `SigninResponseDto`
|
|
256
420
|
*/
|
|
257
|
-
resetPassword: (data: ResetPasswordDto, params?: RequestParams) => Promise<
|
|
421
|
+
resetPassword: (data: ResetPasswordDto, params?: RequestParams) => Promise<SigninResponseDto>;
|
|
258
422
|
/**
|
|
259
423
|
* No description
|
|
260
424
|
*
|
|
@@ -264,19 +428,92 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
264
428
|
* @secure
|
|
265
429
|
* @response `200` `SigninResponseDto`
|
|
266
430
|
*/
|
|
267
|
-
signIn: (data: SigninDto, params?: RequestParams) => Promise<
|
|
431
|
+
signIn: (data: SigninDto, params?: RequestParams) => Promise<SigninResponseDto>;
|
|
432
|
+
};
|
|
433
|
+
users: {
|
|
434
|
+
/**
|
|
435
|
+
* No description
|
|
436
|
+
*
|
|
437
|
+
* @tags Users
|
|
438
|
+
* @name UpdateUserPassword
|
|
439
|
+
* @request PATCH:/users/{userId}/password
|
|
440
|
+
* @secure
|
|
441
|
+
* @response `200` `UserEntityDto`
|
|
442
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
443
|
+
*/
|
|
444
|
+
updateUserPassword: (userId: string, data: UpdateUserPasswordDto, params?: RequestParams) => Promise<UserEntityDto>;
|
|
445
|
+
/**
|
|
446
|
+
* No description
|
|
447
|
+
*
|
|
448
|
+
* @tags Users
|
|
449
|
+
* @name UpdateUserProfile
|
|
450
|
+
* @request PATCH:/users/{userId}
|
|
451
|
+
* @secure
|
|
452
|
+
* @response `200` `UserEntityDto`
|
|
453
|
+
* @response `403` `HttpExceptionDto` You're not enabled to make this operation.
|
|
454
|
+
*/
|
|
455
|
+
updateUserProfile: (userId: string, data: UpdateUserProfileDto, params?: RequestParams) => Promise<UserEntityDto>;
|
|
268
456
|
};
|
|
269
457
|
admin: {
|
|
270
458
|
/**
|
|
271
|
-
* @description Gives some user access to the tenant. If there's no account attached to this users, it creates a new one
|
|
459
|
+
* @description Gives some user access to the tenant. If there's no user account attached to this users, it creates a new one
|
|
272
460
|
*
|
|
273
|
-
* @tags Admin Users
|
|
274
|
-
* @name
|
|
461
|
+
* @tags Admin Tenant Users
|
|
462
|
+
* @name CreateOrUpdateTenantUserAndPermissionsByUserEmail
|
|
275
463
|
* @request POST:/admin/tenants/{tenantId}/users
|
|
276
464
|
* @secure
|
|
277
|
-
* @response `
|
|
465
|
+
* @response `200` `TenantUserEntityDto`
|
|
466
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
467
|
+
*/
|
|
468
|
+
createOrUpdateTenantUserAndPermissionsByUserEmail: (tenantId: string, data: CreateTenantUserDto, params?: RequestParams) => Promise<TenantUserEntityDto>;
|
|
469
|
+
/**
|
|
470
|
+
* No description
|
|
471
|
+
*
|
|
472
|
+
* @tags Admin Tenant Users
|
|
473
|
+
* @name DisableTenantUser
|
|
474
|
+
* @request PATCH:/admin/tenants/{tenantId}/users/{userId}/disable
|
|
475
|
+
* @secure
|
|
476
|
+
* @response `204` `void`
|
|
477
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
478
|
+
*/
|
|
479
|
+
disableTenantUser: (tenantId: string, userId: string, params?: RequestParams) => Promise<void>;
|
|
480
|
+
/**
|
|
481
|
+
* No description
|
|
482
|
+
*
|
|
483
|
+
* @tags Admin Tenant Users
|
|
484
|
+
* @name EnableTenantUser
|
|
485
|
+
* @request PATCH:/admin/tenants/{tenantId}/users/{userId}/enable
|
|
486
|
+
* @secure
|
|
487
|
+
* @response `204` `void`
|
|
488
|
+
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
489
|
+
*/
|
|
490
|
+
enableTenantUser: (tenantId: string, userId: string, params?: RequestParams) => Promise<void>;
|
|
491
|
+
/**
|
|
492
|
+
* No description
|
|
493
|
+
*
|
|
494
|
+
* @tags Admin Tenant Users
|
|
495
|
+
* @name ListTenantUsers
|
|
496
|
+
* @request GET:/admin/tenants/{tenantId}/users
|
|
497
|
+
* @secure
|
|
498
|
+
* @response `200` `TenantUserEntityPaginationDto`
|
|
278
499
|
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
279
500
|
*/
|
|
280
|
-
|
|
501
|
+
listTenantUsers: (tenantId: string, query?: {
|
|
502
|
+
/**
|
|
503
|
+
* @default 10
|
|
504
|
+
* @example 10
|
|
505
|
+
*/
|
|
506
|
+
limit?: number;
|
|
507
|
+
orderBy?: OrderByEnum;
|
|
508
|
+
/**
|
|
509
|
+
* @default 1
|
|
510
|
+
* @example 1
|
|
511
|
+
*/
|
|
512
|
+
page?: number;
|
|
513
|
+
roles?: ListTenantUsersParamsRolesEnum[];
|
|
514
|
+
search?: string;
|
|
515
|
+
sortBy?: string[];
|
|
516
|
+
status?: ListTenantUsersParamsStatusEnum[];
|
|
517
|
+
}, params?: RequestParams) => Promise<TenantUserEntityPaginationDto>;
|
|
281
518
|
};
|
|
282
519
|
}
|