@archastro/sdk
    Preparing search index...
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Create a key-value storage entry Creates a key once per owner. An existing key returns HTTP 409 conflict, including expired rows awaiting sweep. User-JWT callers use their own storage. Elevated callers select an owner with system: true, team, user, or agent (in that priority order). An org alone selects system ownership within that organization; all owners must be in the app scope. Create and upsert accept a positive ttl_seconds; absent means no expiry. Script binding (kv.create): the entry is owned by the triggering automation's owner; scripts pass no owner params. A duplicate key returns a script Err with code "conflict" instead of raising.

      Parameters

      • input: {
            agent?: string;
            key: string;
            org?: string;
            system?: boolean;
            team?: string;
            ttl_seconds?: number;
            user?: string;
            value: string;
        }

        Request body.

        • Optionalagent?: string

          Agent owner ID.

        • key: string

          Storage key for the entry. Must be a non-empty string unique to this user.

        • Optionalorg?: string

          Organization scope for the owner.

        • Optionalsystem?: boolean

          Select system ownership within the app or organization.

        • Optionalteam?: string

          Team owner ID.

        • Optionalttl_seconds?: number

          Positive lifetime in seconds; omitted means no expiry.

        • Optionaluser?: string

          User owner ID. Elevated callers may instead select team, agent, org, or system ownership.

        • value: string

          Value to store under key. Must be a non-empty string.

      Returns Promise<KeyValueStorageEntry>

      The newly created key-value storage entry.

    • Delete a key-value storage entry Deletes an unexpired entry by owner and key. Returns 204, or 404 when absent. User-JWT callers use their own storage. Elevated callers select an owner with system: true, team, user, or agent (in that priority order). An org alone selects system ownership within that organization; all owners must be in the app scope. Create and upsert accept a positive ttl_seconds; absent means no expiry. Script binding (kv.delete): removes the entry owned by the triggering automation's owner; scripts pass no owner params.

      Parameters

      • key: string

        Storage key of the entry to delete. Must be a non-empty string.

      Returns Promise<{ deleted: boolean; key: string }>

      Successful response

    • Retrieve a key-value storage entry Returns an unexpired entry by owner and key, or 404. User-JWT callers use their own storage. Elevated callers select an owner with system: true, team, user, or agent (in that priority order). An org alone selects system ownership within that organization; all owners must be in the app scope. Create and upsert accept a positive ttl_seconds; absent means no expiry. Script binding (kv.get): reads the entry owned by the triggering automation's owner; scripts pass no owner params.

      Parameters

      • key: string

        Storage key of the entry to retrieve. Must be a non-empty string.

      • Optionalparams: { agent?: string; org?: string; system?: boolean; team?: string; user?: string }

        Query parameters.

        • Optionalagent?: string

          Agent owner ID.

        • Optionalorg?: string

          Organization scope for the owner.

        • Optionalsystem?: boolean

          Select system ownership within the app or organization.

        • Optionalteam?: string

          Team owner ID.

        • Optionaluser?: string

          User owner ID. Elevated callers may instead select team, agent, org, or system ownership.

      Returns Promise<KeyValueStorageEntry>

      The key-value storage entry for the given key.

    • List key-value storage entries Returns key-value storage entries in one of two modes depending on the caller's auth scope. User-JWT callers receive a flat list of all their own entries with no pagination fields. The page, page_size, user, user_search, and key params are ignored. Developer and server-to-server callers receive a page-based paginated response across all users within the caller's app. Use user to scope results to a single user, user_search to do a substring match on email or full name, and key to filter entries whose key starts with the given prefix. Results are ordered by update time descending. Supplying org, team, agent, or system selects a single owner's flat list instead. Expired entries are excluded in every mode.

      Parameters

      • Optionalparams: {
            agent?: string;
            key?: string;
            org?: string;
            page?: number;
            pageSize?: number;
            system?: boolean;
            team?: string;
            user?: string;
            userSearch?: string;
        }

        Query parameters.

        • Optionalagent?: string

          Agent owner ID.

        • Optionalkey?: string

          Prefix filter on the storage key. Returns only entries whose key starts with this string. Applies to developer and server-to-server callers only.

        • Optionalorg?: string

          Organization scope for the owner.

        • Optionalpage?: number

          Page number to retrieve. Applies to developer and server-to-server callers only. Defaults to 1.

        • OptionalpageSize?: number

          Number of entries per page. Applies to developer and server-to-server callers only. Defaults to 25; maximum is 100.

        • Optionalsystem?: boolean

          Select system ownership within the app or organization.

        • Optionalteam?: string

          Team owner ID.

        • Optionaluser?: string

          Filter results to entries belonging to this user ID. Applies to developer and server-to-server callers only.

        • OptionaluserSearch?: string

          Substring match against user email address and full name. Applies to developer and server-to-server callers only.

      Returns Promise<KeyValueStorageEntryPage>

      Key-value storage entries for the current page, with pagination metadata for developer and server-to-server callers.

    • Create or update a key-value storage entry Creates or replaces a value and its expiry. Omitted ttl_seconds clears any previous expiry. User-JWT callers use their own storage. Elevated callers select an owner with system: true, team, user, or agent (in that priority order). An org alone selects system ownership within that organization; all owners must be in the app scope. Create and upsert accept a positive ttl_seconds; absent means no expiry. Script binding (kv.upsert): overwrites the entry owned by the triggering automation's owner; scripts pass no owner params.

      Parameters

      • key: string

        Storage key to create or overwrite. Must be a non-empty string.

      • input: {
            agent?: string;
            org?: string;
            system?: boolean;
            team?: string;
            ttl_seconds?: number;
            user?: string;
            value: string;
        }

        Request body.

        • Optionalagent?: string

          Agent owner ID.

        • Optionalorg?: string

          Organization scope for the owner.

        • Optionalsystem?: boolean

          Select system ownership within the app or organization.

        • Optionalteam?: string

          Team owner ID.

        • Optionalttl_seconds?: number

          Positive lifetime in seconds; omitted means no expiry.

        • Optionaluser?: string

          User owner ID. Elevated callers may instead select team, agent, org, or system ownership.

        • value: string

          New value to store under key. Must be a non-empty string. Replaces any existing value.

      Returns Promise<KeyValueStorageEntry>

      The created or updated key-value storage entry.