Skip to content

tasra-sdk/app/node

Generated from public TypeScript exports.

SDK reference · Task guides · Errors

Clients, adapters and error classes.

Browse 1 classes

A state lock is already held and requires reconciliation before manual removal.

Source

Import: import {StoreLockedError} from 'tasra-sdk/app/node'

declare class StoreLockedError {
constructor(key: string);
}
  • readonly key: string; — Store entry whose exclusive lock could not be acquired.

  • readonly retryable: boolean; — false when retrying the identical request cannot succeed.

  • name: string;

  • message: string;

  • stack?: string;

  • cause?: unknown;

Operations you can import and call.

Browse 1 functions

The directory is private, trusted application state, not an untrusted shared folder.

Source

Import: import {createFileStore} from 'tasra-sdk/app/node'

declare function createFileStore(directory: string): ApplicationStore;
Parameter Type Description
directory string Private application state directory owned by the current operating-system user.

Returns: ApplicationStore.

Options, data structures and return types.

Browse 1 types

Durable private state storage with exclusive locking for each named operation.

Source

export interface ApplicationStore {
load<T>(key: string): Promise<T | undefined>;
save<T>(key: string, value: T): Promise<void>;
withLock<T>(key: string, action: () => Promise<T>): Promise<T>;
}

Fields:

  • load: Load a saved value, or return undefined when the key does not exist.
  • save: Atomically persist private state before resolving.
  • withLock: Exclusively serialize work for the key across all participating processes or tabs.