@indigoai-us/hq-cloud 6.18.108 → 6.18.109
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.
- package/dist/cli/rescue-core.d.ts +64 -1
- package/dist/cli/rescue-core.d.ts.map +1 -1
- package/dist/cli/rescue-core.js +225 -119
- package/dist/cli/rescue-core.js.map +1 -1
- package/dist/cli/rescue-native-copy.d.ts +88 -0
- package/dist/cli/rescue-native-copy.d.ts.map +1 -0
- package/dist/cli/rescue-native-copy.js +823 -0
- package/dist/cli/rescue-native-copy.js.map +1 -0
- package/dist/ignore.d.ts +5 -1
- package/dist/ignore.d.ts.map +1 -1
- package/dist/ignore.js +32 -2
- package/dist/ignore.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** One `--include=`/`--exclude=` rule, in command-line order. */
|
|
2
|
+
export interface OverlayFilterRule {
|
|
3
|
+
include: boolean;
|
|
4
|
+
pattern: string;
|
|
5
|
+
}
|
|
6
|
+
/** A compiled pattern: does it match this path (relative, no leading slash)? */
|
|
7
|
+
type CompiledPattern = (rel: string, isDir: boolean) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Compile one rsync `--include=`/`--exclude=` pattern, following rsync's
|
|
10
|
+
* `rule_matches`:
|
|
11
|
+
* - a trailing `/` matches directories only;
|
|
12
|
+
* - a leading `/` anchors the pattern at the transfer root;
|
|
13
|
+
* - a pattern with no `/` and no `**` matches the last path element;
|
|
14
|
+
* - any other unanchored pattern matches at a path-element boundary;
|
|
15
|
+
* - a pattern that starts with `**` and a slash also matches at the
|
|
16
|
+
* start of the path (rsync puts a slash in front of the name), so
|
|
17
|
+
* `**` + `/cache/` + `**` matches `cache/x`;
|
|
18
|
+
* - `dir/***` matches the directory `dir` itself and everything below it;
|
|
19
|
+
* - backslash escapes apply only when the pattern holds a wildcard
|
|
20
|
+
* (`*`, `?` or `[`); without one the pattern is compared literally.
|
|
21
|
+
*/
|
|
22
|
+
export declare function compileRsyncPattern(rawPattern: string): CompiledPattern;
|
|
23
|
+
/** Whether one rsync filter pattern matches `rel`. See {@link compileRsyncPattern}. */
|
|
24
|
+
export declare function rsyncFilterRuleMatches(rawPattern: string, rel: string, isDir: boolean): boolean;
|
|
25
|
+
interface CompiledRule {
|
|
26
|
+
include: boolean;
|
|
27
|
+
matches: CompiledPattern;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Compile a filter list once for a whole walk. A run of plain anchored
|
|
31
|
+
* paths with the same action (the protect list holds one per unchanged
|
|
32
|
+
* file) becomes one set lookup; first-match order is unchanged because
|
|
33
|
+
* every rule in the run has the same action.
|
|
34
|
+
*/
|
|
35
|
+
export declare function compileOverlayRules(rules: OverlayFilterRule[]): CompiledRule[];
|
|
36
|
+
/** Whether rsync's filter list admits this one entry (its parents admitted). */
|
|
37
|
+
export declare function overlayRulesAdmitEntry(rules: CompiledRule[], rel: string, isDir: boolean): boolean;
|
|
38
|
+
/** Options the built-in copy reads from the rsync argument vector. */
|
|
39
|
+
export interface NativeOverlayOptions {
|
|
40
|
+
rules: OverlayFilterRule[];
|
|
41
|
+
dryRun: boolean;
|
|
42
|
+
checksum: boolean;
|
|
43
|
+
times: boolean;
|
|
44
|
+
perms: boolean;
|
|
45
|
+
itemize: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Read the overlay options from an rsync argument vector, without the two
|
|
49
|
+
* trailing source/destination paths. Throws on an option the built-in copy
|
|
50
|
+
* does not implement, so a new rsync flag cannot be silently dropped.
|
|
51
|
+
*/
|
|
52
|
+
export declare function nativeOverlayOptionsFromRsyncArgs(args: string[], readFile?: (file: string) => Buffer): NativeOverlayOptions;
|
|
53
|
+
/** Filesystem calls the built-in copy makes that tests may replace. */
|
|
54
|
+
export interface NativeOverlayOps {
|
|
55
|
+
symlink(target: string, destination: string, type: "file" | "dir"): void;
|
|
56
|
+
/** Defaults to `fs.renameSync`. */
|
|
57
|
+
rename?(from: string, to: string): void;
|
|
58
|
+
/** Defaults to a blocking wait. */
|
|
59
|
+
sleep?(ms: number): void;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Temp files are `<prefix><8 hex>` in the destination folder. The name is
|
|
63
|
+
* short so a long release file name cannot push it past the file system's
|
|
64
|
+
* name limit. Nothing else uses this prefix, so a file with exactly this
|
|
65
|
+
* shape is a leftover from a killed copy and is removed, never kept as a
|
|
66
|
+
* user file.
|
|
67
|
+
*/
|
|
68
|
+
export declare const NATIVE_COPY_TEMP_PREFIX = ".hq-rescue-tmp-";
|
|
69
|
+
/**
|
|
70
|
+
* Waits between rename attempts on Windows, where Defender, the search
|
|
71
|
+
* indexer, OneDrive or an editor can hold a just-written file or its target
|
|
72
|
+
* for a moment (EPERM, EBUSY, EACCES). About 1.6 s in total.
|
|
73
|
+
*/
|
|
74
|
+
export declare const WINDOWS_RENAME_RETRY_DELAYS_MS: number[];
|
|
75
|
+
export interface NativeOverlayResult {
|
|
76
|
+
status: number;
|
|
77
|
+
stdout: string;
|
|
78
|
+
stderr: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Copy `sourceRoot` onto `destinationRoot` as `rsync -a <args> src/ dst/`
|
|
82
|
+
* would. `args` is the rsync argument vector without the two paths. Returns
|
|
83
|
+
* rsync-style status: 0, 23 when some entries could not be copied (the rest
|
|
84
|
+
* were), or 1 when the copy could not start.
|
|
85
|
+
*/
|
|
86
|
+
export declare function runNativeOverlay(sourceRoot: string, destinationRoot: string, args: string[], platform?: NodeJS.Platform, ops?: NativeOverlayOps): NativeOverlayResult;
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=rescue-native-copy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rescue-native-copy.d.ts","sourceRoot":"","sources":["../../src/cli/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