@targetprocess/auth-client 3.2.2-ci.2 → 3.2.2-manual-up-node-client-template-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/bin/client.d.ts +212 -144
- package/bin/client.js +599 -256
- package/bin/client.js.map +1 -1
- package/package.json +5 -6
package/bin/client.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
2
|
//----------------------
|
|
4
3
|
// <auto-generated>
|
|
5
|
-
// Generated using the NSwag toolchain
|
|
4
|
+
// Generated using the NSwag toolchain v13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
|
|
6
5
|
// </auto-generated>
|
|
7
6
|
//----------------------
|
|
8
|
-
// ReSharper disable InconsistentNaming
|
|
9
7
|
var __extends = (this && this.__extends) || (function () {
|
|
10
8
|
var extendStatics = Object.setPrototypeOf ||
|
|
11
9
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -21,7 +19,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
21
19
|
function AuthClient(baseUrl, http) {
|
|
22
20
|
this.jsonParseReviver = undefined;
|
|
23
21
|
this.http = http ? http : window;
|
|
24
|
-
this.baseUrl = baseUrl ? baseUrl : "";
|
|
22
|
+
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "";
|
|
25
23
|
}
|
|
26
24
|
/**
|
|
27
25
|
* Create new tenant
|
|
@@ -35,10 +33,10 @@ var AuthClient = /** @class */ (function () {
|
|
|
35
33
|
var options_ = {
|
|
36
34
|
body: content_,
|
|
37
35
|
method: "POST",
|
|
38
|
-
headers:
|
|
36
|
+
headers: {
|
|
39
37
|
"Content-Type": "application/json",
|
|
40
38
|
"Accept": "application/json"
|
|
41
|
-
}
|
|
39
|
+
}
|
|
42
40
|
};
|
|
43
41
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
44
42
|
return _this.processCreateTenant(_response);
|
|
@@ -63,24 +61,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
63
61
|
return response.text().then(function (_responseText) {
|
|
64
62
|
var result400 = null;
|
|
65
63
|
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
66
|
-
return throwException("
|
|
64
|
+
return throwException("Validation failed", status, _responseText, _headers, result400);
|
|
67
65
|
});
|
|
68
66
|
}
|
|
69
67
|
else if (status === 401) {
|
|
70
68
|
return response.text().then(function (_responseText) {
|
|
71
|
-
return throwException("
|
|
69
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
72
70
|
});
|
|
73
71
|
}
|
|
74
72
|
else if (status === 403) {
|
|
75
73
|
return response.text().then(function (_responseText) {
|
|
76
|
-
return throwException("
|
|
74
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
77
75
|
});
|
|
78
76
|
}
|
|
79
77
|
else if (status === 500) {
|
|
80
78
|
return response.text().then(function (_responseText) {
|
|
81
79
|
var result500 = null;
|
|
82
80
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
83
|
-
return throwException("
|
|
81
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
84
82
|
});
|
|
85
83
|
}
|
|
86
84
|
else if (status !== 200 && status !== 204) {
|
|
@@ -92,7 +90,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
92
90
|
};
|
|
93
91
|
/**
|
|
94
92
|
* Update tenant
|
|
95
|
-
* @tenantId Tenant Id
|
|
93
|
+
* @param tenantId Tenant Id
|
|
96
94
|
* @return Updated
|
|
97
95
|
*/
|
|
98
96
|
AuthClient.prototype.updateTenant = function (body, tenantId) {
|
|
@@ -106,9 +104,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
106
104
|
var options_ = {
|
|
107
105
|
body: content_,
|
|
108
106
|
method: "PUT",
|
|
109
|
-
headers:
|
|
107
|
+
headers: {
|
|
110
108
|
"Content-Type": "application/json",
|
|
111
|
-
}
|
|
109
|
+
}
|
|
112
110
|
};
|
|
113
111
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
114
112
|
return _this.processUpdateTenant(_response);
|
|
@@ -131,29 +129,29 @@ var AuthClient = /** @class */ (function () {
|
|
|
131
129
|
return response.text().then(function (_responseText) {
|
|
132
130
|
var result400 = null;
|
|
133
131
|
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
134
|
-
return throwException("
|
|
132
|
+
return throwException("Validation failed", status, _responseText, _headers, result400);
|
|
135
133
|
});
|
|
136
134
|
}
|
|
137
135
|
else if (status === 401) {
|
|
138
136
|
return response.text().then(function (_responseText) {
|
|
139
|
-
return throwException("
|
|
137
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
140
138
|
});
|
|
141
139
|
}
|
|
142
140
|
else if (status === 403) {
|
|
143
141
|
return response.text().then(function (_responseText) {
|
|
144
|
-
return throwException("
|
|
142
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
145
143
|
});
|
|
146
144
|
}
|
|
147
145
|
else if (status === 404) {
|
|
148
146
|
return response.text().then(function (_responseText) {
|
|
149
|
-
return throwException("
|
|
147
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
150
148
|
});
|
|
151
149
|
}
|
|
152
150
|
else if (status === 500) {
|
|
153
151
|
return response.text().then(function (_responseText) {
|
|
154
152
|
var result500 = null;
|
|
155
153
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
156
|
-
return throwException("
|
|
154
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
157
155
|
});
|
|
158
156
|
}
|
|
159
157
|
else if (status !== 200 && status !== 204) {
|
|
@@ -165,7 +163,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
165
163
|
};
|
|
166
164
|
/**
|
|
167
165
|
* Get tenant details
|
|
168
|
-
* @tenantId Tenant Id
|
|
166
|
+
* @param tenantId Tenant Id
|
|
169
167
|
* @return OK
|
|
170
168
|
*/
|
|
171
169
|
AuthClient.prototype.getTenant = function (tenantId) {
|
|
@@ -177,10 +175,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
177
175
|
url_ = url_.replace(/[?&]$/, "");
|
|
178
176
|
var options_ = {
|
|
179
177
|
method: "GET",
|
|
180
|
-
headers:
|
|
181
|
-
"Content-Type": "application/json",
|
|
178
|
+
headers: {
|
|
182
179
|
"Accept": "application/json"
|
|
183
|
-
}
|
|
180
|
+
}
|
|
184
181
|
};
|
|
185
182
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
186
183
|
return _this.processGetTenant(_response);
|
|
@@ -203,24 +200,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
203
200
|
}
|
|
204
201
|
else if (status === 401) {
|
|
205
202
|
return response.text().then(function (_responseText) {
|
|
206
|
-
return throwException("
|
|
203
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
207
204
|
});
|
|
208
205
|
}
|
|
209
206
|
else if (status === 403) {
|
|
210
207
|
return response.text().then(function (_responseText) {
|
|
211
|
-
return throwException("
|
|
208
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
212
209
|
});
|
|
213
210
|
}
|
|
214
211
|
else if (status === 404) {
|
|
215
212
|
return response.text().then(function (_responseText) {
|
|
216
|
-
return throwException("
|
|
213
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
217
214
|
});
|
|
218
215
|
}
|
|
219
216
|
else if (status === 500) {
|
|
220
217
|
return response.text().then(function (_responseText) {
|
|
221
218
|
var result500 = null;
|
|
222
219
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
223
|
-
return throwException("
|
|
220
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
224
221
|
});
|
|
225
222
|
}
|
|
226
223
|
else if (status !== 200 && status !== 204) {
|
|
@@ -232,7 +229,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
232
229
|
};
|
|
233
230
|
/**
|
|
234
231
|
* Delete tenant
|
|
235
|
-
* @tenantId Tenant Id
|
|
232
|
+
* @param tenantId Tenant Id
|
|
236
233
|
* @return Deleted
|
|
237
234
|
*/
|
|
238
235
|
AuthClient.prototype.deleteTenant = function (tenantId) {
|
|
@@ -244,9 +241,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
244
241
|
url_ = url_.replace(/[?&]$/, "");
|
|
245
242
|
var options_ = {
|
|
246
243
|
method: "DELETE",
|
|
247
|
-
headers:
|
|
248
|
-
"Content-Type": "application/json",
|
|
249
|
-
})
|
|
244
|
+
headers: {}
|
|
250
245
|
};
|
|
251
246
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
252
247
|
return _this.processDeleteTenant(_response);
|
|
@@ -267,24 +262,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
267
262
|
}
|
|
268
263
|
else if (status === 401) {
|
|
269
264
|
return response.text().then(function (_responseText) {
|
|
270
|
-
return throwException("
|
|
265
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
271
266
|
});
|
|
272
267
|
}
|
|
273
268
|
else if (status === 403) {
|
|
274
269
|
return response.text().then(function (_responseText) {
|
|
275
|
-
return throwException("
|
|
270
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
276
271
|
});
|
|
277
272
|
}
|
|
278
273
|
else if (status === 404) {
|
|
279
274
|
return response.text().then(function (_responseText) {
|
|
280
|
-
return throwException("
|
|
275
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
281
276
|
});
|
|
282
277
|
}
|
|
283
278
|
else if (status === 500) {
|
|
284
279
|
return response.text().then(function (_responseText) {
|
|
285
280
|
var result500 = null;
|
|
286
281
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
287
|
-
return throwException("
|
|
282
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
288
283
|
});
|
|
289
284
|
}
|
|
290
285
|
else if (status !== 200 && status !== 204) {
|
|
@@ -296,7 +291,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
296
291
|
};
|
|
297
292
|
/**
|
|
298
293
|
* Create new user in tenant
|
|
299
|
-
* @tenantId Tenant Id
|
|
294
|
+
* @param tenantId Tenant Id
|
|
300
295
|
* @return Created
|
|
301
296
|
*/
|
|
302
297
|
AuthClient.prototype.createUserInTenant = function (body, tenantId) {
|
|
@@ -310,10 +305,10 @@ var AuthClient = /** @class */ (function () {
|
|
|
310
305
|
var options_ = {
|
|
311
306
|
body: content_,
|
|
312
307
|
method: "POST",
|
|
313
|
-
headers:
|
|
308
|
+
headers: {
|
|
314
309
|
"Content-Type": "application/json",
|
|
315
310
|
"Accept": "application/json"
|
|
316
|
-
}
|
|
311
|
+
}
|
|
317
312
|
};
|
|
318
313
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
319
314
|
return _this.processCreateUserInTenant(_response);
|
|
@@ -336,24 +331,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
336
331
|
}
|
|
337
332
|
else if (status === 401) {
|
|
338
333
|
return response.text().then(function (_responseText) {
|
|
339
|
-
return throwException("
|
|
334
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
340
335
|
});
|
|
341
336
|
}
|
|
342
337
|
else if (status === 403) {
|
|
343
338
|
return response.text().then(function (_responseText) {
|
|
344
|
-
return throwException("
|
|
339
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
345
340
|
});
|
|
346
341
|
}
|
|
347
342
|
else if (status === 404) {
|
|
348
343
|
return response.text().then(function (_responseText) {
|
|
349
|
-
return throwException("
|
|
344
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
350
345
|
});
|
|
351
346
|
}
|
|
352
347
|
else if (status === 500) {
|
|
353
348
|
return response.text().then(function (_responseText) {
|
|
354
349
|
var result500 = null;
|
|
355
350
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
356
|
-
return throwException("
|
|
351
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
357
352
|
});
|
|
358
353
|
}
|
|
359
354
|
else if (status !== 200 && status !== 204) {
|
|
@@ -365,7 +360,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
365
360
|
};
|
|
366
361
|
/**
|
|
367
362
|
* Update users passwords
|
|
368
|
-
* @tenantId Tenant Id
|
|
363
|
+
* @param tenantId Tenant Id
|
|
369
364
|
* @return Imported
|
|
370
365
|
*/
|
|
371
366
|
AuthClient.prototype.updateUsersPasswords = function (body, tenantId) {
|
|
@@ -379,9 +374,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
379
374
|
var options_ = {
|
|
380
375
|
body: content_,
|
|
381
376
|
method: "POST",
|
|
382
|
-
headers:
|
|
377
|
+
headers: {
|
|
383
378
|
"Content-Type": "application/json",
|
|
384
|
-
}
|
|
379
|
+
}
|
|
385
380
|
};
|
|
386
381
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
387
382
|
return _this.processUpdateUsersPasswords(_response);
|
|
@@ -404,24 +399,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
404
399
|
return response.text().then(function (_responseText) {
|
|
405
400
|
var result400 = null;
|
|
406
401
|
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
407
|
-
return throwException("
|
|
402
|
+
return throwException("Validation failed", status, _responseText, _headers, result400);
|
|
408
403
|
});
|
|
409
404
|
}
|
|
410
405
|
else if (status === 401) {
|
|
411
406
|
return response.text().then(function (_responseText) {
|
|
412
|
-
return throwException("
|
|
407
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
413
408
|
});
|
|
414
409
|
}
|
|
415
410
|
else if (status === 403) {
|
|
416
411
|
return response.text().then(function (_responseText) {
|
|
417
|
-
return throwException("
|
|
412
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
418
413
|
});
|
|
419
414
|
}
|
|
420
415
|
else if (status === 500) {
|
|
421
416
|
return response.text().then(function (_responseText) {
|
|
422
417
|
var result500 = null;
|
|
423
418
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
424
|
-
return throwException("
|
|
419
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
425
420
|
});
|
|
426
421
|
}
|
|
427
422
|
else if (status !== 200 && status !== 204) {
|
|
@@ -433,8 +428,8 @@ var AuthClient = /** @class */ (function () {
|
|
|
433
428
|
};
|
|
434
429
|
/**
|
|
435
430
|
* Set user claim values
|
|
436
|
-
* @tenantId Tenant Id
|
|
437
|
-
* @claimType Claim Type
|
|
431
|
+
* @param tenantId Tenant Id
|
|
432
|
+
* @param claimType Claim Type
|
|
438
433
|
* @return OK
|
|
439
434
|
*/
|
|
440
435
|
AuthClient.prototype.setUserClaims = function (userClaimsBatch, tenantId, claimType) {
|
|
@@ -451,9 +446,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
451
446
|
var options_ = {
|
|
452
447
|
body: content_,
|
|
453
448
|
method: "PUT",
|
|
454
|
-
headers:
|
|
449
|
+
headers: {
|
|
455
450
|
"Content-Type": "application/json",
|
|
456
|
-
}
|
|
451
|
+
}
|
|
457
452
|
};
|
|
458
453
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
459
454
|
return _this.processSetUserClaims(_response);
|
|
@@ -474,24 +469,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
474
469
|
}
|
|
475
470
|
else if (status === 401) {
|
|
476
471
|
return response.text().then(function (_responseText) {
|
|
477
|
-
return throwException("
|
|
472
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
478
473
|
});
|
|
479
474
|
}
|
|
480
475
|
else if (status === 403) {
|
|
481
476
|
return response.text().then(function (_responseText) {
|
|
482
|
-
return throwException("
|
|
477
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
483
478
|
});
|
|
484
479
|
}
|
|
485
480
|
else if (status === 404) {
|
|
486
481
|
return response.text().then(function (_responseText) {
|
|
487
|
-
return throwException("
|
|
482
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
488
483
|
});
|
|
489
484
|
}
|
|
490
485
|
else if (status === 500) {
|
|
491
486
|
return response.text().then(function (_responseText) {
|
|
492
487
|
var result500 = null;
|
|
493
488
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
494
|
-
return throwException("
|
|
489
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
495
490
|
});
|
|
496
491
|
}
|
|
497
492
|
else if (status !== 200 && status !== 204) {
|
|
@@ -503,7 +498,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
503
498
|
};
|
|
504
499
|
/**
|
|
505
500
|
* Import users in tenant
|
|
506
|
-
* @tenantId Tenant Id
|
|
501
|
+
* @param tenantId Tenant Id
|
|
507
502
|
* @return Imported
|
|
508
503
|
*/
|
|
509
504
|
AuthClient.prototype.importUsersInTenant = function (body, tenantId) {
|
|
@@ -517,9 +512,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
517
512
|
var options_ = {
|
|
518
513
|
body: content_,
|
|
519
514
|
method: "POST",
|
|
520
|
-
headers:
|
|
515
|
+
headers: {
|
|
521
516
|
"Content-Type": "application/json",
|
|
522
|
-
}
|
|
517
|
+
}
|
|
523
518
|
};
|
|
524
519
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
525
520
|
return _this.processImportUsersInTenant(_response);
|
|
@@ -542,29 +537,29 @@ var AuthClient = /** @class */ (function () {
|
|
|
542
537
|
return response.text().then(function (_responseText) {
|
|
543
538
|
var result400 = null;
|
|
544
539
|
result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
545
|
-
return throwException("
|
|
540
|
+
return throwException("Validation failed", status, _responseText, _headers, result400);
|
|
546
541
|
});
|
|
547
542
|
}
|
|
548
543
|
else if (status === 401) {
|
|
549
544
|
return response.text().then(function (_responseText) {
|
|
550
|
-
return throwException("
|
|
545
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
551
546
|
});
|
|
552
547
|
}
|
|
553
548
|
else if (status === 403) {
|
|
554
549
|
return response.text().then(function (_responseText) {
|
|
555
|
-
return throwException("
|
|
550
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
556
551
|
});
|
|
557
552
|
}
|
|
558
553
|
else if (status === 404) {
|
|
559
554
|
return response.text().then(function (_responseText) {
|
|
560
|
-
return throwException("
|
|
555
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
561
556
|
});
|
|
562
557
|
}
|
|
563
558
|
else if (status === 500) {
|
|
564
559
|
return response.text().then(function (_responseText) {
|
|
565
560
|
var result500 = null;
|
|
566
561
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
567
|
-
return throwException("
|
|
562
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
568
563
|
});
|
|
569
564
|
}
|
|
570
565
|
else if (status !== 200 && status !== 204) {
|
|
@@ -576,8 +571,8 @@ var AuthClient = /** @class */ (function () {
|
|
|
576
571
|
};
|
|
577
572
|
/**
|
|
578
573
|
* Get user from tenant
|
|
579
|
-
* @tenantId Tenant Id
|
|
580
|
-
* @userId User Id
|
|
574
|
+
* @param tenantId Tenant Id
|
|
575
|
+
* @param userId User Id
|
|
581
576
|
* @return OK
|
|
582
577
|
*/
|
|
583
578
|
AuthClient.prototype.getUserFromTenant = function (tenantId, userId) {
|
|
@@ -592,10 +587,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
592
587
|
url_ = url_.replace(/[?&]$/, "");
|
|
593
588
|
var options_ = {
|
|
594
589
|
method: "GET",
|
|
595
|
-
headers:
|
|
596
|
-
"Content-Type": "application/json",
|
|
590
|
+
headers: {
|
|
597
591
|
"Accept": "application/json"
|
|
598
|
-
}
|
|
592
|
+
}
|
|
599
593
|
};
|
|
600
594
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
601
595
|
return _this.processGetUserFromTenant(_response);
|
|
@@ -618,24 +612,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
618
612
|
}
|
|
619
613
|
else if (status === 401) {
|
|
620
614
|
return response.text().then(function (_responseText) {
|
|
621
|
-
return throwException("
|
|
615
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
622
616
|
});
|
|
623
617
|
}
|
|
624
618
|
else if (status === 403) {
|
|
625
619
|
return response.text().then(function (_responseText) {
|
|
626
|
-
return throwException("
|
|
620
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
627
621
|
});
|
|
628
622
|
}
|
|
629
623
|
else if (status === 404) {
|
|
630
624
|
return response.text().then(function (_responseText) {
|
|
631
|
-
return throwException("
|
|
625
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
632
626
|
});
|
|
633
627
|
}
|
|
634
628
|
else if (status === 500) {
|
|
635
629
|
return response.text().then(function (_responseText) {
|
|
636
630
|
var result500 = null;
|
|
637
631
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
638
|
-
return throwException("
|
|
632
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
639
633
|
});
|
|
640
634
|
}
|
|
641
635
|
else if (status !== 200 && status !== 204) {
|
|
@@ -647,8 +641,8 @@ var AuthClient = /** @class */ (function () {
|
|
|
647
641
|
};
|
|
648
642
|
/**
|
|
649
643
|
* Update user in tenant
|
|
650
|
-
* @tenantId Tenant Id
|
|
651
|
-
* @userId User Id
|
|
644
|
+
* @param tenantId Tenant Id
|
|
645
|
+
* @param userId User Id
|
|
652
646
|
* @return Updated
|
|
653
647
|
*/
|
|
654
648
|
AuthClient.prototype.updateUserInTenant = function (body, tenantId, userId) {
|
|
@@ -665,9 +659,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
665
659
|
var options_ = {
|
|
666
660
|
body: content_,
|
|
667
661
|
method: "PUT",
|
|
668
|
-
headers:
|
|
662
|
+
headers: {
|
|
669
663
|
"Content-Type": "application/json",
|
|
670
|
-
}
|
|
664
|
+
}
|
|
671
665
|
};
|
|
672
666
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
673
667
|
return _this.processUpdateUserInTenant(_response);
|
|
@@ -688,24 +682,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
688
682
|
}
|
|
689
683
|
else if (status === 401) {
|
|
690
684
|
return response.text().then(function (_responseText) {
|
|
691
|
-
return throwException("
|
|
685
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
692
686
|
});
|
|
693
687
|
}
|
|
694
688
|
else if (status === 403) {
|
|
695
689
|
return response.text().then(function (_responseText) {
|
|
696
|
-
return throwException("
|
|
690
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
697
691
|
});
|
|
698
692
|
}
|
|
699
693
|
else if (status === 404) {
|
|
700
694
|
return response.text().then(function (_responseText) {
|
|
701
|
-
return throwException("
|
|
695
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
702
696
|
});
|
|
703
697
|
}
|
|
704
698
|
else if (status === 500) {
|
|
705
699
|
return response.text().then(function (_responseText) {
|
|
706
700
|
var result500 = null;
|
|
707
701
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
708
|
-
return throwException("
|
|
702
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
709
703
|
});
|
|
710
704
|
}
|
|
711
705
|
else if (status !== 200 && status !== 204) {
|
|
@@ -717,8 +711,8 @@ var AuthClient = /** @class */ (function () {
|
|
|
717
711
|
};
|
|
718
712
|
/**
|
|
719
713
|
* Delete user from tenant
|
|
720
|
-
* @tenantId Tenant Id
|
|
721
|
-
* @userId User Id
|
|
714
|
+
* @param tenantId Tenant Id
|
|
715
|
+
* @param userId User Id
|
|
722
716
|
* @return Deleted
|
|
723
717
|
*/
|
|
724
718
|
AuthClient.prototype.deleteUserFromTenant = function (tenantId, userId) {
|
|
@@ -733,9 +727,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
733
727
|
url_ = url_.replace(/[?&]$/, "");
|
|
734
728
|
var options_ = {
|
|
735
729
|
method: "DELETE",
|
|
736
|
-
headers:
|
|
737
|
-
"Content-Type": "application/json",
|
|
738
|
-
})
|
|
730
|
+
headers: {}
|
|
739
731
|
};
|
|
740
732
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
741
733
|
return _this.processDeleteUserFromTenant(_response);
|
|
@@ -756,24 +748,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
756
748
|
}
|
|
757
749
|
else if (status === 401) {
|
|
758
750
|
return response.text().then(function (_responseText) {
|
|
759
|
-
return throwException("
|
|
751
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
760
752
|
});
|
|
761
753
|
}
|
|
762
754
|
else if (status === 403) {
|
|
763
755
|
return response.text().then(function (_responseText) {
|
|
764
|
-
return throwException("
|
|
756
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
765
757
|
});
|
|
766
758
|
}
|
|
767
759
|
else if (status === 404) {
|
|
768
760
|
return response.text().then(function (_responseText) {
|
|
769
|
-
return throwException("
|
|
761
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
770
762
|
});
|
|
771
763
|
}
|
|
772
764
|
else if (status === 500) {
|
|
773
765
|
return response.text().then(function (_responseText) {
|
|
774
766
|
var result500 = null;
|
|
775
767
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
776
|
-
return throwException("
|
|
768
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
777
769
|
});
|
|
778
770
|
}
|
|
779
771
|
else if (status !== 200 && status !== 204) {
|
|
@@ -785,8 +777,8 @@ var AuthClient = /** @class */ (function () {
|
|
|
785
777
|
};
|
|
786
778
|
/**
|
|
787
779
|
* Change user's password
|
|
788
|
-
* @tenantId Tenant Id
|
|
789
|
-
* @userId User Id
|
|
780
|
+
* @param tenantId Tenant Id
|
|
781
|
+
* @param userId User Id
|
|
790
782
|
* @return Updated
|
|
791
783
|
*/
|
|
792
784
|
AuthClient.prototype.changeUserPasswordInTenant = function (body, tenantId, userId) {
|
|
@@ -803,9 +795,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
803
795
|
var options_ = {
|
|
804
796
|
body: content_,
|
|
805
797
|
method: "PUT",
|
|
806
|
-
headers:
|
|
798
|
+
headers: {
|
|
807
799
|
"Content-Type": "application/json",
|
|
808
|
-
}
|
|
800
|
+
}
|
|
809
801
|
};
|
|
810
802
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
811
803
|
return _this.processChangeUserPasswordInTenant(_response);
|
|
@@ -826,24 +818,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
826
818
|
}
|
|
827
819
|
else if (status === 401) {
|
|
828
820
|
return response.text().then(function (_responseText) {
|
|
829
|
-
return throwException("
|
|
821
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
830
822
|
});
|
|
831
823
|
}
|
|
832
824
|
else if (status === 403) {
|
|
833
825
|
return response.text().then(function (_responseText) {
|
|
834
|
-
return throwException("
|
|
826
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
835
827
|
});
|
|
836
828
|
}
|
|
837
829
|
else if (status === 404) {
|
|
838
830
|
return response.text().then(function (_responseText) {
|
|
839
|
-
return throwException("
|
|
831
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
840
832
|
});
|
|
841
833
|
}
|
|
842
834
|
else if (status === 500) {
|
|
843
835
|
return response.text().then(function (_responseText) {
|
|
844
836
|
var result500 = null;
|
|
845
837
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
846
|
-
return throwException("
|
|
838
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
847
839
|
});
|
|
848
840
|
}
|
|
849
841
|
else if (status !== 200 && status !== 204) {
|
|
@@ -855,7 +847,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
855
847
|
};
|
|
856
848
|
/**
|
|
857
849
|
* Create new external SAML identity provider in tenant
|
|
858
|
-
* @tenantId Tenant Id
|
|
850
|
+
* @param tenantId Tenant Id
|
|
859
851
|
* @return Created
|
|
860
852
|
*/
|
|
861
853
|
AuthClient.prototype.createSamlProviderInTenant = function (body, tenantId) {
|
|
@@ -869,10 +861,10 @@ var AuthClient = /** @class */ (function () {
|
|
|
869
861
|
var options_ = {
|
|
870
862
|
body: content_,
|
|
871
863
|
method: "POST",
|
|
872
|
-
headers:
|
|
864
|
+
headers: {
|
|
873
865
|
"Content-Type": "application/json",
|
|
874
866
|
"Accept": "application/json"
|
|
875
|
-
}
|
|
867
|
+
}
|
|
876
868
|
};
|
|
877
869
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
878
870
|
return _this.processCreateSamlProviderInTenant(_response);
|
|
@@ -895,24 +887,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
895
887
|
}
|
|
896
888
|
else if (status === 401) {
|
|
897
889
|
return response.text().then(function (_responseText) {
|
|
898
|
-
return throwException("
|
|
890
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
899
891
|
});
|
|
900
892
|
}
|
|
901
893
|
else if (status === 403) {
|
|
902
894
|
return response.text().then(function (_responseText) {
|
|
903
|
-
return throwException("
|
|
895
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
904
896
|
});
|
|
905
897
|
}
|
|
906
898
|
else if (status === 404) {
|
|
907
899
|
return response.text().then(function (_responseText) {
|
|
908
|
-
return throwException("
|
|
900
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
909
901
|
});
|
|
910
902
|
}
|
|
911
903
|
else if (status === 500) {
|
|
912
904
|
return response.text().then(function (_responseText) {
|
|
913
905
|
var result500 = null;
|
|
914
906
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
915
|
-
return throwException("
|
|
907
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
916
908
|
});
|
|
917
909
|
}
|
|
918
910
|
else if (status !== 200 && status !== 204) {
|
|
@@ -924,7 +916,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
924
916
|
};
|
|
925
917
|
/**
|
|
926
918
|
* Get all external SAML identity providers in tenant
|
|
927
|
-
* @tenantId Tenant Id
|
|
919
|
+
* @param tenantId Tenant Id
|
|
928
920
|
* @return OK
|
|
929
921
|
*/
|
|
930
922
|
AuthClient.prototype.getSamlProvidersInTenant = function (tenantId) {
|
|
@@ -936,10 +928,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
936
928
|
url_ = url_.replace(/[?&]$/, "");
|
|
937
929
|
var options_ = {
|
|
938
930
|
method: "GET",
|
|
939
|
-
headers:
|
|
940
|
-
"Content-Type": "application/json",
|
|
931
|
+
headers: {
|
|
941
932
|
"Accept": "application/json"
|
|
942
|
-
}
|
|
933
|
+
}
|
|
943
934
|
};
|
|
944
935
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
945
936
|
return _this.processGetSamlProvidersInTenant(_response);
|
|
@@ -962,24 +953,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
962
953
|
}
|
|
963
954
|
else if (status === 401) {
|
|
964
955
|
return response.text().then(function (_responseText) {
|
|
965
|
-
return throwException("
|
|
956
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
966
957
|
});
|
|
967
958
|
}
|
|
968
959
|
else if (status === 403) {
|
|
969
960
|
return response.text().then(function (_responseText) {
|
|
970
|
-
return throwException("
|
|
961
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
971
962
|
});
|
|
972
963
|
}
|
|
973
964
|
else if (status === 404) {
|
|
974
965
|
return response.text().then(function (_responseText) {
|
|
975
|
-
return throwException("
|
|
966
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
976
967
|
});
|
|
977
968
|
}
|
|
978
969
|
else if (status === 500) {
|
|
979
970
|
return response.text().then(function (_responseText) {
|
|
980
971
|
var result500 = null;
|
|
981
972
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
982
|
-
return throwException("
|
|
973
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
983
974
|
});
|
|
984
975
|
}
|
|
985
976
|
else if (status !== 200 && status !== 204) {
|
|
@@ -991,22 +982,25 @@ var AuthClient = /** @class */ (function () {
|
|
|
991
982
|
};
|
|
992
983
|
/**
|
|
993
984
|
* Get external SAML identity provider from tenant
|
|
994
|
-
* @tenantId Tenant Id
|
|
985
|
+
* @param tenantId Tenant Id
|
|
986
|
+
* @param samlProviderId SAML Provider Id
|
|
995
987
|
* @return OK
|
|
996
988
|
*/
|
|
997
|
-
AuthClient.prototype.getSamlProviderFromTenant = function (tenantId) {
|
|
989
|
+
AuthClient.prototype.getSamlProviderFromTenant = function (tenantId, samlProviderId) {
|
|
998
990
|
var _this = this;
|
|
999
991
|
var url_ = this.baseUrl + "/tenants/{tenantId}/externalidps/saml/{samlProviderId}";
|
|
1000
992
|
if (tenantId === undefined || tenantId === null)
|
|
1001
993
|
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1002
994
|
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
995
|
+
if (samlProviderId === undefined || samlProviderId === null)
|
|
996
|
+
throw new Error("The parameter 'samlProviderId' must be defined.");
|
|
997
|
+
url_ = url_.replace("{samlProviderId}", encodeURIComponent("" + samlProviderId));
|
|
1003
998
|
url_ = url_.replace(/[?&]$/, "");
|
|
1004
999
|
var options_ = {
|
|
1005
1000
|
method: "GET",
|
|
1006
|
-
headers:
|
|
1007
|
-
"Content-Type": "application/json",
|
|
1001
|
+
headers: {
|
|
1008
1002
|
"Accept": "application/json"
|
|
1009
|
-
}
|
|
1003
|
+
}
|
|
1010
1004
|
};
|
|
1011
1005
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1012
1006
|
return _this.processGetSamlProviderFromTenant(_response);
|
|
@@ -1029,24 +1023,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
1029
1023
|
}
|
|
1030
1024
|
else if (status === 401) {
|
|
1031
1025
|
return response.text().then(function (_responseText) {
|
|
1032
|
-
return throwException("
|
|
1026
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1033
1027
|
});
|
|
1034
1028
|
}
|
|
1035
1029
|
else if (status === 403) {
|
|
1036
1030
|
return response.text().then(function (_responseText) {
|
|
1037
|
-
return throwException("
|
|
1031
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1038
1032
|
});
|
|
1039
1033
|
}
|
|
1040
1034
|
else if (status === 404) {
|
|
1041
1035
|
return response.text().then(function (_responseText) {
|
|
1042
|
-
return throwException("
|
|
1036
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1043
1037
|
});
|
|
1044
1038
|
}
|
|
1045
1039
|
else if (status === 500) {
|
|
1046
1040
|
return response.text().then(function (_responseText) {
|
|
1047
1041
|
var result500 = null;
|
|
1048
1042
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1049
|
-
return throwException("
|
|
1043
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1050
1044
|
});
|
|
1051
1045
|
}
|
|
1052
1046
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1058,23 +1052,27 @@ var AuthClient = /** @class */ (function () {
|
|
|
1058
1052
|
};
|
|
1059
1053
|
/**
|
|
1060
1054
|
* Update external SAML identity provider in tenant
|
|
1061
|
-
* @tenantId Tenant Id
|
|
1055
|
+
* @param tenantId Tenant Id
|
|
1056
|
+
* @param samlProviderId SAML Provider Id
|
|
1062
1057
|
* @return Updated
|
|
1063
1058
|
*/
|
|
1064
|
-
AuthClient.prototype.updateSamlProviderInTenant = function (body, tenantId) {
|
|
1059
|
+
AuthClient.prototype.updateSamlProviderInTenant = function (body, tenantId, samlProviderId) {
|
|
1065
1060
|
var _this = this;
|
|
1066
1061
|
var url_ = this.baseUrl + "/tenants/{tenantId}/externalidps/saml/{samlProviderId}";
|
|
1067
1062
|
if (tenantId === undefined || tenantId === null)
|
|
1068
1063
|
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1069
1064
|
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1065
|
+
if (samlProviderId === undefined || samlProviderId === null)
|
|
1066
|
+
throw new Error("The parameter 'samlProviderId' must be defined.");
|
|
1067
|
+
url_ = url_.replace("{samlProviderId}", encodeURIComponent("" + samlProviderId));
|
|
1070
1068
|
url_ = url_.replace(/[?&]$/, "");
|
|
1071
1069
|
var content_ = JSON.stringify(body);
|
|
1072
1070
|
var options_ = {
|
|
1073
1071
|
body: content_,
|
|
1074
1072
|
method: "PUT",
|
|
1075
|
-
headers:
|
|
1073
|
+
headers: {
|
|
1076
1074
|
"Content-Type": "application/json",
|
|
1077
|
-
}
|
|
1075
|
+
}
|
|
1078
1076
|
};
|
|
1079
1077
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1080
1078
|
return _this.processUpdateSamlProviderInTenant(_response);
|
|
@@ -1095,24 +1093,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
1095
1093
|
}
|
|
1096
1094
|
else if (status === 401) {
|
|
1097
1095
|
return response.text().then(function (_responseText) {
|
|
1098
|
-
return throwException("
|
|
1096
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1099
1097
|
});
|
|
1100
1098
|
}
|
|
1101
1099
|
else if (status === 403) {
|
|
1102
1100
|
return response.text().then(function (_responseText) {
|
|
1103
|
-
return throwException("
|
|
1101
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1104
1102
|
});
|
|
1105
1103
|
}
|
|
1106
1104
|
else if (status === 404) {
|
|
1107
1105
|
return response.text().then(function (_responseText) {
|
|
1108
|
-
return throwException("
|
|
1106
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1109
1107
|
});
|
|
1110
1108
|
}
|
|
1111
1109
|
else if (status === 500) {
|
|
1112
1110
|
return response.text().then(function (_responseText) {
|
|
1113
1111
|
var result500 = null;
|
|
1114
1112
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1115
|
-
return throwException("
|
|
1113
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1116
1114
|
});
|
|
1117
1115
|
}
|
|
1118
1116
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1124,21 +1122,23 @@ var AuthClient = /** @class */ (function () {
|
|
|
1124
1122
|
};
|
|
1125
1123
|
/**
|
|
1126
1124
|
* Delete external SAML identity provider from tenant
|
|
1127
|
-
* @tenantId Tenant Id
|
|
1125
|
+
* @param tenantId Tenant Id
|
|
1126
|
+
* @param samlProviderId SAML Provider Id
|
|
1128
1127
|
* @return Deleted
|
|
1129
1128
|
*/
|
|
1130
|
-
AuthClient.prototype.deleteSamlProviderFromTenant = function (tenantId) {
|
|
1129
|
+
AuthClient.prototype.deleteSamlProviderFromTenant = function (tenantId, samlProviderId) {
|
|
1131
1130
|
var _this = this;
|
|
1132
1131
|
var url_ = this.baseUrl + "/tenants/{tenantId}/externalidps/saml/{samlProviderId}";
|
|
1133
1132
|
if (tenantId === undefined || tenantId === null)
|
|
1134
1133
|
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1135
1134
|
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1135
|
+
if (samlProviderId === undefined || samlProviderId === null)
|
|
1136
|
+
throw new Error("The parameter 'samlProviderId' must be defined.");
|
|
1137
|
+
url_ = url_.replace("{samlProviderId}", encodeURIComponent("" + samlProviderId));
|
|
1136
1138
|
url_ = url_.replace(/[?&]$/, "");
|
|
1137
1139
|
var options_ = {
|
|
1138
1140
|
method: "DELETE",
|
|
1139
|
-
headers:
|
|
1140
|
-
"Content-Type": "application/json",
|
|
1141
|
-
})
|
|
1141
|
+
headers: {}
|
|
1142
1142
|
};
|
|
1143
1143
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1144
1144
|
return _this.processDeleteSamlProviderFromTenant(_response);
|
|
@@ -1159,24 +1159,365 @@ var AuthClient = /** @class */ (function () {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
else if (status === 401) {
|
|
1161
1161
|
return response.text().then(function (_responseText) {
|
|
1162
|
-
return throwException("
|
|
1162
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
else if (status === 403) {
|
|
1166
|
+
return response.text().then(function (_responseText) {
|
|
1167
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
else if (status === 404) {
|
|
1171
|
+
return response.text().then(function (_responseText) {
|
|
1172
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
else if (status === 500) {
|
|
1176
|
+
return response.text().then(function (_responseText) {
|
|
1177
|
+
var result500 = null;
|
|
1178
|
+
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1179
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1180
|
+
});
|
|
1181
|
+
}
|
|
1182
|
+
else if (status !== 200 && status !== 204) {
|
|
1183
|
+
return response.text().then(function (_responseText) {
|
|
1184
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
return Promise.resolve(null);
|
|
1188
|
+
};
|
|
1189
|
+
/**
|
|
1190
|
+
* Create new Apptio Frontdoor identity provider in tenant
|
|
1191
|
+
* @param tenantId Tenant Id
|
|
1192
|
+
* @return Created
|
|
1193
|
+
*/
|
|
1194
|
+
AuthClient.prototype.createFrontdoorProviderInTenant = function (body, tenantId) {
|
|
1195
|
+
var _this = this;
|
|
1196
|
+
var url_ = this.baseUrl + "/tenants/{tenantId}/externalidps/frontdoor";
|
|
1197
|
+
if (tenantId === undefined || tenantId === null)
|
|
1198
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1199
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1200
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1201
|
+
var content_ = JSON.stringify(body);
|
|
1202
|
+
var options_ = {
|
|
1203
|
+
body: content_,
|
|
1204
|
+
method: "POST",
|
|
1205
|
+
headers: {
|
|
1206
|
+
"Content-Type": "application/json",
|
|
1207
|
+
"Accept": "application/json"
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
1210
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1211
|
+
return _this.processCreateFrontdoorProviderInTenant(_response);
|
|
1212
|
+
});
|
|
1213
|
+
};
|
|
1214
|
+
AuthClient.prototype.processCreateFrontdoorProviderInTenant = function (response) {
|
|
1215
|
+
var _this = this;
|
|
1216
|
+
var status = response.status;
|
|
1217
|
+
var _headers = {};
|
|
1218
|
+
if (response.headers && response.headers.forEach) {
|
|
1219
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
1220
|
+
}
|
|
1221
|
+
;
|
|
1222
|
+
if (status === 201) {
|
|
1223
|
+
return response.text().then(function (_responseText) {
|
|
1224
|
+
var result201 = null;
|
|
1225
|
+
result201 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1226
|
+
return result201;
|
|
1227
|
+
});
|
|
1228
|
+
}
|
|
1229
|
+
else if (status === 401) {
|
|
1230
|
+
return response.text().then(function (_responseText) {
|
|
1231
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
else if (status === 403) {
|
|
1235
|
+
return response.text().then(function (_responseText) {
|
|
1236
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
1239
|
+
else if (status === 404) {
|
|
1240
|
+
return response.text().then(function (_responseText) {
|
|
1241
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
else if (status === 500) {
|
|
1245
|
+
return response.text().then(function (_responseText) {
|
|
1246
|
+
var result500 = null;
|
|
1247
|
+
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1248
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
else if (status !== 200 && status !== 204) {
|
|
1252
|
+
return response.text().then(function (_responseText) {
|
|
1253
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
return Promise.resolve(null);
|
|
1257
|
+
};
|
|
1258
|
+
/**
|
|
1259
|
+
* Get all Apptio Frontdoor identity providers in tenant
|
|
1260
|
+
* @param tenantId Tenant Id
|
|
1261
|
+
* @return OK
|
|
1262
|
+
*/
|
|
1263
|
+
AuthClient.prototype.getFrontdoorProvidersInTenant = function (tenantId) {
|
|
1264
|
+
var _this = this;
|
|
1265
|
+
var url_ = this.baseUrl + "/tenants/{tenantId}/externalidps/frontdoor";
|
|
1266
|
+
if (tenantId === undefined || tenantId === null)
|
|
1267
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1268
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1269
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1270
|
+
var options_ = {
|
|
1271
|
+
method: "GET",
|
|
1272
|
+
headers: {
|
|
1273
|
+
"Accept": "application/json"
|
|
1274
|
+
}
|
|
1275
|
+
};
|
|
1276
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1277
|
+
return _this.processGetFrontdoorProvidersInTenant(_response);
|
|
1278
|
+
});
|
|
1279
|
+
};
|
|
1280
|
+
AuthClient.prototype.processGetFrontdoorProvidersInTenant = function (response) {
|
|
1281
|
+
var _this = this;
|
|
1282
|
+
var status = response.status;
|
|
1283
|
+
var _headers = {};
|
|
1284
|
+
if (response.headers && response.headers.forEach) {
|
|
1285
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
1286
|
+
}
|
|
1287
|
+
;
|
|
1288
|
+
if (status === 200) {
|
|
1289
|
+
return response.text().then(function (_responseText) {
|
|
1290
|
+
var result200 = null;
|
|
1291
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1292
|
+
return result200;
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1295
|
+
else if (status === 401) {
|
|
1296
|
+
return response.text().then(function (_responseText) {
|
|
1297
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1298
|
+
});
|
|
1299
|
+
}
|
|
1300
|
+
else if (status === 403) {
|
|
1301
|
+
return response.text().then(function (_responseText) {
|
|
1302
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1303
|
+
});
|
|
1304
|
+
}
|
|
1305
|
+
else if (status === 404) {
|
|
1306
|
+
return response.text().then(function (_responseText) {
|
|
1307
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
else if (status === 500) {
|
|
1311
|
+
return response.text().then(function (_responseText) {
|
|
1312
|
+
var result500 = null;
|
|
1313
|
+
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1314
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
else if (status !== 200 && status !== 204) {
|
|
1318
|
+
return response.text().then(function (_responseText) {
|
|
1319
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1320
|
+
});
|
|
1321
|
+
}
|
|
1322
|
+
return Promise.resolve(null);
|
|
1323
|
+
};
|
|
1324
|
+
/**
|
|
1325
|
+
* Get Apptio Frontdoor identity provider from tenant
|
|
1326
|
+
* @param tenantId Tenant Id
|
|
1327
|
+
* @param frontdoorProviderId Frontdoor Provider Id
|
|
1328
|
+
* @return OK
|
|
1329
|
+
*/
|
|
1330
|
+
AuthClient.prototype.getFrontdoorProviderFromTenant = function (tenantId, frontdoorProviderId) {
|
|
1331
|
+
var _this = this;
|
|
1332
|
+
var url_ = this.baseUrl + "/tenants/{tenantId}/externalidps/frontdoor/{frontdoorProviderId}";
|
|
1333
|
+
if (tenantId === undefined || tenantId === null)
|
|
1334
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1335
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1336
|
+
if (frontdoorProviderId === undefined || frontdoorProviderId === null)
|
|
1337
|
+
throw new Error("The parameter 'frontdoorProviderId' must be defined.");
|
|
1338
|
+
url_ = url_.replace("{frontdoorProviderId}", encodeURIComponent("" + frontdoorProviderId));
|
|
1339
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1340
|
+
var options_ = {
|
|
1341
|
+
method: "GET",
|
|
1342
|
+
headers: {
|
|
1343
|
+
"Accept": "application/json"
|
|
1344
|
+
}
|
|
1345
|
+
};
|
|
1346
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1347
|
+
return _this.processGetFrontdoorProviderFromTenant(_response);
|
|
1348
|
+
});
|
|
1349
|
+
};
|
|
1350
|
+
AuthClient.prototype.processGetFrontdoorProviderFromTenant = function (response) {
|
|
1351
|
+
var _this = this;
|
|
1352
|
+
var status = response.status;
|
|
1353
|
+
var _headers = {};
|
|
1354
|
+
if (response.headers && response.headers.forEach) {
|
|
1355
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
1356
|
+
}
|
|
1357
|
+
;
|
|
1358
|
+
if (status === 200) {
|
|
1359
|
+
return response.text().then(function (_responseText) {
|
|
1360
|
+
var result200 = null;
|
|
1361
|
+
result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1362
|
+
return result200;
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
else if (status === 401) {
|
|
1366
|
+
return response.text().then(function (_responseText) {
|
|
1367
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1368
|
+
});
|
|
1369
|
+
}
|
|
1370
|
+
else if (status === 403) {
|
|
1371
|
+
return response.text().then(function (_responseText) {
|
|
1372
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
else if (status === 404) {
|
|
1376
|
+
return response.text().then(function (_responseText) {
|
|
1377
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1380
|
+
else if (status === 500) {
|
|
1381
|
+
return response.text().then(function (_responseText) {
|
|
1382
|
+
var result500 = null;
|
|
1383
|
+
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1384
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
else if (status !== 200 && status !== 204) {
|
|
1388
|
+
return response.text().then(function (_responseText) {
|
|
1389
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
return Promise.resolve(null);
|
|
1393
|
+
};
|
|
1394
|
+
/**
|
|
1395
|
+
* Update Apptio Frontdoor identity provider in tenant
|
|
1396
|
+
* @param tenantId Tenant Id
|
|
1397
|
+
* @param frontdoorProviderId Frontdoor Provider Id
|
|
1398
|
+
* @return Updated
|
|
1399
|
+
*/
|
|
1400
|
+
AuthClient.prototype.updateFrontdoorProviderInTenant = function (body, tenantId, frontdoorProviderId) {
|
|
1401
|
+
var _this = this;
|
|
1402
|
+
var url_ = this.baseUrl + "/tenants/{tenantId}/externalidps/frontdoor/{frontdoorProviderId}";
|
|
1403
|
+
if (tenantId === undefined || tenantId === null)
|
|
1404
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1405
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1406
|
+
if (frontdoorProviderId === undefined || frontdoorProviderId === null)
|
|
1407
|
+
throw new Error("The parameter 'frontdoorProviderId' must be defined.");
|
|
1408
|
+
url_ = url_.replace("{frontdoorProviderId}", encodeURIComponent("" + frontdoorProviderId));
|
|
1409
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1410
|
+
var content_ = JSON.stringify(body);
|
|
1411
|
+
var options_ = {
|
|
1412
|
+
body: content_,
|
|
1413
|
+
method: "PUT",
|
|
1414
|
+
headers: {
|
|
1415
|
+
"Content-Type": "application/json",
|
|
1416
|
+
}
|
|
1417
|
+
};
|
|
1418
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1419
|
+
return _this.processUpdateFrontdoorProviderInTenant(_response);
|
|
1420
|
+
});
|
|
1421
|
+
};
|
|
1422
|
+
AuthClient.prototype.processUpdateFrontdoorProviderInTenant = function (response) {
|
|
1423
|
+
var _this = this;
|
|
1424
|
+
var status = response.status;
|
|
1425
|
+
var _headers = {};
|
|
1426
|
+
if (response.headers && response.headers.forEach) {
|
|
1427
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
1428
|
+
}
|
|
1429
|
+
;
|
|
1430
|
+
if (status === 200) {
|
|
1431
|
+
return response.text().then(function (_responseText) {
|
|
1432
|
+
return;
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
else if (status === 401) {
|
|
1436
|
+
return response.text().then(function (_responseText) {
|
|
1437
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
else if (status === 403) {
|
|
1441
|
+
return response.text().then(function (_responseText) {
|
|
1442
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1443
|
+
});
|
|
1444
|
+
}
|
|
1445
|
+
else if (status === 404) {
|
|
1446
|
+
return response.text().then(function (_responseText) {
|
|
1447
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
else if (status === 500) {
|
|
1451
|
+
return response.text().then(function (_responseText) {
|
|
1452
|
+
var result500 = null;
|
|
1453
|
+
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1454
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1455
|
+
});
|
|
1456
|
+
}
|
|
1457
|
+
else if (status !== 200 && status !== 204) {
|
|
1458
|
+
return response.text().then(function (_responseText) {
|
|
1459
|
+
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1462
|
+
return Promise.resolve(null);
|
|
1463
|
+
};
|
|
1464
|
+
/**
|
|
1465
|
+
* Delete Apptio Frontdoor identity provider from tenant
|
|
1466
|
+
* @param tenantId Tenant Id
|
|
1467
|
+
* @param frontdoorProviderId Frontdoor Provider Id
|
|
1468
|
+
* @return Deleted
|
|
1469
|
+
*/
|
|
1470
|
+
AuthClient.prototype.deleteFrontdoorProviderFromTenant = function (tenantId, frontdoorProviderId) {
|
|
1471
|
+
var _this = this;
|
|
1472
|
+
var url_ = this.baseUrl + "/tenants/{tenantId}/externalidps/frontdoor/{frontdoorProviderId}";
|
|
1473
|
+
if (tenantId === undefined || tenantId === null)
|
|
1474
|
+
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1475
|
+
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1476
|
+
if (frontdoorProviderId === undefined || frontdoorProviderId === null)
|
|
1477
|
+
throw new Error("The parameter 'frontdoorProviderId' must be defined.");
|
|
1478
|
+
url_ = url_.replace("{frontdoorProviderId}", encodeURIComponent("" + frontdoorProviderId));
|
|
1479
|
+
url_ = url_.replace(/[?&]$/, "");
|
|
1480
|
+
var options_ = {
|
|
1481
|
+
method: "DELETE",
|
|
1482
|
+
headers: {}
|
|
1483
|
+
};
|
|
1484
|
+
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1485
|
+
return _this.processDeleteFrontdoorProviderFromTenant(_response);
|
|
1486
|
+
});
|
|
1487
|
+
};
|
|
1488
|
+
AuthClient.prototype.processDeleteFrontdoorProviderFromTenant = function (response) {
|
|
1489
|
+
var _this = this;
|
|
1490
|
+
var status = response.status;
|
|
1491
|
+
var _headers = {};
|
|
1492
|
+
if (response.headers && response.headers.forEach) {
|
|
1493
|
+
response.headers.forEach(function (v, k) { return _headers[k] = v; });
|
|
1494
|
+
}
|
|
1495
|
+
;
|
|
1496
|
+
if (status === 204) {
|
|
1497
|
+
return response.text().then(function (_responseText) {
|
|
1498
|
+
return;
|
|
1499
|
+
});
|
|
1500
|
+
}
|
|
1501
|
+
else if (status === 401) {
|
|
1502
|
+
return response.text().then(function (_responseText) {
|
|
1503
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1163
1504
|
});
|
|
1164
1505
|
}
|
|
1165
1506
|
else if (status === 403) {
|
|
1166
1507
|
return response.text().then(function (_responseText) {
|
|
1167
|
-
return throwException("
|
|
1508
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1168
1509
|
});
|
|
1169
1510
|
}
|
|
1170
1511
|
else if (status === 404) {
|
|
1171
1512
|
return response.text().then(function (_responseText) {
|
|
1172
|
-
return throwException("
|
|
1513
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1173
1514
|
});
|
|
1174
1515
|
}
|
|
1175
1516
|
else if (status === 500) {
|
|
1176
1517
|
return response.text().then(function (_responseText) {
|
|
1177
1518
|
var result500 = null;
|
|
1178
1519
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1179
|
-
return throwException("
|
|
1520
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1180
1521
|
});
|
|
1181
1522
|
}
|
|
1182
1523
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1188,7 +1529,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
1188
1529
|
};
|
|
1189
1530
|
/**
|
|
1190
1531
|
* Create new external SSO profile in tenant
|
|
1191
|
-
* @tenantId Tenant Id
|
|
1532
|
+
* @param tenantId Tenant Id
|
|
1192
1533
|
* @return Created
|
|
1193
1534
|
*/
|
|
1194
1535
|
AuthClient.prototype.createSsoProfileInTenant = function (body, tenantId) {
|
|
@@ -1202,10 +1543,10 @@ var AuthClient = /** @class */ (function () {
|
|
|
1202
1543
|
var options_ = {
|
|
1203
1544
|
body: content_,
|
|
1204
1545
|
method: "POST",
|
|
1205
|
-
headers:
|
|
1546
|
+
headers: {
|
|
1206
1547
|
"Content-Type": "application/json",
|
|
1207
1548
|
"Accept": "application/json"
|
|
1208
|
-
}
|
|
1549
|
+
}
|
|
1209
1550
|
};
|
|
1210
1551
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1211
1552
|
return _this.processCreateSsoProfileInTenant(_response);
|
|
@@ -1228,24 +1569,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
1228
1569
|
}
|
|
1229
1570
|
else if (status === 401) {
|
|
1230
1571
|
return response.text().then(function (_responseText) {
|
|
1231
|
-
return throwException("
|
|
1572
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1232
1573
|
});
|
|
1233
1574
|
}
|
|
1234
1575
|
else if (status === 403) {
|
|
1235
1576
|
return response.text().then(function (_responseText) {
|
|
1236
|
-
return throwException("
|
|
1577
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1237
1578
|
});
|
|
1238
1579
|
}
|
|
1239
1580
|
else if (status === 404) {
|
|
1240
1581
|
return response.text().then(function (_responseText) {
|
|
1241
|
-
return throwException("
|
|
1582
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1242
1583
|
});
|
|
1243
1584
|
}
|
|
1244
1585
|
else if (status === 500) {
|
|
1245
1586
|
return response.text().then(function (_responseText) {
|
|
1246
1587
|
var result500 = null;
|
|
1247
1588
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1248
|
-
return throwException("
|
|
1589
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1249
1590
|
});
|
|
1250
1591
|
}
|
|
1251
1592
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1257,22 +1598,25 @@ var AuthClient = /** @class */ (function () {
|
|
|
1257
1598
|
};
|
|
1258
1599
|
/**
|
|
1259
1600
|
* Get external SSO profile from tenant
|
|
1260
|
-
* @tenantId Tenant Id
|
|
1601
|
+
* @param tenantId Tenant Id
|
|
1602
|
+
* @param ssoProfileId External SSO Profile Id
|
|
1261
1603
|
* @return OK
|
|
1262
1604
|
*/
|
|
1263
|
-
AuthClient.prototype.getSsoProfileFromTenant = function (tenantId) {
|
|
1605
|
+
AuthClient.prototype.getSsoProfileFromTenant = function (tenantId, ssoProfileId) {
|
|
1264
1606
|
var _this = this;
|
|
1265
1607
|
var url_ = this.baseUrl + "/tenants/{tenantId}/externalssoprofiles/{ssoProfileId}";
|
|
1266
1608
|
if (tenantId === undefined || tenantId === null)
|
|
1267
1609
|
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1268
1610
|
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1611
|
+
if (ssoProfileId === undefined || ssoProfileId === null)
|
|
1612
|
+
throw new Error("The parameter 'ssoProfileId' must be defined.");
|
|
1613
|
+
url_ = url_.replace("{ssoProfileId}", encodeURIComponent("" + ssoProfileId));
|
|
1269
1614
|
url_ = url_.replace(/[?&]$/, "");
|
|
1270
1615
|
var options_ = {
|
|
1271
1616
|
method: "GET",
|
|
1272
|
-
headers:
|
|
1273
|
-
"Content-Type": "application/json",
|
|
1617
|
+
headers: {
|
|
1274
1618
|
"Accept": "application/json"
|
|
1275
|
-
}
|
|
1619
|
+
}
|
|
1276
1620
|
};
|
|
1277
1621
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1278
1622
|
return _this.processGetSsoProfileFromTenant(_response);
|
|
@@ -1295,24 +1639,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
1295
1639
|
}
|
|
1296
1640
|
else if (status === 401) {
|
|
1297
1641
|
return response.text().then(function (_responseText) {
|
|
1298
|
-
return throwException("
|
|
1642
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1299
1643
|
});
|
|
1300
1644
|
}
|
|
1301
1645
|
else if (status === 403) {
|
|
1302
1646
|
return response.text().then(function (_responseText) {
|
|
1303
|
-
return throwException("
|
|
1647
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1304
1648
|
});
|
|
1305
1649
|
}
|
|
1306
1650
|
else if (status === 404) {
|
|
1307
1651
|
return response.text().then(function (_responseText) {
|
|
1308
|
-
return throwException("
|
|
1652
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1309
1653
|
});
|
|
1310
1654
|
}
|
|
1311
1655
|
else if (status === 500) {
|
|
1312
1656
|
return response.text().then(function (_responseText) {
|
|
1313
1657
|
var result500 = null;
|
|
1314
1658
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1315
|
-
return throwException("
|
|
1659
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1316
1660
|
});
|
|
1317
1661
|
}
|
|
1318
1662
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1324,23 +1668,27 @@ var AuthClient = /** @class */ (function () {
|
|
|
1324
1668
|
};
|
|
1325
1669
|
/**
|
|
1326
1670
|
* Update external SSO profile in tenant
|
|
1327
|
-
* @tenantId Tenant Id
|
|
1671
|
+
* @param tenantId Tenant Id
|
|
1672
|
+
* @param ssoProfileId External SSO Profile Id
|
|
1328
1673
|
* @return Updated
|
|
1329
1674
|
*/
|
|
1330
|
-
AuthClient.prototype.updateSsoProfileInTenant = function (body, tenantId) {
|
|
1675
|
+
AuthClient.prototype.updateSsoProfileInTenant = function (body, tenantId, ssoProfileId) {
|
|
1331
1676
|
var _this = this;
|
|
1332
1677
|
var url_ = this.baseUrl + "/tenants/{tenantId}/externalssoprofiles/{ssoProfileId}";
|
|
1333
1678
|
if (tenantId === undefined || tenantId === null)
|
|
1334
1679
|
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1335
1680
|
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1681
|
+
if (ssoProfileId === undefined || ssoProfileId === null)
|
|
1682
|
+
throw new Error("The parameter 'ssoProfileId' must be defined.");
|
|
1683
|
+
url_ = url_.replace("{ssoProfileId}", encodeURIComponent("" + ssoProfileId));
|
|
1336
1684
|
url_ = url_.replace(/[?&]$/, "");
|
|
1337
1685
|
var content_ = JSON.stringify(body);
|
|
1338
1686
|
var options_ = {
|
|
1339
1687
|
body: content_,
|
|
1340
1688
|
method: "PUT",
|
|
1341
|
-
headers:
|
|
1689
|
+
headers: {
|
|
1342
1690
|
"Content-Type": "application/json",
|
|
1343
|
-
}
|
|
1691
|
+
}
|
|
1344
1692
|
};
|
|
1345
1693
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1346
1694
|
return _this.processUpdateSsoProfileInTenant(_response);
|
|
@@ -1361,24 +1709,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
1361
1709
|
}
|
|
1362
1710
|
else if (status === 401) {
|
|
1363
1711
|
return response.text().then(function (_responseText) {
|
|
1364
|
-
return throwException("
|
|
1712
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1365
1713
|
});
|
|
1366
1714
|
}
|
|
1367
1715
|
else if (status === 403) {
|
|
1368
1716
|
return response.text().then(function (_responseText) {
|
|
1369
|
-
return throwException("
|
|
1717
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1370
1718
|
});
|
|
1371
1719
|
}
|
|
1372
1720
|
else if (status === 404) {
|
|
1373
1721
|
return response.text().then(function (_responseText) {
|
|
1374
|
-
return throwException("
|
|
1722
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1375
1723
|
});
|
|
1376
1724
|
}
|
|
1377
1725
|
else if (status === 500) {
|
|
1378
1726
|
return response.text().then(function (_responseText) {
|
|
1379
1727
|
var result500 = null;
|
|
1380
1728
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1381
|
-
return throwException("
|
|
1729
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1382
1730
|
});
|
|
1383
1731
|
}
|
|
1384
1732
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1390,21 +1738,23 @@ var AuthClient = /** @class */ (function () {
|
|
|
1390
1738
|
};
|
|
1391
1739
|
/**
|
|
1392
1740
|
* Delete external SSO profile from tenant
|
|
1393
|
-
* @tenantId Tenant Id
|
|
1741
|
+
* @param tenantId Tenant Id
|
|
1742
|
+
* @param ssoProfileId External SSO Profile Id
|
|
1394
1743
|
* @return Deleted
|
|
1395
1744
|
*/
|
|
1396
|
-
AuthClient.prototype.deleteSsoProfileFromTenant = function (tenantId) {
|
|
1745
|
+
AuthClient.prototype.deleteSsoProfileFromTenant = function (tenantId, ssoProfileId) {
|
|
1397
1746
|
var _this = this;
|
|
1398
1747
|
var url_ = this.baseUrl + "/tenants/{tenantId}/externalssoprofiles/{ssoProfileId}";
|
|
1399
1748
|
if (tenantId === undefined || tenantId === null)
|
|
1400
1749
|
throw new Error("The parameter 'tenantId' must be defined.");
|
|
1401
1750
|
url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
|
|
1751
|
+
if (ssoProfileId === undefined || ssoProfileId === null)
|
|
1752
|
+
throw new Error("The parameter 'ssoProfileId' must be defined.");
|
|
1753
|
+
url_ = url_.replace("{ssoProfileId}", encodeURIComponent("" + ssoProfileId));
|
|
1402
1754
|
url_ = url_.replace(/[?&]$/, "");
|
|
1403
1755
|
var options_ = {
|
|
1404
1756
|
method: "DELETE",
|
|
1405
|
-
headers:
|
|
1406
|
-
"Content-Type": "application/json",
|
|
1407
|
-
})
|
|
1757
|
+
headers: {}
|
|
1408
1758
|
};
|
|
1409
1759
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1410
1760
|
return _this.processDeleteSsoProfileFromTenant(_response);
|
|
@@ -1425,24 +1775,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
1425
1775
|
}
|
|
1426
1776
|
else if (status === 401) {
|
|
1427
1777
|
return response.text().then(function (_responseText) {
|
|
1428
|
-
return throwException("
|
|
1778
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1429
1779
|
});
|
|
1430
1780
|
}
|
|
1431
1781
|
else if (status === 403) {
|
|
1432
1782
|
return response.text().then(function (_responseText) {
|
|
1433
|
-
return throwException("
|
|
1783
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1434
1784
|
});
|
|
1435
1785
|
}
|
|
1436
1786
|
else if (status === 404) {
|
|
1437
1787
|
return response.text().then(function (_responseText) {
|
|
1438
|
-
return throwException("
|
|
1788
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1439
1789
|
});
|
|
1440
1790
|
}
|
|
1441
1791
|
else if (status === 500) {
|
|
1442
1792
|
return response.text().then(function (_responseText) {
|
|
1443
1793
|
var result500 = null;
|
|
1444
1794
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1445
|
-
return throwException("
|
|
1795
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1446
1796
|
});
|
|
1447
1797
|
}
|
|
1448
1798
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1464,10 +1814,10 @@ var AuthClient = /** @class */ (function () {
|
|
|
1464
1814
|
var options_ = {
|
|
1465
1815
|
body: content_,
|
|
1466
1816
|
method: "POST",
|
|
1467
|
-
headers:
|
|
1817
|
+
headers: {
|
|
1468
1818
|
"Content-Type": "application/json",
|
|
1469
1819
|
"Accept": "application/json"
|
|
1470
|
-
}
|
|
1820
|
+
}
|
|
1471
1821
|
};
|
|
1472
1822
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1473
1823
|
return _this.processCreateClient(_response);
|
|
@@ -1490,19 +1840,19 @@ var AuthClient = /** @class */ (function () {
|
|
|
1490
1840
|
}
|
|
1491
1841
|
else if (status === 401) {
|
|
1492
1842
|
return response.text().then(function (_responseText) {
|
|
1493
|
-
return throwException("
|
|
1843
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1494
1844
|
});
|
|
1495
1845
|
}
|
|
1496
1846
|
else if (status === 403) {
|
|
1497
1847
|
return response.text().then(function (_responseText) {
|
|
1498
|
-
return throwException("
|
|
1848
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1499
1849
|
});
|
|
1500
1850
|
}
|
|
1501
1851
|
else if (status === 500) {
|
|
1502
1852
|
return response.text().then(function (_responseText) {
|
|
1503
1853
|
var result500 = null;
|
|
1504
1854
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1505
|
-
return throwException("
|
|
1855
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1506
1856
|
});
|
|
1507
1857
|
}
|
|
1508
1858
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1514,7 +1864,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
1514
1864
|
};
|
|
1515
1865
|
/**
|
|
1516
1866
|
* Update client
|
|
1517
|
-
* @clientId Client Id
|
|
1867
|
+
* @param clientId Client Id
|
|
1518
1868
|
* @return Updated
|
|
1519
1869
|
*/
|
|
1520
1870
|
AuthClient.prototype.updateClient = function (body, clientId) {
|
|
@@ -1528,9 +1878,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
1528
1878
|
var options_ = {
|
|
1529
1879
|
body: content_,
|
|
1530
1880
|
method: "PUT",
|
|
1531
|
-
headers:
|
|
1881
|
+
headers: {
|
|
1532
1882
|
"Content-Type": "application/json",
|
|
1533
|
-
}
|
|
1883
|
+
}
|
|
1534
1884
|
};
|
|
1535
1885
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1536
1886
|
return _this.processUpdateClient(_response);
|
|
@@ -1551,24 +1901,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
1551
1901
|
}
|
|
1552
1902
|
else if (status === 401) {
|
|
1553
1903
|
return response.text().then(function (_responseText) {
|
|
1554
|
-
return throwException("
|
|
1904
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1555
1905
|
});
|
|
1556
1906
|
}
|
|
1557
1907
|
else if (status === 403) {
|
|
1558
1908
|
return response.text().then(function (_responseText) {
|
|
1559
|
-
return throwException("
|
|
1909
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1560
1910
|
});
|
|
1561
1911
|
}
|
|
1562
1912
|
else if (status === 404) {
|
|
1563
1913
|
return response.text().then(function (_responseText) {
|
|
1564
|
-
return throwException("
|
|
1914
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1565
1915
|
});
|
|
1566
1916
|
}
|
|
1567
1917
|
else if (status === 500) {
|
|
1568
1918
|
return response.text().then(function (_responseText) {
|
|
1569
1919
|
var result500 = null;
|
|
1570
1920
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1571
|
-
return throwException("
|
|
1921
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1572
1922
|
});
|
|
1573
1923
|
}
|
|
1574
1924
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1580,7 +1930,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
1580
1930
|
};
|
|
1581
1931
|
/**
|
|
1582
1932
|
* Get client
|
|
1583
|
-
* @clientId Client Id
|
|
1933
|
+
* @param clientId Client Id
|
|
1584
1934
|
* @return OK
|
|
1585
1935
|
*/
|
|
1586
1936
|
AuthClient.prototype.getClient = function (clientId) {
|
|
@@ -1592,10 +1942,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
1592
1942
|
url_ = url_.replace(/[?&]$/, "");
|
|
1593
1943
|
var options_ = {
|
|
1594
1944
|
method: "GET",
|
|
1595
|
-
headers:
|
|
1596
|
-
"Content-Type": "application/json",
|
|
1945
|
+
headers: {
|
|
1597
1946
|
"Accept": "application/json"
|
|
1598
|
-
}
|
|
1947
|
+
}
|
|
1599
1948
|
};
|
|
1600
1949
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1601
1950
|
return _this.processGetClient(_response);
|
|
@@ -1618,24 +1967,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
1618
1967
|
}
|
|
1619
1968
|
else if (status === 401) {
|
|
1620
1969
|
return response.text().then(function (_responseText) {
|
|
1621
|
-
return throwException("
|
|
1970
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1622
1971
|
});
|
|
1623
1972
|
}
|
|
1624
1973
|
else if (status === 403) {
|
|
1625
1974
|
return response.text().then(function (_responseText) {
|
|
1626
|
-
return throwException("
|
|
1975
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1627
1976
|
});
|
|
1628
1977
|
}
|
|
1629
1978
|
else if (status === 404) {
|
|
1630
1979
|
return response.text().then(function (_responseText) {
|
|
1631
|
-
return throwException("
|
|
1980
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1632
1981
|
});
|
|
1633
1982
|
}
|
|
1634
1983
|
else if (status === 500) {
|
|
1635
1984
|
return response.text().then(function (_responseText) {
|
|
1636
1985
|
var result500 = null;
|
|
1637
1986
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1638
|
-
return throwException("
|
|
1987
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1639
1988
|
});
|
|
1640
1989
|
}
|
|
1641
1990
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1647,7 +1996,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
1647
1996
|
};
|
|
1648
1997
|
/**
|
|
1649
1998
|
* Delete client
|
|
1650
|
-
* @clientId Client Id
|
|
1999
|
+
* @param clientId Client Id
|
|
1651
2000
|
* @return Deleted
|
|
1652
2001
|
*/
|
|
1653
2002
|
AuthClient.prototype.deleteClient = function (clientId) {
|
|
@@ -1659,9 +2008,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
1659
2008
|
url_ = url_.replace(/[?&]$/, "");
|
|
1660
2009
|
var options_ = {
|
|
1661
2010
|
method: "DELETE",
|
|
1662
|
-
headers:
|
|
1663
|
-
"Content-Type": "application/json",
|
|
1664
|
-
})
|
|
2011
|
+
headers: {}
|
|
1665
2012
|
};
|
|
1666
2013
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1667
2014
|
return _this.processDeleteClient(_response);
|
|
@@ -1682,24 +2029,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
1682
2029
|
}
|
|
1683
2030
|
else if (status === 401) {
|
|
1684
2031
|
return response.text().then(function (_responseText) {
|
|
1685
|
-
return throwException("
|
|
2032
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1686
2033
|
});
|
|
1687
2034
|
}
|
|
1688
2035
|
else if (status === 403) {
|
|
1689
2036
|
return response.text().then(function (_responseText) {
|
|
1690
|
-
return throwException("
|
|
2037
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1691
2038
|
});
|
|
1692
2039
|
}
|
|
1693
2040
|
else if (status === 404) {
|
|
1694
2041
|
return response.text().then(function (_responseText) {
|
|
1695
|
-
return throwException("
|
|
2042
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1696
2043
|
});
|
|
1697
2044
|
}
|
|
1698
2045
|
else if (status === 500) {
|
|
1699
2046
|
return response.text().then(function (_responseText) {
|
|
1700
2047
|
var result500 = null;
|
|
1701
2048
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1702
|
-
return throwException("
|
|
2049
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1703
2050
|
});
|
|
1704
2051
|
}
|
|
1705
2052
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1719,10 +2066,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
1719
2066
|
url_ = url_.replace(/[?&]$/, "");
|
|
1720
2067
|
var options_ = {
|
|
1721
2068
|
method: "GET",
|
|
1722
|
-
headers:
|
|
1723
|
-
"Content-Type": "application/json",
|
|
2069
|
+
headers: {
|
|
1724
2070
|
"Accept": "application/json"
|
|
1725
|
-
}
|
|
2071
|
+
}
|
|
1726
2072
|
};
|
|
1727
2073
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1728
2074
|
return _this.processGetApiResources(_response);
|
|
@@ -1745,19 +2091,19 @@ var AuthClient = /** @class */ (function () {
|
|
|
1745
2091
|
}
|
|
1746
2092
|
else if (status === 401) {
|
|
1747
2093
|
return response.text().then(function (_responseText) {
|
|
1748
|
-
return throwException("
|
|
2094
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1749
2095
|
});
|
|
1750
2096
|
}
|
|
1751
2097
|
else if (status === 403) {
|
|
1752
2098
|
return response.text().then(function (_responseText) {
|
|
1753
|
-
return throwException("
|
|
2099
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1754
2100
|
});
|
|
1755
2101
|
}
|
|
1756
2102
|
else if (status === 500) {
|
|
1757
2103
|
return response.text().then(function (_responseText) {
|
|
1758
2104
|
var result500 = null;
|
|
1759
2105
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1760
|
-
return throwException("
|
|
2106
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1761
2107
|
});
|
|
1762
2108
|
}
|
|
1763
2109
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1779,10 +2125,10 @@ var AuthClient = /** @class */ (function () {
|
|
|
1779
2125
|
var options_ = {
|
|
1780
2126
|
body: content_,
|
|
1781
2127
|
method: "POST",
|
|
1782
|
-
headers:
|
|
2128
|
+
headers: {
|
|
1783
2129
|
"Content-Type": "application/json",
|
|
1784
2130
|
"Accept": "application/json"
|
|
1785
|
-
}
|
|
2131
|
+
}
|
|
1786
2132
|
};
|
|
1787
2133
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1788
2134
|
return _this.processCreateApiResource(_response);
|
|
@@ -1805,19 +2151,19 @@ var AuthClient = /** @class */ (function () {
|
|
|
1805
2151
|
}
|
|
1806
2152
|
else if (status === 401) {
|
|
1807
2153
|
return response.text().then(function (_responseText) {
|
|
1808
|
-
return throwException("
|
|
2154
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1809
2155
|
});
|
|
1810
2156
|
}
|
|
1811
2157
|
else if (status === 403) {
|
|
1812
2158
|
return response.text().then(function (_responseText) {
|
|
1813
|
-
return throwException("
|
|
2159
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1814
2160
|
});
|
|
1815
2161
|
}
|
|
1816
2162
|
else if (status === 500) {
|
|
1817
2163
|
return response.text().then(function (_responseText) {
|
|
1818
2164
|
var result500 = null;
|
|
1819
2165
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1820
|
-
return throwException("
|
|
2166
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1821
2167
|
});
|
|
1822
2168
|
}
|
|
1823
2169
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1829,7 +2175,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
1829
2175
|
};
|
|
1830
2176
|
/**
|
|
1831
2177
|
* Get api resource
|
|
1832
|
-
* @resourceName Api resource name
|
|
2178
|
+
* @param resourceName Api resource name
|
|
1833
2179
|
* @return OK
|
|
1834
2180
|
*/
|
|
1835
2181
|
AuthClient.prototype.getApiResource = function (resourceName) {
|
|
@@ -1841,10 +2187,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
1841
2187
|
url_ = url_.replace(/[?&]$/, "");
|
|
1842
2188
|
var options_ = {
|
|
1843
2189
|
method: "GET",
|
|
1844
|
-
headers:
|
|
1845
|
-
"Content-Type": "application/json",
|
|
2190
|
+
headers: {
|
|
1846
2191
|
"Accept": "application/json"
|
|
1847
|
-
}
|
|
2192
|
+
}
|
|
1848
2193
|
};
|
|
1849
2194
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1850
2195
|
return _this.processGetApiResource(_response);
|
|
@@ -1867,24 +2212,24 @@ var AuthClient = /** @class */ (function () {
|
|
|
1867
2212
|
}
|
|
1868
2213
|
else if (status === 401) {
|
|
1869
2214
|
return response.text().then(function (_responseText) {
|
|
1870
|
-
return throwException("
|
|
2215
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1871
2216
|
});
|
|
1872
2217
|
}
|
|
1873
2218
|
else if (status === 403) {
|
|
1874
2219
|
return response.text().then(function (_responseText) {
|
|
1875
|
-
return throwException("
|
|
2220
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1876
2221
|
});
|
|
1877
2222
|
}
|
|
1878
2223
|
else if (status === 404) {
|
|
1879
2224
|
return response.text().then(function (_responseText) {
|
|
1880
|
-
return throwException("
|
|
2225
|
+
return throwException("NotFound", status, _responseText, _headers);
|
|
1881
2226
|
});
|
|
1882
2227
|
}
|
|
1883
2228
|
else if (status === 500) {
|
|
1884
2229
|
return response.text().then(function (_responseText) {
|
|
1885
2230
|
var result500 = null;
|
|
1886
2231
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1887
|
-
return throwException("
|
|
2232
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1888
2233
|
});
|
|
1889
2234
|
}
|
|
1890
2235
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1896,7 +2241,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
1896
2241
|
};
|
|
1897
2242
|
/**
|
|
1898
2243
|
* Delete api resources
|
|
1899
|
-
* @resourceName Api resource name
|
|
2244
|
+
* @param resourceName Api resource name
|
|
1900
2245
|
* @return OK
|
|
1901
2246
|
*/
|
|
1902
2247
|
AuthClient.prototype.deleteApiResource = function (resourceName) {
|
|
@@ -1908,9 +2253,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
1908
2253
|
url_ = url_.replace(/[?&]$/, "");
|
|
1909
2254
|
var options_ = {
|
|
1910
2255
|
method: "DELETE",
|
|
1911
|
-
headers:
|
|
1912
|
-
"Content-Type": "application/json",
|
|
1913
|
-
})
|
|
2256
|
+
headers: {}
|
|
1914
2257
|
};
|
|
1915
2258
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1916
2259
|
return _this.processDeleteApiResource(_response);
|
|
@@ -1931,19 +2274,19 @@ var AuthClient = /** @class */ (function () {
|
|
|
1931
2274
|
}
|
|
1932
2275
|
else if (status === 401) {
|
|
1933
2276
|
return response.text().then(function (_responseText) {
|
|
1934
|
-
return throwException("
|
|
2277
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1935
2278
|
});
|
|
1936
2279
|
}
|
|
1937
2280
|
else if (status === 403) {
|
|
1938
2281
|
return response.text().then(function (_responseText) {
|
|
1939
|
-
return throwException("
|
|
2282
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
1940
2283
|
});
|
|
1941
2284
|
}
|
|
1942
2285
|
else if (status === 500) {
|
|
1943
2286
|
return response.text().then(function (_responseText) {
|
|
1944
2287
|
var result500 = null;
|
|
1945
2288
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
1946
|
-
return throwException("
|
|
2289
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
1947
2290
|
});
|
|
1948
2291
|
}
|
|
1949
2292
|
else if (status !== 200 && status !== 204) {
|
|
@@ -1955,7 +2298,7 @@ var AuthClient = /** @class */ (function () {
|
|
|
1955
2298
|
};
|
|
1956
2299
|
/**
|
|
1957
2300
|
* Update api resource
|
|
1958
|
-
* @resourceName Api resource name
|
|
2301
|
+
* @param resourceName Api resource name
|
|
1959
2302
|
* @return OK
|
|
1960
2303
|
*/
|
|
1961
2304
|
AuthClient.prototype.updateApiResource = function (body, resourceName) {
|
|
@@ -1969,9 +2312,9 @@ var AuthClient = /** @class */ (function () {
|
|
|
1969
2312
|
var options_ = {
|
|
1970
2313
|
body: content_,
|
|
1971
2314
|
method: "PUT",
|
|
1972
|
-
headers:
|
|
2315
|
+
headers: {
|
|
1973
2316
|
"Content-Type": "application/json",
|
|
1974
|
-
}
|
|
2317
|
+
}
|
|
1975
2318
|
};
|
|
1976
2319
|
return this.http.fetch(url_, options_).then(function (_response) {
|
|
1977
2320
|
return _this.processUpdateApiResource(_response);
|
|
@@ -1992,19 +2335,19 @@ var AuthClient = /** @class */ (function () {
|
|
|
1992
2335
|
}
|
|
1993
2336
|
else if (status === 401) {
|
|
1994
2337
|
return response.text().then(function (_responseText) {
|
|
1995
|
-
return throwException("
|
|
2338
|
+
return throwException("Unauthorized", status, _responseText, _headers);
|
|
1996
2339
|
});
|
|
1997
2340
|
}
|
|
1998
2341
|
else if (status === 403) {
|
|
1999
2342
|
return response.text().then(function (_responseText) {
|
|
2000
|
-
return throwException("
|
|
2343
|
+
return throwException("Forbidden", status, _responseText, _headers);
|
|
2001
2344
|
});
|
|
2002
2345
|
}
|
|
2003
2346
|
else if (status === 500) {
|
|
2004
2347
|
return response.text().then(function (_responseText) {
|
|
2005
2348
|
var result500 = null;
|
|
2006
2349
|
result500 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
2007
|
-
return throwException("
|
|
2350
|
+
return throwException("General error", status, _responseText, _headers, result500);
|
|
2008
2351
|
});
|
|
2009
2352
|
}
|
|
2010
2353
|
else if (status !== 200 && status !== 204) {
|
|
@@ -2020,39 +2363,39 @@ exports.AuthClient = AuthClient;
|
|
|
2020
2363
|
/** user password hash algorithm */
|
|
2021
2364
|
var PasswordHashAlgorithm;
|
|
2022
2365
|
(function (PasswordHashAlgorithm) {
|
|
2023
|
-
PasswordHashAlgorithm[
|
|
2024
|
-
PasswordHashAlgorithm[
|
|
2025
|
-
PasswordHashAlgorithm[
|
|
2366
|
+
PasswordHashAlgorithm["Unknown"] = "Unknown";
|
|
2367
|
+
PasswordHashAlgorithm["ProprietaryV1"] = "ProprietaryV1";
|
|
2368
|
+
PasswordHashAlgorithm["IdentityV3"] = "IdentityV3";
|
|
2026
2369
|
})(PasswordHashAlgorithm = exports.PasswordHashAlgorithm || (exports.PasswordHashAlgorithm = {}));
|
|
2027
2370
|
var AllowedGrantTypes;
|
|
2028
2371
|
(function (AllowedGrantTypes) {
|
|
2029
|
-
AllowedGrantTypes[
|
|
2030
|
-
AllowedGrantTypes[
|
|
2031
|
-
AllowedGrantTypes[
|
|
2032
|
-
AllowedGrantTypes[
|
|
2033
|
-
AllowedGrantTypes[
|
|
2034
|
-
AllowedGrantTypes[
|
|
2372
|
+
AllowedGrantTypes["Authorization_code"] = "authorization_code";
|
|
2373
|
+
AllowedGrantTypes["Implicit"] = "implicit";
|
|
2374
|
+
AllowedGrantTypes["Hybrid"] = "hybrid";
|
|
2375
|
+
AllowedGrantTypes["Password"] = "password";
|
|
2376
|
+
AllowedGrantTypes["Client_credentials"] = "client_credentials";
|
|
2377
|
+
AllowedGrantTypes["Delegation"] = "delegation";
|
|
2035
2378
|
})(AllowedGrantTypes = exports.AllowedGrantTypes || (exports.AllowedGrantTypes = {}));
|
|
2036
2379
|
var ClientInfoRefreshTokenUsage;
|
|
2037
2380
|
(function (ClientInfoRefreshTokenUsage) {
|
|
2038
|
-
ClientInfoRefreshTokenUsage[
|
|
2039
|
-
ClientInfoRefreshTokenUsage[
|
|
2381
|
+
ClientInfoRefreshTokenUsage["ReUse"] = "reUse";
|
|
2382
|
+
ClientInfoRefreshTokenUsage["OneTimeOnly"] = "oneTimeOnly";
|
|
2040
2383
|
})(ClientInfoRefreshTokenUsage = exports.ClientInfoRefreshTokenUsage || (exports.ClientInfoRefreshTokenUsage = {}));
|
|
2041
2384
|
var ClientInfoRefreshTokenExpiration;
|
|
2042
2385
|
(function (ClientInfoRefreshTokenExpiration) {
|
|
2043
|
-
ClientInfoRefreshTokenExpiration[
|
|
2044
|
-
ClientInfoRefreshTokenExpiration[
|
|
2386
|
+
ClientInfoRefreshTokenExpiration["Absolute"] = "absolute";
|
|
2387
|
+
ClientInfoRefreshTokenExpiration["Sliding"] = "sliding";
|
|
2045
2388
|
})(ClientInfoRefreshTokenExpiration = exports.ClientInfoRefreshTokenExpiration || (exports.ClientInfoRefreshTokenExpiration = {}));
|
|
2046
2389
|
var ClientInfoAccessTokenType;
|
|
2047
2390
|
(function (ClientInfoAccessTokenType) {
|
|
2048
|
-
ClientInfoAccessTokenType[
|
|
2049
|
-
ClientInfoAccessTokenType[
|
|
2391
|
+
ClientInfoAccessTokenType["Jwt"] = "jwt";
|
|
2392
|
+
ClientInfoAccessTokenType["Reference"] = "reference";
|
|
2050
2393
|
})(ClientInfoAccessTokenType = exports.ClientInfoAccessTokenType || (exports.ClientInfoAccessTokenType = {}));
|
|
2051
|
-
var
|
|
2052
|
-
__extends(
|
|
2053
|
-
function
|
|
2394
|
+
var ApiException = /** @class */ (function (_super) {
|
|
2395
|
+
__extends(ApiException, _super);
|
|
2396
|
+
function ApiException(message, status, response, headers, result) {
|
|
2054
2397
|
var _this = _super.call(this) || this;
|
|
2055
|
-
_this.
|
|
2398
|
+
_this.isApiException = true;
|
|
2056
2399
|
_this.message = message;
|
|
2057
2400
|
_this.status = status;
|
|
2058
2401
|
_this.response = response;
|
|
@@ -2060,16 +2403,16 @@ var SwaggerException = /** @class */ (function (_super) {
|
|
|
2060
2403
|
_this.result = result;
|
|
2061
2404
|
return _this;
|
|
2062
2405
|
}
|
|
2063
|
-
|
|
2064
|
-
return obj.
|
|
2406
|
+
ApiException.isApiException = function (obj) {
|
|
2407
|
+
return obj.isApiException === true;
|
|
2065
2408
|
};
|
|
2066
|
-
return
|
|
2409
|
+
return ApiException;
|
|
2067
2410
|
}(Error));
|
|
2068
|
-
exports.
|
|
2411
|
+
exports.ApiException = ApiException;
|
|
2069
2412
|
function throwException(message, status, response, headers, result) {
|
|
2070
2413
|
if (result !== null && result !== undefined)
|
|
2071
2414
|
throw result;
|
|
2072
2415
|
else
|
|
2073
|
-
throw new
|
|
2416
|
+
throw new ApiException(message, status, response, headers, null);
|
|
2074
2417
|
}
|
|
2075
2418
|
//# sourceMappingURL=client.js.map
|