Download wp-calypso/client/dashboard/data/site-owner-transfer.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/data/site-owner-transfer.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/dashboard/data/site-owner-transfer.ts
-
curl -L -o site-owner-transfer.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/data/site-owner-transfer.ts
1.05 kB
| import wpcom from 'calypso/lib/wp'; | |
| export type SiteOwnerTransferContext = 'dashboard_v2'; | |
| export interface SiteOwnerTransferConfirmation { | |
| transfer: boolean; | |
| email_sent: boolean; | |
| new_owner_email: string; | |
| } | |
| export async function startSiteOwnerTransfer( | |
| siteId: number, | |
| data: { new_site_owner: string; context?: SiteOwnerTransferContext } | |
| ) { | |
| return wpcom.req.post( | |
| { | |
| path: `/sites/${ siteId }/site-owner-transfer`, | |
| apiNamespace: 'wpcom/v2', | |
| }, | |
| { | |
| calypso_origin: window.location.origin, | |
| }, | |
| data | |
| ); | |
| } | |
| export async function checkSiteOwnerTransferEligibility( | |
| siteId: number, | |
| data: { new_site_owner: string } | |
| ) { | |
| return wpcom.req.post( | |
| { | |
| path: `/sites/${ siteId }/site-owner-transfer/eligibility`, | |
| apiNamespace: 'wpcom/v2', | |
| }, | |
| data | |
| ); | |
| } | |
| export async function confirmSiteOwnerTransfer( | |
| siteId: number, | |
| data: { hash: string } | |
| ): Promise< SiteOwnerTransferConfirmation > { | |
| return wpcom.req.post( | |
| { | |
| path: `/sites/${ siteId }/site-owner-transfer/confirm`, | |
| apiNamespace: 'wpcom/v2', | |
| }, | |
| data | |
| ); | |
| } | |