@@ -43,19 +43,31 @@ export default class Security {
4343 this . transport = transport
4444 }
4545
46- async activateUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . TODO >
47- async activateUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . TODO , unknown > >
48- async activateUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < T . TODO >
49- async activateUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < any > {
46+ async activateUserProfile ( this : That , params : T . SecurityActivateUserProfileRequest | TB . SecurityActivateUserProfileRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . SecurityActivateUserProfileResponse >
47+ async activateUserProfile ( this : That , params : T . SecurityActivateUserProfileRequest | TB . SecurityActivateUserProfileRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . SecurityActivateUserProfileResponse , unknown > >
48+ async activateUserProfile ( this : That , params : T . SecurityActivateUserProfileRequest | TB . SecurityActivateUserProfileRequest , options ?: TransportRequestOptions ) : Promise < T . SecurityActivateUserProfileResponse >
49+ async activateUserProfile ( this : That , params : T . SecurityActivateUserProfileRequest | TB . SecurityActivateUserProfileRequest , options ?: TransportRequestOptions ) : Promise < any > {
5050 const acceptedPath : string [ ] = [ ]
51+ const acceptedBody : string [ ] = [ 'access_token' , 'grant_type' , 'password' , 'username' ]
5152 const querystring : Record < string , any > = { }
52- const body = undefined
53+ // @ts -expect-error
54+ const userBody : any = params ?. body
55+ let body : Record < string , any > | string
56+ if ( typeof userBody === 'string' ) {
57+ body = userBody
58+ } else {
59+ body = userBody != null ? { ...userBody } : undefined
60+ }
5361
54- params = params ?? { }
5562 for ( const key in params ) {
56- if ( acceptedPath . includes ( key ) ) {
63+ if ( acceptedBody . includes ( key ) ) {
64+ body = body ?? { }
65+ // @ts -expect-error
66+ body [ key ] = params [ key ]
67+ } else if ( acceptedPath . includes ( key ) ) {
5768 continue
5869 } else if ( key !== 'body' ) {
70+ // @ts -expect-error
5971 querystring [ key ] = params [ key ]
6072 }
6173 }
@@ -436,19 +448,19 @@ export default class Security {
436448 return await this . transport . request ( { path, method, querystring, body } , options )
437449 }
438450
439- async disableUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . TODO >
440- async disableUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . TODO , unknown > >
441- async disableUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < T . TODO >
442- async disableUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < any > {
451+ async disableUserProfile ( this : That , params : T . SecurityDisableUserProfileRequest | TB . SecurityDisableUserProfileRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . SecurityDisableUserProfileResponse >
452+ async disableUserProfile ( this : That , params : T . SecurityDisableUserProfileRequest | TB . SecurityDisableUserProfileRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . SecurityDisableUserProfileResponse , unknown > >
453+ async disableUserProfile ( this : That , params : T . SecurityDisableUserProfileRequest | TB . SecurityDisableUserProfileRequest , options ?: TransportRequestOptions ) : Promise < T . SecurityDisableUserProfileResponse >
454+ async disableUserProfile ( this : That , params : T . SecurityDisableUserProfileRequest | TB . SecurityDisableUserProfileRequest , options ?: TransportRequestOptions ) : Promise < any > {
443455 const acceptedPath : string [ ] = [ 'uid' ]
444456 const querystring : Record < string , any > = { }
445457 const body = undefined
446458
447- params = params ?? { }
448459 for ( const key in params ) {
449460 if ( acceptedPath . includes ( key ) ) {
450461 continue
451462 } else if ( key !== 'body' ) {
463+ // @ts -expect-error
452464 querystring [ key ] = params [ key ]
453465 }
454466 }
@@ -480,19 +492,19 @@ export default class Security {
480492 return await this . transport . request ( { path, method, querystring, body } , options )
481493 }
482494
483- async enableUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . TODO >
484- async enableUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . TODO , unknown > >
485- async enableUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < T . TODO >
486- async enableUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < any > {
495+ async enableUserProfile ( this : That , params : T . SecurityEnableUserProfileRequest | TB . SecurityEnableUserProfileRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . SecurityEnableUserProfileResponse >
496+ async enableUserProfile ( this : That , params : T . SecurityEnableUserProfileRequest | TB . SecurityEnableUserProfileRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . SecurityEnableUserProfileResponse , unknown > >
497+ async enableUserProfile ( this : That , params : T . SecurityEnableUserProfileRequest | TB . SecurityEnableUserProfileRequest , options ?: TransportRequestOptions ) : Promise < T . SecurityEnableUserProfileResponse >
498+ async enableUserProfile ( this : That , params : T . SecurityEnableUserProfileRequest | TB . SecurityEnableUserProfileRequest , options ?: TransportRequestOptions ) : Promise < any > {
487499 const acceptedPath : string [ ] = [ 'uid' ]
488500 const querystring : Record < string , any > = { }
489501 const body = undefined
490502
491- params = params ?? { }
492503 for ( const key in params ) {
493504 if ( acceptedPath . includes ( key ) ) {
494505 continue
495506 } else if ( key !== 'body' ) {
507+ // @ts -expect-error
496508 querystring [ key ] = params [ key ]
497509 }
498510 }
@@ -830,19 +842,19 @@ export default class Security {
830842 return await this . transport . request ( { path, method, querystring, body } , options )
831843 }
832844
833- async getUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . TODO >
834- async getUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . TODO , unknown > >
835- async getUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < T . TODO >
836- async getUserProfile ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < any > {
845+ async getUserProfile ( this : That , params : T . SecurityGetUserProfileRequest | TB . SecurityGetUserProfileRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . SecurityGetUserProfileResponse >
846+ async getUserProfile ( this : That , params : T . SecurityGetUserProfileRequest | TB . SecurityGetUserProfileRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . SecurityGetUserProfileResponse , unknown > >
847+ async getUserProfile ( this : That , params : T . SecurityGetUserProfileRequest | TB . SecurityGetUserProfileRequest , options ?: TransportRequestOptions ) : Promise < T . SecurityGetUserProfileResponse >
848+ async getUserProfile ( this : That , params : T . SecurityGetUserProfileRequest | TB . SecurityGetUserProfileRequest , options ?: TransportRequestOptions ) : Promise < any > {
837849 const acceptedPath : string [ ] = [ 'uid' ]
838850 const querystring : Record < string , any > = { }
839851 const body = undefined
840852
841- params = params ?? { }
842853 for ( const key in params ) {
843854 if ( acceptedPath . includes ( key ) ) {
844855 continue
845856 } else if ( key !== 'body' ) {
857+ // @ts -expect-error
846858 querystring [ key ] = params [ key ]
847859 }
848860 }
@@ -1421,41 +1433,66 @@ export default class Security {
14211433 return await this . transport . request ( { path, method, querystring, body } , options )
14221434 }
14231435
1424- async searchUserProfiles ( this : That , params ?: T . TODO | TB . TODO , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . TODO >
1425- async searchUserProfiles ( this : That , params ?: T . TODO | TB . TODO , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . TODO , unknown > >
1426- async searchUserProfiles ( this : That , params ?: T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < T . TODO >
1427- async searchUserProfiles ( this : That , params ?: T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < any > {
1436+ async suggestUserProfiles ( this : That , params ?: T . SecuritySuggestUserProfilesRequest | TB . SecuritySuggestUserProfilesRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . SecuritySuggestUserProfilesResponse >
1437+ async suggestUserProfiles ( this : That , params ?: T . SecuritySuggestUserProfilesRequest | TB . SecuritySuggestUserProfilesRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . SecuritySuggestUserProfilesResponse , unknown > >
1438+ async suggestUserProfiles ( this : That , params ?: T . SecuritySuggestUserProfilesRequest | TB . SecuritySuggestUserProfilesRequest , options ?: TransportRequestOptions ) : Promise < T . SecuritySuggestUserProfilesResponse >
1439+ async suggestUserProfiles ( this : That , params ?: T . SecuritySuggestUserProfilesRequest | TB . SecuritySuggestUserProfilesRequest , options ?: TransportRequestOptions ) : Promise < any > {
14281440 const acceptedPath : string [ ] = [ ]
1441+ const acceptedBody : string [ ] = [ 'name' , 'size' ]
14291442 const querystring : Record < string , any > = { }
1430- const body = undefined
1443+ // @ts -expect-error
1444+ const userBody : any = params ?. body
1445+ let body : Record < string , any > | string
1446+ if ( typeof userBody === 'string' ) {
1447+ body = userBody
1448+ } else {
1449+ body = userBody != null ? { ...userBody } : undefined
1450+ }
14311451
14321452 params = params ?? { }
14331453 for ( const key in params ) {
1434- if ( acceptedPath . includes ( key ) ) {
1454+ if ( acceptedBody . includes ( key ) ) {
1455+ body = body ?? { }
1456+ // @ts -expect-error
1457+ body [ key ] = params [ key ]
1458+ } else if ( acceptedPath . includes ( key ) ) {
14351459 continue
14361460 } else if ( key !== 'body' ) {
1461+ // @ts -expect-error
14371462 querystring [ key ] = params [ key ]
14381463 }
14391464 }
14401465
14411466 const method = body != null ? 'POST' : 'GET'
1442- const path = '/_security/profile/_search '
1467+ const path = '/_security/profile/_suggest '
14431468 return await this . transport . request ( { path, method, querystring, body } , options )
14441469 }
14451470
1446- async updateUserProfileData ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . TODO >
1447- async updateUserProfileData ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . TODO , unknown > >
1448- async updateUserProfileData ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < T . TODO >
1449- async updateUserProfileData ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < any > {
1471+ async updateUserProfileData ( this : That , params : T . SecurityUpdateUserProfileDataRequest | TB . SecurityUpdateUserProfileDataRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . SecurityUpdateUserProfileDataResponse >
1472+ async updateUserProfileData ( this : That , params : T . SecurityUpdateUserProfileDataRequest | TB . SecurityUpdateUserProfileDataRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . SecurityUpdateUserProfileDataResponse , unknown > >
1473+ async updateUserProfileData ( this : That , params : T . SecurityUpdateUserProfileDataRequest | TB . SecurityUpdateUserProfileDataRequest , options ?: TransportRequestOptions ) : Promise < T . SecurityUpdateUserProfileDataResponse >
1474+ async updateUserProfileData ( this : That , params : T . SecurityUpdateUserProfileDataRequest | TB . SecurityUpdateUserProfileDataRequest , options ?: TransportRequestOptions ) : Promise < any > {
14501475 const acceptedPath : string [ ] = [ 'uid' ]
1476+ const acceptedBody : string [ ] = [ 'access' , 'data' ]
14511477 const querystring : Record < string , any > = { }
1452- const body = undefined
1478+ // @ts -expect-error
1479+ const userBody : any = params ?. body
1480+ let body : Record < string , any > | string
1481+ if ( typeof userBody === 'string' ) {
1482+ body = userBody
1483+ } else {
1484+ body = userBody != null ? { ...userBody } : undefined
1485+ }
14531486
1454- params = params ?? { }
14551487 for ( const key in params ) {
1456- if ( acceptedPath . includes ( key ) ) {
1488+ if ( acceptedBody . includes ( key ) ) {
1489+ body = body ?? { }
1490+ // @ts -expect-error
1491+ body [ key ] = params [ key ]
1492+ } else if ( acceptedPath . includes ( key ) ) {
14571493 continue
14581494 } else if ( key !== 'body' ) {
1495+ // @ts -expect-error
14591496 querystring [ key ] = params [ key ]
14601497 }
14611498 }
0 commit comments