Skip to main content

index

Classes

BaetaCache

Implements

  • DurableObject

Constructors

new BaetaCache()

new BaetaCache(state, env): BaetaCache

Parameters
ParameterType

state

DurableObjectState

env

{}

Returns

BaetaCache

Properties

PropertyModifierType

env

public

object

state

public

DurableObjectState

Methods

alarm()

alarm(): Promise<void>

Returns

Promise<void>

Implementation of

DurableObject.alarm

delete()

delete(keys): Promise<null>

Parameters
ParameterType

keys

string[]

Returns

Promise<null>

fetch()

fetch(request): Promise<Response>

Parameters
ParameterType

request

Request<unknown, CfProperties<unknown>>

Returns

Promise<Response>

Implementation of

DurableObject.fetch

get()

get(keys): Promise<string>

Parameters
ParameterType

keys

string[]

Returns

Promise<string>

handleEviction()

handleEviction(): Promise<void>

Returns

Promise<void>

list()

list(prefix, startAfter?, limit?): Promise<string>

Parameters
ParameterType

prefix

string

startAfter?

string

limit?

number

Returns

Promise<string>

put()

put(values, ttl?): Promise<null>

Parameters
ParameterType

values

[string, string][]

ttl?

number

Returns

Promise<null>

scheduledEviction()

scheduledEviction(at): Promise<void>

Parameters
ParameterType

at

number

Returns

Promise<void>


CloudflareCacheClient

Constructors

new CloudflareCacheClient()

new CloudflareCacheClient(durableObject): CloudflareCacheClient

Parameters
ParameterType

durableObject

DurableObjectNamespace<undefined>

Returns

CloudflareCacheClient

Properties

PropertyModifierType

durableObject

public

DurableObjectNamespace<undefined>

Methods

delete()

delete(keys): Promise<null>

Parameters
ParameterType

keys

string[]

Returns

Promise<null>

deleteOne()

deleteOne(key): Promise<null>

Parameters
ParameterType

key

string

Returns

Promise<null>

get()

get(keys): Promise<(null | string)[]>

Parameters
ParameterType

keys

string[]

Returns

Promise<(null | string)[]>

getOne()

getOne(key): Promise<null | string>

Parameters
ParameterType

key

string

Returns

Promise<null | string>

list()

list(prefix, startAfter?, limit?): Promise<string[]>

Parameters
ParameterType

prefix

string

startAfter?

string

limit?

number

Returns

Promise<string[]>

put()

put(values, ttl?): Promise<null>

Parameters
ParameterType

values

[string, string][]

ttl?

number

Returns

Promise<null>

putOne()

putOne(key, value, ttl?): Promise<null>

Parameters
ParameterType

key

string

value

string

ttl?

number

Returns

Promise<null>


CloudflareStoreAdapter<Item>

Extends

  • StoreAdapter<Item>

Type Parameters

Type Parameter

Item

Constructors

new CloudflareStoreAdapter()

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

Parameters
ParameterType

durableObject

DurableObjectNamespace<undefined>

options

StoreOptions<Item>

type

string

hash

string

Returns

CloudflareStoreAdapter<Item>

Overrides

StoreAdapter<Item>.constructor

Properties

PropertyModifierTypeInherited from

hash

protected

string

StoreAdapter.hash

loader

protected

DataLoader<ItemRef, null | Item, ItemRef>

StoreAdapter.loader

options

protected

StoreOptions<Item>

StoreAdapter.options

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

encodePrimitive()

protected encodePrimitive(value, catchAll?): null | string

Parameters
ParameterType

value

unknown

catchAll?

string

Returns

null | string

Inherited from

StoreAdapter.encodePrimitive

encodeProperty()

protected encodeProperty(value): string

Parameters
ParameterType

value

string

Returns

string

Inherited from

StoreAdapter.encodeProperty

encodeQueryArgs()

protected encodeQueryArgs(args, catchAll?): string

Parameters
ParameterType

args

Record<string, unknown>

catchAll?

string

Returns

string

Inherited from

StoreAdapter.encodeQueryArgs

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()

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

Parameters
ParameterType

refs

ItemRef[]

Returns

Promise<null | 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

getRefFallback()

protected getRefFallback(root): undefined | string

Parameters
ParameterType

root

unknown

Returns

undefined | string

Inherited from

StoreAdapter.getRefFallback

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

refillNullQueryItems()

protected refillNullQueryItems(nullableRefs, items): (null | Item)[]

Parameters
ParameterType

nullableRefs

(null | ItemRef)[]

items

Item[]

Returns

(null | Item)[]

Inherited from

StoreAdapter.refillNullQueryItems

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[]>

shouldEncode()

protected shouldEncode(value): boolean

Parameters
ParameterType

value

string

Returns

boolean

Inherited from

StoreAdapter.shouldEncode

validateRefType()

protected validateRefType(ref): asserts ref is string | number | bigint

Parameters
ParameterType

ref

unknown

Returns

asserts ref is string | number | bigint

Inherited from

StoreAdapter.validateRefType