cloudflare
Version:
The official TypeScript library for the Cloudflare API
37 lines • 1.61 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Bulk = void 0;
const resource_1 = require("cloudflare/resource");
class Bulk extends resource_1.APIResource {
/**
* Write multiple keys and values at once. Body should be an array of up to 10,000
* key-value pairs to be stored, along with optional expiration information.
* Existing values and expirations will be overwritten. If neither `expiration` nor
* `expiration_ttl` is specified, the key-value pair will never expire. If both are
* set, `expiration_ttl` is used and `expiration` is ignored. The entire request
* size must be 100 megabytes or less.
*/
update(namespaceId, params, options) {
const { account_id, body } = params;
return this._client.put(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/bulk`, {
body: body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Remove multiple KV pairs from the namespace. Body should be an array of up to
* 10,000 keys to be removed.
*/
delete(namespaceId, params, options) {
const { account_id, body } = params;
return this._client.delete(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/bulk`, {
body: body,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
exports.Bulk = Bulk;
(function (Bulk) {
})(Bulk = exports.Bulk || (exports.Bulk = {}));
//# sourceMappingURL=bulk.js.map