Download wp-calypso/client/dashboard/data/site-reset.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 854 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/data/site-reset.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/dashboard/data/site-reset.ts
-
curl -L -o site-reset.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/data/site-reset.ts
854 Bytes
| import wpcom from 'calypso/lib/wp'; | |
| export type SiteResetContentSummary = { | |
| post_count: number; | |
| page_count: number; | |
| media_count: number; | |
| plugin_count: number; | |
| }; | |
| export type SiteResetStatus = { | |
| status: 'in-progress' | 'ready' | 'completed'; | |
| progress: number; | |
| }; | |
| export async function fetchSiteResetContentSummary( | |
| siteId: number | |
| ): Promise< SiteResetContentSummary > { | |
| return wpcom.req.get( { | |
| path: `/sites/${ siteId }/reset-site/content-summary`, | |
| apiNamespace: 'wpcom/v2', | |
| } ); | |
| } | |
| export async function resetSite( siteId: number ) { | |
| return wpcom.req.post( { | |
| path: `/sites/${ siteId }/reset-site`, | |
| apiNamespace: 'wpcom/v2', | |
| } ); | |
| } | |
| export async function fetchSiteResetStatus( siteId: number ): Promise< SiteResetStatus > { | |
| return wpcom.req.get( { | |
| path: `/sites/${ siteId }/reset-site/status`, | |
| apiNamespace: 'wpcom/v2', | |
| } ); | |
| } | |