@coffre/ui 0.1.10 → 0.1.12
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/dist/client/_coffre/assets/account-CyJDFhek.js +2 -0
- package/dist/client/_coffre/assets/account-DHSs5h2f.js +1 -0
- package/dist/client/_coffre/assets/affordances-BQD5B421.js +1 -0
- package/dist/client/_coffre/assets/audit-Bcyp_dU1.js +2 -0
- package/dist/client/_coffre/assets/audit-rMy9mU9Q.js +1 -0
- package/dist/client/_coffre/assets/auth.device-DuvaComb.js +1 -0
- package/dist/client/_coffre/assets/auth.device-yBt_sLZW.js +2 -0
- package/dist/client/_coffre/assets/directory-C4BMGC7-.js +1 -0
- package/dist/client/_coffre/assets/dist-BNkBTkxj.js +1 -0
- package/dist/client/_coffre/assets/globals-BJkzu6T5.css +1 -0
- package/dist/client/_coffre/assets/grants-CyDW25eX.js +1 -0
- package/dist/client/_coffre/assets/icons-BRl8DlXW.js +1 -0
- package/dist/client/_coffre/assets/index-CA1mtrIx.js +12 -0
- package/dist/client/_coffre/assets/link-CqlAJWBd.js +1 -0
- package/dist/client/_coffre/assets/login-B73b6bsJ.js +1 -0
- package/dist/client/_coffre/assets/login-BO1KAGPU.js +2 -0
- package/dist/client/_coffre/assets/offboarding--5vSKNHv.js +1 -0
- package/dist/client/_coffre/assets/page-Dngv8FMr.js +1 -0
- package/dist/client/_coffre/assets/preload-helper-DBha3tys.js +1 -0
- package/dist/client/_coffre/assets/principal-page-C4qDD-d8.js +1 -0
- package/dist/client/_coffre/assets/projects._project._environment-eBKxOZ0_.js +2 -0
- package/dist/client/_coffre/assets/projects._project._environment-or_AX6o5.js +3 -0
- package/dist/client/_coffre/assets/projects._project.index-DHdXfEh-.js +2 -0
- package/dist/client/_coffre/assets/projects._project.index-iynQgenH.js +1 -0
- package/dist/client/_coffre/assets/projects.index-CGW8mRil.js +1 -0
- package/dist/client/_coffre/assets/row-state-BlarvG7E.js +1 -0
- package/dist/client/_coffre/assets/settings-D-7RJIDf.js +1 -0
- package/dist/client/_coffre/assets/suspense-q_eJaZ18.js +1 -0
- package/dist/client/_coffre/assets/tokens._token-0u7midqA.js +2 -0
- package/dist/client/_coffre/assets/tokens._token-C53NqScg.js +1 -0
- package/dist/client/_coffre/assets/tokens.index-DBZTLnbi.js +1 -0
- package/dist/client/_coffre/assets/ui-BPWFJNz7.js +46 -0
- package/dist/client/_coffre/assets/unregistered-CLhgtwUt.js +1 -0
- package/dist/client/_coffre/assets/use-action-LULgF26O.js +1 -0
- package/dist/client/_coffre/assets/use-change-Bd6NZJj9.js +1 -0
- package/dist/client/_coffre/assets/use-shell-Dx92Huhb.js +1 -0
- package/dist/client/_coffre/assets/useQuery-BIIZz1CB.js +1 -0
- package/dist/client/_coffre/assets/useSuspenseQuery-tP9HFZ8w.js +1 -0
- package/dist/client/_coffre/assets/users._user-BXtaL8Ee.js +2 -0
- package/dist/client/_coffre/assets/users._user-CNYVkXaY.js +1 -0
- package/dist/client/_coffre/assets/users.index-Cs9tibIv.js +1 -0
- package/dist/server/.vite/manifest.json +342 -246
- package/dist/server/_coffre/assets/_tanstack-start-manifest_v-T9tMsCwo.js +162 -0
- package/dist/server/_coffre/assets/{account-CUQYGCYh.js → account-BUhhOS5-.js} +150 -117
- package/dist/server/_coffre/assets/{account-DMlUoBxQ.js → account-B_h55GCs.js} +10 -24
- package/dist/server/_coffre/assets/{affordances-BNaXjMOb.js → affordances-CKANXDTG.js} +2 -22
- package/dist/server/_coffre/assets/{async-local-storage-C0cwgkEr.js → async-local-storage-C10uQtMM.js} +3 -2
- package/dist/server/_coffre/assets/{audit-CCdSLmvK.js → audit-B8Ck358-.js} +46 -16
- package/dist/server/_coffre/assets/audit-DFsXfeAQ.js +31 -0
- package/dist/server/_coffre/assets/{auth.device-BoFM1jcf.js → auth.device-BXf_JjT7.js} +5 -5
- package/dist/server/_coffre/assets/{auth.device-C05u5ROO.js → auth.device-cqjWACvB.js} +7 -5
- package/dist/server/_coffre/assets/{directory-GsnYkse0.js → directory-C9SfNgpM.js} +87 -112
- package/dist/server/_coffre/assets/{use-action-DwEmf58L.js → dist-CnnV3t2g.js} +3 -48
- package/dist/server/_coffre/assets/globals-BJkzu6T5.css +1 -0
- package/dist/server/_coffre/assets/grants--315KmXu.js +158 -0
- package/dist/server/_coffre/assets/{page-BdnhpwvH.js → icons-CWsTEfpn.js} +125 -436
- package/dist/server/_coffre/assets/lazyRouteComponent-CqBNCGuZ.js +480 -0
- package/dist/server/_coffre/assets/link-42ZWdjzZ.js +422 -0
- package/dist/server/_coffre/assets/{login-DUtCQju5.js → login-CQSkYW_D.js} +7 -5
- package/dist/server/_coffre/assets/{login-B2njIq_o.js → login-LBpXXfsQ.js} +2 -2
- package/dist/server/_coffre/assets/matchContext-qLfYbC6_.js +56 -0
- package/dist/server/_coffre/assets/{offboarding-8yMa7ViM.js → offboarding-CykelNis.js} +11 -79
- package/dist/server/_coffre/assets/page-BGeDoQO5.js +3531 -0
- package/dist/server/_coffre/assets/{principal-page-B8zPcS2b.js → principal-page-CRdoAQOq.js} +51 -42
- package/dist/server/_coffre/assets/{projects._project._environment-DdIOc7wx.js → projects._project._environment-BXU1Mee5.js} +4 -11
- package/dist/server/_coffre/assets/{projects._project._environment-BZ5Z80V8.js → projects._project._environment-BrDqn8kW.js} +129 -748
- package/dist/server/_coffre/assets/{projects._project.index-CuEAUwGn.js → projects._project.index-CAxBU4tY.js} +134 -96
- package/dist/server/_coffre/assets/{projects._project.index-DvbcU1kh.js → projects._project.index-CYyUVTCl.js} +5 -4
- package/dist/server/_coffre/assets/{projects.index-5HI0wOuG.js → projects.index-D6ZoDE_0.js} +57 -55
- package/dist/server/_coffre/assets/{react-dom-qCTiwGGR.js → react-dom-bBoJXlK2.js} +417 -51
- package/dist/server/_coffre/assets/{router-CQDoql8s.js → router-Bu2qtyqw.js} +376 -92
- package/dist/server/_coffre/assets/row-state-CAItu3n_.js +117 -0
- package/dist/server/_coffre/assets/{settings-BVz78wjP.js → settings-ByeF6hBa.js} +8 -6
- package/dist/server/_coffre/assets/suspense-beD01bb8.js +602 -0
- package/dist/server/_coffre/assets/tokens._token-CM01QPCq.js +10 -0
- package/dist/server/_coffre/assets/{tokens._token-CWs3Mtki.js → tokens._token-D2E4P3Qc.js} +97 -79
- package/dist/server/_coffre/assets/{tokens.index-Ck0LN7aC.js → tokens.index-Cmrgn3mU.js} +9 -6
- package/dist/server/_coffre/assets/{ui-D_slKpSF.js → ui-DvlGkmaH.js} +7 -836
- package/dist/server/_coffre/assets/{unregistered-Z17da4Rc.js → unregistered-DSArejP9.js} +5 -3
- package/dist/server/_coffre/assets/use-action-C2wz34kq.js +47 -0
- package/dist/server/_coffre/assets/use-change-CJpGSNIq.js +1212 -0
- package/dist/server/_coffre/assets/use-shell-C3iYcyP1.js +462 -0
- package/dist/server/_coffre/assets/useQuery-ChxaQ4Cb.js +8 -0
- package/dist/server/_coffre/assets/{useStore-DWGPqzXR.js → useRouter-CaUSUNsw.js} +1 -420
- package/dist/server/_coffre/assets/useSuspenseQuery-BjAmlGZl.js +117 -0
- package/dist/server/_coffre/assets/users._user-BVeR9fZP.js +10 -0
- package/dist/server/_coffre/assets/{users._user-CMwj-VI9.js → users._user-Cih2Etf4.js} +4 -5
- package/dist/server/_coffre/assets/{users.index-fWHv6A30.js → users.index-Bo2_a95G.js} +9 -6
- package/dist/server/index.js +6 -5
- package/package.json +5 -3
- package/src/components/directory.tsx +75 -104
- package/src/components/grants.tsx +60 -112
- package/src/components/icons.tsx +0 -34
- package/src/components/offboarding.tsx +1 -52
- package/src/components/principal-page.tsx +54 -67
- package/src/components/principal-picker.tsx +7 -16
- package/src/components/row-state.tsx +95 -0
- package/src/components/service-tokens.tsx +75 -64
- package/src/components/shell.tsx +1 -1
- package/src/lib/announce.ts +36 -0
- package/src/lib/changes.ts +498 -0
- package/src/lib/coffre.ts +1 -1
- package/src/lib/optimistic.ts +233 -0
- package/src/lib/queries.ts +385 -0
- package/src/lib/use-action.ts +20 -15
- package/src/lib/use-change.ts +42 -0
- package/src/lib/use-shell.ts +17 -0
- package/src/router.tsx +17 -9
- package/src/routes/__root.tsx +8 -38
- package/src/routes/account.tsx +163 -154
- package/src/routes/audit.tsx +51 -72
- package/src/routes/auth.device.tsx +4 -2
- package/src/routes/login.tsx +3 -2
- package/src/routes/projects.$project.$environment.tsx +223 -238
- package/src/routes/projects.$project.index.tsx +136 -118
- package/src/routes/projects.index.tsx +117 -145
- package/src/routes/settings.tsx +7 -7
- package/src/routes/tokens.$token.tsx +14 -17
- package/src/routes/tokens.index.tsx +8 -4
- package/src/routes/unregistered.tsx +3 -2
- package/src/routes/users.$user.tsx +4 -4
- package/src/routes/users.index.tsx +8 -4
- package/src/shared/models.ts +1 -5
- package/src/styles/globals.css +80 -50
- package/dist/client/_coffre/assets/account-B48wuSF8.js +0 -1
- package/dist/client/_coffre/assets/account-BkNyIDT7.js +0 -2
- package/dist/client/_coffre/assets/affordances-CmoY-8Xf.js +0 -1
- package/dist/client/_coffre/assets/audit-BvwKYb-5.js +0 -2
- package/dist/client/_coffre/assets/audit-D02H-zxS.js +0 -1
- package/dist/client/_coffre/assets/auth.device-BP5FY0K1.js +0 -1
- package/dist/client/_coffre/assets/auth.device-DYOONgFF.js +0 -2
- package/dist/client/_coffre/assets/coffre-BBp7cKVa.js +0 -1
- package/dist/client/_coffre/assets/directory-Bu0EIxqI.js +0 -1
- package/dist/client/_coffre/assets/globals-Bh2x1gBM.css +0 -1
- package/dist/client/_coffre/assets/grants-DavcwofW.js +0 -1
- package/dist/client/_coffre/assets/index-CDPlq5rM.js +0 -12
- package/dist/client/_coffre/assets/login-C-wTm_t1.js +0 -2
- package/dist/client/_coffre/assets/login-CLLv1om9.js +0 -1
- package/dist/client/_coffre/assets/offboarding-DWsE2FSa.js +0 -1
- package/dist/client/_coffre/assets/page-DbSS7pYH.js +0 -1
- package/dist/client/_coffre/assets/preload-helper-DduCCcmc.js +0 -46
- package/dist/client/_coffre/assets/principal-page-Bp_iwuSd.js +0 -1
- package/dist/client/_coffre/assets/projects._project._environment-BMeX_B8l.js +0 -2
- package/dist/client/_coffre/assets/projects._project._environment-CT0A-hIU.js +0 -3
- package/dist/client/_coffre/assets/projects._project.index-C_xYOGLT.js +0 -2
- package/dist/client/_coffre/assets/projects._project.index-Chcf-cUd.js +0 -1
- package/dist/client/_coffre/assets/projects.index-CfOtb1X5.js +0 -2
- package/dist/client/_coffre/assets/projects.index-DSjOhLDh.js +0 -1
- package/dist/client/_coffre/assets/settings-BC9cUJNK.js +0 -1
- package/dist/client/_coffre/assets/settings-Bkj_E21y.js +0 -2
- package/dist/client/_coffre/assets/tokens._token-BA0KqvaW.js +0 -1
- package/dist/client/_coffre/assets/tokens._token-Dh9jLOkm.js +0 -2
- package/dist/client/_coffre/assets/tokens.index-BgAMWkHT.js +0 -2
- package/dist/client/_coffre/assets/tokens.index-CHueIAv1.js +0 -1
- package/dist/client/_coffre/assets/unregistered-D5go1AfR.js +0 -1
- package/dist/client/_coffre/assets/use-action-l__xZDYY.js +0 -1
- package/dist/client/_coffre/assets/users._user-Dwqa0gv5.js +0 -1
- package/dist/client/_coffre/assets/users._user-xJAb3T6Y.js +0 -2
- package/dist/client/_coffre/assets/users.index-BJoF-L37.js +0 -2
- package/dist/client/_coffre/assets/users.index-YUjtbTGy.js +0 -1
- package/dist/server/_coffre/assets/_tanstack-start-manifest_v-BKg2AlPu.js +0 -133
- package/dist/server/_coffre/assets/audit-CThXn2v7.js +0 -74
- package/dist/server/_coffre/assets/coffre-C2ANsTAz.js +0 -281
- package/dist/server/_coffre/assets/globals-Bh2x1gBM.css +0 -1
- package/dist/server/_coffre/assets/grants-B6k4Fu9z.js +0 -243
- package/dist/server/_coffre/assets/projects.index-uiomWX_l.js +0 -54
- package/dist/server/_coffre/assets/settings-4oRyDizv.js +0 -18
- package/dist/server/_coffre/assets/tokens._token-CF_deAwq.js +0 -18
- package/dist/server/_coffre/assets/tokens.index-DF_07KEe.js +0 -10
- package/dist/server/_coffre/assets/users._user-DUzwkSKT.js +0 -10
- package/dist/server/_coffre/assets/users.index-BbuweTwH.js +0 -10
- package/src/components/syncs.tsx +0 -581
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
1
|
+
import { i as require_react, r as require_jsx_runtime, s as __toESM } from "./useRouter-CaUSUNsw.js";
|
|
2
|
+
import { t as Link } from "./link-42ZWdjzZ.js";
|
|
3
|
+
import { C as useCoffre, h as queries, i as PageHeader, n as ClosedDoor } from "./page-BGeDoQO5.js";
|
|
4
|
+
import { t as useSuspenseQuery } from "./useSuspenseQuery-BjAmlGZl.js";
|
|
5
|
+
import { t as useQuery } from "./useQuery-ChxaQ4Cb.js";
|
|
6
|
+
import { c as Spinner, d as Toggletip, i as EmptyState, l as Timestamp, p as breakAfterUnderscores, s as Notice } from "./ui-DvlGkmaH.js";
|
|
7
|
+
import { F as ShieldCheck, L as SlashCircle, V as User, W as X, _ as Info, b as Ledger, l as Clock, r as AlertTriangle, s as ChevronRight, t as Activity } from "./icons-CWsTEfpn.js";
|
|
8
|
+
import { t as Route } from "./audit-DFsXfeAQ.js";
|
|
5
9
|
//#region src/lib/audit-sentences.ts
|
|
6
10
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
7
11
|
var text = (value) => typeof value === "string" && value !== "" ? value : null;
|
|
@@ -475,8 +479,11 @@ function lines(entries) {
|
|
|
475
479
|
//#region src/routes/audit.tsx?tsr-split=component
|
|
476
480
|
var import_jsx_runtime = require_jsx_runtime();
|
|
477
481
|
function AuditPage() {
|
|
478
|
-
const { entries: result, chain } = Route.useLoaderData();
|
|
479
482
|
const search = Route.useSearch();
|
|
483
|
+
const client = useCoffre();
|
|
484
|
+
const { data: result } = useSuspenseQuery(queries.auditEntries(client, search));
|
|
485
|
+
const verification = useQuery(queries.auditChain(client));
|
|
486
|
+
const chain = verification.data;
|
|
480
487
|
const { decision, actorId } = search;
|
|
481
488
|
const detail = search.detail === "1";
|
|
482
489
|
const deniedOnly = decision === "deny";
|
|
@@ -486,7 +493,7 @@ function AuditPage() {
|
|
|
486
493
|
title: "The audit log is closed to you",
|
|
487
494
|
children: result.error
|
|
488
495
|
});
|
|
489
|
-
const broken = chain
|
|
496
|
+
const broken = chain?.integrity === "broken" ? chain : null;
|
|
490
497
|
const breakAt = broken?.failedAtSeq ?? null;
|
|
491
498
|
const shown = lines(result.entries);
|
|
492
499
|
const filters = {
|
|
@@ -496,7 +503,15 @@ function AuditPage() {
|
|
|
496
503
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
497
504
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageHeader, {
|
|
498
505
|
title: "Audit",
|
|
499
|
-
actions: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
506
|
+
actions: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
507
|
+
className: "chain-live",
|
|
508
|
+
"aria-live": "polite",
|
|
509
|
+
"aria-atomic": "true",
|
|
510
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChainStatus, {
|
|
511
|
+
chain,
|
|
512
|
+
onRetry: () => void verification.refetch()
|
|
513
|
+
})
|
|
514
|
+
})
|
|
500
515
|
}),
|
|
501
516
|
broken !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
502
517
|
style: { marginBottom: "1.25rem" },
|
|
@@ -806,8 +821,16 @@ function BreakMark() {
|
|
|
806
821
|
* have to ask for is reassurance rather than evidence: it is checked when
|
|
807
822
|
* someone is already feeling confident, and not on the morning it would have
|
|
808
823
|
* mattered. Recomputing on load makes the claim continuous.
|
|
824
|
+
*
|
|
825
|
+
* It is not waited for, though: verifying re-reads the whole log, so until
|
|
826
|
+
* it answers the badge says it is verifying, and a check that could not run
|
|
827
|
+
* says so and offers to run again, rather than passing for a broken log.
|
|
809
828
|
*/
|
|
810
|
-
function ChainStatus({ chain }) {
|
|
829
|
+
function ChainStatus({ chain, onRetry }) {
|
|
830
|
+
if (chain === void 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
831
|
+
className: "chain-note",
|
|
832
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { size: 14 }), "Verifying…"]
|
|
833
|
+
});
|
|
811
834
|
if (chain.integrity === "owners-only") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Toggletip, {
|
|
812
835
|
align: "end",
|
|
813
836
|
label: "Owners and root admins see whether the log is intact. Checking it means recomputing every entry, and you read only your projects' part of it.",
|
|
@@ -817,18 +840,25 @@ function ChainStatus({ chain }) {
|
|
|
817
840
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Info, { size: 14 }), "Verified by owners"]
|
|
818
841
|
})
|
|
819
842
|
});
|
|
820
|
-
if (chain.integrity === "unknown") return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
843
|
+
if (chain.integrity === "unknown") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
844
|
+
className: "chain",
|
|
845
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Toggletip, {
|
|
846
|
+
align: "end",
|
|
847
|
+
label: `coffre could not check the log: ${chain.problem}. The entries below loaded, but whether they are intact is unknown until it can.`,
|
|
848
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
849
|
+
type: "button",
|
|
850
|
+
className: "chain-flag chain-flag-warn",
|
|
851
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTriangle, { size: 14 }), "Couldn’t verify"]
|
|
852
|
+
})
|
|
853
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
824
854
|
type: "button",
|
|
825
|
-
className: "
|
|
826
|
-
|
|
827
|
-
|
|
855
|
+
className: "btn btn-sm",
|
|
856
|
+
onClick: onRetry,
|
|
857
|
+
children: "Retry"
|
|
858
|
+
})]
|
|
828
859
|
});
|
|
829
860
|
if (chain.integrity === "broken") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
830
861
|
className: "chain-flag chain-flag-bad",
|
|
831
|
-
role: "status",
|
|
832
862
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTriangle, { size: 14 }), chain.failedAtSeq === null ? "Log does not verify" : `Log broken at ${chain.failedAtSeq}`]
|
|
833
863
|
});
|
|
834
864
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { n as createFileRoute, t as lazyRouteComponent } from "./lazyRouteComponent-CqBNCGuZ.js";
|
|
2
|
+
import { h as queries } from "./page-BGeDoQO5.js";
|
|
3
|
+
//#region src/routes/audit.tsx
|
|
4
|
+
var $$splitComponentImporter = () => import("./audit-B8Ck358-.js");
|
|
5
|
+
var Route = createFileRoute("/audit")({
|
|
6
|
+
validateSearch: (search) => ({
|
|
7
|
+
decision: search.decision === "deny" ? "deny" : void 0,
|
|
8
|
+
actorId: typeof search.actorId === "string" && search.actorId !== "" ? search.actorId : void 0,
|
|
9
|
+
detail: search.detail === "1" || search.detail === 1 ? "1" : void 0
|
|
10
|
+
}),
|
|
11
|
+
loaderDeps: ({ search }) => search,
|
|
12
|
+
loader: ({ context: { client, queryClient }, deps }) => queryClient.fetchQuery(queries.auditEntries(client, deps)),
|
|
13
|
+
component: lazyRouteComponent($$splitComponentImporter, "component")
|
|
14
|
+
});
|
|
15
|
+
/** One action: an entry, or a batch of them under one operation, which opens to each. */
|
|
16
|
+
/** A sentence, its people and places links to their pages. */
|
|
17
|
+
/** The entry the log breaks at, said in words as well as in red. */
|
|
18
|
+
/**
|
|
19
|
+
* Whether the log still verifies, beside the title.
|
|
20
|
+
*
|
|
21
|
+
* This replaced a card with a "Verify chain" button on it. A green result you
|
|
22
|
+
* have to ask for is reassurance rather than evidence: it is checked when
|
|
23
|
+
* someone is already feeling confident, and not on the morning it would have
|
|
24
|
+
* mattered. Recomputing on load makes the claim continuous.
|
|
25
|
+
*
|
|
26
|
+
* It is not waited for, though: verifying re-reads the whole log, so until
|
|
27
|
+
* it answers the badge says it is verifying, and a check that could not run
|
|
28
|
+
* says so and offers to run again, rather than passing for a broken log.
|
|
29
|
+
*/
|
|
30
|
+
//#endregion
|
|
31
|
+
export { Route as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as createFileRoute, t as lazyRouteComponent } from "./lazyRouteComponent-CqBNCGuZ.js";
|
|
2
|
+
import { S as uiResult, f as loadShell } from "./page-BGeDoQO5.js";
|
|
3
3
|
//#region src/routes/auth.device.tsx
|
|
4
|
-
var $$splitComponentImporter = () => import("./auth.device-
|
|
4
|
+
var $$splitComponentImporter = () => import("./auth.device-cqjWACvB.js");
|
|
5
5
|
/**
|
|
6
6
|
* Where `coffre login` sends you: approve a terminal's sign-in with the
|
|
7
7
|
* session this browser already has. The terminal shows a code; this page
|
|
@@ -14,9 +14,9 @@ var Route = createFileRoute("/auth/device")({
|
|
|
14
14
|
return typeof code === "string" && code.length <= 16 ? { code } : {};
|
|
15
15
|
},
|
|
16
16
|
loaderDeps: ({ search }) => ({ code: search.code }),
|
|
17
|
-
loader: async ({ context: { client }, deps
|
|
17
|
+
loader: async ({ context: { client, queryClient }, deps }) => {
|
|
18
18
|
if (deps.code === void 0) return null;
|
|
19
|
-
if (!(await
|
|
19
|
+
if (!(await loadShell(queryClient, client)).auth.signin) return {
|
|
20
20
|
ok: false,
|
|
21
21
|
error: "This instance has no CLI sign-in."
|
|
22
22
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { i as require_react, r as require_jsx_runtime, s as __toESM } from "./useRouter-CaUSUNsw.js";
|
|
2
|
+
import { t as Link } from "./link-42ZWdjzZ.js";
|
|
3
|
+
import { i as useNavigate } from "./lazyRouteComponent-CqBNCGuZ.js";
|
|
4
|
+
import { C as useCoffre, n as ClosedDoor, x as statusOf, y as failureMessage } from "./page-BGeDoQO5.js";
|
|
5
|
+
import { a as ErrorLine, c as Spinner, l as Timestamp } from "./ui-DvlGkmaH.js";
|
|
6
|
+
import { L as SlashCircle, o as CheckCircle, z as Terminal } from "./icons-CWsTEfpn.js";
|
|
7
|
+
import { t as Route } from "./auth.device-BXf_JjT7.js";
|
|
6
8
|
//#region src/routes/auth.device.tsx?tsr-split=component
|
|
7
9
|
/**
|
|
8
10
|
* Where `coffre login` sends you: approve a terminal's sign-in with the
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { i as require_react, r as require_jsx_runtime, s as __toESM } from "./useRouter-CaUSUNsw.js";
|
|
2
|
+
import { t as Link } from "./link-42ZWdjzZ.js";
|
|
3
|
+
import { C as useCoffre, b as memberRef } from "./page-BGeDoQO5.js";
|
|
4
|
+
import { g as removeMember, l as directoryList, m as invite, n as useChangeStatus, o as changeRole, t as useChange } from "./use-change-CJpGSNIq.js";
|
|
5
|
+
import { c as Spinner, d as Toggletip, h as dropdown_menu_exports, i as EmptyState, n as ConfirmDialog, o as Modal } from "./ui-DvlGkmaH.js";
|
|
6
|
+
import { A as Plus, D as MoreHorizontal, F as ShieldCheck, S as Lock, V as User, W as X, k as Pencil, v as Key } from "./icons-CWsTEfpn.js";
|
|
7
|
+
import { a as rowClass, i as RowPending, r as RowFailure } from "./row-state-CAItu3n_.js";
|
|
6
8
|
//#region src/components/principal.tsx
|
|
7
9
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
8
10
|
var import_jsx_runtime = require_jsx_runtime();
|
|
@@ -40,30 +42,8 @@ function PrincipalLink({ type, id, stretch = false }) {
|
|
|
40
42
|
}
|
|
41
43
|
//#endregion
|
|
42
44
|
//#region src/components/directory.tsx
|
|
43
|
-
/**
|
|
44
|
-
|
|
45
|
-
* managers the members of their projects; the directory pages stay the
|
|
46
|
-
* owners' own, and asking for anyone else would only log a refusal.
|
|
47
|
-
*/
|
|
48
|
-
async function loadDirectory(client, canManage) {
|
|
49
|
-
if (!canManage) return {
|
|
50
|
-
ok: false,
|
|
51
|
-
error: "Only owners can manage users and service accounts."
|
|
52
|
-
};
|
|
53
|
-
return uiResult(async () => {
|
|
54
|
-
const { members, removed } = await client.members.list();
|
|
55
|
-
return {
|
|
56
|
-
principals: members.map(({ principalType, principalId, instanceRole, isRootAdmin, tampered }) => ({
|
|
57
|
-
principalType,
|
|
58
|
-
principalId,
|
|
59
|
-
instanceRole,
|
|
60
|
-
isRootAdmin,
|
|
61
|
-
tampered
|
|
62
|
-
})),
|
|
63
|
-
removed
|
|
64
|
-
};
|
|
65
|
-
});
|
|
66
|
-
}
|
|
45
|
+
/** How the directory, and its changes, name someone: `user:…`, `token:…`. */
|
|
46
|
+
var memberOf = (principal) => memberRef(principal.principalType, principal.principalId);
|
|
67
47
|
var ROLE_LABEL = {
|
|
68
48
|
"root-admin": "Root admin",
|
|
69
49
|
owner: "Owner",
|
|
@@ -76,10 +56,13 @@ var KIND = {
|
|
|
76
56
|
};
|
|
77
57
|
function DirectoryTable({ principalType, principals, hasRemoved = false }) {
|
|
78
58
|
const users = principalType === "user";
|
|
59
|
+
const columns = users ? 4 : 3;
|
|
60
|
+
const { status, failedAdds, dismiss } = useChangeStatus(directoryList.queryKey);
|
|
61
|
+
const refused = failedAdds(principals.map(memberOf)).filter(({ vars }) => vars.principalType === principalType);
|
|
79
62
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", {
|
|
80
63
|
className: "card",
|
|
81
64
|
"aria-label": users ? "Users" : "Tokens",
|
|
82
|
-
children: principals.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(EmptyState, {
|
|
65
|
+
children: principals.length === 0 && refused.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(EmptyState, {
|
|
83
66
|
title: hasRemoved ? `No active ${KIND[principalType]}s` : users ? "Nobody is registered" : "No tokens yet",
|
|
84
67
|
children: [hasRemoved ? `Add a ${KIND[principalType]}` : `Add the first ${KIND[principalType]}`, " to let it through the door. Project access is a separate step, granted from each project's page."]
|
|
85
68
|
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -112,33 +95,45 @@ function DirectoryTable({ principalType, principals, hasRemoved = false }) {
|
|
|
112
95
|
children: "Actions"
|
|
113
96
|
})
|
|
114
97
|
})
|
|
115
|
-
] }) }), /* @__PURE__ */ (0, import_jsx_runtime.
|
|
116
|
-
|
|
117
|
-
children: [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
98
|
+
] }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tbody", { children: [principals.map((principal, index) => {
|
|
99
|
+
const state = status(memberOf(principal));
|
|
100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", {
|
|
101
|
+
className: `row-link ${rowClass(state)}`,
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
104
|
+
className: "n",
|
|
105
|
+
children: index + 1
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
108
|
+
className: "col-lead",
|
|
109
|
+
"data-label": principal.principalType === "user" ? "Email" : "Name",
|
|
110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PrincipalLink, {
|
|
111
|
+
type: principal.principalType,
|
|
112
|
+
id: principal.principalId,
|
|
113
|
+
stretch: true
|
|
114
|
+
})
|
|
115
|
+
}),
|
|
116
|
+
users && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
117
|
+
className: "col-role",
|
|
118
|
+
"data-label": "Instance role",
|
|
119
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstanceRole, { principal })
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", {
|
|
122
|
+
className: "col-actions",
|
|
123
|
+
children: state.state === "pending" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowPending, { status: state }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PrincipalActions, { principal })
|
|
129
124
|
})
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
]
|
|
141
|
-
},
|
|
125
|
+
]
|
|
126
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowFailure, {
|
|
127
|
+
status: state,
|
|
128
|
+
columns,
|
|
129
|
+
onDismiss: () => state.state === "failed" && dismiss(state.mutationId)
|
|
130
|
+
})] }, principal.principalId);
|
|
131
|
+
}), refused.map(({ mutationId, vars, status: failed }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(RowFailure, {
|
|
132
|
+
status: failed,
|
|
133
|
+
columns,
|
|
134
|
+
onDismiss: () => dismiss(mutationId),
|
|
135
|
+
children: [vars.principalId, " was not added."]
|
|
136
|
+
}, mutationId))] })]
|
|
142
137
|
})
|
|
143
138
|
})
|
|
144
139
|
});
|
|
@@ -178,16 +173,16 @@ function InstanceRole({ principal }) {
|
|
|
178
173
|
* Change role and Remove, behind one menu. Root admins get none: the
|
|
179
174
|
* deployment's configuration owns them.
|
|
180
175
|
*/
|
|
181
|
-
function PrincipalActions({ principal, trigger = "act act-quiet act-menu"
|
|
176
|
+
function PrincipalActions({ principal, trigger = "act act-quiet act-menu" }) {
|
|
182
177
|
const [editing, setEditing] = (0, import_react.useState)(false);
|
|
183
178
|
const [confirming, setConfirming] = (0, import_react.useState)(false);
|
|
184
179
|
const [instanceRole, setInstanceRole] = (0, import_react.useState)(principal.instanceRole === "owner" ? "owner" : "user");
|
|
185
180
|
const coffre = useCoffre();
|
|
186
|
-
const
|
|
181
|
+
const setRole = useChange(changeRole(coffre));
|
|
182
|
+
const remove = useChange(removeMember(coffre));
|
|
183
|
+
const { status } = useChangeStatus(directoryList.queryKey);
|
|
184
|
+
const pending = status(memberOf(principal)).state === "pending";
|
|
187
185
|
const kind = KIND[principal.principalType];
|
|
188
|
-
(0, import_react.useEffect)(() => {
|
|
189
|
-
if (error !== null && !editing) toast.error(error);
|
|
190
|
-
}, [editing, error]);
|
|
191
186
|
if (principal.isRootAdmin) return null;
|
|
192
187
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
193
188
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(dropdown_menu_exports.Root, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(dropdown_menu_exports.Trigger, {
|
|
@@ -222,10 +217,7 @@ function PrincipalActions({ principal, trigger = "act act-quiet act-menu", onRem
|
|
|
222
217
|
}) })] }),
|
|
223
218
|
principal.principalType === "user" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Modal, {
|
|
224
219
|
open: editing,
|
|
225
|
-
onOpenChange:
|
|
226
|
-
setEditing(open);
|
|
227
|
-
if (!open) setError(null);
|
|
228
|
-
},
|
|
220
|
+
onOpenChange: setEditing,
|
|
229
221
|
title: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: ["Role of ", /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
230
222
|
className: "mono",
|
|
231
223
|
children: principal.principalId
|
|
@@ -234,32 +226,28 @@ function PrincipalActions({ principal, trigger = "act act-quiet act-menu", onRem
|
|
|
234
226
|
className: "form",
|
|
235
227
|
onSubmit: (event) => {
|
|
236
228
|
event.preventDefault();
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
229
|
+
setRole({
|
|
230
|
+
principalId: principal.principalId,
|
|
231
|
+
owner: instanceRole === "owner"
|
|
240
232
|
});
|
|
233
|
+
setEditing(false);
|
|
241
234
|
},
|
|
242
|
-
children: [
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
disabled: pending,
|
|
259
|
-
children: [pending && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, {}), "Save"]
|
|
260
|
-
})]
|
|
261
|
-
})
|
|
262
|
-
]
|
|
235
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RoleField, {
|
|
236
|
+
value: instanceRole,
|
|
237
|
+
onChange: setInstanceRole
|
|
238
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
239
|
+
className: "dialog-actions",
|
|
240
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
241
|
+
className: "btn",
|
|
242
|
+
type: "button",
|
|
243
|
+
onClick: () => setEditing(false),
|
|
244
|
+
children: "Cancel"
|
|
245
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
246
|
+
className: "btn btn-primary",
|
|
247
|
+
type: "submit",
|
|
248
|
+
children: "Save"
|
|
249
|
+
})]
|
|
250
|
+
})]
|
|
263
251
|
})
|
|
264
252
|
}),
|
|
265
253
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfirmDialog, {
|
|
@@ -275,10 +263,7 @@ function PrincipalActions({ principal, trigger = "act act-quiet act-menu", onRem
|
|
|
275
263
|
] }),
|
|
276
264
|
body: principal.principalType === "user" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: "They are signed out everywhere, and their CLI logins, linked sign-in accounts and project permissions are revoked at once. Their past actions stay in the audit log, and their page then lists the values they saw, to rotate." }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: "Every token issued to it stops working and its project permissions are revoked at once, including for anything running with it right now. Its past actions stay in the audit log, and its page then lists the values it read, to rotate." }),
|
|
277
265
|
confirmLabel: `Remove ${kind}`,
|
|
278
|
-
onConfirm: () =>
|
|
279
|
-
toast.success(`${principal.principalId} removed`);
|
|
280
|
-
await onRemoved?.();
|
|
281
|
-
})
|
|
266
|
+
onConfirm: () => remove(principal)
|
|
282
267
|
})
|
|
283
268
|
] });
|
|
284
269
|
}
|
|
@@ -286,14 +271,12 @@ function AddPrincipal({ principalType }) {
|
|
|
286
271
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
287
272
|
const [principalId, setPrincipalId] = (0, import_react.useState)("");
|
|
288
273
|
const [instanceRole, setInstanceRole] = (0, import_react.useState)("user");
|
|
289
|
-
const
|
|
290
|
-
const { pending, error, setError, run } = useAction();
|
|
274
|
+
const add = useChange(invite(useCoffre()));
|
|
291
275
|
const kind = KIND[principalType];
|
|
292
276
|
function close() {
|
|
293
277
|
setOpen(false);
|
|
294
278
|
setPrincipalId("");
|
|
295
279
|
setInstanceRole("user");
|
|
296
|
-
setError(null);
|
|
297
280
|
}
|
|
298
281
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
299
282
|
className: "btn btn-primary",
|
|
@@ -312,15 +295,12 @@ function AddPrincipal({ principalType }) {
|
|
|
312
295
|
className: "form",
|
|
313
296
|
onSubmit: (event) => {
|
|
314
297
|
event.preventDefault();
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
await coffre.members.add(member, { owner: principalType === "user" && instanceRole === "owner" });
|
|
320
|
-
}, () => {
|
|
321
|
-
toast.success(`${principalId.trim()} added`);
|
|
322
|
-
close();
|
|
298
|
+
add({
|
|
299
|
+
principalType,
|
|
300
|
+
principalId: principalId.trim(),
|
|
301
|
+
owner: instanceRole === "owner"
|
|
323
302
|
});
|
|
303
|
+
close();
|
|
324
304
|
},
|
|
325
305
|
children: [
|
|
326
306
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", {
|
|
@@ -342,7 +322,6 @@ function AddPrincipal({ principalType }) {
|
|
|
342
322
|
value: instanceRole,
|
|
343
323
|
onChange: setInstanceRole
|
|
344
324
|
}),
|
|
345
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorLine, { error }),
|
|
346
325
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
347
326
|
className: "dialog-actions",
|
|
348
327
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
@@ -353,12 +332,8 @@ function AddPrincipal({ principalType }) {
|
|
|
353
332
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
354
333
|
className: "btn btn-primary",
|
|
355
334
|
type: "submit",
|
|
356
|
-
disabled:
|
|
357
|
-
children: [
|
|
358
|
-
pending && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, {}),
|
|
359
|
-
"Add ",
|
|
360
|
-
kind
|
|
361
|
-
]
|
|
335
|
+
disabled: principalId.trim() === "",
|
|
336
|
+
children: ["Add ", kind]
|
|
362
337
|
})]
|
|
363
338
|
})
|
|
364
339
|
]
|
|
@@ -393,4 +368,4 @@ function RoleField({ value, onChange }) {
|
|
|
393
368
|
});
|
|
394
369
|
}
|
|
395
370
|
//#endregion
|
|
396
|
-
export { PrincipalActions as a,
|
|
371
|
+
export { PrincipalActions as a, KIND as i, DirectoryTable as n, PrincipalAvatar as o, InstanceRole as r, PrincipalLink as s, AddPrincipal as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as require_react_dom } from "./react-dom-
|
|
3
|
-
import { n as failureMessage } from "./coffre-C2ANsTAz.js";
|
|
1
|
+
import { i as require_react, s as __toESM } from "./useRouter-CaUSUNsw.js";
|
|
2
|
+
import { t as require_react_dom } from "./react-dom-bBoJXlK2.js";
|
|
4
3
|
//#region ../../node_modules/.pnpm/sonner@2.0.7_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/sonner/dist/index.mjs
|
|
5
4
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
6
5
|
var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1);
|
|
@@ -906,48 +905,4 @@ var Toaster = /*#__PURE__*/ import_react.forwardRef(function Toaster(props, ref)
|
|
|
906
905
|
}));
|
|
907
906
|
});
|
|
908
907
|
//#endregion
|
|
909
|
-
|
|
910
|
-
/**
|
|
911
|
-
* Run a change against the API, then refresh what is on screen. A failed
|
|
912
|
-
* call leaves the page as it was and says why, in `error`.
|
|
913
|
-
*
|
|
914
|
-
* `router.invalidate()` is this app's replacement for Next's
|
|
915
|
-
* `revalidatePath`. The difference worth knowing: `revalidatePath` named the
|
|
916
|
-
* routes to refresh and got it wrong quietly when a mutation touched more than
|
|
917
|
-
* the page it was called from -- renaming a project had to remember to
|
|
918
|
-
* revalidate both `/` and `/:project`. Invalidating refetches every mounted
|
|
919
|
-
* loader instead, so the sidebar's project tree stays honest without anyone
|
|
920
|
-
* having to remember it exists.
|
|
921
|
-
*/
|
|
922
|
-
function useAction() {
|
|
923
|
-
const router = useRouter();
|
|
924
|
-
const [pending, setPending] = (0, import_react.useState)(false);
|
|
925
|
-
const [error, setError] = (0, import_react.useState)(null);
|
|
926
|
-
async function run(fn, onSuccess) {
|
|
927
|
-
setPending(true);
|
|
928
|
-
let result;
|
|
929
|
-
try {
|
|
930
|
-
result = await fn();
|
|
931
|
-
} catch (failure) {
|
|
932
|
-
setError(failureMessage(failure));
|
|
933
|
-
setPending(false);
|
|
934
|
-
return;
|
|
935
|
-
}
|
|
936
|
-
setError(null);
|
|
937
|
-
try {
|
|
938
|
-
await router.invalidate();
|
|
939
|
-
await onSuccess?.(result);
|
|
940
|
-
} catch {
|
|
941
|
-
setError("The change was saved, but the page could not refresh. Reload before you retry.");
|
|
942
|
-
}
|
|
943
|
-
setPending(false);
|
|
944
|
-
}
|
|
945
|
-
return {
|
|
946
|
-
pending,
|
|
947
|
-
error,
|
|
948
|
-
setError,
|
|
949
|
-
run
|
|
950
|
-
};
|
|
951
|
-
}
|
|
952
|
-
//#endregion
|
|
953
|
-
export { Toaster as n, toast as r, useAction as t };
|
|
908
|
+
export { toast as n, Toaster as t };
|