@owlmeans/client-planning 0.1.18-rc.8 → 0.1.18
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 +94 -11
- package/agent-meta/manifest.json +62 -4
- package/agent-meta/skills/client-planning/SKILL.md +60 -78
- package/agent-meta/skills/client-planning/parts/aux-mirrors.md +61 -0
- package/agent-meta/skills/client-planning/parts/mirror.md +67 -0
- package/agent-meta/skills/client-planning/parts/validation.md +60 -0
- package/build/client.d.ts +1 -1
- package/build/client.d.ts.map +1 -1
- package/build/client.js +66 -14
- package/build/client.js.map +1 -1
- package/build/commits.d.ts +2 -13
- package/build/commits.d.ts.map +1 -1
- package/build/commits.js +190 -132
- package/build/commits.js.map +1 -1
- package/build/consts.d.ts +4 -0
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +10 -4
- package/build/consts.js.map +1 -1
- package/build/definitions.d.ts +13 -0
- package/build/definitions.d.ts.map +1 -0
- package/build/definitions.js +70 -0
- package/build/definitions.js.map +1 -0
- package/build/events/types.d.ts +34 -0
- package/build/events/types.d.ts.map +1 -0
- package/build/events/types.js +2 -0
- package/build/events/types.js.map +1 -0
- package/build/events.d.ts +10 -21
- package/build/events.d.ts.map +1 -1
- package/build/events.js +104 -102
- package/build/events.js.map +1 -1
- package/build/facade.d.ts.map +1 -1
- package/build/facade.js +86 -49
- package/build/facade.js.map +1 -1
- package/build/feed.d.ts +4 -4
- package/build/feed.d.ts.map +1 -1
- package/build/feed.js +50 -27
- package/build/feed.js.map +1 -1
- package/build/helper/types.d.ts +15 -0
- package/build/helper/types.d.ts.map +1 -0
- package/build/helper/types.js +2 -0
- package/build/helper/types.js.map +1 -0
- package/build/helper.d.ts +7 -7
- package/build/helper.d.ts.map +1 -1
- package/build/helper.js +16 -8
- package/build/helper.js.map +1 -1
- package/build/index.d.ts +11 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -0
- package/build/index.js.map +1 -1
- package/build/lifecycle/types.d.ts +27 -0
- package/build/lifecycle/types.d.ts.map +1 -0
- package/build/lifecycle/types.js +2 -0
- package/build/lifecycle/types.js.map +1 -0
- package/build/lifecycle.d.ts +3 -0
- package/build/lifecycle.d.ts.map +1 -0
- package/build/lifecycle.js +157 -0
- package/build/lifecycle.js.map +1 -0
- package/build/resource-feed.d.ts +5 -0
- package/build/resource-feed.d.ts.map +1 -0
- package/build/resource-feed.js +97 -0
- package/build/resource-feed.js.map +1 -0
- package/build/resources.d.ts +6 -0
- package/build/resources.d.ts.map +1 -0
- package/build/resources.js +93 -0
- package/build/resources.js.map +1 -0
- package/build/stores.d.ts +4 -11
- package/build/stores.d.ts.map +1 -1
- package/build/stores.js +11 -35
- package/build/stores.js.map +1 -1
- package/build/sync/types.d.ts +18 -0
- package/build/sync/types.d.ts.map +1 -0
- package/build/sync/types.js +2 -0
- package/build/sync/types.js.map +1 -0
- package/build/sync.d.ts +4 -0
- package/build/sync.d.ts.map +1 -0
- package/build/sync.js +26 -0
- package/build/sync.js.map +1 -0
- package/build/types.d.ts +48 -3
- package/build/types.d.ts.map +1 -1
- package/build/types.local.d.ts +13 -0
- package/build/types.local.d.ts.map +1 -0
- package/build/types.local.js +2 -0
- package/build/types.local.js.map +1 -0
- package/build/utils/record/types.d.ts +28 -0
- package/build/utils/record/types.d.ts.map +1 -0
- package/build/utils/record/types.js +2 -0
- package/build/utils/record/types.js.map +1 -0
- package/build/utils/record.d.ts +3 -24
- package/build/utils/record.d.ts.map +1 -1
- package/build/utils/record.js +64 -70
- package/build/utils/record.js.map +1 -1
- package/build/validation/consts.d.ts +23 -0
- package/build/validation/consts.d.ts.map +1 -0
- package/build/validation/consts.js +289 -0
- package/build/validation/consts.js.map +1 -0
- package/build/validation/types.d.ts +17 -0
- package/build/validation/types.d.ts.map +1 -0
- package/build/validation/types.js +2 -0
- package/build/validation/types.js.map +1 -0
- package/build/validation.d.ts +10 -0
- package/build/validation.d.ts.map +1 -0
- package/build/validation.js +171 -0
- package/build/validation.js.map +1 -0
- package/package.json +20 -18
- package/src/client.ts +58 -15
- package/src/commits.ts +152 -184
- package/src/consts.ts +12 -4
- package/src/definitions.ts +93 -0
- package/src/events/types.ts +35 -0
- package/src/events.ts +118 -108
- package/src/facade.ts +87 -55
- package/src/feed.ts +47 -28
- package/src/helper/types.ts +15 -0
- package/src/helper.ts +27 -10
- package/src/index.ts +12 -0
- package/src/lifecycle/types.ts +28 -0
- package/src/lifecycle.ts +123 -0
- package/src/resource-feed.ts +79 -0
- package/src/resources.ts +84 -0
- package/src/stores.ts +11 -40
- package/src/sync/types.ts +18 -0
- package/src/sync.ts +40 -0
- package/src/types.local.ts +14 -0
- package/src/types.ts +53 -5
- package/src/utils/record/types.ts +27 -0
- package/src/utils/record.ts +68 -71
- package/src/validation/consts.ts +289 -0
- package/src/validation/types.ts +18 -0
- package/src/validation.ts +140 -0
- package/tests/app.spec.ts +72 -0
- package/tests/context.ts +46 -15
- package/tests/csp.spec.ts +119 -0
- package/tests/definitions.spec.ts +74 -0
- package/tests/draft7.spec.ts +13 -0
- package/tests/events.spec.ts +13 -9
- package/tests/facade.spec.ts +2 -1
- package/tests/lifecycle/context.ts +29 -0
- package/tests/lifecycle-close.spec.ts +103 -0
- package/tests/lifecycle-commits.spec.ts +92 -0
- package/tests/lifecycle-definitions.spec.ts +28 -0
- package/tests/lifecycle-feeds.spec.ts +92 -0
- package/tests/lifecycle-sockets.spec.ts +76 -0
- package/tests/replies.spec.ts +81 -0
- package/tests/resources.spec.ts +116 -0
- package/tests/stores.spec.ts +13 -11
- package/tests/validation.spec.ts +127 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/** Draft 7 vocabulary, plus AJV's $defs spelling. Other vocabularies fail closed. */
|
|
2
|
+
export const FIELD_SCHEMA_KEYWORDS = new Set([
|
|
3
|
+
'$id', '$schema', '$ref', '$comment', '$defs', 'definitions', 'type', 'nullable', 'const', 'enum',
|
|
4
|
+
'required', 'properties', 'patternProperties', 'additionalProperties', 'propertyNames',
|
|
5
|
+
'minProperties', 'maxProperties', 'dependencies', 'items', 'additionalItems', 'contains',
|
|
6
|
+
'minItems', 'maxItems', 'uniqueItems', 'minimum', 'maximum', 'exclusiveMinimum',
|
|
7
|
+
'exclusiveMaximum', 'multipleOf', 'minLength', 'maxLength', 'pattern', 'format',
|
|
8
|
+
'allOf', 'anyOf', 'oneOf', 'not', 'if', 'then', 'else', 'title', 'description', 'default',
|
|
9
|
+
'examples', 'readOnly', 'writeOnly', 'contentMediaType', 'contentEncoding',
|
|
10
|
+
]);
|
|
11
|
+
export const FIELD_SCHEMA_MAPS = new Set(['properties', 'patternProperties', 'definitions', '$defs']);
|
|
12
|
+
export const FIELD_SCHEMA_ARRAYS = new Set(['allOf', 'anyOf', 'oneOf']);
|
|
13
|
+
export const FIELD_SCHEMA_CHILDREN = new Set([
|
|
14
|
+
'additionalProperties', 'propertyNames', 'additionalItems', 'contains', 'not', 'if', 'then', 'else',
|
|
15
|
+
]);
|
|
16
|
+
export const FIELD_SCHEMA_ANNOTATIONS = new Set([
|
|
17
|
+
'$comment', 'title', 'description', 'default', 'examples', 'readOnly', 'writeOnly',
|
|
18
|
+
'contentMediaType', 'contentEncoding',
|
|
19
|
+
]);
|
|
20
|
+
export const FIELD_SCHEMA_DRAFTS = new Set([
|
|
21
|
+
'http://json-schema.org/draft-07/schema', 'http://json-schema.org/draft-07/schema#',
|
|
22
|
+
'https://json-schema.org/draft-07/schema', 'https://json-schema.org/draft-07/schema#',
|
|
23
|
+
]);
|
|
24
|
+
/** Reserved predicates never replace cfworker's own global format definitions. */
|
|
25
|
+
export const FIELD_FORMAT_PREFIX = 'owlmeans-planning:';
|
|
26
|
+
export const MAX_FIELD_ERRORS = 64;
|
|
27
|
+
export const MAX_FIELD_ERROR_PATH = 512;
|
|
28
|
+
export const REQUIRED_ERROR_PREFIX = 'Instance does not have required property "';
|
|
29
|
+
export const REQUIRED_ERROR_SUFFIX = '".';
|
|
30
|
+
export const FIELD_ERROR_WRAPPERS = new Set(['properties', 'patternProperties', 'items', '$ref', 'allOf', 'if']);
|
|
31
|
+
export const FIELD_ERROR_MESSAGES = {
|
|
32
|
+
required: 'A required field is missing', type: 'The field has an invalid type',
|
|
33
|
+
enum: 'Choose one of the allowed values', const: 'The field must match its fixed value',
|
|
34
|
+
format: 'The field has an invalid format', pattern: 'The field does not match its required pattern',
|
|
35
|
+
additionalProperties: 'This field is not allowed', additionalItems: 'This item is not allowed',
|
|
36
|
+
minimum: 'The value is below its minimum', maximum: 'The value exceeds its maximum',
|
|
37
|
+
exclusiveMinimum: 'The value must exceed its minimum', exclusiveMaximum: 'The value must be below its maximum',
|
|
38
|
+
multipleOf: 'The value is not an allowed multiple', minLength: 'The value is too short',
|
|
39
|
+
maxLength: 'The value is too long', minItems: 'There are too few items', maxItems: 'There are too many items',
|
|
40
|
+
uniqueItems: 'Items must be distinct', minProperties: 'There are too few fields', maxProperties: 'There are too many fields',
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The JSON Schema draft-07 meta-schema a field schema is checked against — ajv's own
|
|
44
|
+
* `refs/json-schema-draft-07.json`, kept here as data. Importing that file directly needs a JSON
|
|
45
|
+
* import attribute in Node, and a bundler that also meets ajv's own attribute-less `require` of the
|
|
46
|
+
* same file refuses the two (Rollup: "import attributes for the same module are always consistent").
|
|
47
|
+
*/
|
|
48
|
+
export const JSON_SCHEMA_DRAFT_07 = Object.freeze({
|
|
49
|
+
'$schema': 'http://json-schema.org/draft-07/schema#',
|
|
50
|
+
'$id': 'http://json-schema.org/draft-07/schema#',
|
|
51
|
+
'title': 'Core schema meta-schema',
|
|
52
|
+
'definitions': {
|
|
53
|
+
'schemaArray': {
|
|
54
|
+
'type': 'array',
|
|
55
|
+
'minItems': 1,
|
|
56
|
+
'items': {
|
|
57
|
+
'$ref': '#'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
'nonNegativeInteger': {
|
|
61
|
+
'type': 'integer',
|
|
62
|
+
'minimum': 0
|
|
63
|
+
},
|
|
64
|
+
'nonNegativeIntegerDefault0': {
|
|
65
|
+
'allOf': [
|
|
66
|
+
{
|
|
67
|
+
'$ref': '#/definitions/nonNegativeInteger'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
'default': 0
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
'simpleTypes': {
|
|
75
|
+
'enum': [
|
|
76
|
+
'array',
|
|
77
|
+
'boolean',
|
|
78
|
+
'integer',
|
|
79
|
+
'null',
|
|
80
|
+
'number',
|
|
81
|
+
'object',
|
|
82
|
+
'string'
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
'stringArray': {
|
|
86
|
+
'type': 'array',
|
|
87
|
+
'items': {
|
|
88
|
+
'type': 'string'
|
|
89
|
+
},
|
|
90
|
+
'uniqueItems': true,
|
|
91
|
+
'default': []
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
'type': [
|
|
95
|
+
'object',
|
|
96
|
+
'boolean'
|
|
97
|
+
],
|
|
98
|
+
'properties': {
|
|
99
|
+
'$id': {
|
|
100
|
+
'type': 'string',
|
|
101
|
+
'format': 'uri-reference'
|
|
102
|
+
},
|
|
103
|
+
'$schema': {
|
|
104
|
+
'type': 'string',
|
|
105
|
+
'format': 'uri'
|
|
106
|
+
},
|
|
107
|
+
'$ref': {
|
|
108
|
+
'type': 'string',
|
|
109
|
+
'format': 'uri-reference'
|
|
110
|
+
},
|
|
111
|
+
'$comment': {
|
|
112
|
+
'type': 'string'
|
|
113
|
+
},
|
|
114
|
+
'title': {
|
|
115
|
+
'type': 'string'
|
|
116
|
+
},
|
|
117
|
+
'description': {
|
|
118
|
+
'type': 'string'
|
|
119
|
+
},
|
|
120
|
+
'default': true,
|
|
121
|
+
'readOnly': {
|
|
122
|
+
'type': 'boolean',
|
|
123
|
+
'default': false
|
|
124
|
+
},
|
|
125
|
+
'examples': {
|
|
126
|
+
'type': 'array',
|
|
127
|
+
'items': true
|
|
128
|
+
},
|
|
129
|
+
'multipleOf': {
|
|
130
|
+
'type': 'number',
|
|
131
|
+
'exclusiveMinimum': 0
|
|
132
|
+
},
|
|
133
|
+
'maximum': {
|
|
134
|
+
'type': 'number'
|
|
135
|
+
},
|
|
136
|
+
'exclusiveMaximum': {
|
|
137
|
+
'type': 'number'
|
|
138
|
+
},
|
|
139
|
+
'minimum': {
|
|
140
|
+
'type': 'number'
|
|
141
|
+
},
|
|
142
|
+
'exclusiveMinimum': {
|
|
143
|
+
'type': 'number'
|
|
144
|
+
},
|
|
145
|
+
'maxLength': {
|
|
146
|
+
'$ref': '#/definitions/nonNegativeInteger'
|
|
147
|
+
},
|
|
148
|
+
'minLength': {
|
|
149
|
+
'$ref': '#/definitions/nonNegativeIntegerDefault0'
|
|
150
|
+
},
|
|
151
|
+
'pattern': {
|
|
152
|
+
'type': 'string',
|
|
153
|
+
'format': 'regex'
|
|
154
|
+
},
|
|
155
|
+
'additionalItems': {
|
|
156
|
+
'$ref': '#'
|
|
157
|
+
},
|
|
158
|
+
'items': {
|
|
159
|
+
'anyOf': [
|
|
160
|
+
{
|
|
161
|
+
'$ref': '#'
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
'$ref': '#/definitions/schemaArray'
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
'default': true
|
|
168
|
+
},
|
|
169
|
+
'maxItems': {
|
|
170
|
+
'$ref': '#/definitions/nonNegativeInteger'
|
|
171
|
+
},
|
|
172
|
+
'minItems': {
|
|
173
|
+
'$ref': '#/definitions/nonNegativeIntegerDefault0'
|
|
174
|
+
},
|
|
175
|
+
'uniqueItems': {
|
|
176
|
+
'type': 'boolean',
|
|
177
|
+
'default': false
|
|
178
|
+
},
|
|
179
|
+
'contains': {
|
|
180
|
+
'$ref': '#'
|
|
181
|
+
},
|
|
182
|
+
'maxProperties': {
|
|
183
|
+
'$ref': '#/definitions/nonNegativeInteger'
|
|
184
|
+
},
|
|
185
|
+
'minProperties': {
|
|
186
|
+
'$ref': '#/definitions/nonNegativeIntegerDefault0'
|
|
187
|
+
},
|
|
188
|
+
'required': {
|
|
189
|
+
'$ref': '#/definitions/stringArray'
|
|
190
|
+
},
|
|
191
|
+
'additionalProperties': {
|
|
192
|
+
'$ref': '#'
|
|
193
|
+
},
|
|
194
|
+
'definitions': {
|
|
195
|
+
'type': 'object',
|
|
196
|
+
'additionalProperties': {
|
|
197
|
+
'$ref': '#'
|
|
198
|
+
},
|
|
199
|
+
'default': {}
|
|
200
|
+
},
|
|
201
|
+
'properties': {
|
|
202
|
+
'type': 'object',
|
|
203
|
+
'additionalProperties': {
|
|
204
|
+
'$ref': '#'
|
|
205
|
+
},
|
|
206
|
+
'default': {}
|
|
207
|
+
},
|
|
208
|
+
'patternProperties': {
|
|
209
|
+
'type': 'object',
|
|
210
|
+
'additionalProperties': {
|
|
211
|
+
'$ref': '#'
|
|
212
|
+
},
|
|
213
|
+
'propertyNames': {
|
|
214
|
+
'format': 'regex'
|
|
215
|
+
},
|
|
216
|
+
'default': {}
|
|
217
|
+
},
|
|
218
|
+
'dependencies': {
|
|
219
|
+
'type': 'object',
|
|
220
|
+
'additionalProperties': {
|
|
221
|
+
'anyOf': [
|
|
222
|
+
{
|
|
223
|
+
'$ref': '#'
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
'$ref': '#/definitions/stringArray'
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
'propertyNames': {
|
|
232
|
+
'$ref': '#'
|
|
233
|
+
},
|
|
234
|
+
'const': true,
|
|
235
|
+
'enum': {
|
|
236
|
+
'type': 'array',
|
|
237
|
+
'items': true,
|
|
238
|
+
'minItems': 1,
|
|
239
|
+
'uniqueItems': true
|
|
240
|
+
},
|
|
241
|
+
'type': {
|
|
242
|
+
'anyOf': [
|
|
243
|
+
{
|
|
244
|
+
'$ref': '#/definitions/simpleTypes'
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
'type': 'array',
|
|
248
|
+
'items': {
|
|
249
|
+
'$ref': '#/definitions/simpleTypes'
|
|
250
|
+
},
|
|
251
|
+
'minItems': 1,
|
|
252
|
+
'uniqueItems': true
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
'format': {
|
|
257
|
+
'type': 'string'
|
|
258
|
+
},
|
|
259
|
+
'contentMediaType': {
|
|
260
|
+
'type': 'string'
|
|
261
|
+
},
|
|
262
|
+
'contentEncoding': {
|
|
263
|
+
'type': 'string'
|
|
264
|
+
},
|
|
265
|
+
'if': {
|
|
266
|
+
'$ref': '#'
|
|
267
|
+
},
|
|
268
|
+
'then': {
|
|
269
|
+
'$ref': '#'
|
|
270
|
+
},
|
|
271
|
+
'else': {
|
|
272
|
+
'$ref': '#'
|
|
273
|
+
},
|
|
274
|
+
'allOf': {
|
|
275
|
+
'$ref': '#/definitions/schemaArray'
|
|
276
|
+
},
|
|
277
|
+
'anyOf': {
|
|
278
|
+
'$ref': '#/definitions/schemaArray'
|
|
279
|
+
},
|
|
280
|
+
'oneOf': {
|
|
281
|
+
'$ref': '#/definitions/schemaArray'
|
|
282
|
+
},
|
|
283
|
+
'not': {
|
|
284
|
+
'$ref': '#'
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
'default': true
|
|
288
|
+
});
|
|
289
|
+
//# sourceMappingURL=consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/validation/consts.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IAC3C,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM;IACjG,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,eAAe;IACtF,eAAe,E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AAO;aAClB;YACD,SAAS,EAAE,EAAE;SACd;QACD,cAAc,EAAE;YACd,MAAM,EAAE,QAAQ;YAChB,sBAAsB,EAAE;gBACtB,OAAO,EAAE;oBACP;wBACE,MAAM,EAAE,GAAG;qBACZ;oBACD;wBACE,MAAM,EAAE,2BAA2B;qBACpC;iBACF;aACF;SACF;QACD,eAAe,EAAE;YACf,MAAM,EAAE,GAAG;SACZ;QACD,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACN,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,CAAC;YACb,aAAa,EAAE,IAAI;SACpB;QACD,MAAM,EAAE;YACN,OAAO,EAAE;gBACP;oBACE,MAAM,EAAE,2BAA2B;iBACpC;gBACD;oBACE,MAAM,EAAE,OAAO;oBACf,OAAO,EAAE;wBACP,MAAM,EAAE,2BAA2B;qBACpC;oBACD,UAAU,EAAE,CAAC;oBACb,aAAa,EAAE,IAAI;iBACpB;aACF;SACF;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;SACjB;QACD,kBAAkB,EAAE;YAClB,MAAM,EAAE,QAAQ;SACjB;QACD,iBAAiB,EAAE;YACjB,MAAM,EAAE,QAAQ;SACjB;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,GAAG;SACZ;QACD,MAAM,EAAE;YACN,MAAM,EAAE,GAAG;SACZ;QACD,MAAM,EAAE;YACN,MAAM,EAAE,GAAG;SACZ;QACD,OAAO,EAAE;YACP,MAAM,EAAE,2BAA2B;SACpC;QACD,OAAO,EAAE;YACP,MAAM,EAAE,2BAA2B;SACpC;QACD,OAAO,EAAE;YACP,MAAM,EAAE,2BAA2B;SACpC;QACD,KAAK,EAAE;YACL,MAAM,EAAE,GAAG;SACZ;KACF;IACD,SAAS,EAAE,IAAI;CAChB,CAAC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface PlanningFieldError {
|
|
2
|
+
/** Decoded field path; a required-property error includes the missing property's name. */
|
|
3
|
+
path: string;
|
|
4
|
+
keyword: string;
|
|
5
|
+
schemaPath: string;
|
|
6
|
+
/** A bounded explanation which does not include the submitted value. */
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PlanningFieldValidation {
|
|
10
|
+
valid: boolean;
|
|
11
|
+
errors: PlanningFieldError[];
|
|
12
|
+
}
|
|
13
|
+
export interface PlanningFieldValidator {
|
|
14
|
+
/** Validate without coercion, defaults, removal, code generation or network reference loading. */
|
|
15
|
+
validateFields: (fields: Record<string, unknown>) => PlanningFieldValidation;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/validation/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,0FAA0F;IAC1F,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,kBAAkB,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,sBAAsB;IACrC,kGAAkG;IAClG,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,uBAAuB,CAAA;CAC7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/validation/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AnySchema } from 'ajv';
|
|
2
|
+
import type { PlanningFieldValidator } from './validation/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Interpret the exact served field schema under a strict script-src policy. The vocabulary is
|
|
5
|
+
* Draft 7/$defs/nullable with AJV reference-sibling semantics and its full string-format predicates.
|
|
6
|
+
* Unsupported dialects/extensions, numeric formats and multipleOf schemas refuse
|
|
7
|
+
* during preparation; the server's AJV remains the authoritative validator.
|
|
8
|
+
*/
|
|
9
|
+
export declare const makePlanningFieldValidator: (fieldsSchema: AnySchema) => PlanningFieldValidator;
|
|
10
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAU,MAAM,KAAK,CAAA;AAI5C,OAAO,KAAK,EAA+C,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAOhH;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,iBAAkB,SAAS,KAAG,sBAwHpE,CAAA"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { dereference, format, validate as interpret, Validator } from '@cfworker/json-schema';
|
|
2
|
+
import formatsPlugin from 'ajv-formats';
|
|
3
|
+
import { SchemaInvalid } from '@owlmeans/planning';
|
|
4
|
+
import { FIELD_ERROR_MESSAGES, FIELD_ERROR_WRAPPERS, FIELD_FORMAT_PREFIX, FIELD_SCHEMA_ANNOTATIONS, FIELD_SCHEMA_ARRAYS, FIELD_SCHEMA_CHILDREN, FIELD_SCHEMA_DRAFTS, FIELD_SCHEMA_KEYWORDS, FIELD_SCHEMA_MAPS, JSON_SCHEMA_DRAFT_07, MAX_FIELD_ERRORS, MAX_FIELD_ERROR_PATH, REQUIRED_ERROR_PREFIX, REQUIRED_ERROR_SUFFIX, } from './validation/consts.js';
|
|
5
|
+
/**
|
|
6
|
+
* Interpret the exact served field schema under a strict script-src policy. The vocabulary is
|
|
7
|
+
* Draft 7/$defs/nullable with AJV reference-sibling semantics and its full string-format predicates.
|
|
8
|
+
* Unsupported dialects/extensions, numeric formats and multipleOf schemas refuse
|
|
9
|
+
* during preparation; the server's AJV remains the authoritative validator.
|
|
10
|
+
*/
|
|
11
|
+
export const makePlanningFieldValidator = (fieldsSchema) => {
|
|
12
|
+
const invalid = (path, keyword) => {
|
|
13
|
+
throw new SchemaInvalid(`client:fields:${keyword}:${path.slice(0, MAX_FIELD_ERROR_PATH)}`);
|
|
14
|
+
};
|
|
15
|
+
const pointer = (part) => part.replaceAll('~', '~0').replaceAll('/', '~1');
|
|
16
|
+
const nodes = new Map();
|
|
17
|
+
const meta = new Validator(structuredClone(JSON_SCHEMA_DRAFT_07), '7', false);
|
|
18
|
+
const prepare = (source, path) => {
|
|
19
|
+
if (typeof source === 'boolean')
|
|
20
|
+
return source;
|
|
21
|
+
if (source == null || typeof source !== 'object' || Array.isArray(source))
|
|
22
|
+
return invalid(path, 'schema');
|
|
23
|
+
const checked = meta.validate(source);
|
|
24
|
+
if (!checked.valid)
|
|
25
|
+
return invalid(`${path}${checked.errors[0]?.instanceLocation.slice(1) ?? ''}`, 'malformed');
|
|
26
|
+
const node = {};
|
|
27
|
+
nodes.set(node, path);
|
|
28
|
+
for (const [key, value] of Object.entries(source)) {
|
|
29
|
+
const next = `${path}/${pointer(key)}`;
|
|
30
|
+
if (!FIELD_SCHEMA_KEYWORDS.has(key) && !key.startsWith('x-'))
|
|
31
|
+
invalid(next, 'unsupported-keyword');
|
|
32
|
+
if (FIELD_SCHEMA_ANNOTATIONS.has(key) || key.startsWith('x-'))
|
|
33
|
+
continue;
|
|
34
|
+
if (key === 'nullable')
|
|
35
|
+
continue;
|
|
36
|
+
if (key === '$schema' && !FIELD_SCHEMA_DRAFTS.has(String(value)))
|
|
37
|
+
invalid(next, 'unsupported-draft');
|
|
38
|
+
// The interpreters disagree on floating tolerance and large/scientific-notation quotients.
|
|
39
|
+
if (key === 'multipleOf')
|
|
40
|
+
invalid(next, 'unsupported-multipleOf');
|
|
41
|
+
if (key === 'format') {
|
|
42
|
+
let definition;
|
|
43
|
+
try {
|
|
44
|
+
definition = formatsPlugin.get(value, 'full');
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return invalid(next, 'unsupported-format');
|
|
48
|
+
}
|
|
49
|
+
if (typeof definition === 'object' && !(definition instanceof RegExp) && definition.type === 'number') {
|
|
50
|
+
invalid(next, 'unsupported-numeric-format');
|
|
51
|
+
}
|
|
52
|
+
if (typeof definition === 'object' && !(definition instanceof RegExp) && 'async' in definition && definition.async === true) {
|
|
53
|
+
invalid(next, 'unsupported-async-format');
|
|
54
|
+
}
|
|
55
|
+
const guard = typeof definition === 'object' && !(definition instanceof RegExp) ? definition.validate : definition;
|
|
56
|
+
const predicate = typeof guard === 'string' ? new RegExp(guard, 'u') : guard;
|
|
57
|
+
const name = `${FIELD_FORMAT_PREFIX}${String(value)}`;
|
|
58
|
+
format[name] ??= input => predicate === true || (predicate instanceof RegExp ? predicate.test(input)
|
|
59
|
+
: predicate(input)) === true;
|
|
60
|
+
node.format = name;
|
|
61
|
+
}
|
|
62
|
+
else if (FIELD_SCHEMA_MAPS.has(key)) {
|
|
63
|
+
if (value == null || typeof value !== 'object' || Array.isArray(value))
|
|
64
|
+
invalid(next, 'malformed');
|
|
65
|
+
node[key] = Object.fromEntries(Object.entries(value)
|
|
66
|
+
.map(([name, child]) => [name, prepare(child, `${next}/${pointer(name)}`)]));
|
|
67
|
+
}
|
|
68
|
+
else if (FIELD_SCHEMA_ARRAYS.has(key) || (key === 'items' && Array.isArray(value))) {
|
|
69
|
+
node[key] = value.map((child, index) => prepare(child, `${next}/${index}`));
|
|
70
|
+
}
|
|
71
|
+
else if (FIELD_SCHEMA_CHILDREN.has(key) || key === 'items') {
|
|
72
|
+
node[key] = prepare(value, next);
|
|
73
|
+
}
|
|
74
|
+
else if (key === 'dependencies') {
|
|
75
|
+
;
|
|
76
|
+
node[key] = Object.fromEntries(Object.entries(value)
|
|
77
|
+
.map(([name, child]) => [name, Array.isArray(child) ? child : prepare(child, `${next}/${pointer(name)}`)]));
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
node[key] = structuredClone(value);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if ('nullable' in source) {
|
|
84
|
+
const nullable = source.nullable;
|
|
85
|
+
if (typeof nullable !== 'boolean' || node.type == null)
|
|
86
|
+
invalid(`${path}/nullable`, 'malformed');
|
|
87
|
+
const kinds = Array.isArray(node.type) ? node.type : [node.type];
|
|
88
|
+
if (nullable)
|
|
89
|
+
node.type = [...new Set([...kinds, 'null'])];
|
|
90
|
+
else if (kinds.includes('null'))
|
|
91
|
+
invalid(`${path}/nullable`, 'malformed');
|
|
92
|
+
}
|
|
93
|
+
return node;
|
|
94
|
+
};
|
|
95
|
+
const schema = prepare(fieldsSchema, '#');
|
|
96
|
+
let lookup;
|
|
97
|
+
try {
|
|
98
|
+
lookup = dereference(schema);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return invalid('#', 'invalid-reference');
|
|
102
|
+
}
|
|
103
|
+
for (const [node, path] of nodes) {
|
|
104
|
+
if (node.$ref != null && lookup[node.__absolute_ref__] === undefined)
|
|
105
|
+
invalid(`${path}/$ref`, 'missing-reference');
|
|
106
|
+
}
|
|
107
|
+
const complete = new Set();
|
|
108
|
+
const visiting = new Set();
|
|
109
|
+
const checkReferences = (node) => {
|
|
110
|
+
if (typeof node === 'boolean' || complete.has(node))
|
|
111
|
+
return;
|
|
112
|
+
if (visiting.has(node))
|
|
113
|
+
invalid(nodes.get(node) ?? '#', 'cyclic-reference');
|
|
114
|
+
visiting.add(node);
|
|
115
|
+
if (node.$ref != null)
|
|
116
|
+
checkReferences(lookup[node.__absolute_ref__]);
|
|
117
|
+
// These evaluate the same instance; properties/items make productive recursive schemas.
|
|
118
|
+
for (const key of ['allOf', 'anyOf', 'oneOf'])
|
|
119
|
+
node[key]?.forEach(checkReferences);
|
|
120
|
+
for (const key of ['not', 'if', 'then', 'else'])
|
|
121
|
+
if (node[key] != null)
|
|
122
|
+
checkReferences(node[key]);
|
|
123
|
+
for (const child of Object.values(node.dependencies ?? {}))
|
|
124
|
+
if (!Array.isArray(child))
|
|
125
|
+
checkReferences(child);
|
|
126
|
+
visiting.delete(node);
|
|
127
|
+
complete.add(node);
|
|
128
|
+
};
|
|
129
|
+
nodes.forEach((_path, node) => checkReferences(node));
|
|
130
|
+
const fieldError = (error) => {
|
|
131
|
+
const parts = error.instanceLocation.slice(1).replace(/^\//, '').split('/').filter(Boolean)
|
|
132
|
+
.map(part => part.replaceAll('~1', '/').replaceAll('~0', '~'));
|
|
133
|
+
if (error.keyword === 'required' && error.error.startsWith(REQUIRED_ERROR_PREFIX) && error.error.endsWith(REQUIRED_ERROR_SUFFIX)) {
|
|
134
|
+
parts.push(error.error.slice(REQUIRED_ERROR_PREFIX.length, -REQUIRED_ERROR_SUFFIX.length));
|
|
135
|
+
}
|
|
136
|
+
return { path: parts.join('.').slice(0, MAX_FIELD_ERROR_PATH), keyword: error.keyword,
|
|
137
|
+
schemaPath: error.keywordLocation.slice(0, MAX_FIELD_ERROR_PATH),
|
|
138
|
+
message: FIELD_ERROR_MESSAGES[error.keyword] ?? 'The field does not match its definition' };
|
|
139
|
+
};
|
|
140
|
+
const jsonErrors = (value, path, active) => {
|
|
141
|
+
if (value === null || typeof value === 'string' || typeof value === 'boolean'
|
|
142
|
+
|| (typeof value === 'number' && Number.isFinite(value)))
|
|
143
|
+
return [];
|
|
144
|
+
if (typeof value !== 'object' || active.has(value))
|
|
145
|
+
return [{ path, keyword: 'json', schemaPath: '#', message: 'Use a JSON value' }];
|
|
146
|
+
const plain = Array.isArray(value) || Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null;
|
|
147
|
+
if (!plain)
|
|
148
|
+
return [{ path, keyword: 'json', schemaPath: '#', message: 'Use a JSON value' }];
|
|
149
|
+
active.add(value);
|
|
150
|
+
const errors = Object.entries(value).flatMap(([key, child]) => [
|
|
151
|
+
...(!Array.isArray(value) && (key.includes('.') || key.includes('$'))
|
|
152
|
+
? [{ path: [path, key].filter(Boolean).join('.'), keyword: 'field-key', schemaPath: '#', message: 'This field name is not allowed' }] : []),
|
|
153
|
+
...jsonErrors(child, [path, key].filter(Boolean).join('.'), active),
|
|
154
|
+
]);
|
|
155
|
+
active.delete(value);
|
|
156
|
+
return errors;
|
|
157
|
+
};
|
|
158
|
+
const validateFields = (fields) => {
|
|
159
|
+
const unsafe = jsonErrors(fields, '', new Set());
|
|
160
|
+
if (unsafe.length > 0)
|
|
161
|
+
return { valid: false, errors: unsafe.slice(0, MAX_FIELD_ERRORS)
|
|
162
|
+
.map(error => ({ ...error, path: error.path.slice(0, MAX_FIELD_ERROR_PATH) })) };
|
|
163
|
+
// Only the guarded Draft 7 vocabulary reaches this engine. This mode, unlike its '7' mode,
|
|
164
|
+
// also enforces sibling keywords beside $ref, as the native planning AJV does.
|
|
165
|
+
const result = interpret(fields, schema, '2019-09', lookup, false);
|
|
166
|
+
const errors = result.errors.filter(error => !FIELD_ERROR_WRAPPERS.has(error.keyword));
|
|
167
|
+
return { valid: result.valid, errors: (errors.length > 0 ? errors : result.errors).slice(0, MAX_FIELD_ERRORS).map(fieldError) };
|
|
168
|
+
};
|
|
169
|
+
return { validateFields };
|
|
170
|
+
};
|
|
171
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,IAAI,SAAS,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAG7F,OAAO,aAAa,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,OAAO,EACL,oBAAoB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,mBAAmB,EAC9G,qBAAqB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,iBAAiB,EACpF,oBAAoB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,qBAAqB,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,CAAC,UAAU,CAAC,EAAE,CAAA;IACjI,CAAC,CAAA;IACD,OAAO,EAAE,cAAc,EAAE,CAAA;AAC3B,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/client-planning",
|
|
3
|
-
"version": "0.1.18
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "The client half of OwlMeans planning
|
|
5
|
+
"description": "The client half of OwlMeans planning \u2014 the remote planning facade, the state mirror and its commit fold, and the subscribe-then-poll commit wait. React-free: it runs in a browser and in a Node client alike.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc -b",
|
|
@@ -23,28 +23,30 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@
|
|
27
|
-
"@owlmeans/
|
|
28
|
-
"@owlmeans/client-
|
|
29
|
-
"@owlmeans/
|
|
30
|
-
"@owlmeans/
|
|
31
|
-
"@owlmeans/
|
|
32
|
-
"@owlmeans/
|
|
33
|
-
"@owlmeans/
|
|
34
|
-
"@owlmeans/
|
|
35
|
-
"@owlmeans/
|
|
36
|
-
"@owlmeans/
|
|
26
|
+
"@cfworker/json-schema": "^4.1.1",
|
|
27
|
+
"@owlmeans/auth": "^0.1.18",
|
|
28
|
+
"@owlmeans/client-context": "^0.1.18",
|
|
29
|
+
"@owlmeans/client-entrypoint": "^0.1.18",
|
|
30
|
+
"@owlmeans/context": "^0.1.18",
|
|
31
|
+
"@owlmeans/entrypoint": "^0.1.18",
|
|
32
|
+
"@owlmeans/error": "^0.1.18",
|
|
33
|
+
"@owlmeans/planning": "^0.1.18",
|
|
34
|
+
"@owlmeans/resource": "^0.1.18",
|
|
35
|
+
"@owlmeans/log": "^0.1.18",
|
|
36
|
+
"@owlmeans/route": "^0.1.18",
|
|
37
|
+
"@owlmeans/socket": "^0.1.18",
|
|
38
|
+
"@owlmeans/state": "^0.1.18"
|
|
37
39
|
},
|
|
38
40
|
"peerDependencies": {
|
|
39
41
|
"ajv": "*",
|
|
40
42
|
"ajv-formats": "*"
|
|
41
43
|
},
|
|
42
44
|
"devDependencies": {
|
|
43
|
-
"@owlmeans/dep-config": "
|
|
44
|
-
"@owlmeans/server-planning": "^0.1.18
|
|
45
|
-
"@owlmeans/test": "^0.1.18
|
|
46
|
-
"@types/bun": "^1.4.
|
|
47
|
-
"ajv": "^8.
|
|
45
|
+
"@owlmeans/dep-config": "^0.1.18",
|
|
46
|
+
"@owlmeans/server-planning": "^0.1.18",
|
|
47
|
+
"@owlmeans/test": "^0.1.18",
|
|
48
|
+
"@types/bun": "^1.4.2",
|
|
49
|
+
"ajv": "^8.20.0",
|
|
48
50
|
"ajv-formats": "^3.0.1",
|
|
49
51
|
"nodemon": "^3.1.14",
|
|
50
52
|
"typescript": "^7.0.2"
|