@coffre/ui 0.3.0 → 0.4.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.
Files changed (177) hide show
  1. package/dist/chunks/audit-sentence-BhHmvQX_.js +660 -0
  2. package/dist/chunks/audit-sentence-BhHmvQX_.js.map +1 -0
  3. package/dist/chunks/delete-place-CRX7ntE8.js +206 -0
  4. package/dist/chunks/delete-place-CRX7ntE8.js.map +1 -0
  5. package/dist/chunks/{directory-CSjWWUQ1.js → directory-zr3ek7Mc.js} +175 -60
  6. package/dist/chunks/directory-zr3ek7Mc.js.map +1 -0
  7. package/dist/chunks/folders-DoBmCwOi.js +207 -0
  8. package/dist/chunks/folders-DoBmCwOi.js.map +1 -0
  9. package/dist/chunks/grants-Cw1FyGID.js +669 -0
  10. package/dist/chunks/grants-Cw1FyGID.js.map +1 -0
  11. package/dist/chunks/offboarding-CE6d7um1.js +305 -0
  12. package/dist/chunks/offboarding-CE6d7um1.js.map +1 -0
  13. package/dist/chunks/one-time-DXEl9hbg.js +35 -0
  14. package/dist/chunks/one-time-DXEl9hbg.js.map +1 -0
  15. package/dist/chunks/page-DvsgZ2Hd.js +391 -0
  16. package/dist/chunks/page-DvsgZ2Hd.js.map +1 -0
  17. package/dist/chunks/principal-BIN-xwZw.js +42 -0
  18. package/dist/chunks/principal-BIN-xwZw.js.map +1 -0
  19. package/dist/chunks/{principal-page-D_91OA0l.js → principal-page-DhjO76GH.js} +245 -251
  20. package/dist/chunks/principal-page-DhjO76GH.js.map +1 -0
  21. package/dist/chunks/project-page-SRCtRe2g.js +17 -0
  22. package/dist/chunks/project-page-SRCtRe2g.js.map +1 -0
  23. package/dist/chunks/{queries-CQ81o4so.js → queries-DVR_i3rA.js} +132 -30
  24. package/dist/chunks/queries-DVR_i3rA.js.map +1 -0
  25. package/dist/chunks/references-B6pLT1uQ.js +343 -0
  26. package/dist/chunks/references-B6pLT1uQ.js.map +1 -0
  27. package/dist/chunks/{row-state-0PsrEzOL.js → row-state-DOPUsjQK.js} +3 -3
  28. package/dist/chunks/{row-state-0PsrEzOL.js.map → row-state-DOPUsjQK.js.map} +1 -1
  29. package/dist/chunks/signin-errors--ykMFuqN.js +57 -0
  30. package/dist/chunks/signin-errors--ykMFuqN.js.map +1 -0
  31. package/dist/chunks/tabs-BmwKfUeK.js +22 -0
  32. package/dist/chunks/tabs-BmwKfUeK.js.map +1 -0
  33. package/dist/chunks/{theme-B2vQolVR.js → theme-DJuz-xLM.js} +3 -3
  34. package/dist/chunks/{theme-B2vQolVR.js.map → theme-DJuz-xLM.js.map} +1 -1
  35. package/dist/chunks/{ui-DixXLQvQ.js → ui-DJje3gST.js} +6 -3
  36. package/dist/chunks/ui-DJje3gST.js.map +1 -0
  37. package/dist/chunks/{use-change-c6CeLRin.js → use-change-DUiGO19U.js} +52 -21
  38. package/dist/chunks/use-change-DUiGO19U.js.map +1 -0
  39. package/dist/chunks/{use-shell-jxd7Tzd-.js → use-shell-rNKfGjdj.js} +3 -3
  40. package/dist/chunks/{use-shell-jxd7Tzd-.js.map → use-shell-rNKfGjdj.js.map} +1 -1
  41. package/dist/chunks/validation-D312_NLf.js +87 -0
  42. package/dist/chunks/validation-D312_NLf.js.map +1 -0
  43. package/dist/index.d.ts +361 -27
  44. package/dist/index.js +188 -98
  45. package/dist/index.js.map +1 -1
  46. package/dist/pages/account.d.ts +2 -2
  47. package/dist/pages/account.js +297 -135
  48. package/dist/pages/account.js.map +1 -1
  49. package/dist/pages/approval.d.ts +9 -0
  50. package/dist/pages/approval.js +207 -0
  51. package/dist/pages/approval.js.map +1 -0
  52. package/dist/pages/audit.js +17 -542
  53. package/dist/pages/audit.js.map +1 -1
  54. package/dist/pages/device-login.js +2 -3
  55. package/dist/pages/device-login.js.map +1 -1
  56. package/dist/pages/environment.js +647 -257
  57. package/dist/pages/environment.js.map +1 -1
  58. package/dist/pages/login.js +18 -7
  59. package/dist/pages/login.js.map +1 -1
  60. package/dist/pages/oauth-authorize.d.ts +10 -0
  61. package/dist/pages/oauth-authorize.js +249 -0
  62. package/dist/pages/oauth-authorize.js.map +1 -0
  63. package/dist/pages/project-access.d.ts +6 -0
  64. package/dist/pages/project-access.js +370 -0
  65. package/dist/pages/project-access.js.map +1 -0
  66. package/dist/pages/project-environments.d.ts +4 -0
  67. package/dist/pages/project-environments.js +593 -0
  68. package/dist/pages/project-environments.js.map +1 -0
  69. package/dist/pages/project-settings.d.ts +4 -0
  70. package/dist/pages/project-settings.js +242 -0
  71. package/dist/pages/project-settings.js.map +1 -0
  72. package/dist/pages/project.d.ts +10 -2
  73. package/dist/pages/project.js +57 -934
  74. package/dist/pages/project.js.map +1 -1
  75. package/dist/pages/projects.js +53 -21
  76. package/dist/pages/projects.js.map +1 -1
  77. package/dist/pages/service-account.d.ts +10 -0
  78. package/dist/pages/{token.js → service-account.js} +112 -54
  79. package/dist/pages/service-account.js.map +1 -0
  80. package/dist/pages/service-accounts.d.ts +3 -0
  81. package/dist/pages/service-accounts.js +38 -0
  82. package/dist/pages/service-accounts.js.map +1 -0
  83. package/dist/pages/settings.d.ts +1 -0
  84. package/dist/pages/settings.js +104 -42
  85. package/dist/pages/settings.js.map +1 -1
  86. package/dist/pages/unregistered.js +2 -3
  87. package/dist/pages/unregistered.js.map +1 -1
  88. package/dist/pages/user.d.ts +6 -1
  89. package/dist/pages/user.js +18 -6
  90. package/dist/pages/user.js.map +1 -1
  91. package/dist/pages/users.js +6 -10
  92. package/dist/pages/users.js.map +1 -1
  93. package/package.json +3 -3
  94. package/src/components/actions-log.tsx +117 -0
  95. package/src/components/audit-sentence.tsx +55 -0
  96. package/src/components/command-palette.tsx +4 -4
  97. package/src/components/delete-place.tsx +180 -0
  98. package/src/components/directory.tsx +259 -110
  99. package/src/components/every-project.tsx +287 -0
  100. package/src/components/expiry-field.tsx +42 -0
  101. package/src/components/folders.tsx +219 -0
  102. package/src/components/grants.tsx +11 -4
  103. package/src/components/icons.tsx +2 -0
  104. package/src/components/missing.tsx +110 -0
  105. package/src/components/offboarding.tsx +61 -33
  106. package/src/components/page.tsx +4 -1
  107. package/src/components/principal-page.tsx +136 -106
  108. package/src/components/principal-picker.tsx +5 -5
  109. package/src/components/principal.tsx +4 -4
  110. package/src/components/references.tsx +323 -0
  111. package/src/components/service-tokens.tsx +112 -93
  112. package/src/components/shell.tsx +11 -32
  113. package/src/components/tabs.tsx +18 -0
  114. package/src/components/trusted-workloads.tsx +97 -79
  115. package/src/components/ui.tsx +8 -1
  116. package/src/index.ts +13 -2
  117. package/src/layout.tsx +2 -2
  118. package/src/lib/access-plan.ts +2 -2
  119. package/src/lib/audit-sentences.ts +161 -77
  120. package/src/lib/changes.ts +56 -5
  121. package/src/lib/coffre.ts +3 -2
  122. package/src/lib/one-time.ts +32 -0
  123. package/src/lib/project-access.ts +11 -23
  124. package/src/lib/project-page.ts +14 -0
  125. package/src/lib/queries.ts +126 -32
  126. package/src/lib/search.ts +25 -0
  127. package/src/lib/signin-errors.ts +45 -1
  128. package/src/lib/validation.ts +14 -0
  129. package/src/options.ts +187 -35
  130. package/src/pages/account.tsx +274 -129
  131. package/src/pages/approval.tsx +197 -0
  132. package/src/pages/audit.tsx +9 -61
  133. package/src/pages/environment.tsx +585 -286
  134. package/src/pages/login.tsx +8 -2
  135. package/src/pages/oauth-authorize.tsx +233 -0
  136. package/src/pages/project-access.tsx +219 -0
  137. package/src/pages/project-environments.tsx +582 -0
  138. package/src/pages/project-settings.tsx +259 -0
  139. package/src/pages/project.tsx +52 -879
  140. package/src/pages/projects.tsx +55 -18
  141. package/src/pages/service-account.tsx +50 -0
  142. package/src/pages/{tokens.tsx → service-accounts.tsx} +9 -6
  143. package/src/pages/settings.tsx +62 -8
  144. package/src/pages/user.tsx +16 -4
  145. package/src/pages/users.tsx +2 -2
  146. package/src/parity.ts +160 -0
  147. package/src/register.ts +58 -9
  148. package/src/router.tsx +4 -0
  149. package/src/shared/models.ts +6 -2
  150. package/src/styles/globals.css +536 -31
  151. package/dist/chunks/directory-CSjWWUQ1.js.map +0 -1
  152. package/dist/chunks/grants-saMQagmG.js +0 -160
  153. package/dist/chunks/grants-saMQagmG.js.map +0 -1
  154. package/dist/chunks/icons-D-PfAfnH.js +0 -203
  155. package/dist/chunks/icons-D-PfAfnH.js.map +0 -1
  156. package/dist/chunks/offboarding-C6l30DZR.js +0 -263
  157. package/dist/chunks/offboarding-C6l30DZR.js.map +0 -1
  158. package/dist/chunks/page-C5HcNqf2.js +0 -190
  159. package/dist/chunks/page-C5HcNqf2.js.map +0 -1
  160. package/dist/chunks/principal-page-D_91OA0l.js.map +0 -1
  161. package/dist/chunks/queries-CQ81o4so.js.map +0 -1
  162. package/dist/chunks/signin-errors-BEFlVDbQ.js +0 -30
  163. package/dist/chunks/signin-errors-BEFlVDbQ.js.map +0 -1
  164. package/dist/chunks/ui-DixXLQvQ.js.map +0 -1
  165. package/dist/chunks/use-action-CWsg_YWU.js +0 -49
  166. package/dist/chunks/use-action-CWsg_YWU.js.map +0 -1
  167. package/dist/chunks/use-change-c6CeLRin.js.map +0 -1
  168. package/dist/chunks/validation-BQtqPe2V.js +0 -29
  169. package/dist/chunks/validation-BQtqPe2V.js.map +0 -1
  170. package/dist/pages/token.d.ts +0 -3
  171. package/dist/pages/token.js.map +0 -1
  172. package/dist/pages/tokens.d.ts +0 -3
  173. package/dist/pages/tokens.js +0 -39
  174. package/dist/pages/tokens.js.map +0 -1
  175. package/dist/project-BqIy8gYR.d.ts +0 -5
  176. package/src/lib/instance.ts +0 -13
  177. package/src/pages/token.tsx +0 -34
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { n as ProjectTab } from "./project-BqIy8gYR.js";
2
1
  import { ReactNode } from "react";
3
- import { CoffreClient, Member } from "@coffre/client";
2
+ import { CoffreClient, Member, RouteInput } from "@coffre/client";
4
3
  import { AnyRoute, ParsedLocation } from "@tanstack/react-router";
5
4
  import "@coffre/core/pages";
6
5
  import "@coffre/core/access";
@@ -94,7 +93,13 @@ type NavigationBlocker = {
94
93
  };
95
94
  //#endregion
96
95
  //#region src/shared/models.d.ts
97
- type DirectoryPrincipal = Pick<Member, 'principalType' | 'principalId' | 'instanceRole' | 'isRootAdmin'> & Partial<Pick<Member, 'tampered'>>;
96
+ type DirectoryPrincipal = Pick<Member, 'principalType' | 'principalId' | 'instanceRole' | 'isRootAdmin'> & Partial<Pick<Member, 'tampered'>> & {
97
+ /** Where it has access, when the list said; a member just added has none yet. */
98
+ grants?: {
99
+ project: string;
100
+ environment: string | null;
101
+ }[];
102
+ };
98
103
  //#endregion
99
104
  //#region src/lib/queries.d.ts
100
105
  type AuditSearch = {
@@ -103,6 +108,21 @@ type AuditSearch = {
103
108
  detail?: '1';
104
109
  };
105
110
  //#endregion
111
+ //#region src/lib/signin-errors.d.ts
112
+ type LoginSearch = {
113
+ next?: string;
114
+ error?: string;
115
+ with?: string;
116
+ via?: string;
117
+ };
118
+ /**
119
+ * `/login`'s search: where to resume after signing in, same-origin paths
120
+ * only, since an absolute URL accepted here would make the sign-in page an
121
+ * open redirect; and the sign-in's `error`, with account_mismatch's `with`
122
+ * and `via`, provider ids, shown once, then taken out of the URL.
123
+ */
124
+ declare function loginSearch(search: Record<string, unknown>): LoginSearch;
125
+ //#endregion
106
126
  //#region src/options.d.ts
107
127
  /**
108
128
  * What coffre's routes read through the router: the API as the visitor
@@ -145,6 +165,7 @@ export declare const projects: {
145
165
  slug: string;
146
166
  name: string;
147
167
  archivedAt: string | null;
168
+ folder: string | null;
148
169
  permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
149
170
  environments: {
150
171
  slug: string;
@@ -157,13 +178,75 @@ export declare const projects: {
157
178
  }[];
158
179
  secretCount: number | null;
159
180
  }[];
181
+ everyProject: {
182
+ member: string;
183
+ place: string;
184
+ role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
185
+ roleName: string;
186
+ expiresAt: string | null;
187
+ }[];
160
188
  })>;
161
189
  };
162
- /** `/projects/$project`. */
190
+ /**
191
+ * `/projects/$project`, the layout of a project's tabs: its header, and the
192
+ * tabs its visitor may open. Each tab is a page under it that reads its own.
193
+ */
163
194
  declare const project$1: {
164
- validateSearch: (search: Record<string, unknown>) => {
165
- tab?: Exclude<ProjectTab, "environments">;
166
- };
195
+ loader: ({ context }: Loader<{
196
+ project: string;
197
+ }>) => Promise<{
198
+ ok: false;
199
+ error: string;
200
+ signedOut: boolean;
201
+ } | ({
202
+ ok: true;
203
+ } & {
204
+ projects: {
205
+ slug: string;
206
+ name: string;
207
+ archivedAt: string | null;
208
+ folder: string | null;
209
+ permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
210
+ environments: {
211
+ slug: string;
212
+ name: string;
213
+ accessible: boolean;
214
+ details: null | {
215
+ archivedAt: string | null;
216
+ secretCount: number | null;
217
+ };
218
+ }[];
219
+ secretCount: number | null;
220
+ }[];
221
+ everyProject: {
222
+ member: string;
223
+ place: string;
224
+ role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
225
+ roleName: string;
226
+ expiresAt: string | null;
227
+ }[];
228
+ })>;
229
+ };
230
+ /** `/projects/$project/`, its environments, and who can open each when you manage its access. */
231
+ export declare const projectEnvironments: {
232
+ loader: ({ context, params }: Loader<{
233
+ project: string;
234
+ }>) => Promise<void>;
235
+ };
236
+ /** `/projects/$project/users`: who holds access, and what others read of it through references. */
237
+ export declare const projectUsers: {
238
+ loader: ({ context, params }: Loader<{
239
+ project: string;
240
+ }>) => Promise<void>;
241
+ };
242
+ /** `/projects/$project/service-accounts`. */
243
+ export declare const projectServiceAccounts: {
244
+ loader: ({ context, params }: Loader<{
245
+ project: string;
246
+ }>) => Promise<void>;
247
+ };
248
+ /** `/projects/$project/settings`: the project itself, which its layout read. */
249
+ export declare const projectSettings: {
167
250
  loader: ({ context, params }: Loader<{
168
251
  project: string;
169
252
  }>) => Promise<void>;
@@ -186,6 +269,19 @@ declare const environment$1: {
186
269
  permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
187
270
  keys: {
188
271
  key: string;
272
+ reference: null | {
273
+ id: string;
274
+ holder: string;
275
+ source: string;
276
+ state: "broken" | "live" | "replaced" | "source_archived" | "source_deleted" | "source_empty" | "source_is_reference";
277
+ version: number | null;
278
+ createdBy: string;
279
+ createdAt: string;
280
+ endedBy: string | null;
281
+ endedAt: string | null;
282
+ canOpenSource: boolean;
283
+ };
284
+ folder: string | null;
189
285
  archived: boolean;
190
286
  version: number | null;
191
287
  updatedAt: string | null;
@@ -263,37 +359,78 @@ export declare const users: {
263
359
  }[];
264
360
  })>;
265
361
  };
266
- /** `/users/$user`. */
362
+ /** `/users/$user`, the layout of a user's tabs: who they are to the instance, for owners. */
267
363
  export declare const user: {
268
364
  loader: ({ context, params }: Loader<{
269
365
  user: string;
270
- }>) => Promise<void>;
271
- };
272
- /** `/tokens`. */
273
- export declare const tokens: {
274
- loader: ({ context }: Loader) => Promise<{
366
+ }>) => Promise<{
275
367
  ok: false;
276
368
  error: string;
277
369
  signedOut: boolean;
278
370
  } | ({
279
371
  ok: true;
280
372
  } & {
281
- principals: DirectoryPrincipal[];
282
- removed: {
373
+ report: {
283
374
  principalType: "service" | "user";
284
375
  principalId: string;
285
- toRotate: number;
286
- }[];
287
- })>;
376
+ status: "active" | "removed" | "tampered";
377
+ instanceRole: "owner" | "root-admin" | "user";
378
+ isRootAdmin: boolean;
379
+ removedAt: string | null;
380
+ removedBy: string | null;
381
+ live: {
382
+ grants: number;
383
+ sessions: number;
384
+ tokens: number;
385
+ identities: number;
386
+ };
387
+ exposed: {
388
+ project: string;
389
+ environment: string;
390
+ key: string;
391
+ version: number;
392
+ how: "read" | "wrote";
393
+ at: string;
394
+ }[];
395
+ rotated: number;
396
+ issuedTokens: {
397
+ id: string;
398
+ service: string;
399
+ label: string | null;
400
+ hint: string;
401
+ expiresAt: string;
402
+ lastUsedAt: string | null;
403
+ }[];
404
+ references: {
405
+ id: string;
406
+ holder: string;
407
+ source: string;
408
+ state: "broken" | "live" | "replaced" | "source_archived" | "source_deleted" | "source_empty" | "source_is_reference";
409
+ version: number | null;
410
+ createdBy: string;
411
+ createdAt: string;
412
+ endedBy: string | null;
413
+ endedAt: string | null;
414
+ }[];
415
+ };
416
+ }) | ({
417
+ ok: true;
418
+ } & {
419
+ report: null;
420
+ }) | null>;
421
+ };
422
+ /** `/users/$user/`, their access on every project where you manage it. */
423
+ export declare const userAccess: {
424
+ loader: ({ context }: Loader) => Promise<void>;
288
425
  };
289
- /** `/tokens/$token`. */
290
- export declare const token: {
426
+ /** `/users/$user/activity`, for whoever reads the audit log; the others are sent to the first tab. */
427
+ export declare const userActivity: {
291
428
  loader: ({ context, params }: Loader<{
292
- token: string;
429
+ user: string;
293
430
  }>) => Promise<void>;
294
431
  };
295
- /** `/settings`. */
296
- export declare const settings: {
432
+ /** `/service-accounts`. */
433
+ export declare const serviceAccounts: {
297
434
  loader: ({ context }: Loader) => Promise<{
298
435
  ok: false;
299
436
  error: string;
@@ -309,6 +446,90 @@ export declare const settings: {
309
446
  }[];
310
447
  })>;
311
448
  };
449
+ /** `/service-accounts/$account`, the layout of a service account's tabs: who it is to the instance, for owners. */
450
+ export declare const serviceAccount: {
451
+ loader: ({ context, params }: Loader<{
452
+ account: string;
453
+ }>) => Promise<{
454
+ ok: false;
455
+ error: string;
456
+ signedOut: boolean;
457
+ } | ({
458
+ ok: true;
459
+ } & {
460
+ report: {
461
+ principalType: "service" | "user";
462
+ principalId: string;
463
+ status: "active" | "removed" | "tampered";
464
+ instanceRole: "owner" | "root-admin" | "user";
465
+ isRootAdmin: boolean;
466
+ removedAt: string | null;
467
+ removedBy: string | null;
468
+ live: {
469
+ grants: number;
470
+ sessions: number;
471
+ tokens: number;
472
+ identities: number;
473
+ };
474
+ exposed: {
475
+ project: string;
476
+ environment: string;
477
+ key: string;
478
+ version: number;
479
+ how: "read" | "wrote";
480
+ at: string;
481
+ }[];
482
+ rotated: number;
483
+ issuedTokens: {
484
+ id: string;
485
+ service: string;
486
+ label: string | null;
487
+ hint: string;
488
+ expiresAt: string;
489
+ lastUsedAt: string | null;
490
+ }[];
491
+ references: {
492
+ id: string;
493
+ holder: string;
494
+ source: string;
495
+ state: "broken" | "live" | "replaced" | "source_archived" | "source_deleted" | "source_empty" | "source_is_reference";
496
+ version: number | null;
497
+ createdBy: string;
498
+ createdAt: string;
499
+ endedBy: string | null;
500
+ endedAt: string | null;
501
+ }[];
502
+ };
503
+ }) | ({
504
+ ok: true;
505
+ } & {
506
+ report: null;
507
+ }) | null>;
508
+ };
509
+ /**
510
+ * `/service-accounts/$account/`, how it signs in: its trusted workloads and
511
+ * bearer tokens. Only an owner manages them, and only while it is active;
512
+ * anyone else is sent to its access.
513
+ */
514
+ export declare const serviceAccountSignIn: {
515
+ loader: ({ context, params }: Loader<{
516
+ account: string;
517
+ }>) => Promise<void>;
518
+ };
519
+ /** `/service-accounts/$account/access`. */
520
+ export declare const serviceAccountAccess: {
521
+ loader: ({ context }: Loader) => Promise<void>;
522
+ };
523
+ /** `/service-accounts/$account/activity`, as a user's. */
524
+ export declare const serviceAccountActivity: {
525
+ loader: ({ context, params }: Loader<{
526
+ account: string;
527
+ }>) => Promise<void>;
528
+ };
529
+ /** `/settings`. */
530
+ export declare const settings: {
531
+ loader: ({ context }: Loader) => Promise<void>;
532
+ };
312
533
  type AccountSearch = {
313
534
  linked?: string;
314
535
  error?: string;
@@ -320,10 +541,7 @@ export declare const account: {
320
541
  };
321
542
  /** `/login`. */
322
543
  export declare const login: {
323
- validateSearch: (search: Record<string, unknown>) => {
324
- next?: string;
325
- error?: string;
326
- };
544
+ validateSearch: typeof loginSearch;
327
545
  loader: ({ context }: Loader) => Promise<void>;
328
546
  };
329
547
  /** `/unregistered`. */
@@ -366,6 +584,122 @@ export declare const deviceLogin: {
366
584
  error: string;
367
585
  } | null>;
368
586
  };
587
+ /**
588
+ * `/approvals/$approval`: a change an MCP client asked for, which its person
589
+ * decides here. Its own read: the page shows what the change would do now.
590
+ */
591
+ export declare const approval: {
592
+ loader: ({ context, params, location }: Loader<{
593
+ approval: string;
594
+ }>) => Promise<{
595
+ ok: false;
596
+ error: string;
597
+ signedOut: boolean;
598
+ } | ({
599
+ ok: true;
600
+ } & {
601
+ approval: {
602
+ id: string;
603
+ status: "approved" | "cancelled" | "denied" | "expired" | "failed" | "pending";
604
+ client: {
605
+ name: string;
606
+ host: string | null;
607
+ registration: "cimd" | "dcr";
608
+ };
609
+ tool: string;
610
+ summary: string;
611
+ details: {
612
+ label: string;
613
+ value: string;
614
+ kind?: "mono" | "time";
615
+ }[];
616
+ asks: null | {
617
+ value: {
618
+ label: string;
619
+ note: string;
620
+ };
621
+ };
622
+ kind: "change" | "reveal";
623
+ digest: string;
624
+ createdAt: string;
625
+ expiresAt: string;
626
+ outcome: null | {
627
+ text: string;
628
+ result?: {
629
+ [key: string]: unknown;
630
+ };
631
+ error?: string;
632
+ };
633
+ };
634
+ })>;
635
+ };
636
+ type AuthorizationSearch = RouteInput<'GET /oauth/authorizations'>;
637
+ /**
638
+ * `/oauth/authorize`: an MCP client asking to connect. Its parameters go to
639
+ * the API as sent, which says which it takes; the router keeps them strings,
640
+ * so a `state` of `1e5` goes back as `1e5`.
641
+ */
642
+ export declare const oauthAuthorize: {
643
+ validateSearch: (search: Record<string, unknown>) => AuthorizationSearch;
644
+ loaderDeps: ({ search }: {
645
+ search: AuthorizationSearch;
646
+ }) => {
647
+ request: {
648
+ client_id?: string;
649
+ redirect_uri?: string;
650
+ response_type?: string;
651
+ code_challenge?: string;
652
+ code_challenge_method?: string;
653
+ state?: string;
654
+ scope?: string;
655
+ resource?: string;
656
+ };
657
+ };
658
+ loader: ({ context, deps, location }: Loader & {
659
+ deps: {
660
+ request: AuthorizationSearch;
661
+ };
662
+ }) => Promise<{
663
+ request: {
664
+ client_id?: string;
665
+ redirect_uri?: string;
666
+ response_type?: string;
667
+ code_challenge?: string;
668
+ code_challenge_method?: string;
669
+ state?: string;
670
+ scope?: string;
671
+ resource?: string;
672
+ };
673
+ email: string;
674
+ result: {
675
+ ok: false;
676
+ error: string;
677
+ signedOut: boolean;
678
+ } | ({
679
+ ok: true;
680
+ } & ({
681
+ status: "invalid";
682
+ message: string;
683
+ } | {
684
+ status: "refused";
685
+ message: string;
686
+ redirect: string;
687
+ } | {
688
+ status: "ready";
689
+ client: {
690
+ id: string;
691
+ name: string;
692
+ host: string | null;
693
+ registration: "cimd" | "dcr";
694
+ };
695
+ redirectHost: string;
696
+ loopbackOnly: boolean;
697
+ scopes: ("browse" | "manage-access" | "read-values" | "write")[];
698
+ connections: ("browse" | "manage-access" | "read-values" | "write")[][];
699
+ days: number;
700
+ }));
701
+ }>;
702
+ };
369
703
  //#endregion
370
704
  //#region src/router.d.ts
371
705
  /**