cloudflare
Version:
The official TypeScript library for the Cloudflare API
90 lines • 3.81 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomTrustStore = exports.BaseCustomTrustStore = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../core/resource.js");
const pagination_1 = require("../../core/pagination.js");
const path_1 = require("../../internal/utils/path.js");
var BaseCustomTrustStore = /* @__PURE__ */ (() => {
class BaseCustomTrustStore extends resource_1.APIResource {
/**
* Upload a root CA certificate to the Custom Origin Trust Store for a Zone. Only
* root CA certificates are accepted.
*
* @example
* ```ts
* const customTrustStore =
* await client.acm.customTrustStore.create({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* certificate:
* '-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n',
* });
* ```
*/
create(params, options) {
const { zone_id, ...body } = params;
return this._client.post((0, path_1.path) `/zones/${zone_id}/acm/custom_trust_store`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Get Custom Origin Trust Store for a Zone.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const customTrustStore of client.acm.customTrustStore.list(
* { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(params, options) {
const { zone_id, ...query } = params;
return this._client.getAPIList((0, path_1.path) `/zones/${zone_id}/acm/custom_trust_store`, (pagination_1.V4PagePaginationArray), { query, ...options });
}
/**
* Removes a root CA certificate from the custom origin trust store. Origins using
* certificates signed by this CA will no longer be trusted.
*
* @example
* ```ts
* const customTrustStore =
* await client.acm.customTrustStore.delete(
* '2458ce5a-0c35-4c7f-82c7-8e9487d3ff60',
* { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
delete(customOriginTrustStoreID, params, options) {
const { zone_id } = params;
return this._client.delete((0, path_1.path) `/zones/${zone_id}/acm/custom_trust_store/${customOriginTrustStoreID}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves details about a specific root CA certificate in the custom origin
* trust store, including expiration and subject information.
*
* @example
* ```ts
* const customTrustStore =
* await client.acm.customTrustStore.get(
* '2458ce5a-0c35-4c7f-82c7-8e9487d3ff60',
* { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(customOriginTrustStoreID, params, options) {
const { zone_id } = params;
return this._client.get((0, path_1.path) `/zones/${zone_id}/acm/custom_trust_store/${customOriginTrustStoreID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseCustomTrustStore._key = Object.freeze([
'acm',
'customTrustStore',
]);
return BaseCustomTrustStore;
})();
exports.BaseCustomTrustStore = BaseCustomTrustStore;
class CustomTrustStore extends BaseCustomTrustStore {
}
exports.CustomTrustStore = CustomTrustStore;
//# sourceMappingURL=custom-trust-store.js.map