@noldova/checkpoints.protocol 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 +3 -2
- package/package.json +5 -3
- package/src/api/index.d.ts +248 -535
- package/src/api/index.js +3 -11
- package/src/api/index.js.map +1 -1
- package/src/exceptions/{missing-field.exception.js → capture-content-mismatch.exception.js} +6 -8
- package/src/exceptions/capture-content-mismatch.exception.js.map +1 -0
- package/src/exceptions/{not-an-object.exception.js → earlier-paths-mismatch.exception.js} +6 -6
- package/src/exceptions/earlier-paths-mismatch.exception.js.map +1 -0
- package/src/exceptions/{field-not-a-list.exception.js → restore-content-mismatch.exception.js} +6 -8
- package/src/exceptions/restore-content-mismatch.exception.js.map +1 -0
- package/src/models/capture-mode.js +2 -1
- package/src/models/capture-mode.js.map +1 -1
- package/src/models/capture-outcome.js +4 -2
- package/src/models/capture-outcome.js.map +1 -1
- package/src/models/capture-paused-event.js +2 -3
- package/src/models/capture-paused-event.js.map +1 -1
- package/src/models/capture-request.js +17 -8
- package/src/models/capture-request.js.map +1 -1
- package/src/models/capture-result.js +26 -13
- package/src/models/capture-result.js.map +1 -1
- package/src/models/capture-resumed-event.js +2 -3
- package/src/models/capture-resumed-event.js.map +1 -1
- package/src/models/change-side.js +6 -6
- package/src/models/change-side.js.map +1 -1
- package/src/models/change-status.js +2 -1
- package/src/models/change-status.js.map +1 -1
- package/src/models/change.js +12 -12
- package/src/models/change.js.map +1 -1
- package/src/models/checkpoint-list.js +3 -4
- package/src/models/checkpoint-list.js.map +1 -1
- package/src/models/checkpoint.js +5 -9
- package/src/models/checkpoint.js.map +1 -1
- package/src/models/compare-outcome.js +2 -1
- package/src/models/compare-outcome.js.map +1 -1
- package/src/models/compare-request.js +5 -5
- package/src/models/compare-request.js.map +1 -1
- package/src/models/compare-result.js +3 -4
- package/src/models/compare-result.js.map +1 -1
- package/src/models/delete-folder-outcome.js +2 -1
- package/src/models/delete-folder-outcome.js.map +1 -1
- package/src/models/delete-folder-request.js +3 -4
- package/src/models/delete-folder-request.js.map +1 -1
- package/src/models/delete-folder-result.js +3 -4
- package/src/models/delete-folder-result.js.map +1 -1
- package/src/models/diff-target.js +5 -5
- package/src/models/diff-target.js.map +1 -1
- package/src/models/folder-reference.js +2 -3
- package/src/models/folder-reference.js.map +1 -1
- package/src/models/folder-usage.js +5 -5
- package/src/models/folder-usage.js.map +1 -1
- package/src/models/keep-reason.js +4 -2
- package/src/models/keep-reason.js.map +1 -1
- package/src/models/kept-path.js +3 -4
- package/src/models/kept-path.js.map +1 -1
- package/src/models/list-request.js +3 -4
- package/src/models/list-request.js.map +1 -1
- package/src/models/path-kind.js +2 -1
- package/src/models/path-kind.js.map +1 -1
- package/src/models/preview-outcome.js +2 -1
- package/src/models/preview-outcome.js.map +1 -1
- package/src/models/preview-request.js +3 -4
- package/src/models/preview-request.js.map +1 -1
- package/src/models/preview-result.js +7 -7
- package/src/models/preview-result.js.map +1 -1
- package/src/models/read-outcome.js +2 -1
- package/src/models/read-outcome.js.map +1 -1
- package/src/models/read-request.js +6 -6
- package/src/models/read-request.js.map +1 -1
- package/src/models/read-result.js +3 -4
- package/src/models/read-result.js.map +1 -1
- package/src/models/restore-action.js +2 -1
- package/src/models/restore-action.js.map +1 -1
- package/src/models/restore-held-up-event.js +3 -4
- package/src/models/restore-held-up-event.js.map +1 -1
- package/src/models/restore-outcome.js +5 -2
- package/src/models/restore-outcome.js.map +1 -1
- package/src/models/restore-plan.js +15 -7
- package/src/models/restore-plan.js.map +1 -1
- package/src/models/restore-request.js +3 -4
- package/src/models/restore-request.js.map +1 -1
- package/src/models/restore-result.js +27 -11
- package/src/models/restore-result.js.map +1 -1
- package/src/models/restore-step.js +9 -9
- package/src/models/restore-step.js.map +1 -1
- package/src/models/restored-event.js +2 -3
- package/src/models/restored-event.js.map +1 -1
- package/src/models/storage-list.js +3 -4
- package/src/models/storage-list.js.map +1 -1
- package/src/models/storage-request.js +2 -2
- package/src/models/storage-request.js.map +1 -1
- package/src/models/unread-path.js +5 -5
- package/src/models/unread-path.js.map +1 -1
- package/src/models/unread-reason.js +4 -2
- package/src/models/unread-reason.js.map +1 -1
- package/src/resources.js +20 -32
- package/src/resources.js.map +1 -1
- package/src/services/scope-paths.js +3 -2
- package/src/services/scope-paths.js.map +1 -1
- package/src/services/wire-form.js +43 -0
- package/src/services/wire-form.js.map +1 -0
- package/src/exceptions/field-not-a-boolean.exception.js +0 -19
- package/src/exceptions/field-not-a-boolean.exception.js.map +0 -1
- package/src/exceptions/field-not-a-list.exception.js.map +0 -1
- package/src/exceptions/field-not-a-number-or-null.exception.js +0 -19
- package/src/exceptions/field-not-a-number-or-null.exception.js.map +0 -1
- package/src/exceptions/field-not-a-number.exception.js +0 -19
- package/src/exceptions/field-not-a-number.exception.js.map +0 -1
- package/src/exceptions/field-not-a-string-list.exception.js +0 -19
- package/src/exceptions/field-not-a-string-list.exception.js.map +0 -1
- package/src/exceptions/field-not-a-string-or-null.exception.js +0 -19
- package/src/exceptions/field-not-a-string-or-null.exception.js.map +0 -1
- package/src/exceptions/field-not-a-string.exception.js +0 -19
- package/src/exceptions/field-not-a-string.exception.js.map +0 -1
- package/src/exceptions/missing-field.exception.js.map +0 -1
- package/src/exceptions/not-an-object.exception.js.map +0 -1
- package/src/exceptions/unknown-field.exception.js +0 -19
- package/src/exceptions/unknown-field.exception.js.map +0 -1
- package/src/services/json-object.reader.js +0 -89
- package/src/services/json-object.reader.js.map +0 -1
- package/src/types/json-object.js +0 -9
- package/src/types/json-object.js.map +0 -1
- package/src/types/json-value.js +0 -9
- package/src/types/json-value.js.map +0 -1
package/src/api/index.js
CHANGED
|
@@ -6,17 +6,12 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
export { CaptureCheckpointMismatchException } from "../exceptions/capture-checkpoint-mismatch.exception.js";
|
|
9
|
+
export { CaptureContentMismatchException } from "../exceptions/capture-content-mismatch.exception.js";
|
|
9
10
|
export { CaptureSpaceMismatchException } from "../exceptions/capture-space-mismatch.exception.js";
|
|
10
11
|
export { ChangeSidesMismatchException } from "../exceptions/change-sides-mismatch.exception.js";
|
|
11
12
|
export { CompareChangesMismatchException } from "../exceptions/compare-changes-mismatch.exception.js";
|
|
12
13
|
export { ContentTooLongException } from "../exceptions/content-too-long.exception.js";
|
|
13
|
-
export {
|
|
14
|
-
export { FieldNotAListException } from "../exceptions/field-not-a-list.exception.js";
|
|
15
|
-
export { FieldNotANumberOrNullException } from "../exceptions/field-not-a-number-or-null.exception.js";
|
|
16
|
-
export { FieldNotANumberException } from "../exceptions/field-not-a-number.exception.js";
|
|
17
|
-
export { FieldNotAStringListException } from "../exceptions/field-not-a-string-list.exception.js";
|
|
18
|
-
export { FieldNotAStringOrNullException } from "../exceptions/field-not-a-string-or-null.exception.js";
|
|
19
|
-
export { FieldNotAStringException } from "../exceptions/field-not-a-string.exception.js";
|
|
14
|
+
export { EarlierPathsMismatchException } from "../exceptions/earlier-paths-mismatch.exception.js";
|
|
20
15
|
export { InvalidBase64Exception } from "../exceptions/invalid-base64.exception.js";
|
|
21
16
|
export { InvalidCheckpointIdException } from "../exceptions/invalid-checkpoint-id.exception.js";
|
|
22
17
|
export { InvalidDateException } from "../exceptions/invalid-date.exception.js";
|
|
@@ -28,13 +23,12 @@ export { InvalidRelativePathException } from "../exceptions/invalid-relative-pat
|
|
|
28
23
|
export { InvalidSizeException } from "../exceptions/invalid-size.exception.js";
|
|
29
24
|
export { InvalidTimeException } from "../exceptions/invalid-time.exception.js";
|
|
30
25
|
export { LabelTooLongException } from "../exceptions/label-too-long.exception.js";
|
|
31
|
-
export { MissingFieldException } from "../exceptions/missing-field.exception.js";
|
|
32
|
-
export { NotAnObjectException } from "../exceptions/not-an-object.exception.js";
|
|
33
26
|
export { PreviewPlanMismatchException } from "../exceptions/preview-plan-mismatch.exception.js";
|
|
34
27
|
export { ProtocolException } from "../exceptions/protocol.exception.js";
|
|
35
28
|
export { ReadCutMismatchException } from "../exceptions/read-cut-mismatch.exception.js";
|
|
36
29
|
export { ReadOutcomeMismatchException } from "../exceptions/read-outcome-mismatch.exception.js";
|
|
37
30
|
export { RestoreCheckpointsMismatchException } from "../exceptions/restore-checkpoints-mismatch.exception.js";
|
|
31
|
+
export { RestoreContentMismatchException } from "../exceptions/restore-content-mismatch.exception.js";
|
|
38
32
|
export { SideSizeMismatchException } from "../exceptions/side-size-mismatch.exception.js";
|
|
39
33
|
export { StepSidesMismatchException } from "../exceptions/step-sides-mismatch.exception.js";
|
|
40
34
|
export { UnknownCaptureModeException } from "../exceptions/unknown-capture-mode.exception.js";
|
|
@@ -42,7 +36,6 @@ export { UnknownCaptureOutcomeException } from "../exceptions/unknown-capture-ou
|
|
|
42
36
|
export { UnknownChangeStatusException } from "../exceptions/unknown-change-status.exception.js";
|
|
43
37
|
export { UnknownCompareOutcomeException } from "../exceptions/unknown-compare-outcome.exception.js";
|
|
44
38
|
export { UnknownDeleteFolderOutcomeException } from "../exceptions/unknown-delete-folder-outcome.exception.js";
|
|
45
|
-
export { UnknownFieldException } from "../exceptions/unknown-field.exception.js";
|
|
46
39
|
export { UnknownKeepReasonException } from "../exceptions/unknown-keep-reason.exception.js";
|
|
47
40
|
export { UnknownPathKindException } from "../exceptions/unknown-path-kind.exception.js";
|
|
48
41
|
export { UnknownPreviewOutcomeException } from "../exceptions/unknown-preview-outcome.exception.js";
|
|
@@ -94,5 +87,4 @@ export { StorageList } from "../models/storage-list.js";
|
|
|
94
87
|
export { StorageRequest } from "../models/storage-request.js";
|
|
95
88
|
export { UnreadPath } from "../models/unread-path.js";
|
|
96
89
|
export { UnreadReason } from "../models/unread-reason.js";
|
|
97
|
-
export { JsonObjectReader } from "../services/json-object.reader.js";
|
|
98
90
|
//# sourceMappingURL=index.js.map
|
package/src/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kCAAkC,EAAE,MAAM,wDAAwD,CAAC;AAC5G,OAAO,EAAE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kCAAkC,EAAE,MAAM,wDAAwD,CAAC;AAC5G,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,4BAA4B,EAAE,M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M,8BAA8B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -7,13 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Resources } from "../resources.js";
|
|
9
9
|
import { ProtocolException } from "./protocol.exception.js";
|
|
10
|
-
export class
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.field = field;
|
|
16
|
-
this.model = model;
|
|
10
|
+
export class CaptureContentMismatchException extends ProtocolException {
|
|
11
|
+
outcome;
|
|
12
|
+
constructor(outcome) {
|
|
13
|
+
super(Resources.formatContentMismatch(outcome.value));
|
|
14
|
+
this.outcome = outcome;
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=capture-content-mismatch.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture-content-mismatch.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/capture-content-mismatch.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,+BAAgC,SAAQ,iBAAiB;IACpD,OAAO,CAAiB;IAExC,YAAmB,OAAuB;QACxC,KAAK,CAAC,SAAS,CAAC,qBAAqB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAEtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Resources } from "../resources.js";
|
|
9
9
|
import { ProtocolException } from "./protocol.exception.js";
|
|
10
|
-
export class
|
|
11
|
-
|
|
12
|
-
constructor(
|
|
13
|
-
super(Resources.
|
|
14
|
-
this.
|
|
10
|
+
export class EarlierPathsMismatchException extends ProtocolException {
|
|
11
|
+
path;
|
|
12
|
+
constructor(path) {
|
|
13
|
+
super(Resources.formatEarlierPathsMismatch(path));
|
|
14
|
+
this.path = path;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=earlier-paths-mismatch.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"earlier-paths-mismatch.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/earlier-paths-mismatch.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,6BAA8B,SAAQ,iBAAiB;IAClD,IAAI,CAAS;IAE7B,YAAmB,IAAY;QAC7B,KAAK,CAAC,SAAS,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC;QAElD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
|
package/src/exceptions/{field-not-a-list.exception.js → restore-content-mismatch.exception.js}
RENAMED
|
@@ -7,13 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Resources } from "../resources.js";
|
|
9
9
|
import { ProtocolException } from "./protocol.exception.js";
|
|
10
|
-
export class
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.field = field;
|
|
16
|
-
this.model = model;
|
|
10
|
+
export class RestoreContentMismatchException extends ProtocolException {
|
|
11
|
+
outcome;
|
|
12
|
+
constructor(outcome) {
|
|
13
|
+
super(Resources.formatRestoreContentMismatch(outcome.value));
|
|
14
|
+
this.outcome = outcome;
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=restore-content-mismatch.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore-content-mismatch.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/restore-content-mismatch.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,+BAAgC,SAAQ,iBAAiB;IACpD,OAAO,CAAiB;IAExC,YAAmB,OAAuB;QACxC,KAAK,CAAC,SAAS,CAAC,4BAA4B,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAE7D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,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 { UnknownCaptureModeException } from "../exceptions/unknown-capture-mode.exception.js";
|
|
9
10
|
export class CaptureMode {
|
|
10
11
|
static EveryFile = new CaptureMode("EveryFile");
|
|
@@ -16,7 +17,7 @@ export class CaptureMode {
|
|
|
16
17
|
}
|
|
17
18
|
static fromJson(value) {
|
|
18
19
|
const mode = CaptureMode.ALL.find(t => t.value === value);
|
|
19
|
-
if (mode
|
|
20
|
+
if (Object.isUndefined(mode))
|
|
20
21
|
throw new UnknownCaptureModeException(String(value));
|
|
21
22
|
return mode;
|
|
22
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-mode.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/capture-mode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAE9F,MAAM,OAAO,WAAW;IACf,MAAM,CAAU,SAAS,GAAgB,IAAI,WAAW,CAAC,WAAW,CAAC,CAAC;IACtE,MAAM,CAAU,WAAW,GAAgB,IAAI,WAAW,CAAC,aAAa,CAAC,CAAC;IACzE,MAAM,CAAU,GAAG,GAA2B,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACvF,KAAK,CAAS;IAE9B,YAAoB,KAAa;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAC1D,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"capture-mode.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/capture-mode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAE9F,MAAM,OAAO,WAAW;IACf,MAAM,CAAU,SAAS,GAAgB,IAAI,WAAW,CAAC,WAAW,CAAC,CAAC;IACtE,MAAM,CAAU,WAAW,GAAgB,IAAI,WAAW,CAAC,aAAa,CAAC,CAAC;IACzE,MAAM,CAAU,GAAG,GAA2B,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACvF,KAAK,CAAS;IAE9B,YAAoB,KAAa;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAC1D,IAAI,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;YAC1B,MAAM,IAAI,2BAA2B,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -5,13 +5,15 @@
|
|
|
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 { UnknownCaptureOutcomeException } from "../exceptions/unknown-capture-outcome.exception.js";
|
|
9
10
|
export class CaptureOutcome {
|
|
10
11
|
static Captured = new CaptureOutcome("Captured", true);
|
|
11
12
|
static FolderMissing = new CaptureOutcome("FolderMissing", false);
|
|
12
13
|
static HeldUp = new CaptureOutcome("HeldUp", false);
|
|
13
14
|
static LowDiskSpace = new CaptureOutcome("LowDiskSpace", false);
|
|
14
|
-
static
|
|
15
|
+
static TooLarge = new CaptureOutcome("TooLarge", false);
|
|
16
|
+
static ALL = [CaptureOutcome.Captured, CaptureOutcome.FolderMissing, CaptureOutcome.HeldUp, CaptureOutcome.LowDiskSpace, CaptureOutcome.TooLarge];
|
|
15
17
|
isCaptured;
|
|
16
18
|
value;
|
|
17
19
|
constructor(value, isCaptured) {
|
|
@@ -20,7 +22,7 @@ export class CaptureOutcome {
|
|
|
20
22
|
}
|
|
21
23
|
static fromJson(value) {
|
|
22
24
|
const outcome = CaptureOutcome.ALL.find(t => t.value === value);
|
|
23
|
-
if (outcome
|
|
25
|
+
if (Object.isUndefined(outcome))
|
|
24
26
|
throw new UnknownCaptureOutcomeException(String(value));
|
|
25
27
|
return outcome;
|
|
26
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-outcome.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/capture-outcome.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AAEpG,MAAM,OAAO,cAAc;IAClB,MAAM,CAAU,QAAQ,GAAmB,IAAI,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAChF,MAAM,CAAU,aAAa,GAAmB,IAAI,cAAc,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IAC3F,MAAM,CAAU,MAAM,GAAmB,IAAI,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC7E,MAAM,CAAU,YAAY,GAAmB,IAAI,cAAc,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"capture-outcome.js","sourceRoot":"","sources":["../../../../../src/noldova.check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;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { Resources } from "../resources.js";
|
|
9
9
|
import { ByteSize } from "../services/byte-size.js";
|
|
10
10
|
import { FolderIdentity } from "../services/folder-identity.js";
|
|
11
|
-
import {
|
|
11
|
+
import { WireForm } from "../services/wire-form.js";
|
|
12
12
|
export class CapturePausedEvent {
|
|
13
13
|
static event = Resources.capturePausedEvent;
|
|
14
14
|
static FIELDS = [Resources.identityField, Resources.spaceFreeField, Resources.spaceNeededField];
|
|
@@ -24,8 +24,7 @@ export class CapturePausedEvent {
|
|
|
24
24
|
this.spaceNeeded = spaceNeeded;
|
|
25
25
|
}
|
|
26
26
|
static fromJson(value) {
|
|
27
|
-
const reader =
|
|
28
|
-
reader.refuseOtherFields(CapturePausedEvent.FIELDS);
|
|
27
|
+
const reader = WireForm.read(value, Resources.capturePausedEventModel, CapturePausedEvent.FIELDS);
|
|
29
28
|
return new CapturePausedEvent(reader.readString(Resources.identityField), reader.readNumber(Resources.spaceFreeField), reader.readNumber(Resources.spaceNeededField));
|
|
30
29
|
}
|
|
31
30
|
toJson() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-paused-event.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/capture-paused-event.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"capture-paused-event.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/capture-paused-event.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,MAAM,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
|
|
|
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";
|
|
9
|
+
import { InvalidDateException } from "../exceptions/invalid-date.exception.js";
|
|
8
10
|
import { LabelTooLongException } from "../exceptions/label-too-long.exception.js";
|
|
9
11
|
import { Resources } from "../resources.js";
|
|
10
|
-
import {
|
|
12
|
+
import { WireForm } from "../services/wire-form.js";
|
|
11
13
|
import { FolderReference } from "./folder-reference.js";
|
|
12
14
|
export class CaptureRequest {
|
|
13
15
|
static method = Resources.captureMethod;
|
|
14
|
-
static FIELDS = [Resources.folderField, Resources.labelField];
|
|
16
|
+
static FIELDS = [Resources.folderField, Resources.labelField, Resources.asOfField];
|
|
17
|
+
asOf;
|
|
15
18
|
folder;
|
|
16
19
|
label;
|
|
17
|
-
constructor(folder, label) {
|
|
18
|
-
if (label
|
|
20
|
+
constructor(folder, label, asOf = null) {
|
|
21
|
+
if (!Object.isNull(label) && label.length > Resources.maximumLabelLength)
|
|
19
22
|
throw new LabelTooLongException(label.length);
|
|
23
|
+
if (!Object.isNull(asOf) && Number.isNaN(asOf.getTime()))
|
|
24
|
+
throw new InvalidDateException();
|
|
25
|
+
this.asOf = Object.isNull(asOf) ? null : new Date(asOf.getTime());
|
|
20
26
|
this.folder = folder;
|
|
21
27
|
this.label = label;
|
|
22
28
|
}
|
|
23
29
|
static fromJson(value) {
|
|
24
|
-
const reader =
|
|
25
|
-
reader.
|
|
26
|
-
return new CaptureRequest(FolderReference.fromJson(reader.read(Resources.folderField)), reader.readStringOrNull(Resources.labelField));
|
|
30
|
+
const reader = WireForm.read(value, Resources.captureRequestModel, CaptureRequest.FIELDS);
|
|
31
|
+
return new CaptureRequest(FolderReference.fromJson(reader.readValue(Resources.folderField)), reader.readNullableString(Resources.labelField), WireForm.readNullableTime(reader, Resources.asOfField));
|
|
27
32
|
}
|
|
28
33
|
toJson() {
|
|
29
|
-
return {
|
|
34
|
+
return {
|
|
35
|
+
[Resources.folderField]: this.folder.toJson(),
|
|
36
|
+
[Resources.labelField]: this.label,
|
|
37
|
+
[Resources.asOfField]: Object.isNull(this.asOf) ? null : this.asOf.toISOString()
|
|
38
|
+
};
|
|
30
39
|
}
|
|
31
40
|
}
|
|
32
41
|
//# sourceMappingURL=capture-request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/capture-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"capture-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/capture-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAG/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,OAAO,cAAc;IAClB,MAAM,CAAU,MAAM,GAAW,SAAS,CAAC,aAAa,CAAC;IACxD,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACvG,IAAI,CAAc;IAClB,MAAM,CAAkB;IACxB,KAAK,CAAgB;IAErC,YAAmB,MAAuB,EAAE,KAAoB,EAAE,IAAI,GAAgB,IAAI;QACxF,IAAI,CAAC,MAAM,CAAC,MA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AC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;SACjF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -5,45 +5,58 @@
|
|
|
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 { CaptureCheckpointMismatchException } from "../exceptions/capture-checkpoint-mismatch.exception.js";
|
|
10
|
+
import { CaptureContentMismatchException } from "../exceptions/capture-content-mismatch.exception.js";
|
|
9
11
|
import { CaptureSpaceMismatchException } from "../exceptions/capture-space-mismatch.exception.js";
|
|
10
12
|
import { Resources } from "../resources.js";
|
|
11
13
|
import { ByteSize } from "../services/byte-size.js";
|
|
12
|
-
import {
|
|
14
|
+
import { WireForm } from "../services/wire-form.js";
|
|
13
15
|
import { CaptureOutcome } from "./capture-outcome.js";
|
|
14
16
|
import { Checkpoint } from "./checkpoint.js";
|
|
15
17
|
export class CaptureResult {
|
|
16
|
-
static FIELDS = [
|
|
18
|
+
static FIELDS = [
|
|
19
|
+
Resources.outcomeField, Resources.checkpointField, Resources.spaceFreeField, Resources.spaceNeededField, Resources.contentSizeField,
|
|
20
|
+
Resources.contentLimitField
|
|
21
|
+
];
|
|
17
22
|
checkpoint;
|
|
23
|
+
contentLimit;
|
|
24
|
+
contentSize;
|
|
18
25
|
outcome;
|
|
19
26
|
spaceFree;
|
|
20
27
|
spaceNeeded;
|
|
21
|
-
constructor(outcome, checkpoint, spaceFree, spaceNeeded) {
|
|
22
|
-
if (outcome.isCaptured !== (checkpoint
|
|
28
|
+
constructor(outcome, checkpoint, spaceFree, spaceNeeded, contentSize = null, contentLimit = null) {
|
|
29
|
+
if (outcome.isCaptured !== (!Object.isNull(checkpoint)))
|
|
23
30
|
throw new CaptureCheckpointMismatchException(outcome);
|
|
24
31
|
const sizes = [spaceFree, spaceNeeded];
|
|
25
|
-
if (sizes.some(t => (t
|
|
32
|
+
if (sizes.some(t => (!Object.isNull(t)) !== (outcome === CaptureOutcome.LowDiskSpace)))
|
|
26
33
|
throw new CaptureSpaceMismatchException(outcome);
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
const contents = [contentSize, contentLimit];
|
|
35
|
+
if (contents.some(t => (!Object.isNull(t)) !== (outcome === CaptureOutcome.TooLarge)))
|
|
36
|
+
throw new CaptureContentMismatchException(outcome);
|
|
37
|
+
for (const size of [...sizes, ...contents])
|
|
38
|
+
if (!Object.isNull(size))
|
|
29
39
|
ByteSize.check(size);
|
|
30
40
|
this.checkpoint = checkpoint;
|
|
41
|
+
this.contentLimit = contentLimit;
|
|
42
|
+
this.contentSize = contentSize;
|
|
31
43
|
this.outcome = outcome;
|
|
32
44
|
this.spaceFree = spaceFree;
|
|
33
45
|
this.spaceNeeded = spaceNeeded;
|
|
34
46
|
}
|
|
35
47
|
static fromJson(value) {
|
|
36
|
-
const reader =
|
|
37
|
-
reader.
|
|
38
|
-
|
|
39
|
-
return new CaptureResult(CaptureOutcome.fromJson(reader.read(Resources.outcomeField)), checkpoint === null ? null : Checkpoint.fromJson(checkpoint), reader.readNumberOrNull(Resources.spaceFreeField), reader.readNumberOrNull(Resources.spaceNeededField));
|
|
48
|
+
const reader = WireForm.read(value, Resources.captureResultModel, CaptureResult.FIELDS);
|
|
49
|
+
const checkpoint = reader.readValue(Resources.checkpointField);
|
|
50
|
+
return new CaptureResult(CaptureOutcome.fromJson(reader.readValue(Resources.outcomeField)), Object.isNull(checkpoint) ? null : Checkpoint.fromJson(checkpoint), WireForm.readNullableNumber(reader, Resources.spaceFreeField), WireForm.readNullableNumber(reader, Resources.spaceNeededField), WireForm.readNullableNumber(reader, Resources.contentSizeField), WireForm.readNullableNumber(reader, Resources.contentLimitField));
|
|
40
51
|
}
|
|
41
52
|
toJson() {
|
|
42
53
|
return {
|
|
43
54
|
[Resources.outcomeField]: this.outcome.toJson(),
|
|
44
|
-
[Resources.checkpointField]: this.checkpoint
|
|
55
|
+
[Resources.checkpointField]: Object.isNull(this.checkpoint) ? null : this.checkpoint.toJson(),
|
|
45
56
|
[Resources.spaceFreeField]: this.spaceFree,
|
|
46
|
-
[Resources.spaceNeededField]: this.spaceNeeded
|
|
57
|
+
[Resources.spaceNeededField]: this.spaceNeeded,
|
|
58
|
+
[Resources.contentSizeField]: this.contentSize,
|
|
59
|
+
[Resources.contentLimitField]: this.contentLimit
|
|
47
60
|
};
|
|
48
61
|
}
|
|
49
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-result.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/capture-result.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kCAAkC,EAAE,MAAM,wDAAwD,CAAC;AAC5G,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"capture-result.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/capture-result.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAG/B,OAAO,EAAE,kCAAkC,EAAE,MAAM,wDAAwD,CAAC;AAC5G,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CA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,CAAC,MAAM,EAAE;YAC/C,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;YAC7F,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,SAAS;YAC1C,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,WAAW;YAC9C,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,WAAW;YAC9C,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,YAAY;SACjD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Resources } from "../resources.js";
|
|
9
9
|
import { FolderIdentity } from "../services/folder-identity.js";
|
|
10
|
-
import {
|
|
10
|
+
import { WireForm } from "../services/wire-form.js";
|
|
11
11
|
export class CaptureResumedEvent {
|
|
12
12
|
static event = Resources.captureResumedEvent;
|
|
13
13
|
static FIELDS = [Resources.identityField];
|
|
@@ -17,8 +17,7 @@ export class CaptureResumedEvent {
|
|
|
17
17
|
this.identity = identity;
|
|
18
18
|
}
|
|
19
19
|
static fromJson(value) {
|
|
20
|
-
const reader =
|
|
21
|
-
reader.refuseOtherFields(CaptureResumedEvent.FIELDS);
|
|
20
|
+
const reader = WireForm.read(value, Resources.captureResumedEventModel, CaptureResumedEvent.FIELDS);
|
|
22
21
|
return new CaptureResumedEvent(reader.readString(Resources.identityField));
|
|
23
22
|
}
|
|
24
23
|
toJson() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-resumed-event.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/capture-resumed-event.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"capture-resumed-event.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/capture-resumed-event.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,MAAM,OAAO,mBAAmB;IACvB,MAAM,CAAU,KAAK,GAAW,SAAS,CAAC,mBAAmB,CAAC;IAC7D,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAC9D,QAAQ,CAAS;IAEjC,YAAmB,QAAgB;QACjC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACpG,OAAO,IAAI,mBAAmB,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;IAC7E,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;IACtD,CAAC;CACF"}
|
|
@@ -5,10 +5,11 @@
|
|
|
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 { SideSizeMismatchException } from "../exceptions/side-size-mismatch.exception.js";
|
|
9
10
|
import { Resources } from "../resources.js";
|
|
10
11
|
import { ByteSize } from "../services/byte-size.js";
|
|
11
|
-
import {
|
|
12
|
+
import { WireForm } from "../services/wire-form.js";
|
|
12
13
|
import { PathKind } from "./path-kind.js";
|
|
13
14
|
export class ChangeSide {
|
|
14
15
|
static FIELDS = [Resources.kindField, Resources.sizeField, Resources.isTextField];
|
|
@@ -16,18 +17,17 @@ export class ChangeSide {
|
|
|
16
17
|
kind;
|
|
17
18
|
size;
|
|
18
19
|
constructor(kind, size, isText) {
|
|
19
|
-
if ((kind === PathKind.Folder) !== (size
|
|
20
|
+
if ((kind === PathKind.Folder) !== (Object.isNull(size)) || kind === PathKind.Folder && isText)
|
|
20
21
|
throw new SideSizeMismatchException(kind);
|
|
21
|
-
if (size
|
|
22
|
+
if (!Object.isNull(size))
|
|
22
23
|
ByteSize.check(size);
|
|
23
24
|
this.isText = isText;
|
|
24
25
|
this.kind = kind;
|
|
25
26
|
this.size = size;
|
|
26
27
|
}
|
|
27
28
|
static fromJson(value) {
|
|
28
|
-
const reader =
|
|
29
|
-
reader.
|
|
30
|
-
return new ChangeSide(PathKind.fromJson(reader.read(Resources.kindField)), reader.readNumberOrNull(Resources.sizeField), reader.readBoolean(Resources.isTextField));
|
|
29
|
+
const reader = WireForm.read(value, Resources.changeSideModel, ChangeSide.FIELDS);
|
|
30
|
+
return new ChangeSide(PathKind.fromJson(reader.readValue(Resources.kindField)), WireForm.readNullableNumber(reader, Resources.sizeField), reader.readBoolean(Resources.isTextField));
|
|
31
31
|
}
|
|
32
32
|
toJson() {
|
|
33
33
|
return { [Resources.kindField]: this.kind.toJson(), [Resources.sizeField]: this.size, [Resources.isTextField]: this.isText };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-side.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/change-side.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0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,CAAC,eAAe,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QAClF,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,EACtI,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;IAC/C,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;IAC/H,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 { UnknownChangeStatusException } from "../exceptions/unknown-change-status.exception.js";
|
|
9
10
|
export class ChangeStatus {
|
|
10
11
|
static Added = new ChangeStatus("Added");
|
|
@@ -21,7 +22,7 @@ export class ChangeStatus {
|
|
|
21
22
|
}
|
|
22
23
|
static fromJson(value) {
|
|
23
24
|
const status = ChangeStatus.ALL.find(t => t.value === value);
|
|
24
|
-
if (status
|
|
25
|
+
if (Object.isUndefined(status))
|
|
25
26
|
throw new UnknownChangeStatusException(String(value));
|
|
26
27
|
return status;
|
|
27
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-status.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/change-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAEhG,MAAM,OAAO,YAAY;IAChB,MAAM,CAAU,KAAK,GAAiB,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;IAChE,MAAM,CAAU,OAAO,GAAiB,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;IACpE,MAAM,CAAU,QAAQ,GAAiB,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;IACtE,MAAM,CAAU,WAAW,GAAiB,IAAI,YAAY,CAAC,aAAa,CAAC,CAAC;IAC5E,MAAM,CAAU,OAAO,GAAiB,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;IACnE,MAAM,CAAU,GAAG,GAA4B;QACrD,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,QAAQ,EAAE,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,OAAO;KAChH,CAAC;IACc,KAAK,CAAS;IAE9B,YAAoB,KAAa;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAC7D,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"change-status.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/change-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAEhG,MAAM,OAAO,YAAY;IAChB,MAAM,CAAU,KAAK,GAAiB,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;IAChE,MAAM,CAAU,OAAO,GAAiB,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;IACpE,MAAM,CAAU,QAAQ,GAAiB,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;IACtE,MAAM,CAAU,WAAW,GAAiB,IAAI,YAAY,CAAC,aAAa,CAAC,CAAC;IAC5E,MAAM,CAAU,OAAO,GAAiB,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;IACnE,MAAM,CAAU,GAAG,GAA4B;QACrD,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,QAAQ,EAAE,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,OAAO;KAChH,CAAC;IACc,KAAK,CAAS;IAE9B,YAAoB,KAAa;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAC7D,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC;YAC5B,MAAM,IAAI,4BAA4B,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
package/src/models/change.js
CHANGED
|
@@ -5,12 +5,13 @@
|
|
|
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 { ChangeSidesMismatchException } from "../exceptions/change-sides-mismatch.exception.js";
|
|
9
10
|
import { InvalidRelativePathException } from "../exceptions/invalid-relative-path.exception.js";
|
|
10
11
|
import { UnreadReasonMismatchException } from "../exceptions/unread-reason-mismatch.exception.js";
|
|
11
12
|
import { Resources } from "../resources.js";
|
|
12
|
-
import { JsonObjectReader } from "../services/json-object.reader.js";
|
|
13
13
|
import { RelativePath } from "../services/relative-path.js";
|
|
14
|
+
import { WireForm } from "../services/wire-form.js";
|
|
14
15
|
import { ChangeSide } from "./change-side.js";
|
|
15
16
|
import { ChangeStatus } from "./change-status.js";
|
|
16
17
|
import { UnreadReason } from "./unread-reason.js";
|
|
@@ -26,9 +27,9 @@ export class Change {
|
|
|
26
27
|
constructor(path, status, before, after, unreadReason) {
|
|
27
28
|
if (!RelativePath.isValid(path))
|
|
28
29
|
throw new InvalidRelativePathException(path);
|
|
29
|
-
if (status !== ChangeStatus.Unknown && ((before
|
|
30
|
+
if (status !== ChangeStatus.Unknown && ((Object.isNull(before)) !== (status === ChangeStatus.Added) || (Object.isNull(after)) !== (status === ChangeStatus.Deleted)))
|
|
30
31
|
throw new ChangeSidesMismatchException(status);
|
|
31
|
-
if ((unreadReason
|
|
32
|
+
if ((!Object.isNull(unreadReason)) !== (status === ChangeStatus.Unknown))
|
|
32
33
|
throw new UnreadReasonMismatchException(status);
|
|
33
34
|
this.after = after;
|
|
34
35
|
this.before = before;
|
|
@@ -37,20 +38,19 @@ export class Change {
|
|
|
37
38
|
this.unreadReason = unreadReason;
|
|
38
39
|
}
|
|
39
40
|
static fromJson(value) {
|
|
40
|
-
const reader =
|
|
41
|
-
reader.
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
return new Change(reader.readString(Resources.pathField), ChangeStatus.fromJson(reader.read(Resources.statusField)), before === null ? null : ChangeSide.fromJson(before), after === null ? null : ChangeSide.fromJson(after), unreadReason === null ? null : UnreadReason.fromJson(unreadReason));
|
|
41
|
+
const reader = WireForm.read(value, Resources.changeModel, Change.FIELDS);
|
|
42
|
+
const before = reader.readValue(Resources.beforeField);
|
|
43
|
+
const after = reader.readValue(Resources.afterField);
|
|
44
|
+
const unreadReason = reader.readValue(Resources.unreadReasonField);
|
|
45
|
+
return new Change(reader.readString(Resources.pathField), ChangeStatus.fromJson(reader.readValue(Resources.statusField)), Object.isNull(before) ? null : ChangeSide.fromJson(before), Object.isNull(after) ? null : ChangeSide.fromJson(after), Object.isNull(unreadReason) ? null : UnreadReason.fromJson(unreadReason));
|
|
46
46
|
}
|
|
47
47
|
toJson() {
|
|
48
48
|
return {
|
|
49
49
|
[Resources.pathField]: this.path,
|
|
50
50
|
[Resources.statusField]: this.status.toJson(),
|
|
51
|
-
[Resources.beforeField]: this.before
|
|
52
|
-
[Resources.afterField]: this.after
|
|
53
|
-
[Resources.unreadReasonField]: this.unreadReason
|
|
51
|
+
[Resources.beforeField]: Object.isNull(this.before) ? null : this.before.toJson(),
|
|
52
|
+
[Resources.afterField]: Object.isNull(this.after) ? null : this.after.toJson(),
|
|
53
|
+
[Resources.unreadReasonField]: Object.isNull(this.unreadReason) ? null : this.unreadReason.toJson()
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
}
|
package/src/models/change.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/change.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"change.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/change.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAG/B,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EA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EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YAC7C,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YACjF,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YAC9E,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;SACpG,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
import { Resources } from "../resources.js";
|
|
9
|
-
import {
|
|
9
|
+
import { WireForm } from "../services/wire-form.js";
|
|
10
10
|
import { Checkpoint } from "./checkpoint.js";
|
|
11
11
|
export class CheckpointList {
|
|
12
12
|
static FIELDS = [Resources.checkpointsField];
|
|
@@ -15,9 +15,8 @@ export class CheckpointList {
|
|
|
15
15
|
this.checkpoints = [...checkpoints];
|
|
16
16
|
}
|
|
17
17
|
static fromJson(value) {
|
|
18
|
-
const reader =
|
|
19
|
-
reader.
|
|
20
|
-
return new CheckpointList(reader.readList(Resources.checkpointsField).map(t => Checkpoint.fromJson(t)));
|
|
18
|
+
const reader = WireForm.read(value, Resources.checkpointListModel, CheckpointList.FIELDS);
|
|
19
|
+
return new CheckpointList(WireForm.readArray(reader, Resources.checkpointsField).map(t => Checkpoint.fromJson(t)));
|
|
21
20
|
}
|
|
22
21
|
toJson() {
|
|
23
22
|
return { [Resources.checkpointsField]: this.checkpoints.map(t => t.toJson()) };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint-list.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/checkpoint-list.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"checkpoint-list.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/checkpoint-list.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,OAAO,cAAc;IACjB,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IACjE,WAAW,CAAwB;IAEnD,YAAmB,WAAkC;QACnD,IAAI,CAAC,WAAW,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC;IACtC,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,mBAAmB,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;QAC1F,OAAO,IAAI,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrH,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;IACjF,CAAC;CACF"}
|