miniflare icon indicating copy to clipboard operation
miniflare copied to clipboard

`getMiniflareDurableObjectIds(class: string)` helper function

Open DaniFoldi opened this issue 1 year ago • 0 comments

Durable Object IDs have no runtime binding to be listed, however the Cloudflare API has an endpoint to retrieve all created Durable Objects, with the additional information whether there is storage attached.

A helper function like getMiniflareDurableObjectIds(class: string) could return an array like the API, probably without the pagination, or the limits.

This could be useful in tests to verify if in certain cases no DO is created, or that no storage is used. A possible extension could be to also provide a _stored key which shows how many bytes the Durable Object is using.

DaniFoldi avatar Sep 20 '22 10:09 DaniFoldi