Closed kulla closed 3 years ago
There are several tasks to do:
The KV definition at https://github.com/serlo/serlo.org-cloudflare-worker/blob/master/src/kv.d.ts#L30-L37 needs to be updated. The final definition shall be:
declare interface KV<Key extends string> { get: (key: Key) => Promise<string | null> put: ( key: Key, value: string, options?: { expirationTtl: number } ) => Promise<void> }
The values property of createKV shall be deleted at https://github.com/serlo/serlo.org-cloudflare-worker/blob/master/__tests__/__utils__/kv.ts#L23
values
createKV
Thus instead of https://github.com/serlo/serlo.org-cloudflare-worker/blob/master/__tests__/maintenance.ts#L52 we need to be
await global.MAINTENANCE_KV.put("enabled", JSON.stringify(value))
Therefore all KVs need to be initialized at https://github.com/serlo/serlo.org-cloudflare-worker/blob/master/jest.setup.ts#L56-L58
change signature of createKV
function createKV<Keys extends string>(): KV<Keys>
Fixed by #121
There are several tasks to do:
Change KV definition:
The KV definition at https://github.com/serlo/serlo.org-cloudflare-worker/blob/master/src/kv.d.ts#L30-L37 needs to be updated. The final definition shall be:
Change createKV() definition:
The
values
property ofcreateKV
shall be deleted at https://github.com/serlo/serlo.org-cloudflare-worker/blob/master/__tests__/__utils__/kv.ts#L23Thus instead of https://github.com/serlo/serlo.org-cloudflare-worker/blob/master/__tests__/maintenance.ts#L52 we need to be
Therefore all KVs need to be initialized at https://github.com/serlo/serlo.org-cloudflare-worker/blob/master/jest.setup.ts#L56-L58
change signature of createKV