UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

84 lines 4.45 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Gateway = void 0; const resource_1 = require("cloudflare/resource"); const AppTypesAPI = __importStar(require("cloudflare/resources/zero-trust/gateway/app-types")); const AuditSSHSettingsAPI = __importStar(require("cloudflare/resources/zero-trust/gateway/audit-ssh-settings")); const CategoriesAPI = __importStar(require("cloudflare/resources/zero-trust/gateway/categories")); const ConfigurationsAPI = __importStar(require("cloudflare/resources/zero-trust/gateway/configurations")); const LocationsAPI = __importStar(require("cloudflare/resources/zero-trust/gateway/locations")); const LoggingAPI = __importStar(require("cloudflare/resources/zero-trust/gateway/logging")); const ProxyEndpointsAPI = __importStar(require("cloudflare/resources/zero-trust/gateway/proxy-endpoints")); const RulesAPI = __importStar(require("cloudflare/resources/zero-trust/gateway/rules")); const ListsAPI = __importStar(require("cloudflare/resources/zero-trust/gateway/lists/lists")); class Gateway extends resource_1.APIResource { constructor() { super(...arguments); this.auditSSHSettings = new AuditSSHSettingsAPI.AuditSSHSettings(this._client); this.categories = new CategoriesAPI.Categories(this._client); this.appTypes = new AppTypesAPI.AppTypes(this._client); this.configurations = new ConfigurationsAPI.Configurations(this._client); this.lists = new ListsAPI.Lists(this._client); this.locations = new LocationsAPI.Locations(this._client); this.logging = new LoggingAPI.Logging(this._client); this.proxyEndpoints = new ProxyEndpointsAPI.ProxyEndpoints(this._client); this.rules = new RulesAPI.Rules(this._client); } /** * Creates a Zero Trust account with an existing Cloudflare account. */ create(params, options) { const { account_id } = params; return this._client.post(`/accounts/${account_id}/gateway`, options)._thenUnwrap((obj) => obj.result); } /** * Gets information about the current Zero Trust account. */ list(params, options) { const { account_id } = params; return this._client.get(`/accounts/${account_id}/gateway`, options)._thenUnwrap((obj) => obj.result); } } exports.Gateway = Gateway; (function (Gateway) { Gateway.AuditSSHSettings = AuditSSHSettingsAPI.AuditSSHSettings; Gateway.Categories = CategoriesAPI.Categories; Gateway.CategoriesSinglePage = CategoriesAPI.CategoriesSinglePage; Gateway.AppTypes = AppTypesAPI.AppTypes; Gateway.AppTypesSinglePage = AppTypesAPI.AppTypesSinglePage; Gateway.Configurations = ConfigurationsAPI.Configurations; Gateway.Lists = ListsAPI.Lists; Gateway.GatewayListsSinglePage = ListsAPI.GatewayListsSinglePage; Gateway.Locations = LocationsAPI.Locations; Gateway.LocationsSinglePage = LocationsAPI.LocationsSinglePage; Gateway.Logging = LoggingAPI.Logging; Gateway.ProxyEndpoints = ProxyEndpointsAPI.ProxyEndpoints; Gateway.ProxyEndpointsSinglePage = ProxyEndpointsAPI.ProxyEndpointsSinglePage; Gateway.Rules = RulesAPI.Rules; Gateway.GatewayRulesSinglePage = RulesAPI.GatewayRulesSinglePage; })(Gateway = exports.Gateway || (exports.Gateway = {})); //# sourceMappingURL=gateway.js.map