Skip to content

Welshman Docs / @welshman/app / Plaintext

Class: Plaintext ​

Defined in: plugins/plaintext.ts:20

A cache of decrypted content, keyed by the ciphertext. Decryption itself is supplied by the caller (the signer's underlying decrypt), so the cache stays independent of which signer produced the plaintext — and appPolicyCacheDecrypt can layer it onto user.signer without recursing back into the wrapped signer.

A caller shares a pending decryption requested at least as urgently, so concurrent callers prompt the signer once. An abort fails only the caller that started the decryption.

Extends ​

Constructors ​

Constructor ​

new Plaintext(app): Plaintext

Defined in: plugins/base.ts:81

Parameters ​

app ​

IApp

Returns ​

Plaintext

Inherited from ​

MapPlugin.constructor

Properties ​

all ​

all: Projection<string[]>

Defined in: plugins/base.ts:77

Inherited from ​

MapPlugin.all


app ​

protected readonly app: IApp

Defined in: plugins/base.ts:81

Inherited from ​

MapPlugin.app


index ​

index: Projection<ItemsByKey<string>>

Defined in: plugins/base.ts:76

Inherited from ​

MapPlugin.index


one ​

one: (key?, ...args) => Readable<Maybe<string>>

Defined in: plugins/base.ts:78

Parameters ​

key? ​

string

args ​

...any[]

Returns ​

Readable<Maybe<string>>

Inherited from ​

MapPlugin.one


store ​

protected store: Writable<Map<string, string>>

Defined in: plugins/base.ts:75

Inherited from ​

MapPlugin.store


subs ​

subs: (key, value) => void[] = []

Defined in: plugins/base.ts:79

Parameters ​

key ​

string

value ​

Maybe<string>

Returns ​

void

Inherited from ​

MapPlugin.subs

Methods ​

clear() ​

clear(): void

Defined in: plugins/base.ts:112

Returns ​

void

Inherited from ​

MapPlugin.clear


delete() ​

delete(key): void

Defined in: plugins/base.ts:102

Parameters ​

key ​

string

Returns ​

void

Inherited from ​

MapPlugin.delete


emitItem() ​

protected emitItem(key, value): void

Defined in: plugins/base.ts:132

Parameters ​

key ​

string

value ​

Maybe<string>

Returns ​

void

Inherited from ​

MapPlugin.emitItem


ensure() ​

ensure(ciphertext, decrypt, options?): Promise<string>

Defined in: plugins/plaintext.ts:23

Parameters ​

ciphertext ​

string

decrypt ​

() => Promise<string>

options? ​

SignerOptions = {}

Returns ​

Promise<string>


get() ​

get(key): string | undefined

Defined in: plugins/base.ts:87

Parameters ​

key ​

string

Returns ​

string | undefined

Inherited from ​

MapPlugin.get


onItem() ​

onItem(subscriber): Unsubscriber

Defined in: plugins/base.ts:122

Parameters ​

subscriber ​

(key, value) => void

Returns ​

Unsubscriber

Inherited from ​

MapPlugin.onItem


project() ​

project<U>(key, read): Projection<U>

Defined in: plugins/base.ts:89

Type Parameters ​

U ​

U

Parameters ​

key ​

string

read ​

(item) => U

Returns ​

Projection<U>

Inherited from ​

MapPlugin.project


set() ​

set(key, value): void

Defined in: plugins/base.ts:92

Parameters ​

key ​

string

value ​

string

Returns ​

void

Inherited from ​

MapPlugin.set