cloudflare
Version:
The official TypeScript library for the Cloudflare API
48 lines • 1.81 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
import * as CustomPagesAPI from 'cloudflare/resources/zero-trust/access/custom-pages';
import { SinglePage } from 'cloudflare/pagination';
export class CustomPages extends APIResource {
/**
* Create a custom page
*/
create(identifier, body, options) {
return this._client.post(`/accounts/${identifier}/access/custom_pages`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Update a custom page
*/
update(identifier, uuid, body, options) {
return this._client.put(`/accounts/${identifier}/access/custom_pages/${uuid}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* List custom pages
*/
list(identifier, options) {
return this._client.getAPIList(`/accounts/${identifier}/access/custom_pages`, CustomPageWithoutHTMLsSinglePage, options);
}
/**
* Delete a custom page
*/
delete(identifier, uuid, options) {
return this._client.delete(`/accounts/${identifier}/access/custom_pages/${uuid}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Fetches a custom page and also returns its HTML.
*/
get(identifier, uuid, options) {
return this._client.get(`/accounts/${identifier}/access/custom_pages/${uuid}`, options)._thenUnwrap((obj) => obj.result);
}
}
export class CustomPageWithoutHTMLsSinglePage extends SinglePage {
}
(function (CustomPages) {
CustomPages.CustomPageWithoutHTMLsSinglePage = CustomPagesAPI.CustomPageWithoutHTMLsSinglePage;
})(CustomPages || (CustomPages = {}));
//# sourceMappingURL=custom-pages.mjs.map