cloudflare
Version:
The official TypeScript library for the Cloudflare API
100 lines • 5.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.R2DataCatalog = exports.BaseR2DataCatalog = 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 CredentialsAPI = tslib_1.__importStar(require("./credentials.js"));
const credentials_1 = require("./credentials.js");
const MaintenanceConfigsAPI = tslib_1.__importStar(require("./maintenance-configs.js"));
const maintenance_configs_1 = require("./maintenance-configs.js");
const NamespacesAPI = tslib_1.__importStar(require("./namespaces/namespaces.js"));
const namespaces_1 = require("./namespaces/namespaces.js");
const headers_1 = require("../../internal/headers.js");
const path_1 = require("../../internal/utils/path.js");
var BaseR2DataCatalog = /* @__PURE__ */ (() => {
class BaseR2DataCatalog extends resource_1.APIResource {
/**
* Returns a list of R2 buckets that have been enabled as Apache Iceberg catalogs
* for the specified account. Each catalog represents an R2 bucket configured to
* store Iceberg metadata and data files.
*
* @deprecated Use `GET /accounts/{account_id}/basin-catalog` instead.
*/
list(params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/r2-catalog`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Removes the catalog from the control plane without deleting R2 bucket objects.
* Set force=true to remove catalog namespaces, tables, views, and maintenance
* metadata. Force deletion is limited to a configured catalog object count.
*
* @deprecated Use `POST /accounts/{account_id}/basin-catalog/{bucket_name}/delete` instead.
*/
delete(bucketName, params, options) {
const { account_id, force } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/r2-catalog/${bucketName}/delete`, {
query: { force },
...options,
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
});
}
/**
* Disable an R2 bucket as a catalog. This operation deactivates the catalog but
* preserves existing metadata and data files. The catalog can be re-enabled later.
*
* @deprecated Use `POST /accounts/{account_id}/basin-catalog/{bucket_name}/disable` instead.
*/
disable(bucketName, params, options) {
const { account_id } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/r2-catalog/${bucketName}/disable`, {
...options,
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
});
}
/**
* Enable an R2 bucket as an Apache Iceberg catalog. This operation creates the
* necessary catalog infrastructure and activates the bucket for storing Iceberg
* metadata and data files.
*
* @deprecated Use `POST /accounts/{account_id}/basin-catalog/{bucket_name}/enable` instead.
*/
enable(bucketName, params, options) {
const { account_id } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/r2-catalog/${bucketName}/enable`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Retrieve detailed information about a specific R2 catalog by bucket name.
* Returns catalog status, maintenance configuration, and credential status.
*
* @deprecated Use `GET /accounts/{account_id}/basin-catalog/{bucket_name}` instead.
*/
get(bucketName, params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/r2-catalog/${bucketName}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseR2DataCatalog._key = Object.freeze(['r2DataCatalog']);
return BaseR2DataCatalog;
})();
exports.BaseR2DataCatalog = BaseR2DataCatalog;
var R2DataCatalog = /* @__PURE__ */ (() => {
class R2DataCatalog extends BaseR2DataCatalog {
constructor() {
super(...arguments);
this.maintenanceConfigs = new MaintenanceConfigsAPI.MaintenanceConfigs(this._client);
this.credentials = new CredentialsAPI.Credentials(this._client);
this.namespaces = new NamespacesAPI.Namespaces(this._client);
}
}
R2DataCatalog.MaintenanceConfigs = maintenance_configs_1.MaintenanceConfigs;
R2DataCatalog.BaseMaintenanceConfigs = maintenance_configs_1.BaseMaintenanceConfigs;
R2DataCatalog.Credentials = credentials_1.Credentials;
R2DataCatalog.BaseCredentials = credentials_1.BaseCredentials;
R2DataCatalog.Namespaces = namespaces_1.Namespaces;
R2DataCatalog.BaseNamespaces = namespaces_1.BaseNamespaces;
return R2DataCatalog;
})();
exports.R2DataCatalog = R2DataCatalog;
//# sourceMappingURL=r2-data-catalog.js.map