@coffre/ui 0.3.0 → 0.4.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.
Files changed (180) 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/connected-apps-CUOyEZXR.js +146 -0
  4. package/dist/chunks/connected-apps-CUOyEZXR.js.map +1 -0
  5. package/dist/chunks/delete-place-CRX7ntE8.js +206 -0
  6. package/dist/chunks/delete-place-CRX7ntE8.js.map +1 -0
  7. package/dist/chunks/{directory-CSjWWUQ1.js → directory-CxxrnGUL.js} +177 -60
  8. package/dist/chunks/directory-CxxrnGUL.js.map +1 -0
  9. package/dist/chunks/folders-DoBmCwOi.js +207 -0
  10. package/dist/chunks/folders-DoBmCwOi.js.map +1 -0
  11. package/dist/chunks/grants-CXcmhujY.js +669 -0
  12. package/dist/chunks/grants-CXcmhujY.js.map +1 -0
  13. package/dist/chunks/offboarding-6eAduCsM.js +305 -0
  14. package/dist/chunks/offboarding-6eAduCsM.js.map +1 -0
  15. package/dist/chunks/one-time-DXEl9hbg.js +35 -0
  16. package/dist/chunks/one-time-DXEl9hbg.js.map +1 -0
  17. package/dist/chunks/page-DvsgZ2Hd.js +391 -0
  18. package/dist/chunks/page-DvsgZ2Hd.js.map +1 -0
  19. package/dist/chunks/principal-BIN-xwZw.js +42 -0
  20. package/dist/chunks/principal-BIN-xwZw.js.map +1 -0
  21. package/dist/chunks/{principal-page-D_91OA0l.js → principal-page-B9R2zPlp.js} +259 -251
  22. package/dist/chunks/principal-page-B9R2zPlp.js.map +1 -0
  23. package/dist/chunks/project-page-SRCtRe2g.js +17 -0
  24. package/dist/chunks/project-page-SRCtRe2g.js.map +1 -0
  25. package/dist/chunks/{queries-CQ81o4so.js → queries-DVR_i3rA.js} +132 -30
  26. package/dist/chunks/queries-DVR_i3rA.js.map +1 -0
  27. package/dist/chunks/references-B6pLT1uQ.js +343 -0
  28. package/dist/chunks/references-B6pLT1uQ.js.map +1 -0
  29. package/dist/chunks/{row-state-0PsrEzOL.js → row-state-DOPUsjQK.js} +3 -3
  30. package/dist/chunks/{row-state-0PsrEzOL.js.map → row-state-DOPUsjQK.js.map} +1 -1
  31. package/dist/chunks/signin-errors--ykMFuqN.js +57 -0
  32. package/dist/chunks/signin-errors--ykMFuqN.js.map +1 -0
  33. package/dist/chunks/tabs-BmwKfUeK.js +22 -0
  34. package/dist/chunks/tabs-BmwKfUeK.js.map +1 -0
  35. package/dist/chunks/{theme-B2vQolVR.js → theme-DJuz-xLM.js} +3 -3
  36. package/dist/chunks/{theme-B2vQolVR.js.map → theme-DJuz-xLM.js.map} +1 -1
  37. package/dist/chunks/{ui-DixXLQvQ.js → ui-DJje3gST.js} +6 -3
  38. package/dist/chunks/ui-DJje3gST.js.map +1 -0
  39. package/dist/chunks/{use-change-c6CeLRin.js → use-change-CZdI2MJG.js} +75 -21
  40. package/dist/chunks/use-change-CZdI2MJG.js.map +1 -0
  41. package/dist/chunks/{use-shell-jxd7Tzd-.js → use-shell-rNKfGjdj.js} +3 -3
  42. package/dist/chunks/{use-shell-jxd7Tzd-.js.map → use-shell-rNKfGjdj.js.map} +1 -1
  43. package/dist/chunks/validation-D312_NLf.js +87 -0
  44. package/dist/chunks/validation-D312_NLf.js.map +1 -0
  45. package/dist/index.d.ts +385 -31
  46. package/dist/index.js +188 -102
  47. package/dist/index.js.map +1 -1
  48. package/dist/pages/account.d.ts +2 -2
  49. package/dist/pages/account.js +174 -135
  50. package/dist/pages/account.js.map +1 -1
  51. package/dist/pages/approval.d.ts +9 -0
  52. package/dist/pages/approval.js +207 -0
  53. package/dist/pages/approval.js.map +1 -0
  54. package/dist/pages/audit.js +17 -542
  55. package/dist/pages/audit.js.map +1 -1
  56. package/dist/pages/device-login.js +2 -3
  57. package/dist/pages/device-login.js.map +1 -1
  58. package/dist/pages/environment.js +647 -257
  59. package/dist/pages/environment.js.map +1 -1
  60. package/dist/pages/login.js +18 -7
  61. package/dist/pages/login.js.map +1 -1
  62. package/dist/pages/oauth-authorize.d.ts +10 -0
  63. package/dist/pages/oauth-authorize.js +249 -0
  64. package/dist/pages/oauth-authorize.js.map +1 -0
  65. package/dist/pages/project-access.d.ts +6 -0
  66. package/dist/pages/project-access.js +370 -0
  67. package/dist/pages/project-access.js.map +1 -0
  68. package/dist/pages/project-environments.d.ts +4 -0
  69. package/dist/pages/project-environments.js +593 -0
  70. package/dist/pages/project-environments.js.map +1 -0
  71. package/dist/pages/project-settings.d.ts +4 -0
  72. package/dist/pages/project-settings.js +242 -0
  73. package/dist/pages/project-settings.js.map +1 -0
  74. package/dist/pages/project.d.ts +10 -2
  75. package/dist/pages/project.js +57 -934
  76. package/dist/pages/project.js.map +1 -1
  77. package/dist/pages/projects.js +53 -21
  78. package/dist/pages/projects.js.map +1 -1
  79. package/dist/pages/service-account.d.ts +10 -0
  80. package/dist/pages/{token.js → service-account.js} +112 -54
  81. package/dist/pages/service-account.js.map +1 -0
  82. package/dist/pages/service-accounts.d.ts +3 -0
  83. package/dist/pages/service-accounts.js +38 -0
  84. package/dist/pages/service-accounts.js.map +1 -0
  85. package/dist/pages/settings.d.ts +1 -0
  86. package/dist/pages/settings.js +104 -42
  87. package/dist/pages/settings.js.map +1 -1
  88. package/dist/pages/unregistered.js +2 -3
  89. package/dist/pages/unregistered.js.map +1 -1
  90. package/dist/pages/user.d.ts +6 -1
  91. package/dist/pages/user.js +18 -6
  92. package/dist/pages/user.js.map +1 -1
  93. package/dist/pages/users.js +6 -10
  94. package/dist/pages/users.js.map +1 -1
  95. package/package.json +3 -3
  96. package/src/components/actions-log.tsx +117 -0
  97. package/src/components/audit-sentence.tsx +55 -0
  98. package/src/components/command-palette.tsx +4 -4
  99. package/src/components/connected-apps.tsx +138 -0
  100. package/src/components/delete-place.tsx +180 -0
  101. package/src/components/directory.tsx +266 -110
  102. package/src/components/every-project.tsx +287 -0
  103. package/src/components/expiry-field.tsx +42 -0
  104. package/src/components/folders.tsx +219 -0
  105. package/src/components/grants.tsx +11 -4
  106. package/src/components/icons.tsx +2 -0
  107. package/src/components/missing.tsx +110 -0
  108. package/src/components/offboarding.tsx +62 -34
  109. package/src/components/page.tsx +4 -1
  110. package/src/components/principal-page.tsx +154 -108
  111. package/src/components/principal-picker.tsx +5 -5
  112. package/src/components/principal.tsx +4 -4
  113. package/src/components/references.tsx +323 -0
  114. package/src/components/service-tokens.tsx +112 -93
  115. package/src/components/shell.tsx +11 -32
  116. package/src/components/tabs.tsx +18 -0
  117. package/src/components/trusted-workloads.tsx +97 -79
  118. package/src/components/ui.tsx +8 -1
  119. package/src/index.ts +13 -3
  120. package/src/layout.tsx +2 -2
  121. package/src/lib/access-plan.ts +2 -2
  122. package/src/lib/audit-sentences.ts +161 -77
  123. package/src/lib/changes.ts +77 -5
  124. package/src/lib/coffre.ts +3 -2
  125. package/src/lib/one-time.ts +32 -0
  126. package/src/lib/project-access.ts +11 -23
  127. package/src/lib/project-page.ts +14 -0
  128. package/src/lib/queries.ts +126 -32
  129. package/src/lib/search.ts +25 -0
  130. package/src/lib/signin-errors.ts +45 -1
  131. package/src/lib/validation.ts +14 -0
  132. package/src/options.ts +187 -42
  133. package/src/pages/account.tsx +176 -133
  134. package/src/pages/approval.tsx +197 -0
  135. package/src/pages/audit.tsx +9 -61
  136. package/src/pages/environment.tsx +585 -286
  137. package/src/pages/login.tsx +8 -2
  138. package/src/pages/oauth-authorize.tsx +233 -0
  139. package/src/pages/project-access.tsx +219 -0
  140. package/src/pages/project-environments.tsx +582 -0
  141. package/src/pages/project-settings.tsx +259 -0
  142. package/src/pages/project.tsx +52 -879
  143. package/src/pages/projects.tsx +55 -18
  144. package/src/pages/service-account.tsx +50 -0
  145. package/src/pages/{tokens.tsx → service-accounts.tsx} +9 -6
  146. package/src/pages/settings.tsx +62 -8
  147. package/src/pages/user.tsx +16 -4
  148. package/src/pages/users.tsx +2 -2
  149. package/src/parity.ts +160 -0
  150. package/src/register.ts +57 -10
  151. package/src/router.tsx +4 -0
  152. package/src/shared/models.ts +6 -2
  153. package/src/styles/globals.css +536 -31
  154. package/dist/chunks/directory-CSjWWUQ1.js.map +0 -1
  155. package/dist/chunks/grants-saMQagmG.js +0 -160
  156. package/dist/chunks/grants-saMQagmG.js.map +0 -1
  157. package/dist/chunks/icons-D-PfAfnH.js +0 -203
  158. package/dist/chunks/icons-D-PfAfnH.js.map +0 -1
  159. package/dist/chunks/offboarding-C6l30DZR.js +0 -263
  160. package/dist/chunks/offboarding-C6l30DZR.js.map +0 -1
  161. package/dist/chunks/page-C5HcNqf2.js +0 -190
  162. package/dist/chunks/page-C5HcNqf2.js.map +0 -1
  163. package/dist/chunks/principal-page-D_91OA0l.js.map +0 -1
  164. package/dist/chunks/queries-CQ81o4so.js.map +0 -1
  165. package/dist/chunks/signin-errors-BEFlVDbQ.js +0 -30
  166. package/dist/chunks/signin-errors-BEFlVDbQ.js.map +0 -1
  167. package/dist/chunks/ui-DixXLQvQ.js.map +0 -1
  168. package/dist/chunks/use-action-CWsg_YWU.js +0 -49
  169. package/dist/chunks/use-action-CWsg_YWU.js.map +0 -1
  170. package/dist/chunks/use-change-c6CeLRin.js.map +0 -1
  171. package/dist/chunks/validation-BQtqPe2V.js +0 -29
  172. package/dist/chunks/validation-BQtqPe2V.js.map +0 -1
  173. package/dist/pages/token.d.ts +0 -3
  174. package/dist/pages/token.js.map +0 -1
  175. package/dist/pages/tokens.d.ts +0 -3
  176. package/dist/pages/tokens.js +0 -39
  177. package/dist/pages/tokens.js.map +0 -1
  178. package/dist/project-BqIy8gYR.d.ts +0 -5
  179. package/src/lib/instance.ts +0 -13
  180. 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;
@@ -242,10 +338,6 @@ export declare const audit: {
242
338
  }[];
243
339
  })>;
244
340
  };
245
- /** `/access`: the access page became the users page, and old links land there. */
246
- export declare const access: {
247
- beforeLoad: () => never;
248
- };
249
341
  /** `/users`. */
250
342
  export declare const users: {
251
343
  loader: ({ context }: Loader) => Promise<{
@@ -263,37 +355,90 @@ export declare const users: {
263
355
  }[];
264
356
  })>;
265
357
  };
266
- /** `/users/$user`. */
358
+ /** `/users/$user`, the layout of a user's tabs: who they are to the instance, for owners. */
267
359
  export declare const user: {
268
360
  loader: ({ context, params }: Loader<{
269
361
  user: string;
270
- }>) => Promise<void>;
271
- };
272
- /** `/tokens`. */
273
- export declare const tokens: {
274
- loader: ({ context }: Loader) => Promise<{
362
+ }>) => Promise<{
275
363
  ok: false;
276
364
  error: string;
277
365
  signedOut: boolean;
278
366
  } | ({
279
367
  ok: true;
280
368
  } & {
281
- principals: DirectoryPrincipal[];
282
- removed: {
369
+ report: {
283
370
  principalType: "service" | "user";
284
371
  principalId: string;
285
- toRotate: number;
286
- }[];
287
- })>;
372
+ status: "active" | "removed" | "tampered";
373
+ instanceRole: "owner" | "root-admin" | "user";
374
+ isRootAdmin: boolean;
375
+ removedAt: string | null;
376
+ removedBy: string | null;
377
+ live: {
378
+ grants: number;
379
+ sessions: number;
380
+ tokens: number;
381
+ identities: number;
382
+ apps: number;
383
+ };
384
+ exposed: {
385
+ project: string;
386
+ environment: string;
387
+ key: string;
388
+ version: number;
389
+ how: "read" | "wrote";
390
+ at: string;
391
+ }[];
392
+ rotated: number;
393
+ issuedTokens: {
394
+ id: string;
395
+ service: string;
396
+ label: string | null;
397
+ hint: string;
398
+ expiresAt: string;
399
+ lastUsedAt: string | null;
400
+ }[];
401
+ apps: {
402
+ id: string;
403
+ name: string;
404
+ host: string | null;
405
+ registration: "cimd" | "dcr";
406
+ scopes: ("browse" | "manage-access" | "read-values" | "write")[];
407
+ createdAt: string;
408
+ lastUsedAt: string | null;
409
+ lastUsedIp: string | null;
410
+ expiresAt: string;
411
+ }[];
412
+ references: {
413
+ id: string;
414
+ holder: string;
415
+ source: string;
416
+ state: "broken" | "live" | "replaced" | "source_archived" | "source_deleted" | "source_empty" | "source_is_reference";
417
+ version: number | null;
418
+ createdBy: string;
419
+ createdAt: string;
420
+ endedBy: string | null;
421
+ endedAt: string | null;
422
+ }[];
423
+ };
424
+ }) | ({
425
+ ok: true;
426
+ } & {
427
+ report: null;
428
+ }) | null>;
429
+ };
430
+ /** `/users/$user/`, their access on every project where you manage it. */
431
+ export declare const userAccess: {
432
+ loader: ({ context }: Loader) => Promise<void>;
288
433
  };
289
- /** `/tokens/$token`. */
290
- export declare const token: {
434
+ /** `/users/$user/activity`, for whoever reads the audit log; the others are sent to the first tab. */
435
+ export declare const userActivity: {
291
436
  loader: ({ context, params }: Loader<{
292
- token: string;
437
+ user: string;
293
438
  }>) => Promise<void>;
294
439
  };
295
- /** `/settings`. */
296
- export declare const settings: {
440
+ /** `/service-accounts`. */
441
+ export declare const serviceAccounts: {
297
442
  loader: ({ context }: Loader) => Promise<{
298
443
  ok: false;
299
444
  error: string;
@@ -309,6 +454,102 @@ export declare const settings: {
309
454
  }[];
310
455
  })>;
311
456
  };
457
+ /** `/service-accounts/$account`, the layout of a service account's tabs: who it is to the instance, for owners. */
458
+ export declare const serviceAccount: {
459
+ loader: ({ context, params }: Loader<{
460
+ account: string;
461
+ }>) => Promise<{
462
+ ok: false;
463
+ error: string;
464
+ signedOut: boolean;
465
+ } | ({
466
+ ok: true;
467
+ } & {
468
+ report: {
469
+ principalType: "service" | "user";
470
+ principalId: string;
471
+ status: "active" | "removed" | "tampered";
472
+ instanceRole: "owner" | "root-admin" | "user";
473
+ isRootAdmin: boolean;
474
+ removedAt: string | null;
475
+ removedBy: string | null;
476
+ live: {
477
+ grants: number;
478
+ sessions: number;
479
+ tokens: number;
480
+ identities: number;
481
+ apps: number;
482
+ };
483
+ exposed: {
484
+ project: string;
485
+ environment: string;
486
+ key: string;
487
+ version: number;
488
+ how: "read" | "wrote";
489
+ at: string;
490
+ }[];
491
+ rotated: number;
492
+ issuedTokens: {
493
+ id: string;
494
+ service: string;
495
+ label: string | null;
496
+ hint: string;
497
+ expiresAt: string;
498
+ lastUsedAt: string | null;
499
+ }[];
500
+ apps: {
501
+ id: string;
502
+ name: string;
503
+ host: string | null;
504
+ registration: "cimd" | "dcr";
505
+ scopes: ("browse" | "manage-access" | "read-values" | "write")[];
506
+ createdAt: string;
507
+ lastUsedAt: string | null;
508
+ lastUsedIp: string | null;
509
+ expiresAt: string;
510
+ }[];
511
+ references: {
512
+ id: string;
513
+ holder: string;
514
+ source: string;
515
+ state: "broken" | "live" | "replaced" | "source_archived" | "source_deleted" | "source_empty" | "source_is_reference";
516
+ version: number | null;
517
+ createdBy: string;
518
+ createdAt: string;
519
+ endedBy: string | null;
520
+ endedAt: string | null;
521
+ }[];
522
+ };
523
+ }) | ({
524
+ ok: true;
525
+ } & {
526
+ report: null;
527
+ }) | null>;
528
+ };
529
+ /**
530
+ * `/service-accounts/$account/`, how it signs in: its trusted workloads and
531
+ * bearer tokens. Only an owner manages them, and only while it is active;
532
+ * anyone else is sent to its access.
533
+ */
534
+ export declare const serviceAccountSignIn: {
535
+ loader: ({ context, params }: Loader<{
536
+ account: string;
537
+ }>) => Promise<void>;
538
+ };
539
+ /** `/service-accounts/$account/access`. */
540
+ export declare const serviceAccountAccess: {
541
+ loader: ({ context }: Loader) => Promise<void>;
542
+ };
543
+ /** `/service-accounts/$account/activity`, as a user's. */
544
+ export declare const serviceAccountActivity: {
545
+ loader: ({ context, params }: Loader<{
546
+ account: string;
547
+ }>) => Promise<void>;
548
+ };
549
+ /** `/settings`. */
550
+ export declare const settings: {
551
+ loader: ({ context }: Loader) => Promise<void>;
552
+ };
312
553
  type AccountSearch = {
313
554
  linked?: string;
314
555
  error?: string;
@@ -320,10 +561,7 @@ export declare const account: {
320
561
  };
321
562
  /** `/login`. */
322
563
  export declare const login: {
323
- validateSearch: (search: Record<string, unknown>) => {
324
- next?: string;
325
- error?: string;
326
- };
564
+ validateSearch: typeof loginSearch;
327
565
  loader: ({ context }: Loader) => Promise<void>;
328
566
  };
329
567
  /** `/unregistered`. */
@@ -366,6 +604,122 @@ export declare const deviceLogin: {
366
604
  error: string;
367
605
  } | null>;
368
606
  };
607
+ /**
608
+ * `/approvals/$approval`: a change an MCP client asked for, which its person
609
+ * decides here. Its own read: the page shows what the change would do now.
610
+ */
611
+ export declare const approval: {
612
+ loader: ({ context, params, location }: Loader<{
613
+ approval: string;
614
+ }>) => Promise<{
615
+ ok: false;
616
+ error: string;
617
+ signedOut: boolean;
618
+ } | ({
619
+ ok: true;
620
+ } & {
621
+ approval: {
622
+ id: string;
623
+ status: "approved" | "cancelled" | "denied" | "expired" | "failed" | "pending";
624
+ client: {
625
+ name: string;
626
+ host: string | null;
627
+ registration: "cimd" | "dcr";
628
+ };
629
+ tool: string;
630
+ summary: string;
631
+ details: {
632
+ label: string;
633
+ value: string;
634
+ kind?: "mono" | "time";
635
+ }[];
636
+ asks: null | {
637
+ value: {
638
+ label: string;
639
+ note: string;
640
+ };
641
+ };
642
+ kind: "change" | "reveal";
643
+ digest: string;
644
+ createdAt: string;
645
+ expiresAt: string;
646
+ outcome: null | {
647
+ text: string;
648
+ result?: {
649
+ [key: string]: unknown;
650
+ };
651
+ error?: string;
652
+ };
653
+ };
654
+ })>;
655
+ };
656
+ type AuthorizationSearch = RouteInput<'GET /oauth/authorizations'>;
657
+ /**
658
+ * `/oauth/authorize`: an MCP client asking to connect. Its parameters go to
659
+ * the API as sent, which says which it takes; the router keeps them strings,
660
+ * so a `state` of `1e5` goes back as `1e5`.
661
+ */
662
+ export declare const oauthAuthorize: {
663
+ validateSearch: (search: Record<string, unknown>) => AuthorizationSearch;
664
+ loaderDeps: ({ search }: {
665
+ search: AuthorizationSearch;
666
+ }) => {
667
+ request: {
668
+ client_id?: string;
669
+ redirect_uri?: string;
670
+ response_type?: string;
671
+ code_challenge?: string;
672
+ code_challenge_method?: string;
673
+ state?: string;
674
+ scope?: string;
675
+ resource?: string;
676
+ };
677
+ };
678
+ loader: ({ context, deps, location }: Loader & {
679
+ deps: {
680
+ request: AuthorizationSearch;
681
+ };
682
+ }) => Promise<{
683
+ request: {
684
+ client_id?: string;
685
+ redirect_uri?: string;
686
+ response_type?: string;
687
+ code_challenge?: string;
688
+ code_challenge_method?: string;
689
+ state?: string;
690
+ scope?: string;
691
+ resource?: string;
692
+ };
693
+ email: string;
694
+ result: {
695
+ ok: false;
696
+ error: string;
697
+ signedOut: boolean;
698
+ } | ({
699
+ ok: true;
700
+ } & ({
701
+ status: "invalid";
702
+ message: string;
703
+ } | {
704
+ status: "refused";
705
+ message: string;
706
+ redirect: string;
707
+ } | {
708
+ status: "ready";
709
+ client: {
710
+ id: string;
711
+ name: string;
712
+ host: string | null;
713
+ registration: "cimd" | "dcr";
714
+ };
715
+ redirectHost: string;
716
+ loopbackOnly: boolean;
717
+ scopes: ("browse" | "manage-access" | "read-values" | "write")[];
718
+ connections: ("browse" | "manage-access" | "read-values" | "write")[][];
719
+ days: number;
720
+ }));
721
+ }>;
722
+ };
369
723
  //#endregion
370
724
  //#region src/router.d.ts
371
725
  /**