@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unread-path.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/unread-path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,2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AC,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,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,EAC1H,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IACpD,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,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;IAC/H,CAAC;CACF"}
|
|
@@ -5,20 +5,22 @@
|
|
|
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 { UnknownUnreadReasonException } from "../exceptions/unknown-unread-reason.exception.js";
|
|
9
10
|
export class UnreadReason {
|
|
10
11
|
static Changing = new UnreadReason("Changing");
|
|
11
12
|
static Denied = new UnreadReason("Denied");
|
|
12
13
|
static InvalidName = new UnreadReason("InvalidName");
|
|
14
|
+
static TooLarge = new UnreadReason("TooLarge");
|
|
13
15
|
static Unreadable = new UnreadReason("Unreadable");
|
|
14
|
-
static ALL = [UnreadReason.Changing, UnreadReason.Denied, UnreadReason.InvalidName, UnreadReason.Unreadable];
|
|
16
|
+
static ALL = [UnreadReason.Changing, UnreadReason.Denied, UnreadReason.InvalidName, UnreadReason.TooLarge, UnreadReason.Unreadable];
|
|
15
17
|
value;
|
|
16
18
|
constructor(value) {
|
|
17
19
|
this.value = value;
|
|
18
20
|
}
|
|
19
21
|
static fromJson(value) {
|
|
20
22
|
const reason = UnreadReason.ALL.find(t => t.value === value);
|
|
21
|
-
if (reason
|
|
23
|
+
if (Object.isUndefined(reason))
|
|
22
24
|
throw new UnknownUnreadReasonException(String(value));
|
|
23
25
|
return reason;
|
|
24
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unread-reason.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/unread-reason.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAEhG,MAAM,OAAO,YAAY;IAChB,MAAM,CAAU,QAAQ,GAAiB,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;IACtE,MAAM,CAAU,MAAM,GAAiB,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC;IAClE,MAAM,CAAU,WAAW,GAAiB,IAAI,YAAY,CAAC,aAAa,CAAC,CAAC;IAC5E,MAAM,CAAU,UAAU,GAAiB,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC;IACzE,MAAM,CAAU,GAAG,GAA4B,CAAC,YAAY,CAAC,QAAQ,EAAE,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"unread-reason.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/models/unread-reason.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAEhG,MAAM,OAAO,YAAY;IAChB,MAAM,CAAU,QAAQ,GAAiB,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;IACtE,MAAM,CAAU,MAAM,GAAiB,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC;IAClE,MAAM,CAAU,WAAW,GAAiB,IAAI,YAAY,CAAC,aAAa,CAAC,CAAC;IAC5E,MAAM,CAAU,QAAQ,GAAiB,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC;IACtE,MAAM,CAAU,UAAU,GAAiB,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC;IACzE,MAAM,CAAU,GAAG,GAA4B,CAAC,YAAY,CAAC,QAAQ,EAAE,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAC9J,KAAK,CAAS;IAE9B,YAAoB,KAAa;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QAC7D,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC;YAC5B,MAAM,IAAI,4BAA4B,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
|
package/src/resources.js
CHANGED
|
@@ -10,12 +10,14 @@ export class Resources {
|
|
|
10
10
|
static actionField = "action";
|
|
11
11
|
static afterField = "after";
|
|
12
12
|
static againstField = "against";
|
|
13
|
+
static arrayExpected = "Expected an array.";
|
|
13
14
|
static base64Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
14
15
|
static base64DigitMask = 0x3f;
|
|
15
16
|
static base64GroupLength = 4;
|
|
16
17
|
static base64Padding = "=";
|
|
17
18
|
static base64Pattern = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
18
19
|
static base64TrailingPadding = /=+$/;
|
|
20
|
+
static asOfField = "asOf";
|
|
19
21
|
static beforeField = "before";
|
|
20
22
|
static bitsPerBase64Digit = 6;
|
|
21
23
|
static bitsPerByte = 8;
|
|
@@ -41,11 +43,14 @@ export class Resources {
|
|
|
41
43
|
static compareRequestModel = "CompareRequest";
|
|
42
44
|
static compareResultModel = "CompareResult";
|
|
43
45
|
static contentField = "content";
|
|
46
|
+
static contentLimitField = "contentLimit";
|
|
47
|
+
static contentSizeField = "contentSize";
|
|
44
48
|
static currentFolderName = ".";
|
|
45
49
|
static deleteFolderMethod = "checkpoints.deleteFolder";
|
|
46
50
|
static deleteFolderRequestModel = "DeleteFolderRequest";
|
|
47
51
|
static deleteFolderResultModel = "DeleteFolderResult";
|
|
48
52
|
static diffTargetModel = "DiffTarget";
|
|
53
|
+
static earlierPathsField = "earlierPaths";
|
|
49
54
|
static folderField = "folder";
|
|
50
55
|
static folderReferenceModel = "FolderReference";
|
|
51
56
|
static foldersField = "folders";
|
|
@@ -53,9 +58,9 @@ export class Resources {
|
|
|
53
58
|
static fromField = "from";
|
|
54
59
|
static idField = "id";
|
|
55
60
|
static identityField = "identity";
|
|
56
|
-
static identityPattern = /^[
|
|
61
|
+
static identityPattern = /^[a-z0-9-]{1,64}$/;
|
|
57
62
|
static invalidBase64 = "The content is not base64 text.";
|
|
58
|
-
static invalidIdentity = "A folder's identity must be 1 to 64 letters, digits or hyphens.";
|
|
63
|
+
static invalidIdentity = "A folder's identity must be 1 to 64 lower-case letters, digits or hyphens, so it names one store on every file system.";
|
|
59
64
|
static invalidTime = "A checkpoint's time must be a valid date.";
|
|
60
65
|
static isCutField = "isCut";
|
|
61
66
|
static isTextField = "isText";
|
|
@@ -106,6 +111,7 @@ export class Resources {
|
|
|
106
111
|
static timeField = "time";
|
|
107
112
|
static timePattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
108
113
|
static toField = "to";
|
|
114
|
+
static unknownField = "The field is not part of this message, which accepts no unknown fields.";
|
|
109
115
|
static unreadPathModel = "UnreadPath";
|
|
110
116
|
static unreadPathsField = "unreadPaths";
|
|
111
117
|
static unreadReasonField = "unreadReason";
|
|
@@ -150,48 +156,33 @@ export class Resources {
|
|
|
150
156
|
static formatInvalidTime(value) {
|
|
151
157
|
return `"${value}" is not a time in UTC with milliseconds, such as 2026-10-18T12:00:00.000Z.`;
|
|
152
158
|
}
|
|
159
|
+
static formatFieldPath(path, field) {
|
|
160
|
+
return `${path}.${field}`;
|
|
161
|
+
}
|
|
153
162
|
static formatLabelTooLong(length) {
|
|
154
163
|
return `A label has at most ${Resources.maximumLabelLength} characters; this one has ${length}.`;
|
|
155
164
|
}
|
|
156
|
-
static formatMissingField(model, field) {
|
|
157
|
-
return `${model}.${field} is missing.`;
|
|
158
|
-
}
|
|
159
|
-
static formatNotABoolean(model, field) {
|
|
160
|
-
return `${model}.${field} must be true or false.`;
|
|
161
|
-
}
|
|
162
|
-
static formatNotAList(model, field) {
|
|
163
|
-
return `${model}.${field} must be a list.`;
|
|
164
|
-
}
|
|
165
|
-
static formatNotANumber(model, field) {
|
|
166
|
-
return `${model}.${field} must be a number.`;
|
|
167
|
-
}
|
|
168
|
-
static formatNotANumberOrNull(model, field) {
|
|
169
|
-
return `${model}.${field} must be a number or null.`;
|
|
170
|
-
}
|
|
171
|
-
static formatNotAnObject(model) {
|
|
172
|
-
return `${model} must be a JSON object.`;
|
|
173
|
-
}
|
|
174
|
-
static formatNotAString(model, field) {
|
|
175
|
-
return `${model}.${field} must be a string.`;
|
|
176
|
-
}
|
|
177
|
-
static formatNotAStringList(model, field) {
|
|
178
|
-
return `${model}.${field} must be a list of strings.`;
|
|
179
|
-
}
|
|
180
|
-
static formatNotAStringOrNull(model, field) {
|
|
181
|
-
return `${model}.${field} must be a string or null.`;
|
|
182
|
-
}
|
|
183
165
|
static formatPlanMismatch(outcome) {
|
|
184
166
|
return `A preview result holds a plan exactly when its outcome is Planned; the outcome is ${outcome}.`;
|
|
185
167
|
}
|
|
186
168
|
static formatReadMismatch(outcome) {
|
|
187
169
|
return `A read result holds content and a size only when its outcome is Read; the outcome is ${outcome}.`;
|
|
188
170
|
}
|
|
171
|
+
static formatRestoreContentMismatch(outcome) {
|
|
172
|
+
return `A restore result holds the content size and its limit exactly when its outcome is TooLarge; the outcome is ${outcome}.`;
|
|
173
|
+
}
|
|
189
174
|
static formatRestoreCheckpointsMismatch(outcome) {
|
|
190
175
|
return `A restore result holds the checkpoint before exactly when its outcome is Restored or RolledBack, and a recovered one only when it is Restored; the outcome is ${outcome}.`;
|
|
191
176
|
}
|
|
192
177
|
static formatSideSizeMismatch(kind) {
|
|
193
178
|
return `A side has a size exactly when it isn't a folder, and a folder is never text; the kind is ${kind}.`;
|
|
194
179
|
}
|
|
180
|
+
static formatContentMismatch(outcome) {
|
|
181
|
+
return `A capture result holds the content size and its limit exactly when its outcome is TooLarge; the outcome is ${outcome}.`;
|
|
182
|
+
}
|
|
183
|
+
static formatEarlierPathsMismatch(path) {
|
|
184
|
+
return `A restore plan names each of its earlier paths once, and only a path one of its steps writes; "${path}" is not.`;
|
|
185
|
+
}
|
|
195
186
|
static formatSpaceMismatch(outcome) {
|
|
196
187
|
return `A capture result holds the space free and the space needed exactly when its outcome is LowDiskSpace; the outcome is ${outcome}.`;
|
|
197
188
|
}
|
|
@@ -213,9 +204,6 @@ export class Resources {
|
|
|
213
204
|
static formatUnknownDeleteFolderOutcome(value) {
|
|
214
205
|
return `"${value}" is not a known delete outcome.`;
|
|
215
206
|
}
|
|
216
|
-
static formatUnknownField(model, field) {
|
|
217
|
-
return `${model}.${field} is not a known field.`;
|
|
218
|
-
}
|
|
219
207
|
static formatUnknownKeepReason(value) {
|
|
220
208
|
return `"${value}" is not a known reason a restore keeps a path.`;
|
|
221
209
|
}
|
package/src/resources.js.map
CHANGED
|
@@ -1 +1 @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tD,CAAC;IAEM,MAAM,CAAC,yBAAyB,CAAC,KAAa;QACnD,OAAO,IAAI,KAAK,iCAAiC,CAAC;IACpD,CAAC;IAEM,MAAM,CAAC,2BAA2B,CAAC,KAAa;QACrD,OAAO,IAAI,KAAK,mCAAmC,CAAC;IACtD,CAAC;IAEM,MAAM,CAAC,gCAAgC,CAAC,KAAa;QAC1D,OAAO,IAAI,KAAK,kCAAkC,CAAC;IACrD,CAAC;IAEM,MAAM,CAAC,uBAAuB,CAAC,KAAa;QACjD,OAAO,IAAI,KAAK,iDAAiD,CAAC;IACpE,CAAC;IAEM,MAAM,CAAC,qBAAqB,CAAC,KAAa;QAC/C,OAAO,IAAI,KAAK,gCAAgC,CAAC;IACnD,CAAC;IAEM,MAAM,CAAC,2BAA2B,CAAC,KAAa;QACrD,OAAO,IAAI,KAAK,mCAAmC,CAAC;IACtD,CAAC;IAEM,MAAM,CAAC,wBAAwB,CAAC,KAAa;QAClD,OAAO,IAAI,KAAK,gCAAgC,CAAC;IACnD,CAAC;IAEM,MAAM,CAAC,0BAA0B,CAAC,KAAa;QACpD,OAAO,IAAI,KAAK,kCAAkC,CAAC;IACrD,CAAC;IAEM,MAAM,CAAC,2BAA2B,CAAC,KAAa;QACrD,OAAO,IAAI,KAAK,mCAAmC,CAAC;IACtD,CAAC;IAEM,MAAM,CAAC,yBAAyB,CAAC,KAAa;QACnD,OAAO,IAAI,KAAK,2DAA2D,CAAC;IAC9E,CAAC;IAEM,MAAM,CAAC,wBAAwB,CAAC,MAAc;QACnD,OAAO,uGAAuG,MAAM,GAAG,CAAC;IAC1H,CAAC;IAEM,MAAM,CAAC,0BAA0B,CAAC,MAAc;QACrD,OAAO,+FAA+F,MAAM,GAAG,CAAC;IAClH,CAAC;CACF"}
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
* This source code is licensed under the license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
+
import "@noldova/context.core";
|
|
8
9
|
import { InvalidRelativePathException } from "../exceptions/invalid-relative-path.exception.js";
|
|
9
10
|
import { Resources } from "../resources.js";
|
|
10
11
|
import { RelativePath } from "./relative-path.js";
|
|
11
12
|
export class ScopePaths {
|
|
12
13
|
static of(paths) {
|
|
13
|
-
if (paths
|
|
14
|
+
if (Object.isNull(paths))
|
|
14
15
|
return null;
|
|
15
16
|
for (const path of paths)
|
|
16
17
|
if (path.includes(Resources.windowsPathSeparator) || !RelativePath.isValid(path))
|
|
@@ -18,7 +19,7 @@ export class ScopePaths {
|
|
|
18
19
|
return [...paths];
|
|
19
20
|
}
|
|
20
21
|
static toJson(paths) {
|
|
21
|
-
return paths
|
|
22
|
+
return Object.isNull(paths) ? null : [...paths];
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
//# sourceMappingURL=scope-paths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-paths.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/services/scope-paths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"scope-paths.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/services/scope-paths.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,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,OAAO,UAAU;IACd,MAAM,CAAC,EAAE,CAAC,KAA+B;QAC9C,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;YACtB,OAAO,IAAI,CAAC;QACd,KAAK,MAAM,IAAI,IAAI,KAAK;YACtB,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;gBAC9E,MAAM,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;IACpB,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,KAA+B;QAClD,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;IAClD,CAAC;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 "@noldova/context.core";
|
|
9
|
+
import { JsonException, JsonReader } from "@noldova/context.json";
|
|
10
|
+
import { InvalidTimeException } from "../exceptions/invalid-time.exception.js";
|
|
11
|
+
import { Resources } from "../resources.js";
|
|
12
|
+
export class WireForm {
|
|
13
|
+
static read(value, model, fields) {
|
|
14
|
+
const names = Object.isObject(value) ? Object.keys(value) : [];
|
|
15
|
+
const reader = JsonReader.fromValue(value, model);
|
|
16
|
+
const unknown = names.find(t => !fields.includes(t));
|
|
17
|
+
if (!Object.isUndefined(unknown))
|
|
18
|
+
throw new JsonException(Resources.unknownField, Resources.formatFieldPath(reader.path, unknown));
|
|
19
|
+
return reader;
|
|
20
|
+
}
|
|
21
|
+
static readArray(reader, field) {
|
|
22
|
+
const value = reader.readValue(field);
|
|
23
|
+
if (!Array.isArray(value))
|
|
24
|
+
throw new JsonException(Resources.arrayExpected, Resources.formatFieldPath(reader.path, field));
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
static readNullableNumber(reader, field) {
|
|
28
|
+
return Object.isNull(reader.readValue(field)) ? null : reader.readNumber(field);
|
|
29
|
+
}
|
|
30
|
+
static readNullableTime(reader, field) {
|
|
31
|
+
return Object.isNull(reader.readValue(field)) ? null : WireForm.readTime(reader, field);
|
|
32
|
+
}
|
|
33
|
+
static readTime(reader, field) {
|
|
34
|
+
const time = reader.readString(field);
|
|
35
|
+
if (!Resources.timePattern.test(time) || Number.isNaN(Date.parse(time)) || new Date(time).toISOString() !== time)
|
|
36
|
+
throw new InvalidTimeException(time);
|
|
37
|
+
return new Date(time);
|
|
38
|
+
}
|
|
39
|
+
static readNullableStringArray(reader, field) {
|
|
40
|
+
return Object.isNull(reader.readValue(field)) ? null : reader.readStringArray(field);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=wire-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-form.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/services/wire-form.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,uBAAuB,CAAC;AAElF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,QAAQ;IACZ,MAAM,CAAC,IAAI,CAAC,KAAc,EAAE,KAAa,EAAE,MAAyB;QACzE,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAClD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CA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AAI,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,KAAK,IAAI;YAC9G,MAAM,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACvC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAEM,MAAM,CAAC,uBAAuB,CAAC,MAAkB,EAAE,KAAa;QACrE,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IACvF,CAAC;CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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 { ProtocolException } from "./protocol.exception.js";
|
|
10
|
-
export class FieldNotABooleanException extends ProtocolException {
|
|
11
|
-
field;
|
|
12
|
-
model;
|
|
13
|
-
constructor(model, field) {
|
|
14
|
-
super(Resources.formatNotABoolean(model, field));
|
|
15
|
-
this.field = field;
|
|
16
|
-
this.model = model;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=field-not-a-boolean.exception.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-not-a-boolean.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/field-not-a-boolean.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,yBAA0B,SAAQ,iBAAiB;IAC9C,KAAK,CAAS;IACd,KAAK,CAAS;IAE9B,YAAmB,KAAa,EAAE,KAAa;QAC7C,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAEjD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-not-a-list.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/field-not-a-list.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,sBAAuB,SAAQ,iBAAiB;IAC3C,KAAK,CAAS;IACd,KAAK,CAAS;IAE9B,YAAmB,KAAa,EAAE,KAAa;QAC7C,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAE9C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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 { ProtocolException } from "./protocol.exception.js";
|
|
10
|
-
export class FieldNotANumberOrNullException extends ProtocolException {
|
|
11
|
-
field;
|
|
12
|
-
model;
|
|
13
|
-
constructor(model, field) {
|
|
14
|
-
super(Resources.formatNotANumberOrNull(model, field));
|
|
15
|
-
this.field = field;
|
|
16
|
-
this.model = model;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=field-not-a-number-or-null.exception.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-not-a-number-or-null.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/field-not-a-number-or-null.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,8BAA+B,SAAQ,iBAAiB;IACnD,KAAK,CAAS;IACd,KAAK,CAAS;IAE9B,YAAmB,KAAa,EAAE,KAAa;QAC7C,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAEtD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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 { ProtocolException } from "./protocol.exception.js";
|
|
10
|
-
export class FieldNotANumberException extends ProtocolException {
|
|
11
|
-
field;
|
|
12
|
-
model;
|
|
13
|
-
constructor(model, field) {
|
|
14
|
-
super(Resources.formatNotANumber(model, field));
|
|
15
|
-
this.field = field;
|
|
16
|
-
this.model = model;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=field-not-a-number.exception.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-not-a-number.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/field-not-a-number.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,wBAAyB,SAAQ,iBAAiB;IAC7C,KAAK,CAAS;IACd,KAAK,CAAS;IAE9B,YAAmB,KAAa,EAAE,KAAa;QAC7C,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAEhD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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 { ProtocolException } from "./protocol.exception.js";
|
|
10
|
-
export class FieldNotAStringListException extends ProtocolException {
|
|
11
|
-
field;
|
|
12
|
-
model;
|
|
13
|
-
constructor(model, field) {
|
|
14
|
-
super(Resources.formatNotAStringList(model, field));
|
|
15
|
-
this.field = field;
|
|
16
|
-
this.model = model;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=field-not-a-string-list.exception.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-not-a-string-list.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/field-not-a-string-list.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,4BAA6B,SAAQ,iBAAiB;IACjD,KAAK,CAAS;IACd,KAAK,CAAS;IAE9B,YAAmB,KAAa,EAAE,KAAa;QAC7C,KAAK,CAAC,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAEpD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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 { ProtocolException } from "./protocol.exception.js";
|
|
10
|
-
export class FieldNotAStringOrNullException extends ProtocolException {
|
|
11
|
-
field;
|
|
12
|
-
model;
|
|
13
|
-
constructor(model, field) {
|
|
14
|
-
super(Resources.formatNotAStringOrNull(model, field));
|
|
15
|
-
this.field = field;
|
|
16
|
-
this.model = model;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=field-not-a-string-or-null.exception.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-not-a-string-or-null.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/field-not-a-string-or-null.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,8BAA+B,SAAQ,iBAAiB;IACnD,KAAK,CAAS;IACd,KAAK,CAAS;IAE9B,YAAmB,KAAa,EAAE,KAAa;QAC7C,KAAK,CAAC,SAAS,CAAC,sBAAsB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAEtD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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 { ProtocolException } from "./protocol.exception.js";
|
|
10
|
-
export class FieldNotAStringException extends ProtocolException {
|
|
11
|
-
field;
|
|
12
|
-
model;
|
|
13
|
-
constructor(model, field) {
|
|
14
|
-
super(Resources.formatNotAString(model, field));
|
|
15
|
-
this.field = field;
|
|
16
|
-
this.model = model;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=field-not-a-string.exception.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-not-a-string.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/field-not-a-string.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,wBAAyB,SAAQ,iBAAiB;IAC7C,KAAK,CAAS;IACd,KAAK,CAAS;IAE9B,YAAmB,KAAa,EAAE,KAAa;QAC7C,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAEhD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"missing-field.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/missing-field.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,qBAAsB,SAAQ,iBAAiB;IAC1C,KAAK,CAAS;IACd,KAAK,CAAS;IAE9B,YAAmB,KAAa,EAAE,KAAa;QAC7C,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAElD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"not-an-object.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/not-an-object.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,oBAAqB,SAAQ,iBAAiB;IACzC,KAAK,CAAS;IAE9B,YAAmB,KAAa;QAC9B,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;QAE1C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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 { ProtocolException } from "./protocol.exception.js";
|
|
10
|
-
export class UnknownFieldException extends ProtocolException {
|
|
11
|
-
field;
|
|
12
|
-
model;
|
|
13
|
-
constructor(model, field) {
|
|
14
|
-
super(Resources.formatUnknownField(model, field));
|
|
15
|
-
this.field = field;
|
|
16
|
-
this.model = model;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=unknown-field.exception.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unknown-field.exception.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/exceptions/unknown-field.exception.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,OAAO,qBAAsB,SAAQ,iBAAiB;IAC1C,KAAK,CAAS;IACd,KAAK,CAAS;IAE9B,YAAmB,KAAa,EAAE,KAAa;QAC7C,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QAElD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,89 +0,0 @@
|
|
|
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 { FieldNotABooleanException } from "../exceptions/field-not-a-boolean.exception.js";
|
|
9
|
-
import { FieldNotAListException } from "../exceptions/field-not-a-list.exception.js";
|
|
10
|
-
import { FieldNotANumberOrNullException } from "../exceptions/field-not-a-number-or-null.exception.js";
|
|
11
|
-
import { FieldNotANumberException } from "../exceptions/field-not-a-number.exception.js";
|
|
12
|
-
import { FieldNotAStringListException } from "../exceptions/field-not-a-string-list.exception.js";
|
|
13
|
-
import { FieldNotAStringOrNullException } from "../exceptions/field-not-a-string-or-null.exception.js";
|
|
14
|
-
import { FieldNotAStringException } from "../exceptions/field-not-a-string.exception.js";
|
|
15
|
-
import { MissingFieldException } from "../exceptions/missing-field.exception.js";
|
|
16
|
-
import { NotAnObjectException } from "../exceptions/not-an-object.exception.js";
|
|
17
|
-
import { UnknownFieldException } from "../exceptions/unknown-field.exception.js";
|
|
18
|
-
export class JsonObjectReader {
|
|
19
|
-
fields;
|
|
20
|
-
model;
|
|
21
|
-
constructor(value, model) {
|
|
22
|
-
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
23
|
-
throw new NotAnObjectException(model);
|
|
24
|
-
this.fields = new Map(Object.entries(value));
|
|
25
|
-
this.model = model;
|
|
26
|
-
}
|
|
27
|
-
read(field) {
|
|
28
|
-
if (!this.fields.has(field))
|
|
29
|
-
throw new MissingFieldException(this.model, field);
|
|
30
|
-
return this.fields.get(field);
|
|
31
|
-
}
|
|
32
|
-
readBoolean(field) {
|
|
33
|
-
const value = this.read(field);
|
|
34
|
-
if (typeof value !== "boolean")
|
|
35
|
-
throw new FieldNotABooleanException(this.model, field);
|
|
36
|
-
return value;
|
|
37
|
-
}
|
|
38
|
-
readList(field) {
|
|
39
|
-
const value = this.read(field);
|
|
40
|
-
if (!Array.isArray(value))
|
|
41
|
-
throw new FieldNotAListException(this.model, field);
|
|
42
|
-
return value;
|
|
43
|
-
}
|
|
44
|
-
readNumber(field) {
|
|
45
|
-
const value = this.read(field);
|
|
46
|
-
if (typeof value !== "number")
|
|
47
|
-
throw new FieldNotANumberException(this.model, field);
|
|
48
|
-
return value;
|
|
49
|
-
}
|
|
50
|
-
readNumberOrNull(field) {
|
|
51
|
-
const value = this.read(field);
|
|
52
|
-
if (value !== null && typeof value !== "number")
|
|
53
|
-
throw new FieldNotANumberOrNullException(this.model, field);
|
|
54
|
-
return value;
|
|
55
|
-
}
|
|
56
|
-
readString(field) {
|
|
57
|
-
const value = this.read(field);
|
|
58
|
-
if (typeof value !== "string")
|
|
59
|
-
throw new FieldNotAStringException(this.model, field);
|
|
60
|
-
return value;
|
|
61
|
-
}
|
|
62
|
-
readStringOrNull(field) {
|
|
63
|
-
const value = this.read(field);
|
|
64
|
-
if (value !== null && typeof value !== "string")
|
|
65
|
-
throw new FieldNotAStringOrNullException(this.model, field);
|
|
66
|
-
return value;
|
|
67
|
-
}
|
|
68
|
-
readStringList(field) {
|
|
69
|
-
return this.stringListOf(field, this.read(field));
|
|
70
|
-
}
|
|
71
|
-
readStringListOrNull(field) {
|
|
72
|
-
const value = this.read(field);
|
|
73
|
-
return value === null ? null : this.stringListOf(field, value);
|
|
74
|
-
}
|
|
75
|
-
refuseOtherFields(known) {
|
|
76
|
-
for (const field of this.fields.keys())
|
|
77
|
-
if (!known.includes(field))
|
|
78
|
-
throw new UnknownFieldException(this.model, field);
|
|
79
|
-
}
|
|
80
|
-
stringListOf(field, value) {
|
|
81
|
-
if (!Array.isArray(value))
|
|
82
|
-
throw new FieldNotAStringListException(this.model, field);
|
|
83
|
-
const strings = value.filter((t) => typeof t === "string");
|
|
84
|
-
if (strings.length !== value.length)
|
|
85
|
-
throw new FieldNotAStringListException(this.model, field);
|
|
86
|
-
return strings;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=json-object.reader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-object.reader.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/services/json-object.reader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EA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+0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-object.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/types/json-object.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/src/types/json-value.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-value.js","sourceRoot":"","sources":["../../../../../src/noldova.checkpoints.protocol/src/types/json-value.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|