Skip to content

@codesoul-co/hypha-adapters-local / legacy-tool-artifact-migration-rollback

Using this module

Use the Legacy tool artifact migration rollback module for using the public contracts and operations for this capability boundary. It exports 2 classes, 5 interfaces, 1 type.

Import from the package entrypoint

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

import type {
  LegacyToolArtifactMigrationRollbackExecutorOptions,
  LegacyToolArtifactMigrationRollbackItem,
  LegacyToolArtifactMigrationRollbackRequest,
  LegacyToolArtifactMigrationRollbackResult,
  LegacyToolArtifactMigrationRollbackSummary,
  LegacyToolArtifactMigrationRollbackErrorCode,
} from '@codesoul-co/hypha-adapters-local';

Usage patterns

  • Use the 6 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 2 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
LegacyToolArtifactMigrationRollbackErrorclassnew LegacyToolArtifactMigrationRollbackError(code: LegacyToolArtifactMigrationRollbackErrorCode, message: string, details?: Record<string, unknown> | undefined): LegacyToolArtifactMigrationRollbackErrorLegacy Tool Artifact Migration Rollback Error class with 10 public constructor or member entries; its exact declarations are listed below.
LegacyToolArtifactMigrationRollbackExecutorclassnew LegacyToolArtifactMigrationRollbackExecutor(options: LegacyToolArtifactMigrationRollbackExecutorOptions): LegacyToolArtifactMigrationRollbackExecutorReverses only Artifacts proven to have been created by a specific migration report. Revision fences prevent rollback from deleting a later mutation.
LegacyToolArtifactMigrationRollbackExecutorOptionsinterfaceinterface LegacyToolArtifactMigrationRollbackExecutorOptionsLegacy Tool Artifact Migration Rollback Executor Options interface with 1 public fields or methods.
LegacyToolArtifactMigrationRollbackIteminterfaceinterface LegacyToolArtifactMigrationRollbackItemLegacy Tool Artifact Migration Rollback Item interface with 8 public fields or methods.
LegacyToolArtifactMigrationRollbackRequestinterfaceinterface LegacyToolArtifactMigrationRollbackRequestLegacy Tool Artifact Migration Rollback Request interface with 3 public fields or methods.
LegacyToolArtifactMigrationRollbackResultinterfaceinterface LegacyToolArtifactMigrationRollbackResultLegacy Tool Artifact Migration Rollback Result interface with 6 public fields or methods.
LegacyToolArtifactMigrationRollbackSummaryinterfaceinterface LegacyToolArtifactMigrationRollbackSummaryLegacy Tool Artifact Migration Rollback Summary interface with 5 public fields or methods.
LegacyToolArtifactMigrationRollbackErrorCodetypetype LegacyToolArtifactMigrationRollbackErrorCode = 'LEGACY_MIGRATION_ROLLBACK_INVALID_REPORT' | 'LEGACY_MIGRATION_ROLLBACK_TARGET_MISMATCH'Public type alias for Legacy Tool Artifact Migration Rollback Error Code; the declaration contains its complete type expression.

LegacyToolArtifactMigrationRollbackError

Legacy Tool Artifact Migration Rollback Error class with 10 public constructor or member entries; its exact declarations are listed below.

Declaration

text
export declare class LegacyToolArtifactMigrationRollbackError extends Error {
    readonly code: LegacyToolArtifactMigrationRollbackErrorCode;
    readonly details?: Record<string, unknown> | undefined;
    constructor(code: LegacyToolArtifactMigrationRollbackErrorCode, message: string, details?: Record<string, unknown> | undefined);
}

Public members

MemberKindSignatureDescription
causepropertycause?: unknownPublic property; its type, readonly modifier and optionality are shown in the signature.
codepropertyreadonly code: LegacyToolArtifactMigrationRollbackErrorCodePublic property; its type, readonly modifier and optionality are shown in the signature.
constructorconstructor(code: LegacyToolArtifactMigrationRollbackErrorCode, message: string, details?: Record<string, unknown> | undefined): LegacyToolArtifactMigrationRollbackErrorCreates an instance of this class.
detailspropertyreadonly details?: Record<string, unknown>Public 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.
namepropertyname: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
stackpropertystack?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
static captureStackTracemethodstatic captureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called. js const myObject = {}; Error.captureStackTrace(myObject); myObject.stack; // Similar to `new Error().stack` The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}. The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance: js function a() { b(); } function b() { c(); } function c() { // Create an error without stack trace to avoid calculating the stack trace twice. const { stackTraceLimit } = Error; Error.stackTraceLimit = 0; const error = new Error(); Error.stackTraceLimit = stackTraceLimit; // Capture the stack trace above function b Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace throw error; } a();
static prepareStackTracemethodstatic prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): anyPublic method; parameters and return type are shown in the signature.
static stackTraceLimitpropertystatic stackTraceLimit: numberThe Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

LegacyToolArtifactMigrationRollbackExecutor

Reverses only Artifacts proven to have been created by a specific migration report. Revision fences prevent rollback from deleting a later mutation.

Declaration

text
export declare class LegacyToolArtifactMigrationRollbackExecutor {
    constructor(options: LegacyToolArtifactMigrationRollbackExecutorOptions);
    rollback(request: LegacyToolArtifactMigrationRollbackRequest): Promise<LegacyToolArtifactMigrationRollbackResult>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: LegacyToolArtifactMigrationRollbackExecutorOptions): LegacyToolArtifactMigrationRollbackExecutorCreates an instance of this class.
rollbackmethodrollback(request: LegacyToolArtifactMigrationRollbackRequest): Promise<LegacyToolArtifactMigrationRollbackResult>Public method; parameters and return type are shown in the signature.

LegacyToolArtifactMigrationRollbackExecutorOptions

Legacy Tool Artifact Migration Rollback Executor Options interface with 1 public fields or methods.

Declaration

text
export interface LegacyToolArtifactMigrationRollbackExecutorOptions {
    manager: Pick<ArtifactManager, 'get' | 'delete'>;
}

Contract members

MemberKindSignatureDescription
managerpropertymanager: Pick<ArtifactManager, "delete" | "get">Public property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactMigrationRollbackItem

Legacy Tool Artifact Migration Rollback Item interface with 8 public fields or methods.

Declaration

text
export interface LegacyToolArtifactMigrationRollbackItem {
    relativePath: string;
    legacyArtifactId: string;
    artifactId: string;
    versionId: string;
    revision: number;
    target: LegacyToolArtifactMigrationTargetSummary;
    status: 'dry_run' | 'rolled_back' | 'already_absent' | 'failed';
    failure?: LegacyToolArtifactMigrationFailure;
}

Contract members

MemberKindSignatureDescription
artifactIdpropertyartifactId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
failurepropertyfailure?: LegacyToolArtifactMigrationFailurePublic property; its type, readonly modifier and optionality are shown in the signature.
legacyArtifactIdpropertylegacyArtifactId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
relativePathpropertyrelativePath: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "failed" | "rolled_back" | "dry_run" | "already_absent"Public property; its type, readonly modifier and optionality are shown in the signature.
targetpropertytarget: LegacyToolArtifactMigrationTargetSummaryPublic property; its type, readonly modifier and optionality are shown in the signature.
versionIdpropertyversionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactMigrationRollbackRequest

Legacy Tool Artifact Migration Rollback Request interface with 3 public fields or methods.

Declaration

text
export interface LegacyToolArtifactMigrationRollbackRequest {
    plan: LegacyToolArtifactMigrationPlan;
    execution: LegacyToolArtifactMigrationExecutionResult;
    dryRun?: boolean;
}

Contract members

MemberKindSignatureDescription
dryRunpropertydryRun?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
executionpropertyexecution: LegacyToolArtifactMigrationExecutionResultPublic property; its type, readonly modifier and optionality are shown in the signature.
planpropertyplan: LegacyToolArtifactMigrationPlanPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactMigrationRollbackResult

Legacy Tool Artifact Migration Rollback Result interface with 6 public fields or methods.

Declaration

text
export interface LegacyToolArtifactMigrationRollbackResult {
    planHash: string;
    executionReportId: string;
    reportId: string;
    mode: 'dry_run' | 'rollback';
    items: LegacyToolArtifactMigrationRollbackItem[];
    summary: LegacyToolArtifactMigrationRollbackSummary;
}

Contract members

MemberKindSignatureDescription
executionReportIdpropertyexecutionReportId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
itemspropertyitems: LegacyToolArtifactMigrationRollbackItem[]Public property; its type, readonly modifier and optionality are shown in the signature.
modepropertymode: "rollback" | "dry_run"Public property; its type, readonly modifier and optionality are shown in the signature.
planHashpropertyplanHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
reportIdpropertyreportId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
summarypropertysummary: LegacyToolArtifactMigrationRollbackSummaryPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactMigrationRollbackSummary

Legacy Tool Artifact Migration Rollback Summary interface with 5 public fields or methods.

Declaration

text
export interface LegacyToolArtifactMigrationRollbackSummary {
    candidates: number;
    dryRun: number;
    rolledBack: number;
    alreadyAbsent: number;
    failed: number;
}

Contract members

MemberKindSignatureDescription
alreadyAbsentpropertyalreadyAbsent: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
candidatespropertycandidates: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
dryRunpropertydryRun: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
failedpropertyfailed: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
rolledBackpropertyrolledBack: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyToolArtifactMigrationRollbackErrorCode

Public type alias for Legacy Tool Artifact Migration Rollback Error Code; the declaration contains its complete type expression.

Declaration

text
export type LegacyToolArtifactMigrationRollbackErrorCode = 'LEGACY_MIGRATION_ROLLBACK_INVALID_REPORT' | 'LEGACY_MIGRATION_ROLLBACK_TARGET_MISMATCH';