Skip to content

Interface: AppCache ​

The install's cached values: text the module keeps between the calls of its install, such as a vendor's token or session, under a name like a secret's (a letter, then up to 63 letters, digits or _). The platform keeps them sealed, per install, and clears them when a secret of the install is stored or revoked, its configuration or version changes, or an administrator clears them. A call sees what it sets at once, and the install's later calls see it once the call has ended, whatever it answered. Every value a call reads or sets is redacted from its answer, its log lines and its errors as [cache:NAME]. A method throws an AppError when the host refuses it: a name it cannot be, a value under 8 characters or over 8 KiB, more than 64 sets in one call, or a call the platform keeps no cache for.

Methods ​

delete() ​

ts
delete(name): boolean;

Removes the value kept under name; answers whether there was one.

Parameters ​

name ​

string

Returns ​

boolean


get() ​

ts
get(name): string | undefined;

The value kept under name, or undefined when none is: never set, expired, deleted.

Parameters ​

name ​

string

Returns ​

string | undefined


set() ​

ts
set(
   name, 
   value, 
   options
): string;

Keeps value under name for ttlSeconds, a day at most (a longer time is cut to a day), in place of the one kept before; answers when it expires (ISO 8601).

Parameters ​

name ​

string

value ​

string

options ​
ttlSeconds ​

number

Returns ​

string

Released under the Apache-2.0 License.