UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

28 lines 1.15 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'cloudflare/resource'; export class Tail extends APIResource { /** * Starts a tail that receives logs and exception from a Worker. */ create(scriptName, params, options) { const { account_id } = params; return this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/tails`, options)._thenUnwrap((obj) => obj.result); } /** * Deletes a tail from a Worker. */ delete(scriptName, id, params, options) { const { account_id } = params; return this._client.delete(`/accounts/${account_id}/workers/scripts/${scriptName}/tails/${id}`, options)._thenUnwrap((obj) => obj.result); } /** * Get list of tails currently deployed on a Worker. */ get(scriptName, params, options) { const { account_id } = params; return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/tails`, options)._thenUnwrap((obj) => obj.result); } } (function (Tail) { })(Tail || (Tail = {})); //# sourceMappingURL=tail.mjs.map