-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
69 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export { Actions_Cast_getCast as getCast } from '../Internal/Actions/Cast/getCast.js' | ||
export { Actions_Cast_get as get } from '../Internal/Actions/Cast/get.js' | ||
export { Actions_Cast_create as create } from '../Internal/Actions/Cast/create.js' | ||
export { Actions_Cast_fromString as fromString } from '../Internal/Actions/Cast/fromString.js' | ||
export { Actions_Cast_toString as toString } from '../Internal/Actions/Cast/toString.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Actions_User_get as get } from '../Internal/Actions/User/get.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import type { CallOptions } from '@connectrpc/connect' | ||
import { | ||
Actions as NodeActions, | ||
type Types as NodeTypes, | ||
} from '../../../Node/index.js' | ||
import type { Client } from '../../Client/types.js' | ||
import type { GlobalErrorType } from '../../Errors/error.js' | ||
|
||
export declare namespace Actions_User_get { | ||
type ParametersType = { fid: bigint } | ||
type ReturnType = { | ||
pfp: string | null | ||
displayName: string | null | ||
bio: string | null | ||
url: string | null | ||
username: string | null | ||
location: string | null | ||
} | ||
type ErrorType = | ||
| NodeActions.UserData.getUserDataByFid.ErrorType | ||
| GlobalErrorType | ||
} | ||
export async function Actions_User_get( | ||
client: Client, | ||
parameters: Actions_User_get.ParametersType, | ||
options?: CallOptions, | ||
): Promise<Actions_User_get.ReturnType> { | ||
let nextPageToken: NodeTypes.NextPageToken = null | ||
const userDatas = await (async () => { | ||
const datas: NodeTypes.UserData[] = [] | ||
do { | ||
const result = await NodeActions.UserData.getUserDataByFid( | ||
client, | ||
{ fid: parameters.fid }, | ||
options, | ||
) | ||
datas.push(...result.datas) | ||
nextPageToken = result.nextPageToken | ||
} while (nextPageToken !== null) | ||
return datas | ||
})() | ||
return { | ||
pfp: userDatas.find((data) => data.type === 'pfp')?.value ?? null, | ||
displayName: | ||
userDatas.find((data) => data.type === 'display')?.value ?? null, | ||
bio: userDatas.find((data) => data.type === 'bio')?.value ?? null, | ||
url: userDatas.find((data) => data.type === 'url')?.value ?? null, | ||
username: userDatas.find((data) => data.type === 'username')?.value ?? null, | ||
location: userDatas.find((data) => data.type === 'location')?.value ?? null, | ||
} | ||
} | ||
|
||
Actions_User_get.parseError = (error: unknown) => | ||
error as Actions_User_get.ErrorType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters