Download wp-calypso/client/dashboard/data/me.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 487 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/data/me.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/dashboard/data/me.ts
-
curl -L -o me.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/data/me.ts
487 Bytes
| import wpcom from 'calypso/lib/wp'; | |
| export interface User { | |
| ID: number; | |
| username: string; | |
| display_name: string; | |
| avatar_URL?: string; | |
| language: string; | |
| locale_variant: string; | |
| email: string; | |
| site_count: number; | |
| } | |
| export interface TwoStep { | |
| two_step_reauthorization_required: boolean; | |
| } | |
| export async function fetchUser(): Promise< User > { | |
| return wpcom.req.get( '/me' ); | |
| } | |
| export async function fetchTwoStep(): Promise< TwoStep > { | |
| return wpcom.req.get( '/me/two-step' ); | |
| } | |