@cloudhal/core-contracts 0.5.0 → 0.6.1
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/dist/src/generated/index.d.ts +1 -1
- package/dist/src/generated/index.js +1 -1
- package/dist/src/generated/page.d.ts +193 -0
- package/dist/src/generated/page.js +217 -0
- package/dist/src/generated/schemas.d.ts +652 -0
- package/dist/src/generated/schemas.js +434 -0
- package/dist/src/generated/section.d.ts +187 -0
- package/dist/src/generated/section.js +211 -0
- package/dist/src/generated/site.d.ts +283 -0
- package/dist/src/generated/site.js +313 -0
- package/dist/src/generated/validators.js +3607 -1653
- package/package.json +1 -1
- package/schemas/common.schema.json +50 -0
- package/schemas/section.schema.json +9 -1
- package/schemas/site.schema.json +145 -0
|
@@ -123,6 +123,217 @@
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* RFC-0042: one condition on a typed field of the listed collection. `value` is read by the field's type: a number, YYYY-MM-DD, an RFC 3339 instant, true/false, an option value, or `now`. `values` only with `in`.
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* RFC-0042: order a listing by a number, date or datetime field. Entries without a value sort last.
|
|
330
|
+
*/
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
126
337
|
|
|
127
338
|
/**
|
|
128
339
|
* A typed block from the block registry (RFC-0015): `type` names a registered block type (one global namespace of English names), `props` follow that type's props schema, which the store validates.
|
|
@@ -44,6 +44,27 @@ export type FieldDefinition = TextField | RichTextField | NumberField | BooleanF
|
|
|
44
44
|
* via the `definition` "FieldKey".
|
|
45
45
|
*/
|
|
46
46
|
export type FieldKey = string;
|
|
47
|
+
/**
|
|
48
|
+
* RFC-0042: where one JSON-LD property's value comes from, discriminated by `kind`.
|
|
49
|
+
*
|
|
50
|
+
* This interface was referenced by `Site`'s JSON-Schema
|
|
51
|
+
* via the `definition` "StructuredDataSource".
|
|
52
|
+
*/
|
|
53
|
+
export type StructuredDataSource = FieldValueSource | EntryValueSource | SiteValueSource | ConstantValueSource;
|
|
54
|
+
/**
|
|
55
|
+
* RFC-0042: entry properties a structured-data property may read.
|
|
56
|
+
*
|
|
57
|
+
* This interface was referenced by `Site`'s JSON-Schema
|
|
58
|
+
* via the `definition` "EntryValueProperty".
|
|
59
|
+
*/
|
|
60
|
+
export type EntryValueProperty = "title" | "summary" | "body" | "coverImage" | "url" | "publishedAt" | "updatedAt";
|
|
61
|
+
/**
|
|
62
|
+
* RFC-0042: site properties a structured-data property may read.
|
|
63
|
+
*
|
|
64
|
+
* This interface was referenced by `Site`'s JSON-Schema
|
|
65
|
+
* via the `definition` "SiteValueProperty".
|
|
66
|
+
*/
|
|
67
|
+
export type SiteValueProperty = "name" | "url" | "logo";
|
|
47
68
|
/**
|
|
48
69
|
* RFC-0025 §2: one optional surface (kind `surface`) above the footer's columns, built and checked like any surface; the store refuses other section kinds.
|
|
49
70
|
*/
|
|
@@ -235,6 +256,15 @@ export interface CollectionSettings {
|
|
|
235
256
|
* @maxItems 30
|
|
236
257
|
*/
|
|
237
258
|
fields?: [FieldDefinition, ...FieldDefinition[]];
|
|
259
|
+
/**
|
|
260
|
+
* RFC-0042: fields that listings, queries, Studio columns and MCP may filter and sort by, in column order. Keys of this collection's fields (checked in code).
|
|
261
|
+
*
|
|
262
|
+
* @minItems 1
|
|
263
|
+
* @maxItems 4
|
|
264
|
+
*/
|
|
265
|
+
listFields?: [FieldKey] | [FieldKey, FieldKey] | [FieldKey, FieldKey, FieldKey] | [FieldKey, FieldKey, FieldKey, FieldKey];
|
|
266
|
+
expiry?: CollectionExpiry;
|
|
267
|
+
structuredData?: StructuredDataPreset;
|
|
238
268
|
}
|
|
239
269
|
/**
|
|
240
270
|
* This interface was referenced by `Site`'s JSON-Schema
|
|
@@ -472,6 +502,66 @@ export interface FieldOption {
|
|
|
472
502
|
[k: string]: string | undefined;
|
|
473
503
|
};
|
|
474
504
|
}
|
|
505
|
+
/**
|
|
506
|
+
* RFC-0042: a time gate every entry derives from one of its date or datetime fields, checked at render time like Availability.until. A date ends at the start of the next day in the site's time zone.
|
|
507
|
+
*
|
|
508
|
+
* This interface was referenced by `Site`'s JSON-Schema
|
|
509
|
+
* via the `definition` "CollectionExpiry".
|
|
510
|
+
*/
|
|
511
|
+
export interface CollectionExpiry {
|
|
512
|
+
field: FieldKey;
|
|
513
|
+
/**
|
|
514
|
+
* unlist: the page stays, the entry leaves listings, feeds, the sitemap and search. hide: every public route answers 404.
|
|
515
|
+
*/
|
|
516
|
+
action: "unlist" | "hide";
|
|
517
|
+
/**
|
|
518
|
+
* Grace after the field's instant. Absent: 0.
|
|
519
|
+
*/
|
|
520
|
+
afterMinutes?: number;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* RFC-0042: the JSON-LD type an entry page emits in place of BlogPosting, with its properties mapped to value sources. Paths, fitting field types and required properties are a closed table in code (@cloudhal/core-ts/structured-data).
|
|
524
|
+
*
|
|
525
|
+
* This interface was referenced by `Site`'s JSON-Schema
|
|
526
|
+
* via the `definition` "StructuredDataPreset".
|
|
527
|
+
*/
|
|
528
|
+
export interface StructuredDataPreset {
|
|
529
|
+
type: "Event" | "JobPosting" | "Product" | "Recipe";
|
|
530
|
+
/**
|
|
531
|
+
* Keyed by property path, e.g. startDate or location.address.addressLocality.
|
|
532
|
+
*/
|
|
533
|
+
properties: {
|
|
534
|
+
[k: string]: StructuredDataSource | undefined;
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* A typed field of this collection, converted by its type.
|
|
539
|
+
*/
|
|
540
|
+
export interface FieldValueSource {
|
|
541
|
+
kind: "field";
|
|
542
|
+
field: FieldKey;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* A built-in property of the entry.
|
|
546
|
+
*/
|
|
547
|
+
export interface EntryValueSource {
|
|
548
|
+
kind: "entry";
|
|
549
|
+
property: EntryValueProperty;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* A property of the site.
|
|
553
|
+
*/
|
|
554
|
+
export interface SiteValueSource {
|
|
555
|
+
kind: "site";
|
|
556
|
+
property: SiteValueProperty;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* A plain-text constant: no control characters, no markup meaning; vocabulary-checked on enum paths (in code).
|
|
560
|
+
*/
|
|
561
|
+
export interface ConstantValueSource {
|
|
562
|
+
kind: "constant";
|
|
563
|
+
value: string;
|
|
564
|
+
}
|
|
475
565
|
/**
|
|
476
566
|
* Theme (a.k.a. Experience) applied by the renderer. Config is theme-defined and validated by the theme's own schema, not here.
|
|
477
567
|
*
|
|
@@ -712,6 +802,199 @@ export interface ContentListSection {
|
|
|
712
802
|
* Filter expression over term assignments (RFC-0002), e.g. 'category:news+tag:ai' or 'category:news>*'.
|
|
713
803
|
*/
|
|
714
804
|
filter?: string;
|
|
805
|
+
/**
|
|
806
|
+
* RFC-0042: conditions on the collection's list fields, ANDed.
|
|
807
|
+
*
|
|
808
|
+
* @minItems 1
|
|
809
|
+
* @maxItems 4
|
|
810
|
+
*/
|
|
811
|
+
where?: [FieldCondition] | [FieldCondition, FieldCondition] | [FieldCondition, FieldCondition, FieldCondition] | [FieldCondition, FieldCondition, FieldCondition, FieldCondition];
|
|
812
|
+
orderBy?: FieldOrder;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* RFC-0042: one condition on a typed field of the listed collection. `value` is read by the field's type: a number, YYYY-MM-DD, an RFC 3339 instant, true/false, an option value, or `now`. `values` only with `in`.
|
|
816
|
+
*
|
|
817
|
+
* This interface was referenced by `Site`'s JSON-Schema
|
|
818
|
+
* via the `definition` "FieldCondition".
|
|
819
|
+
*/
|
|
820
|
+
export interface FieldCondition {
|
|
821
|
+
/**
|
|
822
|
+
* A field key (site.schema.json FieldKey's pattern, repeated).
|
|
823
|
+
*/
|
|
824
|
+
field: string;
|
|
825
|
+
op: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "in" | "set" | "unset";
|
|
826
|
+
value?: string;
|
|
827
|
+
/**
|
|
828
|
+
* @minItems 1
|
|
829
|
+
* @maxItems 20
|
|
830
|
+
*/
|
|
831
|
+
values?: [string] | [string, string] | [string, string, string] | [string, string, string, string] | [string, string, string, string, string] | [string, string, string, string, string, string] | [string, string, string, string, string, string, string] | [string, string, string, string, string, string, string, string] | [string, string, string, string, string, string, string, string, string] | [string, string, string, string, string, string, string, string, string, string] | [string, string, string, string, string, string, string, string, string, string, string] | [
|
|
832
|
+
string,
|
|
833
|
+
string,
|
|
834
|
+
string,
|
|
835
|
+
string,
|
|
836
|
+
string,
|
|
837
|
+
string,
|
|
838
|
+
string,
|
|
839
|
+
string,
|
|
840
|
+
string,
|
|
841
|
+
string,
|
|
842
|
+
string,
|
|
843
|
+
string
|
|
844
|
+
] | [
|
|
845
|
+
string,
|
|
846
|
+
string,
|
|
847
|
+
string,
|
|
848
|
+
string,
|
|
849
|
+
string,
|
|
850
|
+
string,
|
|
851
|
+
string,
|
|
852
|
+
string,
|
|
853
|
+
string,
|
|
854
|
+
string,
|
|
855
|
+
string,
|
|
856
|
+
string,
|
|
857
|
+
string
|
|
858
|
+
] | [
|
|
859
|
+
string,
|
|
860
|
+
string,
|
|
861
|
+
string,
|
|
862
|
+
string,
|
|
863
|
+
string,
|
|
864
|
+
string,
|
|
865
|
+
string,
|
|
866
|
+
string,
|
|
867
|
+
string,
|
|
868
|
+
string,
|
|
869
|
+
string,
|
|
870
|
+
string,
|
|
871
|
+
string,
|
|
872
|
+
string
|
|
873
|
+
] | [
|
|
874
|
+
string,
|
|
875
|
+
string,
|
|
876
|
+
string,
|
|
877
|
+
string,
|
|
878
|
+
string,
|
|
879
|
+
string,
|
|
880
|
+
string,
|
|
881
|
+
string,
|
|
882
|
+
string,
|
|
883
|
+
string,
|
|
884
|
+
string,
|
|
885
|
+
string,
|
|
886
|
+
string,
|
|
887
|
+
string,
|
|
888
|
+
string
|
|
889
|
+
] | [
|
|
890
|
+
string,
|
|
891
|
+
string,
|
|
892
|
+
string,
|
|
893
|
+
string,
|
|
894
|
+
string,
|
|
895
|
+
string,
|
|
896
|
+
string,
|
|
897
|
+
string,
|
|
898
|
+
string,
|
|
899
|
+
string,
|
|
900
|
+
string,
|
|
901
|
+
string,
|
|
902
|
+
string,
|
|
903
|
+
string,
|
|
904
|
+
string,
|
|
905
|
+
string
|
|
906
|
+
] | [
|
|
907
|
+
string,
|
|
908
|
+
string,
|
|
909
|
+
string,
|
|
910
|
+
string,
|
|
911
|
+
string,
|
|
912
|
+
string,
|
|
913
|
+
string,
|
|
914
|
+
string,
|
|
915
|
+
string,
|
|
916
|
+
string,
|
|
917
|
+
string,
|
|
918
|
+
string,
|
|
919
|
+
string,
|
|
920
|
+
string,
|
|
921
|
+
string,
|
|
922
|
+
string,
|
|
923
|
+
string
|
|
924
|
+
] | [
|
|
925
|
+
string,
|
|
926
|
+
string,
|
|
927
|
+
string,
|
|
928
|
+
string,
|
|
929
|
+
string,
|
|
930
|
+
string,
|
|
931
|
+
string,
|
|
932
|
+
string,
|
|
933
|
+
string,
|
|
934
|
+
string,
|
|
935
|
+
string,
|
|
936
|
+
string,
|
|
937
|
+
string,
|
|
938
|
+
string,
|
|
939
|
+
string,
|
|
940
|
+
string,
|
|
941
|
+
string,
|
|
942
|
+
string
|
|
943
|
+
] | [
|
|
944
|
+
string,
|
|
945
|
+
string,
|
|
946
|
+
string,
|
|
947
|
+
string,
|
|
948
|
+
string,
|
|
949
|
+
string,
|
|
950
|
+
string,
|
|
951
|
+
string,
|
|
952
|
+
string,
|
|
953
|
+
string,
|
|
954
|
+
string,
|
|
955
|
+
string,
|
|
956
|
+
string,
|
|
957
|
+
string,
|
|
958
|
+
string,
|
|
959
|
+
string,
|
|
960
|
+
string,
|
|
961
|
+
string,
|
|
962
|
+
string
|
|
963
|
+
] | [
|
|
964
|
+
string,
|
|
965
|
+
string,
|
|
966
|
+
string,
|
|
967
|
+
string,
|
|
968
|
+
string,
|
|
969
|
+
string,
|
|
970
|
+
string,
|
|
971
|
+
string,
|
|
972
|
+
string,
|
|
973
|
+
string,
|
|
974
|
+
string,
|
|
975
|
+
string,
|
|
976
|
+
string,
|
|
977
|
+
string,
|
|
978
|
+
string,
|
|
979
|
+
string,
|
|
980
|
+
string,
|
|
981
|
+
string,
|
|
982
|
+
string,
|
|
983
|
+
string
|
|
984
|
+
];
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* RFC-0042: order a listing by a number, date or datetime field. Entries without a value sort last.
|
|
988
|
+
*
|
|
989
|
+
* This interface was referenced by `Site`'s JSON-Schema
|
|
990
|
+
* via the `definition` "FieldOrder".
|
|
991
|
+
*/
|
|
992
|
+
export interface FieldOrder {
|
|
993
|
+
/**
|
|
994
|
+
* A field key (site.schema.json FieldKey's pattern, repeated).
|
|
995
|
+
*/
|
|
996
|
+
field: string;
|
|
997
|
+
direction: "asc" | "desc";
|
|
715
998
|
}
|
|
716
999
|
/**
|
|
717
1000
|
* A typed block from the block registry (RFC-0015): `type` names a registered block type (one global namespace of English names), `props` follow that type's props schema, which the store validates.
|