UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

62 lines • 2.37 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../../core/resource.mjs"; import * as AuthMethodsAPI from "./auth-methods.mjs"; import { AuthMethods, BaseAuthMethods, } from "./auth-methods.mjs"; import { SinglePage } from "../../../../core/pagination.mjs"; import { path } from "../../../../internal/utils/path.mjs"; export var BaseApplications = /* @__PURE__ */ (() => { class BaseApplications extends APIResource { /** * Returns a list of available applications with use cases and permissions. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const applicationListResponse of client.zeroTrust.casb.applications.list( * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ list(params, options) { const { account_id, ...query } = params; return this._client.getAPIList(path `/accounts/${account_id}/one/applications`, (SinglePage), { query, ...options }); } /** * Returns full application details including auth methods, use cases, and * permissions. * * @example * ```ts * const application = * await client.zeroTrust.casb.applications.get( * 'ANTHROPIC', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get(applicationID, params, options) { const { account_id } = params; return this._client.get(path `/accounts/${account_id}/one/applications/${applicationID}`, options)._thenUnwrap((obj) => obj.result); } } BaseApplications._key = Object.freeze([ 'zeroTrust', 'casb', 'applications', ]); return BaseApplications; })(); export var Applications = /* @__PURE__ */ (() => { class Applications extends BaseApplications { constructor() { super(...arguments); this.authMethods = new AuthMethodsAPI.AuthMethods(this._client); } } Applications.AuthMethods = AuthMethods; Applications.BaseAuthMethods = BaseAuthMethods; return Applications; })(); //# sourceMappingURL=applications.mjs.map