@noldova/checkpoints.protocol 0.0.0-stage → 0.0.2

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.
Files changed (204) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +8 -2
  3. package/package.json +34 -4
  4. package/src/api/index.d.ts +4062 -0
  5. package/src/api/index.js +98 -0
  6. package/src/api/index.js.map +1 -0
  7. package/src/exceptions/capture-checkpoint-mismatch.exception.js +17 -0
  8. package/src/exceptions/capture-checkpoint-mismatch.exception.js.map +1 -0
  9. package/src/exceptions/capture-space-mismatch.exception.js +17 -0
  10. package/src/exceptions/capture-space-mismatch.exception.js.map +1 -0
  11. package/src/exceptions/change-sides-mismatch.exception.js +17 -0
  12. package/src/exceptions/change-sides-mismatch.exception.js.map +1 -0
  13. package/src/exceptions/compare-changes-mismatch.exception.js +17 -0
  14. package/src/exceptions/compare-changes-mismatch.exception.js.map +1 -0
  15. package/src/exceptions/content-too-long.exception.js +19 -0
  16. package/src/exceptions/content-too-long.exception.js.map +1 -0
  17. package/src/exceptions/field-not-a-boolean.exception.js +19 -0
  18. package/src/exceptions/field-not-a-boolean.exception.js.map +1 -0
  19. package/src/exceptions/field-not-a-list.exception.js +19 -0
  20. package/src/exceptions/field-not-a-list.exception.js.map +1 -0
  21. package/src/exceptions/field-not-a-number-or-null.exception.js +19 -0
  22. package/src/exceptions/field-not-a-number-or-null.exception.js.map +1 -0
  23. package/src/exceptions/field-not-a-number.exception.js +19 -0
  24. package/src/exceptions/field-not-a-number.exception.js.map +1 -0
  25. package/src/exceptions/field-not-a-string-list.exception.js +19 -0
  26. package/src/exceptions/field-not-a-string-list.exception.js.map +1 -0
  27. package/src/exceptions/field-not-a-string-or-null.exception.js +19 -0
  28. package/src/exceptions/field-not-a-string-or-null.exception.js.map +1 -0
  29. package/src/exceptions/field-not-a-string.exception.js +19 -0
  30. package/src/exceptions/field-not-a-string.exception.js.map +1 -0
  31. package/src/exceptions/invalid-base64.exception.js +15 -0
  32. package/src/exceptions/invalid-base64.exception.js.map +1 -0
  33. package/src/exceptions/invalid-checkpoint-id.exception.js +17 -0
  34. package/src/exceptions/invalid-checkpoint-id.exception.js.map +1 -0
  35. package/src/exceptions/invalid-date.exception.js +15 -0
  36. package/src/exceptions/invalid-date.exception.js.map +1 -0
  37. package/src/exceptions/invalid-folder-path.exception.js +17 -0
  38. package/src/exceptions/invalid-folder-path.exception.js.map +1 -0
  39. package/src/exceptions/invalid-identity.exception.js +17 -0
  40. package/src/exceptions/invalid-identity.exception.js.map +1 -0
  41. package/src/exceptions/invalid-plan-state.exception.js +17 -0
  42. package/src/exceptions/invalid-plan-state.exception.js.map +1 -0
  43. package/src/exceptions/invalid-read-limit.exception.js +17 -0
  44. package/src/exceptions/invalid-read-limit.exception.js.map +1 -0
  45. package/src/exceptions/invalid-relative-path.exception.js +18 -0
  46. package/src/exceptions/invalid-relative-path.exception.js.map +1 -0
  47. package/src/exceptions/invalid-size.exception.js +17 -0
  48. package/src/exceptions/invalid-size.exception.js.map +1 -0
  49. package/src/exceptions/invalid-time.exception.js +17 -0
  50. package/src/exceptions/invalid-time.exception.js.map +1 -0
  51. package/src/exceptions/label-too-long.exception.js +17 -0
  52. package/src/exceptions/label-too-long.exception.js.map +1 -0
  53. package/src/exceptions/missing-field.exception.js +19 -0
  54. package/src/exceptions/missing-field.exception.js.map +1 -0
  55. package/src/exceptions/not-an-object.exception.js +17 -0
  56. package/src/exceptions/not-an-object.exception.js.map +1 -0
  57. package/src/exceptions/preview-plan-mismatch.exception.js +17 -0
  58. package/src/exceptions/preview-plan-mismatch.exception.js.map +1 -0
  59. package/src/exceptions/protocol.exception.js +14 -0
  60. package/src/exceptions/protocol.exception.js.map +1 -0
  61. package/src/exceptions/read-cut-mismatch.exception.js +17 -0
  62. package/src/exceptions/read-cut-mismatch.exception.js.map +1 -0
  63. package/src/exceptions/read-outcome-mismatch.exception.js +17 -0
  64. package/src/exceptions/read-outcome-mismatch.exception.js.map +1 -0
  65. package/src/exceptions/restore-checkpoints-mismatch.exception.js +17 -0
  66. package/src/exceptions/restore-checkpoints-mismatch.exception.js.map +1 -0
  67. package/src/exceptions/side-size-mismatch.exception.js +17 -0
  68. package/src/exceptions/side-size-mismatch.exception.js.map +1 -0
  69. package/src/exceptions/step-sides-mismatch.exception.js +17 -0
  70. package/src/exceptions/step-sides-mismatch.exception.js.map +1 -0
  71. package/src/exceptions/unknown-capture-mode.exception.js +17 -0
  72. package/src/exceptions/unknown-capture-mode.exception.js.map +1 -0
  73. package/src/exceptions/unknown-capture-outcome.exception.js +17 -0
  74. package/src/exceptions/unknown-capture-outcome.exception.js.map +1 -0
  75. package/src/exceptions/unknown-change-status.exception.js +17 -0
  76. package/src/exceptions/unknown-change-status.exception.js.map +1 -0
  77. package/src/exceptions/unknown-compare-outcome.exception.js +17 -0
  78. package/src/exceptions/unknown-compare-outcome.exception.js.map +1 -0
  79. package/src/exceptions/unknown-delete-folder-outcome.exception.js +17 -0
  80. package/src/exceptions/unknown-delete-folder-outcome.exception.js.map +1 -0
  81. package/src/exceptions/unknown-field.exception.js +19 -0
  82. package/src/exceptions/unknown-field.exception.js.map +1 -0
  83. package/src/exceptions/unknown-keep-reason.exception.js +17 -0
  84. package/src/exceptions/unknown-keep-reason.exception.js.map +1 -0
  85. package/src/exceptions/unknown-path-kind.exception.js +17 -0
  86. package/src/exceptions/unknown-path-kind.exception.js.map +1 -0
  87. package/src/exceptions/unknown-preview-outcome.exception.js +17 -0
  88. package/src/exceptions/unknown-preview-outcome.exception.js.map +1 -0
  89. package/src/exceptions/unknown-read-outcome.exception.js +17 -0
  90. package/src/exceptions/unknown-read-outcome.exception.js.map +1 -0
  91. package/src/exceptions/unknown-restore-action.exception.js +17 -0
  92. package/src/exceptions/unknown-restore-action.exception.js.map +1 -0
  93. package/src/exceptions/unknown-restore-outcome.exception.js +17 -0
  94. package/src/exceptions/unknown-restore-outcome.exception.js.map +1 -0
  95. package/src/exceptions/unknown-unread-reason.exception.js +17 -0
  96. package/src/exceptions/unknown-unread-reason.exception.js.map +1 -0
  97. package/src/exceptions/unread-code-mismatch.exception.js +17 -0
  98. package/src/exceptions/unread-code-mismatch.exception.js.map +1 -0
  99. package/src/exceptions/unread-reason-mismatch.exception.js +17 -0
  100. package/src/exceptions/unread-reason-mismatch.exception.js.map +1 -0
  101. package/src/models/capture-mode.js +27 -0
  102. package/src/models/capture-mode.js.map +1 -0
  103. package/src/models/capture-outcome.js +31 -0
  104. package/src/models/capture-outcome.js.map +1 -0
  105. package/src/models/capture-paused-event.js +35 -0
  106. package/src/models/capture-paused-event.js.map +1 -0
  107. package/src/models/capture-request.js +32 -0
  108. package/src/models/capture-request.js.map +1 -0
  109. package/src/models/capture-result.js +50 -0
  110. package/src/models/capture-result.js.map +1 -0
  111. package/src/models/capture-resumed-event.js +28 -0
  112. package/src/models/capture-resumed-event.js.map +1 -0
  113. package/src/models/change-side.js +36 -0
  114. package/src/models/change-side.js.map +1 -0
  115. package/src/models/change-status.js +32 -0
  116. package/src/models/change-status.js.map +1 -0
  117. package/src/models/change.js +57 -0
  118. package/src/models/change.js.map +1 -0
  119. package/src/models/checkpoint-list.js +26 -0
  120. package/src/models/checkpoint-list.js.map +1 -0
  121. package/src/models/checkpoint.js +55 -0
  122. package/src/models/checkpoint.js.map +1 -0
  123. package/src/models/compare-outcome.js +30 -0
  124. package/src/models/compare-outcome.js.map +1 -0
  125. package/src/models/compare-request.js +35 -0
  126. package/src/models/compare-request.js.map +1 -0
  127. package/src/models/compare-result.js +32 -0
  128. package/src/models/compare-result.js.map +1 -0
  129. package/src/models/delete-folder-outcome.js +27 -0
  130. package/src/models/delete-folder-outcome.js.map +1 -0
  131. package/src/models/delete-folder-request.js +27 -0
  132. package/src/models/delete-folder-request.js.map +1 -0
  133. package/src/models/delete-folder-result.js +26 -0
  134. package/src/models/delete-folder-result.js.map +1 -0
  135. package/src/models/diff-target.js +28 -0
  136. package/src/models/diff-target.js.map +1 -0
  137. package/src/models/folder-reference.js +32 -0
  138. package/src/models/folder-reference.js.map +1 -0
  139. package/src/models/folder-usage.js +36 -0
  140. package/src/models/folder-usage.js.map +1 -0
  141. package/src/models/keep-reason.js +30 -0
  142. package/src/models/keep-reason.js.map +1 -0
  143. package/src/models/kept-path.js +32 -0
  144. package/src/models/kept-path.js.map +1 -0
  145. package/src/models/list-request.js +27 -0
  146. package/src/models/list-request.js.map +1 -0
  147. package/src/models/path-kind.js +29 -0
  148. package/src/models/path-kind.js.map +1 -0
  149. package/src/models/preview-outcome.js +33 -0
  150. package/src/models/preview-outcome.js.map +1 -0
  151. package/src/models/preview-request.js +34 -0
  152. package/src/models/preview-request.js.map +1 -0
  153. package/src/models/preview-result.js +33 -0
  154. package/src/models/preview-result.js.map +1 -0
  155. package/src/models/read-outcome.js +35 -0
  156. package/src/models/read-outcome.js.map +1 -0
  157. package/src/models/read-request.js +54 -0
  158. package/src/models/read-request.js.map +1 -0
  159. package/src/models/read-result.js +52 -0
  160. package/src/models/read-result.js.map +1 -0
  161. package/src/models/restore-action.js +28 -0
  162. package/src/models/restore-action.js.map +1 -0
  163. package/src/models/restore-held-up-event.js +35 -0
  164. package/src/models/restore-held-up-event.js.map +1 -0
  165. package/src/models/restore-outcome.js +36 -0
  166. package/src/models/restore-outcome.js.map +1 -0
  167. package/src/models/restore-plan.js +59 -0
  168. package/src/models/restore-plan.js.map +1 -0
  169. package/src/models/restore-request.js +30 -0
  170. package/src/models/restore-request.js.map +1 -0
  171. package/src/models/restore-result.js +40 -0
  172. package/src/models/restore-result.js.map +1 -0
  173. package/src/models/restore-step.js +47 -0
  174. package/src/models/restore-step.js.map +1 -0
  175. package/src/models/restored-event.js +35 -0
  176. package/src/models/restored-event.js.map +1 -0
  177. package/src/models/storage-list.js +26 -0
  178. package/src/models/storage-list.js.map +1 -0
  179. package/src/models/storage-request.js +20 -0
  180. package/src/models/storage-request.js.map +1 -0
  181. package/src/models/unread-path.js +37 -0
  182. package/src/models/unread-path.js.map +1 -0
  183. package/src/models/unread-reason.js +29 -0
  184. package/src/models/unread-reason.js.map +1 -0
  185. package/src/resources.js +247 -0
  186. package/src/resources.js.map +1 -0
  187. package/src/services/base64.js +48 -0
  188. package/src/services/base64.js.map +1 -0
  189. package/src/services/byte-size.js +15 -0
  190. package/src/services/byte-size.js.map +1 -0
  191. package/src/services/checkpoint-id.js +16 -0
  192. package/src/services/checkpoint-id.js.map +1 -0
  193. package/src/services/folder-identity.js +16 -0
  194. package/src/services/folder-identity.js.map +1 -0
  195. package/src/services/json-object.reader.js +89 -0
  196. package/src/services/json-object.reader.js.map +1 -0
  197. package/src/services/relative-path.js +14 -0
  198. package/src/services/relative-path.js.map +1 -0
  199. package/src/services/scope-paths.js +24 -0
  200. package/src/services/scope-paths.js.map +1 -0
  201. package/src/types/json-object.js +9 -0
  202. package/src/types/json-object.js.map +1 -0
  203. package/src/types/json-value.js +9 -0
  204. package/src/types/json-value.js.map +1 -0
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { Resources } from "../resources.js";
9
+ import { CheckpointId } from "../services/checkpoint-id.js";
10
+ import { JsonObjectReader } from "../services/json-object.reader.js";
11
+ export class DiffTarget {
12
+ static FIELDS = [Resources.checkpointField];
13
+ checkpoint;
14
+ constructor(checkpoint) {
15
+ if (checkpoint !== null)
16
+ CheckpointId.check(checkpoint);
17
+ this.checkpoint = checkpoint;
18
+ }
19
+ static fromJson(value) {
20
+ const reader = new JsonObjectReader(value, Resources.diffTargetModel);
21
+ reader.refuseOtherFields(DiffTarget.FIELDS);
22
+ return new DiffTarget(reader.readStringOrNull(Resources.checkpointField));
23
+ }
24
+ toJson() {
25
+ return { [Resources.checkpointField]: this.checkpoint };
26
+ }
27
+ }
28
+ //# sourceMappingURL=diff-target.js.map
@@ -0,0 +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,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,MAAM,OAAO,UAAU;IACb,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAChE,UAAU,CAAgB;IAE1C,YAAmB,UAAyB;QAC1C,IAAI,UAAU,KAAK,IAAI;YACrB,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,IAAI,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;QACtE,MAAM,CAAC,iBAAiB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC5C,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC;IAC5E,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;IAC1D,CAAC;CACF"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { InvalidFolderPathException } from "../exceptions/invalid-folder-path.exception.js";
9
+ import { Resources } from "../resources.js";
10
+ import { FolderIdentity } from "../services/folder-identity.js";
11
+ import { JsonObjectReader } from "../services/json-object.reader.js";
12
+ export class FolderReference {
13
+ static FIELDS = [Resources.identityField, Resources.pathField];
14
+ identity;
15
+ path;
16
+ constructor(identity, path) {
17
+ FolderIdentity.check(identity);
18
+ if (!Resources.absolutePathPattern.test(path))
19
+ throw new InvalidFolderPathException(path);
20
+ this.identity = identity;
21
+ this.path = path;
22
+ }
23
+ static fromJson(value) {
24
+ const reader = new JsonObjectReader(value, Resources.folderReferenceModel);
25
+ reader.refuseOtherFields(FolderReference.FIELDS);
26
+ return new FolderReference(reader.readString(Resources.identityField), reader.readString(Resources.pathField));
27
+ }
28
+ toJson() {
29
+ return { [Resources.identityField]: this.identity, [Resources.pathField]: this.path };
30
+ }
31
+ }
32
+ //# sourceMappingURL=folder-reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"folder-reference.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/folder-reference.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,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,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,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,IAAI,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,oBAAoB,CAAC,CAAC;QAC3E,MAAM,CAAC,iBAAiB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QACjD,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"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { InvalidFolderPathException } from "../exceptions/invalid-folder-path.exception.js";
9
+ import { Resources } from "../resources.js";
10
+ import { ByteSize } from "../services/byte-size.js";
11
+ import { FolderIdentity } from "../services/folder-identity.js";
12
+ import { JsonObjectReader } from "../services/json-object.reader.js";
13
+ export class FolderUsage {
14
+ static FIELDS = [Resources.identityField, Resources.pathField, Resources.bytesField];
15
+ bytes;
16
+ identity;
17
+ path;
18
+ constructor(identity, path, bytes) {
19
+ FolderIdentity.check(identity);
20
+ if (path !== null && !Resources.absolutePathPattern.test(path))
21
+ throw new InvalidFolderPathException(path);
22
+ ByteSize.check(bytes);
23
+ this.bytes = bytes;
24
+ this.identity = identity;
25
+ this.path = path;
26
+ }
27
+ static fromJson(value) {
28
+ const reader = new JsonObjectReader(value, Resources.folderUsageModel);
29
+ reader.refuseOtherFields(FolderUsage.FIELDS);
30
+ return new FolderUsage(reader.readString(Resources.identityField), reader.readStringOrNull(Resources.pathField), reader.readNumber(Resources.bytesField));
31
+ }
32
+ toJson() {
33
+ return { [Resources.identityField]: this.identity, [Resources.pathField]: this.path, [Resources.bytesField]: this.bytes };
34
+ }
35
+ }
36
+ //# sourceMappingURL=folder-usage.js.map
@@ -0,0 +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,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,MAAM,OAAO,WAAW;IACd,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,aAAa,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACzG,KAAK,CAAS;IACd,QAAQ,CAAS;IACjB,IAAI,CAAgB;IAEpC,YAAmB,QAAgB,EAAE,IAAmB,EAAE,KAAa;QACrE,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC/B,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC;YAC5D,MAAM,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAC;QAC7C,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,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,IAAI,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACvE,MAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5J,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"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { UnknownKeepReasonException } from "../exceptions/unknown-keep-reason.exception.js";
9
+ export class KeepReason {
10
+ static Repository = new KeepReason("Repository");
11
+ static RepositoryFolder = new KeepReason("RepositoryFolder");
12
+ static Ignored = new KeepReason("Ignored");
13
+ static Unread = new KeepReason("Unread");
14
+ static LinkUnsupported = new KeepReason("LinkUnsupported");
15
+ static ALL = [KeepReason.Repository, KeepReason.RepositoryFolder, KeepReason.Ignored, KeepReason.Unread, KeepReason.LinkUnsupported];
16
+ value;
17
+ constructor(value) {
18
+ this.value = value;
19
+ }
20
+ static fromJson(value) {
21
+ const reason = KeepReason.ALL.find(t => t.value === value);
22
+ if (reason === undefined)
23
+ throw new UnknownKeepReasonException(String(value));
24
+ return reason;
25
+ }
26
+ toJson() {
27
+ return this.value;
28
+ }
29
+ }
30
+ //# sourceMappingURL=keep-reason.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keep-reason.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/keep-reason.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAE5F,MAAM,OAAO,UAAU;IACd,MAAM,CAAU,UAAU,GAAe,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC;IACtE,MAAM,CAAU,gBAAgB,GAAe,IAAI,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAClF,MAAM,CAAU,OAAO,GAAe,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC;IAChE,MAAM,CAAU,MAAM,GAAe,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9D,MAAM,CAAU,eAAe,GAAe,IAAI,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC/E,MAAM,CAAU,GAAG,GAA0B,CAAC,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,gBAAgB,EAAE,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;IAC7J,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,KAAK,SAAS;YACtB,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"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { InvalidRelativePathException } from "../exceptions/invalid-relative-path.exception.js";
9
+ import { Resources } from "../resources.js";
10
+ import { JsonObjectReader } from "../services/json-object.reader.js";
11
+ import { RelativePath } from "../services/relative-path.js";
12
+ import { KeepReason } from "./keep-reason.js";
13
+ export class KeptPath {
14
+ static FIELDS = [Resources.pathField, Resources.reasonField];
15
+ path;
16
+ reason;
17
+ constructor(path, reason) {
18
+ if (!RelativePath.isValid(path))
19
+ throw new InvalidRelativePathException(path);
20
+ this.path = path;
21
+ this.reason = reason;
22
+ }
23
+ static fromJson(value) {
24
+ const reader = new JsonObjectReader(value, Resources.keptPathModel);
25
+ reader.refuseOtherFields(KeptPath.FIELDS);
26
+ return new KeptPath(reader.readString(Resources.pathField), KeepReason.fromJson(reader.read(Resources.reasonField)));
27
+ }
28
+ toJson() {
29
+ return { [Resources.pathField]: this.path, [Resources.reasonField]: this.reason.toJson() };
30
+ }
31
+ }
32
+ //# sourceMappingURL=kept-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kept-path.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/kept-path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,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,IAAI,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;QACpE,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC1C,OAAO,IAAI,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACvH,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"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { Resources } from "../resources.js";
9
+ import { JsonObjectReader } from "../services/json-object.reader.js";
10
+ import { FolderReference } from "./folder-reference.js";
11
+ export class ListRequest {
12
+ static method = Resources.listMethod;
13
+ static FIELDS = [Resources.folderField];
14
+ folder;
15
+ constructor(folder) {
16
+ this.folder = folder;
17
+ }
18
+ static fromJson(value) {
19
+ const reader = new JsonObjectReader(value, Resources.listRequestModel);
20
+ reader.refuseOtherFields(ListRequest.FIELDS);
21
+ return new ListRequest(FolderReference.fromJson(reader.read(Resources.folderField)));
22
+ }
23
+ toJson() {
24
+ return { [Resources.folderField]: this.folder.toJson() };
25
+ }
26
+ }
27
+ //# sourceMappingURL=list-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/list-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,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,IAAI,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACvE,MAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,IAAI,WAAW,CAAC,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACvF,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;IAC3D,CAAC;CACF"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { UnknownPathKindException } from "../exceptions/unknown-path-kind.exception.js";
9
+ export class PathKind {
10
+ static File = new PathKind("File");
11
+ static Executable = new PathKind("Executable");
12
+ static Link = new PathKind("Link");
13
+ static Folder = new PathKind("Folder");
14
+ static ALL = [PathKind.File, PathKind.Executable, PathKind.Link, PathKind.Folder];
15
+ value;
16
+ constructor(value) {
17
+ this.value = value;
18
+ }
19
+ static fromJson(value) {
20
+ const kind = PathKind.ALL.find(t => t.value === value);
21
+ if (kind === undefined)
22
+ throw new UnknownPathKindException(String(value));
23
+ return kind;
24
+ }
25
+ toJson() {
26
+ return this.value;
27
+ }
28
+ }
29
+ //# sourceMappingURL=path-kind.js.map
@@ -0,0 +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,KAAK,SAAS;YACpB,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"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { UnknownPreviewOutcomeException } from "../exceptions/unknown-preview-outcome.exception.js";
9
+ export class PreviewOutcome {
10
+ static Planned = new PreviewOutcome("Planned", true);
11
+ static CheckpointMissing = new PreviewOutcome("CheckpointMissing", false);
12
+ static FolderMissing = new PreviewOutcome("FolderMissing", false);
13
+ static HeldUp = new PreviewOutcome("HeldUp", false);
14
+ static ALL = [
15
+ PreviewOutcome.Planned, PreviewOutcome.CheckpointMissing, PreviewOutcome.FolderMissing, PreviewOutcome.HeldUp
16
+ ];
17
+ isPlanned;
18
+ value;
19
+ constructor(value, isPlanned) {
20
+ this.isPlanned = isPlanned;
21
+ this.value = value;
22
+ }
23
+ static fromJson(value) {
24
+ const outcome = PreviewOutcome.ALL.find(t => t.value === value);
25
+ if (outcome === undefined)
26
+ throw new UnknownPreviewOutcomeException(String(value));
27
+ return outcome;
28
+ }
29
+ toJson() {
30
+ return this.value;
31
+ }
32
+ }
33
+ //# sourceMappingURL=preview-outcome.js.map
@@ -0,0 +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,KAAK,SAAS;YACvB,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"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { Resources } from "../resources.js";
9
+ import { CheckpointId } from "../services/checkpoint-id.js";
10
+ import { JsonObjectReader } from "../services/json-object.reader.js";
11
+ import { ScopePaths } from "../services/scope-paths.js";
12
+ import { FolderReference } from "./folder-reference.js";
13
+ export class PreviewRequest {
14
+ static method = Resources.previewRestoreMethod;
15
+ static FIELDS = [Resources.folderField, Resources.checkpointField, Resources.pathsField];
16
+ checkpoint;
17
+ folder;
18
+ paths;
19
+ constructor(folder, checkpoint, paths) {
20
+ CheckpointId.check(checkpoint);
21
+ this.checkpoint = checkpoint;
22
+ this.folder = folder;
23
+ this.paths = ScopePaths.of(paths);
24
+ }
25
+ static fromJson(value) {
26
+ const reader = new JsonObjectReader(value, Resources.previewRequestModel);
27
+ reader.refuseOtherFields(PreviewRequest.FIELDS);
28
+ return new PreviewRequest(FolderReference.fromJson(reader.read(Resources.folderField)), reader.readString(Resources.checkpointField), reader.readStringListOrNull(Resources.pathsField));
29
+ }
30
+ toJson() {
31
+ return { [Resources.folderField]: this.folder.toJson(), [Resources.checkpointField]: this.checkpoint, [Resources.pathsField]: ScopePaths.toJson(this.paths) };
32
+ }
33
+ }
34
+ //# sourceMappingURL=preview-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/preview-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,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,OAAO,cAAc;IAClB,MAAM,CAAU,MAAM,GAAW,SAAS,CAAC,oBAAoB,CAAC;IAC/D,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAC7G,UAAU,CAAS;IACnB,MAAM,CAAkB;IACxB,KAAK,CAA2B;IAEhD,YAAmB,MAAuB,EAAE,UAAkB,EAAE,KAA+B;QAC7F,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAE/B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,mBAAmB,CAAC,CAAC;QAC1E,MAAM,CAAC,iBAAiB,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO,IAAI,cAAc,CAAC,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,EAClI,MAAM,CAAC,oBAAoB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IACvD,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IAChK,CAAC;CACF"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { PreviewPlanMismatchException } from "../exceptions/preview-plan-mismatch.exception.js";
9
+ import { Resources } from "../resources.js";
10
+ import { JsonObjectReader } from "../services/json-object.reader.js";
11
+ import { PreviewOutcome } from "./preview-outcome.js";
12
+ import { RestorePlan } from "./restore-plan.js";
13
+ export class PreviewResult {
14
+ static FIELDS = [Resources.outcomeField, Resources.planField];
15
+ outcome;
16
+ plan;
17
+ constructor(outcome, plan) {
18
+ if (outcome.isPlanned !== (plan !== null))
19
+ throw new PreviewPlanMismatchException(outcome);
20
+ this.outcome = outcome;
21
+ this.plan = plan;
22
+ }
23
+ static fromJson(value) {
24
+ const reader = new JsonObjectReader(value, Resources.previewResultModel);
25
+ reader.refuseOtherFields(PreviewResult.FIELDS);
26
+ const plan = reader.read(Resources.planField);
27
+ return new PreviewResult(PreviewOutcome.fromJson(reader.read(Resources.outcomeField)), plan === null ? null : RestorePlan.fromJson(plan));
28
+ }
29
+ toJson() {
30
+ return { [Resources.outcomeField]: this.outcome.toJson(), [Resources.planField]: this.plan === null ? null : this.plan.toJson() };
31
+ }
32
+ }
33
+ //# sourceMappingURL=preview-result.js.map
@@ -0,0 +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,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,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,IAAI,KAAK,IAAI,CAAC;YACvC,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,MAAM,GAAG,IAAI,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;QACzE,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC9C,OAAO,IAAI,aAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5I,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;IACpI,CAAC;CACF"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { UnknownReadOutcomeException } from "../exceptions/unknown-read-outcome.exception.js";
9
+ export class ReadOutcome {
10
+ static Read = new ReadOutcome("Read", true);
11
+ static FolderMissing = new ReadOutcome("FolderMissing", false);
12
+ static CheckpointMissing = new ReadOutcome("CheckpointMissing", false);
13
+ static PathMissing = new ReadOutcome("PathMissing", false);
14
+ static Unknown = new ReadOutcome("Unknown", false);
15
+ static Binary = new ReadOutcome("Binary", false);
16
+ static ALL = [
17
+ ReadOutcome.Read, ReadOutcome.FolderMissing, ReadOutcome.CheckpointMissing, ReadOutcome.PathMissing, ReadOutcome.Unknown, ReadOutcome.Binary
18
+ ];
19
+ isRead;
20
+ value;
21
+ constructor(value, isRead) {
22
+ this.isRead = isRead;
23
+ this.value = value;
24
+ }
25
+ static fromJson(value) {
26
+ const outcome = ReadOutcome.ALL.find(t => t.value === value);
27
+ if (outcome === undefined)
28
+ throw new UnknownReadOutcomeException(String(value));
29
+ return outcome;
30
+ }
31
+ toJson() {
32
+ return this.value;
33
+ }
34
+ }
35
+ //# sourceMappingURL=read-outcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-outcome.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/read-outcome.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAE9F,MAAM,OAAO,WAAW;IACf,MAAM,CAAU,IAAI,GAAgB,IAAI,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAClE,MAAM,CAAU,aAAa,GAAgB,IAAI,WAAW,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACrF,MAAM,CAAU,iBAAiB,GAAgB,IAAI,WAAW,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;IAC7F,MAAM,CAAU,WAAW,GAAgB,IAAI,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IACjF,MAAM,CAAU,OAAO,GAAgB,IAAI,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACzE,MAAM,CAAU,MAAM,GAAgB,IAAI,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACtE,MAAM,CAAU,GAAG,GAA2B;QACpD,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,aAAa,EAAE,WAAW,CAAC,iBAAiB,EAAE,WAAW,CAAC,WAAW,EAAE,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM;KAC7I,CAAC;IACc,MAAM,CAAU;IAChB,KAAK,CAAS;IAE9B,YAAoB,KAAa,EAAE,MAAe;QAChD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAC7D,IAAI,OAAO,KAAK,SAAS;YACvB,MAAM,IAAI,2BAA2B,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACvD,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { InvalidReadLimitException } from "../exceptions/invalid-read-limit.exception.js";
9
+ import { InvalidRelativePathException } from "../exceptions/invalid-relative-path.exception.js";
10
+ import { Resources } from "../resources.js";
11
+ import { CheckpointId } from "../services/checkpoint-id.js";
12
+ import { JsonObjectReader } from "../services/json-object.reader.js";
13
+ import { RelativePath } from "../services/relative-path.js";
14
+ import { DiffTarget } from "./diff-target.js";
15
+ import { FolderReference } from "./folder-reference.js";
16
+ export class ReadRequest {
17
+ static method = Resources.readMethod;
18
+ static FIELDS = [
19
+ Resources.folderField, Resources.checkpointField, Resources.pathField, Resources.againstField, Resources.limitField
20
+ ];
21
+ against;
22
+ checkpoint;
23
+ folder;
24
+ limit;
25
+ path;
26
+ constructor(folder, checkpoint, path, against, limit) {
27
+ CheckpointId.check(checkpoint);
28
+ if (!RelativePath.isValid(path))
29
+ throw new InvalidRelativePathException(path);
30
+ if (!Number.isSafeInteger(limit) || limit < Resources.minimumReadLimit || limit > Resources.maximumReadLimit)
31
+ throw new InvalidReadLimitException(limit);
32
+ this.against = against;
33
+ this.checkpoint = checkpoint;
34
+ this.folder = folder;
35
+ this.limit = limit;
36
+ this.path = path;
37
+ }
38
+ static fromJson(value) {
39
+ const reader = new JsonObjectReader(value, Resources.readRequestModel);
40
+ reader.refuseOtherFields(ReadRequest.FIELDS);
41
+ const against = reader.read(Resources.againstField);
42
+ return new ReadRequest(FolderReference.fromJson(reader.read(Resources.folderField)), reader.readString(Resources.checkpointField), reader.readString(Resources.pathField), against === null ? null : DiffTarget.fromJson(against), reader.readNumber(Resources.limitField));
43
+ }
44
+ toJson() {
45
+ return {
46
+ [Resources.folderField]: this.folder.toJson(),
47
+ [Resources.checkpointField]: this.checkpoint,
48
+ [Resources.pathField]: this.path,
49
+ [Resources.againstField]: this.against === null ? null : this.against.toJson(),
50
+ [Resources.limitField]: this.limit
51
+ };
52
+ }
53
+ }
54
+ //# sourceMappingURL=read-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-request.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/read-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,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,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,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;QAClD,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,UAAU;KACpH,CAAC;IACc,OAAO,CAAoB;IAC3B,UAAU,CAAS;IACnB,MAAM,CAAkB;IACxB,KAAK,CAAS;IACd,IAAI,CAAS;IAE7B,YAAmB,MAAuB,EAAE,UAAkB,EAAE,IAAY,EAAE,OAA0B,EAAE,KAAa;QACrH,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC/B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;YAC7B,MAAM,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,SAAS,CAAC,gBAAgB,IAAI,KAAK,GAAG,SAAS,CAAC,gBAAgB;YAC1G,MAAM,IAAI,yBAAyB,CAAC,KAAK,CAAC,CAAC;QAE7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACvE,MAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACpD,OAAO,IAAI,WAAW,CACpB,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,EAC5D,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,EAC5C,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,EACtC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EACtD,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7C,CAAC;IAEM,MAAM;QACX,OAAO;YACL,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YAC7C,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC,UAAU;YAC5C,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI;YAChC,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAC9E,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,KAAK;SACnC,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { ContentTooLongException } from "../exceptions/content-too-long.exception.js";
9
+ import { ReadCutMismatchException } from "../exceptions/read-cut-mismatch.exception.js";
10
+ import { ReadOutcomeMismatchException } from "../exceptions/read-outcome-mismatch.exception.js";
11
+ import { Resources } from "../resources.js";
12
+ import { Base64 } from "../services/base64.js";
13
+ import { ByteSize } from "../services/byte-size.js";
14
+ import { JsonObjectReader } from "../services/json-object.reader.js";
15
+ import { ReadOutcome } from "./read-outcome.js";
16
+ export class ReadResult {
17
+ static FIELDS = [Resources.outcomeField, Resources.contentField, Resources.isCutField, Resources.sizeField];
18
+ content;
19
+ outcome;
20
+ size;
21
+ constructor(outcome, content, size) {
22
+ if (!outcome.isRead && (content.length > 0 || size > 0))
23
+ throw new ReadOutcomeMismatchException(outcome);
24
+ ByteSize.check(size);
25
+ if (content.length > size)
26
+ throw new ContentTooLongException(content.length, size);
27
+ this.content = new Uint8Array(content);
28
+ this.outcome = outcome;
29
+ this.size = size;
30
+ }
31
+ get isCut() {
32
+ return this.content.length < this.size;
33
+ }
34
+ static fromJson(value) {
35
+ const reader = new JsonObjectReader(value, Resources.readResultModel);
36
+ reader.refuseOtherFields(ReadResult.FIELDS);
37
+ const result = new ReadResult(ReadOutcome.fromJson(reader.read(Resources.outcomeField)), Base64.decode(reader.readString(Resources.contentField)), reader.readNumber(Resources.sizeField));
38
+ const isCut = reader.readBoolean(Resources.isCutField);
39
+ if (isCut !== result.isCut)
40
+ throw new ReadCutMismatchException(isCut);
41
+ return result;
42
+ }
43
+ toJson() {
44
+ return {
45
+ [Resources.outcomeField]: this.outcome.toJson(),
46
+ [Resources.contentField]: Base64.encode(this.content),
47
+ [Resources.isCutField]: this.isCut,
48
+ [Resources.sizeField]: this.size
49
+ };
50
+ }
51
+ }
52
+ //# sourceMappingURL=read-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-result.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/read-result.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,OAAO,UAAU;IACb,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAChI,OAAO,CAAa;IACpB,OAAO,CAAc;IACrB,IAAI,CAAS;IAE7B,YAAmB,OAAoB,EAAE,OAAmB,EAAE,IAAY;QACxE,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;YACrD,MAAM,IAAI,4BAA4B,CAAC,OAAO,CAAC,CAAC;QAClD,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI;YACvB,MAAM,IAAI,uBAAuB,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAE1D,IAAI,CAAC,OAAO,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC;IACzC,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;QACtE,MAAM,CAAC,iBAAiB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,EAC/I,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;QAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACvD,IAAI,KAAK,KAAK,MAAM,CAAC,KAAK;YACxB,MAAM,IAAI,wBAAwB,CAAC,KAAK,CAAC,CAAC;QAC5C,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,MAAM;QACX,OAAO;YACL,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAC/C,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;YACrD,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,KAAK;YAClC,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI;SACjC,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { UnknownRestoreActionException } from "../exceptions/unknown-restore-action.exception.js";
9
+ export class RestoreAction {
10
+ static Write = new RestoreAction("Write");
11
+ static Replace = new RestoreAction("Replace");
12
+ static Delete = new RestoreAction("Delete");
13
+ static ALL = [RestoreAction.Write, RestoreAction.Replace, RestoreAction.Delete];
14
+ value;
15
+ constructor(value) {
16
+ this.value = value;
17
+ }
18
+ static fromJson(value) {
19
+ const action = RestoreAction.ALL.find(t => t.value === value);
20
+ if (action === undefined)
21
+ throw new UnknownRestoreActionException(String(value));
22
+ return action;
23
+ }
24
+ toJson() {
25
+ return this.value;
26
+ }
27
+ }
28
+ //# sourceMappingURL=restore-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restore-action.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/restore-action.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAElG,MAAM,OAAO,aAAa;IACjB,MAAM,CAAU,KAAK,GAAkB,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;IAClE,MAAM,CAAU,OAAO,GAAkB,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC;IACtE,MAAM,CAAU,MAAM,GAAkB,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC;IACnE,MAAM,CAAU,GAAG,GAA6B,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC3G,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,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAC9D,IAAI,MAAM,KAAK,SAAS;YACtB,MAAM,IAAI,6BAA6B,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACzD,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) Noldova.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ import { InvalidRelativePathException } from "../exceptions/invalid-relative-path.exception.js";
9
+ import { Resources } from "../resources.js";
10
+ import { FolderIdentity } from "../services/folder-identity.js";
11
+ import { JsonObjectReader } from "../services/json-object.reader.js";
12
+ import { RelativePath } from "../services/relative-path.js";
13
+ export class RestoreHeldUpEvent {
14
+ static event = Resources.restoreHeldUpEvent;
15
+ static FIELDS = [Resources.identityField, Resources.pathsField];
16
+ identity;
17
+ paths;
18
+ constructor(identity, paths) {
19
+ FolderIdentity.check(identity);
20
+ for (const path of paths)
21
+ if (!RelativePath.isValid(path))
22
+ throw new InvalidRelativePathException(path);
23
+ this.identity = identity;
24
+ this.paths = [...paths];
25
+ }
26
+ static fromJson(value) {
27
+ const reader = new JsonObjectReader(value, Resources.restoreHeldUpEventModel);
28
+ reader.refuseOtherFields(RestoreHeldUpEvent.FIELDS);
29
+ return new RestoreHeldUpEvent(reader.readString(Resources.identityField), reader.readStringList(Resources.pathsField));
30
+ }
31
+ toJson() {
32
+ return { [Resources.identityField]: this.identity, [Resources.pathsField]: [...this.paths] };
33
+ }
34
+ }
35
+ //# sourceMappingURL=restore-held-up-event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restore-held-up-event.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/restore-held-up-event.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,MAAM,OAAO,kBAAkB;IACtB,MAAM,CAAU,KAAK,GAAW,SAAS,CAAC,kBAAkB,CAAC;IAC5D,MAAM,CAAU,MAAM,GAAsB,CAAC,SAAS,CAAC,aAAa,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IACpF,QAAQ,CAAS;IACjB,KAAK,CAAoB;IAEzC,YAAmB,QAAgB,EAAE,KAAwB;QAC3D,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC/B,KAAK,MAAM,IAAI,IAAI,KAAK;YACtB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;gBAC7B,MAAM,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;QAEjD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IAC1B,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,uBAAuB,CAAC,CAAC;QAC9E,MAAM,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QACpD,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IACzH,CAAC;IAEM,MAAM;QACX,OAAO,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IAC/F,CAAC;CACF"}