Skip to content

@codesoul-co/hypha-core / modules/runtime/state-execution-claim-store

Using this module

Use the State execution claim store module for persisting and reading data at this boundary. It exports 1 class, 2 functions, 1 interface.

Import from the package entrypoint

ts
import {
  InMemoryStateExecutionClaimStore,
  stateExecutionClaimGuard,
  stateExecutionClaimScopeKey,
} from '@codesoul-co/hypha-core';

import type {
  InMemoryStateExecutionClaimStoreOptions,
} from '@codesoul-co/hypha-core';

Usage patterns

  • Use the 1 type/interface export as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
  • The module exposes 2 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.

Public exports

SymbolKindSignatureDescription
InMemoryStateExecutionClaimStoreclassnew InMemoryStateExecutionClaimStore(options: InMemoryStateExecutionClaimStoreOptions): InMemoryStateExecutionClaimStoreIn Memory State Execution Claim Store class with 7 public constructor or member entries; its exact declarations are listed below.
stateExecutionClaimGuardfunctionstateExecutionClaimGuard(claim: StateExecutionClaim): StateExecutionClaimGuardState Execution Claim Guard function with 1 public call signature; parameters and return types are listed below.
stateExecutionClaimScopeKeyfunctionstateExecutionClaimScopeKey(scope: StateExecutionClaimScope): stringState Execution Claim Scope Key function with 1 public call signature; parameters and return types are listed below.
InMemoryStateExecutionClaimStoreOptionsinterfaceinterface InMemoryStateExecutionClaimStoreOptionsIn Memory State Execution Claim Store Options interface with 2 public fields or methods.

InMemoryStateExecutionClaimStore

In Memory State Execution Claim Store class with 7 public constructor or member entries; its exact declarations are listed below.

Declaration

text
export declare class InMemoryStateExecutionClaimStore implements StateExecutionClaimStore {
    constructor(options: InMemoryStateExecutionClaimStoreOptions);
    acquire(request: StateExecutionClaimAcquireRequest): Promise<StateExecutionClaim | null>;
    renew(request: StateExecutionClaimRenewRequest): Promise<StateExecutionClaim>;
    complete(request: StateExecutionClaimCompleteRequest): Promise<StateExecutionClaim>;
    release(request: StateExecutionClaimReleaseRequest): Promise<StateExecutionClaim>;
    get(scope: StateExecutionClaimScope, checkedAt?: string): Promise<StateExecutionClaim | null>;
    assertCurrent(request: StateExecutionClaimAssertionRequest): Promise<StateExecutionClaim>;
}

Public members

MemberKindSignatureDescription
acquiremethodacquire(request: StateExecutionClaimAcquireRequest): Promise<StateExecutionClaim | null>Public method; parameters and return type are shown in the signature.
assertCurrentmethodassertCurrent(request: StateExecutionClaimAssertionRequest): Promise<StateExecutionClaim>Public method; parameters and return type are shown in the signature.
completemethodcomplete(request: StateExecutionClaimCompleteRequest): Promise<StateExecutionClaim>Public method; parameters and return type are shown in the signature.
constructorconstructor(options: InMemoryStateExecutionClaimStoreOptions): InMemoryStateExecutionClaimStoreCreates an instance of this class.
getmethodget(scope: StateExecutionClaimScope, checkedAt?: string): Promise<StateExecutionClaim | null>Public method; parameters and return type are shown in the signature.
releasemethodrelease(request: StateExecutionClaimReleaseRequest): Promise<StateExecutionClaim>Public method; parameters and return type are shown in the signature.
renewmethodrenew(request: StateExecutionClaimRenewRequest): Promise<StateExecutionClaim>Public method; parameters and return type are shown in the signature.

stateExecutionClaimGuard

State Execution Claim Guard function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function stateExecutionClaimGuard(claim: StateExecutionClaim): StateExecutionClaimGuard;

Call signature

text
stateExecutionClaimGuard(claim: StateExecutionClaim): StateExecutionClaimGuard

Parameters

ParameterTypeRequiredDescription
claimStateExecutionClaimYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: StateExecutionClaimGuard
  • Description: The return contract is defined by the type shown above.

stateExecutionClaimScopeKey

State Execution Claim Scope Key function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function stateExecutionClaimScopeKey(scope: StateExecutionClaimScope): string;

Call signature

text
stateExecutionClaimScopeKey(scope: StateExecutionClaimScope): string

Parameters

ParameterTypeRequiredDescription
scopeStateExecutionClaimScopeYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: string
  • Description: The return contract is defined by the type shown above.

InMemoryStateExecutionClaimStoreOptions

In Memory State Execution Claim Store Options interface with 2 public fields or methods.

Declaration

text
export interface InMemoryStateExecutionClaimStoreOptions {
    runLeaseStore: Pick<RunLeaseStore, 'assertCurrent'>;
    now?: () => string;
}

Contract members

MemberKindSignatureDescription
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
runLeaseStorepropertyrunLeaseStore: Pick<RunLeaseStore, "assertCurrent">Public property; its type, readonly modifier and optionality are shown in the signature.