import { JobStatusClient } from "@aics/job-status-client"; import { JSSJob, JSSJobStatus } from "@aics/job-status-client/type-declarations/types"; import { ILogger } from "js-logger/src/types"; import { FSSConnection } from "../connections"; import { Uploader } from "../uploader"; export interface Uploads { [filePath: string]: UploadMetadata; } export interface UploadResponse { [originalPath: string]: FSSResponseFile; } export interface AicsResponse { responseType: "SUCCESS" | "SERVER_ERROR" | "CLIENT_ERROR"; } export interface AicsSuccessResponse extends AicsResponse { data: T[]; totalCount: number; hasMore?: boolean; offset: number; rows?: T[]; } export interface FSSRequestFile { fileName: string; md5hex: string; fileType: string; metadata: UploadMetadata; shouldBeInArchive?: boolean; shouldBeInLocal?: boolean; } export interface UploadMetadataRequest { jobId: string; files: FSSRequestFile[]; } export interface ImageModelBase { channelId?: string; fovId?: number; positionIndex?: number; scene?: number; subImageName?: string; } export interface CustomFileAnnotationRequest extends ImageModelBase { annotationId: number; values: string[]; } export interface CustomFileMetadataRequest { annotations: CustomFileAnnotationRequest[]; templateId?: number; } export interface UploadMetadata { customMetadata: CustomFileMetadataRequest; fileType?: string; file: File; [id: string]: any; } export interface File { originalPath: string; fileName?: string; fileType: string; [id: string]: any; } export interface StartUploadResponse { jobId: string; uploadDirectory: string; } export interface UploadMetadataResponse { jobId: string; files: FSSResponseFile[]; } export interface FSSResponseFile { fileName: string; fileId: string; readPath: string; } export interface FileManagementSystemConfig { host?: string; port?: string; logLevel?: "debug" | "error" | "info" | "trace" | "warn"; logger?: ILogger; fss?: FSSConnection; jobStatusClient?: JobStatusClient; uploader?: Uploader; username?: string; } export interface Job { jobId: string; status: JSSJobStatus; serviceFields?: any; } export declare enum StepName { AddMetadata = "Add metadata about file and complete upload", CopyFilesChild = "Copy file", CopyFiles = "Copy files in parallel" } export interface Step { skip: (ctx: UploadContext) => Promise; end: (ctx: UploadContext) => Promise; job: Job; name: StepName; start: (ctx: UploadContext) => Promise; } export interface UploadContext { uploadChildJobIds?: string[]; copyChildJobs?: Job[]; resultFiles?: FSSResponseFile[]; sourceFiles?: SourceFiles; startUploadResponse: StartUploadResponse; totalBytesToCopy?: number; uploadJobName: string; uploads: Uploads; uploadJob?: JSSJob; } export interface SourceFiles { [file: string]: FSSRequestFile; } export declare enum FilterType { EQUALS = "EQUALS", IN = "IN" } export interface Filter { filterColumn: string; searchValue?: any | any[]; type?: FilterType; } export interface Annotation extends ImageModelBase { annotationId: number; values: any[]; } export interface LabKeyFileMetadata { archiveFilePath?: string; filename: string; fileId: string; fileSize: number; fileType: string; localFilePath?: string; publicFilePath?: string; thumbnailLocalFilePath?: string; thumbnailId?: string; modified: string; modifiedBy: string; } export interface CustomFileMetadata { annotations: Annotation[]; fileId: string; templateId?: number; modified: string; modifiedBy: string; } export interface FileMetadata extends CustomFileMetadata, LabKeyFileMetadata { } export interface FileToFileMetadata { [FileId: string]: FileMetadata; } export interface ImageModelMetadata extends ImageModelBase, LabKeyFileMetadata { channel?: string; templateId?: number; template?: string; [key: string]: any; } export interface LabKeyResponse { rows: T[]; }