Skip to main content
Version: 1.x

CloudflareStoreAdapter<Item>

Extends​

Type Parameters​

Type Parameter

Item

Constructors​

Constructor​

new CloudflareStoreAdapter<Item>(durableObject, serializer, options, type, hash): CloudflareStoreAdapter<Item>

Parameters​

ParameterType

durableObject

DurableObjectNamespace

serializer

Serializer

options

StoreOptions<Item>

type

string

hash

string

Returns​

CloudflareStoreAdapter<Item>

Overrides​

StoreAdapter.constructor

Properties​

PropertyModifierTypeInherited from

hash

protected

string

StoreAdapter.hash

loader

protected

DataLoader<ItemRef, null | Item, ItemRef>

StoreAdapter.loader

options

protected

StoreOptions<Item>

StoreAdapter.options

serializer

protected

Serializer

StoreAdapter.serializer

type

protected

string

StoreAdapter.type

Methods​

createKey()​

protected createKey(ref): string

Parameters​

ParameterType

ref

ItemRef

Returns​

string

Inherited from​

StoreAdapter.createKey


createKeyByItem()​

protected createKeyByItem(item): string

Parameters​

ParameterType

item

Item

Returns​

string

Inherited from​

StoreAdapter.createKeyByItem


createKeyByQuery()​

protected createKeyByQuery(queryRef, parentRef?, args?): string

Parameters​

ParameterType

queryRef

string

parentRef?

ParentRef

args?

Record<string, unknown>

Returns​

string

Inherited from​

StoreAdapter.createKeyByQuery


createMiddleware()​

createMiddleware<Result, Root, Args>(queryRef, ...args): Middleware<Result, Root, unknown, Args>

Type Parameters​

Type Parameter

Result

Root

Args

Parameters​

ParameterType

queryRef

CacheRef<Result, Root, Args>

...args

Root extends RefCompatibleRoot ? [CacheMiddlewareOptions<Root<Root>>] : [RequiredCacheMiddlewareOptions<Root>]

Returns​

Middleware<Result, Root, unknown, Args>

Inherited from​

StoreAdapter.createMiddleware


createQueryKeyGlobMatcher()​

protected createQueryKeyGlobMatcher(queryRef, parentRef, args): string

Parameters​

ParameterType

queryRef

string

parentRef

NonNullable<ParentRef>

args

Record<string, unknown>

Returns​

string

Inherited from​

StoreAdapter.createQueryKeyGlobMatcher


createQueryKeyHeader()​

protected createQueryKeyHeader(parentRef, args?): string

Parameters​

ParameterType

parentRef

ParentRef

args?

Record<string, unknown>

Returns​

string

Inherited from​

StoreAdapter.createQueryKeyHeader


createQueryKeyNamespace()​

protected createQueryKeyNamespace(queryRef): string

Parameters​

ParameterType

queryRef

string

Returns​

string

Inherited from​

StoreAdapter.createQueryKeyNamespace


createQueryKeyRegExpMatcher()​

protected createQueryKeyRegExpMatcher(queryRef, parentRef, args): RegExp

Parameters​

ParameterType

queryRef

string

parentRef

NonNullable<ParentRef>

args

Record<string, unknown>

Returns​

RegExp

Inherited from​

StoreAdapter.createQueryKeyRegExpMatcher


decodeQueryItemRef()​

protected decodeQueryItemRef(encodedRef): null | string

Parameters​

ParameterType

encodedRef

string

Returns​

null | string

Inherited from​

StoreAdapter.decodeQueryItemRef


delete()​

delete(ref, evictQueries?): Promise<void>

Parameters​

ParameterType

ref

ItemRef

evictQueries?

boolean

Returns​

Promise<void>

Inherited from​

StoreAdapter.delete


deleteMany()​

deleteMany(refs, evictQueries): Promise<void>

Parameters​

ParameterTypeDefault value

refs

ItemRef[]

undefined

evictQueries

boolean

true

Returns​

Promise<void>

Overrides​

StoreAdapter.deleteMany


deleteQueries()​

deleteQueries<Result, Root, Args>(queryRef?, matcher?): Promise<void>

Type Parameters​

Type Parameter

Result

Root

Args

Parameters​

ParameterType

queryRef?

CacheRef<Result, Root, Args>

matcher?

CacheQueryMatching<Args>

Returns​

Promise<void>

Inherited from​

StoreAdapter.deleteQueries


deleteQueriesByRef()​

protected deleteQueriesByRef(queryRef?, parentRef?, args?): Promise<void>

Parameters​

ParameterType

queryRef?

string

parentRef?

ParentRef

args?

Record<string, unknown>

Returns​

Promise<void>

Overrides​

StoreAdapter.deleteQueriesByRef


encodeQueryItemRef()​

protected encodeQueryItemRef(item): string

Parameters​

ParameterType

item

null | Item

Returns​

string

Inherited from​

StoreAdapter.encodeQueryItemRef


get()​

get(ref): Promise<null | Item>

Parameters​

ParameterType

ref

ItemRef

Returns​

Promise<null | Item>

Inherited from​

StoreAdapter.get


getMany()​

Call Signature​

getMany(refs): Promise<null | Item[]>

Parameters​
ParameterType

refs

ItemRef[]

Returns​

Promise<null | Item[]>

Inherited from​

StoreAdapter.getMany

Call Signature​

getMany<T>(refs, fallback): Promise<Item[]>

Type Parameters​
Type Parameter

T extends ItemRef

Parameters​
ParameterType

refs

T[]

fallback

(refs) => Promise<Item[]>

Returns​

Promise<Item[]>

Inherited from​

StoreAdapter.getMany


getPartialMany()​

getPartialMany(refs): Promise<null | (null | Item)[]>

Parameters​

ParameterType

refs

ItemRef[]

Returns​

Promise<null | (null | Item)[]>

Overrides​

StoreAdapter.getPartialMany


getQueryResult()​

getQueryResult<Result, Root, Args>(queryRef, matcher?): Promise<null | { query: Result; }>

Type Parameters​

Type Parameter

Result

Root

Args

Parameters​

ParameterType

queryRef

CacheRef<Result, Root, Args>

matcher?

CacheQueryMatching<Args>

Returns​

Promise<null | { query: Result; }>

Inherited from​

StoreAdapter.getQueryResult


getRef()​

protected getRef(root): ItemRef

Parameters​

ParameterType

root

Item

Returns​

ItemRef

Inherited from​

StoreAdapter.getRef


getRevision()​

protected getRevision(): string

Returns​

string

Inherited from​

StoreAdapter.getRevision


getTtl()​

protected getTtl(): undefined | number

Returns​

undefined | number


loaderFn()​

protected loaderFn(refs): Promise<any[]>

Parameters​

ParameterType

refs

readonly ItemRef[]

Returns​

Promise<any[]>

Inherited from​

StoreAdapter.loaderFn


loadQueryMetadata()​

protected loadQueryMetadata(queryRef, parentRef?, args?): Promise<null | string[]>

Parameters​

ParameterType

queryRef

string

parentRef?

ParentRef

args?

Record<string, unknown>

Returns​

Promise<null | string[]>

Overrides​

StoreAdapter.loadQueryMetadata


parseItem()​

protected parseItem(value): Item

Parameters​

ParameterType

value

string

Returns​

Item

Inherited from​

StoreAdapter.parseItem


save()​

save(item): Promise<void>

Parameters​

ParameterType

item

Item

Returns​

Promise<void>

Inherited from​

StoreAdapter.save


saveMany()​

saveMany(items): Promise<void>

Parameters​

ParameterType

items

Item[]

Returns​

Promise<void>

Overrides​

StoreAdapter.saveMany


saveQueryMetadata()​

protected saveQueryMetadata(queryRef, meta, parentRef?, args?): Promise<void>

Parameters​

ParameterType

queryRef

string

meta

string[]

parentRef?

ParentRef

args?

Record<string, unknown>

Returns​

Promise<void>

Overrides​

StoreAdapter.saveQueryMetadata


saveQueryResult()​

saveQueryResult<Result, Root, Args>(queryRef, data, matcher?): Promise<void>

Type Parameters​

Type Parameter

Result

Root

Args

Parameters​

ParameterType

queryRef

CacheRef<Result, Root, Args>

data

Result

matcher?

CacheQueryMatching<Args>

Returns​

Promise<void>

Inherited from​

StoreAdapter.saveQueryResult


searchQueries()​

protected searchQueries(queryRef, parentRef, args): Promise<string[]>

Parameters​

ParameterTypeDefault value

queryRef

string

'*'

parentRef

NonNullable<ParentRef>

'*'

args

Record<string, unknown>

{}

Returns​

Promise<string[]>


stringifyItem()​

protected stringifyItem(item): string

Parameters​

ParameterType

item

Item

Returns​

string

Inherited from​

StoreAdapter.stringifyItem