ankka-console 0.11.0 → 0.13.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 (39) hide show
  1. package/dist/ankka-mark.png +0 -0
  2. package/dist/client/control-plane.d.ts +63 -1
  3. package/dist/client/control-plane.js +142 -1
  4. package/dist/client/schemas.d.ts +1460 -2
  5. package/dist/client/schemas.js +462 -2
  6. package/dist/context.d.ts +1 -1
  7. package/dist/context.js +1 -1
  8. package/dist/extensions/types.d.ts +1 -1
  9. package/dist/extensions/types.js +22 -0
  10. package/dist/routes/front.d.ts +76 -2
  11. package/dist/routes/front.js +37 -8
  12. package/dist/routes/logs.d.ts +67 -0
  13. package/dist/routes/machines.d.ts +78 -0
  14. package/dist/routes/machines.js +78 -0
  15. package/dist/routes/organization.d.ts +29 -1
  16. package/dist/routes/organization.js +27 -5
  17. package/dist/routes/project.d.ts +285 -1
  18. package/dist/routes/project.js +107 -6
  19. package/dist/routes/service-history.d.ts +2 -0
  20. package/dist/routes/service-history.js +3 -0
  21. package/dist/routes/service-topology.d.ts +67 -0
  22. package/dist/routes/service.d.ts +67 -0
  23. package/dist/routes/service.js +64 -4
  24. package/dist/routes.js +1 -0
  25. package/dist/runtime.d.ts +3 -1
  26. package/dist/runtime.js +1 -0
  27. package/dist/styles.css +1 -1
  28. package/dist/testing/fake-control-plane.d.ts +193 -1
  29. package/dist/testing/fake-control-plane.js +840 -7
  30. package/dist/ui/buckets.d.ts +14 -0
  31. package/dist/ui/buckets.js +9 -0
  32. package/dist/ui/grants.d.ts +3 -0
  33. package/dist/ui/grants.js +13 -0
  34. package/dist/ui/shell.d.ts +1 -1
  35. package/dist/ui/shell.js +14 -3
  36. package/dist/ui/topology/Table.d.ts +8 -0
  37. package/dist/ui/topology/Table.js +8 -1
  38. package/dist/ui/use-stream.d.ts +134 -0
  39. package/package.json +1 -1
@@ -44,6 +44,49 @@ export const whoamiSchema = z.object({
44
44
  platformAdmin: z.boolean().default(false),
45
45
  organizations: z.array(organizationMembershipSchema).default([]),
46
46
  });
47
+ /** The installation's cloud: its provider, account and location, and its key for an owner alone. */
48
+ export const cloudInstallationSchema = z.object({
49
+ provider: z.string(),
50
+ account: z.string(),
51
+ location: z.string(),
52
+ kmsKey: optional(z.string()),
53
+ });
54
+ /** Where the installation keeps its secrets, and how long the record of reads is kept (feature 038). */
55
+ export const installationSecretsSchema = z.object({
56
+ backend: z.string(),
57
+ recordRetention: z.string(),
58
+ auditLog: z.string().default("unknown"),
59
+ });
60
+ /** One model the installation's model server declares: its state, and its digest once served (feature 053). */
61
+ export const modelLineSchema = z.object({
62
+ name: z.string(),
63
+ state: z.string(),
64
+ digest: optional(z.string()),
65
+ detail: optional(z.string()),
66
+ });
67
+ /** One cluster's model server, read live through its door. */
68
+ export const clusterModelsSchema = z.object({
69
+ cluster: z.string(),
70
+ server: z.string(),
71
+ ready: z.boolean(),
72
+ models: z.array(modelLineSchema).default([]),
73
+ detail: optional(z.string()),
74
+ });
75
+ export const installationModelsSchema = z.object({
76
+ clusters: z.array(clusterModelsSchema),
77
+ });
78
+ /**
79
+ * `GET /installation`: the platform's version, and its cloud when it names a provider; and its
80
+ * backups (feature 041); where it keeps its secrets (feature 038); and its model server (feature 053).
81
+ */
82
+ export const installationSchema = z.object({
83
+ platformVersion: z.string(),
84
+ cloud: optional(cloudInstallationSchema),
85
+ // Lazily: its schema is with the other backup schemas, below.
86
+ backups: optional(z.lazy(() => installationStatusSchema)),
87
+ secrets: optional(installationSecretsSchema),
88
+ models: optional(installationModelsSchema),
89
+ });
47
90
  export const quotaSchema = z.object({
48
91
  projects: optional(z.number().int()),
49
92
  services: optional(z.number().int()),
@@ -95,6 +138,53 @@ export const mountStatusSchema = z.object({
95
138
  service: z.string(),
96
139
  state: z.string().default(""),
97
140
  });
141
+ /** One name in a move of a service's secrets to Secret Manager, and how the two compare. */
142
+ export const secretMoveNameSchema = z.object({ name: z.string(), state: z.string() });
143
+ /** What a move of a service's secrets did when its instance started; names and states, never a value. */
144
+ export const secretMoveReportSchema = z.object({
145
+ phase: z.string(),
146
+ outcome: z.string(),
147
+ names: z.array(secretMoveNameSchema).default([]),
148
+ detail: optional(z.string()),
149
+ });
150
+ /** Where a service's instance keeps its secrets, and what a move of them did. */
151
+ export const secretStoreReportSchema = z.object({
152
+ backend: z.string(),
153
+ keyRead: z.boolean(),
154
+ move: optional(secretMoveReportSchema),
155
+ });
156
+ /** A DNS record a member creates at their provider; the platform writes none. */
157
+ export const dnsRecordSchema = z.object({
158
+ name: z.string(),
159
+ kind: z.string(),
160
+ value: z.string(),
161
+ });
162
+ /**
163
+ * One named bucket of a service, as the operator reported it (feature 055): kept ones are those the
164
+ * descriptor no longer names, which the platform never deletes.
165
+ */
166
+ export const bucketReportSchema = z.object({
167
+ name: z.string(),
168
+ phase: z.string(),
169
+ /** `garage` or `gcs`; absent for a supplied bucket. */
170
+ store: optional(z.string()),
171
+ /** Its name in the store. */
172
+ bucket: optional(z.string()),
173
+ /** `private`, `signed`, `public` or `supplied`. */
174
+ exposure: z.string().default("private"),
175
+ /** Where a public or signed bucket is on the internet. */
176
+ publicAddress: optional(z.string()),
177
+ kept: z.boolean().default(false),
178
+ detail: optional(z.string()),
179
+ });
180
+ /** One custom hostname of a service: where it stands, and the record that points it at the installation. */
181
+ export const customHostnameSchema = z.object({
182
+ hostname: z.string(),
183
+ state: z.string().default("pending"),
184
+ reason: optional(z.string()),
185
+ record: optional(dnsRecordSchema),
186
+ note: optional(z.string()),
187
+ });
98
188
  export const serviceStatusSchema = z.object({
99
189
  name: z.string(),
100
190
  projectId: z.string(),
@@ -118,13 +208,47 @@ export const serviceStatusSchema = z.object({
118
208
  broker: optional(z.string()),
119
209
  /** Topics the service's components use that its project does not declare; absent when not read. */
120
210
  undeclaredTopics: optional(z.array(z.string())),
211
+ /** Where the service keeps its secrets, and what a move of them did, from its instances; absent when not read. */
212
+ secretStore: optional(secretStoreReportSchema),
121
213
  /** Each side the service takes on a declared topic with a contract, checked against it; absent when not read. */
122
214
  topicChecks: optional(z.array(z.lazy(() => topicCheckSchema))),
123
215
  /** Each topic source of the service with how far behind it is, from its instances; absent when not read. */
124
216
  topicSources: optional(z.array(z.lazy(() => topicSourceReportSchema))),
217
+ /** What a member should know and need not act on, worked out from the project's declarations now. */
218
+ warnings: optional(z.array(z.lazy(() => serviceWarningSchema))),
125
219
  objectStorage: optional(z.string()),
126
220
  bucket: optional(z.string()),
127
221
  bucketAddress: optional(z.string()),
222
+ /** Which store the bucket is in, `garage` or `gcs`, as the operator reported it. */
223
+ objectStore: optional(z.string()),
224
+ /** The bucket's location, in Google Cloud Storage. */
225
+ bucketLocation: optional(z.string()),
226
+ /** How many days the bucket keeps a deleted object, in Google Cloud Storage. */
227
+ softDeleteDays: optional(z.number().int()),
228
+ /** Where a move of the bucket from Garage is, as a phrase; its detail is in `detail`. */
229
+ storageMove: optional(z.string()),
230
+ /** Each named bucket, in the descriptor's order, then the kept ones (feature 055); absent when none. */
231
+ buckets: optional(z.array(bucketReportSchema)),
232
+ /** The project database cluster the service is on, when a member switched it to a restore. */
233
+ databaseCluster: optional(z.string()),
234
+ /** `mounted` when the service's instances read their project's grants (feature 040). */
235
+ grants: optional(z.string()),
236
+ /** Each other project's topic the service uses, and whether that project grants it; absent when not read. */
237
+ crossProjectTopics: optional(z.array(z.lazy(() => crossProjectTopicSchema))),
238
+ /** Names under domains the project's owner brings, served beside the derived hostname. */
239
+ customHostnames: z.array(customHostnameSchema).default([]),
240
+ /** The TXT record that proves the project controls a name it brings; on a read of one service. */
241
+ proofRecord: optional(dnsRecordSchema),
242
+ });
243
+ /** `POST /services/{project}/{name}/storage/move`: how long the service's writes may be paused. */
244
+ export const storageMoveRequestSchema = z.object({ writePauseBound: optional(z.string()) });
245
+ /** `PUT /projects/{id}/location`. */
246
+ export const setProjectLocationSchema = z.object({ location: z.string() });
247
+ export const crossProjectTopicSchema = z.object({
248
+ project: z.string(),
249
+ topic: z.string(),
250
+ right: z.string(),
251
+ status: z.string(),
128
252
  });
129
253
  export const historyActorSchema = z.object({
130
254
  subject: z.string(),
@@ -139,8 +263,12 @@ export const historyEntrySchema = z.object({
139
263
  /** On an entry that recorded a descriptor: its image, and a digest two such entries share exactly when the descriptors are the same. */
140
264
  image: optional(z.string()),
141
265
  digest: optional(z.string()),
266
+ /** On a custom hostname's entry: the name it added or removed. */
267
+ hostname: optional(z.string()),
142
268
  /** On a rollback: the generation whose descriptor was applied again. */
143
269
  rolledBackTo: optional(z.number().int()),
270
+ /** What else the entry says: for a switch, which cluster the service left and which it is on. */
271
+ detail: optional(z.string()),
144
272
  });
145
273
  export const rollbackRequestSchema = z.object({ generation: optional(z.number().int()) });
146
274
  export const rolledBackSchema = z.object({ rolledBackTo: z.number().int(), status: serviceStatusSchema });
@@ -290,12 +418,37 @@ export const topicCheckSchema = z.object({
290
418
  });
291
419
  /**
292
420
  * `PUT /projects/{id}/topics/{name}`: the partitions a declared topic has, whether the broker keeps
293
- * only the last message under each key, and the contract it carries with its schema document.
421
+ * only the last message under each key, and the contract it carries with its schema document; and
422
+ * how long it keeps, how it is cleaned and how many copies it has, each in the words a member types.
423
+ * A new topic needs its partitions and takes every setting left out from the installation; a topic
424
+ * already declared keeps what is left out. `removes` restates what a change that removes messages
425
+ * removes, in the control plane's own words.
294
426
  */
295
427
  export const topicDeclarationRequestSchema = z.object({
296
- partitions: z.number().int(),
428
+ partitions: optional(z.number().int()),
297
429
  compacted: z.boolean().default(false),
298
430
  contract: optional(z.object({ name: z.string(), schema: z.unknown() })),
431
+ retention: optional(z.string()),
432
+ retentionSize: optional(z.string()),
433
+ cleanup: optional(z.string()),
434
+ tombstoneWindow: optional(z.string()),
435
+ minCompactionLag: optional(z.string()),
436
+ maxCompactionLag: optional(z.string()),
437
+ copies: optional(z.number().int()),
438
+ minInSync: optional(z.number().int()),
439
+ removes: optional(z.string()),
440
+ });
441
+ /** A declared topic's every setting in words, and the ones the installation supplied. */
442
+ export const topicSettingsViewSchema = z.object({
443
+ retention: z.string(),
444
+ retentionSize: z.string(),
445
+ cleanup: z.string(),
446
+ tombstoneWindow: z.string(),
447
+ minCompactionLag: z.string(),
448
+ maxCompactionLag: z.string(),
449
+ copies: optional(z.number().int()),
450
+ minInSync: optional(z.number().int()),
451
+ defaulted: z.array(z.string()).default([]),
299
452
  });
300
453
  /** A topic a project declares, and how far the platform has got with it. */
301
454
  export const projectTopicSchema = z.object({
@@ -306,6 +459,37 @@ export const projectTopicSchema = z.object({
306
459
  compacted: z.boolean().default(false),
307
460
  contract: optional(contractSchema),
308
461
  checks: z.array(topicCheckSchema).default([]),
462
+ settings: optional(topicSettingsViewSchema),
463
+ /** How many copies the broker holds, as the operator last saw. */
464
+ copiesHeld: optional(z.number().int()),
465
+ /** How many broker nodes the installation's broker has. */
466
+ brokerNodes: optional(z.number().int()),
467
+ });
468
+ /** One setting a declaration changed, from what to what. */
469
+ export const settingChangeSchema = z.object({
470
+ setting: z.string(),
471
+ from: z.string(),
472
+ to: z.string(),
473
+ });
474
+ /** Where a partition begins on the broker, and when that message was published. */
475
+ export const partitionGapReportSchema = z.object({
476
+ partition: z.number().int(),
477
+ beginning: z.number().int(),
478
+ earliestRetained: optional(z.string()),
479
+ });
480
+ /** What a topic source's topic no longer holds, per partition, and whether earlier messages are gone. */
481
+ export const retentionGapReportSchema = z.object({
482
+ partitions: z.array(partitionGapReportSchema),
483
+ compacted: z.boolean().default(false),
484
+ gone: z.boolean().default(false),
485
+ readAt: optional(z.string()),
486
+ });
487
+ /** Something about a service a member should know: a view over a topic that keeps too little. */
488
+ export const serviceWarningSchema = z.object({
489
+ kind: z.string(),
490
+ component: z.string(),
491
+ topic: z.string(),
492
+ message: z.string(),
309
493
  });
310
494
  /**
311
495
  * A topic source as a service's instances report it: what reads which topic under which group, the
@@ -325,6 +509,8 @@ export const topicSourceReportSchema = z.object({
325
509
  contract: optional(z.string()),
326
510
  lag: optional(z.number().int()),
327
511
  failing: optional(z.string()),
512
+ /** What the broker still holds of the topic, per partition. */
513
+ gap: optional(retentionGapReportSchema),
328
514
  });
329
515
  /** `PUT /projects/{id}/brokers/{name}`: a broker declared beside the installation's, and how it is reached. */
330
516
  export const brokerDeclarationRequestSchema = z.object({
@@ -347,11 +533,262 @@ export const projectSecretSummarySchema = z.object({
347
533
  setAt: optional(z.string()),
348
534
  setBy: optional(z.string()),
349
535
  });
536
+ /** The record of one read, keep or removal of a service secret: never its value. */
537
+ export const readRecordSchema = z.object({
538
+ at: z.string(),
539
+ project: z.string(),
540
+ service: z.string(),
541
+ hosting: z.string(),
542
+ name: z.string(),
543
+ operation: z.string(),
544
+ outcome: z.string(),
545
+ backend: z.string(),
546
+ traceId: optional(z.string()),
547
+ spanId: optional(z.string()),
548
+ component: optional(z.string()),
549
+ componentKind: optional(z.string()),
550
+ latestSkipped: z.boolean().default(false),
551
+ });
552
+ /** The record of a project's secret reads, newest first, as an owner reads it. */
553
+ export const secretReadsPageSchema = z.object({ records: z.array(readRecordSchema).default([]) });
554
+ // ── Backups and recovery (feature 041) ──────────────────────────────────────
555
+ /** One line of history's backups: `phase` is `backing up`, `failing` or `not backed up`. */
556
+ export const backupLineSchema = z.object({
557
+ line: z.string(),
558
+ cluster: z.string(),
559
+ phase: z.string(),
560
+ lastBaseBackup: optional(z.string()),
561
+ firstRestorable: optional(z.string()),
562
+ lastRestorable: optional(z.string()),
563
+ archiveLagSeconds: optional(z.number()),
564
+ failing: optional(z.string()),
565
+ copiedAt: optional(z.string()),
566
+ });
567
+ export const projectDatabaseSchema = z.object({
568
+ cluster: z.string(),
569
+ instances: z.number().int(),
570
+ readyInstances: z.number().int(),
571
+ primary: optional(z.string()),
572
+ synchronous: z.boolean().default(false),
573
+ writesWaitingOn: optional(z.string()),
574
+ });
575
+ /** One of the project's database clusters: `live`, a `restore`, or `left` once every service has left it. */
576
+ export const projectClusterSchema = z.object({
577
+ name: z.string(),
578
+ line: z.string(),
579
+ phase: z.string(),
580
+ services: z.array(z.string()).default([]),
581
+ since: optional(z.string()),
582
+ leftAt: optional(z.string()),
583
+ });
584
+ /** What one service's database holds in a restore or a rehearsal; secrets by name only. */
585
+ export const serviceVerificationSchema = z.object({
586
+ name: z.string(),
587
+ present: z.boolean(),
588
+ journalRows: z.number().int().default(0),
589
+ stateRows: z.number().int().default(0),
590
+ offsetRows: z.number().int().default(0),
591
+ timerRows: z.number().int().default(0),
592
+ highestSequence: z.number().int().default(0),
593
+ changedSecrets: z.array(z.string()).default([]),
594
+ });
595
+ /** A topic past a restore's moment: messages newer than it, and how many of them a group has read. */
596
+ export const topicDivergenceSchema = z.object({
597
+ topic: z.string(),
598
+ group: optional(z.string()),
599
+ after: z.number().int().default(0),
600
+ read: optional(z.number().int()),
601
+ services: z.array(z.string()).default([]),
602
+ });
603
+ /** A restore: `Restoring`, `Verified`, `Failed` or `InUse`, with what each service's database holds. */
604
+ export const restoreViewSchema = z.object({
605
+ name: z.string(),
606
+ line: z.string(),
607
+ moment: z.string(),
608
+ phase: z.string(),
609
+ requestedBy: optional(z.string()),
610
+ requestedAt: optional(z.string()),
611
+ reachedAt: optional(z.string()),
612
+ services: z.array(serviceVerificationSchema).default([]),
613
+ detail: optional(z.string()),
614
+ broker: z.array(topicDivergenceSchema).default([]),
615
+ notAsked: z.array(z.string()).default([]),
616
+ note: optional(z.string()),
617
+ });
618
+ /** A rehearsal: `Running`, `Completed`, `Failed` or `NotRemoved`, and how long it took. */
619
+ export const rehearsalViewSchema = z.object({
620
+ name: z.string(),
621
+ line: z.string(),
622
+ moment: z.string(),
623
+ outcome: z.string(),
624
+ requestedBy: optional(z.string()),
625
+ requestedAt: optional(z.string()),
626
+ elapsedSeconds: optional(z.number().int()),
627
+ detail: optional(z.string()),
628
+ services: z.array(serviceVerificationSchema).default([]),
629
+ });
630
+ export const projectStatusSchema = z.object({
631
+ id: z.string(),
632
+ backedUp: z.boolean(),
633
+ target: z.string(),
634
+ lines: z.array(backupLineSchema).default([]),
635
+ database: optional(projectDatabaseSchema),
636
+ detail: optional(z.string()),
637
+ clusters: z.array(projectClusterSchema).default([]),
638
+ restores: z.array(restoreViewSchema).default([]),
639
+ rehearsal: optional(rehearsalViewSchema),
640
+ });
641
+ export const secondaryStoreSchema = z.object({
642
+ lastCompleted: optional(z.string()),
643
+ lastFailed: optional(z.string()),
644
+ failure: optional(z.string()),
645
+ buckets: optional(z.number().int()),
646
+ deletedObjects: optional(z.number().int()),
647
+ });
648
+ export const installationStatusSchema = z.object({
649
+ backupTarget: z.string(),
650
+ retentionDays: z.number().int(),
651
+ copyRequired: z.boolean(),
652
+ sharesFailureDomain: z.boolean(),
653
+ encryption: z.string(),
654
+ controlPlane: optional(backupLineSchema),
655
+ notBackedUp: optional(z.string()),
656
+ secondaryStore: optional(secondaryStoreSchema),
657
+ });
658
+ export const serviceDifferenceSchema = z.object({
659
+ project: z.string(),
660
+ service: z.string(),
661
+ recordedGeneration: optional(z.number().int()),
662
+ clusterGeneration: optional(z.number().int()),
663
+ recordedImage: optional(z.string()),
664
+ clusterImage: optional(z.string()),
665
+ });
666
+ /** Whether the control plane is held after its own database was restored, and what differs. */
667
+ export const restoreHoldStatusSchema = z.object({
668
+ held: z.boolean(),
669
+ restoredAt: optional(z.string()),
670
+ targetTime: optional(z.string()),
671
+ releasedAt: optional(z.string()),
672
+ releasedBy: optional(z.string()),
673
+ services: z.array(serviceDifferenceSchema).default([]),
674
+ topics: z.array(z.string()).default([]),
675
+ unknownProjects: z.array(z.string()).default([]),
676
+ reconciled: z.array(z.string()).default([]),
677
+ });
678
+ /** `POST /projects/{id}/restores`: the moment, and the line when services are on more than one. */
679
+ export const restoreRequestSchema = z.object({ moment: z.string(), line: optional(z.string()) });
680
+ /** `POST /services/{p}/{n}/switch`: the cluster to move the service to. */
681
+ export const switchRequestSchema = z.object({ cluster: z.string() });
682
+ /** `POST /projects/{id}/rehearsals`: both may be left out, for the latest restorable moment. */
683
+ export const rehearsalRequestSchema = z.object({ moment: optional(z.string()), line: optional(z.string()) });
684
+ export const credentialReissuedSchema = z.object({ project: z.string(), generation: z.number().int() });
685
+ /** What a project asks of its database, whole. */
686
+ export const databaseSettingSchema = z.object({
687
+ replicas: z.number().int().default(0),
688
+ synchronous: z.boolean().default(false),
689
+ retentionDays: optional(z.number().int()),
690
+ rehearse: optional(z.string()),
691
+ });
692
+ /**
693
+ * Who did what to a project: to its database, or to the topic `topic` names, with each setting it
694
+ * changed (feature 043).
695
+ */
696
+ export const projectHistoryViewSchema = z.object({
697
+ kind: z.string(),
698
+ by: optional(z.string()),
699
+ at: optional(z.string()),
700
+ detail: optional(z.string()),
701
+ topic: optional(z.string()),
702
+ changes: z.array(settingChangeSchema).default([]),
703
+ });
704
+ // ── Grants and machines (feature 040) ───────────────────────────────────────
705
+ /** What a grant opens: one route, one gRPC method, one topic with one right, or the erasure. */
706
+ export const grantTargetSchema = z.object({
707
+ kind: z.string(),
708
+ service: optional(z.string()),
709
+ method: optional(z.string()),
710
+ path: optional(z.string()),
711
+ topic: optional(z.string()),
712
+ right: optional(z.string()),
713
+ decrypt: z.boolean().default(false),
714
+ });
715
+ /** Who did something to a grant, and when. */
716
+ export const grantActSchema = z.object({
717
+ by: optional(z.string()),
718
+ at: optional(z.string()),
719
+ });
720
+ export const grantRequestSchema = z.object({
721
+ grantee: z.string(),
722
+ target: grantTargetSchema,
723
+ });
724
+ /** A grant as its project lists it; `effect` is `in effect`, or why not. */
725
+ export const grantDetailSchema = z.object({
726
+ id: z.string(),
727
+ grantee: z.string(),
728
+ target: grantTargetSchema,
729
+ state: z.string(),
730
+ effect: z.string(),
731
+ granted: grantActSchema,
732
+ answered: optional(grantActSchema),
733
+ ended: optional(grantActSchema),
734
+ });
735
+ export const grantChangeRecordSchema = z.object({
736
+ change: z.string(),
737
+ by: optional(z.string()),
738
+ at: optional(z.string()),
739
+ });
740
+ export const topicSettingsSchema = z.object({
741
+ partitions: z.number().int(),
742
+ compacted: z.boolean().default(false),
743
+ retention: optional(z.string()),
744
+ copies: optional(z.number().int()),
745
+ });
746
+ /** A grant as its grantee's side records it. */
747
+ export const receivedGrantDetailSchema = z.object({
748
+ id: z.string(),
749
+ grantingProject: z.string(),
750
+ grantingOrganization: z.string(),
751
+ grantee: z.string(),
752
+ target: grantTargetSchema,
753
+ state: z.string(),
754
+ changes: z.array(grantChangeRecordSchema).default([]),
755
+ topic: optional(topicSettingsSchema),
756
+ });
757
+ export const machineRegistrationSchema = z.object({ name: z.string() });
758
+ /** A machine just registered: its secret, shown this once. */
759
+ export const machineRegisteredSchema = z.object({
760
+ name: z.string(),
761
+ clientId: z.string(),
762
+ clientSecret: z.string(),
763
+ tokenUrl: z.string(),
764
+ brokerBootstrap: optional(z.string()),
765
+ });
766
+ export const byteRatesRequestSchema = z.object({
767
+ produceBytesPerSecond: z.number().int(),
768
+ consumeBytesPerSecond: z.number().int(),
769
+ requestPercentage: z.number().int(),
770
+ });
771
+ export const machineSummarySchema = z.object({
772
+ name: z.string(),
773
+ clientId: z.string(),
774
+ registeredBy: optional(z.string()),
775
+ registeredAt: optional(z.string()),
776
+ byteRates: optional(byteRatesRequestSchema),
777
+ });
778
+ export const tokenResponseSchema = z.object({
779
+ access_token: z.string(),
780
+ token_type: z.string(),
781
+ expires_in: z.number().int(),
782
+ });
783
+ export const jsonWebKeySetSchema = z.object({
784
+ keys: z.array(z.object({ kty: z.string(), use: z.string(), alg: z.string(), kid: z.string(), n: z.string(), e: z.string() })),
785
+ });
350
786
  /** Every schema by the Scala type's name, as the fixture files name them. */
351
787
  export const schemasByType = {
352
788
  AuthDiscovery: authDiscoverySchema,
353
789
  OrganizationMembership: organizationMembershipSchema,
354
790
  Whoami: whoamiSchema,
791
+ Installation: installationSchema,
355
792
  Quota: quotaSchema,
356
793
  Usage: usageSchema,
357
794
  OrganizationDetail: organizationDetailSchema,
@@ -364,6 +801,8 @@ export const schemasByType = {
364
801
  HistoryActor: historyActorSchema,
365
802
  HistoryEntry: historyEntrySchema,
366
803
  RollbackRequest: rollbackRequestSchema,
804
+ StorageMoveRequest: storageMoveRequestSchema,
805
+ SetProjectLocation: setProjectLocationSchema,
367
806
  RolledBack: rolledBackSchema,
368
807
  InstanceLogs: instanceLogsSchema,
369
808
  LogsResponse: logsResponseSchema,
@@ -392,4 +831,25 @@ export const schemasByType = {
392
831
  Contract: contractSchema,
393
832
  BrokerDeclarationRequest: brokerDeclarationRequestSchema,
394
833
  ProjectBroker: projectBrokerSchema,
834
+ SecretReadsPage: secretReadsPageSchema,
835
+ ProjectStatus: projectStatusSchema,
836
+ InstallationStatus: installationStatusSchema,
837
+ RestoreRequest: restoreRequestSchema,
838
+ RestoreView: restoreViewSchema,
839
+ SwitchRequest: switchRequestSchema,
840
+ ProjectHistoryView: projectHistoryViewSchema,
841
+ DatabaseSetting: databaseSettingSchema,
842
+ RehearsalRequest: rehearsalRequestSchema,
843
+ RehearsalView: rehearsalViewSchema,
844
+ RestoreHoldStatus: restoreHoldStatusSchema,
845
+ CredentialReissued: credentialReissuedSchema,
846
+ GrantRequest: grantRequestSchema,
847
+ GrantDetail: grantDetailSchema,
848
+ ReceivedGrantDetail: receivedGrantDetailSchema,
849
+ MachineRegistration: machineRegistrationSchema,
850
+ MachineRegistered: machineRegisteredSchema,
851
+ MachineSummary: machineSummarySchema,
852
+ ByteRatesRequest: byteRatesRequestSchema,
853
+ TokenResponse: tokenResponseSchema,
854
+ JsonWebKeySet: jsonWebKeySetSchema,
395
855
  };
package/dist/context.d.ts CHANGED
@@ -70,7 +70,7 @@ export interface ActionRefusal {
70
70
  export declare function act<T>(ctx: ConsoleContext, intent: string, form: FormData, work: () => Promise<T>): Promise<T | ReturnType<typeof data<ActionRefusal>>>;
71
71
  export declare const text: (form: FormData, name: string) => string;
72
72
  /** The rail's areas, in the order it shows them. */
73
- export declare const areas: readonly ["organizations", "projects", "services", "members", "tokens"];
73
+ export declare const areas: readonly ["organizations", "projects", "services", "members", "tokens", "machines"];
74
74
  export type Area = (typeof areas)[number];
75
75
  export interface Crumb {
76
76
  label: string;
package/dist/context.js CHANGED
@@ -144,7 +144,7 @@ export const text = (form, name) => {
144
144
  return typeof v === "string" ? v.trim() : "";
145
145
  };
146
146
  /** The rail's areas, in the order it shows them. */
147
- export const areas = ["organizations", "projects", "services", "members", "tokens"];
147
+ export const areas = ["organizations", "projects", "services", "members", "tokens", "machines"];
148
148
  const byName = (a, b) => a.name.localeCompare(b.name);
149
149
  /** The listing of a project's services, in name order, marking the one being read. */
150
150
  export function servicesListing(project, services, current) {
@@ -1,7 +1,7 @@
1
1
  import type { ComponentType } from "react";
2
2
  import type { OrganizationSummary, ProjectDetail, ServiceStatus } from "../client/schemas.ts";
3
3
  /** Every operation the console offers, by the name a host uses to add beside it or hide it. */
4
- export declare const operations: readonly ["organization.create", "organization.rename", "organization.delete", "organization.disable", "organization.enable", "organization.quota.set", "organization.quota.clear", "member.invite", "member.role", "member.remove", "invitation.withdraw", "member.repair", "token.create", "token.revoke", "project.create", "project.rename", "project.delete", "registry.set", "registry.clear", "project-secret.set", "project-secret.unset", "project-topic.set", "project-topic.unset", "project-broker.set", "project-broker.unset", "service.apply", "service.pause", "service.resume", "service.restart", "service.rollback", "service.expose", "service.unexpose", "service.delete", "service.logs"];
4
+ export declare const operations: readonly ["organization.create", "organization.rename", "organization.delete", "organization.disable", "organization.enable", "organization.quota.set", "organization.quota.clear", "member.invite", "member.role", "member.remove", "invitation.withdraw", "member.repair", "token.create", "token.revoke", "machine.register", "machine.delete", "machine.byte-rates", "project.create", "project.rename", "project.delete", "registry.set", "registry.clear", "project-secret.set", "project-secret.unset", "project-topic.set", "project-topic.unset", "project-broker.set", "project-broker.unset", "project.restore", "project.rehearse", "project.database", "project.backup-credential", "installation.release", "service.switch", "grant.make", "grant.end", "grant.answer", "grant.relinquish", "service.apply", "service.pause", "service.resume", "service.restart", "service.rollback", "service.expose", "service.unexpose", "service-hostname.add", "service-hostname.remove", "service.delete", "service.logs", "service.storage-credential", "service.storage-move", "service.storage-settings", "project-location.set", "project-location.clear"];
5
5
  export type Operation = (typeof operations)[number];
6
6
  export interface PanelEntities {
7
7
  organization: OrganizationSummary;
@@ -14,6 +14,9 @@ export const operations = [
14
14
  "member.repair",
15
15
  "token.create",
16
16
  "token.revoke",
17
+ "machine.register",
18
+ "machine.delete",
19
+ "machine.byte-rates",
17
20
  "project.create",
18
21
  "project.rename",
19
22
  "project.delete",
@@ -25,6 +28,18 @@ export const operations = [
25
28
  "project-topic.unset",
26
29
  "project-broker.set",
27
30
  "project-broker.unset",
31
+ "project.restore",
32
+ "project.rehearse",
33
+ "project.database",
34
+ "project.backup-credential",
35
+ "installation.release",
36
+ "service.switch",
37
+ "grant.make",
38
+ "grant.end",
39
+ // An owner of the grantee's side accepting or declining a pending grant, and giving one up: the
40
+ // organization page's "Offered grants" card.
41
+ "grant.answer",
42
+ "grant.relinquish",
28
43
  "service.apply",
29
44
  "service.pause",
30
45
  "service.resume",
@@ -32,6 +47,13 @@ export const operations = [
32
47
  "service.rollback",
33
48
  "service.expose",
34
49
  "service.unexpose",
50
+ "service-hostname.add",
51
+ "service-hostname.remove",
35
52
  "service.delete",
36
53
  "service.logs",
54
+ "service.storage-credential",
55
+ "service.storage-move",
56
+ "service.storage-settings",
57
+ "project-location.set",
58
+ "project-location.clear",
37
59
  ];