

remove namespace: 'namespace has associated scripts: pages-worker--1260571-production'Property cursor does not exist on type 'KVNamespaceListResult<unknown, string>'. Though cursor key exists and is returned as expected


const cached = await KV.get(key, { type: 'json', cacheTtl: 1800 })
if (cached) return cached
await KV.put(key, JSON.stringify(value), { expirationTtl: 1800 })cacheTtl and expirationTtl set to 1800 (30 min), the D1 analytics show hundreds of reads over 48 hours, even though the value rarely changes and should be served from cache most of the time. For example I expected around 96 calls but i'm getting like ~500.remove namespace: 'namespace has associated scripts: pages-worker--2406846-production 


const cached = await KV.get(key, { type: 'json', cacheTtl: 1800 })
if (cached) return cached
await KV.put(key, JSON.stringify(value), { expirationTtl: 1800 })async function putKeys(env: Env, pairs: Array<Record<string, string>>): Promise<Response> {
for (const pair of pairs) {
var lastE = null;
for (let i = 0; i < retries; i++) {
try {
await env.KV_NS.put(pair["key"], pair["value"], {
metadata: {
version: "v1",
timestamp: ((Date.now() / 1000) | 0)
}
});
console.log({"message": `Successful to sync key ${pair["key"]}`});
break;
} catch(e) {
lastE = e;
}
}
if (lastE != null) {
console.error({"message": `Failed to sync key ${pair["key"]}`, error: lastE});
}
}
console.log({"message": `Successful synced ${pairs.length} pairs`});
return new Response(null, {});
}const client = new Cloudflare({
apiToken: CLOUDFLARE_API_TOKEN
});
console.log("List all Regional Services regions available for use by this account.");
for await (const regionListResponse of client.addressing.regionalHostnames.regions.list({
account_id: ACCOUNT_ID,
})) {
console.log(regionListResponse);
}
// Got `error: 403 {"result":null,"success":false,"errors":[{"code":1002,"message":"forbidden"}],"messages":[]}`
console.log("List all Regional Hostnames within a zone.");
for await (const regionalHostnameListResponse of client.addressing.regionalHostnames.list({
zone_id: ZONE_ID
})) {
console.log(regionalHostnameListResponse);
}