check / check (push) Waiting to run
proper-lockfile's default onCompromised throws from a timer, so a backup whose backup.lock was removed or taken over by another backup died with a stack trace. lockBackupDirectory now returns the lock, its release function and why it was lost, and passes a handler that only records the reason. The backup checks it after the refresh and before each original, thumbnail, file's JSON and album, and before it writes failures.json, and then fails with "lost the lock on DIR: REASON", which quak backup prints as one line, exiting 1. lib.backup() takes a caller's lock as lock, in place of lockHeld: true. Releasing a lost lock leaves backup.lock alone, since it may be another backup's. Model: opus-5-5
115 lines
2.8 KiB
TypeScript
115 lines
2.8 KiB
TypeScript
// A build reports the version script/build stamps into dist/package.json;
|
|
// package.json's own version is reported only when running from source. tsc
|
|
// copies package.json to dist/package.json, so this path resolves from source
|
|
// and from dist/src/.
|
|
import pkg from "../package.json" with { type: "json" };
|
|
|
|
export const VERSION: string = pkg.version;
|
|
|
|
export {
|
|
Client,
|
|
type LoginOptions,
|
|
type ClientSnapshot,
|
|
type CollectionsPage,
|
|
type FilesPage,
|
|
} from "./client.js";
|
|
export {
|
|
ApiClient,
|
|
ApiError,
|
|
DEFAULT_DOWNLOAD_TIMEOUT_MS,
|
|
DEFAULT_REQUEST_TIMEOUT_MS,
|
|
type ApiClientOptions,
|
|
type StreamOptions,
|
|
} from "./api/client.js";
|
|
export { TruncatedStreamError } from "./errors.js";
|
|
export {
|
|
DEFAULT_RETRY_OPTIONS,
|
|
isRetryable,
|
|
isSafeToReplay,
|
|
resolveRetryOptions,
|
|
UNATTENDED_RETRY_OPTIONS,
|
|
withRetry,
|
|
type ResolvedRetryOptions,
|
|
type RetryOptions,
|
|
type WithRetryOptions,
|
|
} from "./retry.js";
|
|
export { unwrapAuth, type UnwrapResult } from "./auth/unwrap.js";
|
|
export {
|
|
beginLogin,
|
|
submitTOTP,
|
|
requestEmailOTP,
|
|
submitEmailOTP,
|
|
} from "./auth/login.js";
|
|
export {
|
|
Library,
|
|
DEFAULT_REFRESH_INTERVAL_SECONDS,
|
|
Album,
|
|
Photo,
|
|
type LibraryClient,
|
|
type LibraryOptions,
|
|
type LibraryStatus,
|
|
type RefreshEvent,
|
|
type RefreshProgressCallback,
|
|
type AlbumsAPI,
|
|
type PhotosAPI,
|
|
type TimelineAPI,
|
|
type PhotoFilter,
|
|
type TimelineGroup,
|
|
type GroupBy,
|
|
type SavePathLookup,
|
|
type ContentSource,
|
|
type ContentResult,
|
|
type ContentEvent,
|
|
type ContentOptions,
|
|
type PhotoContent,
|
|
type ThumbnailsAPI,
|
|
type ThumbnailPriority,
|
|
type EnsureOptions,
|
|
type EnsureResult,
|
|
type EnsureEvent,
|
|
lockBackupDirectory,
|
|
runBackup,
|
|
type BackupLock,
|
|
type BackupOptions,
|
|
type BackupResult,
|
|
type BackupError,
|
|
} from "./library/index.js";
|
|
export {
|
|
RequestPools,
|
|
BoundedPool,
|
|
DEFAULT_METADATA_CONCURRENCY,
|
|
DEFAULT_CONTENT_CONCURRENCY,
|
|
DEFAULT_THUMBNAIL_CONCURRENCY,
|
|
type RequestPoolsOptions,
|
|
type Priority,
|
|
type RunOptions,
|
|
} from "./library/pools.js";
|
|
export type {
|
|
AlbumRecord,
|
|
PhotoRecord,
|
|
LibrarySnapshot,
|
|
LibraryChange,
|
|
} from "./library/records.js";
|
|
export type { ExifTags, PhotoExif } from "./exif.js";
|
|
export { decryptCollection, decryptFile } from "./model/index.js";
|
|
export { downloadFile, downloadThumbnail } from "./download/index.js";
|
|
export type {
|
|
AuthorizationResponse,
|
|
KeyAttributes,
|
|
LoginChallenge,
|
|
SRPAttributes,
|
|
} from "./auth/types.js";
|
|
export type {
|
|
Collection,
|
|
CollectionType,
|
|
EnteFile,
|
|
FileBlob,
|
|
FileMetadata,
|
|
FileType,
|
|
KeyMaterial,
|
|
Microseconds,
|
|
RawCollection,
|
|
RawEnteFile,
|
|
} from "./model/types.js";
|
|
export type { DownloadResult } from "./download/index.js";
|