@emilgroup/auth-sdk 1.0.0-beta.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.
Files changed (73) hide show
  1. package/.openapi-generator/FILES +29 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +51 -0
  5. package/api/authservice-api.ts +1032 -0
  6. package/api.ts +27 -0
  7. package/base.ts +248 -0
  8. package/common.ts +198 -0
  9. package/configuration.ts +101 -0
  10. package/dist/api/authservice-api.d.ts +566 -0
  11. package/dist/api/authservice-api.js +987 -0
  12. package/dist/api.d.ts +12 -0
  13. package/dist/api.js +30 -0
  14. package/dist/base.d.ts +73 -0
  15. package/dist/base.js +294 -0
  16. package/dist/common.d.ts +91 -0
  17. package/dist/common.js +276 -0
  18. package/dist/configuration.d.ts +83 -0
  19. package/dist/configuration.js +44 -0
  20. package/dist/index.d.ts +15 -0
  21. package/dist/index.js +36 -0
  22. package/dist/models/create-org-and-user-request-dto.d.ts +78 -0
  23. package/dist/models/create-org-and-user-request-dto.js +15 -0
  24. package/dist/models/create-org-and-user-response-class.d.ts +32 -0
  25. package/dist/models/create-org-and-user-response-class.js +15 -0
  26. package/dist/models/create-user-request-dto.d.ts +54 -0
  27. package/dist/models/create-user-request-dto.js +15 -0
  28. package/dist/models/create-user-response-class.d.ts +25 -0
  29. package/dist/models/create-user-response-class.js +15 -0
  30. package/dist/models/forgot-password-request-dto.d.ts +24 -0
  31. package/dist/models/forgot-password-request-dto.js +15 -0
  32. package/dist/models/get-samllogin-link-request-dto.d.ts +24 -0
  33. package/dist/models/get-samllogin-link-request-dto.js +15 -0
  34. package/dist/models/index.d.ts +15 -0
  35. package/dist/models/index.js +31 -0
  36. package/dist/models/login-by-samlrequest-dto.d.ts +30 -0
  37. package/dist/models/login-by-samlrequest-dto.js +15 -0
  38. package/dist/models/login-class.d.ts +30 -0
  39. package/dist/models/login-class.js +15 -0
  40. package/dist/models/login-request-dto.d.ts +30 -0
  41. package/dist/models/login-request-dto.js +15 -0
  42. package/dist/models/logout-request-dto.d.ts +24 -0
  43. package/dist/models/logout-request-dto.js +15 -0
  44. package/dist/models/organization-class.d.ts +102 -0
  45. package/dist/models/organization-class.js +15 -0
  46. package/dist/models/refresh-token-dto.d.ts +24 -0
  47. package/dist/models/refresh-token-dto.js +15 -0
  48. package/dist/models/reset-password-request-dto.d.ts +36 -0
  49. package/dist/models/reset-password-request-dto.js +15 -0
  50. package/dist/models/role-class.d.ts +54 -0
  51. package/dist/models/role-class.js +15 -0
  52. package/dist/models/user-class.d.ts +85 -0
  53. package/dist/models/user-class.js +15 -0
  54. package/git_push.sh +57 -0
  55. package/index.ts +19 -0
  56. package/models/create-org-and-user-request-dto.ts +84 -0
  57. package/models/create-org-and-user-response-class.ts +38 -0
  58. package/models/create-user-request-dto.ts +60 -0
  59. package/models/create-user-response-class.ts +31 -0
  60. package/models/forgot-password-request-dto.ts +30 -0
  61. package/models/get-samllogin-link-request-dto.ts +30 -0
  62. package/models/index.ts +15 -0
  63. package/models/login-by-samlrequest-dto.ts +36 -0
  64. package/models/login-class.ts +36 -0
  65. package/models/login-request-dto.ts +36 -0
  66. package/models/logout-request-dto.ts +30 -0
  67. package/models/organization-class.ts +108 -0
  68. package/models/refresh-token-dto.ts +30 -0
  69. package/models/reset-password-request-dto.ts +42 -0
  70. package/models/role-class.ts +60 -0
  71. package/models/user-class.ts +91 -0
  72. package/package.json +26 -0
  73. package/tsconfig.json +22 -0
@@ -0,0 +1,987 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * EMIL AuthService
6
+ * The EMIL AuthService API description
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __assign = (this && this.__assign) || function () {
31
+ __assign = Object.assign || function(t) {
32
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
33
+ s = arguments[i];
34
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
+ t[p] = s[p];
36
+ }
37
+ return t;
38
+ };
39
+ return __assign.apply(this, arguments);
40
+ };
41
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
+ return new (P || (P = Promise))(function (resolve, reject) {
44
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ };
50
+ var __generator = (this && this.__generator) || function (thisArg, body) {
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ };
77
+ var __importDefault = (this && this.__importDefault) || function (mod) {
78
+ return (mod && mod.__esModule) ? mod : { "default": mod };
79
+ };
80
+ Object.defineProperty(exports, "__esModule", { value: true });
81
+ exports.AuthserviceApi = exports.AuthserviceApiFactory = exports.AuthserviceApiFp = exports.AuthserviceApiAxiosParamCreator = void 0;
82
+ var axios_1 = __importDefault(require("axios"));
83
+ // Some imports not used depending on template conditions
84
+ // @ts-ignore
85
+ var common_1 = require("../common");
86
+ // @ts-ignore
87
+ var base_1 = require("../base");
88
+ /**
89
+ * AuthserviceApi - axios parameter creator
90
+ * @export
91
+ */
92
+ var AuthserviceApiAxiosParamCreator = function (configuration) {
93
+ var _this = this;
94
+ return {
95
+ /**
96
+ * Register a new organization with appropriate hierarchy and create a user for that organization.
97
+ * @summary Register Organization and User using invitation token
98
+ * @param {CreateOrgAndUserRequestDto} createOrgAndUserRequestDto
99
+ * @param {*} [options] Override http request option.
100
+ * @throws {RequiredError}
101
+ */
102
+ createOrgAndUser: function (createOrgAndUserRequestDto, options) {
103
+ if (options === void 0) { options = {}; }
104
+ return __awaiter(_this, void 0, void 0, function () {
105
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
106
+ return __generator(this, function (_a) {
107
+ // verify required parameter 'createOrgAndUserRequestDto' is not null or undefined
108
+ (0, common_1.assertParamExists)('createOrgAndUser', 'createOrgAndUserRequestDto', createOrgAndUserRequestDto);
109
+ localVarPath = "/authservice/v1/create-org-and-user";
110
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
111
+ if (configuration) {
112
+ baseOptions = configuration.baseOptions;
113
+ baseAccessToken = configuration.accessToken;
114
+ }
115
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
116
+ localVarHeaderParameter = {};
117
+ localVarQueryParameter = {};
118
+ localVarHeaderParameter['Content-Type'] = 'application/json';
119
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
120
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
121
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
122
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createOrgAndUserRequestDto, localVarRequestOptions, configuration);
123
+ return [2 /*return*/, {
124
+ url: (0, common_1.toPathString)(localVarUrlObj),
125
+ options: localVarRequestOptions,
126
+ }];
127
+ });
128
+ });
129
+ },
130
+ /**
131
+ * Register a tenant user using the invite token sent to the tenant user\'s email address.
132
+ * @summary Register tenant user after invite
133
+ * @param {CreateUserRequestDto} createUserRequestDto
134
+ * @param {*} [options] Override http request option.
135
+ * @throws {RequiredError}
136
+ */
137
+ createUser: function (createUserRequestDto, options) {
138
+ if (options === void 0) { options = {}; }
139
+ return __awaiter(_this, void 0, void 0, function () {
140
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
141
+ return __generator(this, function (_a) {
142
+ // verify required parameter 'createUserRequestDto' is not null or undefined
143
+ (0, common_1.assertParamExists)('createUser', 'createUserRequestDto', createUserRequestDto);
144
+ localVarPath = "/authservice/v1/create-user";
145
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
146
+ if (configuration) {
147
+ baseOptions = configuration.baseOptions;
148
+ baseAccessToken = configuration.accessToken;
149
+ }
150
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
151
+ localVarHeaderParameter = {};
152
+ localVarQueryParameter = {};
153
+ localVarHeaderParameter['Content-Type'] = 'application/json';
154
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
155
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
156
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
157
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createUserRequestDto, localVarRequestOptions, configuration);
158
+ return [2 /*return*/, {
159
+ url: (0, common_1.toPathString)(localVarUrlObj),
160
+ options: localVarRequestOptions,
161
+ }];
162
+ });
163
+ });
164
+ },
165
+ /**
166
+ * Send a tenant user a reset-password token via email.
167
+ * @summary Forgot password by tenant
168
+ * @param {ForgotPasswordRequestDto} forgotPasswordRequestDto
169
+ * @param {*} [options] Override http request option.
170
+ * @throws {RequiredError}
171
+ */
172
+ forgotPassword: function (forgotPasswordRequestDto, options) {
173
+ if (options === void 0) { options = {}; }
174
+ return __awaiter(_this, void 0, void 0, function () {
175
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
176
+ return __generator(this, function (_a) {
177
+ // verify required parameter 'forgotPasswordRequestDto' is not null or undefined
178
+ (0, common_1.assertParamExists)('forgotPassword', 'forgotPasswordRequestDto', forgotPasswordRequestDto);
179
+ localVarPath = "/authservice/v1/forgot-password";
180
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
181
+ if (configuration) {
182
+ baseOptions = configuration.baseOptions;
183
+ baseAccessToken = configuration.accessToken;
184
+ }
185
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
186
+ localVarHeaderParameter = {};
187
+ localVarQueryParameter = {};
188
+ localVarHeaderParameter['Content-Type'] = 'application/json';
189
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
190
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
191
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
192
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(forgotPasswordRequestDto, localVarRequestOptions, configuration);
193
+ return [2 /*return*/, {
194
+ url: (0, common_1.toPathString)(localVarUrlObj),
195
+ options: localVarRequestOptions,
196
+ }];
197
+ });
198
+ });
199
+ },
200
+ /**
201
+ * Get saml login link configured for the tenant in cognito as well as tenant settings
202
+ * @summary Get saml login link for tenant
203
+ * @param {string} tenantSlug
204
+ * @param {*} [options] Override http request option.
205
+ * @throws {RequiredError}
206
+ */
207
+ getSamlLoginLink: function (tenantSlug, options) {
208
+ if (options === void 0) { options = {}; }
209
+ return __awaiter(_this, void 0, void 0, function () {
210
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
211
+ return __generator(this, function (_a) {
212
+ // verify required parameter 'tenantSlug' is not null or undefined
213
+ (0, common_1.assertParamExists)('getSamlLoginLink', 'tenantSlug', tenantSlug);
214
+ localVarPath = "/authservice/v1/saml-login-link";
215
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
216
+ if (configuration) {
217
+ baseOptions = configuration.baseOptions;
218
+ baseAccessToken = configuration.accessToken;
219
+ }
220
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
221
+ localVarHeaderParameter = {};
222
+ localVarQueryParameter = {};
223
+ if (tenantSlug !== undefined) {
224
+ localVarQueryParameter['tenantSlug'] = tenantSlug;
225
+ }
226
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
227
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
228
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
229
+ return [2 /*return*/, {
230
+ url: (0, common_1.toPathString)(localVarUrlObj),
231
+ options: localVarRequestOptions,
232
+ }];
233
+ });
234
+ });
235
+ },
236
+ /**
237
+ * Get new access token, refresh token after successful login.
238
+ * @summary Login by tenant
239
+ * @param {LoginRequestDto} loginRequestDto
240
+ * @param {*} [options] Override http request option.
241
+ * @throws {RequiredError}
242
+ */
243
+ login: function (loginRequestDto, options) {
244
+ if (options === void 0) { options = {}; }
245
+ return __awaiter(_this, void 0, void 0, function () {
246
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
247
+ return __generator(this, function (_a) {
248
+ // verify required parameter 'loginRequestDto' is not null or undefined
249
+ (0, common_1.assertParamExists)('login', 'loginRequestDto', loginRequestDto);
250
+ localVarPath = "/authservice/v1/login";
251
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
252
+ if (configuration) {
253
+ baseOptions = configuration.baseOptions;
254
+ baseAccessToken = configuration.accessToken;
255
+ }
256
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
257
+ localVarHeaderParameter = {};
258
+ localVarQueryParameter = {};
259
+ localVarHeaderParameter['Content-Type'] = 'application/json';
260
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
261
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
262
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
263
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(loginRequestDto, localVarRequestOptions, configuration);
264
+ return [2 /*return*/, {
265
+ url: (0, common_1.toPathString)(localVarUrlObj),
266
+ options: localVarRequestOptions,
267
+ }];
268
+ });
269
+ });
270
+ },
271
+ /**
272
+ * Get new access token, refresh token after successful login. This api also creates a tenant user if user does not exist
273
+ * @summary Login by SAML idp provider such as ADFS
274
+ * @param {LoginBySAMLRequestDto} loginBySAMLRequestDto
275
+ * @param {*} [options] Override http request option.
276
+ * @throws {RequiredError}
277
+ */
278
+ loginBySAML: function (loginBySAMLRequestDto, options) {
279
+ if (options === void 0) { options = {}; }
280
+ return __awaiter(_this, void 0, void 0, function () {
281
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
282
+ return __generator(this, function (_a) {
283
+ // verify required parameter 'loginBySAMLRequestDto' is not null or undefined
284
+ (0, common_1.assertParamExists)('loginBySAML', 'loginBySAMLRequestDto', loginBySAMLRequestDto);
285
+ localVarPath = "/authservice/v1/login/saml";
286
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
287
+ if (configuration) {
288
+ baseOptions = configuration.baseOptions;
289
+ baseAccessToken = configuration.accessToken;
290
+ }
291
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
292
+ localVarHeaderParameter = {};
293
+ localVarQueryParameter = {};
294
+ localVarHeaderParameter['Content-Type'] = 'application/json';
295
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
296
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
297
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
298
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(loginBySAMLRequestDto, localVarRequestOptions, configuration);
299
+ return [2 /*return*/, {
300
+ url: (0, common_1.toPathString)(localVarUrlObj),
301
+ options: localVarRequestOptions,
302
+ }];
303
+ });
304
+ });
305
+ },
306
+ /**
307
+ * Sign tenant user out.
308
+ * @summary Logout tenant
309
+ * @param {LogoutRequestDto} logoutRequestDto
310
+ * @param {*} [options] Override http request option.
311
+ * @throws {RequiredError}
312
+ */
313
+ logout: function (logoutRequestDto, options) {
314
+ if (options === void 0) { options = {}; }
315
+ return __awaiter(_this, void 0, void 0, function () {
316
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
317
+ return __generator(this, function (_a) {
318
+ // verify required parameter 'logoutRequestDto' is not null or undefined
319
+ (0, common_1.assertParamExists)('logout', 'logoutRequestDto', logoutRequestDto);
320
+ localVarPath = "/authservice/v1/logout";
321
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
322
+ if (configuration) {
323
+ baseOptions = configuration.baseOptions;
324
+ baseAccessToken = configuration.accessToken;
325
+ }
326
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
327
+ localVarHeaderParameter = {};
328
+ localVarQueryParameter = {};
329
+ localVarHeaderParameter['Content-Type'] = 'application/json';
330
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
331
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
332
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
333
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(logoutRequestDto, localVarRequestOptions, configuration);
334
+ return [2 /*return*/, {
335
+ url: (0, common_1.toPathString)(localVarUrlObj),
336
+ options: localVarRequestOptions,
337
+ }];
338
+ });
339
+ });
340
+ },
341
+ /**
342
+ * Get new access token, new refresh token.
343
+ * @summary Refresh token by tenant
344
+ * @param {RefreshTokenDto} refreshTokenDto
345
+ * @param {string} [cookie] HTTP only cookie that was sent during login
346
+ * @param {*} [options] Override http request option.
347
+ * @throws {RequiredError}
348
+ */
349
+ refreshToken: function (refreshTokenDto, cookie, options) {
350
+ if (options === void 0) { options = {}; }
351
+ return __awaiter(_this, void 0, void 0, function () {
352
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
353
+ return __generator(this, function (_a) {
354
+ // verify required parameter 'refreshTokenDto' is not null or undefined
355
+ (0, common_1.assertParamExists)('refreshToken', 'refreshTokenDto', refreshTokenDto);
356
+ localVarPath = "/authservice/v1/refresh-token";
357
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
358
+ if (configuration) {
359
+ baseOptions = configuration.baseOptions;
360
+ baseAccessToken = configuration.accessToken;
361
+ }
362
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
363
+ localVarHeaderParameter = {};
364
+ localVarQueryParameter = {};
365
+ if (cookie !== undefined && cookie !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
366
+ localVarHeaderParameter['Cookie'] = String(cookie ? cookie : baseAccessToken);
367
+ }
368
+ localVarHeaderParameter['Content-Type'] = 'application/json';
369
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
370
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
371
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
372
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(refreshTokenDto, localVarRequestOptions, configuration);
373
+ return [2 /*return*/, {
374
+ url: (0, common_1.toPathString)(localVarUrlObj),
375
+ options: localVarRequestOptions,
376
+ }];
377
+ });
378
+ });
379
+ },
380
+ /**
381
+ * Change tenant user\'s password using the token provided by the reset password endpoint.
382
+ * @summary Change password by tenant
383
+ * @param {ResetPasswordRequestDto} resetPasswordRequestDto
384
+ * @param {*} [options] Override http request option.
385
+ * @throws {RequiredError}
386
+ */
387
+ resetPassword: function (resetPasswordRequestDto, options) {
388
+ if (options === void 0) { options = {}; }
389
+ return __awaiter(_this, void 0, void 0, function () {
390
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
391
+ return __generator(this, function (_a) {
392
+ // verify required parameter 'resetPasswordRequestDto' is not null or undefined
393
+ (0, common_1.assertParamExists)('resetPassword', 'resetPasswordRequestDto', resetPasswordRequestDto);
394
+ localVarPath = "/authservice/v1/reset-password";
395
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
396
+ if (configuration) {
397
+ baseOptions = configuration.baseOptions;
398
+ baseAccessToken = configuration.accessToken;
399
+ }
400
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
401
+ localVarHeaderParameter = {};
402
+ localVarQueryParameter = {};
403
+ localVarHeaderParameter['Content-Type'] = 'application/json';
404
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
405
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
406
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
407
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(resetPasswordRequestDto, localVarRequestOptions, configuration);
408
+ return [2 /*return*/, {
409
+ url: (0, common_1.toPathString)(localVarUrlObj),
410
+ options: localVarRequestOptions,
411
+ }];
412
+ });
413
+ });
414
+ },
415
+ /**
416
+ * Verify the invite sent to the tenant user via email.
417
+ * @summary Verify tenant user\'s invite token
418
+ * @param {string} token
419
+ * @param {*} [options] Override http request option.
420
+ * @throws {RequiredError}
421
+ */
422
+ verifyInvite: function (token, options) {
423
+ if (options === void 0) { options = {}; }
424
+ return __awaiter(_this, void 0, void 0, function () {
425
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
426
+ return __generator(this, function (_a) {
427
+ // verify required parameter 'token' is not null or undefined
428
+ (0, common_1.assertParamExists)('verifyInvite', 'token', token);
429
+ localVarPath = "/authservice/v1/verify-invite";
430
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
431
+ if (configuration) {
432
+ baseOptions = configuration.baseOptions;
433
+ baseAccessToken = configuration.accessToken;
434
+ }
435
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
436
+ localVarHeaderParameter = {};
437
+ localVarQueryParameter = {};
438
+ if (token !== undefined) {
439
+ localVarQueryParameter['token'] = token;
440
+ }
441
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
442
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
443
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
444
+ return [2 /*return*/, {
445
+ url: (0, common_1.toPathString)(localVarUrlObj),
446
+ options: localVarRequestOptions,
447
+ }];
448
+ });
449
+ });
450
+ },
451
+ /**
452
+ * Verify the reset password token that is sent by calling the \'forgot password\' endpoint.
453
+ * @summary Verify tenant reset password token
454
+ * @param {string} resetToken Tenant user\&#39;s reset token. Reset token can be found in the email sent after \&#39;forgot-password\&#39; endpoint was called.
455
+ * @param {*} [options] Override http request option.
456
+ * @throws {RequiredError}
457
+ */
458
+ verifyResetPasswordToken: function (resetToken, options) {
459
+ if (options === void 0) { options = {}; }
460
+ return __awaiter(_this, void 0, void 0, function () {
461
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
462
+ return __generator(this, function (_a) {
463
+ // verify required parameter 'resetToken' is not null or undefined
464
+ (0, common_1.assertParamExists)('verifyResetPasswordToken', 'resetToken', resetToken);
465
+ localVarPath = "/authservice/v1/verify-reset-password";
466
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
467
+ if (configuration) {
468
+ baseOptions = configuration.baseOptions;
469
+ baseAccessToken = configuration.accessToken;
470
+ }
471
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
472
+ localVarHeaderParameter = {};
473
+ localVarQueryParameter = {};
474
+ if (resetToken !== undefined) {
475
+ localVarQueryParameter['resetToken'] = resetToken;
476
+ }
477
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
478
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
479
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
480
+ return [2 /*return*/, {
481
+ url: (0, common_1.toPathString)(localVarUrlObj),
482
+ options: localVarRequestOptions,
483
+ }];
484
+ });
485
+ });
486
+ },
487
+ };
488
+ };
489
+ exports.AuthserviceApiAxiosParamCreator = AuthserviceApiAxiosParamCreator;
490
+ /**
491
+ * AuthserviceApi - functional programming interface
492
+ * @export
493
+ */
494
+ var AuthserviceApiFp = function (configuration) {
495
+ var localVarAxiosParamCreator = (0, exports.AuthserviceApiAxiosParamCreator)(configuration);
496
+ return {
497
+ /**
498
+ * Register a new organization with appropriate hierarchy and create a user for that organization.
499
+ * @summary Register Organization and User using invitation token
500
+ * @param {CreateOrgAndUserRequestDto} createOrgAndUserRequestDto
501
+ * @param {*} [options] Override http request option.
502
+ * @throws {RequiredError}
503
+ */
504
+ createOrgAndUser: function (createOrgAndUserRequestDto, options) {
505
+ return __awaiter(this, void 0, void 0, function () {
506
+ var localVarAxiosArgs;
507
+ return __generator(this, function (_a) {
508
+ switch (_a.label) {
509
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createOrgAndUser(createOrgAndUserRequestDto, options)];
510
+ case 1:
511
+ localVarAxiosArgs = _a.sent();
512
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
513
+ }
514
+ });
515
+ });
516
+ },
517
+ /**
518
+ * Register a tenant user using the invite token sent to the tenant user\'s email address.
519
+ * @summary Register tenant user after invite
520
+ * @param {CreateUserRequestDto} createUserRequestDto
521
+ * @param {*} [options] Override http request option.
522
+ * @throws {RequiredError}
523
+ */
524
+ createUser: function (createUserRequestDto, options) {
525
+ return __awaiter(this, void 0, void 0, function () {
526
+ var localVarAxiosArgs;
527
+ return __generator(this, function (_a) {
528
+ switch (_a.label) {
529
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createUser(createUserRequestDto, options)];
530
+ case 1:
531
+ localVarAxiosArgs = _a.sent();
532
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
533
+ }
534
+ });
535
+ });
536
+ },
537
+ /**
538
+ * Send a tenant user a reset-password token via email.
539
+ * @summary Forgot password by tenant
540
+ * @param {ForgotPasswordRequestDto} forgotPasswordRequestDto
541
+ * @param {*} [options] Override http request option.
542
+ * @throws {RequiredError}
543
+ */
544
+ forgotPassword: function (forgotPasswordRequestDto, options) {
545
+ return __awaiter(this, void 0, void 0, function () {
546
+ var localVarAxiosArgs;
547
+ return __generator(this, function (_a) {
548
+ switch (_a.label) {
549
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.forgotPassword(forgotPasswordRequestDto, options)];
550
+ case 1:
551
+ localVarAxiosArgs = _a.sent();
552
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
553
+ }
554
+ });
555
+ });
556
+ },
557
+ /**
558
+ * Get saml login link configured for the tenant in cognito as well as tenant settings
559
+ * @summary Get saml login link for tenant
560
+ * @param {string} tenantSlug
561
+ * @param {*} [options] Override http request option.
562
+ * @throws {RequiredError}
563
+ */
564
+ getSamlLoginLink: function (tenantSlug, options) {
565
+ return __awaiter(this, void 0, void 0, function () {
566
+ var localVarAxiosArgs;
567
+ return __generator(this, function (_a) {
568
+ switch (_a.label) {
569
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getSamlLoginLink(tenantSlug, options)];
570
+ case 1:
571
+ localVarAxiosArgs = _a.sent();
572
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
573
+ }
574
+ });
575
+ });
576
+ },
577
+ /**
578
+ * Get new access token, refresh token after successful login.
579
+ * @summary Login by tenant
580
+ * @param {LoginRequestDto} loginRequestDto
581
+ * @param {*} [options] Override http request option.
582
+ * @throws {RequiredError}
583
+ */
584
+ login: function (loginRequestDto, options) {
585
+ return __awaiter(this, void 0, void 0, function () {
586
+ var localVarAxiosArgs;
587
+ return __generator(this, function (_a) {
588
+ switch (_a.label) {
589
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.login(loginRequestDto, options)];
590
+ case 1:
591
+ localVarAxiosArgs = _a.sent();
592
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
593
+ }
594
+ });
595
+ });
596
+ },
597
+ /**
598
+ * Get new access token, refresh token after successful login. This api also creates a tenant user if user does not exist
599
+ * @summary Login by SAML idp provider such as ADFS
600
+ * @param {LoginBySAMLRequestDto} loginBySAMLRequestDto
601
+ * @param {*} [options] Override http request option.
602
+ * @throws {RequiredError}
603
+ */
604
+ loginBySAML: function (loginBySAMLRequestDto, options) {
605
+ return __awaiter(this, void 0, void 0, function () {
606
+ var localVarAxiosArgs;
607
+ return __generator(this, function (_a) {
608
+ switch (_a.label) {
609
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.loginBySAML(loginBySAMLRequestDto, options)];
610
+ case 1:
611
+ localVarAxiosArgs = _a.sent();
612
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
613
+ }
614
+ });
615
+ });
616
+ },
617
+ /**
618
+ * Sign tenant user out.
619
+ * @summary Logout tenant
620
+ * @param {LogoutRequestDto} logoutRequestDto
621
+ * @param {*} [options] Override http request option.
622
+ * @throws {RequiredError}
623
+ */
624
+ logout: function (logoutRequestDto, options) {
625
+ return __awaiter(this, void 0, void 0, function () {
626
+ var localVarAxiosArgs;
627
+ return __generator(this, function (_a) {
628
+ switch (_a.label) {
629
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.logout(logoutRequestDto, options)];
630
+ case 1:
631
+ localVarAxiosArgs = _a.sent();
632
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
633
+ }
634
+ });
635
+ });
636
+ },
637
+ /**
638
+ * Get new access token, new refresh token.
639
+ * @summary Refresh token by tenant
640
+ * @param {RefreshTokenDto} refreshTokenDto
641
+ * @param {string} [cookie] HTTP only cookie that was sent during login
642
+ * @param {*} [options] Override http request option.
643
+ * @throws {RequiredError}
644
+ */
645
+ refreshToken: function (refreshTokenDto, cookie, options) {
646
+ return __awaiter(this, void 0, void 0, function () {
647
+ var localVarAxiosArgs;
648
+ return __generator(this, function (_a) {
649
+ switch (_a.label) {
650
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.refreshToken(refreshTokenDto, cookie, options)];
651
+ case 1:
652
+ localVarAxiosArgs = _a.sent();
653
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
654
+ }
655
+ });
656
+ });
657
+ },
658
+ /**
659
+ * Change tenant user\'s password using the token provided by the reset password endpoint.
660
+ * @summary Change password by tenant
661
+ * @param {ResetPasswordRequestDto} resetPasswordRequestDto
662
+ * @param {*} [options] Override http request option.
663
+ * @throws {RequiredError}
664
+ */
665
+ resetPassword: function (resetPasswordRequestDto, options) {
666
+ return __awaiter(this, void 0, void 0, function () {
667
+ var localVarAxiosArgs;
668
+ return __generator(this, function (_a) {
669
+ switch (_a.label) {
670
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.resetPassword(resetPasswordRequestDto, options)];
671
+ case 1:
672
+ localVarAxiosArgs = _a.sent();
673
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
674
+ }
675
+ });
676
+ });
677
+ },
678
+ /**
679
+ * Verify the invite sent to the tenant user via email.
680
+ * @summary Verify tenant user\'s invite token
681
+ * @param {string} token
682
+ * @param {*} [options] Override http request option.
683
+ * @throws {RequiredError}
684
+ */
685
+ verifyInvite: function (token, options) {
686
+ return __awaiter(this, void 0, void 0, function () {
687
+ var localVarAxiosArgs;
688
+ return __generator(this, function (_a) {
689
+ switch (_a.label) {
690
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.verifyInvite(token, options)];
691
+ case 1:
692
+ localVarAxiosArgs = _a.sent();
693
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
694
+ }
695
+ });
696
+ });
697
+ },
698
+ /**
699
+ * Verify the reset password token that is sent by calling the \'forgot password\' endpoint.
700
+ * @summary Verify tenant reset password token
701
+ * @param {string} resetToken Tenant user\&#39;s reset token. Reset token can be found in the email sent after \&#39;forgot-password\&#39; endpoint was called.
702
+ * @param {*} [options] Override http request option.
703
+ * @throws {RequiredError}
704
+ */
705
+ verifyResetPasswordToken: function (resetToken, options) {
706
+ return __awaiter(this, void 0, void 0, function () {
707
+ var localVarAxiosArgs;
708
+ return __generator(this, function (_a) {
709
+ switch (_a.label) {
710
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.verifyResetPasswordToken(resetToken, options)];
711
+ case 1:
712
+ localVarAxiosArgs = _a.sent();
713
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
714
+ }
715
+ });
716
+ });
717
+ },
718
+ };
719
+ };
720
+ exports.AuthserviceApiFp = AuthserviceApiFp;
721
+ /**
722
+ * AuthserviceApi - factory interface
723
+ * @export
724
+ */
725
+ var AuthserviceApiFactory = function (configuration, basePath, axios) {
726
+ var localVarFp = (0, exports.AuthserviceApiFp)(configuration);
727
+ return {
728
+ /**
729
+ * Register a new organization with appropriate hierarchy and create a user for that organization.
730
+ * @summary Register Organization and User using invitation token
731
+ * @param {CreateOrgAndUserRequestDto} createOrgAndUserRequestDto
732
+ * @param {*} [options] Override http request option.
733
+ * @throws {RequiredError}
734
+ */
735
+ createOrgAndUser: function (createOrgAndUserRequestDto, options) {
736
+ return localVarFp.createOrgAndUser(createOrgAndUserRequestDto, options).then(function (request) { return request(axios, basePath); });
737
+ },
738
+ /**
739
+ * Register a tenant user using the invite token sent to the tenant user\'s email address.
740
+ * @summary Register tenant user after invite
741
+ * @param {CreateUserRequestDto} createUserRequestDto
742
+ * @param {*} [options] Override http request option.
743
+ * @throws {RequiredError}
744
+ */
745
+ createUser: function (createUserRequestDto, options) {
746
+ return localVarFp.createUser(createUserRequestDto, options).then(function (request) { return request(axios, basePath); });
747
+ },
748
+ /**
749
+ * Send a tenant user a reset-password token via email.
750
+ * @summary Forgot password by tenant
751
+ * @param {ForgotPasswordRequestDto} forgotPasswordRequestDto
752
+ * @param {*} [options] Override http request option.
753
+ * @throws {RequiredError}
754
+ */
755
+ forgotPassword: function (forgotPasswordRequestDto, options) {
756
+ return localVarFp.forgotPassword(forgotPasswordRequestDto, options).then(function (request) { return request(axios, basePath); });
757
+ },
758
+ /**
759
+ * Get saml login link configured for the tenant in cognito as well as tenant settings
760
+ * @summary Get saml login link for tenant
761
+ * @param {string} tenantSlug
762
+ * @param {*} [options] Override http request option.
763
+ * @throws {RequiredError}
764
+ */
765
+ getSamlLoginLink: function (tenantSlug, options) {
766
+ return localVarFp.getSamlLoginLink(tenantSlug, options).then(function (request) { return request(axios, basePath); });
767
+ },
768
+ /**
769
+ * Get new access token, refresh token after successful login.
770
+ * @summary Login by tenant
771
+ * @param {LoginRequestDto} loginRequestDto
772
+ * @param {*} [options] Override http request option.
773
+ * @throws {RequiredError}
774
+ */
775
+ login: function (loginRequestDto, options) {
776
+ return localVarFp.login(loginRequestDto, options).then(function (request) { return request(axios, basePath); });
777
+ },
778
+ /**
779
+ * Get new access token, refresh token after successful login. This api also creates a tenant user if user does not exist
780
+ * @summary Login by SAML idp provider such as ADFS
781
+ * @param {LoginBySAMLRequestDto} loginBySAMLRequestDto
782
+ * @param {*} [options] Override http request option.
783
+ * @throws {RequiredError}
784
+ */
785
+ loginBySAML: function (loginBySAMLRequestDto, options) {
786
+ return localVarFp.loginBySAML(loginBySAMLRequestDto, options).then(function (request) { return request(axios, basePath); });
787
+ },
788
+ /**
789
+ * Sign tenant user out.
790
+ * @summary Logout tenant
791
+ * @param {LogoutRequestDto} logoutRequestDto
792
+ * @param {*} [options] Override http request option.
793
+ * @throws {RequiredError}
794
+ */
795
+ logout: function (logoutRequestDto, options) {
796
+ return localVarFp.logout(logoutRequestDto, options).then(function (request) { return request(axios, basePath); });
797
+ },
798
+ /**
799
+ * Get new access token, new refresh token.
800
+ * @summary Refresh token by tenant
801
+ * @param {RefreshTokenDto} refreshTokenDto
802
+ * @param {string} [cookie] HTTP only cookie that was sent during login
803
+ * @param {*} [options] Override http request option.
804
+ * @throws {RequiredError}
805
+ */
806
+ refreshToken: function (refreshTokenDto, cookie, options) {
807
+ return localVarFp.refreshToken(refreshTokenDto, cookie, options).then(function (request) { return request(axios, basePath); });
808
+ },
809
+ /**
810
+ * Change tenant user\'s password using the token provided by the reset password endpoint.
811
+ * @summary Change password by tenant
812
+ * @param {ResetPasswordRequestDto} resetPasswordRequestDto
813
+ * @param {*} [options] Override http request option.
814
+ * @throws {RequiredError}
815
+ */
816
+ resetPassword: function (resetPasswordRequestDto, options) {
817
+ return localVarFp.resetPassword(resetPasswordRequestDto, options).then(function (request) { return request(axios, basePath); });
818
+ },
819
+ /**
820
+ * Verify the invite sent to the tenant user via email.
821
+ * @summary Verify tenant user\'s invite token
822
+ * @param {string} token
823
+ * @param {*} [options] Override http request option.
824
+ * @throws {RequiredError}
825
+ */
826
+ verifyInvite: function (token, options) {
827
+ return localVarFp.verifyInvite(token, options).then(function (request) { return request(axios, basePath); });
828
+ },
829
+ /**
830
+ * Verify the reset password token that is sent by calling the \'forgot password\' endpoint.
831
+ * @summary Verify tenant reset password token
832
+ * @param {string} resetToken Tenant user\&#39;s reset token. Reset token can be found in the email sent after \&#39;forgot-password\&#39; endpoint was called.
833
+ * @param {*} [options] Override http request option.
834
+ * @throws {RequiredError}
835
+ */
836
+ verifyResetPasswordToken: function (resetToken, options) {
837
+ return localVarFp.verifyResetPasswordToken(resetToken, options).then(function (request) { return request(axios, basePath); });
838
+ },
839
+ };
840
+ };
841
+ exports.AuthserviceApiFactory = AuthserviceApiFactory;
842
+ /**
843
+ * AuthserviceApi - object-oriented interface
844
+ * @export
845
+ * @class AuthserviceApi
846
+ * @extends {BaseAPI}
847
+ */
848
+ var AuthserviceApi = /** @class */ (function (_super) {
849
+ __extends(AuthserviceApi, _super);
850
+ function AuthserviceApi() {
851
+ return _super !== null && _super.apply(this, arguments) || this;
852
+ }
853
+ /**
854
+ * Register a new organization with appropriate hierarchy and create a user for that organization.
855
+ * @summary Register Organization and User using invitation token
856
+ * @param {AuthserviceApiCreateOrgAndUserRequest} requestParameters Request parameters.
857
+ * @param {*} [options] Override http request option.
858
+ * @throws {RequiredError}
859
+ * @memberof AuthserviceApi
860
+ */
861
+ AuthserviceApi.prototype.createOrgAndUser = function (requestParameters, options) {
862
+ var _this = this;
863
+ return (0, exports.AuthserviceApiFp)(this.configuration).createOrgAndUser(requestParameters.createOrgAndUserRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
864
+ };
865
+ /**
866
+ * Register a tenant user using the invite token sent to the tenant user\'s email address.
867
+ * @summary Register tenant user after invite
868
+ * @param {AuthserviceApiCreateUserRequest} requestParameters Request parameters.
869
+ * @param {*} [options] Override http request option.
870
+ * @throws {RequiredError}
871
+ * @memberof AuthserviceApi
872
+ */
873
+ AuthserviceApi.prototype.createUser = function (requestParameters, options) {
874
+ var _this = this;
875
+ return (0, exports.AuthserviceApiFp)(this.configuration).createUser(requestParameters.createUserRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
876
+ };
877
+ /**
878
+ * Send a tenant user a reset-password token via email.
879
+ * @summary Forgot password by tenant
880
+ * @param {AuthserviceApiForgotPasswordRequest} requestParameters Request parameters.
881
+ * @param {*} [options] Override http request option.
882
+ * @throws {RequiredError}
883
+ * @memberof AuthserviceApi
884
+ */
885
+ AuthserviceApi.prototype.forgotPassword = function (requestParameters, options) {
886
+ var _this = this;
887
+ return (0, exports.AuthserviceApiFp)(this.configuration).forgotPassword(requestParameters.forgotPasswordRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
888
+ };
889
+ /**
890
+ * Get saml login link configured for the tenant in cognito as well as tenant settings
891
+ * @summary Get saml login link for tenant
892
+ * @param {AuthserviceApiGetSamlLoginLinkRequest} requestParameters Request parameters.
893
+ * @param {*} [options] Override http request option.
894
+ * @throws {RequiredError}
895
+ * @memberof AuthserviceApi
896
+ */
897
+ AuthserviceApi.prototype.getSamlLoginLink = function (requestParameters, options) {
898
+ var _this = this;
899
+ return (0, exports.AuthserviceApiFp)(this.configuration).getSamlLoginLink(requestParameters.tenantSlug, options).then(function (request) { return request(_this.axios, _this.basePath); });
900
+ };
901
+ /**
902
+ * Get new access token, refresh token after successful login.
903
+ * @summary Login by tenant
904
+ * @param {AuthserviceApiLoginRequest} requestParameters Request parameters.
905
+ * @param {*} [options] Override http request option.
906
+ * @throws {RequiredError}
907
+ * @memberof AuthserviceApi
908
+ */
909
+ AuthserviceApi.prototype.login = function (requestParameters, options) {
910
+ var _this = this;
911
+ return (0, exports.AuthserviceApiFp)(this.configuration).login(requestParameters.loginRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
912
+ };
913
+ /**
914
+ * Get new access token, refresh token after successful login. This api also creates a tenant user if user does not exist
915
+ * @summary Login by SAML idp provider such as ADFS
916
+ * @param {AuthserviceApiLoginBySAMLRequest} requestParameters Request parameters.
917
+ * @param {*} [options] Override http request option.
918
+ * @throws {RequiredError}
919
+ * @memberof AuthserviceApi
920
+ */
921
+ AuthserviceApi.prototype.loginBySAML = function (requestParameters, options) {
922
+ var _this = this;
923
+ return (0, exports.AuthserviceApiFp)(this.configuration).loginBySAML(requestParameters.loginBySAMLRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
924
+ };
925
+ /**
926
+ * Sign tenant user out.
927
+ * @summary Logout tenant
928
+ * @param {AuthserviceApiLogoutRequest} requestParameters Request parameters.
929
+ * @param {*} [options] Override http request option.
930
+ * @throws {RequiredError}
931
+ * @memberof AuthserviceApi
932
+ */
933
+ AuthserviceApi.prototype.logout = function (requestParameters, options) {
934
+ var _this = this;
935
+ return (0, exports.AuthserviceApiFp)(this.configuration).logout(requestParameters.logoutRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
936
+ };
937
+ /**
938
+ * Get new access token, new refresh token.
939
+ * @summary Refresh token by tenant
940
+ * @param {AuthserviceApiRefreshTokenRequest} requestParameters Request parameters.
941
+ * @param {*} [options] Override http request option.
942
+ * @throws {RequiredError}
943
+ * @memberof AuthserviceApi
944
+ */
945
+ AuthserviceApi.prototype.refreshToken = function (requestParameters, options) {
946
+ var _this = this;
947
+ return (0, exports.AuthserviceApiFp)(this.configuration).refreshToken(requestParameters.refreshTokenDto, requestParameters.cookie, options).then(function (request) { return request(_this.axios, _this.basePath); });
948
+ };
949
+ /**
950
+ * Change tenant user\'s password using the token provided by the reset password endpoint.
951
+ * @summary Change password by tenant
952
+ * @param {AuthserviceApiResetPasswordRequest} requestParameters Request parameters.
953
+ * @param {*} [options] Override http request option.
954
+ * @throws {RequiredError}
955
+ * @memberof AuthserviceApi
956
+ */
957
+ AuthserviceApi.prototype.resetPassword = function (requestParameters, options) {
958
+ var _this = this;
959
+ return (0, exports.AuthserviceApiFp)(this.configuration).resetPassword(requestParameters.resetPasswordRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
960
+ };
961
+ /**
962
+ * Verify the invite sent to the tenant user via email.
963
+ * @summary Verify tenant user\'s invite token
964
+ * @param {AuthserviceApiVerifyInviteRequest} requestParameters Request parameters.
965
+ * @param {*} [options] Override http request option.
966
+ * @throws {RequiredError}
967
+ * @memberof AuthserviceApi
968
+ */
969
+ AuthserviceApi.prototype.verifyInvite = function (requestParameters, options) {
970
+ var _this = this;
971
+ return (0, exports.AuthserviceApiFp)(this.configuration).verifyInvite(requestParameters.token, options).then(function (request) { return request(_this.axios, _this.basePath); });
972
+ };
973
+ /**
974
+ * Verify the reset password token that is sent by calling the \'forgot password\' endpoint.
975
+ * @summary Verify tenant reset password token
976
+ * @param {AuthserviceApiVerifyResetPasswordTokenRequest} requestParameters Request parameters.
977
+ * @param {*} [options] Override http request option.
978
+ * @throws {RequiredError}
979
+ * @memberof AuthserviceApi
980
+ */
981
+ AuthserviceApi.prototype.verifyResetPasswordToken = function (requestParameters, options) {
982
+ var _this = this;
983
+ return (0, exports.AuthserviceApiFp)(this.configuration).verifyResetPasswordToken(requestParameters.resetToken, options).then(function (request) { return request(_this.axios, _this.basePath); });
984
+ };
985
+ return AuthserviceApi;
986
+ }(base_1.BaseAPI));
987
+ exports.AuthserviceApi = AuthserviceApi;