UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

29 lines 1.27 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../../resource.mjs"; import { SinglePage } from "../../../../pagination.mjs"; export class Connections extends APIResource { /** * Removes a connection (aka Cloudflare Tunnel Connector) from a Cloudflare Tunnel * independently of its current state. If no connector id (client_id) is provided * all connectors will be removed. We recommend running this command after rotating * tokens. */ delete(tunnelId, params, options) { const { account_id, client_id } = params; return this._client.delete(`/accounts/${account_id}/cfd_tunnel/${tunnelId}/connections`, { query: { client_id }, ...options, })._thenUnwrap((obj) => obj.result); } /** * Fetches connection details for a Cloudflare Tunnel. */ get(tunnelId, params, options) { const { account_id } = params; return this._client.getAPIList(`/accounts/${account_id}/cfd_tunnel/${tunnelId}/connections`, ClientsSinglePage, options); } } export class ClientsSinglePage extends SinglePage { } Connections.ClientsSinglePage = ClientsSinglePage; //# sourceMappingURL=connections.mjs.map