@lumy-pack/syncpoint 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerBackupCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerInitCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerListCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerProvisionCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerRestoreCommand(program: Command): void;
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerStatusCommand(program: Command): void;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface ConfirmProps {
3
+ message: string;
4
+ onConfirm: (yes: boolean) => void;
5
+ defaultYes?: boolean;
6
+ }
7
+ export declare const Confirm: React.FC<ConfirmProps>;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface ProgressBarProps {
3
+ percent: number;
4
+ width?: number;
5
+ }
6
+ export declare const ProgressBar: React.FC<ProgressBarProps>;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { StepResult } from "../utils/types.js";
3
+ interface StepRunnerProps {
4
+ steps: StepResult[];
5
+ currentStep: number;
6
+ total: number;
7
+ }
8
+ export declare const StepRunner: React.FC<StepRunnerProps>;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ interface TableProps {
3
+ headers: string[];
4
+ rows: string[][];
5
+ columnWidths?: number[];
6
+ }
7
+ export declare const Table: React.FC<TableProps>;
8
+ export {};
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ export interface ViewerSection {
3
+ label: string;
4
+ value: string;
5
+ }
6
+ export interface ViewerProps {
7
+ title: string;
8
+ sections: ViewerSection[];
9
+ table?: {
10
+ title?: string;
11
+ headers: string[];
12
+ rows: string[][];
13
+ };
14
+ onBack: () => void;
15
+ }
16
+ export declare const Viewer: React.FC<ViewerProps>;
@@ -0,0 +1,16 @@
1
+ export declare const APP_NAME = "syncpoint";
2
+ export declare const APP_DIR = ".syncpoint";
3
+ export declare const CONFIG_FILENAME = "config.yml";
4
+ export declare const METADATA_FILENAME = "_metadata.json";
5
+ export declare const LARGE_FILE_THRESHOLD: number;
6
+ export declare const MAX_RETRY = 3;
7
+ export declare const SENSITIVE_PATTERNS: string[];
8
+ export declare const REMOTE_SCRIPT_PATTERN: RegExp;
9
+ export declare const BACKUPS_DIR = "backups";
10
+ export declare const TEMPLATES_DIR = "templates";
11
+ export declare const SCRIPTS_DIR = "scripts";
12
+ export declare const LOGS_DIR = "logs";
13
+ export declare function getAppDir(): string;
14
+ export declare const APP_VERSION = "0.0.1";
15
+ export type SubDirName = "backups" | "templates" | "scripts" | "logs";
16
+ export declare function getSubDir(sub: SubDirName): string;
@@ -0,0 +1,21 @@
1
+ import type { BackupOptions, BackupResult, FileEntry, SyncpointConfig } from "../utils/types.js";
2
+ /**
3
+ * Scan config targets, resolve globs, filter excludes.
4
+ * Returns found FileEntry[] and missing path strings.
5
+ */
6
+ export declare function scanTargets(config: SyncpointConfig): Promise<{
7
+ found: FileEntry[];
8
+ missing: string[];
9
+ }>;
10
+ /**
11
+ * Create a backup archive.
12
+ *
13
+ * Flow:
14
+ * 1. Resolve config targets (globs, tilde expansion)
15
+ * 2. Filter excludes
16
+ * 3. Collect file info (stat + hash)
17
+ * 4. Include scripts/ if configured
18
+ * 5. Generate metadata
19
+ * 6. Create tar.gz archive to destination
20
+ */
21
+ export declare function createBackup(config: SyncpointConfig, options?: BackupOptions): Promise<BackupResult>;
@@ -0,0 +1,22 @@
1
+ import type { SyncpointConfig } from "../utils/types.js";
2
+ /**
3
+ * Get the path to the config.yml file.
4
+ */
5
+ export declare function getConfigPath(): string;
6
+ /**
7
+ * Load and validate the config file.
8
+ * Throws if the file does not exist or is invalid.
9
+ */
10
+ export declare function loadConfig(): Promise<SyncpointConfig>;
11
+ /**
12
+ * Validate and save a config object to config.yml.
13
+ */
14
+ export declare function saveConfig(config: SyncpointConfig): Promise<void>;
15
+ /**
16
+ * Create the default directory structure and config.yml.
17
+ * Does not overwrite existing files.
18
+ */
19
+ export declare function initDefaultConfig(): Promise<{
20
+ created: string[];
21
+ skipped: string[];
22
+ }>;
@@ -0,0 +1,20 @@
1
+ import type { BackupMetadata, FileEntry, SyncpointConfig } from "../utils/types.js";
2
+ /**
3
+ * Create a full metadata object for a backup.
4
+ */
5
+ export declare function createMetadata(files: FileEntry[], config: SyncpointConfig): BackupMetadata;
6
+ /**
7
+ * Parse and validate metadata from a buffer or string.
8
+ */
9
+ export declare function parseMetadata(data: Buffer | string): BackupMetadata;
10
+ /**
11
+ * Compute the SHA-256 hash of a file.
12
+ * Returns "sha256:<hex>"
13
+ */
14
+ export declare function computeFileHash(filePath: string): Promise<string>;
15
+ /**
16
+ * Collect file information: size, hash, type detection.
17
+ * @param absolutePath The real filesystem path
18
+ * @param logicalPath The display path (e.g. ~/.zshrc)
19
+ */
20
+ export declare function collectFileInfo(absolutePath: string, logicalPath: string): Promise<FileEntry>;
@@ -0,0 +1,28 @@
1
+ import type { ProvisionOptions, StepResult, TemplateConfig, TemplateStep } from "../utils/types.js";
2
+ /**
3
+ * Load and validate a template from a YAML file.
4
+ */
5
+ export declare function loadTemplate(templatePath: string): Promise<TemplateConfig>;
6
+ /**
7
+ * List all available templates from ~/.syncpoint/templates/.
8
+ */
9
+ export declare function listTemplates(): Promise<Array<{
10
+ name: string;
11
+ path: string;
12
+ config: TemplateConfig;
13
+ }>>;
14
+ /**
15
+ * Evaluate a skip_if condition.
16
+ * Returns true if the command exits with code 0 (meaning: skip this step).
17
+ */
18
+ export declare function evaluateSkipIf(command: string, stepName: string): Promise<boolean>;
19
+ /**
20
+ * Execute a single provisioning step.
21
+ */
22
+ export declare function executeStep(step: TemplateStep): Promise<StepResult>;
23
+ /**
24
+ * Run a provisioning template, yielding step results for real-time UI.
25
+ *
26
+ * Stops on failure unless the step has continue_on_error: true.
27
+ */
28
+ export declare function runProvision(templatePath: string, options?: ProvisionOptions): AsyncGenerator<StepResult>;
@@ -0,0 +1,24 @@
1
+ import type { BackupInfo, RestoreOptions, RestorePlan, RestoreResult, SyncpointConfig } from "../utils/types.js";
2
+ /**
3
+ * List all backup archives in the backup directory, sorted by date desc.
4
+ */
5
+ export declare function getBackupList(config?: SyncpointConfig): Promise<BackupInfo[]>;
6
+ /**
7
+ * Build a restore plan by reading metadata and comparing with current files.
8
+ */
9
+ export declare function getRestorePlan(archivePath: string): Promise<RestorePlan>;
10
+ /**
11
+ * Create a safety backup of the given file paths before restoring.
12
+ * Returns the path to the safety backup archive.
13
+ */
14
+ export declare function createSafetyBackup(filePaths: string[]): Promise<string>;
15
+ /**
16
+ * Restore files from a backup archive.
17
+ *
18
+ * Flow:
19
+ * 1. Read metadata
20
+ * 2. Build restore plan
21
+ * 3. Create safety backup of files that will be overwritten
22
+ * 4. Extract and copy files to their target locations
23
+ */
24
+ export declare function restoreBackup(archivePath: string, options?: RestoreOptions): Promise<RestoreResult>;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Create a tar.gz archive from a list of file descriptors.
3
+ * For in-memory content (like _metadata.json), writes temp files first.
4
+ */
5
+ export declare function createArchive(files: Array<{
6
+ name: string;
7
+ content?: Buffer | string;
8
+ sourcePath?: string;
9
+ }>, outputPath: string): Promise<void>;
10
+ /**
11
+ * Extract a tar.gz archive to a destination directory.
12
+ */
13
+ export declare function extractArchive(archivePath: string, destDir: string): Promise<void>;
14
+ /**
15
+ * Read a single file from a tar.gz archive.
16
+ * Returns the file content as a Buffer, or null if not found.
17
+ */
18
+ export declare function readFileFromArchive(archivePath: string, filename: string): Promise<Buffer | null>;
19
+ /**
20
+ * List all entries in a tar.gz archive.
21
+ */
22
+ export declare function listArchiveEntries(archivePath: string): Promise<string[]>;