@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/models/checkpoint.js
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
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 { InvalidDateException } from "../exceptions/invalid-date.exception.js";
|
|
9
|
-
import { InvalidTimeException } from "../exceptions/invalid-time.exception.js";
|
|
10
10
|
import { LabelTooLongException } from "../exceptions/label-too-long.exception.js";
|
|
11
11
|
import { Resources } from "../resources.js";
|
|
12
12
|
import { CheckpointId } from "../services/checkpoint-id.js";
|
|
13
|
-
import {
|
|
13
|
+
import { WireForm } from "../services/wire-form.js";
|
|
14
14
|
import { CaptureMode } from "./capture-mode.js";
|
|
15
15
|
import { UnreadPath } from "./unread-path.js";
|
|
16
16
|
export class Checkpoint {
|
|
@@ -24,7 +24,7 @@ export class Checkpoint {
|
|
|
24
24
|
unreadPaths;
|
|
25
25
|
constructor(id, time, mode, label, unreadPaths) {
|
|
26
26
|
CheckpointId.check(id);
|
|
27
|
-
if (label
|
|
27
|
+
if (!Object.isNull(label) && label.length > Resources.maximumLabelLength)
|
|
28
28
|
throw new LabelTooLongException(label.length);
|
|
29
29
|
if (Number.isNaN(time.getTime()))
|
|
30
30
|
throw new InvalidDateException();
|
|
@@ -35,12 +35,8 @@ export class Checkpoint {
|
|
|
35
35
|
this.unreadPaths = [...unreadPaths];
|
|
36
36
|
}
|
|
37
37
|
static fromJson(value) {
|
|
38
|
-
const reader =
|
|
39
|
-
reader.
|
|
40
|
-
const time = reader.readString(Resources.timeField);
|
|
41
|
-
if (!Resources.timePattern.test(time) || Number.isNaN(Date.parse(time)) || new Date(time).toISOString() !== time)
|
|
42
|
-
throw new InvalidTimeException(time);
|
|
43
|
-
return new Checkpoint(reader.readString(Resources.idField), new Date(time), CaptureMode.fromJson(reader.read(Resources.modeField)), reader.readStringOrNull(Resources.labelField), reader.readList(Resources.unreadPathsField).map(t => UnreadPath.fromJson(t)));
|
|
38
|
+
const reader = WireForm.read(value, Resources.checkpointModel, Checkpoint.FIELDS);
|
|
39
|
+
return new Checkpoint(reader.readString(Resources.idField), WireForm.readTime(reader, Resources.timeField), CaptureMode.fromJson(reader.readValue(Resources.modeField)), reader.readNullableString(Resources.labelField), WireForm.readArray(reader, Resources.unreadPathsField).map(t => UnreadPath.fromJson(t)));
|
|
44
40
|
}
|
|
45
41
|
toJson() {
|
|
46
42
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/checkpoint.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"checkpoint.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/checkpoint.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,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,OAAO,UAAU;IACb,MAAM,CAAU,MAAM,GAAsB;QAClD,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,gBAAgB;KAC9G,CAAC;IACc,EAAE,CAAS;IACX,KAAK,CAAgB;IACrB,IAAI,CAAc;IAClB,IAAI,CAAO;IACX,WAAW,CAAwB;IAEnD,YAAmB,EAAU,EAAE,IAAU,EAAE,IAAiB,EAAE,KAAoB,EAAE,WAAkC;QACpH,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACvB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,SAAS,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I,CAAC,WAAW,EAAE;YAC9C,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACzC,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,KAAK;YAClC,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACpE,CAAC;IACJ,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 { UnknownCompareOutcomeException } from "../exceptions/unknown-compare-outcome.exception.js";
|
|
9
10
|
export class CompareOutcome {
|
|
10
11
|
static Compared = new CompareOutcome("Compared", true);
|
|
@@ -19,7 +20,7 @@ export class CompareOutcome {
|
|
|
19
20
|
}
|
|
20
21
|
static fromJson(value) {
|
|
21
22
|
const outcome = CompareOutcome.ALL.find(t => t.value === value);
|
|
22
|
-
if (outcome
|
|
23
|
+
if (Object.isUndefined(outcome))
|
|
23
24
|
throw new UnknownCompareOutcomeException(String(value));
|
|
24
25
|
return outcome;
|
|
25
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare-outcome.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/compare-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,CAA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,UAAU,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAChE,IAAI,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC;YAC7B,MAAM,IAAI,8BAA8B,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1D,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -5,9 +5,10 @@
|
|
|
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 { CheckpointId } from "../services/checkpoint-id.js";
|
|
10
|
-
import {
|
|
11
|
+
import { WireForm } from "../services/wire-form.js";
|
|
11
12
|
import { FolderReference } from "./folder-reference.js";
|
|
12
13
|
export class CompareRequest {
|
|
13
14
|
static method = Resources.compareMethod;
|
|
@@ -17,16 +18,15 @@ export class CompareRequest {
|
|
|
17
18
|
to;
|
|
18
19
|
constructor(folder, from, to) {
|
|
19
20
|
for (const id of [from, to])
|
|
20
|
-
if (id
|
|
21
|
+
if (!Object.isNull(id))
|
|
21
22
|
CheckpointId.check(id);
|
|
22
23
|
this.folder = folder;
|
|
23
24
|
this.from = from;
|
|
24
25
|
this.to = to;
|
|
25
26
|
}
|
|
26
27
|
static fromJson(value) {
|
|
27
|
-
const reader =
|
|
28
|
-
reader.
|
|
29
|
-
return new CompareRequest(FolderReference.fromJson(reader.read(Resources.folderField)), reader.readString(Resources.fromField), reader.readStringOrNull(Resources.toField));
|
|
28
|
+
const reader = WireForm.read(value, Resources.compareRequestModel, CompareRequest.FIELDS);
|
|
29
|
+
return new CompareRequest(FolderReference.fromJson(reader.readValue(Resources.folderField)), reader.readString(Resources.fromField), reader.readNullableString(Resources.toField));
|
|
30
30
|
}
|
|
31
31
|
toJson() {
|
|
32
32
|
return { [Resources.folderField]: this.folder.toJson(), [Resources.fromField]: this.from, [Resources.toField]: this.to };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/compare-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"compare-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/compare-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAG/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,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,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACpG,MAAM,CAAkB;IACxB,IAAI,CAAS;IACb,EAAE,CAAgB;IAElC,YAAmB,MAAuB,EAAE,IAAY,EAAE,EAAiB;QACzE,KAAK,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YACzB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;gBACpB,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAE3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,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,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,EACjI,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAClD,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;IAC3H,CAAC;CACF"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { CompareChangesMismatchException } from "../exceptions/compare-changes-mismatch.exception.js";
|
|
9
9
|
import { Resources } from "../resources.js";
|
|
10
|
-
import {
|
|
10
|
+
import { WireForm } from "../services/wire-form.js";
|
|
11
11
|
import { Change } from "./change.js";
|
|
12
12
|
import { CompareOutcome } from "./compare-outcome.js";
|
|
13
13
|
export class CompareResult {
|
|
@@ -21,9 +21,8 @@ export class CompareResult {
|
|
|
21
21
|
this.outcome = outcome;
|
|
22
22
|
}
|
|
23
23
|
static fromJson(value) {
|
|
24
|
-
const reader =
|
|
25
|
-
reader.
|
|
26
|
-
return new CompareResult(CompareOutcome.fromJson(reader.read(Resources.outcomeField)), reader.readList(Resources.changesField).map(t => Change.fromJson(t)));
|
|
24
|
+
const reader = WireForm.read(value, Resources.compareResultModel, CompareResult.FIELDS);
|
|
25
|
+
return new CompareResult(CompareOutcome.fromJson(reader.readValue(Resources.outcomeField)), WireForm.readArray(reader, Resources.changesField).map(t => Change.fromJson(t)));
|
|
27
26
|
}
|
|
28
27
|
toJson() {
|
|
29
28
|
return { [Resources.outcomeField]: this.outcome.toJson(), [Resources.changesField]: this.changes.map(t => t.toJson()) };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compare-result.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/compare-result.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"compare-result.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/compare-result.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,OAAO,aAAa;IAChB,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACrF,OAAO,CAAoB;IAC3B,OAAO,CAAiB;IAExC,YAAmB,OAAuB,EAAE,OAA0B;QACpE,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAC3C,MAAM,IAAI,+BAA+B,CAAC,OAAO,CAAC,CAAC;QAErD,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,kBAAkB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QACxF,OAAO,IAAI,aAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/K,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;IAC1H,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 { UnknownDeleteFolderOutcomeException } from "../exceptions/unknown-delete-folder-outcome.exception.js";
|
|
9
10
|
export class DeleteFolderOutcome {
|
|
10
11
|
static Deleted = new DeleteFolderOutcome("Deleted");
|
|
@@ -16,7 +17,7 @@ export class DeleteFolderOutcome {
|
|
|
16
17
|
}
|
|
17
18
|
static fromJson(value) {
|
|
18
19
|
const outcome = DeleteFolderOutcome.ALL.find(t => t.value === value);
|
|
19
|
-
if (outcome
|
|
20
|
+
if (Object.isUndefined(outcome))
|
|
20
21
|
throw new UnknownDeleteFolderOutcomeException(String(value));
|
|
21
22
|
return outcome;
|
|
22
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-folder-outcome.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/delete-folder-outcome.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,mCAAmC,EAAE,MAAM,0DAA0D,CAAC;AAE/G,MAAM,OAAO,mBAAmB;IACvB,MAAM,CAAU,OAAO,GAAwB,IAAI,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAClF,MAAM,CAAU,MAAM,GAAwB,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC/E,MAAM,CAAU,GAAG,GAAmC,CAAC,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACxG,KAAK,CAAS;IAE9B,YAAoB,KAAa;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QACrE,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"delete-folder-outcome.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/delete-folder-outcome.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,mCAAmC,EAAE,MAAM,0DAA0D,CAAC;AAE/G,MAAM,OAAO,mBAAmB;IACvB,MAAM,CAAU,OAAO,GAAwB,IAAI,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAClF,MAAM,CAAU,MAAM,GAAwB,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC/E,MAAM,CAAU,GAAG,GAAmC,CAAC,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACxG,KAAK,CAAS;IAE9B,YAAoB,KAAa;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QACrE,IAAI,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC;YAC7B,MAAM,IAAI,mCAAmC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/D,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,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 { FolderReference } from "./folder-reference.js";
|
|
11
11
|
export class DeleteFolderRequest {
|
|
12
12
|
static method = Resources.deleteFolderMethod;
|
|
@@ -16,9 +16,8 @@ export class DeleteFolderRequest {
|
|
|
16
16
|
this.folder = folder;
|
|
17
17
|
}
|
|
18
18
|
static fromJson(value) {
|
|
19
|
-
const reader =
|
|
20
|
-
reader.
|
|
21
|
-
return new DeleteFolderRequest(FolderReference.fromJson(reader.read(Resources.folderField)));
|
|
19
|
+
const reader = WireForm.read(value, Resources.deleteFolderRequestModel, DeleteFolderRequest.FIELDS);
|
|
20
|
+
return new DeleteFolderRequest(FolderReference.fromJson(reader.readValue(Resources.folderField)));
|
|
22
21
|
}
|
|
23
22
|
toJson() {
|
|
24
23
|
return { [Resources.folderField]: this.folder.toJson() };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-folder-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/delete-folder-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"delete-folder-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/delete-folder-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,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,mBAAmB;IACvB,MAAM,CAAU,MAAM,GAAW,SAAS,CAAC,kBAAkB,CAAC;IAC7D,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC5D,MAAM,CAAkB;IAExC,YAAmB,MAAuB;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,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,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACpG,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;IAC3D,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 { DeleteFolderOutcome } from "./delete-folder-outcome.js";
|
|
11
11
|
export class DeleteFolderResult {
|
|
12
12
|
static FIELDS = [Resources.outcomeField];
|
|
@@ -15,9 +15,8 @@ export class DeleteFolderResult {
|
|
|
15
15
|
this.outcome = outcome;
|
|
16
16
|
}
|
|
17
17
|
static fromJson(value) {
|
|
18
|
-
const reader =
|
|
19
|
-
reader.
|
|
20
|
-
return new DeleteFolderResult(DeleteFolderOutcome.fromJson(reader.read(Resources.outcomeField)));
|
|
18
|
+
const reader = WireForm.read(value, Resources.deleteFolderResultModel, DeleteFolderResult.FIELDS);
|
|
19
|
+
return new DeleteFolderResult(DeleteFolderOutcome.fromJson(reader.readValue(Resources.outcomeField)));
|
|
21
20
|
}
|
|
22
21
|
toJson() {
|
|
23
22
|
return { [Resources.outcomeField]: this.outcome.toJson() };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-folder-result.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/delete-folder-result.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"delete-folder-result.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/delete-folder-result.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,OAAO,kBAAkB;IACrB,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAC7D,OAAO,CAAsB;IAE7C,YAAmB,OAA4B;QAC7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAClG,OAAO,IAAI,kBAAkB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACxG,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -5,21 +5,21 @@
|
|
|
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 { CheckpointId } from "../services/checkpoint-id.js";
|
|
10
|
-
import {
|
|
11
|
+
import { WireForm } from "../services/wire-form.js";
|
|
11
12
|
export class DiffTarget {
|
|
12
13
|
static FIELDS = [Resources.checkpointField];
|
|
13
14
|
checkpoint;
|
|
14
15
|
constructor(checkpoint) {
|
|
15
|
-
if (checkpoint
|
|
16
|
+
if (!Object.isNull(checkpoint))
|
|
16
17
|
CheckpointId.check(checkpoint);
|
|
17
18
|
this.checkpoint = checkpoint;
|
|
18
19
|
}
|
|
19
20
|
static fromJson(value) {
|
|
20
|
-
const reader =
|
|
21
|
-
reader.
|
|
22
|
-
return new DiffTarget(reader.readStringOrNull(Resources.checkpointField));
|
|
21
|
+
const reader = WireForm.read(value, Resources.diffTargetModel, DiffTarget.FIELDS);
|
|
22
|
+
return new DiffTarget(reader.readNullableString(Resources.checkpointField));
|
|
23
23
|
}
|
|
24
24
|
toJson() {
|
|
25
25
|
return { [Resources.checkpointField]: this.checkpoint };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-target.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/diff-target.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"diff-target.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/diff-target.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAG/B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,MAAM,OAAO,UAAU;IACb,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAChE,UAAU,CAAgB;IAE1C,YAAmB,UAAyB;QAC1C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;YAC5B,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAEjC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QAClF,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC;IAC9E,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;IAC1D,CAAC;CACF"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { InvalidFolderPathException } from "../exceptions/invalid-folder-path.exception.js";
|
|
9
9
|
import { Resources } from "../resources.js";
|
|
10
10
|
import { FolderIdentity } from "../services/folder-identity.js";
|
|
11
|
-
import {
|
|
11
|
+
import { WireForm } from "../services/wire-form.js";
|
|
12
12
|
export class FolderReference {
|
|
13
13
|
static FIELDS = [Resources.identityField, Resources.pathField];
|
|
14
14
|
identity;
|
|
@@ -21,8 +21,7 @@ export class FolderReference {
|
|
|
21
21
|
this.path = path;
|
|
22
22
|
}
|
|
23
23
|
static fromJson(value) {
|
|
24
|
-
const reader =
|
|
25
|
-
reader.refuseOtherFields(FolderReference.FIELDS);
|
|
24
|
+
const reader = WireForm.read(value, Resources.folderReferenceModel, FolderReference.FIELDS);
|
|
26
25
|
return new FolderReference(reader.readString(Resources.identityField), reader.readString(Resources.pathField));
|
|
27
26
|
}
|
|
28
27
|
toJson() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folder-reference.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/folder-reference.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"folder-reference.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/folder-reference.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAC5F,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,eAAe;IAClB,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,aAAa,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACnF,QAAQ,CAAS;IACjB,IAAI,CAAS;IAE7B,YAAmB,QAAgB,EAAE,IAAY;QAC/C,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC;YAC3C,MAAM,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAC;QAE7C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,oBAAoB,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAC5F,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IACjH,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IACxF,CAAC;CACF"}
|
|
@@ -5,11 +5,12 @@
|
|
|
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 { InvalidFolderPathException } from "../exceptions/invalid-folder-path.exception.js";
|
|
9
10
|
import { Resources } from "../resources.js";
|
|
10
11
|
import { ByteSize } from "../services/byte-size.js";
|
|
11
12
|
import { FolderIdentity } from "../services/folder-identity.js";
|
|
12
|
-
import {
|
|
13
|
+
import { WireForm } from "../services/wire-form.js";
|
|
13
14
|
export class FolderUsage {
|
|
14
15
|
static FIELDS = [Resources.identityField, Resources.pathField, Resources.bytesField];
|
|
15
16
|
bytes;
|
|
@@ -17,7 +18,7 @@ export class FolderUsage {
|
|
|
17
18
|
path;
|
|
18
19
|
constructor(identity, path, bytes) {
|
|
19
20
|
FolderIdentity.check(identity);
|
|
20
|
-
if (path
|
|
21
|
+
if (!Object.isNull(path) && !Resources.absolutePathPattern.test(path))
|
|
21
22
|
throw new InvalidFolderPathException(path);
|
|
22
23
|
ByteSize.check(bytes);
|
|
23
24
|
this.bytes = bytes;
|
|
@@ -25,9 +26,8 @@ export class FolderUsage {
|
|
|
25
26
|
this.path = path;
|
|
26
27
|
}
|
|
27
28
|
static fromJson(value) {
|
|
28
|
-
const reader =
|
|
29
|
-
reader.
|
|
30
|
-
return new FolderUsage(reader.readString(Resources.identityField), reader.readStringOrNull(Resources.pathField), reader.readNumber(Resources.bytesField));
|
|
29
|
+
const reader = WireForm.read(value, Resources.folderUsageModel, FolderUsage.FIELDS);
|
|
30
|
+
return new FolderUsage(reader.readString(Resources.identityField), reader.readNullableString(Resources.pathField), reader.readNumber(Resources.bytesField));
|
|
31
31
|
}
|
|
32
32
|
toJson() {
|
|
33
33
|
return { [Resources.identityField]: this.identity, [Resources.pathField]: this.path, [Resources.bytesField]: this.bytes };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folder-usage.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/folder-usage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAC5F,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,
|
|
1
|
+
{"version":3,"file":"folder-usage.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/folder-usage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;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,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IAC9J,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IAC5H,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 { UnknownKeepReasonException } from "../exceptions/unknown-keep-reason.exception.js";
|
|
9
10
|
export class KeepReason {
|
|
10
11
|
static Repository = new KeepReason("Repository");
|
|
@@ -12,14 +13,15 @@ export class KeepReason {
|
|
|
12
13
|
static Ignored = new KeepReason("Ignored");
|
|
13
14
|
static Unread = new KeepReason("Unread");
|
|
14
15
|
static LinkUnsupported = new KeepReason("LinkUnsupported");
|
|
15
|
-
static
|
|
16
|
+
static TooLarge = new KeepReason("TooLarge");
|
|
17
|
+
static ALL = [KeepReason.Repository, KeepReason.RepositoryFolder, KeepReason.Ignored, KeepReason.Unread, KeepReason.LinkUnsupported, KeepReason.TooLarge];
|
|
16
18
|
value;
|
|
17
19
|
constructor(value) {
|
|
18
20
|
this.value = value;
|
|
19
21
|
}
|
|
20
22
|
static fromJson(value) {
|
|
21
23
|
const reason = KeepReason.ALL.find(t => t.value === value);
|
|
22
|
-
if (reason
|
|
24
|
+
if (Object.isUndefined(reason))
|
|
23
25
|
throw new UnknownKeepReasonException(String(value));
|
|
24
26
|
return reason;
|
|
25
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keep-reason.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/keep-reason.ts"],"names":[],"mappings":"AAAA;;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AAC,QAAQ,CAAC,CAAC;IAClL,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,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAC3D,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC;YAC5B,MAAM,IAAI,0BAA0B,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACtD,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
package/src/models/kept-path.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { InvalidRelativePathException } from "../exceptions/invalid-relative-path.exception.js";
|
|
9
9
|
import { Resources } from "../resources.js";
|
|
10
|
-
import { JsonObjectReader } from "../services/json-object.reader.js";
|
|
11
10
|
import { RelativePath } from "../services/relative-path.js";
|
|
11
|
+
import { WireForm } from "../services/wire-form.js";
|
|
12
12
|
import { KeepReason } from "./keep-reason.js";
|
|
13
13
|
export class KeptPath {
|
|
14
14
|
static FIELDS = [Resources.pathField, Resources.reasonField];
|
|
@@ -21,9 +21,8 @@ export class KeptPath {
|
|
|
21
21
|
this.reason = reason;
|
|
22
22
|
}
|
|
23
23
|
static fromJson(value) {
|
|
24
|
-
const reader =
|
|
25
|
-
reader.
|
|
26
|
-
return new KeptPath(reader.readString(Resources.pathField), KeepReason.fromJson(reader.read(Resources.reasonField)));
|
|
24
|
+
const reader = WireForm.read(value, Resources.keptPathModel, KeptPath.FIELDS);
|
|
25
|
+
return new KeptPath(reader.readString(Resources.pathField), KeepReason.fromJson(reader.readValue(Resources.reasonField)));
|
|
27
26
|
}
|
|
28
27
|
toJson() {
|
|
29
28
|
return { [Resources.pathField]: this.path, [Resources.reasonField]: this.reason.toJson() };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kept-path.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/kept-path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"kept-path.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/kept-path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,OAAO,QAAQ;IACX,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACjF,IAAI,CAAS;IACb,MAAM,CAAa;IAEnC,YAAmB,IAAY,EAAE,MAAkB;QACjD,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;YAC7B,MAAM,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;QAE/C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC9E,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5H,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;IAC7F,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 { FolderReference } from "./folder-reference.js";
|
|
11
11
|
export class ListRequest {
|
|
12
12
|
static method = Resources.listMethod;
|
|
@@ -16,9 +16,8 @@ export class ListRequest {
|
|
|
16
16
|
this.folder = folder;
|
|
17
17
|
}
|
|
18
18
|
static fromJson(value) {
|
|
19
|
-
const reader =
|
|
20
|
-
reader.
|
|
21
|
-
return new ListRequest(FolderReference.fromJson(reader.read(Resources.folderField)));
|
|
19
|
+
const reader = WireForm.read(value, Resources.listRequestModel, ListRequest.FIELDS);
|
|
20
|
+
return new ListRequest(FolderReference.fromJson(reader.readValue(Resources.folderField)));
|
|
22
21
|
}
|
|
23
22
|
toJson() {
|
|
24
23
|
return { [Resources.folderField]: this.folder.toJson() };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/list-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"list-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/list-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,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,WAAW;IACf,MAAM,CAAU,MAAM,GAAW,SAAS,CAAC,UAAU,CAAC;IACrD,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC5D,MAAM,CAAkB;IAExC,YAAmB,MAAuB;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACpF,OAAO,IAAI,WAAW,CAAC,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5F,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;IAC3D,CAAC;CACF"}
|
package/src/models/path-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 { UnknownPathKindException } from "../exceptions/unknown-path-kind.exception.js";
|
|
9
10
|
export class PathKind {
|
|
10
11
|
static File = new PathKind("File");
|
|
@@ -18,7 +19,7 @@ export class PathKind {
|
|
|
18
19
|
}
|
|
19
20
|
static fromJson(value) {
|
|
20
21
|
const kind = PathKind.ALL.find(t => t.value === value);
|
|
21
|
-
if (kind
|
|
22
|
+
if (Object.isUndefined(kind))
|
|
22
23
|
throw new UnknownPathKindException(String(value));
|
|
23
24
|
return kind;
|
|
24
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-kind.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/path-kind.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAExF,MAAM,OAAO,QAAQ;IACZ,MAAM,CAAU,IAAI,GAAa,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtD,MAAM,CAAU,UAAU,GAAa,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC;IAClE,MAAM,CAAU,IAAI,GAAa,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtD,MAAM,CAAU,MAAM,GAAa,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzD,MAAM,CAAU,GAAG,GAAwB,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxG,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,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QACvD,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"path-kind.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/path-kind.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAExF,MAAM,OAAO,QAAQ;IACZ,MAAM,CAAU,IAAI,GAAa,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtD,MAAM,CAAU,UAAU,GAAa,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC;IAClE,MAAM,CAAU,IAAI,GAAa,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtD,MAAM,CAAU,MAAM,GAAa,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzD,MAAM,CAAU,GAAG,GAAwB,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxG,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,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QACvD,IAAI,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;YAC1B,MAAM,IAAI,wBAAwB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,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 { UnknownPreviewOutcomeException } from "../exceptions/unknown-preview-outcome.exception.js";
|
|
9
10
|
export class PreviewOutcome {
|
|
10
11
|
static Planned = new PreviewOutcome("Planned", true);
|
|
@@ -22,7 +23,7 @@ export class PreviewOutcome {
|
|
|
22
23
|
}
|
|
23
24
|
static fromJson(value) {
|
|
24
25
|
const outcome = PreviewOutcome.ALL.find(t => t.value === value);
|
|
25
|
-
if (outcome
|
|
26
|
+
if (Object.isUndefined(outcome))
|
|
26
27
|
throw new UnknownPreviewOutcomeException(String(value));
|
|
27
28
|
return outcome;
|
|
28
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-outcome.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/preview-outcome.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AAEpG,MAAM,OAAO,cAAc;IAClB,MAAM,CAAU,OAAO,GAAmB,IAAI,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC9E,MAAM,CAAU,iBAAiB,GAAmB,IAAI,cAAc,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;IACnG,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;IAC5E,MAAM,CAAU,GAAG,GAA8B;QACvD,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,iBAAiB,EAAE,cAAc,CAAC,aAAa,EAAE,cAAc,CAAC,MAAM;KAC9G,CAAC;IACc,SAAS,CAAU;IACnB,KAAK,CAAS;IAE9B,YAAoB,KAAa,EAAE,SAAkB;QACnD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAChE,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"preview-outcome.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/preview-outcome.ts"],"names":[],"mappings":"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CheckpointId } from "../services/checkpoint-id.js";
|
|
10
|
-
import { JsonObjectReader } from "../services/json-object.reader.js";
|
|
11
10
|
import { ScopePaths } from "../services/scope-paths.js";
|
|
11
|
+
import { WireForm } from "../services/wire-form.js";
|
|
12
12
|
import { FolderReference } from "./folder-reference.js";
|
|
13
13
|
export class PreviewRequest {
|
|
14
14
|
static method = Resources.previewRestoreMethod;
|
|
@@ -23,9 +23,8 @@ export class PreviewRequest {
|
|
|
23
23
|
this.paths = ScopePaths.of(paths);
|
|
24
24
|
}
|
|
25
25
|
static fromJson(value) {
|
|
26
|
-
const reader =
|
|
27
|
-
reader.
|
|
28
|
-
return new PreviewRequest(FolderReference.fromJson(reader.read(Resources.folderField)), reader.readString(Resources.checkpointField), reader.readStringListOrNull(Resources.pathsField));
|
|
26
|
+
const reader = WireForm.read(value, Resources.previewRequestModel, PreviewRequest.FIELDS);
|
|
27
|
+
return new PreviewRequest(FolderReference.fromJson(reader.readValue(Resources.folderField)), reader.readString(Resources.checkpointField), WireForm.readNullableStringArray(reader, Resources.pathsField));
|
|
29
28
|
}
|
|
30
29
|
toJson() {
|
|
31
30
|
return { [Resources.folderField]: this.folder.toJson(), [Resources.checkpointField]: this.checkpoint, [Resources.pathsField]: ScopePaths.toJson(this.paths) };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/preview-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"preview-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/preview-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,QAAQ,E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M,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IAChK,CAAC;CACF"}
|
|
@@ -5,9 +5,10 @@
|
|
|
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 { PreviewPlanMismatchException } from "../exceptions/preview-plan-mismatch.exception.js";
|
|
9
10
|
import { Resources } from "../resources.js";
|
|
10
|
-
import {
|
|
11
|
+
import { WireForm } from "../services/wire-form.js";
|
|
11
12
|
import { PreviewOutcome } from "./preview-outcome.js";
|
|
12
13
|
import { RestorePlan } from "./restore-plan.js";
|
|
13
14
|
export class PreviewResult {
|
|
@@ -15,19 +16,18 @@ export class PreviewResult {
|
|
|
15
16
|
outcome;
|
|
16
17
|
plan;
|
|
17
18
|
constructor(outcome, plan) {
|
|
18
|
-
if (outcome.isPlanned !== (plan
|
|
19
|
+
if (outcome.isPlanned !== (!Object.isNull(plan)))
|
|
19
20
|
throw new PreviewPlanMismatchException(outcome);
|
|
20
21
|
this.outcome = outcome;
|
|
21
22
|
this.plan = plan;
|
|
22
23
|
}
|
|
23
24
|
static fromJson(value) {
|
|
24
|
-
const reader =
|
|
25
|
-
reader.
|
|
26
|
-
|
|
27
|
-
return new PreviewResult(PreviewOutcome.fromJson(reader.read(Resources.outcomeField)), plan === null ? null : RestorePlan.fromJson(plan));
|
|
25
|
+
const reader = WireForm.read(value, Resources.previewResultModel, PreviewResult.FIELDS);
|
|
26
|
+
const plan = reader.readValue(Resources.planField);
|
|
27
|
+
return new PreviewResult(PreviewOutcome.fromJson(reader.readValue(Resources.outcomeField)), Object.isNull(plan) ? null : RestorePlan.fromJson(plan));
|
|
28
28
|
}
|
|
29
29
|
toJson() {
|
|
30
|
-
return { [Resources.outcomeField]: this.outcome.toJson(), [Resources.planField]: this.plan
|
|
30
|
+
return { [Resources.outcomeField]: this.outcome.toJson(), [Resources.planField]: Object.isNull(this.plan) ? null : this.plan.toJson() };
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=preview-result.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-result.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/preview-result.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"preview-result.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/preview-result.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAG/B,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,aAAa;IAChB,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClF,OAAO,CAAiB;IACxB,IAAI,CAAqB;IAEzC,YAAmB,OAAuB,EAAE,IAAwB;QAClE,IAAI,OAAO,CAAC,SAAS,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC9C,MAAM,IAAI,4BAA4B,CAAC,OAAO,CAAC,CAAC;QAElD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAA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