@inf-monkeys-tech/monkeys 1.1.52 → 1.1.54
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/lib/contracts/action-program-http.d.ts +202 -0
- package/lib/contracts/action-program-http.d.ts.map +1 -1
- package/lib/contracts/declarative-control-http.d.ts +44345 -12496
- package/lib/contracts/declarative-control-http.d.ts.map +1 -1
- package/lib/contracts/declarative-control-http.js +37 -4
- package/lib/contracts/declarative-control-http.js.map +1 -1
- package/lib/contracts/declarative-control.d.ts +1738 -246
- package/lib/contracts/declarative-control.d.ts.map +1 -1
- package/lib/contracts/declarative-control.js +166 -20
- package/lib/contracts/declarative-control.js.map +1 -1
- package/lib/contracts/declarative-document-import.d.ts +640 -10
- package/lib/contracts/declarative-document-import.d.ts.map +1 -1
- package/lib/contracts/declarative-publication-job.d.ts +3318 -578
- package/lib/contracts/declarative-publication-job.d.ts.map +1 -1
- package/lib/contracts/menu.d.ts +329 -0
- package/lib/contracts/menu.d.ts.map +1 -1
- package/lib/contracts/page-expression.d.ts +1 -0
- package/lib/contracts/page-expression.d.ts.map +1 -1
- package/lib/contracts/page-expression.js +1 -1
- package/lib/contracts/page-expression.js.map +1 -1
- package/lib/contracts/page.d.ts +989 -0
- package/lib/contracts/page.d.ts.map +1 -1
- package/lib/contracts/page.js +24 -1
- package/lib/contracts/page.js.map +1 -1
- package/lib/contracts/semantic.d.ts +329 -0
- package/lib/contracts/semantic.d.ts.map +1 -1
- package/lib/contracts/tenant.d.ts +1645 -0
- package/lib/contracts/tenant.d.ts.map +1 -1
- package/lib/esm/{chunk-EMZG7H6M.mjs → chunk-66A4GGOV.mjs} +2 -2
- package/lib/esm/{chunk-LQ72DLZI.mjs → chunk-DIIMDX7F.mjs} +220 -23
- package/lib/esm/chunk-DIIMDX7F.mjs.map +1 -0
- package/lib/esm/{chunk-E46Y3E7E.mjs → chunk-E6YPJ4DR.mjs} +2 -2
- package/lib/esm/{chunk-TFNKWLY6.mjs → chunk-ITGLKSCE.mjs} +295 -13
- package/lib/esm/chunk-ITGLKSCE.mjs.map +1 -0
- package/lib/esm/{chunk-BNFELJET.mjs → chunk-RMZW3SVL.mjs} +3 -3
- package/lib/esm/{chunk-CB4WTYNQ.mjs → chunk-TROZIHS4.mjs} +2 -2
- package/lib/esm/contracts/index.mjs +28 -4
- package/lib/esm/index.mjs +48 -6
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +21 -3
- package/lib/esm/schemas/index.mjs +3 -3
- package/lib/json-schema/declarative-route-owner-index.schema.json +10 -2
- package/lib/json-schema/navigation-runtime-bundle.schema.json +21 -1
- package/lib/json-schema/navigation.schema.json +21 -1
- package/lib/json-schema/overlay-node.schema.json +2 -1
- package/lib/json-schema/page-definition.schema.json +1739 -3
- package/lib/json-schema/page-release.schema.json +80 -6
- package/lib/json-schema/page-runtime-bundle.schema.json +2453 -372
- package/lib/json-schema/page-runtime-descriptor.schema.json +1739 -3
- package/lib/json-schema/page.schema.json +958 -215
- package/lib/json-schema/product-declaration.schema.json +1736 -0
- package/lib/json-schema/render-node.schema.json +2 -1
- package/lib/json-schema/render-tree.schema.json +2 -1
- package/lib/json-schema/tenant-product-config.schema.json +1736 -0
- package/lib/json-schema/tenant-runtime-config.schema.json +1736 -0
- package/lib/runtime/declarative-control-compiler.d.ts +5 -0
- package/lib/runtime/declarative-control-compiler.d.ts.map +1 -1
- package/lib/runtime/declarative-control-compiler.js +105 -12
- package/lib/runtime/declarative-control-compiler.js.map +1 -1
- package/lib/runtime/index.d.ts +2 -0
- package/lib/runtime/index.d.ts.map +1 -1
- package/lib/runtime/index.js +2 -0
- package/lib/runtime/index.js.map +1 -1
- package/lib/runtime/native-page-composition.d.ts +319 -0
- package/lib/runtime/native-page-composition.d.ts.map +1 -0
- package/lib/runtime/native-page-composition.js +19 -0
- package/lib/runtime/native-page-composition.js.map +1 -0
- package/lib/runtime/page-composition.js +1 -1
- package/lib/runtime/page-composition.js.map +1 -1
- package/lib/runtime/page-expression.d.ts +1 -1
- package/lib/runtime/page-expression.d.ts.map +1 -1
- package/lib/runtime/page-mount.d.ts +26 -0
- package/lib/runtime/page-mount.d.ts.map +1 -0
- package/lib/runtime/page-mount.js +203 -0
- package/lib/runtime/page-mount.js.map +1 -0
- package/lib/runtime/runtime-definition-wire.d.ts +6759 -357
- package/lib/runtime/runtime-definition-wire.d.ts.map +1 -1
- package/lib/schemas/index.d.ts +2544 -349
- package/lib/schemas/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-LQ72DLZI.mjs.map +0 -1
- package/lib/esm/chunk-TFNKWLY6.mjs.map +0 -1
- /package/lib/esm/{chunk-EMZG7H6M.mjs.map → chunk-66A4GGOV.mjs.map} +0 -0
- /package/lib/esm/{chunk-E46Y3E7E.mjs.map → chunk-E6YPJ4DR.mjs.map} +0 -0
- /package/lib/esm/{chunk-BNFELJET.mjs.map → chunk-RMZW3SVL.mjs.map} +0 -0
- /package/lib/esm/{chunk-CB4WTYNQ.mjs.map → chunk-TROZIHS4.mjs.map} +0 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import type { PageDefinition } from '../contracts/page';
|
|
2
|
+
import { type RevisionRef } from '../contracts/declarative-control';
|
|
3
|
+
/** The catalog is the immutable plan; this does not discover or select child releases. */
|
|
4
|
+
export declare function nativePageMountPlan(page: PageDefinition, catalogRevision: RevisionRef): {
|
|
5
|
+
routeClaims: {
|
|
6
|
+
kind: "canonical" | "alias" | "redirect";
|
|
7
|
+
routeSpaceRevisionRef: {
|
|
8
|
+
revision: number;
|
|
9
|
+
schemaVersion: number;
|
|
10
|
+
contentHash: string;
|
|
11
|
+
kind: string;
|
|
12
|
+
id: string;
|
|
13
|
+
ownerRepo: string;
|
|
14
|
+
visibility: "tenant" | "public" | "global";
|
|
15
|
+
tenantScope?: {
|
|
16
|
+
tenantRef: {
|
|
17
|
+
kind: string;
|
|
18
|
+
id: string;
|
|
19
|
+
ownerRepo: string;
|
|
20
|
+
};
|
|
21
|
+
dataSpaceRef: {
|
|
22
|
+
kind: string;
|
|
23
|
+
id: string;
|
|
24
|
+
ownerRepo: string;
|
|
25
|
+
};
|
|
26
|
+
teamRef?: {
|
|
27
|
+
kind: string;
|
|
28
|
+
id: string;
|
|
29
|
+
ownerRepo: string;
|
|
30
|
+
} | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
};
|
|
33
|
+
pathTemplate: string;
|
|
34
|
+
surface: "studio" | "kernel";
|
|
35
|
+
normalizedPath: string;
|
|
36
|
+
matcher: {
|
|
37
|
+
caseSensitive: boolean;
|
|
38
|
+
trailingSlash: "preserve" | "remove" | "require";
|
|
39
|
+
parameters: {
|
|
40
|
+
name: string;
|
|
41
|
+
type: "integer" | "identifier" | "slug" | "uuid";
|
|
42
|
+
required: boolean;
|
|
43
|
+
}[];
|
|
44
|
+
surface: "studio" | "kernel";
|
|
45
|
+
};
|
|
46
|
+
redirectTargetRef?: {
|
|
47
|
+
kind: string;
|
|
48
|
+
id: string;
|
|
49
|
+
ownerRepo: string;
|
|
50
|
+
visibility: "tenant" | "public" | "global";
|
|
51
|
+
tenantScope?: {
|
|
52
|
+
tenantRef: {
|
|
53
|
+
kind: string;
|
|
54
|
+
id: string;
|
|
55
|
+
ownerRepo: string;
|
|
56
|
+
};
|
|
57
|
+
dataSpaceRef: {
|
|
58
|
+
kind: string;
|
|
59
|
+
id: string;
|
|
60
|
+
ownerRepo: string;
|
|
61
|
+
};
|
|
62
|
+
teamRef?: {
|
|
63
|
+
kind: string;
|
|
64
|
+
id: string;
|
|
65
|
+
ownerRepo: string;
|
|
66
|
+
} | undefined;
|
|
67
|
+
} | undefined;
|
|
68
|
+
} | undefined;
|
|
69
|
+
}[];
|
|
70
|
+
mounts: {
|
|
71
|
+
mountId: string;
|
|
72
|
+
target: {
|
|
73
|
+
kind: "page";
|
|
74
|
+
id: string;
|
|
75
|
+
};
|
|
76
|
+
slot: string;
|
|
77
|
+
presentation: "inline" | "fullscreen" | "panel" | "drawer" | "modal";
|
|
78
|
+
inputs: Record<string, {
|
|
79
|
+
kind: "page-parameter";
|
|
80
|
+
name: string;
|
|
81
|
+
} | {
|
|
82
|
+
kind: "scope-field";
|
|
83
|
+
path: string;
|
|
84
|
+
} | {
|
|
85
|
+
kind: "binding-field";
|
|
86
|
+
bindingId: string;
|
|
87
|
+
path: string;
|
|
88
|
+
} | {
|
|
89
|
+
kind: "constant";
|
|
90
|
+
value: string | number | boolean | null;
|
|
91
|
+
} | {
|
|
92
|
+
kind: "route-parameter";
|
|
93
|
+
name: string;
|
|
94
|
+
} | {
|
|
95
|
+
kind: "query-parameter";
|
|
96
|
+
name: string;
|
|
97
|
+
} | {
|
|
98
|
+
kind: "identity";
|
|
99
|
+
name: "tenantId" | "teamId" | "userId";
|
|
100
|
+
} | {
|
|
101
|
+
kind: "intent-field";
|
|
102
|
+
path: string;
|
|
103
|
+
} | {
|
|
104
|
+
kind: "page-state";
|
|
105
|
+
stateId: string;
|
|
106
|
+
}>;
|
|
107
|
+
on: Record<string, {
|
|
108
|
+
kind: "close";
|
|
109
|
+
} | {
|
|
110
|
+
kind: "refresh";
|
|
111
|
+
bindingIds: string[];
|
|
112
|
+
} | {
|
|
113
|
+
kind: "state";
|
|
114
|
+
stateId: string;
|
|
115
|
+
path: string[];
|
|
116
|
+
}>;
|
|
117
|
+
backgroundQueryPolicy: "always" | "when-active";
|
|
118
|
+
targetRevisionRef: {
|
|
119
|
+
revision: number;
|
|
120
|
+
schemaVersion: number;
|
|
121
|
+
contentHash: string;
|
|
122
|
+
kind: string;
|
|
123
|
+
id: string;
|
|
124
|
+
ownerRepo: string;
|
|
125
|
+
visibility: "tenant" | "public" | "global";
|
|
126
|
+
tenantScope?: {
|
|
127
|
+
tenantRef: {
|
|
128
|
+
kind: string;
|
|
129
|
+
id: string;
|
|
130
|
+
ownerRepo: string;
|
|
131
|
+
};
|
|
132
|
+
dataSpaceRef: {
|
|
133
|
+
kind: string;
|
|
134
|
+
id: string;
|
|
135
|
+
ownerRepo: string;
|
|
136
|
+
};
|
|
137
|
+
teamRef?: {
|
|
138
|
+
kind: string;
|
|
139
|
+
id: string;
|
|
140
|
+
ownerRepo: string;
|
|
141
|
+
} | undefined;
|
|
142
|
+
} | undefined;
|
|
143
|
+
};
|
|
144
|
+
targetReleaseRevisionRef: {
|
|
145
|
+
revision: number;
|
|
146
|
+
schemaVersion: number;
|
|
147
|
+
contentHash: string;
|
|
148
|
+
kind: string;
|
|
149
|
+
id: string;
|
|
150
|
+
ownerRepo: string;
|
|
151
|
+
visibility: "tenant" | "public" | "global";
|
|
152
|
+
tenantScope?: {
|
|
153
|
+
tenantRef: {
|
|
154
|
+
kind: string;
|
|
155
|
+
id: string;
|
|
156
|
+
ownerRepo: string;
|
|
157
|
+
};
|
|
158
|
+
dataSpaceRef: {
|
|
159
|
+
kind: string;
|
|
160
|
+
id: string;
|
|
161
|
+
ownerRepo: string;
|
|
162
|
+
};
|
|
163
|
+
teamRef?: {
|
|
164
|
+
kind: string;
|
|
165
|
+
id: string;
|
|
166
|
+
ownerRepo: string;
|
|
167
|
+
} | undefined;
|
|
168
|
+
} | undefined;
|
|
169
|
+
};
|
|
170
|
+
targetAccessPolicy: {
|
|
171
|
+
authenticated: boolean;
|
|
172
|
+
groupAllOf: {
|
|
173
|
+
kind: string;
|
|
174
|
+
id: string;
|
|
175
|
+
ownerRepo: string;
|
|
176
|
+
visibility: "tenant" | "public" | "global";
|
|
177
|
+
tenantScope?: {
|
|
178
|
+
tenantRef: {
|
|
179
|
+
kind: string;
|
|
180
|
+
id: string;
|
|
181
|
+
ownerRepo: string;
|
|
182
|
+
};
|
|
183
|
+
dataSpaceRef: {
|
|
184
|
+
kind: string;
|
|
185
|
+
id: string;
|
|
186
|
+
ownerRepo: string;
|
|
187
|
+
};
|
|
188
|
+
teamRef?: {
|
|
189
|
+
kind: string;
|
|
190
|
+
id: string;
|
|
191
|
+
ownerRepo: string;
|
|
192
|
+
} | undefined;
|
|
193
|
+
} | undefined;
|
|
194
|
+
}[];
|
|
195
|
+
groupAnyOf: {
|
|
196
|
+
kind: string;
|
|
197
|
+
id: string;
|
|
198
|
+
ownerRepo: string;
|
|
199
|
+
visibility: "tenant" | "public" | "global";
|
|
200
|
+
tenantScope?: {
|
|
201
|
+
tenantRef: {
|
|
202
|
+
kind: string;
|
|
203
|
+
id: string;
|
|
204
|
+
ownerRepo: string;
|
|
205
|
+
};
|
|
206
|
+
dataSpaceRef: {
|
|
207
|
+
kind: string;
|
|
208
|
+
id: string;
|
|
209
|
+
ownerRepo: string;
|
|
210
|
+
};
|
|
211
|
+
teamRef?: {
|
|
212
|
+
kind: string;
|
|
213
|
+
id: string;
|
|
214
|
+
ownerRepo: string;
|
|
215
|
+
} | undefined;
|
|
216
|
+
} | undefined;
|
|
217
|
+
}[];
|
|
218
|
+
permissionAllOf: string[];
|
|
219
|
+
permissionAnyOf: string[];
|
|
220
|
+
conditionAllOf: {
|
|
221
|
+
revision: number;
|
|
222
|
+
schemaVersion: number;
|
|
223
|
+
contentHash: string;
|
|
224
|
+
kind: string;
|
|
225
|
+
id: string;
|
|
226
|
+
ownerRepo: string;
|
|
227
|
+
visibility: "tenant" | "public" | "global";
|
|
228
|
+
tenantScope?: {
|
|
229
|
+
tenantRef: {
|
|
230
|
+
kind: string;
|
|
231
|
+
id: string;
|
|
232
|
+
ownerRepo: string;
|
|
233
|
+
};
|
|
234
|
+
dataSpaceRef: {
|
|
235
|
+
kind: string;
|
|
236
|
+
id: string;
|
|
237
|
+
ownerRepo: string;
|
|
238
|
+
};
|
|
239
|
+
teamRef?: {
|
|
240
|
+
kind: string;
|
|
241
|
+
id: string;
|
|
242
|
+
ownerRepo: string;
|
|
243
|
+
} | undefined;
|
|
244
|
+
} | undefined;
|
|
245
|
+
}[];
|
|
246
|
+
};
|
|
247
|
+
outputs: {
|
|
248
|
+
name: string;
|
|
249
|
+
nodeId: string;
|
|
250
|
+
port: string;
|
|
251
|
+
capabilityInstanceId: string;
|
|
252
|
+
schemaRevisionRef: {
|
|
253
|
+
revision: number;
|
|
254
|
+
schemaVersion: number;
|
|
255
|
+
contentHash: string;
|
|
256
|
+
kind: string;
|
|
257
|
+
id: string;
|
|
258
|
+
ownerRepo: string;
|
|
259
|
+
visibility: "tenant" | "public" | "global";
|
|
260
|
+
tenantScope?: {
|
|
261
|
+
tenantRef: {
|
|
262
|
+
kind: string;
|
|
263
|
+
id: string;
|
|
264
|
+
ownerRepo: string;
|
|
265
|
+
};
|
|
266
|
+
dataSpaceRef: {
|
|
267
|
+
kind: string;
|
|
268
|
+
id: string;
|
|
269
|
+
ownerRepo: string;
|
|
270
|
+
};
|
|
271
|
+
teamRef?: {
|
|
272
|
+
kind: string;
|
|
273
|
+
id: string;
|
|
274
|
+
ownerRepo: string;
|
|
275
|
+
} | undefined;
|
|
276
|
+
} | undefined;
|
|
277
|
+
};
|
|
278
|
+
phase?: "success" | "intent" | undefined;
|
|
279
|
+
}[];
|
|
280
|
+
instanceKey?: string[] | undefined;
|
|
281
|
+
route?: {
|
|
282
|
+
path: string;
|
|
283
|
+
pathParameters: Record<string, string>;
|
|
284
|
+
query: Record<string, {
|
|
285
|
+
parameter: string;
|
|
286
|
+
type: "string" | "boolean" | "json" | "integer";
|
|
287
|
+
}>;
|
|
288
|
+
} | undefined;
|
|
289
|
+
activeWhen?: import("../contracts/declarative-control").PageStateActivation | undefined;
|
|
290
|
+
consumeStateIds?: string[] | undefined;
|
|
291
|
+
parametersSchemaRevisionRef?: {
|
|
292
|
+
revision: number;
|
|
293
|
+
schemaVersion: number;
|
|
294
|
+
contentHash: string;
|
|
295
|
+
kind: string;
|
|
296
|
+
id: string;
|
|
297
|
+
ownerRepo: string;
|
|
298
|
+
visibility: "tenant" | "public" | "global";
|
|
299
|
+
tenantScope?: {
|
|
300
|
+
tenantRef: {
|
|
301
|
+
kind: string;
|
|
302
|
+
id: string;
|
|
303
|
+
ownerRepo: string;
|
|
304
|
+
};
|
|
305
|
+
dataSpaceRef: {
|
|
306
|
+
kind: string;
|
|
307
|
+
id: string;
|
|
308
|
+
ownerRepo: string;
|
|
309
|
+
};
|
|
310
|
+
teamRef?: {
|
|
311
|
+
kind: string;
|
|
312
|
+
id: string;
|
|
313
|
+
ownerRepo: string;
|
|
314
|
+
} | undefined;
|
|
315
|
+
} | undefined;
|
|
316
|
+
} | undefined;
|
|
317
|
+
}[];
|
|
318
|
+
};
|
|
319
|
+
//# sourceMappingURL=native-page-composition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-page-composition.d.ts","sourceRoot":"","sources":["../../src/runtime/native-page-composition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAA4B,KAAK,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE9F,0FAA0F;AAC1F,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWrF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nativePageMountPlan = void 0;
|
|
4
|
+
const declarative_control_1 = require("../contracts/declarative-control");
|
|
5
|
+
/** The catalog is the immutable plan; this does not discover or select child releases. */
|
|
6
|
+
function nativePageMountPlan(page, catalogRevision) {
|
|
7
|
+
if (!page.composition || catalogRevision.kind !== 'legacy-route-adapter' || catalogRevision.id !== page.pageId)
|
|
8
|
+
throw new TypeError('The native Page must have a composition bound to its exact catalog revision.');
|
|
9
|
+
const path = page.routePath.replace(/^\/(?:\$|:)teamId(?=\/|$)/, '').replace(/\$([A-Za-z][A-Za-z0-9_]*)/g, ':$1').replace(/\/+$/, '') || '/';
|
|
10
|
+
const parameters = [...path.matchAll(/:([A-Za-z][A-Za-z0-9_-]*)/g)].map(match => ({ name: match[1], type: 'identifier', required: true }));
|
|
11
|
+
const claim = declarative_control_1.CompiledRouteClaimSchema.parse({
|
|
12
|
+
kind: 'canonical', surface: 'studio', pathTemplate: path, normalizedPath: path,
|
|
13
|
+
routeSpaceRevisionRef: { ...catalogRevision, kind: 'route-space', id: `${page.pageId}.native-route-space` },
|
|
14
|
+
matcher: { surface: 'studio', caseSensitive: true, trailingSlash: 'remove', parameters },
|
|
15
|
+
});
|
|
16
|
+
return { routeClaims: [claim], mounts: page.composition.mounts };
|
|
17
|
+
}
|
|
18
|
+
exports.nativePageMountPlan = nativePageMountPlan;
|
|
19
|
+
//# sourceMappingURL=native-page-composition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-page-composition.js","sourceRoot":"","sources":["../../src/runtime/native-page-composition.ts"],"names":[],"mappings":";;;AACA,0EAA8F;AAE9F,0FAA0F;AAC1F,SAAgB,mBAAmB,CAAC,IAAoB,EAAE,eAA4B;IACpF,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,eAAe,CAAC,IAAI,KAAK,sBAAsB,IAAI,eAAe,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM;QAC5G,MAAM,IAAI,SAAS,CAAC,8EAA8E,CAAC,CAAC;IACtG,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,2BAA2B,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC;IAC7I,MAAM,UAAU,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,YAAqB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACpJ,MAAM,KAAK,GAAG,8CAAwB,CAAC,KAAK,CAAC;QAC3C,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI;QAC9E,qBAAqB,EAAE,EAAE,GAAG,eAAe,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,qBAAqB,EAAE;QAC3G,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE;KACzF,CAAC,CAAC;IACH,OAAO,EAAE,WAAW,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;AACnE,CAAC;AAXD,kDAWC"}
|
|
@@ -101,7 +101,7 @@ function compilePageComposition(input) {
|
|
|
101
101
|
ids.add(value.id);
|
|
102
102
|
return { ...value, ...(value.children ? { children: value.children.map((child) => expand(child, depth + 1)) } : {}) };
|
|
103
103
|
};
|
|
104
|
-
return declarative_control_1.PageSchema.parse({ ...source.page, contract: 'Page', schemaVersion: 1, body: expand(source.body, 0) });
|
|
104
|
+
return declarative_control_1.PageSchema.parse({ ...source.page, contract: 'Page', schemaVersion: source.page.schemaVersion ?? 1, body: expand(source.body, 0) });
|
|
105
105
|
}
|
|
106
106
|
exports.compilePageComposition = compilePageComposition;
|
|
107
107
|
//# sourceMappingURL=page-composition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-composition.js","sourceRoot":"","sources":["../../src/runtime/page-composition.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,0EAAwG;AACxG,gDAAsE;AAEtE,oGAAoG;AACpG,MAAM,IAAI,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;AACjE,MAAM,IAAI,GAAG,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAC3E,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,IAAI,EAAE,oCAAc;IACpB,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,wBAAe,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACzG,+EAA+E;IAC/E,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC,MAAM,EAAE,CAAC;AAQZ,MAAM,UAAU,GAAmB,OAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAC,CAAC,KAAK,CAAC;IACtD,OAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC,IAAI,EAAE,wBAAe,CAAC,CAAC,QAAQ,EAAE,EAAE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E,CAAC,CAAC;AAC7I,CAAC;AAnDD,wDAmDC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JsonObject, JsonValue } from '../contracts/common';
|
|
2
2
|
import { type PageExpression, type PagePropertyBinding } from '../contracts/page-expression';
|
|
3
|
-
export type PageExpressionContext = Partial<Record<'state' | 'model' | 'bindings' | 'queries' | 'scope' | 'intent' | 'result' | 'actions', JsonValue>>;
|
|
3
|
+
export type PageExpressionContext = Partial<Record<'state' | 'model' | 'bindings' | 'queries' | 'scope' | 'intent' | 'result' | 'actions' | 'parameters', JsonValue>>;
|
|
4
4
|
export declare const readPageValue: (value: JsonValue | undefined, path: readonly string[]) => JsonValue | undefined;
|
|
5
5
|
export declare const compilePageExpression: (input: unknown) => PageExpression;
|
|
6
6
|
export declare const writePageDraftPath: (source: JsonValue, path: readonly string[], value: JsonValue) => JsonValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-expression.d.ts","sourceRoot":"","sources":["../../src/runtime/page-expression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAGL,KAAK,cAAc,EAAE,KAAK,mBAAmB,EAC9C,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"page-expression.d.ts","sourceRoot":"","sources":["../../src/runtime/page-expression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAGL,KAAK,cAAc,EAAE,KAAK,mBAAmB,EAC9C,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;AAKtK,eAAO,MAAM,aAAa,UAAW,SAAS,GAAG,SAAS,QAAQ,SAAS,MAAM,EAAE,KAAG,SAAS,GAAG,SASjG,CAAC;AAmBF,eAAO,MAAM,qBAAqB,UAAW,OAAO,KAAG,cAKtD,CAAC;AAWF,eAAO,MAAM,kBAAkB,WAAY,SAAS,QAAQ,SAAS,MAAM,EAAE,SAAS,SAAS,KAAG,SAUjG,CAAC;AA6IF,eAAO,MAAM,sBAAsB,eAAgB,OAAO,WAAW,qBAAqB,KAAG,SACZ,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,UAAW,OAAO,KAAG,CAAC,CAAC,OAAO,EAAE,qBAAqB,KAAK,SAAS,CAGpG,CAAC;AAiDF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,aAAc,SAAS,mBAAmB,EAAE,KAAG,CAAC,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,qBAAqB,KAAK,UAAU,CAKzJ,CAAC;AAEF,eAAO,MAAM,qBAAqB,SAAU,UAAU,YAAY,SAAS,mBAAmB,EAAE,WAAW,qBAAqB,KAAG,UAC1D,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { JsonObject } from '../contracts/common';
|
|
2
|
+
import type { CompiledRouteClaim, PageMount, PageRuntimeBundle, ResolvedPageMount } from '../contracts/declarative-control';
|
|
3
|
+
/** Coercion belongs to each URL codec; embedded inputs are never implicitly coerced. */
|
|
4
|
+
export declare function createPageParameterValidator(schema: JsonObject): (input: JsonObject) => JsonObject;
|
|
5
|
+
export declare function compilePageMountRoute(parent: CompiledRouteClaim, mount: Pick<PageMount, 'route'>): CompiledRouteClaim;
|
|
6
|
+
export interface PageMountLocation {
|
|
7
|
+
mount: ResolvedPageMount;
|
|
8
|
+
parentPathname: string;
|
|
9
|
+
parameters: JsonObject;
|
|
10
|
+
parentParameters: Readonly<Record<string, string>>;
|
|
11
|
+
}
|
|
12
|
+
/** Resolves only declared mounts; an arbitrary pathname cannot select a child Page. */
|
|
13
|
+
export declare function matchPageMountLocation(page: Pick<PageRuntimeBundle, 'routeClaims' | 'mounts'>, pathname: string, search: string): PageMountLocation | undefined;
|
|
14
|
+
export interface PageInputContext {
|
|
15
|
+
state?: JsonObject;
|
|
16
|
+
parameters?: JsonObject;
|
|
17
|
+
pathParameters?: Readonly<Record<string, string>>;
|
|
18
|
+
search?: string;
|
|
19
|
+
identity?: Readonly<Record<string, string>>;
|
|
20
|
+
}
|
|
21
|
+
export declare function resolvePageInputBindings(inputs: PageMount['inputs'], context: PageInputContext): JsonObject;
|
|
22
|
+
export declare function resolvePageMountInputs(mount: PageMount, context: PageInputContext, locationInputs?: JsonObject): JsonObject;
|
|
23
|
+
export declare function resolvePageRootParameters(page: Pick<PageRuntimeBundle, 'parameterBindings'>, schema: JsonObject, context: PageInputContext): JsonObject;
|
|
24
|
+
export declare function buildPageMountHref(parentHref: string, mount: PageMount, input: JsonObject): string;
|
|
25
|
+
export declare function pageMountParentHref(parentPathname: string, search: string, mount: PageMount): string;
|
|
26
|
+
//# sourceMappingURL=page-mount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-mount.d.ts","sourceRoot":"","sources":["../../src/runtime/page-mount.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAU5H,wFAAwF;AACxF,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,UAAU,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,UAAU,CASlG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AkB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAkBlG;AAED,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAKpG"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.pageMountParentHref = exports.buildPageMountHref = exports.resolvePageRootParameters = exports.resolvePageMountInputs = exports.resolvePageInputBindings = exports.matchPageMountLocation = exports.compilePageMountRoute = exports.createPageParameterValidator = void 0;
|
|
7
|
+
const _2020_1 = __importDefault(require("ajv/dist/2020"));
|
|
8
|
+
const page_expression_1 = require("../contracts/page-expression");
|
|
9
|
+
const declarative_control_compiler_1 = require("./declarative-control-compiler");
|
|
10
|
+
const fail = (code, message) => { throw Object.assign(new TypeError(message), { code }); };
|
|
11
|
+
const scalar = (value) => {
|
|
12
|
+
if (typeof value !== 'string' && typeof value !== 'number' && typeof value !== 'boolean')
|
|
13
|
+
return fail('PAGE_LOCATION_PARAMETER_INVALID', 'A URL parameter must be a scalar.');
|
|
14
|
+
return String(value);
|
|
15
|
+
};
|
|
16
|
+
/** Coercion belongs to each URL codec; embedded inputs are never implicitly coerced. */
|
|
17
|
+
function createPageParameterValidator(schema) {
|
|
18
|
+
if (schema.type !== 'object')
|
|
19
|
+
fail('PAGE_PARAMETER_SCHEMA_INVALID', 'Page input schema must describe an object.');
|
|
20
|
+
const validate = new _2020_1.default({ strict: false, allErrors: true, useDefaults: true, coerceTypes: false }).compile(schema);
|
|
21
|
+
return input => {
|
|
22
|
+
(0, page_expression_1.assertPageValueBudget)(input);
|
|
23
|
+
const value = structuredClone(input);
|
|
24
|
+
if (!validate(value))
|
|
25
|
+
fail('PAGE_PARAMETERS_INVALID', 'Page inputs do not satisfy the published schema.');
|
|
26
|
+
return value;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
exports.createPageParameterValidator = createPageParameterValidator;
|
|
30
|
+
function compilePageMountRoute(parent, mount) {
|
|
31
|
+
if (!mount.route)
|
|
32
|
+
return fail('PAGE_MOUNT_ROUTE_MISSING', 'The mount has no route.');
|
|
33
|
+
const names = Object.keys(mount.route.pathParameters);
|
|
34
|
+
if (names.some(name => parent.matcher.parameters.some(parameter => parameter.name === name)))
|
|
35
|
+
fail('PAGE_MOUNT_ROUTE_CONFLICT', 'Parent and child path parameter names must be distinct.');
|
|
36
|
+
const normalizedPath = `${parent.normalizedPath.replace(/\/+$/, '')}/${mount.route.path}`;
|
|
37
|
+
return { ...parent, kind: 'canonical', pathTemplate: normalizedPath, normalizedPath,
|
|
38
|
+
matcher: { ...parent.matcher, parameters: [...parent.matcher.parameters, ...names.map(name => ({ name, type: 'identifier', required: true }))] } };
|
|
39
|
+
}
|
|
40
|
+
exports.compilePageMountRoute = compilePageMountRoute;
|
|
41
|
+
/** Resolves only declared mounts; an arbitrary pathname cannot select a child Page. */
|
|
42
|
+
function matchPageMountLocation(page, pathname, search) {
|
|
43
|
+
const matches = [];
|
|
44
|
+
for (const parent of page.routeClaims.filter(claim => claim.kind === 'canonical')) {
|
|
45
|
+
for (const mount of page.mounts ?? []) {
|
|
46
|
+
if (!mount.route)
|
|
47
|
+
continue;
|
|
48
|
+
const claim = compilePageMountRoute(parent, mount);
|
|
49
|
+
const match = (0, declarative_control_compiler_1.matchCompiledRouteClaim)(claim, pathname);
|
|
50
|
+
if (!match.matched)
|
|
51
|
+
continue;
|
|
52
|
+
const parameters = {};
|
|
53
|
+
for (const [name, parameter] of Object.entries(mount.route.pathParameters))
|
|
54
|
+
parameters[parameter] = match.parameters[name];
|
|
55
|
+
const query = new URLSearchParams(search);
|
|
56
|
+
for (const [key, codec] of Object.entries(mount.route.query)) {
|
|
57
|
+
const values = query.getAll(key);
|
|
58
|
+
if (!values.length)
|
|
59
|
+
continue;
|
|
60
|
+
if (values.length !== 1)
|
|
61
|
+
fail('PAGE_LOCATION_PARAMETER_INVALID', `Duplicate query key ${key}.`);
|
|
62
|
+
const raw = values[0];
|
|
63
|
+
if (codec.type === 'json') {
|
|
64
|
+
try {
|
|
65
|
+
const decoded = JSON.parse(raw);
|
|
66
|
+
(0, page_expression_1.assertPageValueBudget)(decoded);
|
|
67
|
+
parameters[codec.parameter] = decoded;
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
fail('PAGE_LOCATION_PARAMETER_INVALID', `Invalid structured input ${key}.`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else if (codec.type === 'integer') {
|
|
74
|
+
if (!/^-?(0|[1-9][0-9]*)$/.test(raw) || !Number.isSafeInteger(Number(raw)))
|
|
75
|
+
fail('PAGE_LOCATION_PARAMETER_INVALID', `Invalid integer ${key}.`);
|
|
76
|
+
parameters[codec.parameter] = Number(raw);
|
|
77
|
+
}
|
|
78
|
+
else if (codec.type === 'boolean') {
|
|
79
|
+
if (raw !== 'true' && raw !== 'false')
|
|
80
|
+
fail('PAGE_LOCATION_PARAMETER_INVALID', `Invalid boolean ${key}.`);
|
|
81
|
+
parameters[codec.parameter] = raw === 'true';
|
|
82
|
+
}
|
|
83
|
+
else
|
|
84
|
+
parameters[codec.parameter] = raw;
|
|
85
|
+
}
|
|
86
|
+
const size = parent.normalizedPath.split('/').filter(Boolean).length;
|
|
87
|
+
const parentPathname = `/${pathname.split('/').filter(Boolean).slice(0, size).join('/')}`;
|
|
88
|
+
const parentParameters = Object.fromEntries(parent.matcher.parameters.map(parameter => [parameter.name, match.parameters[parameter.name]]));
|
|
89
|
+
matches.push({ mount, parentPathname, parameters, parentParameters });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (matches.length > 1)
|
|
93
|
+
fail('PAGE_MOUNT_ROUTE_CONFLICT', 'More than one child mount owns this location.');
|
|
94
|
+
return matches[0];
|
|
95
|
+
}
|
|
96
|
+
exports.matchPageMountLocation = matchPageMountLocation;
|
|
97
|
+
function resolvePageInputBindings(inputs, context) {
|
|
98
|
+
const result = {};
|
|
99
|
+
const query = new URLSearchParams(context.search);
|
|
100
|
+
for (const [name, source] of Object.entries(inputs)) {
|
|
101
|
+
let value;
|
|
102
|
+
if (source.kind === 'constant')
|
|
103
|
+
value = source.value;
|
|
104
|
+
else if (source.kind === 'page-parameter')
|
|
105
|
+
value = context.parameters?.[source.name];
|
|
106
|
+
else if (source.kind === 'page-state')
|
|
107
|
+
value = context.state?.[source.stateId];
|
|
108
|
+
else if (source.kind === 'route-parameter')
|
|
109
|
+
value = context.pathParameters?.[source.name];
|
|
110
|
+
else if (source.kind === 'query-parameter')
|
|
111
|
+
value = query.get(source.name) ?? undefined;
|
|
112
|
+
else if (source.kind === 'identity')
|
|
113
|
+
value = context.identity?.[source.name];
|
|
114
|
+
else
|
|
115
|
+
fail('PAGE_MOUNT_INPUT_SOURCE_INVALID', 'Mount inputs require an explicit Page, state, location, identity or constant source.');
|
|
116
|
+
if (value !== undefined)
|
|
117
|
+
result[name] = value;
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
exports.resolvePageInputBindings = resolvePageInputBindings;
|
|
122
|
+
function resolvePageMountInputs(mount, context, locationInputs = {}) {
|
|
123
|
+
const result = resolvePageInputBindings(mount.inputs, context);
|
|
124
|
+
// Only fields declared in this mount's route may override its normal bindings.
|
|
125
|
+
const owned = new Set([...Object.values(mount.route?.pathParameters ?? {}), ...Object.values(mount.route?.query ?? {}).map(codec => codec.parameter)]);
|
|
126
|
+
for (const [name, value] of Object.entries(locationInputs)) {
|
|
127
|
+
if (!owned.has(name))
|
|
128
|
+
fail('PAGE_MOUNT_INPUT_SOURCE_INVALID', 'Unexpected location input.');
|
|
129
|
+
result[name] = value;
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
exports.resolvePageMountInputs = resolvePageMountInputs;
|
|
134
|
+
function resolvePageRootParameters(page, schema, context) {
|
|
135
|
+
const result = resolvePageInputBindings(page.parameterBindings ?? {}, context);
|
|
136
|
+
const properties = schema.properties;
|
|
137
|
+
for (const [name, source] of Object.entries(page.parameterBindings ?? {})) {
|
|
138
|
+
if (!['route-parameter', 'query-parameter'].includes(source.kind) || result[name] === undefined)
|
|
139
|
+
continue;
|
|
140
|
+
const raw = String(result[name]);
|
|
141
|
+
const codec = 'codec' in source ? source.codec : undefined;
|
|
142
|
+
if (codec === 'json' || codec === 'page-state') {
|
|
143
|
+
if (codec === 'page-state' && !raw.startsWith('json:'))
|
|
144
|
+
continue;
|
|
145
|
+
try {
|
|
146
|
+
result[name] = JSON.parse(raw.startsWith('json:') ? raw.slice(5) : raw);
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
fail('PAGE_LOCATION_PARAMETER_INVALID', `Invalid structured input ${name}.`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else if (codec === 'integer' || (!codec && properties?.[name]?.type === 'integer')) {
|
|
153
|
+
if (!/^-?(0|[1-9][0-9]*)$/.test(raw) || !Number.isSafeInteger(Number(raw)))
|
|
154
|
+
fail('PAGE_LOCATION_PARAMETER_INVALID', `Invalid integer ${name}.`);
|
|
155
|
+
result[name] = Number(raw);
|
|
156
|
+
}
|
|
157
|
+
else if (codec === 'boolean' || (!codec && properties?.[name]?.type === 'boolean')) {
|
|
158
|
+
if (raw !== 'true' && raw !== 'false')
|
|
159
|
+
fail('PAGE_LOCATION_PARAMETER_INVALID', `Invalid boolean ${name}.`);
|
|
160
|
+
result[name] = raw === 'true';
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return createPageParameterValidator(schema)(result);
|
|
164
|
+
}
|
|
165
|
+
exports.resolvePageRootParameters = resolvePageRootParameters;
|
|
166
|
+
function buildPageMountHref(parentHref, mount, input) {
|
|
167
|
+
if (!mount.route)
|
|
168
|
+
return fail('PAGE_MOUNT_ROUTE_MISSING', 'The mount has no route.');
|
|
169
|
+
if (!parentHref.startsWith('/') || parentHref.startsWith('//') || parentHref.includes('\\'))
|
|
170
|
+
fail('PAGE_LOCATION_INVALID', 'Expected an application-relative parent URL.');
|
|
171
|
+
const parent = new URL(parentHref, 'https://page.invalid');
|
|
172
|
+
const path = mount.route.path.replace(/:([A-Za-z][A-Za-z0-9_-]*)/g, (_match, name) => encodeURIComponent(scalar(input[mount.route.pathParameters[name]])));
|
|
173
|
+
for (const [key, codec] of Object.entries(mount.route.query)) {
|
|
174
|
+
const value = input[codec.parameter];
|
|
175
|
+
if (value === undefined || value === null)
|
|
176
|
+
parent.searchParams.delete(key);
|
|
177
|
+
else {
|
|
178
|
+
if (codec.type === 'integer' && (typeof value !== 'number' || !Number.isSafeInteger(value)))
|
|
179
|
+
fail('PAGE_LOCATION_PARAMETER_INVALID', `Invalid integer ${key}.`);
|
|
180
|
+
if (codec.type === 'boolean' && typeof value !== 'boolean')
|
|
181
|
+
fail('PAGE_LOCATION_PARAMETER_INVALID', `Invalid boolean ${key}.`);
|
|
182
|
+
if (codec.type === 'string' && typeof value !== 'string')
|
|
183
|
+
fail('PAGE_LOCATION_PARAMETER_INVALID', `Invalid string ${key}.`);
|
|
184
|
+
if (codec.type === 'json')
|
|
185
|
+
(0, page_expression_1.assertPageValueBudget)(value);
|
|
186
|
+
parent.searchParams.set(key, codec.type === 'json' ? JSON.stringify(value) : scalar(value));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (parent.search.length > 8192 || `${parent.pathname.replace(/\/+$/, '')}/${path}`.length > 2048)
|
|
190
|
+
fail('PAGE_LOCATION_PARAMETER_INVALID', 'Page location exceeds its budget.');
|
|
191
|
+
return `${parent.pathname.replace(/\/+$/, '')}/${path}${parent.search}`;
|
|
192
|
+
}
|
|
193
|
+
exports.buildPageMountHref = buildPageMountHref;
|
|
194
|
+
function pageMountParentHref(parentPathname, search, mount) {
|
|
195
|
+
const query = new URLSearchParams(search);
|
|
196
|
+
Object.keys(mount.route?.query ?? {}).forEach(key => query.delete(key));
|
|
197
|
+
for (const key of [...query.keys()])
|
|
198
|
+
if (key.startsWith(`${mount.mountId}.state.`))
|
|
199
|
+
query.delete(key);
|
|
200
|
+
return `${parentPathname}${query.size ? `?${query}` : ''}`;
|
|
201
|
+
}
|
|
202
|
+
exports.pageMountParentHref = pageMountParentHref;
|
|
203
|
+
//# sourceMappingURL=page-mount.js.map
|