Skip to content

@codesoul-co/hypha-core / contracts/artifact-gc

Using this module

Use the Artifact gc module for declaring and runtime-validating contracts. It exports 8 interfaces.

Import from the package entrypoint

ts
import type {
  ArtifactGarbageCollectionCandidate,
  ArtifactGarbageCollectionClaimRequest,
  ArtifactGarbageCollectionFailure,
  ArtifactGarbageCollectionRequest,
  ArtifactGarbageCollectionResult,
  ArtifactGarbageCollectionScanRequest,
  ArtifactGarbageCollector,
  DefaultArtifactGarbageCollectorOptions,
} from '@codesoul-co/hypha-core';

Usage patterns

  • Use the 8 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.

Public exports

SymbolKindSignatureDescription
ArtifactGarbageCollectionCandidateinterfaceinterface ArtifactGarbageCollectionCandidateArtifact Garbage Collection Candidate interface with 5 public fields or methods.
ArtifactGarbageCollectionClaimRequestinterfaceinterface ArtifactGarbageCollectionClaimRequestArtifact Garbage Collection Claim Request interface with 4 public fields or methods.
ArtifactGarbageCollectionFailureinterfaceinterface ArtifactGarbageCollectionFailureArtifact Garbage Collection Failure interface with 4 public fields or methods.
ArtifactGarbageCollectionRequestinterfaceinterface ArtifactGarbageCollectionRequestArtifact Garbage Collection Request interface with 4 public fields or methods.
ArtifactGarbageCollectionResultinterfaceinterface ArtifactGarbageCollectionResultArtifact Garbage Collection Result interface with 12 public fields or methods.
ArtifactGarbageCollectionScanRequestinterfaceinterface ArtifactGarbageCollectionScanRequestArtifact Garbage Collection Scan Request interface with 2 public fields or methods.
ArtifactGarbageCollectorinterfaceinterface ArtifactGarbageCollectorArtifact Garbage Collector interface with 1 public fields or methods.
DefaultArtifactGarbageCollectorOptionsinterfaceinterface DefaultArtifactGarbageCollectorOptionsDefault Artifact Garbage Collector Options interface with 5 public fields or methods.

ArtifactGarbageCollectionCandidate

Artifact Garbage Collection Candidate interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { ArtifactGarbageCollectionCandidate } from '@codesoul-co/hypha-core';
  • Source module: contracts/artifact-gc

Declaration

text
export interface ArtifactGarbageCollectionCandidate {
    storageRef: ArtifactStorageRef;
    contentHash: string;
    sizeBytes: number;
    versionIds: string[];
    profileRefs: SpecRef[];
}

Contract members

MemberKindSignatureDescription
contentHashpropertycontentHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
profileRefspropertyprofileRefs: SpecRef[]Public property; its type, readonly modifier and optionality are shown in the signature.
sizeBytespropertysizeBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
storageRefpropertystorageRef: ArtifactStorageRefPublic property; its type, readonly modifier and optionality are shown in the signature.
versionIdspropertyversionIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

ArtifactGarbageCollectionClaimRequest

Artifact Garbage Collection Claim Request interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { ArtifactGarbageCollectionClaimRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/artifact-gc

Declaration

text
export interface ArtifactGarbageCollectionClaimRequest {
    claimId: string;
    claimedAt: string;
    staleBefore: string;
    candidate: ArtifactGarbageCollectionCandidate;
}

Contract members

MemberKindSignatureDescription
candidatepropertycandidate: ArtifactGarbageCollectionCandidatePublic property; its type, readonly modifier and optionality are shown in the signature.
claimedAtpropertyclaimedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
claimIdpropertyclaimId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
staleBeforepropertystaleBefore: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ArtifactGarbageCollectionFailure

Artifact Garbage Collection Failure interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { ArtifactGarbageCollectionFailure } from '@codesoul-co/hypha-core';
  • Source module: contracts/artifact-gc

Declaration

text
export interface ArtifactGarbageCollectionFailure {
    storageRef: ArtifactStorageRef;
    code: string;
    message: string;
    retryable: boolean;
}

Contract members

MemberKindSignatureDescription
codepropertycode: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
messagepropertymessage: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
retryablepropertyretryable: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
storageRefpropertystorageRef: ArtifactStorageRefPublic property; its type, readonly modifier and optionality are shown in the signature.

ArtifactGarbageCollectionRequest

Artifact Garbage Collection Request interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { ArtifactGarbageCollectionRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/artifact-gc

Declaration

text
export interface ArtifactGarbageCollectionRequest {
    operationId: string;
    dryRun?: boolean;
    limit?: number;
    claimTtlSeconds?: number;
}

Contract members

MemberKindSignatureDescription
claimTtlSecondspropertyclaimTtlSeconds?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
dryRunpropertydryRun?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
limitpropertylimit?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ArtifactGarbageCollectionResult

Artifact Garbage Collection Result interface with 12 public fields or methods.

  • Kind: interface
  • Import: import type { ArtifactGarbageCollectionResult } from '@codesoul-co/hypha-core';
  • Source module: contracts/artifact-gc

Declaration

text
export interface ArtifactGarbageCollectionResult {
    operationId: string;
    dryRun: boolean;
    candidateObjects: number;
    claimedObjects: number;
    deletedObjects: number;
    missingObjects: number;
    skippedPolicyObjects: number;
    skippedConcurrentObjects: number;
    reclaimedBytes: number;
    failures: ArtifactGarbageCollectionFailure[];
    startedAt: string;
    completedAt: string;
}

Contract members

MemberKindSignatureDescription
candidateObjectspropertycandidateObjects: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
claimedObjectspropertyclaimedObjects: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
completedAtpropertycompletedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
deletedObjectspropertydeletedObjects: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
dryRunpropertydryRun: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
failurespropertyfailures: ArtifactGarbageCollectionFailure[]Public property; its type, readonly modifier and optionality are shown in the signature.
missingObjectspropertymissingObjects: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reclaimedBytespropertyreclaimedBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
skippedConcurrentObjectspropertyskippedConcurrentObjects: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
skippedPolicyObjectspropertyskippedPolicyObjects: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
startedAtpropertystartedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ArtifactGarbageCollectionScanRequest

Artifact Garbage Collection Scan Request interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { ArtifactGarbageCollectionScanRequest } from '@codesoul-co/hypha-core';
  • Source module: contracts/artifact-gc

Declaration

text
export interface ArtifactGarbageCollectionScanRequest {
    limit?: number;
    staleBefore: string;
}

Contract members

MemberKindSignatureDescription
limitpropertylimit?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
staleBeforepropertystaleBefore: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ArtifactGarbageCollector

Artifact Garbage Collector interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { ArtifactGarbageCollector } from '@codesoul-co/hypha-core';
  • Source module: contracts/artifact-gc

Declaration

text
export interface ArtifactGarbageCollector {
    collect(request: ArtifactGarbageCollectionRequest): Promise<ArtifactGarbageCollectionResult>;
}

Contract members

MemberKindSignatureDescription
collectmethodcollect(request: ArtifactGarbageCollectionRequest): Promise<ArtifactGarbageCollectionResult>Public method; parameters and return type are shown in the signature.

DefaultArtifactGarbageCollectorOptions

Default Artifact Garbage Collector Options interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { DefaultArtifactGarbageCollectorOptions } from '@codesoul-co/hypha-core';
  • Source module: contracts/artifact-gc

Declaration

text
export interface DefaultArtifactGarbageCollectorOptions {
    profiles: ArtifactProfileSpec[];
    stores: ArtifactStoreProvider[];
    repository: ArtifactRecordRepository;
    idGenerator: () => string;
    now?: () => string;
}

Contract members

MemberKindSignatureDescription
idGeneratormethodidGenerator(): stringPublic method; parameters and return type are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
profilespropertyprofiles: ArtifactProfileSpec[]Public property; its type, readonly modifier and optionality are shown in the signature.
repositorypropertyrepository: ArtifactRecordRepositoryPublic property; its type, readonly modifier and optionality are shown in the signature.
storespropertystores: ArtifactStoreProvider[]Public property; its type, readonly modifier and optionality are shown in the signature.