@jxsuite/schema 5.0.0 → 5.1.0
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/defs/field-schema.schema.ts +37 -4
- package/package.json +1 -1
- package/schema.json +38 -0
- package/schemas/document.paths.schema.json +30 -0
- package/types.ts +6 -4
|
@@ -62,10 +62,12 @@ export const relationshipRefSchema = {
|
|
|
62
62
|
* ones every per-project entry document unions extension shapes on top of.
|
|
63
63
|
*
|
|
64
64
|
* These mirror `resolvePathEntries` in the compiler's pages-discovery exactly (specs/
|
|
65
|
-
* site-architecture.md §4.3): an explicit value list, a JSON data-file reference,
|
|
66
|
-
* bare array of parameter objects. Anything else is dispatched by discriminator key to
|
|
67
|
-
* extension's `resolvePaths` capability, so extension shapes reach the union through the entry
|
|
68
|
-
* document rather than from here.
|
|
65
|
+
* site-architecture.md §4.3): an explicit value list, a JSON data-file reference, a paged list, and
|
|
66
|
+
* the legacy bare array of parameter objects. Anything else is dispatched by discriminator key to
|
|
67
|
+
* an extension's `resolvePaths` capability, so extension shapes reach the union through the entry
|
|
68
|
+
* document rather than from here. The paged list is expanded by `expandDynamicRoutes` itself rather
|
|
69
|
+
* than `resolvePathEntries`, because it reads the page's own state; its `each` holds another source
|
|
70
|
+
* of this union (or an extension's), checked when the route expands.
|
|
69
71
|
*
|
|
70
72
|
* Each shape is CLOSED (`additionalProperties: false`). `$paths` is a build-time instruction with a
|
|
71
73
|
* fully specified grammar and no forward-compatible extension points of its own — a stray or
|
|
@@ -103,6 +105,37 @@ export const documentPathsCoreMembers = [
|
|
|
103
105
|
required: ["$ref"],
|
|
104
106
|
type: "object",
|
|
105
107
|
},
|
|
108
|
+
{
|
|
109
|
+
additionalProperties: false,
|
|
110
|
+
description:
|
|
111
|
+
"Paged list: one route per `pageSize` items of an entry of this page's own state, which must " +
|
|
112
|
+
"resolve to an array at build time. The page number fills the route's one parameter that " +
|
|
113
|
+
"`each` does not.",
|
|
114
|
+
properties: {
|
|
115
|
+
each: {
|
|
116
|
+
description:
|
|
117
|
+
"Another `$paths` source for the route's other parameter: the list is paged once per " +
|
|
118
|
+
"value of it, as a paged archive per tag is.",
|
|
119
|
+
type: ["object", "array"],
|
|
120
|
+
},
|
|
121
|
+
pageSize: { description: "Items on each page.", minimum: 1, type: "integer" },
|
|
122
|
+
paginate: {
|
|
123
|
+
additionalProperties: false,
|
|
124
|
+
description: "The state entry to page.",
|
|
125
|
+
properties: {
|
|
126
|
+
$ref: {
|
|
127
|
+
description: "A pointer to an entry of this page's state: `#/state/<key>`.",
|
|
128
|
+
pattern: "^#/state/[^/]+$",
|
|
129
|
+
type: "string",
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
required: ["$ref"],
|
|
133
|
+
type: "object",
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
required: ["paginate", "pageSize"],
|
|
137
|
+
type: "object",
|
|
138
|
+
},
|
|
106
139
|
{
|
|
107
140
|
description:
|
|
108
141
|
"Legacy explicit form: an array of ready-made parameter objects, used as-is with no " +
|
package/package.json
CHANGED
package/schema.json
CHANGED
|
@@ -28351,6 +28351,44 @@
|
|
|
28351
28351
|
],
|
|
28352
28352
|
"type": "object"
|
|
28353
28353
|
},
|
|
28354
|
+
{
|
|
28355
|
+
"additionalProperties": false,
|
|
28356
|
+
"description": "Paged list: one route per `pageSize` items of an entry of this page's own state, which must resolve to an array at build time. The page number fills the route's one parameter that `each` does not.",
|
|
28357
|
+
"properties": {
|
|
28358
|
+
"each": {
|
|
28359
|
+
"description": "Another `$paths` source for the route's other parameter: the list is paged once per value of it, as a paged archive per tag is.",
|
|
28360
|
+
"type": [
|
|
28361
|
+
"object",
|
|
28362
|
+
"array"
|
|
28363
|
+
]
|
|
28364
|
+
},
|
|
28365
|
+
"pageSize": {
|
|
28366
|
+
"description": "Items on each page.",
|
|
28367
|
+
"minimum": 1,
|
|
28368
|
+
"type": "integer"
|
|
28369
|
+
},
|
|
28370
|
+
"paginate": {
|
|
28371
|
+
"additionalProperties": false,
|
|
28372
|
+
"description": "The state entry to page.",
|
|
28373
|
+
"properties": {
|
|
28374
|
+
"$ref": {
|
|
28375
|
+
"description": "A pointer to an entry of this page's state: `#/state/<key>`.",
|
|
28376
|
+
"pattern": "^#/state/[^/]+$",
|
|
28377
|
+
"type": "string"
|
|
28378
|
+
}
|
|
28379
|
+
},
|
|
28380
|
+
"required": [
|
|
28381
|
+
"$ref"
|
|
28382
|
+
],
|
|
28383
|
+
"type": "object"
|
|
28384
|
+
}
|
|
28385
|
+
},
|
|
28386
|
+
"required": [
|
|
28387
|
+
"paginate",
|
|
28388
|
+
"pageSize"
|
|
28389
|
+
],
|
|
28390
|
+
"type": "object"
|
|
28391
|
+
},
|
|
28354
28392
|
{
|
|
28355
28393
|
"description": "Legacy explicit form: an array of ready-made parameter objects, used as-is with no expansion. Prefer one of the source shapes above.",
|
|
28356
28394
|
"items": {
|
|
@@ -38,6 +38,36 @@
|
|
|
38
38
|
"required": ["$ref"],
|
|
39
39
|
"type": "object"
|
|
40
40
|
},
|
|
41
|
+
{
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"description": "Paged list: one route per `pageSize` items of an entry of this page's own state, which must resolve to an array at build time. The page number fills the route's one parameter that `each` does not.",
|
|
44
|
+
"properties": {
|
|
45
|
+
"each": {
|
|
46
|
+
"description": "Another `$paths` source for the route's other parameter: the list is paged once per value of it, as a paged archive per tag is.",
|
|
47
|
+
"type": ["object", "array"]
|
|
48
|
+
},
|
|
49
|
+
"pageSize": {
|
|
50
|
+
"description": "Items on each page.",
|
|
51
|
+
"minimum": 1,
|
|
52
|
+
"type": "integer"
|
|
53
|
+
},
|
|
54
|
+
"paginate": {
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"description": "The state entry to page.",
|
|
57
|
+
"properties": {
|
|
58
|
+
"$ref": {
|
|
59
|
+
"description": "A pointer to an entry of this page's state: `#/state/<key>`.",
|
|
60
|
+
"pattern": "^#/state/[^/]+$",
|
|
61
|
+
"type": "string"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"required": ["$ref"],
|
|
65
|
+
"type": "object"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"required": ["paginate", "pageSize"],
|
|
69
|
+
"type": "object"
|
|
70
|
+
},
|
|
41
71
|
{
|
|
42
72
|
"description": "Legacy explicit form: an array of ready-made parameter objects, used as-is with no expansion. Prefer one of the source shapes above.",
|
|
43
73
|
"items": {
|
package/types.ts
CHANGED
|
@@ -793,14 +793,16 @@ export interface ProjectConfig {
|
|
|
793
793
|
export type JxAttributeValue = Bindable<string | number | boolean>;
|
|
794
794
|
|
|
795
795
|
/**
|
|
796
|
-
* A dynamic-route path source (spec §4.3): explicit values, data-file ref, a
|
|
797
|
-
*
|
|
798
|
-
*
|
|
799
|
-
*
|
|
796
|
+
* A dynamic-route path source (spec §4.3): explicit values, data-file ref, a paged list of an entry
|
|
797
|
+
* of the page's own state (with `each` naming the source of a second parameter), a legacy array of
|
|
798
|
+
* param objects, or an extension-discriminated source (an object carrying a `resolvePaths`
|
|
799
|
+
* discriminator key registered by an enabled extension, e.g. the parser's `contentType` — the
|
|
800
|
+
* extension owns the narrow shape).
|
|
800
801
|
*/
|
|
801
802
|
export type JxPathsDef =
|
|
802
803
|
| { values: JsonValue[]; param?: string }
|
|
803
804
|
| { $ref: string; param?: string; field?: string }
|
|
805
|
+
| { paginate: { $ref: string }; pageSize: number; each?: JsonValue }
|
|
804
806
|
| { param?: string; field?: string; [discriminator: string]: JsonValue | undefined }
|
|
805
807
|
| Record<string, JsonValue>[];
|
|
806
808
|
|