Skip to content

@codesoul-co/hypha-adapters-local / in-memory-artifact-record-repository

Using this module

Use the In memory artifact record repository module for persisting and reading data at this boundary. It exports 1 class, 1 interface.

Import from the package entrypoint

ts
import {
  InMemoryArtifactRecordRepository,
} from '@codesoul-co/hypha-adapters-local';

import type {
  InMemoryArtifactRecordRepositoryOptions,
} from '@codesoul-co/hypha-adapters-local';

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.

Public exports

SymbolKindSignatureDescription
InMemoryArtifactRecordRepositoryclassnew InMemoryArtifactRecordRepository(options?: InMemoryArtifactRecordRepositoryOptions): InMemoryArtifactRecordRepositoryIn Memory Artifact Record Repository class with 12 public constructor or member entries; its exact declarations are listed below.
InMemoryArtifactRecordRepositoryOptionsinterfaceinterface InMemoryArtifactRecordRepositoryOptionsIn Memory Artifact Record Repository Options interface with 2 public fields or methods.

InMemoryArtifactRecordRepository

In Memory Artifact Record Repository class with 12 public constructor or member entries; its exact declarations are listed below.

Declaration

text
export declare class InMemoryArtifactRecordRepository implements ArtifactRecordRepository {
    readonly id: string;
    constructor(options?: InMemoryArtifactRecordRepositoryOptions);
    get(artifactId: string, versionId?: string): Promise<StoredArtifactRecord | null>;
    getByVersionId(versionId: string): Promise<StoredArtifactRecord | null>;
    list(): Promise<StoredArtifactRecord[]>;
    findIdempotency(operationId: string, idempotencyKey: string): Promise<StoredArtifactRecord | null>;
    commit(request: ArtifactRecordCommitRequest): Promise<void>;
    listGarbageCollectionCandidates(request: ArtifactGarbageCollectionScanRequest): Promise<ArtifactGarbageCollectionCandidate[]>;
    claimGarbageCollection(request: ArtifactGarbageCollectionClaimRequest): Promise<boolean>;
    completeGarbageCollection(claimId: string, completedAt: string): Promise<void>;
    releaseGarbageCollection(claimId: string): Promise<void>;
    health(): Promise<ProviderHealth>;
}

Public members

MemberKindSignatureDescription
claimGarbageCollectionmethodclaimGarbageCollection(request: ArtifactGarbageCollectionClaimRequest): Promise<boolean>Public method; parameters and return type are shown in the signature.
commitmethodcommit(request: ArtifactRecordCommitRequest): Promise<void>Public method; parameters and return type are shown in the signature.
completeGarbageCollectionmethodcompleteGarbageCollection(claimId: string, completedAt: string): Promise<void>Public method; parameters and return type are shown in the signature.
constructorconstructor(options?: InMemoryArtifactRecordRepositoryOptions): InMemoryArtifactRecordRepositoryCreates an instance of this class.
findIdempotencymethodfindIdempotency(operationId: string, idempotencyKey: string): Promise<StoredArtifactRecord | null>Public method; parameters and return type are shown in the signature.
getmethodget(artifactId: string, versionId?: string): Promise<StoredArtifactRecord | null>Public method; parameters and return type are shown in the signature.
getByVersionIdmethodgetByVersionId(versionId: string): Promise<StoredArtifactRecord | null>Public method; parameters and return type are shown in the signature.
healthmethodhealth(): Promise<ProviderHealth>Public method; parameters and return type are shown in the signature.
idpropertyreadonly id: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
listmethodlist(): Promise<StoredArtifactRecord[]>Public method; parameters and return type are shown in the signature.
listGarbageCollectionCandidatesmethodlistGarbageCollectionCandidates(request: ArtifactGarbageCollectionScanRequest): Promise<ArtifactGarbageCollectionCandidate[]>Public method; parameters and return type are shown in the signature.
releaseGarbageCollectionmethodreleaseGarbageCollection(claimId: string): Promise<void>Public method; parameters and return type are shown in the signature.

InMemoryArtifactRecordRepositoryOptions

In Memory Artifact Record Repository Options interface with 2 public fields or methods.

Declaration

text
export interface InMemoryArtifactRecordRepositoryOptions {
    id?: string;
    now?: () => string;
}

Contract members

MemberKindSignatureDescription
idpropertyid?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.