refactor: updates based on the provider methods signature changes

This commit is contained in:
jamesgeorge007
2024-02-09 22:49:38 +05:30
parent c1a8a871d2
commit 392b2fc48d
8 changed files with 476 additions and 432 deletions

View File

@@ -17,3 +17,19 @@ export type HoppInheritedProperty = {
inheritedHeader: HoppRESTHeader | GQLHeader
}[]
}
type ModifiedAuth<T, AuthType> = {
[K in keyof T]: K extends 'inheritedAuth' ? Extract<T[K], AuthType> : T[K]
}
type ModifiedHeaders<T, HeaderType> = {
[K in keyof T]: K extends 'inheritedHeader' ? Extract<T[K], HeaderType> : T[K]
}
type ModifiedHoppInheritedProperty<AuthType, HeaderType> = {
auth: ModifiedAuth<HoppInheritedProperty['auth'], AuthType>
headers: ModifiedHeaders<HoppInheritedProperty['headers'][number], HeaderType>[]
}
export type HoppInheritedRESTProperty = ModifiedHoppInheritedProperty<HoppRESTAuth, HoppRESTHeader>