cloudflare
Version:
The official TypeScript library for the Cloudflare API
68 lines • 2.72 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Applications = exports.BaseApplications = void 0;
const tslib_1 = require("../../../../internal/tslib.js");
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../../core/resource.js");
const AuthMethodsAPI = tslib_1.__importStar(require("./auth-methods.js"));
const auth_methods_1 = require("./auth-methods.js");
const pagination_1 = require("../../../../core/pagination.js");
const path_1 = require("../../../../internal/utils/path.js");
var BaseApplications = /* @__PURE__ */ (() => {
class BaseApplications extends resource_1.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((0, path_1.path) `/accounts/${account_id}/one/applications`, (pagination_1.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((0, path_1.path) `/accounts/${account_id}/one/applications/${applicationID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseApplications._key = Object.freeze([
'zeroTrust',
'casb',
'applications',
]);
return BaseApplications;
})();
exports.BaseApplications = BaseApplications;
var Applications = /* @__PURE__ */ (() => {
class Applications extends BaseApplications {
constructor() {
super(...arguments);
this.authMethods = new AuthMethodsAPI.AuthMethods(this._client);
}
}
Applications.AuthMethods = auth_methods_1.AuthMethods;
Applications.BaseAuthMethods = auth_methods_1.BaseAuthMethods;
return Applications;
})();
exports.Applications = Applications;
//# sourceMappingURL=applications.js.map