cloudflare
Version:
The official TypeScript library for the Cloudflare API
61 lines • 2.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tails = exports.BaseTails = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../../core/resource.js");
const path_1 = require("../../../../internal/utils/path.js");
var BaseTails = /* @__PURE__ */ (() => {
class BaseTails extends resource_1.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((0, path_1.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((0, path_1.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;
})();
exports.BaseTails = BaseTails;
class Tails extends BaseTails {
}
exports.Tails = Tails;
//# sourceMappingURL=tails.js.map