AbstractAbstractgetRetrieves a value from storage by key.
Returns the stored value deserialized to the specified type, or null if the key doesn't exist or the value is null.
The expected type of the stored value
The storage key to retrieve
Promise resolving to the stored value or null
AbstractsetStores a value in persistent storage.
The value will be JSON-serialized and stored persistently. Any existing value at the same key will be overwritten.
The type of value being stored
The storage key to use
The value to store (must be JSON-serializable)
Promise that resolves when the value is stored
AbstractclearRemoves a specific key from storage.
After this operation, get() calls for this key will return null. No error is thrown if the key doesn't exist.
The storage key to remove
Promise that resolves when the key is removed
AbstractclearRemoves all keys from this storage instance.
This operation clears all data stored by this twist/tool instance but does not affect storage for other twists or tools.
Promise that resolves when all keys are removed
Built-in tool for persistent key-value storage.
The Store tool provides twists and tools with a simple, persistent storage mechanism that survives worker restarts and invocations. Each twist/tool instance gets its own isolated storage namespace.
Note: Store methods are also available directly on Twist and Tool classes via
this.get(),this.set(),this.clear(), andthis.clearAll(). This is the recommended approach for most use cases.Storage Characteristics:
Use Cases:
Example