@noldova/checkpoints 0.0.5 → 0.0.7
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/module.json +1 -1
- package/package.json +9 -9
- package/src/api/index.d.ts +2 -264
- package/src/api/index.js +1 -1
- package/src/api/index.js.map +1 -1
- package/src/models/checkpoint-record.js +5 -4
- package/src/models/checkpoint-record.js.map +1 -1
- package/src/models/folder-index.js +11 -7
- package/src/models/folder-index.js.map +1 -1
- package/src/models/ignore-record.js +15 -6
- package/src/models/ignore-record.js.map +1 -1
- package/src/models/ignore-rules.js +6 -1
- package/src/models/ignore-rules.js.map +1 -1
- package/src/models/walk-result.js +7 -0
- package/src/models/walk-result.js.map +1 -1
- package/src/resources.js +4 -2
- package/src/resources.js.map +1 -1
- package/src/services/checkpoint-capture.js +23 -6
- package/src/services/checkpoint-capture.js.map +1 -1
- package/src/services/checkpoints-host.js +1 -2
- package/src/services/checkpoints-host.js.map +1 -1
- package/src/services/folder-walker.js +15 -8
- package/src/services/folder-walker.js.map +1 -1
- package/src/services/module-activation.js +2 -3
- package/src/services/module-activation.js.map +1 -1
- package/src/services/restore-planner.js +3 -2
- package/src/services/restore-planner.js.map +1 -1
- package/src/services/restore-scope.js +1 -1
- package/src/services/restore-scope.js.map +1 -1
- package/src/services/side-loader.js +3 -3
- package/src/services/side-loader.js.map +1 -1
- package/src/services/tree-lister.js +4 -0
- package/src/services/tree-lister.js.map +1 -1
- package/src/services/checkpoints.service.js +0 -10
- package/src/services/checkpoints.service.js.map +0 -1
package/module.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "checkpoints",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"displayName": "Checkpoints",
|
|
5
5
|
"description": "Keeps a folder's files at chosen moments, with the module's own Git, lists them, compares them and restores one on request.",
|
|
6
6
|
"parts": ["runtime"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noldova/checkpoints",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "The checkpoints module for apps on Noldova Desktop: it keeps a folder's files at chosen moments with its own Git and lists them.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"@noldova/desktop.runtime": ">=0.0.21 <0.1.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@noldova/checkpoints.protocol": "0.0.
|
|
42
|
+
"@noldova/checkpoints.protocol": "0.0.7"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
|
-
"@noldova/checkpoints.git.darwin-arm64": "0.0.
|
|
46
|
-
"@noldova/checkpoints.git.darwin-x64": "0.0.
|
|
47
|
-
"@noldova/checkpoints.git.linux-arm64": "0.0.
|
|
48
|
-
"@noldova/checkpoints.git.linux-x64": "0.0.
|
|
49
|
-
"@noldova/checkpoints.git.win32-arm64": "0.0.
|
|
50
|
-
"@noldova/checkpoints.git.win32-x64": "0.0.
|
|
45
|
+
"@noldova/checkpoints.git.darwin-arm64": "0.0.7",
|
|
46
|
+
"@noldova/checkpoints.git.darwin-x64": "0.0.7",
|
|
47
|
+
"@noldova/checkpoints.git.linux-arm64": "0.0.7",
|
|
48
|
+
"@noldova/checkpoints.git.linux-x64": "0.0.7",
|
|
49
|
+
"@noldova/checkpoints.git.win32-arm64": "0.0.7",
|
|
50
|
+
"@noldova/checkpoints.git.win32-x64": "0.0.7"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "2990911cd9601211738ba774267f594369b47db5"
|
|
53
53
|
}
|
package/src/api/index.d.ts
CHANGED
|
@@ -7,24 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import "@noldova/context.core";
|
|
10
|
-
import type {
|
|
11
|
-
CaptureMode,
|
|
12
|
-
CaptureRequest,
|
|
13
|
-
CaptureResult,
|
|
14
|
-
CheckpointList,
|
|
15
|
-
CompareRequest,
|
|
16
|
-
CompareResult,
|
|
17
|
-
DeleteFolderRequest,
|
|
18
|
-
DeleteFolderResult,
|
|
19
|
-
ListRequest,
|
|
20
|
-
PreviewRequest,
|
|
21
|
-
PreviewResult,
|
|
22
|
-
ReadRequest,
|
|
23
|
-
ReadResult,
|
|
24
|
-
RestoreRequest,
|
|
25
|
-
RestoreResult,
|
|
26
|
-
StorageList
|
|
27
|
-
} from "@noldova/checkpoints.protocol";
|
|
10
|
+
import type { CaptureMode } from "@noldova/checkpoints.protocol";
|
|
28
11
|
import { Exception, type ExceptionOptions } from "@noldova/context.exceptions";
|
|
29
12
|
import type { IRuntimePart, IRuntimePartContext, ModuleActivationException } from "@noldova/desktop.runtime";
|
|
30
13
|
|
|
@@ -779,252 +762,7 @@ export declare class UnsupportedStoreFormatException extends StoreException {
|
|
|
779
762
|
public constructor(version: string);
|
|
780
763
|
}
|
|
781
764
|
|
|
782
|
-
|
|
783
|
-
* The checkpoints service, which the runtime part publishes as `checkpoints.service` for other runtime parts, and with which it
|
|
784
|
-
* answers the `checkpoints.*` methods. Each folder's operations run one at a time; a request that arrives during one waits for it.
|
|
785
|
-
* Each first finishes or undoes any restore of the folder that was interrupted; while that can't finish, the folder's captures and
|
|
786
|
-
* restores are refused with the outcome `HeldUp`.
|
|
787
|
-
*
|
|
788
|
-
* Each call takes an optional signal, such as its request's. A call whose signal aborts while it waits never runs; one that runs
|
|
789
|
-
* stops before its next file or Git command, ends the Git commands it started, and rejects with the signal's reason once they have
|
|
790
|
-
* exited, and the folder's next call runs. A capture so stopped leaves no checkpoint and the folder's index as it was. A restore
|
|
791
|
-
* stops so only until it starts writing its journal; from then on it runs to its end. The recovery of an interrupted restore that a
|
|
792
|
-
* call starts with always runs to its end.
|
|
793
|
-
*
|
|
794
|
-
* It is abstract: the runtime part publishes the module's own instance, and a module gets it with `getService`, which takes the class.
|
|
795
|
-
*
|
|
796
|
-
* @example
|
|
797
|
-
* ```ts
|
|
798
|
-
* import { CaptureRequest, FolderReference } from "@noldova/checkpoints.protocol";
|
|
799
|
-
* import { CheckpointsService } from "@noldova/checkpoints/runtime";
|
|
800
|
-
* import type { IRuntimePartContext } from "@noldova/desktop.runtime";
|
|
801
|
-
*
|
|
802
|
-
* export async function captureAsync(context: IRuntimePartContext): Promise<void> {
|
|
803
|
-
* const checkpoints = context.getService("checkpoints.service", CheckpointsService);
|
|
804
|
-
* const result = await checkpoints.captureAsync(new CaptureRequest(new FolderReference("project-1", "/work/project"), "Turn 3"));
|
|
805
|
-
* console.log(result.outcome.value);
|
|
806
|
-
* }
|
|
807
|
-
* ```
|
|
808
|
-
*/
|
|
809
|
-
export declare abstract class CheckpointsService {
|
|
810
|
-
/**
|
|
811
|
-
* Takes a checkpoint of a folder: every file, link and folder in it but each `.git`, or, while the setting
|
|
812
|
-
* `checkpoints.followIgnoreFiles` is on, only those its `.gitignore` files don't ignore, matched as Git matches them. The
|
|
813
|
-
* checkpoint's `mode` says which. It needs, on the store's volume, 2 GiB free beyond the size of the new and changed files it
|
|
814
|
-
* adds, before it streams and while it does; one without the space takes no checkpoint, posts the folder's
|
|
815
|
-
* `checkpoints.lowDiskSpace` notification and raises `checkpoints.capturePaused`, and the folder's next capture that is taken
|
|
816
|
-
* dismisses the notification and raises `checkpoints.captureResumed`. It leaves out each file over 10 MiB, listing it as
|
|
817
|
-
* `TooLarge`, and takes no checkpoint when the new and changed files come to over 1 GiB. With the request's `asOf`, it keeps each
|
|
818
|
-
* file changed at or after that time, less two seconds, as the folder's last checkpoint had it, and leaves out one that checkpoint
|
|
819
|
-
* didn't hold, so an app can take a turn's checkpoint after the turn has started, without holding the turn. With the request's
|
|
820
|
-
* `paths`, it reads only those paths and keeps every other path as the folder's last checkpoint had it, and the size of the new and
|
|
821
|
-
* changed files, for the limit and the free space, counts only what it reads, so a capture of a few files succeeds in a folder too
|
|
822
|
-
* large to capture whole.
|
|
823
|
-
*
|
|
824
|
-
* @param request The folder, the label to attach, the time the turn started, if any, and the paths to read, if limited.
|
|
825
|
-
* @param signal Stops the call; none by default.
|
|
826
|
-
* @returns The checkpoint taken; or the outcome `LowDiskSpace`, with the space free and the space needed in bytes, `TooLarge`,
|
|
827
|
-
* with the size of the new and changed files and its limit, `FolderMissing` when the folder's path is missing, or `HeldUp` while an interrupted restore of the folder can't finish.
|
|
828
|
-
* @throws {GitException} When a Git command fails; no checkpoint is left.
|
|
829
|
-
* @throws {StoreException} When the folder's store holds a file the module can't read.
|
|
830
|
-
* @throws {Error} When the system refuses the module a step of its own, such as reading the folder itself (EACCES), writing its
|
|
831
|
-
* store (ENOSPC) or finishing an interrupted restore of the folder; a path the capture can't read is listed in the checkpoint instead.
|
|
832
|
-
* @example
|
|
833
|
-
* ```ts
|
|
834
|
-
* import { CaptureRequest, FolderReference } from "@noldova/checkpoints.protocol";
|
|
835
|
-
* import type { CheckpointsService } from "@noldova/checkpoints/runtime";
|
|
836
|
-
*
|
|
837
|
-
* export async function captureAsync(checkpoints: CheckpointsService, signal: AbortSignal): Promise<string | null> {
|
|
838
|
-
* const result = await checkpoints.captureAsync(new CaptureRequest(new FolderReference("project-1", "/work/project"), "Turn 3"), signal);
|
|
839
|
-
* return result.checkpoint?.id ?? null;
|
|
840
|
-
* }
|
|
841
|
-
* ```
|
|
842
|
-
*/
|
|
843
|
-
public abstract captureAsync(request: CaptureRequest, signal?: AbortSignal): Promise<CaptureResult>;
|
|
844
|
-
|
|
845
|
-
/**
|
|
846
|
-
* Compares one of a folder's checkpoints with another, or with the folder now, which it walks in the checkpoint's own mode. A path
|
|
847
|
-
* either side's rules ignore is on neither side, a `.git` never is, and a path the module couldn't read on either side is
|
|
848
|
-
* `Unknown`, never `Deleted`. It writes nothing.
|
|
849
|
-
*
|
|
850
|
-
* @param request The folder, the checkpoint the changes start from, and the one they lead to, or `null` for the folder now.
|
|
851
|
-
* @param signal Stops the call; none by default.
|
|
852
|
-
* @returns The changes, in the byte order of their paths; or the outcome `CheckpointMissing` when either checkpoint is missing,
|
|
853
|
-
* or `FolderMissing` when the folder now is asked for and its path is missing.
|
|
854
|
-
* @throws {GitException} When a Git command fails.
|
|
855
|
-
* @throws {StoreException} When the folder's store holds a checkpoint the module can't read.
|
|
856
|
-
* @throws {Error} When the system refuses the module a step of its own, such as reading its store, finishing an interrupted restore of the folder, or,
|
|
857
|
-
* for the folder now, reading the folder itself (EACCES).
|
|
858
|
-
* @example
|
|
859
|
-
* ```ts
|
|
860
|
-
* import { CompareRequest, FolderReference } from "@noldova/checkpoints.protocol";
|
|
861
|
-
* import type { CheckpointsService } from "@noldova/checkpoints/runtime";
|
|
862
|
-
*
|
|
863
|
-
* export async function changedPathsAsync(checkpoints: CheckpointsService, from: string): Promise<readonly string[]> {
|
|
864
|
-
* const result = await checkpoints.compareAsync(new CompareRequest(new FolderReference("project-1", "/work/project"), from, null));
|
|
865
|
-
* return result.changes.map(t => t.path);
|
|
866
|
-
* }
|
|
867
|
-
* ```
|
|
868
|
-
*/
|
|
869
|
-
public abstract compareAsync(request: CompareRequest, signal?: AbortSignal): Promise<CompareResult>;
|
|
870
|
-
|
|
871
|
-
/**
|
|
872
|
-
* Deletes all of a folder's checkpoints by removing its store whole, after the folder's earlier calls; a housekeeping pass running
|
|
873
|
-
* on the store is stopped first. It first finishes or undoes a restore of the folder that was interrupted, and while that can't
|
|
874
|
-
* finish it deletes nothing, since the restore's journal is what puts the folder's files right. A crash mid-delete never leaves a
|
|
875
|
-
* half store: the store is moved aside whole before it is removed, once a `storageAsync` reading it has, and what a crash leaves
|
|
876
|
-
* there is removed when the module next starts. The folder's next capture starts a new store. The module stopping stops the call as
|
|
877
|
-
* its signal would, and waits for it.
|
|
878
|
-
*
|
|
879
|
-
* @param request The folder.
|
|
880
|
-
* @param signal Stops the call until the store is moved aside; none by default.
|
|
881
|
-
* @returns The outcome `Deleted`, also for a folder that has no checkpoints, or `HeldUp` while an interrupted restore of the folder
|
|
882
|
-
* can't finish.
|
|
883
|
-
* @throws {Error} When the system refuses to move the store aside, after trying for about 5 s while it holds a file; the store is
|
|
884
|
-
* left whole.
|
|
885
|
-
* @example
|
|
886
|
-
* ```ts
|
|
887
|
-
* import { DeleteFolderRequest, FolderReference } from "@noldova/checkpoints.protocol";
|
|
888
|
-
* import type { CheckpointsService } from "@noldova/checkpoints/runtime";
|
|
889
|
-
*
|
|
890
|
-
* export async function forgetAsync(checkpoints: CheckpointsService): Promise<string> {
|
|
891
|
-
* const result = await checkpoints.deleteFolderAsync(new DeleteFolderRequest(new FolderReference("project-1", "/work/project")));
|
|
892
|
-
* return result.outcome.value;
|
|
893
|
-
* }
|
|
894
|
-
* ```
|
|
895
|
-
*/
|
|
896
|
-
public abstract deleteFolderAsync(request: DeleteFolderRequest, signal?: AbortSignal): Promise<DeleteFolderResult>;
|
|
897
|
-
|
|
898
|
-
/**
|
|
899
|
-
* Lists a folder's checkpoints.
|
|
900
|
-
*
|
|
901
|
-
* @param request The folder.
|
|
902
|
-
* @param signal Stops the call; none by default.
|
|
903
|
-
* @returns The folder's checkpoints, newest first; none for a folder never captured.
|
|
904
|
-
* @throws {GitException} When a Git command fails.
|
|
905
|
-
* @throws {StoreException} When the folder's store holds a checkpoint the module can't read.
|
|
906
|
-
* @throws {Error} When the system refuses the module a step of its own, such as reading its store or finishing an interrupted restore of the folder.
|
|
907
|
-
* @example
|
|
908
|
-
* ```ts
|
|
909
|
-
* import { FolderReference, ListRequest } from "@noldova/checkpoints.protocol";
|
|
910
|
-
* import type { CheckpointsService } from "@noldova/checkpoints/runtime";
|
|
911
|
-
*
|
|
912
|
-
* export async function newestAsync(checkpoints: CheckpointsService): Promise<string | null> {
|
|
913
|
-
* const list = await checkpoints.listAsync(new ListRequest(new FolderReference("project-1", "/work/project")));
|
|
914
|
-
* return list.checkpoints[0]?.id ?? null;
|
|
915
|
-
* }
|
|
916
|
-
* ```
|
|
917
|
-
*/
|
|
918
|
-
public abstract listAsync(request: ListRequest, signal?: AbortSignal): Promise<CheckpointList>;
|
|
919
|
-
|
|
920
|
-
/**
|
|
921
|
-
* Plans a restore of one of a folder's checkpoints over the folder now, which it walks in the checkpoint's own mode: each path the
|
|
922
|
-
* restore writes, replaces or deletes, with its side now and in the checkpoint, and each path that stays as it is, with its reason:
|
|
923
|
-
* a `.git` or another name for one, a folder that holds a `.git` at any depth or one above it, a path either side's rules ignore,
|
|
924
|
-
* one either side couldn't read, or a link this system won't let the module create. It writes nothing to the folder.
|
|
925
|
-
*
|
|
926
|
-
* @param request The folder and the checkpoint to restore.
|
|
927
|
-
* @param signal Stops the call; none by default.
|
|
928
|
-
* @returns The plan, with the state of the folder it was planned on; or the outcome `HeldUp` while a restore holds the folder,
|
|
929
|
-
* `CheckpointMissing` when the checkpoint is missing, or `FolderMissing` when the folder's path is missing.
|
|
930
|
-
* @throws {GitException} When a Git command fails.
|
|
931
|
-
* @throws {StoreException} When the folder's store holds a checkpoint the module can't read.
|
|
932
|
-
* @throws {Error} When the system refuses the module a step of its own, such as reading its store, finishing an interrupted restore of the folder or
|
|
933
|
-
* reading the folder itself (EACCES).
|
|
934
|
-
* @example
|
|
935
|
-
* ```ts
|
|
936
|
-
* import { FolderReference, PreviewRequest } from "@noldova/checkpoints.protocol";
|
|
937
|
-
* import type { CheckpointsService } from "@noldova/checkpoints/runtime";
|
|
938
|
-
*
|
|
939
|
-
* export async function stepCountAsync(checkpoints: CheckpointsService, checkpoint: string): Promise<number> {
|
|
940
|
-
* const result = await checkpoints.previewRestoreAsync(new PreviewRequest(new FolderReference("project-1", "/work/project"), checkpoint, ["src"]));
|
|
941
|
-
* return result.plan?.steps.length ?? 0;
|
|
942
|
-
* }
|
|
943
|
-
* ```
|
|
944
|
-
*/
|
|
945
|
-
public abstract previewRestoreAsync(request: PreviewRequest, signal?: AbortSignal): Promise<PreviewResult>;
|
|
946
|
-
|
|
947
|
-
/**
|
|
948
|
-
* Reads one file of a checkpoint: its content, or its line diff to another checkpoint or to the folder now, cut at the request's
|
|
949
|
-
* limit. A diff to the folder now writes the file's content there into the store as one object no checkpoint names; nothing else
|
|
950
|
-
* is written.
|
|
951
|
-
*
|
|
952
|
-
* @param request The folder, the checkpoint, the path, what to diff against, if anything, and the most bytes to give.
|
|
953
|
-
* @param signal Stops the call; none by default.
|
|
954
|
-
* @returns The content or the diff, with its whole size, so a result shorter than its size is cut; or why there's none.
|
|
955
|
-
* @throws {GitException} When a Git command fails.
|
|
956
|
-
* @throws {StoreException} When the folder's store holds a checkpoint the module can't read.
|
|
957
|
-
* @throws {Error} When the system refuses the module a step of its own, such as reading its store, finishing an interrupted restore of the folder, or,
|
|
958
|
-
* for the folder now, reading the folder itself (EACCES).
|
|
959
|
-
* @example
|
|
960
|
-
* ```ts
|
|
961
|
-
* import { DiffTarget, FolderReference, ReadRequest } from "@noldova/checkpoints.protocol";
|
|
962
|
-
* import type { CheckpointsService } from "@noldova/checkpoints/runtime";
|
|
963
|
-
*
|
|
964
|
-
* export async function diffToNowAsync(checkpoints: CheckpointsService, checkpoint: string): Promise<Uint8Array> {
|
|
965
|
-
* const request = new ReadRequest(new FolderReference("project-1", "/work/project"), checkpoint, "src/main.ts", new DiffTarget(null), 65536);
|
|
966
|
-
* return (await checkpoints.readAsync(request)).content;
|
|
967
|
-
* }
|
|
968
|
-
* ```
|
|
969
|
-
*/
|
|
970
|
-
public abstract readAsync(request: ReadRequest, signal?: AbortSignal): Promise<ReadResult>;
|
|
971
|
-
|
|
972
|
-
/**
|
|
973
|
-
* Restores one of a folder's checkpoints by the plan its preview gave, whole or not at all. It plans again and refuses a plan the
|
|
974
|
-
* folder has moved on from, then takes a checkpoint of the folder labelled `Before restore`, limited to the paths the restore may
|
|
975
|
-
* change when it is limited, which undoes the restore. A checkpoint captured with paths restores only those. It stages
|
|
976
|
-
* new content in a folder of its own at the folder's root, moves each file it replaces or deletes aside and compares it with that
|
|
977
|
-
* checkpoint, so a file another program wrote is never lost; it never writes through a link, never changes a `.git`, and never
|
|
978
|
-
* moves, renames or removes a folder that holds one. A restore that fails rolls back; one interrupted is finished or undone when the folder is next
|
|
979
|
-
* opened. It raises `checkpoints.restored` when it finishes, and `checkpoints.restoreHeldUp` when its rollback can't.
|
|
980
|
-
*
|
|
981
|
-
* @param request The folder and the plan its preview gave.
|
|
982
|
-
* @param signal Stops the call until the restore starts writing its journal; none by default.
|
|
983
|
-
* @returns The outcome, with the checkpoint taken before the restore when it restored or rolled back, and, when it restored, the
|
|
984
|
-
* checkpoint labelled `Recovered after restore` that keeps what another program changed in a file the restore had moved aside;
|
|
985
|
-
* or `MovedOn` when the folder no longer matches the plan, `LowDiskSpace`, `TooLarge`, with the size of the new and changed files
|
|
986
|
-
* and its limit, when the checkpoint taken before the restore would add over 1 GiB, `CheckpointMissing`, `FolderMissing` or `HeldUp`.
|
|
987
|
-
* @throws {GitException} When a Git command fails before the restore changes anything.
|
|
988
|
-
* @throws {StoreException} When the folder's store holds a file the module can't read.
|
|
989
|
-
* @throws {Error} When the system refuses the module a step of its own before the restore changes anything, such as reading the
|
|
990
|
-
* folder itself (EACCES), writing its store (ENOSPC) or finishing an interrupted restore of the folder.
|
|
991
|
-
* @example
|
|
992
|
-
* ```ts
|
|
993
|
-
* import { FolderReference, PreviewRequest, RestoreRequest } from "@noldova/checkpoints.protocol";
|
|
994
|
-
* import type { CheckpointsService } from "@noldova/checkpoints/runtime";
|
|
995
|
-
*
|
|
996
|
-
* export async function restoreAsync(checkpoints: CheckpointsService, checkpoint: string): Promise<string> {
|
|
997
|
-
* const folder = new FolderReference("project-1", "/work/project");
|
|
998
|
-
* const preview = await checkpoints.previewRestoreAsync(new PreviewRequest(folder, checkpoint, null));
|
|
999
|
-
* if (Object.isNull(preview.plan))
|
|
1000
|
-
* return preview.outcome.value;
|
|
1001
|
-
* return (await checkpoints.restoreAsync(new RestoreRequest(folder, preview.plan))).outcome.value;
|
|
1002
|
-
* }
|
|
1003
|
-
* ```
|
|
1004
|
-
*/
|
|
1005
|
-
public abstract restoreAsync(request: RestoreRequest, signal?: AbortSignal): Promise<RestoreResult>;
|
|
1006
|
-
|
|
1007
|
-
/**
|
|
1008
|
-
* Lists every folder's space used: the sum of the sizes of its store's files, and the path the folder had at its last capture. It
|
|
1009
|
-
* reads outside the folders' calls, so it never waits for one; a capture or a housekeeping pass running meanwhile may change the
|
|
1010
|
-
* sizes at once. A folder whose store a delete is moving aside is left out, and a delete waits for a call reading it. Space a delete
|
|
1011
|
-
* couldn't free yet isn't listed.
|
|
1012
|
-
*
|
|
1013
|
-
* @param signal Stops the call; none by default.
|
|
1014
|
-
* @returns The folders, the largest first; none when no folder was ever captured.
|
|
1015
|
-
* @throws {Error} When the system refuses to list the module's stores, or a store's files, other than one that is gone.
|
|
1016
|
-
* @example
|
|
1017
|
-
* ```ts
|
|
1018
|
-
* import type { CheckpointsService } from "@noldova/checkpoints/runtime";
|
|
1019
|
-
*
|
|
1020
|
-
* export async function usedBytesAsync(checkpoints: CheckpointsService): Promise<number> {
|
|
1021
|
-
* const list = await checkpoints.storageAsync();
|
|
1022
|
-
* return list.folders.reduce((total, t) => total + t.bytes, 0);
|
|
1023
|
-
* }
|
|
1024
|
-
* ```
|
|
1025
|
-
*/
|
|
1026
|
-
public abstract storageAsync(signal?: AbortSignal): Promise<StorageList>;
|
|
1027
|
-
}
|
|
765
|
+
export { CheckpointsService } from "@noldova/checkpoints.protocol";
|
|
1028
766
|
|
|
1029
767
|
/**
|
|
1030
768
|
* The module's runtime part, which Noldova Desktop loads from `@noldova/checkpoints/runtime`.
|
package/src/api/index.js
CHANGED
|
@@ -28,5 +28,5 @@ export { UnknownJournalRecordException } from "../exceptions/unknown-journal-rec
|
|
|
28
28
|
export { UnknownLinkKindException } from "../exceptions/unknown-link-kind.exception.js";
|
|
29
29
|
export { UnsupportedStoreFormatException } from "../exceptions/unsupported-store-format.exception.js";
|
|
30
30
|
export { RuntimePart } from "../runtime-part.js";
|
|
31
|
-
export { CheckpointsService } from "
|
|
31
|
+
export { CheckpointsService } from "@noldova/checkpoints.protocol";
|
|
32
32
|
//# sourceMappingURL=index.js.map
|
package/src/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAC9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAC9F,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,6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AO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -40,7 +40,8 @@ export class CheckpointRecord {
|
|
|
40
40
|
this.paths = Object.isNull(paths) ? null : [...paths];
|
|
41
41
|
}
|
|
42
42
|
static fromJson(value) {
|
|
43
|
-
const version = StoreFormat.readVersion(StoreFormat.read(value, Resources.checkpointRecordModel, CheckpointRecord.FIELDS), [Resources.formatVersion, Resources.version2CheckpointFormat, Resources.version3CheckpointFormat, Resources.
|
|
43
|
+
const version = StoreFormat.readVersion(StoreFormat.read(value, Resources.checkpointRecordModel, CheckpointRecord.FIELDS), [Resources.formatVersion, Resources.version2CheckpointFormat, Resources.version3CheckpointFormat, Resources.version4CheckpointFormat,
|
|
44
|
+
Resources.checkpointFormatVersion]);
|
|
44
45
|
const reader = StoreFormat.read(value, Resources.checkpointRecordModel, CheckpointRecord.fieldsOf(version));
|
|
45
46
|
const written = reader.readValue(Resources.checkpointField);
|
|
46
47
|
const checkpoint = version === Resources.formatVersion ? CheckpointRecord.checkpointOfVersion1(written) : Checkpoint.fromJson(written);
|
|
@@ -48,8 +49,8 @@ export class CheckpointRecord {
|
|
|
48
49
|
const links = StoreFormat.readArray(reader, Resources.linksField).map(t => LinkRecord.fromJson(t));
|
|
49
50
|
const ignoreRules = reader.readValue(Resources.ignoreRulesField);
|
|
50
51
|
const earlierPaths = version >= Resources.version3CheckpointFormat ? reader.readStringArray(Resources.earlierPathsField) : [];
|
|
51
|
-
const paths = version
|
|
52
|
-
return new CheckpointRecord(checkpoint, emptyFolders, links, Object.isNull(ignoreRules) ? null : IgnoreRecord.fromJson(ignoreRules), earlierPaths, paths);
|
|
52
|
+
const paths = version >= Resources.version4CheckpointFormat && !Object.isNull(reader.readValue(Resources.pathsField)) ? reader.readStringArray(Resources.pathsField) : null;
|
|
53
|
+
return new CheckpointRecord(checkpoint, emptyFolders, links, Object.isNull(ignoreRules) ? null : IgnoreRecord.fromJson(ignoreRules, version), earlierPaths, paths);
|
|
53
54
|
}
|
|
54
55
|
linkKindOf(relativePath) {
|
|
55
56
|
return this.links.find(t => t.path === relativePath)?.linkKind ?? null;
|
|
@@ -66,7 +67,7 @@ export class CheckpointRecord {
|
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
static fieldsOf(version) {
|
|
69
|
-
if (version
|
|
70
|
+
if (version >= Resources.version4CheckpointFormat)
|
|
70
71
|
return CheckpointRecord.FIELDS;
|
|
71
72
|
return version === Resources.version3CheckpointFormat ? CheckpointRecord.VERSION_3_FIELDS : CheckpointRecord.VERSION_2_FIELDS;
|
|
72
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint-record.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/checkpoint-record.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGlG,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,UAAU,EA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CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC;YAC5D,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC;YAC5D,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC;YAC9D,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,EAAE;SACjC,CAAC,CAAC;QACH,MAAM,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;QACjI,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAChF,CAAC;IAEO,MAAM,CAAC,oBAAoB,CAAC,KAAc;QAChD,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,EAAE,gBAAgB,CAAC,4BAA4B,CAAC,CAAC;QACjH,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACtI,CAAC;CACF"}
|
|
@@ -10,20 +10,23 @@ import { Resources } from "../resources.js";
|
|
|
10
10
|
import { StoreFormat } from "../services/store-format.js";
|
|
11
11
|
import { IndexEntry } from "./index-entry.js";
|
|
12
12
|
export class FolderIndex {
|
|
13
|
-
static Empty = new FolderIndex(0n, []);
|
|
14
|
-
static FIELDS = [Resources.formatVersionField, Resources.startField, Resources.entriesField];
|
|
13
|
+
static Empty = new FolderIndex(0n, [], null);
|
|
14
|
+
static FIELDS = [Resources.formatVersionField, Resources.startField, Resources.checkpointField, Resources.entriesField];
|
|
15
|
+
static VERSION_1_FIELDS = FolderIndex.FIELDS.filter(t => t !== Resources.checkpointField);
|
|
15
16
|
byPath;
|
|
17
|
+
checkpoint;
|
|
16
18
|
entries;
|
|
17
19
|
start;
|
|
18
|
-
constructor(start, entries) {
|
|
20
|
+
constructor(start, entries, checkpoint) {
|
|
19
21
|
this.byPath = new Map(entries.map(t => [t.path, t]));
|
|
22
|
+
this.checkpoint = checkpoint;
|
|
20
23
|
this.entries = [...entries];
|
|
21
24
|
this.start = start;
|
|
22
25
|
}
|
|
23
26
|
static fromJson(value) {
|
|
24
|
-
const
|
|
25
|
-
StoreFormat.
|
|
26
|
-
return new FolderIndex(BigInt(reader.readString(Resources.startField)), StoreFormat.readArray(reader, Resources.entriesField).map(t => IndexEntry.fromJson(t)));
|
|
27
|
+
const version = StoreFormat.readVersion(StoreFormat.read(value, Resources.folderIndexModel, FolderIndex.FIELDS), [Resources.formatVersion, Resources.folderIndexFormatVersion]);
|
|
28
|
+
const reader = StoreFormat.read(value, Resources.folderIndexModel, version === Resources.formatVersion ? FolderIndex.VERSION_1_FIELDS : FolderIndex.FIELDS);
|
|
29
|
+
return new FolderIndex(BigInt(reader.readString(Resources.startField)), StoreFormat.readArray(reader, Resources.entriesField).map(t => IndexEntry.fromJson(t)), version === Resources.formatVersion ? null : reader.readNullableString(Resources.checkpointField));
|
|
27
30
|
}
|
|
28
31
|
find(path) {
|
|
29
32
|
return this.byPath.get(path) ?? null;
|
|
@@ -34,8 +37,9 @@ export class FolderIndex {
|
|
|
34
37
|
}
|
|
35
38
|
toJson() {
|
|
36
39
|
return {
|
|
37
|
-
[Resources.formatVersionField]: Resources.
|
|
40
|
+
[Resources.formatVersionField]: Resources.folderIndexFormatVersion,
|
|
38
41
|
[Resources.startField]: String(this.start),
|
|
42
|
+
[Resources.checkpointField]: this.checkpoint,
|
|
39
43
|
[Resources.entriesField]: this.entries.map(t => t.toJson())
|
|
40
44
|
};
|
|
41
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folder-index.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/folder-index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAG/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,MAAM,OAAO,WAAW;IACf,MAAM,CAAU,KAAK,GAAgB,IAAI,WAAW,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"folder-index.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/folder-index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAG/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,MAAM,OAAO,WAAW;IACf,MAAM,CAAU,KAAK,GAAgB,IAAI,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IAElE,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,kBAAkB,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACpJ,MAAM,CAAU,gBAAgB,GAAsB,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,eAAe,CAAC,CAAC;IAC7G,MAAM,CAAkC;IAEzC,UAAU,C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CAAC,CAAC,CAAC;IACvG,CAAC;IAEM,IAAI,CAAC,IAAY;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IACvC,CAAC;IAEM,aAAa,CAAC,KAAkB;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1C,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACzH,CAAC;IAEM,MAAM;QACX,OAAO;YACL,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,SAAS,CAAC,wBAAwB;YAClE,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAC1C,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC,UAAU;YAC5C,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SAC5D,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -8,19 +8,28 @@
|
|
|
8
8
|
import { Resources } from "../resources.js";
|
|
9
9
|
import { StoreFormat } from "../services/store-format.js";
|
|
10
10
|
export class IgnoreRecord {
|
|
11
|
-
static FIELDS = [Resources.ignoresCaseField, Resources.repositoryFoldersField];
|
|
11
|
+
static FIELDS = [Resources.ignoresCaseField, Resources.repositoryFoldersField, Resources.pathsField];
|
|
12
|
+
static VERSION_4_FIELDS = IgnoreRecord.FIELDS.filter(t => t !== Resources.pathsField);
|
|
12
13
|
ignoresCase;
|
|
14
|
+
paths;
|
|
13
15
|
repositoryFolders;
|
|
14
|
-
constructor(ignoresCase, repositoryFolders) {
|
|
16
|
+
constructor(ignoresCase, repositoryFolders, paths = null) {
|
|
15
17
|
this.ignoresCase = ignoresCase;
|
|
18
|
+
this.paths = Object.isNull(paths) ? null : [...paths];
|
|
16
19
|
this.repositoryFolders = [...repositoryFolders];
|
|
17
20
|
}
|
|
18
|
-
static fromJson(value) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
+
static fromJson(value, version) {
|
|
22
|
+
const hasPaths = version === Resources.checkpointFormatVersion;
|
|
23
|
+
const reader = StoreFormat.read(value, Resources.ignoreRecordModel, hasPaths ? IgnoreRecord.FIELDS : IgnoreRecord.VERSION_4_FIELDS);
|
|
24
|
+
const paths = hasPaths && !Object.isNull(reader.readValue(Resources.pathsField)) ? reader.readStringArray(Resources.pathsField) : null;
|
|
25
|
+
return new IgnoreRecord(reader.readBoolean(Resources.ignoresCaseField), reader.readStringArray(Resources.repositoryFoldersField), paths);
|
|
21
26
|
}
|
|
22
27
|
toJson() {
|
|
23
|
-
return {
|
|
28
|
+
return {
|
|
29
|
+
[Resources.ignoresCaseField]: this.ignoresCase,
|
|
30
|
+
[Resources.repositoryFoldersField]: [...this.repositoryFolders],
|
|
31
|
+
[Resources.pathsField]: Object.isNull(this.paths) ? null : [...this.paths]
|
|
32
|
+
};
|
|
24
33
|
}
|
|
25
34
|
}
|
|
26
35
|
//# sourceMappingURL=ignore-record.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore-record.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/ignore-record.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,MAAM,OAAO,YAAY;IACf,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,gBAAgB,EAAE,SAAS,CAAC,s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CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACvI,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,sBAAsB,CAAC,EAAE,KAAK,CAAC,CAAC;IAC3I,CAAC;IAEM,MAAM;QACX,OAAO;YACL,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,WAAW;YAC9C,CAAC,SAAS,CAAC,sBAAsB,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC;YAC/D,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;SAC3E,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -7,13 +7,16 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import "@noldova/context.core";
|
|
9
9
|
import { Resources } from "../resources.js";
|
|
10
|
+
import { RestoreScope } from "../services/restore-scope.js";
|
|
10
11
|
import { IgnoreFile } from "./ignore-file.js";
|
|
11
12
|
export class IgnoreRules {
|
|
12
13
|
fileMap = new Map();
|
|
13
14
|
repositoryFolderSet = new Set();
|
|
15
|
+
scope;
|
|
14
16
|
ignoresCase;
|
|
15
|
-
constructor(ignoresCase) {
|
|
17
|
+
constructor(ignoresCase, paths = null) {
|
|
16
18
|
this.ignoresCase = ignoresCase;
|
|
19
|
+
this.scope = new RestoreScope(paths);
|
|
17
20
|
}
|
|
18
21
|
get files() {
|
|
19
22
|
return [...this.fileMap.values()];
|
|
@@ -28,6 +31,8 @@ export class IgnoreRules {
|
|
|
28
31
|
this.repositoryFolderSet.add(folderPath);
|
|
29
32
|
}
|
|
30
33
|
excludes(path, isFolder) {
|
|
34
|
+
if (!this.scope.reports(path))
|
|
35
|
+
return true;
|
|
31
36
|
for (let end = path.indexOf(Resources.relativePathSeparator); end >= 0; end = path.indexOf(Resources.relativePathSeparator, end + 1))
|
|
32
37
|
if (this.isIgnored(path.slice(0, end), true))
|
|
33
38
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore-rules.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/ignore-rules.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,OAAO,WAAW;IACL,OAAO,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC7C,mBAAmB,GAAgB,IAAI,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ignore-rules.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/ignore-rules.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,OAAO,WAAW;IACL,OAAO,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC7C,mBAAmB,GAAgB,IAAI,GAAG,EAAE,CAAC;IAC7C,KAAK,CAAe;IACrB,WAAW,CAAU;IAErC,YAAmB,WAAoB,EAAE,KAAK,GAA6B,IAAI;QAC7E,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK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AC;QACjF,IAAI,MAAM,GAAG,IAAI,CAAC;QAClB,GAAG,CAAC;YACF,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC3F,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC;YACjF,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;gBAC1B,OAAO,QAAQ,CAAC;QACpB,CAAC,QAAQ,MAAM,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QACjE,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -15,6 +15,7 @@ export class WalkResult {
|
|
|
15
15
|
folderTimeMap = new Map();
|
|
16
16
|
ignoredPathList = [];
|
|
17
17
|
linkList = [];
|
|
18
|
+
partialFolderSet = new Set();
|
|
18
19
|
repositoryFolderSet = new Set();
|
|
19
20
|
repositoryPathList = [];
|
|
20
21
|
unreadPathList = [];
|
|
@@ -40,6 +41,9 @@ export class WalkResult {
|
|
|
40
41
|
get links() {
|
|
41
42
|
return this.linkList;
|
|
42
43
|
}
|
|
44
|
+
get partialFolders() {
|
|
45
|
+
return this.partialFolderSet;
|
|
46
|
+
}
|
|
43
47
|
get repositoryFolders() {
|
|
44
48
|
return this.repositoryFolderSet;
|
|
45
49
|
}
|
|
@@ -65,6 +69,9 @@ export class WalkResult {
|
|
|
65
69
|
addIgnoredPath(path) {
|
|
66
70
|
this.ignoredPathList.push(path);
|
|
67
71
|
}
|
|
72
|
+
addPartialFolder(path) {
|
|
73
|
+
this.partialFolderSet.add(path);
|
|
74
|
+
}
|
|
68
75
|
addRepositoryFolder(path) {
|
|
69
76
|
for (let folder = path; folder !== "" && !this.repositoryFolderSet.has(folder); folder = RelativePath.parentOf(folder))
|
|
70
77
|
this.repositoryFolderSet.add(folder);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walk-result.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/walk-result.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAM5D,MAAM,OAAO,UAAU;IACJ,eAAe,GAAa,EAAE,CAAC;IAC/B,SAAS,GAAkB,EAAE,CAAC;IAC9B,WAAW,GAAwB,IAAI,GAAG,EAAE,CAAC;IAC7C,aAAa,GAAwB,IAAI,GAAG,EAAE,CAAC;IAC/C,eAAe,GAAa,EAAE,CAAC;IAC/B,QAAQ,GAAiB,EAAE,CAAC;IAC5B,mBAAmB,GAAgB,IAAI,GAAG,EAAE,CAAC;IAC7C,kBAAkB,GAAa,EAAE,CAAC;IAClC,cAAc,GAAiB,EAAE,CAAC;IACnC,KAAK,CAAqB;IAE1C,YAAmB,KAAyB;QAC1C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAW,WAAW;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;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,CAAC,IAAY;QAClC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAEM,mBAAmB,CAAC,IAAY;QACrC,KAAK,IAAI,MAAM,GAAG,IAAI,EAAE,MAAM,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;YACpH,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAEM,iBAAiB,CAAC,IAAY;QACnC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAEM,UAAU,CAAC,IAAY,EAAE,OAAoB;QAClD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;YACxB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAEM,OAAO,CAAC,IAAgB;QAC7B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAEM,aAAa,CAAC,IAAgB;QACnC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACF"}
|
package/src/resources.js
CHANGED
|
@@ -65,7 +65,7 @@ export class Resources {
|
|
|
65
65
|
static changingCodes = ["ELOOP"];
|
|
66
66
|
static checkpointField = "checkpoint";
|
|
67
67
|
static checkpointFile = "checkpoint.json";
|
|
68
|
-
static checkpointFormatVersion =
|
|
68
|
+
static checkpointFormatVersion = 5;
|
|
69
69
|
static checkpointIdCounterBits = 12n;
|
|
70
70
|
static checkpointIdCounterMask = 0xfffn;
|
|
71
71
|
static checkpointIdRandomBytes = 8;
|
|
@@ -115,6 +115,7 @@ export class Resources {
|
|
|
115
115
|
static fileLinkType = "file";
|
|
116
116
|
static filesFolder = "files";
|
|
117
117
|
static folderFile = "folder.json";
|
|
118
|
+
static folderIndexFormatVersion = 2;
|
|
118
119
|
static folderIndexModel = "FolderIndex";
|
|
119
120
|
static folderLinkType = "dir";
|
|
120
121
|
static folderRecordModel = "FolderRecord";
|
|
@@ -293,9 +294,9 @@ export class Resources {
|
|
|
293
294
|
static returnedRecord = "Returned";
|
|
294
295
|
static rollingBackRecord = "RollingBack";
|
|
295
296
|
static rulesFolder = "rules";
|
|
297
|
+
static pathspecSeparator = "--";
|
|
296
298
|
static scriptField = "script";
|
|
297
299
|
static scriptStepModel = "ScriptStep";
|
|
298
|
-
static serviceName = "checkpoints.service";
|
|
299
300
|
static sizeField = "size";
|
|
300
301
|
static space = " ";
|
|
301
302
|
static spaceCheckInterval = 64 * 1024 * 1024;
|
|
@@ -327,6 +328,7 @@ export class Resources {
|
|
|
327
328
|
static uuidVariantMask = 0x3f;
|
|
328
329
|
static version2CheckpointFormat = 2;
|
|
329
330
|
static version3CheckpointFormat = 3;
|
|
331
|
+
static version4CheckpointFormat = 4;
|
|
330
332
|
static wildcardBackslash = 0x5c;
|
|
331
333
|
static wildcardBang = 0x21;
|
|
332
334
|
static wildcardCaret = 0x5e;
|