UNPKG

@wordpress/e2e-test-utils-playwright

Version:
8 lines (7 loc) 1.82 kB
{ "version": 3, "sources": ["../../src/request-utils/site-settings.ts"], "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { RequestUtils } from './index';\n\ntype SiteSettings = {\n\ttitle: string;\n\tdescription: string;\n\turl: string;\n\temail: string;\n\ttimezone: string;\n\tdate_format: string;\n\ttime_format: string;\n\tstart_of_week: number;\n\tlanguage: string;\n\tuse_smilies: boolean;\n\tdefault_category: number;\n\tdefault_post_format: string;\n\tposts_per_page: number;\n\tdefault_ping_status: 'open' | 'closed';\n\tdefault_comment_status: 'open' | 'closed';\n\tshow_on_front: 'posts' | 'page';\n\tpage_on_front: number;\n\tpage_for_posts: number;\n};\n\n/**\n * Get the site settings.\n *\n * @see https://developer.wordpress.org/rest-api/reference/settings/#retrieve-a-site-setting\n *\n * @param this RequestUtils.\n */\nexport async function getSiteSettings( this: RequestUtils ) {\n\treturn await this.rest< SiteSettings >( {\n\t\tpath: '/wp/v2/settings',\n\t\tmethod: 'GET',\n\t} );\n}\n\n/**\n * Update the site settings.\n *\n * @see https://developer.wordpress.org/rest-api/reference/settings/#update-a-site-setting\n *\n * @param this RequestUtils.\n * @param siteSettings The partial settings payload to update.\n */\nexport async function updateSiteSettings(\n\tthis: RequestUtils,\n\tsiteSettings: Partial< SiteSettings >\n) {\n\treturn await this.rest< SiteSettings >( {\n\t\tpath: '/wp/v2/settings',\n\t\tmethod: 'POST',\n\t\tdata: siteSettings,\n\t} );\n}\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiCA,eAAsB,kBAAsC;AAC3D,SAAO,MAAM,KAAK,KAAsB;AAAA,IACvC,MAAM;AAAA,IACN,QAAQ;AAAA,EACT,CAAE;AACH;AAUA,eAAsB,mBAErB,cACC;AACD,SAAO,MAAM,KAAK,KAAsB;AAAA,IACvC,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,MAAM;AAAA,EACP,CAAE;AACH;", "names": [] }