@crvouga/mockingbird-service-cognito 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -1
- package/dist/{chunk-JGZQJPYE.js → chunk-3GTUR4EC.js} +2 -2
- package/dist/{chunk-DNTF6HMV.js → chunk-5233DOLP.js} +355 -22
- package/dist/chunk-5233DOLP.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/dist/server.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-DNTF6HMV.js.map +0 -7
- /package/dist/{chunk-JGZQJPYE.js.map → chunk-3GTUR4EC.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-cognito
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.7.0 (2026-10-01)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- record SQL timelines and serve the admin explorer ([8ced17a](https://github.com/crvouga/mockingbird/commit/8ced17ac398e386ef4e9d7e01fc7744c34b95d07))
|
|
8
|
+
|
|
9
|
+
### Dependencies
|
|
10
|
+
|
|
11
|
+
- `@crvouga/mockingbird-service-sqlite`
|
|
12
|
+
|
|
13
|
+
## 1.6.1 (2026-09-30)
|
|
14
|
+
|
|
15
|
+
### Fixes and improvements
|
|
16
|
+
|
|
17
|
+
- keep admin buttons pressed until the action finishes ([0aabfcb](https://github.com/crvouga/mockingbird/commit/0aabfcb5f392aa51e193f9c3f817d5877d92bc6a))
|
|
18
|
+
- size admin select fields like the text inputs beside them ([0fb3ef2](https://github.com/crvouga/mockingbird/commit/0fb3ef2ddbf43376c93a2ae6d87c6c9bf890dafc))
|
|
19
|
+
- keep admin section tabs wired when boot is renamed ([4eda25e](https://github.com/crvouga/mockingbird/commit/4eda25eacd59da048d196f7cc8369d7a02b47bfc))
|
|
20
|
+
|
|
21
|
+
## 1.6.0 (2026-09-29)
|
|
4
22
|
|
|
5
23
|
### Features
|
|
6
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRuntime
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5233DOLP.js";
|
|
4
4
|
|
|
5
5
|
// ../../adapters/node/dist/cli.js
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
@@ -339,4 +339,4 @@ export {
|
|
|
339
339
|
createServer2 as createServer,
|
|
340
340
|
serveTarget
|
|
341
341
|
};
|
|
342
|
-
//# sourceMappingURL=chunk-
|
|
342
|
+
//# sourceMappingURL=chunk-3GTUR4EC.js.map
|
|
@@ -1500,6 +1500,167 @@ function faultPresetList(value) {
|
|
|
1500
1500
|
})
|
|
1501
1501
|
};
|
|
1502
1502
|
}
|
|
1503
|
+
function mountSqlExplorer(root, api) {
|
|
1504
|
+
const cell = (value) => {
|
|
1505
|
+
if (value === null || value === void 0)
|
|
1506
|
+
return "";
|
|
1507
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1508
|
+
return String(value);
|
|
1509
|
+
}
|
|
1510
|
+
return JSON.stringify(value) ?? "";
|
|
1511
|
+
};
|
|
1512
|
+
root.replaceChildren();
|
|
1513
|
+
const layout = document.createElement("div");
|
|
1514
|
+
layout.className = "sql-layout";
|
|
1515
|
+
const tables = document.createElement("div");
|
|
1516
|
+
tables.className = "sql-tables";
|
|
1517
|
+
const stack = document.createElement("div");
|
|
1518
|
+
stack.className = "stack";
|
|
1519
|
+
const banner = document.createElement("p");
|
|
1520
|
+
banner.className = "banner";
|
|
1521
|
+
const grid = document.createElement("div");
|
|
1522
|
+
const input = document.createElement("textarea");
|
|
1523
|
+
input.className = "sql-input";
|
|
1524
|
+
input.spellcheck = false;
|
|
1525
|
+
input.placeholder = "SELECT * FROM ...";
|
|
1526
|
+
const actions = document.createElement("div");
|
|
1527
|
+
actions.className = "row-actions";
|
|
1528
|
+
const run = document.createElement("button");
|
|
1529
|
+
run.type = "button";
|
|
1530
|
+
run.textContent = "Run";
|
|
1531
|
+
actions.append(run);
|
|
1532
|
+
const result = document.createElement("pre");
|
|
1533
|
+
stack.append(banner, grid, input, actions, result);
|
|
1534
|
+
layout.append(tables, stack);
|
|
1535
|
+
root.append(layout);
|
|
1536
|
+
const showError = (error) => {
|
|
1537
|
+
banner.textContent = error instanceof Error ? error.message : String(error);
|
|
1538
|
+
banner.classList.add("show");
|
|
1539
|
+
};
|
|
1540
|
+
const clearError = () => {
|
|
1541
|
+
banner.textContent = "";
|
|
1542
|
+
banner.classList.remove("show");
|
|
1543
|
+
};
|
|
1544
|
+
const renderGrid = (columns, rows) => {
|
|
1545
|
+
grid.replaceChildren();
|
|
1546
|
+
if (columns.length === 0) {
|
|
1547
|
+
const empty = document.createElement("p");
|
|
1548
|
+
empty.className = "empty";
|
|
1549
|
+
empty.textContent = "No rows.";
|
|
1550
|
+
grid.append(empty);
|
|
1551
|
+
return;
|
|
1552
|
+
}
|
|
1553
|
+
const table = document.createElement("table");
|
|
1554
|
+
const head = document.createElement("thead");
|
|
1555
|
+
const headRow = document.createElement("tr");
|
|
1556
|
+
for (const column of columns) {
|
|
1557
|
+
const th = document.createElement("th");
|
|
1558
|
+
th.textContent = column;
|
|
1559
|
+
headRow.append(th);
|
|
1560
|
+
}
|
|
1561
|
+
head.append(headRow);
|
|
1562
|
+
const body = document.createElement("tbody");
|
|
1563
|
+
for (const row of rows) {
|
|
1564
|
+
const tr = document.createElement("tr");
|
|
1565
|
+
for (const column of columns) {
|
|
1566
|
+
const td = document.createElement("td");
|
|
1567
|
+
td.dataset.label = column;
|
|
1568
|
+
td.textContent = cell(row[column]);
|
|
1569
|
+
tr.append(td);
|
|
1570
|
+
}
|
|
1571
|
+
body.append(tr);
|
|
1572
|
+
}
|
|
1573
|
+
table.append(head, body);
|
|
1574
|
+
grid.append(table);
|
|
1575
|
+
};
|
|
1576
|
+
const rowsOf = (value) => {
|
|
1577
|
+
if (!isRecord2(value) || !Array.isArray(value.rows))
|
|
1578
|
+
return [];
|
|
1579
|
+
return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
|
|
1580
|
+
};
|
|
1581
|
+
const columnsOf = (value, rows) => {
|
|
1582
|
+
if (isRecord2(value) && Array.isArray(value.columns)) {
|
|
1583
|
+
const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
|
|
1584
|
+
if (named.length > 0)
|
|
1585
|
+
return named;
|
|
1586
|
+
}
|
|
1587
|
+
const first = rows[0];
|
|
1588
|
+
return first === void 0 ? [] : Object.keys(first);
|
|
1589
|
+
};
|
|
1590
|
+
let selected = "";
|
|
1591
|
+
const loadPage = async (schema, name) => {
|
|
1592
|
+
selected = `${schema}.${name}`;
|
|
1593
|
+
const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
|
|
1594
|
+
const rows = rowsOf(page);
|
|
1595
|
+
renderGrid(columnsOf(page, rows), rows);
|
|
1596
|
+
const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
|
|
1597
|
+
result.textContent = `${selected} \xB7 ${total} rows`;
|
|
1598
|
+
for (const button of tables.querySelectorAll("button")) {
|
|
1599
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1600
|
+
continue;
|
|
1601
|
+
button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
|
|
1602
|
+
}
|
|
1603
|
+
};
|
|
1604
|
+
const loadTables = async () => {
|
|
1605
|
+
const payload = await api.get("/sql/tables");
|
|
1606
|
+
const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
|
|
1607
|
+
tables.replaceChildren();
|
|
1608
|
+
if (listed.length === 0) {
|
|
1609
|
+
const empty = document.createElement("p");
|
|
1610
|
+
empty.className = "empty";
|
|
1611
|
+
empty.textContent = "No tables.";
|
|
1612
|
+
tables.append(empty);
|
|
1613
|
+
return;
|
|
1614
|
+
}
|
|
1615
|
+
for (const item of listed) {
|
|
1616
|
+
if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
|
|
1617
|
+
continue;
|
|
1618
|
+
const button = document.createElement("button");
|
|
1619
|
+
button.type = "button";
|
|
1620
|
+
button.dataset.schema = item.schema;
|
|
1621
|
+
button.dataset.table = item.name;
|
|
1622
|
+
button.textContent = `${item.schema}.${item.name}`;
|
|
1623
|
+
tables.append(button);
|
|
1624
|
+
}
|
|
1625
|
+
};
|
|
1626
|
+
tables.addEventListener("click", (event) => {
|
|
1627
|
+
const target = event.target;
|
|
1628
|
+
if (!(target instanceof Element))
|
|
1629
|
+
return;
|
|
1630
|
+
const button = target.closest("button");
|
|
1631
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1632
|
+
return;
|
|
1633
|
+
const schema = button.dataset.schema;
|
|
1634
|
+
const name = button.dataset.table;
|
|
1635
|
+
if (schema === void 0 || name === void 0)
|
|
1636
|
+
return;
|
|
1637
|
+
clearError();
|
|
1638
|
+
loadPage(schema, name).catch(showError);
|
|
1639
|
+
});
|
|
1640
|
+
run.addEventListener("click", () => {
|
|
1641
|
+
const sql = input.value.trim();
|
|
1642
|
+
if (sql === "") {
|
|
1643
|
+
showError(new Error("Enter a statement"));
|
|
1644
|
+
return;
|
|
1645
|
+
}
|
|
1646
|
+
clearError();
|
|
1647
|
+
api.send("POST", "/sql/query", { sql }).then((payload) => {
|
|
1648
|
+
const rows = rowsOf(payload);
|
|
1649
|
+
renderGrid(columnsOf(payload, rows), rows);
|
|
1650
|
+
const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
|
|
1651
|
+
const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
|
|
1652
|
+
result.textContent = `${count} rows${truncated}`;
|
|
1653
|
+
}).catch(showError);
|
|
1654
|
+
});
|
|
1655
|
+
const namespace = document.getElementById("namespace");
|
|
1656
|
+
if (namespace) {
|
|
1657
|
+
namespace.addEventListener("change", () => {
|
|
1658
|
+
clearError();
|
|
1659
|
+
loadTables().catch(showError);
|
|
1660
|
+
});
|
|
1661
|
+
}
|
|
1662
|
+
loadTables().catch(showError);
|
|
1663
|
+
}
|
|
1503
1664
|
function bootAdmin(config) {
|
|
1504
1665
|
const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1505
1666
|
const sources = ["declared", "inferred", "mixed"];
|
|
@@ -1940,6 +2101,50 @@ function bootAdmin(config) {
|
|
|
1940
2101
|
if (render)
|
|
1941
2102
|
await render();
|
|
1942
2103
|
}
|
|
2104
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2105
|
+
window.setTimeout(resolve, ms);
|
|
2106
|
+
});
|
|
2107
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2108
|
+
if (button.dataset.pending === "1")
|
|
2109
|
+
return;
|
|
2110
|
+
const label = button.textContent ?? "";
|
|
2111
|
+
const width = button.offsetWidth;
|
|
2112
|
+
button.dataset.pending = "1";
|
|
2113
|
+
button.classList.add("pressed");
|
|
2114
|
+
button.setAttribute("aria-busy", "true");
|
|
2115
|
+
button.style.minWidth = `${width}px`;
|
|
2116
|
+
button.textContent = pending;
|
|
2117
|
+
try {
|
|
2118
|
+
await work();
|
|
2119
|
+
button.textContent = done;
|
|
2120
|
+
await delay(1e3);
|
|
2121
|
+
} catch (error) {
|
|
2122
|
+
showError(error);
|
|
2123
|
+
} finally {
|
|
2124
|
+
button.textContent = label;
|
|
2125
|
+
button.style.minWidth = "";
|
|
2126
|
+
button.classList.remove("pressed");
|
|
2127
|
+
button.removeAttribute("aria-busy");
|
|
2128
|
+
delete button.dataset.pending;
|
|
2129
|
+
}
|
|
2130
|
+
};
|
|
2131
|
+
document.addEventListener("click", (event) => {
|
|
2132
|
+
const target = event.target;
|
|
2133
|
+
if (!(target instanceof Element))
|
|
2134
|
+
return;
|
|
2135
|
+
const button = target.closest("button");
|
|
2136
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2137
|
+
return;
|
|
2138
|
+
button.classList.add("pressed");
|
|
2139
|
+
const token = String(Date.now());
|
|
2140
|
+
button.dataset.press = token;
|
|
2141
|
+
window.setTimeout(() => {
|
|
2142
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2143
|
+
return;
|
|
2144
|
+
button.classList.remove("pressed");
|
|
2145
|
+
delete button.dataset.press;
|
|
2146
|
+
}, 450);
|
|
2147
|
+
});
|
|
1943
2148
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
1944
2149
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
1945
2150
|
refresh().catch(showError);
|
|
@@ -1950,7 +2155,7 @@ function bootAdmin(config) {
|
|
|
1950
2155
|
refresh().catch(showError);
|
|
1951
2156
|
});
|
|
1952
2157
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
1953
|
-
refresh().catch(showError);
|
|
2158
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
1954
2159
|
});
|
|
1955
2160
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
1956
2161
|
const target = event.target;
|
|
@@ -2073,10 +2278,10 @@ function bootAdmin(config) {
|
|
|
2073
2278
|
}).then(() => renderFaults()).catch(showError);
|
|
2074
2279
|
});
|
|
2075
2280
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2076
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2281
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2077
2282
|
});
|
|
2078
2283
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2079
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2284
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2080
2285
|
});
|
|
2081
2286
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2082
2287
|
const target = event.target;
|
|
@@ -2132,6 +2337,22 @@ function bootAdmin(config) {
|
|
|
2132
2337
|
panel.script = value.script;
|
|
2133
2338
|
return panel;
|
|
2134
2339
|
};
|
|
2340
|
+
const decodeExtension = (value) => {
|
|
2341
|
+
if (!isRecord2(value))
|
|
2342
|
+
return void 0;
|
|
2343
|
+
if (value.kind === "sql") {
|
|
2344
|
+
return {
|
|
2345
|
+
kind: "sql",
|
|
2346
|
+
id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
|
|
2347
|
+
title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
|
|
2348
|
+
description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
|
|
2349
|
+
};
|
|
2350
|
+
}
|
|
2351
|
+
if (value.kind !== "panel")
|
|
2352
|
+
return void 0;
|
|
2353
|
+
const panel = decodePanel(value);
|
|
2354
|
+
return panel === void 0 ? void 0 : { kind: "panel", ...panel };
|
|
2355
|
+
};
|
|
2135
2356
|
const mountPanels = (panels) => {
|
|
2136
2357
|
const nav = el("nav", HTMLElement);
|
|
2137
2358
|
const views = el("views", HTMLElement);
|
|
@@ -2185,15 +2406,57 @@ function bootAdmin(config) {
|
|
|
2185
2406
|
return decoded === void 0 ? [] : [decoded];
|
|
2186
2407
|
});
|
|
2187
2408
|
mountPanels(panels);
|
|
2409
|
+
const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
|
|
2410
|
+
const decoded = decodeExtension(extension);
|
|
2411
|
+
return decoded === void 0 ? [] : [decoded];
|
|
2412
|
+
});
|
|
2413
|
+
const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
|
|
2414
|
+
mountPanels(extensionPanels);
|
|
2415
|
+
for (const extension of extensions) {
|
|
2416
|
+
if (extension.kind !== "sql")
|
|
2417
|
+
continue;
|
|
2418
|
+
const nav = el("nav", HTMLElement);
|
|
2419
|
+
const views = el("views", HTMLElement);
|
|
2420
|
+
const button = document.createElement("button");
|
|
2421
|
+
button.type = "button";
|
|
2422
|
+
button.dataset.view = extension.id;
|
|
2423
|
+
button.textContent = extension.title;
|
|
2424
|
+
nav.append(button);
|
|
2425
|
+
const section = document.createElement("section");
|
|
2426
|
+
section.className = "view";
|
|
2427
|
+
section.id = `view-${extension.id}`;
|
|
2428
|
+
section.hidden = true;
|
|
2429
|
+
const title = document.createElement("h2");
|
|
2430
|
+
title.textContent = extension.title;
|
|
2431
|
+
const lede = document.createElement("p");
|
|
2432
|
+
lede.className = "lede";
|
|
2433
|
+
lede.textContent = extension.description;
|
|
2434
|
+
const body = document.createElement("div");
|
|
2435
|
+
body.className = "panel-body";
|
|
2436
|
+
section.append(title, lede, body);
|
|
2437
|
+
views.append(section);
|
|
2438
|
+
mountSqlExplorer(body, panelApi);
|
|
2439
|
+
}
|
|
2188
2440
|
return refresh();
|
|
2189
2441
|
}).catch(showError);
|
|
2190
2442
|
}
|
|
2191
|
-
var clientPrelude = [
|
|
2443
|
+
var clientPrelude = [
|
|
2444
|
+
isRecord2,
|
|
2445
|
+
mountAdminBrand,
|
|
2446
|
+
startAdminBrand,
|
|
2447
|
+
faultPresetList,
|
|
2448
|
+
mountSqlExplorer,
|
|
2449
|
+
bootAdmin
|
|
2450
|
+
].map((fn) => fn.toString()).join("\n");
|
|
2192
2451
|
var adminClientSource = (config) => {
|
|
2193
2452
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2453
|
+
const entry = bootAdmin.name;
|
|
2454
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2455
|
+
throw new Error("admin client cannot call its boot function");
|
|
2456
|
+
}
|
|
2194
2457
|
return `<script>
|
|
2195
2458
|
${clientPrelude}
|
|
2196
|
-
|
|
2459
|
+
${entry}(${payload});
|
|
2197
2460
|
</script>`;
|
|
2198
2461
|
};
|
|
2199
2462
|
|
|
@@ -2234,19 +2497,33 @@ var STANDARD_ADMIN_ROUTES = [
|
|
|
2234
2497
|
"GET /ui/manifest"
|
|
2235
2498
|
];
|
|
2236
2499
|
var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
2500
|
+
var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
|
|
2501
|
+
var checkPanel = (panel, seen, label) => {
|
|
2502
|
+
if (!PANEL_ID.test(panel.id)) {
|
|
2503
|
+
throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
|
|
2504
|
+
}
|
|
2505
|
+
if (RESERVED_VIEWS.has(panel.id)) {
|
|
2506
|
+
throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
|
|
2507
|
+
}
|
|
2508
|
+
if (seen.has(panel.id))
|
|
2509
|
+
throw new RangeError(`duplicate admin view id ${panel.id}`);
|
|
2510
|
+
seen.add(panel.id);
|
|
2511
|
+
if (panel.title.trim() === "")
|
|
2512
|
+
throw new RangeError(`${label} ${panel.id} needs a title`);
|
|
2513
|
+
};
|
|
2237
2514
|
var assertAdminUi = (ui) => {
|
|
2238
|
-
if (!ui
|
|
2515
|
+
if (!ui)
|
|
2239
2516
|
return;
|
|
2240
2517
|
const seen = /* @__PURE__ */ new Set();
|
|
2241
|
-
for (const panel of ui.panels)
|
|
2242
|
-
|
|
2243
|
-
|
|
2518
|
+
for (const panel of ui.panels ?? [])
|
|
2519
|
+
checkPanel(panel, seen, "admin panel");
|
|
2520
|
+
for (const extension of ui.extensions ?? []) {
|
|
2521
|
+
if (extension.kind === "panel") {
|
|
2522
|
+
checkPanel(extension, seen, "admin extension");
|
|
2523
|
+
continue;
|
|
2244
2524
|
}
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
seen.add(panel.id);
|
|
2248
|
-
if (panel.title.trim() === "")
|
|
2249
|
-
throw new RangeError(`admin panel ${panel.id} needs a title`);
|
|
2525
|
+
const id = extension.id ?? "sql";
|
|
2526
|
+
checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
|
|
2250
2527
|
}
|
|
2251
2528
|
};
|
|
2252
2529
|
|
|
@@ -2407,9 +2684,24 @@ var renderAdminDocument = (service) => {
|
|
|
2407
2684
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2408
2685
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2409
2686
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2410
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2411
|
-
padding: 7px 8px; min-height: 36px;
|
|
2412
|
-
}
|
|
2687
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2688
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
2689
|
+
}
|
|
2690
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
2691
|
+
the text fields in the same form. Paint it like those fields. */
|
|
2692
|
+
label.field select {
|
|
2693
|
+
-webkit-appearance: none; appearance: none;
|
|
2694
|
+
padding-right: 28px;
|
|
2695
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
|
|
2696
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
2697
|
+
}
|
|
2698
|
+
.stack > .field > input,
|
|
2699
|
+
.stack > .field > select,
|
|
2700
|
+
.stack > .field > textarea,
|
|
2701
|
+
dialog .field > input,
|
|
2702
|
+
dialog .field > select,
|
|
2703
|
+
dialog .field > textarea { width: 100%; }
|
|
2704
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2413
2705
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2414
2706
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2415
2707
|
background: var(--bg-elev);
|
|
@@ -2417,6 +2709,14 @@ var renderAdminDocument = (service) => {
|
|
|
2417
2709
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2418
2710
|
.btn-quiet { background: transparent; }
|
|
2419
2711
|
.btn-danger { color: var(--err); }
|
|
2712
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
2713
|
+
so the press itself has to stay visible. */
|
|
2714
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
2715
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
2716
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
2717
|
+
}
|
|
2718
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
2719
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2420
2720
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2421
2721
|
record or the full nav row would widen the page past the viewport. */
|
|
2422
2722
|
.layout {
|
|
@@ -2457,6 +2757,12 @@ var renderAdminDocument = (service) => {
|
|
|
2457
2757
|
border-radius: 999px; padding: 4px 8px;
|
|
2458
2758
|
}
|
|
2459
2759
|
.chip i { color: var(--faint); font-style: normal; }
|
|
2760
|
+
.sql-layout {
|
|
2761
|
+
display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
|
|
2762
|
+
}
|
|
2763
|
+
.sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
|
|
2764
|
+
.sql-tables button { text-align: left; }
|
|
2765
|
+
.sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
|
|
2460
2766
|
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
|
2461
2767
|
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
2462
2768
|
th { color: var(--faint); font-weight: 600; font-size: 12px; }
|
|
@@ -2505,14 +2811,22 @@ var renderAdminDocument = (service) => {
|
|
|
2505
2811
|
input, select, textarea { font-size: 16px; }
|
|
2506
2812
|
.brand, .vendor, .controls { width: 100%; }
|
|
2507
2813
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
2508
|
-
|
|
2814
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
2815
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
2816
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
2817
|
+
.layout {
|
|
2818
|
+
grid-template-columns: minmax(0, 1fr);
|
|
2819
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
2820
|
+
align-content: start;
|
|
2821
|
+
}
|
|
2509
2822
|
nav.side {
|
|
2823
|
+
align-self: start; height: auto;
|
|
2510
2824
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
2511
2825
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
2512
2826
|
padding: 8px;
|
|
2513
2827
|
}
|
|
2514
2828
|
nav.side button { white-space: nowrap; flex: none; }
|
|
2515
|
-
.split { grid-template-columns: minmax(0, 1fr); }
|
|
2829
|
+
.split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
|
|
2516
2830
|
main { padding: 14px; }
|
|
2517
2831
|
table, thead, tbody, tr, th, td { display: block; }
|
|
2518
2832
|
thead { display: none; }
|
|
@@ -2683,6 +2997,24 @@ var json2 = (body) => new Response(JSON.stringify(body), {
|
|
|
2683
2997
|
status: 200,
|
|
2684
2998
|
headers: { "content-type": "application/json; charset=utf-8" }
|
|
2685
2999
|
});
|
|
3000
|
+
var describeExtension = (extension) => {
|
|
3001
|
+
if (extension.kind === "sql") {
|
|
3002
|
+
return {
|
|
3003
|
+
kind: "sql",
|
|
3004
|
+
id: extension.id ?? "sql",
|
|
3005
|
+
title: extension.title ?? "SQL",
|
|
3006
|
+
...extension.description !== void 0 ? { description: extension.description } : {}
|
|
3007
|
+
};
|
|
3008
|
+
}
|
|
3009
|
+
return {
|
|
3010
|
+
kind: "panel",
|
|
3011
|
+
id: extension.id,
|
|
3012
|
+
title: extension.title,
|
|
3013
|
+
...extension.description !== void 0 ? { description: extension.description } : {},
|
|
3014
|
+
html: extension.html,
|
|
3015
|
+
...extension.script !== void 0 ? { script: extension.script } : {}
|
|
3016
|
+
};
|
|
3017
|
+
};
|
|
2686
3018
|
var adminUiRoutes = (service, ui) => {
|
|
2687
3019
|
const shell = () => renderAdminDocument(service);
|
|
2688
3020
|
const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
|
|
@@ -2697,7 +3029,8 @@ var adminUiRoutes = (service, ui) => {
|
|
|
2697
3029
|
...panel.description !== void 0 ? { description: panel.description } : {},
|
|
2698
3030
|
html: panel.html,
|
|
2699
3031
|
...panel.script !== void 0 ? { script: panel.script } : {}
|
|
2700
|
-
}))
|
|
3032
|
+
})),
|
|
3033
|
+
extensions: (ui?.extensions ?? []).map(describeExtension)
|
|
2701
3034
|
})
|
|
2702
3035
|
};
|
|
2703
3036
|
};
|
|
@@ -3604,7 +3937,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3604
3937
|
};
|
|
3605
3938
|
|
|
3606
3939
|
// ../core/dist/version.js
|
|
3607
|
-
var PACKAGE_VERSION = true ? "1.
|
|
3940
|
+
var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
|
|
3608
3941
|
|
|
3609
3942
|
// ../core/dist/webhooks.js
|
|
3610
3943
|
var json4 = (status, body) => new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } });
|
|
@@ -4884,4 +5217,4 @@ export {
|
|
|
4884
5217
|
accessKeyCredential,
|
|
4885
5218
|
CognitoAPI
|
|
4886
5219
|
};
|
|
4887
|
-
//# sourceMappingURL=chunk-
|
|
5220
|
+
//# sourceMappingURL=chunk-5233DOLP.js.map
|