Skip to content

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

Using this module

Use the Artifact retention module for declaring and runtime-validating contracts. It exports 7 interfaces, 2 types.

Import from the package entrypoint

ts
import type {
  ArtifactRetentionDecision,
  ArtifactRetentionEvaluationRequest,
  ArtifactRetentionEvaluator,
  ArtifactRetentionProcessor,
  ArtifactRetentionProcessRequest,
  ArtifactRetentionProcessResult,
  DefaultArtifactRetentionProcessorOptions,
  ArtifactRetentionAction,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns

  • Use the 9 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
ArtifactRetentionDecisioninterfaceinterface ArtifactRetentionDecisionArtifact Retention Decision interface with 3 public fields or methods.
ArtifactRetentionEvaluationRequestinterfaceinterface ArtifactRetentionEvaluationRequestArtifact Retention Evaluation Request interface with 3 public fields or methods.
ArtifactRetentionEvaluatorinterfaceinterface ArtifactRetentionEvaluatorArtifact Retention Evaluator interface with 1 public fields or methods.
ArtifactRetentionProcessorinterfaceinterface ArtifactRetentionProcessorArtifact Retention Processor interface with 1 public fields or methods.
ArtifactRetentionProcessRequestinterfaceinterface ArtifactRetentionProcessRequestArtifact Retention Process Request interface with 6 public fields or methods.
ArtifactRetentionProcessResultinterfaceinterface ArtifactRetentionProcessResultArtifact Retention Process Result interface with 7 public fields or methods.
DefaultArtifactRetentionProcessorOptionsinterfaceinterface DefaultArtifactRetentionProcessorOptionsDefault Artifact Retention Processor Options interface with 4 public fields or methods.
ArtifactRetentionActiontypetype ArtifactRetentionAction = 'retain' | 'archive' | 'delete'Public type alias for Artifact Retention Action; the declaration contains its complete type expression.
ArtifactRetentionDecisionReasontypetype ArtifactRetentionDecisionReason = 'not_due' | 'already_terminal' | 'archive_after' | 'delete_after' | 'expired' | 'legal_hold' | 'referenced' | 'retain_final' | 'retain_failure'Public type alias for Artifact Retention Decision Reason; the declaration contains its complete type expression.

ArtifactRetentionDecision

Artifact Retention Decision interface with 3 public fields or methods.

Declaration

text
export interface ArtifactRetentionDecision {
    action: ArtifactRetentionAction;
    reason: ArtifactRetentionDecisionReason;
    effectiveAt?: string;
}

Contract members

MemberKindSignatureDescription
actionpropertyaction: ArtifactRetentionActionPublic property; its type, readonly modifier and optionality are shown in the signature.
effectiveAtpropertyeffectiveAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reasonpropertyreason: ArtifactRetentionDecisionReasonPublic property; its type, readonly modifier and optionality are shown in the signature.

ArtifactRetentionEvaluationRequest

Artifact Retention Evaluation Request interface with 3 public fields or methods.

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

Declaration

text
export interface ArtifactRetentionEvaluationRequest {
    record: ArtifactRecord;
    profile: ArtifactProfileSpec;
    evaluatedAt: string;
}

Contract members

MemberKindSignatureDescription
evaluatedAtpropertyevaluatedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
profilepropertyprofile: ArtifactProfileSpecPublic property; its type, readonly modifier and optionality are shown in the signature.
recordpropertyrecord: ArtifactRecordPublic property; its type, readonly modifier and optionality are shown in the signature.

ArtifactRetentionEvaluator

Artifact Retention Evaluator interface with 1 public fields or methods.

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

Declaration

text
export interface ArtifactRetentionEvaluator {
    evaluate(request: ArtifactRetentionEvaluationRequest): ArtifactRetentionDecision;
}

Contract members

MemberKindSignatureDescription
evaluatemethodevaluate(request: ArtifactRetentionEvaluationRequest): ArtifactRetentionDecisionPublic method; parameters and return type are shown in the signature.

ArtifactRetentionProcessor

Artifact Retention Processor interface with 1 public fields or methods.

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

Declaration

text
export interface ArtifactRetentionProcessor {
    process(request: ArtifactRetentionProcessRequest): Promise<ArtifactRetentionProcessResult>;
}

Contract members

MemberKindSignatureDescription
processmethodprocess(request: ArtifactRetentionProcessRequest): Promise<ArtifactRetentionProcessResult>Public method; parameters and return type are shown in the signature.

ArtifactRetentionProcessRequest

Artifact Retention Process Request interface with 6 public fields or methods.

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

Declaration

text
export interface ArtifactRetentionProcessRequest {
    operationId: string;
    principal: ExecutionPrincipal;
    artifactId: string;
    evaluatedAt?: string;
    dryRun?: boolean;
    idempotencyKey?: string;
}

Contract members

MemberKindSignatureDescription
artifactIdpropertyartifactId: stringPublic 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.
evaluatedAtpropertyevaluatedAt?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeypropertyidempotencyKey?: stringPublic 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.
principalpropertyprincipal: ExecutionPrincipalPublic property; its type, readonly modifier and optionality are shown in the signature.

ArtifactRetentionProcessResult

Artifact Retention Process Result interface with 7 public fields or methods.

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

Declaration

text
export interface ArtifactRetentionProcessResult {
    artifactId: string;
    versionId: string;
    workspaceId: string;
    decision: ArtifactRetentionDecision;
    /** True when this invocation applied the retention mutation. */
    applied: boolean;
    /** True when the same idempotent mutation was committed by an earlier attempt. */
    replayed: boolean;
    dryRun: boolean;
}

Contract members

MemberKindSignatureDescription
appliedpropertyapplied: booleanTrue when this invocation applied the retention mutation.
artifactIdpropertyartifactId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
decisionpropertydecision: ArtifactRetentionDecisionPublic 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.
replayedpropertyreplayed: booleanTrue when the same idempotent mutation was committed by an earlier attempt.
versionIdpropertyversionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIdpropertyworkspaceId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

DefaultArtifactRetentionProcessorOptions

Default Artifact Retention Processor Options interface with 4 public fields or methods.

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

Declaration

text
export interface DefaultArtifactRetentionProcessorOptions {
    manager: ArtifactManager;
    repository: ArtifactRecordRepository;
    evaluator?: ArtifactRetentionEvaluator;
    now?: () => string;
}

Contract members

MemberKindSignatureDescription
evaluatorpropertyevaluator?: ArtifactRetentionEvaluatorPublic property; its type, readonly modifier and optionality are shown in the signature.
managerpropertymanager: ArtifactManagerPublic property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
repositorypropertyrepository: ArtifactRecordRepositoryPublic property; its type, readonly modifier and optionality are shown in the signature.

ArtifactRetentionAction

Public type alias for Artifact Retention Action; the declaration contains its complete type expression.

Declaration

text
export type ArtifactRetentionAction = 'retain' | 'archive' | 'delete';

ArtifactRetentionDecisionReason

Public type alias for Artifact Retention Decision Reason; the declaration contains its complete type expression.

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

Declaration

text
export type ArtifactRetentionDecisionReason = 'not_due' | 'already_terminal' | 'archive_after' | 'delete_after' | 'expired' | 'legal_hold' | 'referenced' | 'retain_final' | 'retain_failure';