@@ -1098,120 +1098,6 @@ export class TokenAuthServiceProxy {
1098
1098
}
1099
1099
return _observableOf ( null as any ) ;
1100
1100
}
1101
-
1102
- /**
1103
- * @return Success
1104
- */
1105
- getExternalAuthenticationProviders ( ) : Observable < ExternalLoginProviderInfoModel [ ] > {
1106
- let url_ = this . baseUrl + "/api/TokenAuth/GetExternalAuthenticationProviders" ;
1107
- url_ = url_ . replace ( / [ ? & ] $ / , "" ) ;
1108
-
1109
- let options_ : any = {
1110
- observe : "response" ,
1111
- responseType : "blob" ,
1112
- headers : new HttpHeaders ( {
1113
- "Accept" : "text/plain"
1114
- } )
1115
- } ;
1116
-
1117
- return this . http . request ( "get" , url_ , options_ ) . pipe ( _observableMergeMap ( ( response_ : any ) => {
1118
- return this . processGetExternalAuthenticationProviders ( response_ ) ;
1119
- } ) ) . pipe ( _observableCatch ( ( response_ : any ) => {
1120
- if ( response_ instanceof HttpResponseBase ) {
1121
- try {
1122
- return this . processGetExternalAuthenticationProviders ( response_ as any ) ;
1123
- } catch ( e ) {
1124
- return _observableThrow ( e ) as any as Observable < ExternalLoginProviderInfoModel [ ] > ;
1125
- }
1126
- } else
1127
- return _observableThrow ( response_ ) as any as Observable < ExternalLoginProviderInfoModel [ ] > ;
1128
- } ) ) ;
1129
- }
1130
-
1131
- protected processGetExternalAuthenticationProviders ( response : HttpResponseBase ) : Observable < ExternalLoginProviderInfoModel [ ] > {
1132
- const status = response . status ;
1133
- const responseBlob =
1134
- response instanceof HttpResponse ? response . body :
1135
- ( response as any ) . error instanceof Blob ? ( response as any ) . error : undefined ;
1136
-
1137
- let _headers : any = { } ; if ( response . headers ) { for ( let key of response . headers . keys ( ) ) { _headers [ key ] = response . headers . get ( key ) ; } }
1138
- if ( status === 200 ) {
1139
- return blobToText ( responseBlob ) . pipe ( _observableMergeMap ( ( _responseText : string ) => {
1140
- let result200 : any = null ;
1141
- let resultData200 = _responseText === "" ? null : JSON . parse ( _responseText , this . jsonParseReviver ) ;
1142
- if ( Array . isArray ( resultData200 ) ) {
1143
- result200 = [ ] as any ;
1144
- for ( let item of resultData200 )
1145
- result200 . push ( ExternalLoginProviderInfoModel . fromJS ( item ) ) ;
1146
- }
1147
- else {
1148
- result200 = < any > null ;
1149
- }
1150
- return _observableOf ( result200 ) ;
1151
- } ) ) ;
1152
- } else if ( status !== 200 && status !== 204 ) {
1153
- return blobToText ( responseBlob ) . pipe ( _observableMergeMap ( ( _responseText : string ) => {
1154
- return throwException ( "An unexpected server error occurred." , status , _responseText , _headers ) ;
1155
- } ) ) ;
1156
- }
1157
- return _observableOf ( null as any ) ;
1158
- }
1159
-
1160
- /**
1161
- * @param body (optional)
1162
- * @return Success
1163
- */
1164
- externalAuthenticate ( body : ExternalAuthenticateModel | undefined ) : Observable < ExternalAuthenticateResultModel > {
1165
- let url_ = this . baseUrl + "/api/TokenAuth/ExternalAuthenticate" ;
1166
- url_ = url_ . replace ( / [ ? & ] $ / , "" ) ;
1167
-
1168
- const content_ = JSON . stringify ( body ) ;
1169
-
1170
- let options_ : any = {
1171
- body : content_ ,
1172
- observe : "response" ,
1173
- responseType : "blob" ,
1174
- headers : new HttpHeaders ( {
1175
- "Content-Type" : "application/json-patch+json" ,
1176
- "Accept" : "text/plain"
1177
- } )
1178
- } ;
1179
-
1180
- return this . http . request ( "post" , url_ , options_ ) . pipe ( _observableMergeMap ( ( response_ : any ) => {
1181
- return this . processExternalAuthenticate ( response_ ) ;
1182
- } ) ) . pipe ( _observableCatch ( ( response_ : any ) => {
1183
- if ( response_ instanceof HttpResponseBase ) {
1184
- try {
1185
- return this . processExternalAuthenticate ( response_ as any ) ;
1186
- } catch ( e ) {
1187
- return _observableThrow ( e ) as any as Observable < ExternalAuthenticateResultModel > ;
1188
- }
1189
- } else
1190
- return _observableThrow ( response_ ) as any as Observable < ExternalAuthenticateResultModel > ;
1191
- } ) ) ;
1192
- }
1193
-
1194
- protected processExternalAuthenticate ( response : HttpResponseBase ) : Observable < ExternalAuthenticateResultModel > {
1195
- const status = response . status ;
1196
- const responseBlob =
1197
- response instanceof HttpResponse ? response . body :
1198
- ( response as any ) . error instanceof Blob ? ( response as any ) . error : undefined ;
1199
-
1200
- let _headers : any = { } ; if ( response . headers ) { for ( let key of response . headers . keys ( ) ) { _headers [ key ] = response . headers . get ( key ) ; } }
1201
- if ( status === 200 ) {
1202
- return blobToText ( responseBlob ) . pipe ( _observableMergeMap ( ( _responseText : string ) => {
1203
- let result200 : any = null ;
1204
- let resultData200 = _responseText === "" ? null : JSON . parse ( _responseText , this . jsonParseReviver ) ;
1205
- result200 = ExternalAuthenticateResultModel . fromJS ( resultData200 ) ;
1206
- return _observableOf ( result200 ) ;
1207
- } ) ) ;
1208
- } else if ( status !== 200 && status !== 204 ) {
1209
- return blobToText ( responseBlob ) . pipe ( _observableMergeMap ( ( _responseText : string ) => {
1210
- return throwException ( "An unexpected server error occurred." , status , _responseText , _headers ) ;
1211
- } ) ) ;
1212
- }
1213
- return _observableOf ( null as any ) ;
1214
- }
1215
1101
}
1216
1102
1217
1103
@Injectable ( )
@@ -2341,159 +2227,6 @@ export interface ICreateUserDto {
2341
2227
password : string ;
2342
2228
}
2343
2229
2344
- export class ExternalAuthenticateModel implements IExternalAuthenticateModel {
2345
- authProvider : string ;
2346
- providerKey : string ;
2347
- providerAccessCode : string ;
2348
-
2349
- constructor ( data ?: IExternalAuthenticateModel ) {
2350
- if ( data ) {
2351
- for ( var property in data ) {
2352
- if ( data . hasOwnProperty ( property ) )
2353
- ( < any > this ) [ property ] = ( < any > data ) [ property ] ;
2354
- }
2355
- }
2356
- }
2357
-
2358
- init ( _data ?: any ) {
2359
- if ( _data ) {
2360
- this . authProvider = _data [ "authProvider" ] ;
2361
- this . providerKey = _data [ "providerKey" ] ;
2362
- this . providerAccessCode = _data [ "providerAccessCode" ] ;
2363
- }
2364
- }
2365
-
2366
- static fromJS ( data : any ) : ExternalAuthenticateModel {
2367
- data = typeof data === 'object' ? data : { } ;
2368
- let result = new ExternalAuthenticateModel ( ) ;
2369
- result . init ( data ) ;
2370
- return result ;
2371
- }
2372
-
2373
- toJSON ( data ?: any ) {
2374
- data = typeof data === 'object' ? data : { } ;
2375
- data [ "authProvider" ] = this . authProvider ;
2376
- data [ "providerKey" ] = this . providerKey ;
2377
- data [ "providerAccessCode" ] = this . providerAccessCode ;
2378
- return data ;
2379
- }
2380
-
2381
- clone ( ) : ExternalAuthenticateModel {
2382
- const json = this . toJSON ( ) ;
2383
- let result = new ExternalAuthenticateModel ( ) ;
2384
- result . init ( json ) ;
2385
- return result ;
2386
- }
2387
- }
2388
-
2389
- export interface IExternalAuthenticateModel {
2390
- authProvider : string ;
2391
- providerKey : string ;
2392
- providerAccessCode : string ;
2393
- }
2394
-
2395
- export class ExternalAuthenticateResultModel implements IExternalAuthenticateResultModel {
2396
- accessToken : string | undefined ;
2397
- encryptedAccessToken : string | undefined ;
2398
- expireInSeconds : number ;
2399
- waitingForActivation : boolean ;
2400
-
2401
- constructor ( data ?: IExternalAuthenticateResultModel ) {
2402
- if ( data ) {
2403
- for ( var property in data ) {
2404
- if ( data . hasOwnProperty ( property ) )
2405
- ( < any > this ) [ property ] = ( < any > data ) [ property ] ;
2406
- }
2407
- }
2408
- }
2409
-
2410
- init ( _data ?: any ) {
2411
- if ( _data ) {
2412
- this . accessToken = _data [ "accessToken" ] ;
2413
- this . encryptedAccessToken = _data [ "encryptedAccessToken" ] ;
2414
- this . expireInSeconds = _data [ "expireInSeconds" ] ;
2415
- this . waitingForActivation = _data [ "waitingForActivation" ] ;
2416
- }
2417
- }
2418
-
2419
- static fromJS ( data : any ) : ExternalAuthenticateResultModel {
2420
- data = typeof data === 'object' ? data : { } ;
2421
- let result = new ExternalAuthenticateResultModel ( ) ;
2422
- result . init ( data ) ;
2423
- return result ;
2424
- }
2425
-
2426
- toJSON ( data ?: any ) {
2427
- data = typeof data === 'object' ? data : { } ;
2428
- data [ "accessToken" ] = this . accessToken ;
2429
- data [ "encryptedAccessToken" ] = this . encryptedAccessToken ;
2430
- data [ "expireInSeconds" ] = this . expireInSeconds ;
2431
- data [ "waitingForActivation" ] = this . waitingForActivation ;
2432
- return data ;
2433
- }
2434
-
2435
- clone ( ) : ExternalAuthenticateResultModel {
2436
- const json = this . toJSON ( ) ;
2437
- let result = new ExternalAuthenticateResultModel ( ) ;
2438
- result . init ( json ) ;
2439
- return result ;
2440
- }
2441
- }
2442
-
2443
- export interface IExternalAuthenticateResultModel {
2444
- accessToken : string | undefined ;
2445
- encryptedAccessToken : string | undefined ;
2446
- expireInSeconds : number ;
2447
- waitingForActivation : boolean ;
2448
- }
2449
-
2450
- export class ExternalLoginProviderInfoModel implements IExternalLoginProviderInfoModel {
2451
- name : string | undefined ;
2452
- clientId : string | undefined ;
2453
-
2454
- constructor ( data ?: IExternalLoginProviderInfoModel ) {
2455
- if ( data ) {
2456
- for ( var property in data ) {
2457
- if ( data . hasOwnProperty ( property ) )
2458
- ( < any > this ) [ property ] = ( < any > data ) [ property ] ;
2459
- }
2460
- }
2461
- }
2462
-
2463
- init ( _data ?: any ) {
2464
- if ( _data ) {
2465
- this . name = _data [ "name" ] ;
2466
- this . clientId = _data [ "clientId" ] ;
2467
- }
2468
- }
2469
-
2470
- static fromJS ( data : any ) : ExternalLoginProviderInfoModel {
2471
- data = typeof data === 'object' ? data : { } ;
2472
- let result = new ExternalLoginProviderInfoModel ( ) ;
2473
- result . init ( data ) ;
2474
- return result ;
2475
- }
2476
-
2477
- toJSON ( data ?: any ) {
2478
- data = typeof data === 'object' ? data : { } ;
2479
- data [ "name" ] = this . name ;
2480
- data [ "clientId" ] = this . clientId ;
2481
- return data ;
2482
- }
2483
-
2484
- clone ( ) : ExternalLoginProviderInfoModel {
2485
- const json = this . toJSON ( ) ;
2486
- let result = new ExternalLoginProviderInfoModel ( ) ;
2487
- result . init ( json ) ;
2488
- return result ;
2489
- }
2490
- }
2491
-
2492
- export interface IExternalLoginProviderInfoModel {
2493
- name : string | undefined ;
2494
- clientId : string | undefined ;
2495
- }
2496
-
2497
2230
export class FlatPermissionDto implements IFlatPermissionDto {
2498
2231
name : string | undefined ;
2499
2232
displayName : string | undefined ;
0 commit comments