@inf-monkeys-tech/monkeys 1.1.70 → 1.1.72
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/bento-block.d.ts +53 -1
- package/lib/contracts/bento-block.d.ts.map +1 -1
- package/lib/contracts/bento-block.js +37 -2
- package/lib/contracts/bento-block.js.map +1 -1
- package/lib/contracts/capability.d.ts +3 -3
- package/lib/contracts/declarative-control-http.d.ts +1806 -708
- package/lib/contracts/declarative-control-http.d.ts.map +1 -1
- package/lib/contracts/declarative-control-http.js +9 -0
- package/lib/contracts/declarative-control-http.js.map +1 -1
- package/lib/contracts/declarative-control.d.ts +134 -45
- package/lib/contracts/declarative-control.d.ts.map +1 -1
- package/lib/contracts/declarative-control.js +1 -0
- package/lib/contracts/declarative-control.js.map +1 -1
- package/lib/contracts/declarative-document-import.d.ts +53 -2
- package/lib/contracts/declarative-document-import.d.ts.map +1 -1
- package/lib/contracts/declarative-document-import.js +6 -0
- package/lib/contracts/declarative-document-import.js.map +1 -1
- package/lib/contracts/declarative-page-delivery.d.ts +145 -0
- package/lib/contracts/declarative-page-delivery.d.ts.map +1 -0
- package/lib/contracts/declarative-page-delivery.js +164 -0
- package/lib/contracts/declarative-page-delivery.js.map +1 -0
- package/lib/contracts/declarative-publication-health.d.ts +1061 -0
- package/lib/contracts/declarative-publication-health.d.ts.map +1 -0
- package/lib/contracts/declarative-publication-health.js +148 -0
- package/lib/contracts/declarative-publication-health.js.map +1 -0
- package/lib/contracts/declarative-publication-job.d.ts +454 -187
- package/lib/contracts/declarative-publication-job.d.ts.map +1 -1
- package/lib/contracts/declarative-publication-verification.d.ts +8 -2
- package/lib/contracts/declarative-publication-verification.d.ts.map +1 -1
- package/lib/contracts/declarative-publication-verification.js +5 -0
- package/lib/contracts/declarative-publication-verification.js.map +1 -1
- package/lib/contracts/index.d.ts +2 -0
- package/lib/contracts/index.d.ts.map +1 -1
- package/lib/contracts/index.js +2 -0
- package/lib/contracts/index.js.map +1 -1
- package/lib/contracts/render.d.ts +244 -63
- package/lib/contracts/render.d.ts.map +1 -1
- package/lib/contracts/render.js +35 -2
- package/lib/contracts/render.js.map +1 -1
- package/lib/contracts/semantic.d.ts +3 -3
- package/lib/esm/{chunk-6YMBQGEH.mjs → chunk-DOQFYTAY.mjs} +16 -2
- package/lib/esm/chunk-DOQFYTAY.mjs.map +1 -0
- package/lib/esm/{chunk-DKJLFQED.mjs → chunk-EMRIN6FD.mjs} +2 -2
- package/lib/esm/{chunk-DNAWFM27.mjs → chunk-GAAD4RFK.mjs} +335 -4
- package/lib/esm/chunk-GAAD4RFK.mjs.map +1 -0
- package/lib/esm/{chunk-H5Z4GWPV.mjs → chunk-HFNPLMKA.mjs} +2069 -1742
- package/lib/esm/chunk-HFNPLMKA.mjs.map +1 -0
- package/lib/esm/contracts/index.mjs +36 -2
- package/lib/esm/index.mjs +44 -4
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +9 -3
- package/lib/esm/schemas/index.mjs +2 -2
- package/lib/json-schema/bento-node.schema.json +141 -1
- package/lib/json-schema/declarative-page-overlay.schema.json +184 -0
- package/lib/json-schema/declarative-page-package.schema.json +73 -0
- package/lib/json-schema/declarative-page-rendering.schema.json +239 -0
- package/lib/json-schema/declarative-publication-last-known-good-result.schema.json +675 -0
- package/lib/json-schema/declarative-publication-last-known-good.schema.json +651 -0
- package/lib/json-schema/declarative-publication-record-result.schema.json +1138 -0
- package/lib/json-schema/declarative-publication-recovery-result.schema.json +1775 -0
- package/lib/json-schema/declarative-publication-verification.schema.json +11 -0
- package/lib/json-schema/index.json +7 -0
- package/lib/json-schema/overlay-node.schema.json +241 -1
- package/lib/json-schema/page-runtime-bundle.schema.json +241 -1
- package/lib/json-schema/page.schema.json +241 -1
- package/lib/json-schema/render-node.schema.json +241 -1
- package/lib/json-schema/render-tree.schema.json +241 -1
- package/lib/json-schema/view-ontology-record.schema.json +141 -1
- package/lib/runtime/bento-render-tree.d.ts.map +1 -1
- package/lib/runtime/bento-render-tree.js +13 -1
- package/lib/runtime/bento-render-tree.js.map +1 -1
- package/lib/runtime/declarative-control-compiler.d.ts.map +1 -1
- package/lib/runtime/declarative-control-compiler.js +1 -0
- package/lib/runtime/declarative-control-compiler.js.map +1 -1
- package/lib/runtime/declarative-page-delivery.d.ts +41 -0
- package/lib/runtime/declarative-page-delivery.d.ts.map +1 -0
- package/lib/runtime/declarative-page-delivery.js +270 -0
- package/lib/runtime/declarative-page-delivery.js.map +1 -0
- package/lib/runtime/index.d.ts +1 -0
- package/lib/runtime/index.d.ts.map +1 -1
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/index.js.map +1 -1
- package/lib/runtime/runtime-definition-wire.d.ts +191 -83
- package/lib/runtime/runtime-definition-wire.d.ts.map +1 -1
- package/lib/schemas/index.d.ts +304 -33
- package/lib/schemas/index.d.ts.map +1 -1
- package/lib/schemas/index.js +9 -0
- package/lib/schemas/index.js.map +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-6YMBQGEH.mjs.map +0 -1
- package/lib/esm/chunk-DNAWFM27.mjs.map +0 -1
- package/lib/esm/chunk-H5Z4GWPV.mjs.map +0 -1
- /package/lib/esm/{chunk-DKJLFQED.mjs.map → chunk-EMRIN6FD.mjs.map} +0 -0
|
@@ -4,9 +4,10 @@ import {
|
|
|
4
4
|
PAGE_STREAM_MAX_FRAME_BYTES,
|
|
5
5
|
PageStreamDescriptorSchema,
|
|
6
6
|
PageStreamEventSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EMRIN6FD.mjs";
|
|
8
8
|
import {
|
|
9
9
|
AccessPolicySchema,
|
|
10
|
+
ActionProgramArtifactSchema,
|
|
10
11
|
ActionProgramDefinitionSchema,
|
|
11
12
|
AgentSessionEventSchema,
|
|
12
13
|
AgentSessionViewModelSchema,
|
|
@@ -24,6 +25,10 @@ import {
|
|
|
24
25
|
ComponentAssemblySchema,
|
|
25
26
|
ConductorWorkflowDefinitionSchema,
|
|
26
27
|
ContractIdentifierSchema,
|
|
28
|
+
DECLARATIVE_PAGE_BINDING_TOKEN_SOURCE,
|
|
29
|
+
DeclarativePageOverlaySchema,
|
|
30
|
+
DeclarativePagePackageSchema,
|
|
31
|
+
DeclarativePageRenderingSchema,
|
|
27
32
|
DeclarativeProductResourceRegistrationSchema,
|
|
28
33
|
DeclarativeRouteOwnerIndexSchema,
|
|
29
34
|
DeclarativeRuntimeResolveResultSchema,
|
|
@@ -72,6 +77,7 @@ import {
|
|
|
72
77
|
PermissionAlternativePolicySchema,
|
|
73
78
|
ProductAccessDeclarationSchema,
|
|
74
79
|
ProductDeclarationSchema,
|
|
80
|
+
ProductDeclarativeAuthoringCatalogSchema,
|
|
75
81
|
ProductDeclarativeCapabilityRegistrationSchema,
|
|
76
82
|
ProductSurfaceSchema,
|
|
77
83
|
RecordEditorDraftOperationSchema,
|
|
@@ -120,7 +126,7 @@ import {
|
|
|
120
126
|
require_validation,
|
|
121
127
|
require_validation_error,
|
|
122
128
|
resolveThemeTokens
|
|
123
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-HFNPLMKA.mjs";
|
|
124
130
|
import {
|
|
125
131
|
__commonJS,
|
|
126
132
|
__toESM
|
|
@@ -2795,6 +2801,7 @@ var resolvePage = (input) => {
|
|
|
2795
2801
|
...node.dataBinding ? { dataBinding: node.dataBinding } : {},
|
|
2796
2802
|
...node.module ? { module: node.module } : {},
|
|
2797
2803
|
...node.dynamicLayout ? { dynamicLayout: node.dynamicLayout } : {},
|
|
2804
|
+
...node.wiring ? { wiring: node.wiring } : {},
|
|
2798
2805
|
...node.style ? { style: node.style } : {},
|
|
2799
2806
|
responsive: node.responsive ?? [],
|
|
2800
2807
|
state: node.state ?? "idle",
|
|
@@ -4822,6 +4829,318 @@ function normalizeDeclarativeReferences(document, resolve) {
|
|
|
4822
4829
|
return { document: visit(document), counts };
|
|
4823
4830
|
}
|
|
4824
4831
|
|
|
4832
|
+
// src/runtime/declarative-page-delivery.ts
|
|
4833
|
+
var byText = (left, right) => left < right ? -1 : left > right ? 1 : 0;
|
|
4834
|
+
var DeclarativePageDeliveryError = class extends Error {
|
|
4835
|
+
constructor(code, message, details = []) {
|
|
4836
|
+
super(message);
|
|
4837
|
+
this.code = code;
|
|
4838
|
+
this.details = details;
|
|
4839
|
+
this.name = "DeclarativePageDeliveryError";
|
|
4840
|
+
}
|
|
4841
|
+
};
|
|
4842
|
+
var CATALOG_COLLECTIONS = [
|
|
4843
|
+
"createTemplates",
|
|
4844
|
+
"routeSpaces",
|
|
4845
|
+
"resourceRegistrations",
|
|
4846
|
+
"defaultPolicies",
|
|
4847
|
+
"domainQueryDefinitions",
|
|
4848
|
+
"domainCommandDefinitions",
|
|
4849
|
+
"schemaDefinitions",
|
|
4850
|
+
"capabilityRegistrations"
|
|
4851
|
+
];
|
|
4852
|
+
var DETAIL_LIMIT = 20;
|
|
4853
|
+
var isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
4854
|
+
var bindingText = (binding) => binding.kind === "value" ? binding.value : binding.id;
|
|
4855
|
+
function collectDeclarativePageBindingKeys(document) {
|
|
4856
|
+
const keys = /* @__PURE__ */ new Set();
|
|
4857
|
+
const visit = (value) => {
|
|
4858
|
+
if (typeof value === "string") {
|
|
4859
|
+
for (const match of value.matchAll(
|
|
4860
|
+
new RegExp(DECLARATIVE_PAGE_BINDING_TOKEN_SOURCE, "g")
|
|
4861
|
+
)) {
|
|
4862
|
+
keys.add(match[1]);
|
|
4863
|
+
}
|
|
4864
|
+
} else if (Array.isArray(value)) {
|
|
4865
|
+
value.forEach(visit);
|
|
4866
|
+
} else if (isRecord(value)) {
|
|
4867
|
+
Object.values(value).forEach(visit);
|
|
4868
|
+
}
|
|
4869
|
+
};
|
|
4870
|
+
visit(document);
|
|
4871
|
+
return [...keys];
|
|
4872
|
+
}
|
|
4873
|
+
var substitute = (document, bindings, used, unbound) => {
|
|
4874
|
+
if (typeof document === "string") {
|
|
4875
|
+
return document.replace(
|
|
4876
|
+
new RegExp(DECLARATIVE_PAGE_BINDING_TOKEN_SOURCE, "g"),
|
|
4877
|
+
(token, key) => {
|
|
4878
|
+
const binding = bindings[key];
|
|
4879
|
+
if (!binding) {
|
|
4880
|
+
unbound.add(key);
|
|
4881
|
+
return token;
|
|
4882
|
+
}
|
|
4883
|
+
used.add(key);
|
|
4884
|
+
return bindingText(binding);
|
|
4885
|
+
}
|
|
4886
|
+
);
|
|
4887
|
+
}
|
|
4888
|
+
if (Array.isArray(document)) {
|
|
4889
|
+
return document.map((entry) => substitute(entry, bindings, used, unbound));
|
|
4890
|
+
}
|
|
4891
|
+
if (isRecord(document)) {
|
|
4892
|
+
return Object.fromEntries(
|
|
4893
|
+
Object.entries(document).map(([key, value]) => [
|
|
4894
|
+
key,
|
|
4895
|
+
substitute(value, bindings, used, unbound)
|
|
4896
|
+
])
|
|
4897
|
+
);
|
|
4898
|
+
}
|
|
4899
|
+
return document;
|
|
4900
|
+
};
|
|
4901
|
+
var issueLines = (issues) => issues.slice(0, DETAIL_LIMIT).map((issue) => `${issue.path.map(String).join(".") || "(root)"}: ${issue.message}`);
|
|
4902
|
+
var parsePackages = (sources) => {
|
|
4903
|
+
const packages = /* @__PURE__ */ new Map();
|
|
4904
|
+
sources.forEach((source, index) => {
|
|
4905
|
+
const parsed = DeclarativePagePackageSchema.safeParse(source.manifest);
|
|
4906
|
+
if (!parsed.success) {
|
|
4907
|
+
throw new DeclarativePageDeliveryError(
|
|
4908
|
+
"DELIVERY_PACKAGE_INVALID",
|
|
4909
|
+
`Package manifest ${index} is not a DeclarativePagePackage.`,
|
|
4910
|
+
issueLines(parsed.error.issues)
|
|
4911
|
+
);
|
|
4912
|
+
}
|
|
4913
|
+
if (packages.has(parsed.data.domain)) {
|
|
4914
|
+
throw new DeclarativePageDeliveryError(
|
|
4915
|
+
"DELIVERY_PACKAGE_DUPLICATE",
|
|
4916
|
+
`Package ${parsed.data.domain} is declared more than once.`
|
|
4917
|
+
);
|
|
4918
|
+
}
|
|
4919
|
+
packages.set(parsed.data.domain, { manifest: parsed.data, source });
|
|
4920
|
+
});
|
|
4921
|
+
return packages;
|
|
4922
|
+
};
|
|
4923
|
+
var pageIdOf = (document, owner) => {
|
|
4924
|
+
if (!isRecord(document) || typeof document.pageId !== "string" || !document.pageId) {
|
|
4925
|
+
throw new DeclarativePageDeliveryError(
|
|
4926
|
+
"DELIVERY_DOCUMENT_INVALID",
|
|
4927
|
+
`Package ${owner} contains a Page without a pageId.`
|
|
4928
|
+
);
|
|
4929
|
+
}
|
|
4930
|
+
return document.pageId;
|
|
4931
|
+
};
|
|
4932
|
+
var programIdOf = (document, owner) => {
|
|
4933
|
+
const definition = isRecord(document) ? document.definition : void 0;
|
|
4934
|
+
if (!isRecord(definition) || typeof definition.programId !== "string" || !definition.programId) {
|
|
4935
|
+
throw new DeclarativePageDeliveryError(
|
|
4936
|
+
"DELIVERY_DOCUMENT_INVALID",
|
|
4937
|
+
`Package ${owner} contains an ActionProgram artifact without a programId.`
|
|
4938
|
+
);
|
|
4939
|
+
}
|
|
4940
|
+
return definition.programId;
|
|
4941
|
+
};
|
|
4942
|
+
function renderDeclarativePagePackages(input) {
|
|
4943
|
+
const parsedOverlay = DeclarativePageOverlaySchema.safeParse(input.overlay);
|
|
4944
|
+
if (!parsedOverlay.success) {
|
|
4945
|
+
throw new DeclarativePageDeliveryError(
|
|
4946
|
+
"DELIVERY_OVERLAY_INVALID",
|
|
4947
|
+
"The overlay is not a DeclarativePageOverlay.",
|
|
4948
|
+
issueLines(parsedOverlay.error.issues)
|
|
4949
|
+
);
|
|
4950
|
+
}
|
|
4951
|
+
const overlay = parsedOverlay.data;
|
|
4952
|
+
const packages = parsePackages(input.packages);
|
|
4953
|
+
const selected = new Map(overlay.packages.map((entry) => [entry.package, entry]));
|
|
4954
|
+
const closure = /* @__PURE__ */ new Set();
|
|
4955
|
+
const pending = [...selected.keys()];
|
|
4956
|
+
while (pending.length > 0) {
|
|
4957
|
+
const name = pending.pop();
|
|
4958
|
+
if (closure.has(name)) continue;
|
|
4959
|
+
const entry = packages.get(name);
|
|
4960
|
+
if (!entry) {
|
|
4961
|
+
throw new DeclarativePageDeliveryError(
|
|
4962
|
+
"DELIVERY_PACKAGE_UNKNOWN",
|
|
4963
|
+
`Package ${name} is selected or required but was not provided.`
|
|
4964
|
+
);
|
|
4965
|
+
}
|
|
4966
|
+
closure.add(name);
|
|
4967
|
+
pending.push(...entry.manifest.dependsOn);
|
|
4968
|
+
}
|
|
4969
|
+
const closureNames = [...closure].sort();
|
|
4970
|
+
const applicationIds = new Set(
|
|
4971
|
+
closureNames.map((name) => packages.get(name).manifest.applicationId)
|
|
4972
|
+
);
|
|
4973
|
+
if (applicationIds.size !== 1) {
|
|
4974
|
+
throw new DeclarativePageDeliveryError(
|
|
4975
|
+
"DELIVERY_APPLICATION_MISMATCH",
|
|
4976
|
+
"Selected packages and their dependencies must belong to one application.",
|
|
4977
|
+
closureNames.map((name) => `${name}: ${packages.get(name).manifest.applicationId}`)
|
|
4978
|
+
);
|
|
4979
|
+
}
|
|
4980
|
+
const applicationId = [...applicationIds][0];
|
|
4981
|
+
const foreign = closureNames.filter((name) => {
|
|
4982
|
+
const customer = packages.get(name).manifest.customer;
|
|
4983
|
+
return customer !== void 0 && customer !== overlay.customer;
|
|
4984
|
+
});
|
|
4985
|
+
if (foreign.length > 0) {
|
|
4986
|
+
throw new DeclarativePageDeliveryError(
|
|
4987
|
+
"DELIVERY_CUSTOMER_MISMATCH",
|
|
4988
|
+
`Overlay ${overlay.customer}/${overlay.environment} cannot use another customer's packages.`,
|
|
4989
|
+
foreign
|
|
4990
|
+
);
|
|
4991
|
+
}
|
|
4992
|
+
const unbound = /* @__PURE__ */ new Map();
|
|
4993
|
+
const render = (document, label) => {
|
|
4994
|
+
const documentUsed = /* @__PURE__ */ new Set();
|
|
4995
|
+
const documentUnbound = /* @__PURE__ */ new Set();
|
|
4996
|
+
const value = substitute(document, overlay.bindings, documentUsed, documentUnbound);
|
|
4997
|
+
if (documentUnbound.size > 0) unbound.set(label, documentUnbound);
|
|
4998
|
+
return { value, keys: [...documentUsed].sort() };
|
|
4999
|
+
};
|
|
5000
|
+
const pages = {};
|
|
5001
|
+
const pageEntries = [];
|
|
5002
|
+
for (const name of [...selected.keys()].sort()) {
|
|
5003
|
+
const { source } = packages.get(name);
|
|
5004
|
+
const available = /* @__PURE__ */ new Map();
|
|
5005
|
+
for (const document of source.pages ?? []) {
|
|
5006
|
+
const pageId = pageIdOf(document, name);
|
|
5007
|
+
if (available.has(pageId)) {
|
|
5008
|
+
throw new DeclarativePageDeliveryError(
|
|
5009
|
+
"DELIVERY_PAGE_DUPLICATE",
|
|
5010
|
+
`Package ${name} declares Page ${pageId} more than once.`
|
|
5011
|
+
);
|
|
5012
|
+
}
|
|
5013
|
+
available.set(pageId, document);
|
|
5014
|
+
}
|
|
5015
|
+
const wanted = selected.get(name).pages ?? [...available.keys()];
|
|
5016
|
+
const missing = wanted.filter((pageId) => !available.has(pageId));
|
|
5017
|
+
if (missing.length > 0) {
|
|
5018
|
+
throw new DeclarativePageDeliveryError(
|
|
5019
|
+
"DELIVERY_PAGE_UNKNOWN",
|
|
5020
|
+
`Overlay selects Pages that package ${name} does not contain.`,
|
|
5021
|
+
missing
|
|
5022
|
+
);
|
|
5023
|
+
}
|
|
5024
|
+
for (const pageId of [...wanted].sort()) {
|
|
5025
|
+
if (pages[pageId]) {
|
|
5026
|
+
throw new DeclarativePageDeliveryError(
|
|
5027
|
+
"DELIVERY_PAGE_DUPLICATE",
|
|
5028
|
+
`Page ${pageId} is owned by more than one selected package.`
|
|
5029
|
+
);
|
|
5030
|
+
}
|
|
5031
|
+
const rendered = render(available.get(pageId), `page ${pageId}`);
|
|
5032
|
+
const checked = PageSchema.safeParse(rendered.value);
|
|
5033
|
+
if (!checked.success && !unbound.has(`page ${pageId}`)) {
|
|
5034
|
+
throw new DeclarativePageDeliveryError(
|
|
5035
|
+
"DELIVERY_DOCUMENT_INVALID",
|
|
5036
|
+
`Rendered Page ${pageId} is not a valid Page.`,
|
|
5037
|
+
issueLines(checked.error.issues)
|
|
5038
|
+
);
|
|
5039
|
+
}
|
|
5040
|
+
pages[pageId] = rendered.value;
|
|
5041
|
+
const bindings = [];
|
|
5042
|
+
for (const key of rendered.keys) {
|
|
5043
|
+
const binding = overlay.bindings[key];
|
|
5044
|
+
if (binding.kind !== "value") bindings.push({ key, binding });
|
|
5045
|
+
}
|
|
5046
|
+
pageEntries.push({
|
|
5047
|
+
pageId,
|
|
5048
|
+
package: name,
|
|
5049
|
+
contentHash: canonicalContentHash(rendered.value),
|
|
5050
|
+
bindings
|
|
5051
|
+
});
|
|
5052
|
+
}
|
|
5053
|
+
}
|
|
5054
|
+
const programs = {};
|
|
5055
|
+
const programEntries = [];
|
|
5056
|
+
const merged = Object.fromEntries(
|
|
5057
|
+
CATALOG_COLLECTIONS.map((collection) => [collection, []])
|
|
5058
|
+
);
|
|
5059
|
+
for (const name of closureNames) {
|
|
5060
|
+
const { source } = packages.get(name);
|
|
5061
|
+
for (const document of source.programs ?? []) {
|
|
5062
|
+
const programId = programIdOf(document, name);
|
|
5063
|
+
if (programs[programId]) {
|
|
5064
|
+
throw new DeclarativePageDeliveryError(
|
|
5065
|
+
"DELIVERY_PROGRAM_DUPLICATE",
|
|
5066
|
+
`ActionProgram ${programId} is owned by more than one package.`
|
|
5067
|
+
);
|
|
5068
|
+
}
|
|
5069
|
+
const rendered2 = render(document, `program ${programId}`);
|
|
5070
|
+
const checked = ActionProgramArtifactSchema.safeParse(rendered2.value);
|
|
5071
|
+
if (!checked.success && !unbound.has(`program ${programId}`)) {
|
|
5072
|
+
throw new DeclarativePageDeliveryError(
|
|
5073
|
+
"DELIVERY_DOCUMENT_INVALID",
|
|
5074
|
+
`Rendered ActionProgram ${programId} is not a valid artifact.`,
|
|
5075
|
+
issueLines(checked.error.issues)
|
|
5076
|
+
);
|
|
5077
|
+
}
|
|
5078
|
+
programs[programId] = rendered2.value;
|
|
5079
|
+
programEntries.push({
|
|
5080
|
+
programId,
|
|
5081
|
+
package: name,
|
|
5082
|
+
contentHash: canonicalContentHash(rendered2.value)
|
|
5083
|
+
});
|
|
5084
|
+
}
|
|
5085
|
+
if (source.catalog === void 0) continue;
|
|
5086
|
+
const rendered = render(source.catalog, `catalog ${name}`).value;
|
|
5087
|
+
if (!isRecord(rendered) || rendered.applicationId !== applicationId) {
|
|
5088
|
+
throw new DeclarativePageDeliveryError(
|
|
5089
|
+
"DELIVERY_CATALOG_INVALID",
|
|
5090
|
+
`The catalog of package ${name} does not belong to application ${applicationId}.`
|
|
5091
|
+
);
|
|
5092
|
+
}
|
|
5093
|
+
for (const collection of CATALOG_COLLECTIONS) {
|
|
5094
|
+
const entries = rendered[collection];
|
|
5095
|
+
if (entries === void 0) continue;
|
|
5096
|
+
if (!Array.isArray(entries)) {
|
|
5097
|
+
throw new DeclarativePageDeliveryError(
|
|
5098
|
+
"DELIVERY_CATALOG_INVALID",
|
|
5099
|
+
`The catalog of package ${name} has a non-array ${collection}.`
|
|
5100
|
+
);
|
|
5101
|
+
}
|
|
5102
|
+
merged[collection].push(...entries);
|
|
5103
|
+
}
|
|
5104
|
+
}
|
|
5105
|
+
if (unbound.size > 0) {
|
|
5106
|
+
throw new DeclarativePageDeliveryError(
|
|
5107
|
+
"DELIVERY_BINDING_UNBOUND",
|
|
5108
|
+
`Overlay ${overlay.customer}/${overlay.environment} leaves binding keys unbound.`,
|
|
5109
|
+
[...unbound.entries()].slice(0, DETAIL_LIMIT).map(([label, keys]) => `${label}: ${[...keys].sort().join(", ")}`)
|
|
5110
|
+
);
|
|
5111
|
+
}
|
|
5112
|
+
const catalogCandidate = {
|
|
5113
|
+
contract: "ProductDeclarativeAuthoringCatalog",
|
|
5114
|
+
schemaVersion: 1,
|
|
5115
|
+
applicationId,
|
|
5116
|
+
...merged
|
|
5117
|
+
};
|
|
5118
|
+
const catalog = ProductDeclarativeAuthoringCatalogSchema.safeParse(catalogCandidate);
|
|
5119
|
+
if (!catalog.success) {
|
|
5120
|
+
throw new DeclarativePageDeliveryError(
|
|
5121
|
+
"DELIVERY_CATALOG_INVALID",
|
|
5122
|
+
"The merged package catalogs are not a valid ProductDeclarativeAuthoringCatalog.",
|
|
5123
|
+
issueLines(catalog.error.issues)
|
|
5124
|
+
);
|
|
5125
|
+
}
|
|
5126
|
+
const unsigned = {
|
|
5127
|
+
contract: "DeclarativePageRendering",
|
|
5128
|
+
schemaVersion: 1,
|
|
5129
|
+
customer: overlay.customer,
|
|
5130
|
+
environment: overlay.environment,
|
|
5131
|
+
applicationId,
|
|
5132
|
+
packages: closureNames,
|
|
5133
|
+
pages: pageEntries.sort((left, right) => byText(left.pageId, right.pageId)),
|
|
5134
|
+
programs: programEntries.sort((left, right) => byText(left.programId, right.programId)),
|
|
5135
|
+
catalogContentHash: canonicalContentHash(catalogCandidate)
|
|
5136
|
+
};
|
|
5137
|
+
const rendering = DeclarativePageRenderingSchema.parse({
|
|
5138
|
+
...unsigned,
|
|
5139
|
+
contentHash: canonicalContentHash(unsigned)
|
|
5140
|
+
});
|
|
5141
|
+
return { rendering, pages, programs, catalog: catalogCandidate };
|
|
5142
|
+
}
|
|
5143
|
+
|
|
4825
5144
|
// src/runtime/menu-compiler.ts
|
|
4826
5145
|
var MenuCompilationError = class extends Error {
|
|
4827
5146
|
constructor(code, path, message) {
|
|
@@ -8004,6 +8323,13 @@ function mapContainerLayout(node) {
|
|
|
8004
8323
|
...gap !== void 0 ? { gap } : {}
|
|
8005
8324
|
};
|
|
8006
8325
|
}
|
|
8326
|
+
if (node.layout === "floating") {
|
|
8327
|
+
return {
|
|
8328
|
+
mode: "floating",
|
|
8329
|
+
...node.floating ? { floating: node.floating } : {},
|
|
8330
|
+
...gap !== void 0 ? { gap } : {}
|
|
8331
|
+
};
|
|
8332
|
+
}
|
|
8007
8333
|
return {
|
|
8008
8334
|
mode: "flex",
|
|
8009
8335
|
direction: node.direction === "horizontal" ? "row" : "column",
|
|
@@ -8036,7 +8362,7 @@ function mapLeafDataBinding(node, data) {
|
|
|
8036
8362
|
const inlineStatement = data?.statements?.[source.statementId];
|
|
8037
8363
|
return inlineStatement ?? { kind: "statement", statementId: source.statementId };
|
|
8038
8364
|
}
|
|
8039
|
-
if (source.kind === "ontology-relation" || source.kind === "ontology-action" || source.kind === "artifact.body" || source.kind === "record.fields") {
|
|
8365
|
+
if (source.kind === "ontology-relation" || source.kind === "ontology-action" || source.kind === "artifact.body" || source.kind === "record.fields" || source.kind === "navigation" || source.kind === "workflow" || source.kind === "command") {
|
|
8040
8366
|
return source;
|
|
8041
8367
|
}
|
|
8042
8368
|
return void 0;
|
|
@@ -8096,10 +8422,12 @@ function compileBentoNodeToRenderTree(root, options) {
|
|
|
8096
8422
|
kind: parentNodeId ? "view" : "page",
|
|
8097
8423
|
children: node.children.map((child) => child.id),
|
|
8098
8424
|
layout: mapContainerLayout(node),
|
|
8425
|
+
...node.wiring ? { wiring: node.wiring } : {},
|
|
8099
8426
|
renderModel: {
|
|
8100
8427
|
bentoKind: "container",
|
|
8101
8428
|
layout: node.layout,
|
|
8102
8429
|
...node.direction ? { direction: node.direction } : {},
|
|
8430
|
+
...node.floating ? { floating: node.floating } : {},
|
|
8103
8431
|
...node.title ? { title: node.title } : {},
|
|
8104
8432
|
...node.description ? { description: node.description } : {},
|
|
8105
8433
|
...node.wiring ? { wiring: node.wiring } : {}
|
|
@@ -8216,6 +8544,9 @@ export {
|
|
|
8216
8544
|
assertProgramRegistration,
|
|
8217
8545
|
projectCurrentNavigationPages,
|
|
8218
8546
|
normalizeDeclarativeReferences,
|
|
8547
|
+
DeclarativePageDeliveryError,
|
|
8548
|
+
collectDeclarativePageBindingKeys,
|
|
8549
|
+
renderDeclarativePagePackages,
|
|
8219
8550
|
MenuCompilationError,
|
|
8220
8551
|
resolveMenuActivationId,
|
|
8221
8552
|
readMenuActivationFromSearch,
|
|
@@ -8308,4 +8639,4 @@ export {
|
|
|
8308
8639
|
compileBentoNodeToRenderTree,
|
|
8309
8640
|
compileViewRecordToRenderTree
|
|
8310
8641
|
};
|
|
8311
|
-
//# sourceMappingURL=chunk-
|
|
8642
|
+
//# sourceMappingURL=chunk-GAAD4RFK.mjs.map
|