cloudflare
Version:
The official TypeScript library for the Cloudflare API
56 lines • 2.15 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export var BaseTails = /* @__PURE__ */ (() => {
class BaseTails extends APIResource {
/**
* Start a tail that receives logs and exception data.
*
* @example
* ```ts
* const tail =
* await client.pages.projects.deployments.tails.create(
* 'f64788e9-fccd-4d4a-a28a-cb84f88f6e12',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* project_name: 'this-is-my-project-01',
* },
* );
* ```
*/
create(deploymentID, params, options) {
const { account_id, project_name, ...body } = params;
return this._client.post(path `/accounts/${account_id}/pages/projects/${project_name}/deployments/${deploymentID}/tails`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Deletes a tail from a Pages deployment.
*
* @example
* ```ts
* const tail =
* await client.pages.projects.deployments.tails.delete(
* '023e105f4ecef8ad9ca31a8372d0c353',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* project_name: 'this-is-my-project-01',
* deployment_id: 'f64788e9-fccd-4d4a-a28a-cb84f88f6e12',
* },
* );
* ```
*/
delete(tailID, params, options) {
const { account_id, project_name, deployment_id } = params;
return this._client.delete(path `/accounts/${account_id}/pages/projects/${project_name}/deployments/${deployment_id}/tails/${tailID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseTails._key = Object.freeze([
'pages',
'projects',
'deployments',
'tails',
]);
return BaseTails;
})();
export class Tails extends BaseTails {
}
//# sourceMappingURL=tails.mjs.map