UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

50 lines 1.87 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../resource.mjs"; import { SinglePage } from "../../../pagination.mjs"; export class CustomPages extends APIResource { /** * Create a custom page */ create(params, options) { const { account_id, ...body } = params; return this._client.post(`/accounts/${account_id}/access/custom_pages`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Update a custom page */ update(customPageId, params, options) { const { account_id, ...body } = params; return this._client.put(`/accounts/${account_id}/access/custom_pages/${customPageId}`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * List custom pages */ list(params, options) { const { account_id } = params; return this._client.getAPIList(`/accounts/${account_id}/access/custom_pages`, CustomPageWithoutHTMLsSinglePage, options); } /** * Delete a custom page */ delete(customPageId, params, options) { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/access/custom_pages/${customPageId}`, options)._thenUnwrap((obj) => obj.result); } /** * Fetches a custom page and also returns its HTML. */ get(customPageId, params, options) { const { account_id } = params; return this._client.get(`/accounts/${account_id}/access/custom_pages/${customPageId}`, options)._thenUnwrap((obj) => obj.result); } } export class CustomPageWithoutHTMLsSinglePage extends SinglePage { } CustomPages.CustomPageWithoutHTMLsSinglePage = CustomPageWithoutHTMLsSinglePage; //# sourceMappingURL=custom-pages.mjs.map