@noldova/checkpoints 0.0.2 → 0.0.4
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/README.md +1 -1
- package/module.json +2 -2
- package/package.json +14 -12
- package/src/api/index.d.ts +14 -71
- package/src/api/index.js +0 -2
- package/src/api/index.js.map +1 -1
- package/src/models/checkpoint-record.js +27 -23
- package/src/models/checkpoint-record.js.map +1 -1
- package/src/models/entry-kind.js +3 -2
- package/src/models/entry-kind.js.map +1 -1
- package/src/models/folder-index.js +7 -5
- package/src/models/folder-index.js.map +1 -1
- package/src/models/folder-record.js +1 -3
- package/src/models/folder-record.js.map +1 -1
- package/src/models/housekeeping-record.js +1 -3
- package/src/models/housekeeping-record.js.map +1 -1
- package/src/models/ignore-file.js +3 -2
- package/src/models/ignore-file.js.map +1 -1
- package/src/models/ignore-record.js +2 -8
- package/src/models/ignore-record.js.map +1 -1
- package/src/models/ignore-rules.js +2 -1
- package/src/models/ignore-rules.js.map +1 -1
- package/src/models/index-entry.js +3 -4
- package/src/models/index-entry.js.map +1 -1
- package/src/models/journal-record-type.js +2 -1
- package/src/models/journal-record-type.js.map +1 -1
- package/src/models/journal-record.js +7 -7
- package/src/models/journal-record.js.map +1 -1
- package/src/models/link-kind.js +2 -1
- package/src/models/link-kind.js.map +1 -1
- package/src/models/link-record.js +3 -4
- package/src/models/link-record.js.map +1 -1
- package/src/models/object-batch.js +2 -1
- package/src/models/object-batch.js.map +1 -1
- package/src/models/object-counts.js +2 -1
- package/src/models/object-counts.js.map +1 -1
- package/src/models/read-failure.js +3 -2
- package/src/models/read-failure.js.map +1 -1
- package/src/models/restore-script.js +6 -21
- package/src/models/restore-script.js.map +1 -1
- package/src/models/script-step.js +10 -9
- package/src/models/script-step.js.map +1 -1
- package/src/models/side-listing.js +4 -3
- package/src/models/side-listing.js.map +1 -1
- package/src/models/tree-listing.js +3 -2
- package/src/models/tree-listing.js.map +1 -1
- package/src/models/walk-result.js +12 -3
- package/src/models/walk-result.js.map +1 -1
- package/src/models/walked-entry.js +3 -0
- package/src/models/walked-entry.js.map +1 -1
- package/src/models/wildcard-pattern.js +3 -2
- package/src/models/wildcard-pattern.js.map +1 -1
- package/src/resources.js +17 -8
- package/src/resources.js.map +1 -1
- package/src/services/blob-batch.writer.js +7 -6
- package/src/services/blob-batch.writer.js.map +1 -1
- package/src/services/capture-pause.js +3 -2
- package/src/services/capture-pause.js.map +1 -1
- package/src/services/change-describer.js +2 -1
- package/src/services/change-describer.js.map +1 -1
- package/src/services/checkpoint-capture.js +80 -19
- package/src/services/checkpoint-capture.js.map +1 -1
- package/src/services/checkpoint-comparer.js +4 -3
- package/src/services/checkpoint-comparer.js.map +1 -1
- package/src/services/checkpoint-file.reader.js +16 -15
- package/src/services/checkpoint-file.reader.js.map +1 -1
- package/src/services/checkpoint-lister.js +3 -2
- package/src/services/checkpoint-lister.js.map +1 -1
- package/src/services/checkpoints-host.js +1 -1
- package/src/services/checkpoints-host.js.map +1 -1
- package/src/services/command-deadline.js +2 -1
- package/src/services/command-deadline.js.map +1 -1
- package/src/services/entry.reader.js +16 -7
- package/src/services/entry.reader.js.map +1 -1
- package/src/services/failures.js +5 -4
- package/src/services/failures.js.map +1 -1
- package/src/services/fast-import-leftovers.js +2 -1
- package/src/services/fast-import-leftovers.js.map +1 -1
- package/src/services/folder-file.reader.js +2 -1
- package/src/services/folder-file.reader.js.map +1 -1
- package/src/services/folder-walker.js +22 -7
- package/src/services/folder-walker.js.map +1 -1
- package/src/services/git-build.locator.js +5 -5
- package/src/services/git-build.locator.js.map +1 -1
- package/src/services/git-process.js +3 -2
- package/src/services/git-process.js.map +1 -1
- package/src/services/git-runner.js +5 -4
- package/src/services/git-runner.js.map +1 -1
- package/src/services/input-writer.js +4 -3
- package/src/services/input-writer.js.map +1 -1
- package/src/services/listing-comparer.js +5 -4
- package/src/services/listing-comparer.js.map +1 -1
- package/src/services/module-activation.js +22 -9
- package/src/services/module-activation.js.map +1 -1
- package/src/services/name-decoder.js +2 -1
- package/src/services/name-decoder.js.map +1 -1
- package/src/services/path-guard.js +3 -2
- package/src/services/path-guard.js.map +1 -1
- package/src/services/restore-applier.js +23 -17
- package/src/services/restore-applier.js.map +1 -1
- package/src/services/restore-journal.js +24 -10
- package/src/services/restore-journal.js.map +1 -1
- package/src/services/restore-paths.js +5 -4
- package/src/services/restore-paths.js.map +1 -1
- package/src/services/restore-planner.js +16 -11
- package/src/services/restore-planner.js.map +1 -1
- package/src/services/restore-rollback.js +10 -9
- package/src/services/restore-rollback.js.map +1 -1
- package/src/services/restore-runner.js +32 -22
- package/src/services/restore-runner.js.map +1 -1
- package/src/services/restore-scope.js +3 -2
- package/src/services/restore-scope.js.map +1 -1
- package/src/services/side-loader.js +11 -4
- package/src/services/side-loader.js.map +1 -1
- package/src/services/storage-reader.js +4 -3
- package/src/services/storage-reader.js.map +1 -1
- package/src/services/store-file.js +2 -1
- package/src/services/store-file.js.map +1 -1
- package/src/services/store-format.js +21 -10
- package/src/services/store-format.js.map +1 -1
- package/src/services/store-housekeeping.js +15 -1
- package/src/services/store-housekeeping.js.map +1 -1
- package/src/services/wildcard.parser.js +3 -2
- package/src/services/wildcard.parser.js.map +1 -1
- package/src/exceptions/store-field-not-a-boolean.exception.js +0 -17
- package/src/exceptions/store-field-not-a-boolean.exception.js.map +0 -1
- package/src/exceptions/store-field-not-a-string-list.exception.js +0 -17
- package/src/exceptions/store-field-not-a-string-list.exception.js.map +0 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ npm install --save-exact @noldova/checkpoints
|
|
|
12
12
|
The package holds `module.json` and `settings.json`, and its `./runtime` gives Noldova Desktop the runtime part, `RuntimePart`, with the `CheckpointsService` it publishes and the module's exceptions, on `CheckpointsException`.
|
|
13
13
|
`module.json` contributes the runtime methods `checkpoints.capture`, `checkpoints.list`, `checkpoints.compare`, `checkpoints.read`, `checkpoints.previewRestore`, `checkpoints.restore`, `checkpoints.storage` and `checkpoints.deleteFolder`, their events, the `checkpoints.lowDiskSpace` notification and the `checkpoints.followIgnoreFiles` setting.
|
|
14
14
|
Their requests, results and events are in [`@noldova/checkpoints.protocol`](https://www.npmjs.com/package/@noldova/checkpoints.protocol), which the module pins at its own version.
|
|
15
|
-
It takes `@noldova/desktop.runtime`, `@noldova/desktop.protocol` and `@noldova/context.
|
|
15
|
+
It takes `@noldova/desktop.runtime`, `@noldova/desktop.protocol`, `@noldova/context.core`, `@noldova/context.exceptions` and `@noldova/context.json` as peers, and installs the Git build for its system from the optional `@noldova/checkpoints.git.<os>-<arch>` packages.
|
|
16
16
|
|
|
17
17
|
[documents/ARCHITECTURE.md](https://github.com/noldova-com/checkpoints/blob/main/documents/ARCHITECTURE.md) says how the module works, and the [README](https://github.com/noldova-com/checkpoints#readme) how to build and test it.
|
|
18
18
|
It is licensed under the [MIT License](https://github.com/noldova-com/checkpoints/blob/main/LICENSE).
|
package/module.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "checkpoints",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
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"],
|
|
7
7
|
"dependencies": {},
|
|
8
|
-
"noldovaDesktop": ">=0.0.
|
|
8
|
+
"noldovaDesktop": ">=0.0.17 <0.1.0",
|
|
9
9
|
"contributes": {
|
|
10
10
|
"methods": ["checkpoints.capture", "checkpoints.list", "checkpoints.compare", "checkpoints.read", "checkpoints.previewRestore", "checkpoints.restore", "checkpoints.storage", "checkpoints.deleteFolder"],
|
|
11
11
|
"events": ["checkpoints.capturePaused", "checkpoints.captureResumed", "checkpoints.restored", "checkpoints.restoreHeldUp"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noldova/checkpoints",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
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",
|
|
@@ -32,20 +32,22 @@
|
|
|
32
32
|
"registry": "https://registry.npmjs.org/"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@noldova/context.
|
|
36
|
-
"@noldova/
|
|
37
|
-
"@noldova/
|
|
35
|
+
"@noldova/context.core": ">=0.0.12 <0.1.0",
|
|
36
|
+
"@noldova/context.exceptions": ">=0.0.12 <0.1.0",
|
|
37
|
+
"@noldova/context.json": ">=0.0.12 <0.1.0",
|
|
38
|
+
"@noldova/desktop.protocol": ">=0.0.17 <0.1.0",
|
|
39
|
+
"@noldova/desktop.runtime": ">=0.0.17 <0.1.0"
|
|
38
40
|
},
|
|
39
41
|
"dependencies": {
|
|
40
|
-
"@noldova/checkpoints.protocol": "0.0.
|
|
42
|
+
"@noldova/checkpoints.protocol": "0.0.4"
|
|
41
43
|
},
|
|
42
44
|
"optionalDependencies": {
|
|
43
|
-
"@noldova/checkpoints.git.darwin-arm64": "0.0.
|
|
44
|
-
"@noldova/checkpoints.git.darwin-x64": "0.0.
|
|
45
|
-
"@noldova/checkpoints.git.linux-arm64": "0.0.
|
|
46
|
-
"@noldova/checkpoints.git.linux-x64": "0.0.
|
|
47
|
-
"@noldova/checkpoints.git.win32-arm64": "0.0.
|
|
48
|
-
"@noldova/checkpoints.git.win32-x64": "0.0.
|
|
45
|
+
"@noldova/checkpoints.git.darwin-arm64": "0.0.4",
|
|
46
|
+
"@noldova/checkpoints.git.darwin-x64": "0.0.4",
|
|
47
|
+
"@noldova/checkpoints.git.linux-arm64": "0.0.4",
|
|
48
|
+
"@noldova/checkpoints.git.linux-x64": "0.0.4",
|
|
49
|
+
"@noldova/checkpoints.git.win32-arm64": "0.0.4",
|
|
50
|
+
"@noldova/checkpoints.git.win32-x64": "0.0.4"
|
|
49
51
|
},
|
|
50
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "92115c9738699675becd88bfa8253a5584d0ac6d"
|
|
51
53
|
}
|
package/src/api/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import "@noldova/context.core";
|
|
9
10
|
import type {
|
|
10
11
|
CaptureMode,
|
|
11
12
|
CaptureRequest,
|
|
@@ -233,7 +234,7 @@ export declare class GitMissingException extends CheckpointsException {
|
|
|
233
234
|
* ```ts
|
|
234
235
|
* import { GitManifestInvalidException } from "@noldova/checkpoints/runtime";
|
|
235
236
|
*
|
|
236
|
-
* const exception = new GitManifestInvalidException("/app/git/package.json", new Error("GitPackage
|
|
237
|
+
* const exception = new GitManifestInvalidException("/app/git/package.json", new Error("GitPackage.noldova.git.path: The field is required."));
|
|
237
238
|
* console.log(exception.message, exception.manifestFile, exception.cause);
|
|
238
239
|
* ```
|
|
239
240
|
*/
|
|
@@ -253,7 +254,7 @@ export declare class GitManifestInvalidException extends CheckpointsException {
|
|
|
253
254
|
* ```ts
|
|
254
255
|
* import { GitManifestInvalidException } from "@noldova/checkpoints/runtime";
|
|
255
256
|
*
|
|
256
|
-
* export const failure: GitManifestInvalidException = new GitManifestInvalidException("/app/git/package.json", new Error("GitPackage
|
|
257
|
+
* export const failure: GitManifestInvalidException = new GitManifestInvalidException("/app/git/package.json", new Error("GitPackage.noldova.git.path: The field is required."));
|
|
257
258
|
* ```
|
|
258
259
|
*/
|
|
259
260
|
public constructor(manifestFile: string, cause: Error);
|
|
@@ -261,7 +262,7 @@ export declare class GitManifestInvalidException extends CheckpointsException {
|
|
|
261
262
|
|
|
262
263
|
/**
|
|
263
264
|
* Thrown when a folder's store holds a file the module can't read, or one of a format version it doesn't know. Its subclasses:
|
|
264
|
-
* {@link CheckpointFileMissingException}, {@link IgnoreRulesMismatchException}, {@link JournalFieldMissingException}, {@link ScriptStepMissingException}, {@link StoreAnswersMismatchException}, {@link
|
|
265
|
+
* {@link CheckpointFileMissingException}, {@link IgnoreRulesMismatchException}, {@link JournalFieldMissingException}, {@link ScriptStepMissingException}, {@link StoreAnswersMismatchException}, {@link StoreFileUnreadableException}, {@link StoreObjectMissingException}, {@link StoreObjectNotABlobException}, {@link TreeLineMalformedException}, {@link UnexpectedStoreObjectException}, {@link UnknownEntryKindException}, {@link UnknownGitModeException}, {@link UnknownJournalRecordException}, {@link UnknownLinkKindException}, {@link UnsupportedStoreFormatException}.
|
|
265
266
|
*
|
|
266
267
|
* @example
|
|
267
268
|
* ```ts
|
|
@@ -460,68 +461,6 @@ export declare class StoreAnswersMismatchException extends StoreException {
|
|
|
460
461
|
public constructor(asked: number, answered: number);
|
|
461
462
|
}
|
|
462
463
|
|
|
463
|
-
/**
|
|
464
|
-
* Thrown when a field of a store file holds something other than true or false.
|
|
465
|
-
*
|
|
466
|
-
* @example
|
|
467
|
-
* ```ts
|
|
468
|
-
* import { StoreFieldNotABooleanException } from "@noldova/checkpoints/runtime";
|
|
469
|
-
*
|
|
470
|
-
* const exception = new StoreFieldNotABooleanException("ignoresCase");
|
|
471
|
-
* console.log(exception.message, exception.field);
|
|
472
|
-
* ```
|
|
473
|
-
*/
|
|
474
|
-
export declare class StoreFieldNotABooleanException extends StoreException {
|
|
475
|
-
/**
|
|
476
|
-
* The field.
|
|
477
|
-
*/
|
|
478
|
-
public readonly field: string;
|
|
479
|
-
|
|
480
|
-
/**
|
|
481
|
-
* Formats the exception's message from its facts.
|
|
482
|
-
*
|
|
483
|
-
* @param field The field.
|
|
484
|
-
* @example
|
|
485
|
-
* ```ts
|
|
486
|
-
* import { StoreFieldNotABooleanException } from "@noldova/checkpoints/runtime";
|
|
487
|
-
*
|
|
488
|
-
* export const failure: StoreFieldNotABooleanException = new StoreFieldNotABooleanException("ignoresCase");
|
|
489
|
-
* ```
|
|
490
|
-
*/
|
|
491
|
-
public constructor(field: string);
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* Thrown when a field of a store file holds something other than text.
|
|
496
|
-
*
|
|
497
|
-
* @example
|
|
498
|
-
* ```ts
|
|
499
|
-
* import { StoreFieldNotAStringListException } from "@noldova/checkpoints/runtime";
|
|
500
|
-
*
|
|
501
|
-
* const exception = new StoreFieldNotAStringListException("emptyFolders");
|
|
502
|
-
* console.log(exception.message, exception.field);
|
|
503
|
-
* ```
|
|
504
|
-
*/
|
|
505
|
-
export declare class StoreFieldNotAStringListException extends StoreException {
|
|
506
|
-
/**
|
|
507
|
-
* The field.
|
|
508
|
-
*/
|
|
509
|
-
public readonly field: string;
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* Formats the exception's message from its facts.
|
|
513
|
-
*
|
|
514
|
-
* @param field The field.
|
|
515
|
-
* @example
|
|
516
|
-
* ```ts
|
|
517
|
-
* import { StoreFieldNotAStringListException } from "@noldova/checkpoints/runtime";
|
|
518
|
-
*
|
|
519
|
-
* export const failure: StoreFieldNotAStringListException = new StoreFieldNotAStringListException("emptyFolders");
|
|
520
|
-
* ```
|
|
521
|
-
*/
|
|
522
|
-
public constructor(field: string);
|
|
523
|
-
}
|
|
524
|
-
|
|
525
464
|
/**
|
|
526
465
|
* Thrown when one of the store's files isn't JSON, or isn't one the module wrote; the cause says why.
|
|
527
466
|
*
|
|
@@ -874,12 +813,15 @@ export declare abstract class CheckpointsService {
|
|
|
874
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
|
|
875
814
|
* adds, before it streams and while it does; one without the space takes no checkpoint, posts the folder's
|
|
876
815
|
* `checkpoints.lowDiskSpace` notification and raises `checkpoints.capturePaused`, and the folder's next capture that is taken
|
|
877
|
-
* dismisses the notification and raises `checkpoints.captureResumed`.
|
|
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.
|
|
878
820
|
*
|
|
879
|
-
* @param request The folder
|
|
821
|
+
* @param request The folder, the label to attach and the time the turn started, if any.
|
|
880
822
|
* @param signal Stops the call; none by default.
|
|
881
|
-
* @returns The checkpoint taken; or the outcome `LowDiskSpace`, with the space free and the space needed in bytes, `
|
|
882
|
-
* when the folder's path is missing, or `HeldUp` while an interrupted restore of the folder can't finish.
|
|
823
|
+
* @returns The checkpoint taken; or the outcome `LowDiskSpace`, with the space free and the space needed in bytes, `TooLarge`,
|
|
824
|
+
* 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.
|
|
883
825
|
* @throws {GitException} When a Git command fails; no checkpoint is left.
|
|
884
826
|
* @throws {StoreException} When the folder's store holds a file the module can't read.
|
|
885
827
|
* @throws {Error} When the system refuses the module a step of its own, such as reading the folder itself (EACCES), writing its
|
|
@@ -1036,7 +978,8 @@ export declare abstract class CheckpointsService {
|
|
|
1036
978
|
* @param signal Stops the call until the restore starts writing its journal; none by default.
|
|
1037
979
|
* @returns The outcome, with the checkpoint taken before the restore when it restored or rolled back, and, when it restored, the
|
|
1038
980
|
* checkpoint labelled `Recovered after restore` that keeps what another program changed in a file the restore had moved aside;
|
|
1039
|
-
* or `MovedOn` when the folder no longer matches the plan, `LowDiskSpace`, `
|
|
981
|
+
* or `MovedOn` when the folder no longer matches the plan, `LowDiskSpace`, `TooLarge`, with the size of the new and changed files
|
|
982
|
+
* and its limit, when the checkpoint taken before the restore would add over 1 GiB, `CheckpointMissing`, `FolderMissing` or `HeldUp`.
|
|
1040
983
|
* @throws {GitException} When a Git command fails before the restore changes anything.
|
|
1041
984
|
* @throws {StoreException} When the folder's store holds a file the module can't read.
|
|
1042
985
|
* @throws {Error} When the system refuses the module a step of its own before the restore changes anything, such as reading the
|
|
@@ -1049,7 +992,7 @@ export declare abstract class CheckpointsService {
|
|
|
1049
992
|
* export async function restoreAsync(checkpoints: CheckpointsService, checkpoint: string): Promise<string> {
|
|
1050
993
|
* const folder = new FolderReference("project-1", "/work/project");
|
|
1051
994
|
* const preview = await checkpoints.previewRestoreAsync(new PreviewRequest(folder, checkpoint, null));
|
|
1052
|
-
* if (preview.plan
|
|
995
|
+
* if (Object.isNull(preview.plan))
|
|
1053
996
|
* return preview.outcome.value;
|
|
1054
997
|
* return (await checkpoints.restoreAsync(new RestoreRequest(folder, preview.plan))).outcome.value;
|
|
1055
998
|
* }
|
package/src/api/index.js
CHANGED
|
@@ -17,8 +17,6 @@ export { JournalFieldMissingException } from "../exceptions/journal-field-missin
|
|
|
17
17
|
export { ScriptStepMissingException } from "../exceptions/script-step-missing.exception.js";
|
|
18
18
|
export { StoreException } from "../exceptions/store.exception.js";
|
|
19
19
|
export { StoreAnswersMismatchException } from "../exceptions/store-answers-mismatch.exception.js";
|
|
20
|
-
export { StoreFieldNotABooleanException } from "../exceptions/store-field-not-a-boolean.exception.js";
|
|
21
|
-
export { StoreFieldNotAStringListException } from "../exceptions/store-field-not-a-string-list.exception.js";
|
|
22
20
|
export { StoreFileUnreadableException } from "../exceptions/store-file-unreadable.exception.js";
|
|
23
21
|
export { StoreObjectMissingException } from "../exceptions/store-object-missing.exception.js";
|
|
24
22
|
export { StoreObjectNotABlobException } from "../exceptions/store-object-not-a-blob.exception.js";
|
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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C;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,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,oCAAoC,CAAC"}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
8
|
+
import "@noldova/context.core";
|
|
9
|
+
import { CaptureMode, Checkpoint, UnreadPath, UnreadReason } from "@noldova/checkpoints.protocol";
|
|
9
10
|
import { IgnoreRulesMismatchException } from "../exceptions/ignore-rules-mismatch.exception.js";
|
|
10
11
|
import { Resources } from "../resources.js";
|
|
11
12
|
import { StoreFormat } from "../services/store-format.js";
|
|
@@ -13,34 +14,38 @@ import { IgnoreRecord } from "./ignore-record.js";
|
|
|
13
14
|
import { LinkRecord } from "./link-record.js";
|
|
14
15
|
export class CheckpointRecord {
|
|
15
16
|
static FIELDS = [
|
|
16
|
-
Resources.formatVersionField, Resources.checkpointField, Resources.emptyFoldersField, Resources.linksField, Resources.ignoreRulesField
|
|
17
|
+
Resources.formatVersionField, Resources.checkpointField, Resources.emptyFoldersField, Resources.linksField, Resources.ignoreRulesField,
|
|
18
|
+
Resources.earlierPathsField
|
|
17
19
|
];
|
|
20
|
+
static VERSION_2_FIELDS = CheckpointRecord.FIELDS.filter(t => t !== Resources.earlierPathsField);
|
|
18
21
|
static VERSION_1_CHECKPOINT_FIELDS = [
|
|
19
22
|
Resources.idField, Resources.timeField, Resources.modeField, Resources.labelField, Resources.unreadPathsField
|
|
20
23
|
];
|
|
21
24
|
static VERSION_1_UNREAD_PATH_FIELDS = [Resources.pathField, Resources.reasonField];
|
|
22
25
|
checkpoint;
|
|
26
|
+
earlierPaths;
|
|
23
27
|
emptyFolders;
|
|
24
28
|
ignoreRules;
|
|
25
29
|
links;
|
|
26
|
-
constructor(checkpoint, emptyFolders, links, ignoreRules) {
|
|
27
|
-
if ((checkpoint.mode === CaptureMode.IgnoreFiles) !== (ignoreRules
|
|
30
|
+
constructor(checkpoint, emptyFolders, links, ignoreRules, earlierPaths = []) {
|
|
31
|
+
if ((checkpoint.mode === CaptureMode.IgnoreFiles) !== (!Object.isNull(ignoreRules)))
|
|
28
32
|
throw new IgnoreRulesMismatchException(checkpoint.mode);
|
|
29
33
|
this.checkpoint = checkpoint;
|
|
34
|
+
this.earlierPaths = [...earlierPaths];
|
|
30
35
|
this.emptyFolders = [...emptyFolders];
|
|
31
36
|
this.ignoreRules = ignoreRules;
|
|
32
37
|
this.links = [...links];
|
|
33
38
|
}
|
|
34
39
|
static fromJson(value) {
|
|
35
|
-
const
|
|
36
|
-
reader.
|
|
37
|
-
const
|
|
38
|
-
const written = reader.read(Resources.checkpointField);
|
|
40
|
+
const version = StoreFormat.readVersion(StoreFormat.read(value, Resources.checkpointRecordModel, CheckpointRecord.FIELDS), [Resources.formatVersion, Resources.version2CheckpointFormat, Resources.checkpointFormatVersion]);
|
|
41
|
+
const reader = StoreFormat.read(value, Resources.checkpointRecordModel, version === Resources.checkpointFormatVersion ? CheckpointRecord.FIELDS : CheckpointRecord.VERSION_2_FIELDS);
|
|
42
|
+
const written = reader.readValue(Resources.checkpointField);
|
|
39
43
|
const checkpoint = version === Resources.formatVersion ? CheckpointRecord.checkpointOfVersion1(written) : Checkpoint.fromJson(written);
|
|
40
|
-
const emptyFolders =
|
|
41
|
-
const links =
|
|
42
|
-
const ignoreRules = reader.
|
|
43
|
-
|
|
44
|
+
const emptyFolders = reader.readStringArray(Resources.emptyFoldersField);
|
|
45
|
+
const links = StoreFormat.readArray(reader, Resources.linksField).map(t => LinkRecord.fromJson(t));
|
|
46
|
+
const ignoreRules = reader.readValue(Resources.ignoreRulesField);
|
|
47
|
+
const earlierPaths = version === Resources.checkpointFormatVersion ? reader.readStringArray(Resources.earlierPathsField) : [];
|
|
48
|
+
return new CheckpointRecord(checkpoint, emptyFolders, links, Object.isNull(ignoreRules) ? null : IgnoreRecord.fromJson(ignoreRules), earlierPaths);
|
|
44
49
|
}
|
|
45
50
|
linkKindOf(relativePath) {
|
|
46
51
|
return this.links.find(t => t.path === relativePath)?.linkKind ?? null;
|
|
@@ -51,26 +56,25 @@ export class CheckpointRecord {
|
|
|
51
56
|
[Resources.checkpointField]: this.checkpoint.toJson(),
|
|
52
57
|
[Resources.emptyFoldersField]: [...this.emptyFolders],
|
|
53
58
|
[Resources.linksField]: this.links.map(t => t.toJson()),
|
|
54
|
-
[Resources.ignoreRulesField]: this.ignoreRules
|
|
59
|
+
[Resources.ignoreRulesField]: Object.isNull(this.ignoreRules) ? null : this.ignoreRules.toJson(),
|
|
60
|
+
[Resources.earlierPathsField]: [...this.earlierPaths]
|
|
55
61
|
};
|
|
56
62
|
}
|
|
57
63
|
static checkpointOfVersion1(value) {
|
|
58
|
-
const reader =
|
|
59
|
-
reader.refuseOtherFields(CheckpointRecord.VERSION_1_CHECKPOINT_FIELDS);
|
|
64
|
+
const reader = StoreFormat.read(value, Resources.checkpointModel, CheckpointRecord.VERSION_1_CHECKPOINT_FIELDS);
|
|
60
65
|
const read = Checkpoint.fromJson({
|
|
61
|
-
[Resources.idField]: reader.
|
|
62
|
-
[Resources.timeField]: reader.
|
|
63
|
-
[Resources.modeField]: reader.
|
|
64
|
-
[Resources.labelField]: reader.
|
|
66
|
+
[Resources.idField]: reader.readValue(Resources.idField),
|
|
67
|
+
[Resources.timeField]: reader.readValue(Resources.timeField),
|
|
68
|
+
[Resources.modeField]: reader.readValue(Resources.modeField),
|
|
69
|
+
[Resources.labelField]: reader.readValue(Resources.labelField),
|
|
65
70
|
[Resources.unreadPathsField]: []
|
|
66
71
|
});
|
|
67
|
-
const unreadPaths =
|
|
72
|
+
const unreadPaths = StoreFormat.readArray(reader, Resources.unreadPathsField).map(t => CheckpointRecord.unreadPathOfVersion1(t));
|
|
68
73
|
return new Checkpoint(read.id, read.time, read.mode, read.label, unreadPaths);
|
|
69
74
|
}
|
|
70
75
|
static unreadPathOfVersion1(value) {
|
|
71
|
-
const reader =
|
|
72
|
-
reader.
|
|
73
|
-
return new UnreadPath(reader.readString(Resources.pathField), UnreadReason.fromJson(reader.read(Resources.reasonField)), null);
|
|
76
|
+
const reader = StoreFormat.read(value, Resources.unreadPathModel, CheckpointRecord.VERSION_1_UNREAD_PATH_FIELDS);
|
|
77
|
+
return new UnreadPath(reader.readString(Resources.pathField), UnreadReason.fromJson(reader.readValue(Resources.reasonField)), null);
|
|
74
78
|
}
|
|
75
79
|
}
|
|
76
80
|
//# sourceMappingURL=checkpoint-record.js.map
|
|
@@ -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,EAAE,WAAW,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"checkpoint-record.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/checkpoint-record.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG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M,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"}
|
package/src/models/entry-kind.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* This source code is licensed under the license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
+
import "@noldova/context.core";
|
|
8
9
|
import { PathKind } from "@noldova/checkpoints.protocol";
|
|
9
10
|
import { UnknownEntryKindException } from "../exceptions/unknown-entry-kind.exception.js";
|
|
10
11
|
import { UnknownGitModeException } from "../exceptions/unknown-git-mode.exception.js";
|
|
@@ -31,13 +32,13 @@ export class EntryKind {
|
|
|
31
32
|
}
|
|
32
33
|
static ofGitMode(mode) {
|
|
33
34
|
const kind = EntryKind.ALL.find(t => t.gitMode === mode);
|
|
34
|
-
if (kind
|
|
35
|
+
if (Object.isUndefined(kind))
|
|
35
36
|
throw new UnknownGitModeException(mode);
|
|
36
37
|
return kind;
|
|
37
38
|
}
|
|
38
39
|
static fromJson(value) {
|
|
39
40
|
const kind = EntryKind.ALL.find(t => t.value === value);
|
|
40
|
-
if (kind
|
|
41
|
+
if (Object.isUndefined(kind))
|
|
41
42
|
throw new UnknownEntryKindException(String(value));
|
|
42
43
|
return kind;
|
|
43
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-kind.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/entry-kind.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,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5,7 @@
|
|
|
5
5
|
* This source code is licensed under the license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
8
|
+
import "@noldova/context.core";
|
|
9
9
|
import { Resources } from "../resources.js";
|
|
10
10
|
import { StoreFormat } from "../services/store-format.js";
|
|
11
11
|
import { IndexEntry } from "./index-entry.js";
|
|
@@ -21,14 +21,16 @@ export class FolderIndex {
|
|
|
21
21
|
this.start = start;
|
|
22
22
|
}
|
|
23
23
|
static fromJson(value) {
|
|
24
|
-
const reader =
|
|
25
|
-
reader.refuseOtherFields(FolderIndex.FIELDS);
|
|
24
|
+
const reader = StoreFormat.read(value, Resources.folderIndexModel, FolderIndex.FIELDS);
|
|
26
25
|
StoreFormat.check(reader);
|
|
27
|
-
return new FolderIndex(BigInt(reader.readString(Resources.startField)),
|
|
26
|
+
return new FolderIndex(BigInt(reader.readString(Resources.startField)), StoreFormat.readArray(reader, Resources.entriesField).map(t => IndexEntry.fromJson(t)));
|
|
27
|
+
}
|
|
28
|
+
find(path) {
|
|
29
|
+
return this.byPath.get(path) ?? null;
|
|
28
30
|
}
|
|
29
31
|
findUnchanged(entry) {
|
|
30
32
|
const known = this.byPath.get(entry.path);
|
|
31
|
-
return known
|
|
33
|
+
return !Object.isUndefined(known) && known.matches(entry, this.start - Resources.racyWindowNanoseconds) ? known : null;
|
|
32
34
|
}
|
|
33
35
|
toJson() {
|
|
34
36
|
return {
|
|
@@ -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,
|
|
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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AAM,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,aAAa;YACvD,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAC1C,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"}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* This source code is licensed under the license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import { JsonObjectReader } from "@noldova/checkpoints.protocol";
|
|
9
8
|
import { Resources } from "../resources.js";
|
|
10
9
|
import { StoreFormat } from "../services/store-format.js";
|
|
11
10
|
export class FolderRecord {
|
|
@@ -15,8 +14,7 @@ export class FolderRecord {
|
|
|
15
14
|
this.path = path;
|
|
16
15
|
}
|
|
17
16
|
static fromJson(value) {
|
|
18
|
-
const reader =
|
|
19
|
-
reader.refuseOtherFields(FolderRecord.FIELDS);
|
|
17
|
+
const reader = StoreFormat.read(value, Resources.folderRecordModel, FolderRecord.FIELDS);
|
|
20
18
|
StoreFormat.check(reader);
|
|
21
19
|
return new FolderRecord(reader.readString(Resources.pathField));
|
|
22
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folder-record.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/folder-record.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"folder-record.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/folder-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,kBAAkB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxF,IAAI,CAAS;IAE7B,YAAmB,IAAY;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;QACzF,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC1B,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAClE,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,SAAS,CAAC,aAAa,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IACvG,CAAC;CACF"}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* This source code is licensed under the license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import { JsonObjectReader } from "@noldova/checkpoints.protocol";
|
|
9
8
|
import { Resources } from "../resources.js";
|
|
10
9
|
import { StoreFormat } from "../services/store-format.js";
|
|
11
10
|
export class HousekeepingRecord {
|
|
@@ -15,8 +14,7 @@ export class HousekeepingRecord {
|
|
|
15
14
|
this.fullPass = fullPass;
|
|
16
15
|
}
|
|
17
16
|
static fromJson(value) {
|
|
18
|
-
const reader =
|
|
19
|
-
reader.refuseOtherFields(HousekeepingRecord.FIELDS);
|
|
17
|
+
const reader = StoreFormat.read(value, Resources.housekeepingRecordModel, HousekeepingRecord.FIELDS);
|
|
20
18
|
StoreFormat.check(reader);
|
|
21
19
|
return new HousekeepingRecord(reader.readNumber(Resources.fullPassField));
|
|
22
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"housekeeping-record.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/housekeeping-record.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"housekeeping-record.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/housekeeping-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,kBAAkB;IACrB,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,kBAAkB,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IAC5F,QAAQ,CAAS;IAEjC,YAAmB,QAAgB;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;QACrG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC1B,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5E,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,SAAS,CAAC,aAAa,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC/G,CAAC;CACF"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* This source code is licensed under the license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
+
import "@noldova/context.core";
|
|
8
9
|
import { Resources } from "../resources.js";
|
|
9
10
|
import { IgnorePattern } from "./ignore-pattern.js";
|
|
10
11
|
export class IgnoreFile {
|
|
@@ -18,7 +19,7 @@ export class IgnoreFile {
|
|
|
18
19
|
this.base = IgnoreFile.bytesOf(folderPath);
|
|
19
20
|
this.content = content;
|
|
20
21
|
this.folderPath = folderPath;
|
|
21
|
-
this.patterns = text.toString(Resources.latin1Encoding).split(Resources.lineFeed).map(t => IgnorePattern.parse(t, ignoresCase)).filter(t => t
|
|
22
|
+
this.patterns = text.toString(Resources.latin1Encoding).split(Resources.lineFeed).map(t => IgnorePattern.parse(t, ignoresCase)).filter(t => !Object.isNull(t));
|
|
22
23
|
}
|
|
23
24
|
static bytesOf(text) {
|
|
24
25
|
return Buffer.from(text, Resources.utf8Encoding).toString(Resources.latin1Encoding);
|
|
@@ -26,7 +27,7 @@ export class IgnoreFile {
|
|
|
26
27
|
decide(path, name, isFolder) {
|
|
27
28
|
const relativePath = this.base === "" ? path : path.slice(this.base.length + 1);
|
|
28
29
|
const pattern = this.patterns.findLast(t => t.matches(relativePath, name, isFolder));
|
|
29
|
-
return pattern
|
|
30
|
+
return Object.isUndefined(pattern) ? null : !pattern.isNegated;
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
//# sourceMappingURL=ignore-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore-file.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/ignore-file.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,OAAO,UAAU;IACJ,IAAI,CAAS;IACb,QAAQ,CAA2B;IACpC,OAAO,CAAS;IAChB,UAAU,CAAS;IAEnC,YAAmB,UAAkB,EAAE,OAAe,EAAE,WAAoB;QAC1E,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QACnG,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3E,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"ignore-file.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/ignore-file.ts"],"names":[],"mappings":"AAAA;;;;;;GA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AM,CAAC,IAAY,EAAE,IAAY,EAAE,QAAiB;QACzD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAChF,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;QACrF,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IACjE,CAAC;CACF"}
|
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
* This source code is licensed under the license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import { JsonObjectReader } from "@noldova/checkpoints.protocol";
|
|
9
|
-
import { StoreFieldNotABooleanException } from "../exceptions/store-field-not-a-boolean.exception.js";
|
|
10
8
|
import { Resources } from "../resources.js";
|
|
11
9
|
import { StoreFormat } from "../services/store-format.js";
|
|
12
10
|
export class IgnoreRecord {
|
|
@@ -18,12 +16,8 @@ export class IgnoreRecord {
|
|
|
18
16
|
this.repositoryFolders = [...repositoryFolders];
|
|
19
17
|
}
|
|
20
18
|
static fromJson(value) {
|
|
21
|
-
const reader =
|
|
22
|
-
reader.
|
|
23
|
-
const ignoresCase = reader.read(Resources.ignoresCaseField);
|
|
24
|
-
if (typeof ignoresCase !== "boolean")
|
|
25
|
-
throw new StoreFieldNotABooleanException(Resources.ignoresCaseField);
|
|
26
|
-
return new IgnoreRecord(ignoresCase, StoreFormat.readStringList(reader, Resources.repositoryFoldersField));
|
|
19
|
+
const reader = StoreFormat.read(value, Resources.ignoreRecordModel, IgnoreRecord.FIELDS);
|
|
20
|
+
return new IgnoreRecord(reader.readBoolean(Resources.ignoresCaseField), reader.readStringArray(Resources.repositoryFoldersField));
|
|
27
21
|
}
|
|
28
22
|
toJson() {
|
|
29
23
|
return { [Resources.ignoresCaseField]: this.ignoresCase, [Resources.repositoryFoldersField]: [...this.repositoryFolders] };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore-record.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints/src/models/ignore-record.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
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,sBAAsB,CAAC,CAAC;IACnG,WAAW,CAAU;IACrB,iBAAiB,CAAoB;IAErD,YAAmB,WAAoB,EAAE,iBAAoC;QAC3E,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,iBAAiB,GAAG,CAAC,GAAG,iBAAiB,CAAC,CAAC;IAClD,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;QACzF,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC,CAAC;IACpI,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC,sBAAsB,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAC7H,CAAC;CACF"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* This source code is licensed under the license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
+
import "@noldova/context.core";
|
|
8
9
|
import { Resources } from "../resources.js";
|
|
9
10
|
import { IgnoreFile } from "./ignore-file.js";
|
|
10
11
|
export class IgnoreRules {
|
|
@@ -39,7 +40,7 @@ export class IgnoreRules {
|
|
|
39
40
|
do {
|
|
40
41
|
folder = folder.slice(0, Math.max(folder.lastIndexOf(Resources.relativePathSeparator), 0));
|
|
41
42
|
const decision = this.fileMap.get(folder)?.decide(bytes, name, isFolder) ?? null;
|
|
42
|
-
if (decision
|
|
43
|
+
if (!Object.isNull(decision))
|
|
43
44
|
return decision;
|
|
44
45
|
} while (folder !== "" && !this.repositoryFolderSet.has(folder));
|
|
45
46
|
return false;
|
|
@@ -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,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;IAC9C,WAAW,CAAU;IAErC,YAAmB,WAAoB;QACrC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,IAAW,KAAK;QACd,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC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qBAAqB,EAAE,GAAG,GAAG,CAAC,CAAC;YAClI,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC;gBAC1C,OAAO,IAAI,CAAC;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;IAEM,SAAS,CAAC,IAAY,EAAE,QAAiB;QAC9C,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;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"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* This source code is licensed under the license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import { JsonObjectReader } from "@noldova/checkpoints.protocol";
|
|
9
8
|
import { Resources } from "../resources.js";
|
|
9
|
+
import { StoreFormat } from "../services/store-format.js";
|
|
10
10
|
import { EntryKind } from "./entry-kind.js";
|
|
11
11
|
export class IndexEntry {
|
|
12
12
|
static FIELDS = [
|
|
@@ -30,9 +30,8 @@ export class IndexEntry {
|
|
|
30
30
|
this.size = size;
|
|
31
31
|
}
|
|
32
32
|
static fromJson(value) {
|
|
33
|
-
const reader =
|
|
34
|
-
reader.
|
|
35
|
-
return new IndexEntry(reader.readString(Resources.pathField), EntryKind.fromJson(reader.read(Resources.kindField)), Number(BigInt(reader.readString(Resources.sizeField))), BigInt(reader.readString(Resources.modifiedField)), BigInt(reader.readString(Resources.changedField)), reader.readString(Resources.fileIdField), reader.readString(Resources.objectIdField));
|
|
33
|
+
const reader = StoreFormat.read(value, Resources.indexEntryModel, IndexEntry.FIELDS);
|
|
34
|
+
return new IndexEntry(reader.readString(Resources.pathField), EntryKind.fromJson(reader.readValue(Resources.kindField)), Number(BigInt(reader.readString(Resources.sizeField))), BigInt(reader.readString(Resources.modifiedField)), BigInt(reader.readString(Resources.changedField)), reader.readString(Resources.fileIdField), reader.readString(Resources.objectIdField));
|
|
36
35
|
}
|
|
37
36
|
static of(entry, objectId) {
|
|
38
37
|
return new IndexEntry(entry.path, entry.kind, entry.size, entry.modified, entry.changed, entry.fileId, objectId);
|