cloudflare
Version:
The official TypeScript library for the Cloudflare API
70 lines • 3.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Extensions = exports.BaseExtensions = 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 BaseExtensions = /* @__PURE__ */ (() => {
class BaseExtensions extends resource_1.APIResource {
/**
* Returns metadata and JSON Schema documents describing the expected input
* structure for registration and transfer operations on each supported extension
* (TLD).
*
* This endpoint uses cursor-based pagination. Results are ordered by extension
* name by default. To fetch the next page, pass the `cursor` value from the
* `result_info` object in the response as the `cursor` query parameter in your
* next request. An empty `cursor` string indicates there are no more pages.
*
* Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a
* previous response in an `If-None-Match` header to receive a `304 Not Modified`
* when the data has not changed.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const extensionListResponse of client.registrar.extensions.list(
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(params, options) {
const { account_id, ...query } = params;
return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/registrar/extensions`, (pagination_1.CursorPagination), { query, ...options });
}
/**
* Returns metadata and JSON Schema documents describing the expected input
* structure for registration and transfer operations on a specific extension
* (TLD).
*
* Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a
* previous response in an `If-None-Match` header to receive a `304 Not Modified`
* when the data has not changed.
*
* @example
* ```ts
* const extension = await client.registrar.extensions.get(
* 'com',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(extension, params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/registrar/extensions/${extension}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseExtensions._key = Object.freeze([
'registrar',
'extensions',
]);
return BaseExtensions;
})();
exports.BaseExtensions = BaseExtensions;
class Extensions extends BaseExtensions {
}
exports.Extensions = Extensions;
//# sourceMappingURL=extensions.js.map