UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

89 lines • 4.96 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OriginTLSClientAuth = exports.BaseOriginTLSClientAuth = 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 HostnameCertificatesAPI = tslib_1.__importStar(require("./hostname-certificates.js")); const hostname_certificates_1 = require("./hostname-certificates.js"); const HostnamesAPI = tslib_1.__importStar(require("./hostnames.js")); const hostnames_1 = require("./hostnames.js"); const SettingsAPI = tslib_1.__importStar(require("./settings.js")); const settings_1 = require("./settings.js"); const ZoneCertificatesAPI = tslib_1.__importStar(require("./zone-certificates.js")); const zone_certificates_1 = require("./zone-certificates.js"); const pagination_1 = require("../../core/pagination.js"); const path_1 = require("../../internal/utils/path.js"); var BaseOriginTLSClientAuth = /* @__PURE__ */ (() => { class BaseOriginTLSClientAuth extends resource_1.APIResource { /** * Upload your own certificate you want Cloudflare to use for edge-to-origin * communication to override the shared certificate. Please note that it is * important to keep only one certificate active. Also, make sure to enable * zone-level authenticated origin pulls by making a PUT call to settings endpoint * to see the uploaded certificate in use. * * @deprecated Use zone_certificates.create for zone-level certificates. This method will be removed in a future major version. */ create(params, options) { const { zone_id, ...body } = params; return this._client.post((0, path_1.path) `/zones/${zone_id}/origin_tls_client_auth`, { body, ...options })._thenUnwrap((obj) => obj.result); } /** * Lists all client certificates configured for zone-level authenticated origin * pulls. * * @deprecated Use zone_certificates.list for zone-level certificates. This method will be removed in a future major version. */ list(params, options) { const { zone_id } = params; return this._client.getAPIList((0, path_1.path) `/zones/${zone_id}/origin_tls_client_auth`, (pagination_1.SinglePage), options); } /** * Removes a client certificate used for zone-level authenticated origin pulls. * * @deprecated Use zone_certificates.delete for zone-level certificates. This method will be removed in a future major version. */ delete(certificateID, params, options) { const { zone_id } = params; return this._client.delete((0, path_1.path) `/zones/${zone_id}/origin_tls_client_auth/${certificateID}`, options)._thenUnwrap((obj) => obj.result); } /** * Retrieves details for a specific client certificate used in zone-level * authenticated origin pulls. * * @deprecated Use zone_certificates.get for zone-level certificates. This method will be removed in a future major version. */ get(certificateID, params, options) { const { zone_id } = params; return this._client.get((0, path_1.path) `/zones/${zone_id}/origin_tls_client_auth/${certificateID}`, options)._thenUnwrap((obj) => obj.result); } } BaseOriginTLSClientAuth._key = Object.freeze([ 'originTLSClientAuth', ]); return BaseOriginTLSClientAuth; })(); exports.BaseOriginTLSClientAuth = BaseOriginTLSClientAuth; var OriginTLSClientAuth = /* @__PURE__ */ (() => { class OriginTLSClientAuth extends BaseOriginTLSClientAuth { constructor() { super(...arguments); this.zoneCertificates = new ZoneCertificatesAPI.ZoneCertificates(this._client); this.hostnames = new HostnamesAPI.Hostnames(this._client); this.hostnameCertificates = new HostnameCertificatesAPI.HostnameCertificates(this._client); this.settings = new SettingsAPI.Settings(this._client); } } OriginTLSClientAuth.ZoneCertificates = zone_certificates_1.ZoneCertificates; OriginTLSClientAuth.BaseZoneCertificates = zone_certificates_1.BaseZoneCertificates; OriginTLSClientAuth.Hostnames = hostnames_1.Hostnames; OriginTLSClientAuth.BaseHostnames = hostnames_1.BaseHostnames; OriginTLSClientAuth.HostnameCertificates = hostname_certificates_1.HostnameCertificates; OriginTLSClientAuth.BaseHostnameCertificates = hostname_certificates_1.BaseHostnameCertificates; OriginTLSClientAuth.Settings = settings_1.Settings; OriginTLSClientAuth.BaseSettings = settings_1.BaseSettings; return OriginTLSClientAuth; })(); exports.OriginTLSClientAuth = OriginTLSClientAuth; //# sourceMappingURL=origin-tls-client-auth.js.map