@betterportal/config-manager 0.0.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/README.md +3 -0
- package/bsb-plugin.json +23 -0
- package/bsb-tests.json +14 -0
- package/lib/.bsb/clients/service-betterportal-config-manager.d.ts +37 -0
- package/lib/.bsb/clients/service-betterportal-config-manager.d.ts.map +1 -0
- package/lib/.bsb/clients/service-betterportal-config-manager.js +40 -0
- package/lib/.bsb/clients/service-betterportal-config-manager.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/.bp-generated/registry.d.ts +3 -0
- package/lib/plugins/service-betterportal-config-manager/.bp-generated/registry.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/.bp-generated/registry.js +235 -0
- package/lib/plugins/service-betterportal-config-manager/.bp-generated/registry.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/adminApi.d.ts +4 -0
- package/lib/plugins/service-betterportal-config-manager/adminApi.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/adminApi.js +2319 -0
- package/lib/plugins/service-betterportal-config-manager/adminApi.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapEndpoint.d.ts +21 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapEndpoint.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapEndpoint.js +269 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapEndpoint.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapWizardHtml.d.ts +19 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapWizardHtml.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapWizardHtml.js +329 -0
- package/lib/plugins/service-betterportal-config-manager/bootstrapWizardHtml.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/auth/_theme.bootstrap1/index.d.ts +4 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/auth/_theme.bootstrap1/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/auth/_theme.bootstrap1/index.js +38 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/auth/_theme.bootstrap1/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/auth/index.d.ts +96 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/auth/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/auth/index.js +78 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/auth/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/config/_theme.bootstrap1/index.d.ts +4 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/config/_theme.bootstrap1/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/config/_theme.bootstrap1/index.js +62 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/config/_theme.bootstrap1/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/config/_theme.embedded.d.ts +5 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/config/_theme.embedded.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/config/_theme.embedded.js +5 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/config/_theme.embedded.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/config/index.d.ts +43 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/config/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/config/index.js +68 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/config/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/fragments/_theme.bootstrap1/index.d.ts +5 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/fragments/_theme.bootstrap1/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/fragments/_theme.bootstrap1/index.js +11 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/fragments/_theme.bootstrap1/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/fragments/index.d.ts +32 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/fragments/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/fragments/index.js +32 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/fragments/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/menu/_theme.bootstrap1/index.d.ts +4 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/menu/_theme.bootstrap1/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/menu/_theme.bootstrap1/index.js +170 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/menu/_theme.bootstrap1/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/menu/index.d.ts +60 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/menu/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/menu/index.js +48 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/menu/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview/_theme.bootstrap1/index.d.ts +4 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview/_theme.bootstrap1/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview/_theme.bootstrap1/index.js +28 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview/_theme.bootstrap1/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview/index.d.ts +48 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview/index.js +40 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/preview/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/routes/_theme.bootstrap1/index.d.ts +5 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/routes/_theme.bootstrap1/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/routes/_theme.bootstrap1/index.js +194 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/routes/_theme.bootstrap1/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/routes/index.d.ts +80 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/routes/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/routes/index.js +59 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/routes/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/_theme.bootstrap1/index.d.ts +5 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/_theme.bootstrap1/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/_theme.bootstrap1/index.js +167 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/_theme.bootstrap1/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/index.d.ts +128 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/index.js +89 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/services/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/settings/_theme.bootstrap1/index.d.ts +5 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/settings/_theme.bootstrap1/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/settings/_theme.bootstrap1/index.js +8 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/settings/_theme.bootstrap1/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/settings/index.d.ts +89 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/settings/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/settings/index.js +93 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/settings/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/tenants/_theme.bootstrap1/index.d.ts +4 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/tenants/_theme.bootstrap1/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/tenants/_theme.bootstrap1/index.js +61 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/tenants/_theme.bootstrap1/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/tenants/index.d.ts +180 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/tenants/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/tenants/index.js +405 -0
- package/lib/plugins/service-betterportal-config-manager/bp-routes/tenants/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/cpBootstrap.d.ts +26 -0
- package/lib/plugins/service-betterportal-config-manager/cpBootstrap.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/cpBootstrap.js +58 -0
- package/lib/plugins/service-betterportal-config-manager/cpBootstrap.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/fragmentsEditor.d.ts +3 -0
- package/lib/plugins/service-betterportal-config-manager/fragmentsEditor.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/fragmentsEditor.js +365 -0
- package/lib/plugins/service-betterportal-config-manager/fragmentsEditor.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/index.d.ts +143 -0
- package/lib/plugins/service-betterportal-config-manager/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/index.js +696 -0
- package/lib/plugins/service-betterportal-config-manager/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/menuEditor.d.ts +3 -0
- package/lib/plugins/service-betterportal-config-manager/menuEditor.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/menuEditor.js +823 -0
- package/lib/plugins/service-betterportal-config-manager/menuEditor.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/routeContext.d.ts +10 -0
- package/lib/plugins/service-betterportal-config-manager/routeContext.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/routeContext.js +11 -0
- package/lib/plugins/service-betterportal-config-manager/routeContext.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/setupTokens.d.ts +18 -0
- package/lib/plugins/service-betterportal-config-manager/setupTokens.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/setupTokens.js +245 -0
- package/lib/plugins/service-betterportal-config-manager/setupTokens.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/storage/core.d.ts +41 -0
- package/lib/plugins/service-betterportal-config-manager/storage/core.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/storage/core.js +396 -0
- package/lib/plugins/service-betterportal-config-manager/storage/core.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/storage/file.d.ts +10 -0
- package/lib/plugins/service-betterportal-config-manager/storage/file.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/storage/file.js +30 -0
- package/lib/plugins/service-betterportal-config-manager/storage/file.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/storage/index.d.ts +36 -0
- package/lib/plugins/service-betterportal-config-manager/storage/index.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/storage/index.js +52 -0
- package/lib/plugins/service-betterportal-config-manager/storage/index.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/storage/postgres.d.ts +15 -0
- package/lib/plugins/service-betterportal-config-manager/storage/postgres.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/storage/postgres.js +60 -0
- package/lib/plugins/service-betterportal-config-manager/storage/postgres.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/syncApi.d.ts +44 -0
- package/lib/plugins/service-betterportal-config-manager/syncApi.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/syncApi.js +280 -0
- package/lib/plugins/service-betterportal-config-manager/syncApi.js.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/webhooks.d.ts +6 -0
- package/lib/plugins/service-betterportal-config-manager/webhooks.d.ts.map +1 -0
- package/lib/plugins/service-betterportal-config-manager/webhooks.js +372 -0
- package/lib/plugins/service-betterportal-config-manager/webhooks.js.map +1 -0
- package/lib/schemas/service-betterportal-config-manager.json +157 -0
- package/lib/schemas/service-betterportal-config-manager.plugin.json +135 -0
- package/package.json +69 -0
package/lib/plugins/service-betterportal-config-manager/bp-routes/config/_theme.bootstrap1/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "jsx-htmx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource jsx-htmx */
|
|
3
|
+
import { js } from "jsx-htmx";
|
|
4
|
+
function configManagerRuntimeSource(timeoutMs) {
|
|
5
|
+
return js(`(() => {
|
|
6
|
+
const timeoutValue = ${timeoutMs};
|
|
7
|
+
|
|
8
|
+
const setCardStatus = (card, values) => {
|
|
9
|
+
const statusNode = card.querySelector("[data-bp-config-status]");
|
|
10
|
+
const modeNode = card.querySelector("[data-bp-config-mode]");
|
|
11
|
+
const schemaCountNode = card.querySelector("[data-bp-config-schema-count]");
|
|
12
|
+
const writeNode = card.querySelector("[data-bp-config-write]");
|
|
13
|
+
if (statusNode) { statusNode.textContent = values.statusText; statusNode.className = "badge " + values.statusClass; }
|
|
14
|
+
if (modeNode) { modeNode.textContent = values.modeText; }
|
|
15
|
+
if (schemaCountNode) { schemaCountNode.textContent = values.schemaCountText; }
|
|
16
|
+
if (writeNode) { writeNode.textContent = values.writeText; writeNode.className = "badge " + (values.writeText === "write enabled" ? "text-bg-info" : "text-bg-secondary"); }
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const inspectCard = async (card) => {
|
|
20
|
+
const healthUrl = card.dataset.bpHealthUrl;
|
|
21
|
+
const schemaUrl = card.dataset.bpSchemaUrl;
|
|
22
|
+
if (!healthUrl) return;
|
|
23
|
+
|
|
24
|
+
setCardStatus(card, { statusText: "checking", statusClass: "text-bg-secondary", modeText: "Checking...", schemaCountText: "...", writeText: "unknown" });
|
|
25
|
+
|
|
26
|
+
const controller = new AbortController();
|
|
27
|
+
const timeout = window.setTimeout(() => controller.abort(), timeoutValue);
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
const healthResponse = await fetch(healthUrl, { method: "GET", headers: { Accept: "application/json" }, signal: controller.signal });
|
|
31
|
+
if (!healthResponse.ok) throw new Error("Health check failed: " + healthResponse.status);
|
|
32
|
+
|
|
33
|
+
if (!schemaUrl) {
|
|
34
|
+
setCardStatus(card, { statusText: "online", statusClass: "text-bg-success", modeText: "No config", schemaCountText: "0", writeText: "n/a" });
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const schemaResponse = await fetch(schemaUrl, { method: "GET", headers: { Accept: "application/json" }, signal: controller.signal });
|
|
39
|
+
if (!schemaResponse.ok) {
|
|
40
|
+
setCardStatus(card, { statusText: "online", statusClass: "text-bg-success", modeText: "No config", schemaCountText: "0", writeText: "n/a" });
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const payload = (schemaResponse.headers.get("content-type") || "").includes("application/json") ? await schemaResponse.json() : null;
|
|
45
|
+
if (!payload) throw new Error("Schema returned non-JSON");
|
|
46
|
+
const schemaCount = Array.isArray(payload.configSchemas) ? payload.configSchemas.length : 0;
|
|
47
|
+
setCardStatus(card, { statusText: "available", statusClass: "text-bg-success", modeText: payload.mode || "unknown", schemaCountText: String(schemaCount), writeText: payload.supportsWrite === true ? "write enabled" : "read only" });
|
|
48
|
+
} catch {
|
|
49
|
+
setCardStatus(card, { statusText: "unreachable", statusClass: "text-bg-warning", modeText: "Unavailable", schemaCountText: "0", writeText: "unknown" });
|
|
50
|
+
} finally {
|
|
51
|
+
window.clearTimeout(timeout);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const run = () => { document.querySelectorAll("[data-bp-config-card]").forEach((card) => { inspectCard(card); }); };
|
|
56
|
+
if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", run, { once: true }); } else { run(); }
|
|
57
|
+
})()`);
|
|
58
|
+
}
|
|
59
|
+
export function render(data) {
|
|
60
|
+
return (_jsxs("div", { class: "container-fluid px-0", children: [_jsxs("div", { class: "d-flex flex-wrap justify-content-between align-items-start gap-3 mb-4", children: [_jsxs("div", { children: [_jsx("div", { class: "text-uppercase small text-secondary fw-semibold", children: "Admin Config" }), _jsx("h2", { class: "mb-2", children: data.title }), _jsxs("p", { class: "text-secondary mb-0", children: ["Tenant ", _jsx("strong", { children: data.tenantId }), ", app ", _jsx("strong", { children: data.appId })] })] }), _jsxs("div", { class: "d-flex gap-2 flex-wrap", children: [_jsxs("span", { class: "badge text-bg-primary", children: [data.services.length, " services"] }), _jsx("span", { class: "badge text-bg-dark", children: "Client-side discovery" })] })] }), _jsx("div", { class: "row g-3", children: data.services.map((service) => (_jsx("div", { class: "col-12 col-xl-6", children: _jsx("article", { class: "card border-0 shadow-sm h-100", "data-bp-config-card": "", "data-bp-health-url": service.healthUrl, "data-bp-schema-url": service.schemaUrl, children: _jsxs("div", { class: "card-body", children: [_jsxs("div", { class: "d-flex justify-content-between align-items-start gap-3 mb-3", children: [_jsxs("div", { children: [_jsx("div", { class: "text-uppercase small text-secondary fw-semibold", children: "Service" }), _jsx("h5", { class: "mb-1", children: service.serviceId }), _jsx("div", { class: "text-secondary small", children: service.endpointBaseUrl })] }), _jsx("span", { class: "badge text-bg-secondary", "data-bp-config-status": "", children: "pending" })] }), _jsxs("div", { class: "row g-2 mb-3", children: [_jsx("div", { class: "col-6", children: _jsxs("div", { class: "rounded-3 bg-body-tertiary p-3", children: [_jsx("div", { class: "small text-secondary", children: "Mode" }), _jsx("div", { class: "fw-semibold", "data-bp-config-mode": "", children: "Waiting..." })] }) }), _jsx("div", { class: "col-6", children: _jsxs("div", { class: "rounded-3 bg-body-tertiary p-3", children: [_jsx("div", { class: "small text-secondary", children: "Schemas" }), _jsx("div", { class: "fw-semibold", "data-bp-config-schema-count": "", children: "..." })] }) })] }), _jsxs("div", { class: "small text-secondary mb-2", children: ["Binding: ", service.bindingId] }), _jsxs("div", { class: "small text-secondary mb-3", children: ["Deployment: ", service.deploymentMode] }), _jsxs("div", { class: "d-flex gap-2 flex-wrap", children: [_jsx("a", { class: "btn btn-sm btn-primary", href: service.schemaUrl, target: "_blank", rel: "noreferrer", children: "Schema" }), _jsx("a", { class: "btn btn-sm btn-outline-secondary", href: service.manifestUrl, target: "_blank", rel: "noreferrer", children: "Manifest" }), _jsx("span", { class: "badge text-bg-secondary", "data-bp-config-write": "", children: "unknown" })] })] }) }) }))) }), _jsx("script", { children: configManagerRuntimeSource(data.requestTimeoutMs) })] }));
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/plugins/service-betterportal-config-manager/bp-routes/config/_theme.bootstrap1/index.tsx"],"names":[],"mappings":";AAAA,gCAAgC;AAChC,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAI9B,SAAS,0BAA0B,CAAC,SAAiB;IACnD,OAAO,EAAE,CAAC;2BACe,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmD7B,CAAC,CAAC;AACT,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,IAAkB;IACvC,OAAO,CACL,eAAK,KAAK,EAAC,sBAAsB,aAC/B,eAAK,KAAK,EAAC,uEAAuE,aAChF,0BACE,cAAK,KAAK,EAAC,iDAAiD,6BAAmB,EAC/E,aAAI,KAAK,EAAC,MAAM,YAAE,IAAI,CAAC,KAAK,GAAM,EAClC,aAAG,KAAK,EAAC,qBAAqB,wBACrB,2BAAS,IAAI,CAAC,QAAQ,GAAU,YAAM,2BAAS,IAAI,CAAC,KAAK,GAAU,IACxE,IACA,EACN,eAAK,KAAK,EAAC,wBAAwB,aACjC,gBAAM,KAAK,EAAC,uBAAuB,aAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,iBAAiB,EAC1E,eAAM,KAAK,EAAC,oBAAoB,sCAA6B,IACzD,IACF,EACN,cAAK,KAAK,EAAC,SAAS,YACjB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAC9B,cAAK,KAAK,EAAC,iBAAiB,YAC1B,kBACE,KAAK,EAAC,+BAA+B,yBACjB,EAAE,wBACF,OAAO,CAAC,SAAS,wBACjB,OAAO,CAAC,SAAS,YAErC,eAAK,KAAK,EAAC,WAAW,aACpB,eAAK,KAAK,EAAC,6DAA6D,aACtE,0BACE,cAAK,KAAK,EAAC,iDAAiD,wBAAc,EAC1E,aAAI,KAAK,EAAC,MAAM,YAAE,OAAO,CAAC,SAAS,GAAM,EACzC,cAAK,KAAK,EAAC,sBAAsB,YAAE,OAAO,CAAC,eAAe,GAAO,IAC7D,EACN,eAAM,KAAK,EAAC,yBAAyB,2BAAuB,EAAE,wBAAe,IACzE,EACN,eAAK,KAAK,EAAC,cAAc,aACvB,cAAK,KAAK,EAAC,OAAO,YAChB,eAAK,KAAK,EAAC,gCAAgC,aACzC,cAAK,KAAK,EAAC,sBAAsB,qBAAW,EAC5C,cAAK,KAAK,EAAC,aAAa,yBAAqB,EAAE,2BAAiB,IAC5D,GACF,EACN,cAAK,KAAK,EAAC,OAAO,YAChB,eAAK,KAAK,EAAC,gCAAgC,aACzC,cAAK,KAAK,EAAC,sBAAsB,wBAAc,EAC/C,cAAK,KAAK,EAAC,aAAa,iCAA6B,EAAE,oBAAU,IAC7D,GACF,IACF,EACN,eAAK,KAAK,EAAC,2BAA2B,0BAAW,OAAO,CAAC,SAAS,IAAO,EACzE,eAAK,KAAK,EAAC,2BAA2B,6BAAc,OAAO,CAAC,cAAc,IAAO,EACjF,eAAK,KAAK,EAAC,wBAAwB,aACjC,YAAG,KAAK,EAAC,wBAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,uBAAW,EACtG,YAAG,KAAK,EAAC,kCAAkC,EAAC,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,yBAAa,EACpH,eAAM,KAAK,EAAC,yBAAyB,0BAAsB,EAAE,wBAAe,IACxE,IACF,GACE,GACN,CACP,CAAC,GACE,EACN,2BAAS,0BAA0B,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAU,IAChE,CACP,CAAC;AACJ,CAAC"}
|
package/lib/plugins/service-betterportal-config-manager/bp-routes/config/_theme.embedded.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_theme.embedded.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/service-betterportal-config-manager/bp-routes/config/_theme.embedded.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,wBAAgB,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CAezD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "jsx-htmx/jsx-runtime";
|
|
2
|
+
export function render(data) {
|
|
3
|
+
return (_jsxs("div", { class: "p-3", "data-bp-config-root": "", "data-bp-request-timeout": String(data.requestTimeoutMs), children: [_jsx("div", { class: "fw-semibold mb-2", children: data.title }), _jsxs("div", { class: "text-secondary small mb-3", children: [data.services.length, " services discovered"] }), _jsx("div", { class: "list-group", children: data.services.map((service) => (_jsxs("div", { class: "list-group-item", children: [_jsx("div", { class: "fw-semibold", children: service.serviceId }), _jsx("div", { class: "small text-secondary", children: service.endpointBaseUrl })] }))) })] }));
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=_theme.embedded.js.map
|
package/lib/plugins/service-betterportal-config-manager/bp-routes/config/_theme.embedded.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_theme.embedded.js","sourceRoot":"","sources":["../../../../../src/plugins/service-betterportal-config-manager/bp-routes/config/_theme.embedded.tsx"],"names":[],"mappings":";AAIA,MAAM,UAAU,MAAM,CAAC,IAAkB;IACvC,OAAO,CACL,eAAK,KAAK,EAAC,KAAK,yBAAqB,EAAE,6BAA0B,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,aAC5F,cAAK,KAAK,EAAC,kBAAkB,YAAE,IAAI,CAAC,KAAK,GAAO,EAChD,eAAK,KAAK,EAAC,2BAA2B,aAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,4BAA2B,EACvF,cAAK,KAAK,EAAC,YAAY,YACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAC9B,eAAK,KAAK,EAAC,iBAAiB,aAC1B,cAAK,KAAK,EAAC,aAAa,YAAE,OAAO,CAAC,SAAS,GAAO,EAClD,cAAK,KAAK,EAAC,sBAAsB,YAAE,OAAO,CAAC,eAAe,GAAO,IAC7D,CACP,CAAC,GACE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as av from "anyvali";
|
|
2
|
+
import type { Infer } from "anyvali";
|
|
3
|
+
import { type DemoScenario, type ApiAuthRequirement, type CacheHints } from "@betterportal/framework";
|
|
4
|
+
export declare const QuerySchema: av.ObjectSchema<{}>;
|
|
5
|
+
export declare const HeadersSchema: av.ObjectSchema<{}>;
|
|
6
|
+
export declare const RequestSchema: av.ObjectSchema<{}>;
|
|
7
|
+
export declare const ResponseSchema: av.ObjectSchema<{
|
|
8
|
+
title: av.StringSchema;
|
|
9
|
+
tenantId: av.StringSchema;
|
|
10
|
+
appId: av.StringSchema;
|
|
11
|
+
requestTimeoutMs: av.IntSchema;
|
|
12
|
+
services: av.ArraySchema<av.ObjectSchema<{
|
|
13
|
+
serviceId: av.StringSchema;
|
|
14
|
+
bindingId: av.StringSchema;
|
|
15
|
+
endpointBaseUrl: av.StringSchema;
|
|
16
|
+
deploymentMode: av.StringSchema;
|
|
17
|
+
healthUrl: av.StringSchema;
|
|
18
|
+
schemaUrl: av.StringSchema;
|
|
19
|
+
manifestUrl: av.StringSchema;
|
|
20
|
+
}>>;
|
|
21
|
+
}>;
|
|
22
|
+
export type ResponseData = Infer<typeof ResponseSchema>;
|
|
23
|
+
export declare const title = "Config Manager";
|
|
24
|
+
export declare const description = "Admin service that discovers BetterPortal service config surfaces.";
|
|
25
|
+
export declare const auth: ApiAuthRequirement;
|
|
26
|
+
export declare const cacheHints: CacheHints;
|
|
27
|
+
export declare const demoScenarios: DemoScenario<ResponseData>[];
|
|
28
|
+
export declare const handleGet: import("@betterportal/framework").RouteHandler<Record<string, string>, Record<string, unknown>, Record<string, string>, Record<string, unknown>, {
|
|
29
|
+
title: string;
|
|
30
|
+
tenantId: string;
|
|
31
|
+
appId: string;
|
|
32
|
+
requestTimeoutMs: number;
|
|
33
|
+
services: {
|
|
34
|
+
serviceId: string;
|
|
35
|
+
bindingId: string;
|
|
36
|
+
endpointBaseUrl: string;
|
|
37
|
+
deploymentMode: string;
|
|
38
|
+
healthUrl: string;
|
|
39
|
+
schemaUrl: string;
|
|
40
|
+
manifestUrl: string;
|
|
41
|
+
}[];
|
|
42
|
+
}, unknown, Record<string, unknown>>;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/service-betterportal-config-manager/bp-routes/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAIjC,eAAO,MAAM,WAAW,qBAA0C,CAAC;AAEnE,eAAO,MAAM,aAAa,qBAA0C,CAAC;AAErE,eAAO,MAAM,aAAa,qBAA0C,CAAC;AAYrE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;EAMC,CAAC;AAC7B,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAIxD,eAAO,MAAM,KAAK,mBAAmB,CAAC;AACtC,eAAO,MAAM,WAAW,uEAAuE,CAAC;AAEhG,eAAO,MAAM,IAAI,EAAE,kBAKlB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAGxB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,YAAY,CAAC,EAarD,CAAC;AAIF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;oCAoBrB,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as av from "anyvali";
|
|
2
|
+
import { createHandler } from "@betterportal/framework";
|
|
3
|
+
// -- Schemas ---------------------------------------------------------
|
|
4
|
+
export const QuerySchema = av.object({}, { unknownKeys: "strip" });
|
|
5
|
+
export const HeadersSchema = av.object({}, { unknownKeys: "strip" });
|
|
6
|
+
export const RequestSchema = av.object({}, { unknownKeys: "strip" });
|
|
7
|
+
const ConfigManagerServiceSchema = av.object({
|
|
8
|
+
serviceId: av.string().minLength(1),
|
|
9
|
+
bindingId: av.string().minLength(1),
|
|
10
|
+
endpointBaseUrl: av.string().format("url"),
|
|
11
|
+
deploymentMode: av.string().minLength(1),
|
|
12
|
+
healthUrl: av.string().format("url"),
|
|
13
|
+
schemaUrl: av.string().format("url"),
|
|
14
|
+
manifestUrl: av.string().format("url")
|
|
15
|
+
}, { unknownKeys: "strip" });
|
|
16
|
+
export const ResponseSchema = av.object({
|
|
17
|
+
title: av.string().minLength(1),
|
|
18
|
+
tenantId: av.string().minLength(1),
|
|
19
|
+
appId: av.string().minLength(1),
|
|
20
|
+
requestTimeoutMs: av.int().min(1),
|
|
21
|
+
services: av.array(ConfigManagerServiceSchema)
|
|
22
|
+
}, { unknownKeys: "strip" });
|
|
23
|
+
// -- Metadata --------------------------------------------------------
|
|
24
|
+
export const title = "Config Manager";
|
|
25
|
+
export const description = "Admin service that discovers BetterPortal service config surfaces.";
|
|
26
|
+
export const auth = {
|
|
27
|
+
required: true,
|
|
28
|
+
permissions: [
|
|
29
|
+
{ serviceId: "service.betterportal.config-manager", viewId: "config.index", permissions: ["read", "update"] }
|
|
30
|
+
]
|
|
31
|
+
};
|
|
32
|
+
export const cacheHints = {
|
|
33
|
+
ttlSeconds: 30,
|
|
34
|
+
varyBy: ["accept", "origin", "referer", ":origin", ":referer"]
|
|
35
|
+
};
|
|
36
|
+
export const demoScenarios = [
|
|
37
|
+
{
|
|
38
|
+
id: "default",
|
|
39
|
+
title: "Default Config Admin",
|
|
40
|
+
match: { query: {} },
|
|
41
|
+
response: {
|
|
42
|
+
title: "Config Manager",
|
|
43
|
+
tenantId: "tenant-main",
|
|
44
|
+
appId: "app-main",
|
|
45
|
+
requestTimeoutMs: 2000,
|
|
46
|
+
services: []
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
];
|
|
50
|
+
// -- Handler ---------------------------------------------------------
|
|
51
|
+
export const handleGet = createHandler({ response: ResponseSchema }, (ctx) => {
|
|
52
|
+
// The actual data is injected by the main plugin via the handler context.
|
|
53
|
+
// This handler is a passthrough - the plugin builds the response model
|
|
54
|
+
// from config/bindings and attaches it to the event before the H3 adapter
|
|
55
|
+
// calls this handler.
|
|
56
|
+
if (ctx.responseModel) {
|
|
57
|
+
return ctx.responseModel;
|
|
58
|
+
}
|
|
59
|
+
// Fallback: return empty state (should not happen in normal flow)
|
|
60
|
+
return {
|
|
61
|
+
title: "Config Manager",
|
|
62
|
+
tenantId: "unknown",
|
|
63
|
+
appId: "unknown",
|
|
64
|
+
requestTimeoutMs: 2000,
|
|
65
|
+
services: []
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugins/service-betterportal-config-manager/bp-routes/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EACL,aAAa,EAId,MAAM,yBAAyB,CAAC;AAEjC,uEAAuE;AAEvE,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;AAErE,MAAM,0BAA0B,GAAG,EAAE,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IACnC,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IACnC,eAAe,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;IAC1C,cAAc,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IACxC,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;IACpC,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;IACpC,WAAW,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;CACvC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;AAE7B,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/B,QAAQ,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAClC,KAAK,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/B,gBAAgB,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,0BAA0B,CAAC;CAC/C,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;AAG7B,uEAAuE;AAEvE,MAAM,CAAC,MAAM,KAAK,GAAG,gBAAgB,CAAC;AACtC,MAAM,CAAC,MAAM,WAAW,GAAG,oEAAoE,CAAC;AAEhG,MAAM,CAAC,MAAM,IAAI,GAAuB;IACtC,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE;QACX,EAAE,SAAS,EAAE,qCAAqC,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC,MAAM,EAAC,QAAQ,CAAC,EAAE;KAC7G;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAe;IACpC,UAAU,EAAE,EAAE;IACd,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC;CAC/D,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAiC;IACzD;QACE,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,sBAAsB;QAC7B,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACpB,QAAQ,EAAE;YACR,KAAK,EAAE,gBAAgB;YACvB,QAAQ,EAAE,aAAa;YACvB,KAAK,EAAE,UAAU;YACjB,gBAAgB,EAAE,IAAI;YACtB,QAAQ,EAAE,EAAE;SACb;KACF;CACF,CAAC;AAEF,uEAAuE;AAEvE,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CACpC,EAAE,QAAQ,EAAE,cAAc,EAAE,EAC5B,CAAC,GAAG,EAAE,EAAE;IACN,0EAA0E;IAC1E,uEAAuE;IACvE,0EAA0E;IAC1E,sBAAsB;IACtB,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC;QACtB,OAAO,GAAG,CAAC,aAA6B,CAAC;IAC3C,CAAC;IAED,kEAAkE;IAClE,OAAO;QACL,KAAK,EAAE,gBAAgB;QACvB,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,SAAS;QAChB,gBAAgB,EAAE,IAAI;QACtB,QAAQ,EAAE,EAAE;KACb,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/plugins/service-betterportal-config-manager/bp-routes/fragments/_theme.bootstrap1/index.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,wBAAgB,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CAsCzD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "jsx-htmx/jsx-runtime";
|
|
2
|
+
export function render(data) {
|
|
3
|
+
const editorBase = "/.well-known/bp/admin/fragments-editor";
|
|
4
|
+
const initialUrl = data.selectedAppId ? `${editorBase}?appId=${encodeURIComponent(data.selectedAppId)}` : "";
|
|
5
|
+
return (_jsxs("div", { class: "container-fluid px-0", children: [_jsxs("div", { class: "mb-4", children: [_jsx("h2", { class: "mb-1", children: data.title }), _jsx("p", { class: "text-secondary mb-0", children: "Add service-rendered widgets to the topbar and other shell regions." })] }), _jsxs("div", { class: "mb-4", children: [_jsx("label", { class: "form-label fw-semibold", children: "App" }), _jsxs("select", { class: "form-select", name: "appId", "hx-get": editorBase, "hx-target": "#bp-fragments-editor", "hx-swap": "outerHTML", "hx-trigger": "change", "hx-include": "this", children: [_jsx("option", { value: "", children: "Choose an app..." }), data.apps.map((app) => (_jsxs("option", { value: app.id, selected: app.id === data.selectedAppId, children: [app.title, " (", app.tenantId, ")"] })))] })] }), _jsx("div", { id: "bp-fragments-editor", ...(data.selectedAppId
|
|
6
|
+
? { "hx-get": initialUrl, "hx-trigger": "load", "hx-swap": "outerHTML" }
|
|
7
|
+
: {}), children: data.selectedAppId
|
|
8
|
+
? _jsx("div", { class: "text-secondary", children: "Loading editor..." })
|
|
9
|
+
: _jsx("div", { class: "alert alert-secondary", children: "Select an app to manage its fragments" }) })] }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/plugins/service-betterportal-config-manager/bp-routes/fragments/_theme.bootstrap1/index.tsx"],"names":[],"mappings":";AAIA,MAAM,UAAU,MAAM,CAAC,IAAkB;IACvC,MAAM,UAAU,GAAG,wCAAwC,CAAC;IAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,UAAU,UAAU,kBAAkB,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAE7G,OAAO,CACL,eAAK,KAAK,EAAC,sBAAsB,aAC/B,eAAK,KAAK,EAAC,MAAM,aACf,aAAI,KAAK,EAAC,MAAM,YAAE,IAAI,CAAC,KAAK,GAAM,EAClC,YAAG,KAAK,EAAC,qBAAqB,oFAAwE,IAClG,EAEN,eAAK,KAAK,EAAC,MAAM,aACf,gBAAO,KAAK,EAAC,wBAAwB,oBAAY,EACjD,kBAAQ,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,OAAO,YAC9B,UAAU,eACR,sBAAsB,aACxB,WAAW,gBACR,QAAQ,gBACR,MAAM,aACjB,iBAAQ,KAAK,EAAC,EAAE,iCAA0B,EACzC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACtB,kBAAQ,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,aAAa,aAC3D,GAAG,CAAC,KAAK,QAAI,GAAG,CAAC,QAAQ,SACnB,CACV,CAAC,IACK,IACL,EAEN,cAAK,EAAE,EAAC,qBAAqB,KACvB,CAAC,IAAI,CAAC,aAAa;oBACrB,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE;oBACxE,CAAC,CAAC,EAAE,CAAC,YACN,IAAI,CAAC,aAAa;oBACjB,CAAC,CAAC,cAAK,KAAK,EAAC,gBAAgB,kCAAwB;oBACrD,CAAC,CAAC,cAAK,KAAK,EAAC,uBAAuB,sDAA4C,GAC9E,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as av from "anyvali";
|
|
2
|
+
import type { Infer } from "anyvali";
|
|
3
|
+
import { type DemoScenario, type ApiAuthRequirement, type CacheHints } from "@betterportal/framework";
|
|
4
|
+
export declare const ResponseSchema: av.ObjectSchema<{
|
|
5
|
+
title: av.StringSchema;
|
|
6
|
+
apps: av.ArraySchema<av.ObjectSchema<{
|
|
7
|
+
id: av.StringSchema;
|
|
8
|
+
title: av.StringSchema;
|
|
9
|
+
tenantId: av.StringSchema;
|
|
10
|
+
}>>;
|
|
11
|
+
selectedAppId: av.OptionalSchema<av.StringSchema>;
|
|
12
|
+
adminApiBase: av.StringSchema;
|
|
13
|
+
serviceBaseUrl: av.StringSchema;
|
|
14
|
+
}>;
|
|
15
|
+
export type ResponseData = Infer<typeof ResponseSchema>;
|
|
16
|
+
export declare const title = "Fragments";
|
|
17
|
+
export declare const description = "Manage topbar/footer fragments per app.";
|
|
18
|
+
export declare const auth: ApiAuthRequirement;
|
|
19
|
+
export declare const cacheHints: CacheHints;
|
|
20
|
+
export declare const demoScenarios: DemoScenario<ResponseData>[];
|
|
21
|
+
export declare const handleGet: import("@betterportal/framework").RouteHandler<Record<string, string>, Record<string, unknown>, Record<string, string>, Record<string, unknown>, {
|
|
22
|
+
title: string;
|
|
23
|
+
apps: {
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
tenantId: string;
|
|
27
|
+
}[];
|
|
28
|
+
adminApiBase: string;
|
|
29
|
+
serviceBaseUrl: string;
|
|
30
|
+
selectedAppId?: string | undefined;
|
|
31
|
+
}, unknown, Record<string, unknown>>;
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/service-betterportal-config-manager/bp-routes/fragments/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAQjC,eAAO,MAAM,cAAc;;;;;;;;;;EAMC,CAAC;AAC7B,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAExD,eAAO,MAAM,KAAK,cAAc,CAAC;AACjC,eAAO,MAAM,WAAW,4CAA4C,CAAC;AAErE,eAAO,MAAM,IAAI,EAAE,kBAKlB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAA4D,CAAC;AAEtF,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,YAAY,CAAC,EAErD,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;oCAMrB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as av from "anyvali";
|
|
2
|
+
import { createHandler } from "@betterportal/framework";
|
|
3
|
+
const AppSummarySchema = av.object({
|
|
4
|
+
id: av.string().minLength(1),
|
|
5
|
+
title: av.string().minLength(1),
|
|
6
|
+
tenantId: av.string().minLength(1)
|
|
7
|
+
}, { unknownKeys: "strip" });
|
|
8
|
+
export const ResponseSchema = av.object({
|
|
9
|
+
title: av.string().minLength(1),
|
|
10
|
+
apps: av.array(AppSummarySchema),
|
|
11
|
+
selectedAppId: av.optional(av.string()),
|
|
12
|
+
adminApiBase: av.string().minLength(1),
|
|
13
|
+
serviceBaseUrl: av.string().minLength(1)
|
|
14
|
+
}, { unknownKeys: "strip" });
|
|
15
|
+
export const title = "Fragments";
|
|
16
|
+
export const description = "Manage topbar/footer fragments per app.";
|
|
17
|
+
export const auth = {
|
|
18
|
+
required: true,
|
|
19
|
+
permissions: [
|
|
20
|
+
{ serviceId: "service.betterportal.config-manager", viewId: "fragments.index", permissions: ["read", "create", "update", "delete"] }
|
|
21
|
+
]
|
|
22
|
+
};
|
|
23
|
+
export const cacheHints = { ttlSeconds: 0, varyBy: ["accept", "origin"] };
|
|
24
|
+
export const demoScenarios = [
|
|
25
|
+
{ id: "default", title: "Default", response: { title: "Fragments", apps: [], adminApiBase: "/.well-known/bp/admin", serviceBaseUrl: "" } }
|
|
26
|
+
];
|
|
27
|
+
export const handleGet = createHandler({ response: ResponseSchema }, (ctx) => {
|
|
28
|
+
if (ctx.responseModel)
|
|
29
|
+
return ctx.responseModel;
|
|
30
|
+
return { title: "Fragments", apps: [], adminApiBase: "/.well-known/bp/admin", serviceBaseUrl: "" };
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugins/service-betterportal-config-manager/bp-routes/fragments/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EACL,aAAa,EAId,MAAM,yBAAyB,CAAC;AAEjC,MAAM,gBAAgB,GAAG,EAAE,CAAC,MAAM,CAAC;IACjC,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5B,KAAK,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/B,QAAQ,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;CACnC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;AAE7B,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/B,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAChC,aAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC;IACvC,YAAY,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IACtC,cAAc,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;CACzC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;AAG7B,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC;AACjC,MAAM,CAAC,MAAM,WAAW,GAAG,yCAAyC,CAAC;AAErE,MAAM,CAAC,MAAM,IAAI,GAAuB;IACtC,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE;QACX,EAAE,SAAS,EAAE,qCAAqC,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,CAAC,MAAM,EAAC,QAAQ,EAAC,QAAQ,EAAC,QAAQ,CAAC,EAAE;KAClI;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAe,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;AAEtF,MAAM,CAAC,MAAM,aAAa,GAAiC;IACzD,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,uBAAuB,EAAE,cAAc,EAAE,EAAE,EAAE,EAAE;CAC3I,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CACpC,EAAE,QAAQ,EAAE,cAAc,EAAE,EAC5B,CAAC,GAAG,EAAE,EAAE;IACN,IAAI,GAAG,CAAC,aAAa;QAAE,OAAO,GAAG,CAAC,aAA6B,CAAC;IAChE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,uBAAuB,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;AACrG,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/plugins/service-betterportal-config-manager/bp-routes/menu/_theme.bootstrap1/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAgKhD,wBAAgB,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CAwCzD"}
|
package/lib/plugins/service-betterportal-config-manager/bp-routes/menu/_theme.bootstrap1/index.js
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "jsx-htmx/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource jsx-htmx */
|
|
3
|
+
import { js } from "jsx-htmx";
|
|
4
|
+
function dragScript() {
|
|
5
|
+
return js(`if (document.body.dataset.bpMenuDragBound !== "1") {
|
|
6
|
+
document.body.dataset.bpMenuDragBound = "1";
|
|
7
|
+
|
|
8
|
+
const PADDING_BASE = 16;
|
|
9
|
+
const DEPTH_PX = 24;
|
|
10
|
+
const SCROLL_ZONE = 80;
|
|
11
|
+
const SCROLL_SPEED = 14;
|
|
12
|
+
|
|
13
|
+
let draggingId = null;
|
|
14
|
+
let draggingIsGroup = false;
|
|
15
|
+
let anchorId = null;
|
|
16
|
+
let targetDepth = 0;
|
|
17
|
+
let scrollTimer = null;
|
|
18
|
+
|
|
19
|
+
let indicator = null;
|
|
20
|
+
let label = null;
|
|
21
|
+
const ensureIndicator = () => {
|
|
22
|
+
if (!indicator) {
|
|
23
|
+
indicator = document.createElement("div");
|
|
24
|
+
indicator.style.cssText = "position:fixed; height:4px; background:var(--bs-primary); pointer-events:none; z-index:9999; border-radius:2px; box-shadow:0 0 6px var(--bs-primary); display:none;";
|
|
25
|
+
document.body.appendChild(indicator);
|
|
26
|
+
label = document.createElement("div");
|
|
27
|
+
label.style.cssText = "position:fixed; pointer-events:none; z-index:9999; background:var(--bs-primary); color:white; font-size:11px; font-weight:600; padding:2px 6px; border-radius:3px; display:none;";
|
|
28
|
+
document.body.appendChild(label);
|
|
29
|
+
}
|
|
30
|
+
return indicator;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const clearAll = () => {
|
|
34
|
+
document.querySelectorAll("[data-bp-drag-item]").forEach((el) => {
|
|
35
|
+
el.classList.remove("opacity-50");
|
|
36
|
+
});
|
|
37
|
+
if (indicator) indicator.style.display = "none";
|
|
38
|
+
if (label) label.style.display = "none";
|
|
39
|
+
stopAutoScroll();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const stopAutoScroll = () => {
|
|
43
|
+
if (scrollTimer) { clearInterval(scrollTimer); scrollTimer = null; }
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const startAutoScroll = (dy) => {
|
|
47
|
+
stopAutoScroll();
|
|
48
|
+
scrollTimer = setInterval(() => {
|
|
49
|
+
// Try scrolling main outlet, fall back to window
|
|
50
|
+
const outlet = document.querySelector(".bp-admin__workspace, main, body");
|
|
51
|
+
const scroller = (document.scrollingElement || document.documentElement);
|
|
52
|
+
scroller.scrollTop += dy;
|
|
53
|
+
}, 16);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
document.body.addEventListener("dragstart", (e) => {
|
|
57
|
+
const li = e.target.closest && e.target.closest("[data-bp-drag-item]");
|
|
58
|
+
if (!li) return;
|
|
59
|
+
draggingId = li.dataset.bpDragItem;
|
|
60
|
+
draggingIsGroup = li.dataset.bpDragType === "group";
|
|
61
|
+
e.dataTransfer.effectAllowed = "move";
|
|
62
|
+
e.dataTransfer.setData("text/plain", draggingId);
|
|
63
|
+
li.classList.add("opacity-50");
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
document.body.addEventListener("dragend", () => {
|
|
67
|
+
clearAll();
|
|
68
|
+
draggingId = null;
|
|
69
|
+
draggingIsGroup = false;
|
|
70
|
+
anchorId = null;
|
|
71
|
+
targetDepth = 0;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
document.body.addEventListener("dragover", (e) => {
|
|
75
|
+
if (!draggingId) return;
|
|
76
|
+
const list = document.querySelector("#bp-menu-editor .list-group");
|
|
77
|
+
if (!list) return;
|
|
78
|
+
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
e.dataTransfer.dropEffect = "move";
|
|
81
|
+
|
|
82
|
+
// Auto-scroll near viewport edges
|
|
83
|
+
if (e.clientY < SCROLL_ZONE) startAutoScroll(-SCROLL_SPEED);
|
|
84
|
+
else if (window.innerHeight - e.clientY < SCROLL_ZONE) startAutoScroll(SCROLL_SPEED);
|
|
85
|
+
else stopAutoScroll();
|
|
86
|
+
|
|
87
|
+
const allRows = Array.from(list.querySelectorAll("[data-bp-drag-item]"));
|
|
88
|
+
const y = e.clientY;
|
|
89
|
+
let anchor = null;
|
|
90
|
+
for (const r of allRows) {
|
|
91
|
+
if (r.dataset.bpDragItem === draggingId) continue;
|
|
92
|
+
const rect = r.getBoundingClientRect();
|
|
93
|
+
if (y >= rect.top + rect.height / 2) anchor = r;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const ind = ensureIndicator();
|
|
97
|
+
const listRect = list.getBoundingClientRect();
|
|
98
|
+
|
|
99
|
+
if (!anchor) {
|
|
100
|
+
anchorId = "";
|
|
101
|
+
targetDepth = 0;
|
|
102
|
+
const firstRow = allRows.find((r) => r.dataset.bpDragItem !== draggingId);
|
|
103
|
+
const topY = firstRow ? firstRow.getBoundingClientRect().top : listRect.top;
|
|
104
|
+
ind.style.left = (listRect.left + PADDING_BASE) + "px";
|
|
105
|
+
ind.style.width = Math.max(40, (listRect.width - PADDING_BASE * 2)) + "px";
|
|
106
|
+
ind.style.top = (topY - 2) + "px";
|
|
107
|
+
ind.style.display = "block";
|
|
108
|
+
label.textContent = "depth 0";
|
|
109
|
+
label.style.left = (listRect.left + PADDING_BASE) + "px";
|
|
110
|
+
label.style.top = (topY - 22) + "px";
|
|
111
|
+
label.style.display = "block";
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const anchorDepth = parseInt(anchor.dataset.bpDragDepth || "0", 10);
|
|
116
|
+
const anchorIsGroup = anchor.dataset.bpDragType === "group";
|
|
117
|
+
const maxDepth = draggingIsGroup ? 0 : (anchorDepth + (anchorIsGroup ? 1 : 0));
|
|
118
|
+
|
|
119
|
+
// Depth = anchor.depth + (cursor offset from anchor's content X, in DEPTH_PX steps)
|
|
120
|
+
const xRel = e.clientX - listRect.left;
|
|
121
|
+
const anchorContentX = PADDING_BASE + anchorDepth * DEPTH_PX;
|
|
122
|
+
const depthDelta = Math.floor((xRel - anchorContentX) / DEPTH_PX);
|
|
123
|
+
const requestedDepth = anchorDepth + depthDelta;
|
|
124
|
+
const clampedDepth = Math.max(0, Math.min(requestedDepth, maxDepth));
|
|
125
|
+
|
|
126
|
+
anchorId = anchor.dataset.bpDragItem;
|
|
127
|
+
targetDepth = clampedDepth;
|
|
128
|
+
|
|
129
|
+
const anchorRect = anchor.getBoundingClientRect();
|
|
130
|
+
const indentPx = PADDING_BASE + clampedDepth * DEPTH_PX;
|
|
131
|
+
ind.style.left = (listRect.left + indentPx) + "px";
|
|
132
|
+
ind.style.width = Math.max(40, (listRect.width - indentPx - 8)) + "px";
|
|
133
|
+
ind.style.top = (anchorRect.bottom - 2) + "px";
|
|
134
|
+
ind.style.display = "block";
|
|
135
|
+
label.textContent = "depth " + clampedDepth + (draggingIsGroup ? " (group)" : "");
|
|
136
|
+
label.style.left = (listRect.left + indentPx) + "px";
|
|
137
|
+
label.style.top = (anchorRect.bottom - 22) + "px";
|
|
138
|
+
label.style.display = "block";
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
document.body.addEventListener("drop", (e) => {
|
|
142
|
+
if (!draggingId) return;
|
|
143
|
+
e.preventDefault();
|
|
144
|
+
const src = draggingId;
|
|
145
|
+
const aId = anchorId;
|
|
146
|
+
const depth = targetDepth;
|
|
147
|
+
clearAll();
|
|
148
|
+
draggingId = null;
|
|
149
|
+
draggingIsGroup = false;
|
|
150
|
+
anchorId = null;
|
|
151
|
+
targetDepth = 0;
|
|
152
|
+
const form = document.getElementById("bp-drag-move-form");
|
|
153
|
+
if (!form) return;
|
|
154
|
+
form.querySelector("[name=itemId]").value = src;
|
|
155
|
+
form.querySelector("[name=anchorId]").value = aId ?? "";
|
|
156
|
+
form.querySelector("[name=targetDepth]").value = String(depth);
|
|
157
|
+
form.requestSubmit();
|
|
158
|
+
});
|
|
159
|
+
}`);
|
|
160
|
+
}
|
|
161
|
+
export function render(data) {
|
|
162
|
+
const editorBase = "/.well-known/bp/admin/menu-editor";
|
|
163
|
+
const initialUrl = data.selectedAppId ? `${editorBase}?appId=${encodeURIComponent(data.selectedAppId)}` : "";
|
|
164
|
+
return (_jsxs("div", { class: "container-fluid px-0", children: [_jsxs("div", { class: "mb-4", children: [_jsx("h2", { class: "mb-1", children: data.title }), _jsx("p", { class: "text-secondary mb-0", children: "Drag rows to reorder. Drag right to nest, left to unnest. Click title to rename. Live nav refresh on save." })] }), _jsxs("div", { class: "mb-4", children: [_jsx("label", { class: "form-label fw-semibold", children: "App" }), _jsxs("select", { class: "form-select", name: "appId", "hx-get": editorBase, "hx-target": "#bp-menu-editor", "hx-swap": "outerHTML", "hx-trigger": "change", "hx-include": "this", children: [_jsx("option", { value: "", children: "Choose an app..." }), data.apps.map((app) => (_jsxs("option", { value: app.id, selected: app.id === data.selectedAppId, children: [app.title, " (", app.tenantId, ")"] })))] })] }), _jsx("div", { id: "bp-menu-editor", ...(data.selectedAppId
|
|
165
|
+
? { "hx-get": initialUrl, "hx-trigger": "load", "hx-swap": "outerHTML" }
|
|
166
|
+
: {}), children: data.selectedAppId
|
|
167
|
+
? _jsx("div", { class: "text-secondary", children: "Loading editor..." })
|
|
168
|
+
: _jsx("div", { class: "alert alert-secondary", children: "Select an app to design its menu" }) }), _jsx("script", { children: dragScript() })] }));
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/plugins/service-betterportal-config-manager/bp-routes/menu/_theme.bootstrap1/index.tsx"],"names":[],"mappings":";AAAA,gCAAgC;AAChC,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAI9B,SAAS,UAAU;IACjB,OAAO,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0JR,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,IAAkB;IACvC,MAAM,UAAU,GAAG,mCAAmC,CAAC;IACvD,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,UAAU,UAAU,kBAAkB,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAE7G,OAAO,CACL,eAAK,KAAK,EAAC,sBAAsB,aAC/B,eAAK,KAAK,EAAC,MAAM,aACf,aAAI,KAAK,EAAC,MAAM,YAAE,IAAI,CAAC,KAAK,GAAM,EAClC,YAAG,KAAK,EAAC,qBAAqB,2HAA+G,IACzI,EAEN,eAAK,KAAK,EAAC,MAAM,aACf,gBAAO,KAAK,EAAC,wBAAwB,oBAAY,EACjD,kBAAQ,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,OAAO,YAC9B,UAAU,eACR,iBAAiB,aACnB,WAAW,gBACR,QAAQ,gBACR,MAAM,aACjB,iBAAQ,KAAK,EAAC,EAAE,iCAA0B,EACzC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACtB,kBAAQ,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,aAAa,aAC3D,GAAG,CAAC,KAAK,QAAI,GAAG,CAAC,QAAQ,SACnB,CACV,CAAC,IACK,IACL,EAEN,cAAK,EAAE,EAAC,gBAAgB,KAClB,CAAC,IAAI,CAAC,aAAa;oBACrB,CAAC,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE;oBACxE,CAAC,CAAC,EAAE,CAAC,YACN,IAAI,CAAC,aAAa;oBACjB,CAAC,CAAC,cAAK,KAAK,EAAC,gBAAgB,kCAAwB;oBACrD,CAAC,CAAC,cAAK,KAAK,EAAC,uBAAuB,iDAAuC,GACzE,EAEN,2BAAS,UAAU,EAAE,GAAU,IAC3B,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as av from "anyvali";
|
|
2
|
+
import type { Infer } from "anyvali";
|
|
3
|
+
import { type DemoScenario, type ApiAuthRequirement, type CacheHints } from "@betterportal/framework";
|
|
4
|
+
export declare const ResponseSchema: av.ObjectSchema<{
|
|
5
|
+
title: av.StringSchema;
|
|
6
|
+
apps: av.ArraySchema<av.ObjectSchema<{
|
|
7
|
+
id: av.StringSchema;
|
|
8
|
+
title: av.StringSchema;
|
|
9
|
+
tenantId: av.StringSchema;
|
|
10
|
+
}>>;
|
|
11
|
+
selectedAppId: av.OptionalSchema<av.StringSchema>;
|
|
12
|
+
menu: av.ArraySchema<av.ObjectSchema<{
|
|
13
|
+
id: av.StringSchema;
|
|
14
|
+
type: av.StringSchema;
|
|
15
|
+
title: av.OptionalSchema<av.StringSchema>;
|
|
16
|
+
routeId: av.OptionalSchema<av.StringSchema>;
|
|
17
|
+
href: av.OptionalSchema<av.StringSchema>;
|
|
18
|
+
enabled: av.BoolSchema;
|
|
19
|
+
defaultExpanded: av.OptionalSchema<av.BoolSchema>;
|
|
20
|
+
}>>;
|
|
21
|
+
routes: av.ArraySchema<av.ObjectSchema<{
|
|
22
|
+
id: av.StringSchema;
|
|
23
|
+
path: av.StringSchema;
|
|
24
|
+
title: av.StringSchema;
|
|
25
|
+
}>>;
|
|
26
|
+
adminApiBase: av.StringSchema;
|
|
27
|
+
serviceBaseUrl: av.StringSchema;
|
|
28
|
+
}>;
|
|
29
|
+
export type ResponseData = Infer<typeof ResponseSchema>;
|
|
30
|
+
export declare const title = "Menu Designer";
|
|
31
|
+
export declare const description = "Design app navigation menu.";
|
|
32
|
+
export declare const auth: ApiAuthRequirement;
|
|
33
|
+
export declare const cacheHints: CacheHints;
|
|
34
|
+
export declare const demoScenarios: DemoScenario<ResponseData>[];
|
|
35
|
+
export declare const handleGet: import("@betterportal/framework").RouteHandler<Record<string, string>, Record<string, unknown>, Record<string, string>, Record<string, unknown>, {
|
|
36
|
+
title: string;
|
|
37
|
+
apps: {
|
|
38
|
+
id: string;
|
|
39
|
+
title: string;
|
|
40
|
+
tenantId: string;
|
|
41
|
+
}[];
|
|
42
|
+
menu: {
|
|
43
|
+
id: string;
|
|
44
|
+
type: string;
|
|
45
|
+
enabled: boolean;
|
|
46
|
+
title?: string | undefined;
|
|
47
|
+
routeId?: string | undefined;
|
|
48
|
+
href?: string | undefined;
|
|
49
|
+
defaultExpanded?: boolean | undefined;
|
|
50
|
+
}[];
|
|
51
|
+
routes: {
|
|
52
|
+
id: string;
|
|
53
|
+
path: string;
|
|
54
|
+
title: string;
|
|
55
|
+
}[];
|
|
56
|
+
adminApiBase: string;
|
|
57
|
+
serviceBaseUrl: string;
|
|
58
|
+
selectedAppId?: string | undefined;
|
|
59
|
+
}, unknown, Record<string, unknown>>;
|
|
60
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/service-betterportal-config-manager/bp-routes/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAwBjC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;EAQC,CAAC;AAC7B,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAExD,eAAO,MAAM,KAAK,kBAAkB,CAAC;AACrC,eAAO,MAAM,WAAW,gCAAgC,CAAC;AAEzD,eAAO,MAAM,IAAI,EAAE,kBAKlB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAA4D,CAAC;AAEtF,eAAO,MAAM,aAAa,EAAE,YAAY,CAAC,YAAY,CAAC,EAErD,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;oCAMrB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as av from "anyvali";
|
|
2
|
+
import { createHandler } from "@betterportal/framework";
|
|
3
|
+
const RouteOptionSchema = av.object({
|
|
4
|
+
id: av.string().minLength(1),
|
|
5
|
+
path: av.string().minLength(1),
|
|
6
|
+
title: av.string()
|
|
7
|
+
}, { unknownKeys: "strip" });
|
|
8
|
+
const MenuItemSchema = av.object({
|
|
9
|
+
id: av.string().minLength(1),
|
|
10
|
+
type: av.string().minLength(1),
|
|
11
|
+
title: av.optional(av.string()),
|
|
12
|
+
routeId: av.optional(av.string()),
|
|
13
|
+
href: av.optional(av.string()),
|
|
14
|
+
enabled: av.bool(),
|
|
15
|
+
defaultExpanded: av.optional(av.bool())
|
|
16
|
+
}, { unknownKeys: "strip" });
|
|
17
|
+
const AppSummarySchema = av.object({
|
|
18
|
+
id: av.string().minLength(1),
|
|
19
|
+
title: av.string().minLength(1),
|
|
20
|
+
tenantId: av.string().minLength(1)
|
|
21
|
+
}, { unknownKeys: "strip" });
|
|
22
|
+
export const ResponseSchema = av.object({
|
|
23
|
+
title: av.string().minLength(1),
|
|
24
|
+
apps: av.array(AppSummarySchema),
|
|
25
|
+
selectedAppId: av.optional(av.string()),
|
|
26
|
+
menu: av.array(MenuItemSchema).default([]),
|
|
27
|
+
routes: av.array(RouteOptionSchema).default([]),
|
|
28
|
+
adminApiBase: av.string().minLength(1),
|
|
29
|
+
serviceBaseUrl: av.string().minLength(1)
|
|
30
|
+
}, { unknownKeys: "strip" });
|
|
31
|
+
export const title = "Menu Designer";
|
|
32
|
+
export const description = "Design app navigation menu.";
|
|
33
|
+
export const auth = {
|
|
34
|
+
required: true,
|
|
35
|
+
permissions: [
|
|
36
|
+
{ serviceId: "service.betterportal.config-manager", viewId: "menu.index", permissions: ["read", "create", "update", "delete"] }
|
|
37
|
+
]
|
|
38
|
+
};
|
|
39
|
+
export const cacheHints = { ttlSeconds: 0, varyBy: ["accept", "origin"] };
|
|
40
|
+
export const demoScenarios = [
|
|
41
|
+
{ id: "default", title: "Default", response: { title: "Menu Designer", apps: [], menu: [], routes: [], adminApiBase: "/.well-known/bp/admin", serviceBaseUrl: "" } }
|
|
42
|
+
];
|
|
43
|
+
export const handleGet = createHandler({ response: ResponseSchema }, (ctx) => {
|
|
44
|
+
if (ctx.responseModel)
|
|
45
|
+
return ctx.responseModel;
|
|
46
|
+
return { title: "Menu Designer", apps: [], menu: [], routes: [], adminApiBase: "/.well-known/bp/admin", serviceBaseUrl: "" };
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=index.js.map
|