cloudflare
Version:
The official TypeScript library for the Cloudflare API
83 lines • 4.44 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import * as HostnameCertificatesAPI from "./hostname-certificates.mjs";
import { BaseHostnameCertificates, HostnameCertificates, } from "./hostname-certificates.mjs";
import * as HostnamesAPI from "./hostnames.mjs";
import { BaseHostnames, Hostnames, } from "./hostnames.mjs";
import * as SettingsAPI from "./settings.mjs";
import { BaseSettings, Settings, } from "./settings.mjs";
import * as ZoneCertificatesAPI from "./zone-certificates.mjs";
import { BaseZoneCertificates, ZoneCertificates, } from "./zone-certificates.mjs";
import { SinglePage } from "../../core/pagination.mjs";
import { path } from "../../internal/utils/path.mjs";
export var BaseOriginTLSClientAuth = /* @__PURE__ */ (() => {
class BaseOriginTLSClientAuth extends 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(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(path `/zones/${zone_id}/origin_tls_client_auth`, (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(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(path `/zones/${zone_id}/origin_tls_client_auth/${certificateID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseOriginTLSClientAuth._key = Object.freeze([
'originTLSClientAuth',
]);
return BaseOriginTLSClientAuth;
})();
export 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 = ZoneCertificates;
OriginTLSClientAuth.BaseZoneCertificates = BaseZoneCertificates;
OriginTLSClientAuth.Hostnames = Hostnames;
OriginTLSClientAuth.BaseHostnames = BaseHostnames;
OriginTLSClientAuth.HostnameCertificates = HostnameCertificates;
OriginTLSClientAuth.BaseHostnameCertificates = BaseHostnameCertificates;
OriginTLSClientAuth.Settings = Settings;
OriginTLSClientAuth.BaseSettings = BaseSettings;
return OriginTLSClientAuth;
})();
//# sourceMappingURL=origin-tls-client-auth.mjs.map