The EnterpriseZoneWorkersKV resource provides an interface for interacting with Cloudflare Workers KV namespaces within an Enterprise Zone. It allows for basic CRUD operations on keys, including single and bulk operations.
Note: All methods require an account_id and a namespace_id as part of the resource path.
// Example usage of EnterpriseZoneWorkersKV methods
// List all keys in a namespace
await enterpriseZoneWorkersKV.browse(accountId, namespaceId);
// Add a single key-value pair
await enterpriseZoneWorkersKV.add(accountId, namespaceId, 'my-key', 'my-value');
// Read a value by key
const value = await enterpriseZoneWorkersKV.read(accountId, namespaceId, 'my-key');
// Delete a single key
await enterpriseZoneWorkersKV.del(accountId, namespaceId, 'my-key');
// Bulk add multiple key-value pairs
await enterpriseZoneWorkersKV.addMulti(accountId, namespaceId, [{ key: 'k1', value: 'v1' }, { key: 'k2', value: 'v2' }]);
// Bulk delete multiple keys
await enterpriseZoneWorkersKV.delMulti(accountId, namespaceId, ['k1', 'k2']);