Skip to content

StoreAPI

Defined in: namespaces-core-plugins.ts:83

Durable, Promise-shaped document + KV storage (fn-71). This is the storage plane every core plugin builds on. context.storage remains the legacy synchronous KV tier.

Scopes: store.namespace.own, store.namespace.declare, store.namespace.shared.read, store.namespace.enumerate, plus contributor scopes store.{backend,migrator,indexer}.register.

fn-71

declareNamespace(spec): Promise<void>

Defined in: namespaces-core-plugins.ts:85

Declares (or re-declares idempotently) a namespace.

StoreNamespaceSpec

Promise<void>


put(namespace, id, doc): Promise<void>

Defined in: namespaces-core-plugins.ts:87

Upserts a document by id.

string

string

AnyJSONValue

Promise<void>


get(namespace, id): Promise<AnyJSONValue>

Defined in: namespaces-core-plugins.ts:89

Gets a document by id, or null.

string

string

Promise<AnyJSONValue>


delete(namespace, id): Promise<void>

Defined in: namespaces-core-plugins.ts:91

Deletes a document by id.

string

string

Promise<void>


query(namespace, query): Promise<AnyJSONValue[]>

Defined in: namespaces-core-plugins.ts:93

Queries documents in a namespace.

string

AnyJSONValue

Promise<AnyJSONValue[]>


setKV(namespace, key, value): Promise<void>

Defined in: namespaces-core-plugins.ts:95

Sets a KV entry.

string

string

AnyJSONValue

Promise<void>


getKV(namespace, key): Promise<AnyJSONValue>

Defined in: namespaces-core-plugins.ts:97

Gets a KV entry, or null.

string

string

Promise<AnyJSONValue>


deleteKV(namespace, key): Promise<void>

Defined in: namespaces-core-plugins.ts:99

Deletes a KV entry.

string

string

Promise<void>


listKV(namespace, prefix?): Promise<string[]>

Defined in: namespaces-core-plugins.ts:101

Lists KV keys, optionally filtered by prefix.

string

string

Promise<string[]>


compact(namespace): Promise<void>

Defined in: namespaces-core-plugins.ts:103

Compacts a namespace.

string

Promise<void>


export(namespace): Promise<string>

Defined in: namespaces-core-plugins.ts:105

Exports a namespace as base64 JSONL.

string

Promise<string>


importData(namespace, data): Promise<void>

Defined in: namespaces-core-plugins.ts:111

Imports namespace data previously produced by export().

QUIRK: the JS method name is importData (NOT import — reserved word).

string

string

Promise<void>