UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

35 lines • 1.41 kB
// 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 BaseManagement = /* @__PURE__ */ (() => { class BaseManagement extends APIResource { /** * Creates a short-lived management token for the requested Tunnel management * resources, such as streaming logs. Treat the token as a secret. * * @example * ```ts * const management = * await client.zeroTrust.tunnels.cloudflared.management.create( * 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', * { * account_id: '699d98642c564d2e855e9661899b7252', * resources: ['logs'], * }, * ); * ``` */ create(tunnelID, params, options) { const { account_id, ...body } = params; return this._client.post(path `/accounts/${account_id}/cfd_tunnel/${tunnelID}/management`, { body, ...options, })._thenUnwrap((obj) => obj.result); } } BaseManagement._key = Object.freeze(['zeroTrust', 'tunnels', 'cloudflared', 'management']); return BaseManagement; })(); export class Management extends BaseManagement { } //# sourceMappingURL=management.mjs.map