@coffre/client 0.0.0 → 0.1.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.
package/src/api.ts ADDED
@@ -0,0 +1,1062 @@
1
+ // Generated from the route table in packages/server/src/api/routes.ts by
2
+ // `pnpm --dir packages/client generate`. Do not edit: a test fails when it
3
+ // is out of date.
4
+
5
+ /** Every route, by `METHOD /path`: what a caller sends (the body, or the query of a GET) and gets back. */
6
+ export type Api = {
7
+ "GET /me": {
8
+ input: undefined;
9
+ output: {
10
+ principal: {
11
+ type: "service" | "user";
12
+ id: string;
13
+ };
14
+ registered: boolean;
15
+ tampered: boolean;
16
+ instanceRole: "owner" | "root-admin" | "user";
17
+ isRootAdmin: boolean;
18
+ canReadAudit: boolean;
19
+ environments: {
20
+ project: string;
21
+ environment: string;
22
+ permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
23
+ }[];
24
+ };
25
+ };
26
+ "GET /projects": {
27
+ input: undefined;
28
+ output: {
29
+ projects: {
30
+ slug: string;
31
+ name: string;
32
+ archivedAt: string | null;
33
+ permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
34
+ environments: {
35
+ slug: string;
36
+ name: string;
37
+ accessible: boolean;
38
+ details: null | {
39
+ archivedAt: string | null;
40
+ secretCount: number | null;
41
+ };
42
+ }[];
43
+ }[];
44
+ };
45
+ };
46
+ "PUT /projects/:project": {
47
+ input: {
48
+ name: string;
49
+ };
50
+ output: {
51
+ project: {
52
+ slug: string;
53
+ name: string;
54
+ archivedAt: string | null;
55
+ };
56
+ created: boolean;
57
+ };
58
+ };
59
+ "PATCH /projects/:project": {
60
+ input: {
61
+ name?: string;
62
+ slug?: string;
63
+ archived?: boolean;
64
+ };
65
+ output: {
66
+ project: {
67
+ slug: string;
68
+ name: string;
69
+ archivedAt: string | null;
70
+ };
71
+ };
72
+ };
73
+ "PUT /projects/:project/:environment": {
74
+ input: {
75
+ name: string;
76
+ };
77
+ output: {
78
+ environment: {
79
+ slug: string;
80
+ name: string;
81
+ archivedAt: string | null;
82
+ };
83
+ created: boolean;
84
+ };
85
+ };
86
+ "PATCH /projects/:project/:environment": {
87
+ input: {
88
+ name?: string;
89
+ slug?: string;
90
+ archived?: boolean;
91
+ };
92
+ output: {
93
+ environment: {
94
+ slug: string;
95
+ name: string;
96
+ archivedAt: string | null;
97
+ };
98
+ };
99
+ };
100
+ "GET /secrets/:project/:environment": {
101
+ input: undefined;
102
+ output: {
103
+ permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
104
+ keys: {
105
+ key: string;
106
+ archived: boolean;
107
+ version: number | null;
108
+ updatedAt: string | null;
109
+ updatedBy: string | null;
110
+ }[];
111
+ };
112
+ };
113
+ "PATCH /secrets/:project/:environment": {
114
+ input: {
115
+ [key: string]: string | null;
116
+ };
117
+ output: {
118
+ operationId: string;
119
+ keys: {
120
+ [key: string]: {
121
+ version: number;
122
+ } | {
123
+ archived: true;
124
+ };
125
+ };
126
+ } | {
127
+ dryRun: true;
128
+ keys: {
129
+ [key: string]: "added" | "archived" | "changed" | "unchanged";
130
+ };
131
+ };
132
+ };
133
+ "PATCH /secrets/:project/:environment/:key": {
134
+ input: {
135
+ key?: string;
136
+ archived?: boolean;
137
+ };
138
+ output: {
139
+ key: string;
140
+ archived: boolean;
141
+ };
142
+ };
143
+ "GET /secrets/:project/:environment/:key/versions": {
144
+ input: undefined;
145
+ output: {
146
+ key: string;
147
+ archived: boolean;
148
+ versions: {
149
+ version: number;
150
+ createdAt: string;
151
+ createdBy: string;
152
+ current: boolean;
153
+ kek: string;
154
+ }[];
155
+ };
156
+ };
157
+ "POST /secrets/:project/:environment/:key/restore": {
158
+ input: {
159
+ version: number;
160
+ };
161
+ output: {
162
+ key: string;
163
+ version: number;
164
+ };
165
+ };
166
+ "POST /reveals": {
167
+ input: {
168
+ path: string;
169
+ };
170
+ output: {
171
+ operationId: string;
172
+ values: {
173
+ [key: string]: string;
174
+ };
175
+ };
176
+ };
177
+ "GET /members": {
178
+ input: {
179
+ path?: string;
180
+ };
181
+ output: {
182
+ members: {
183
+ member: string;
184
+ principalType: "service" | "user";
185
+ principalId: string;
186
+ instanceRole: "owner" | "root-admin" | "user";
187
+ isRootAdmin: boolean;
188
+ tampered: boolean;
189
+ grants: {
190
+ id: string;
191
+ project: string;
192
+ environment: string | null;
193
+ role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
194
+ roleName: string;
195
+ permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
196
+ expiresAt: string | null;
197
+ }[];
198
+ }[];
199
+ removed: {
200
+ principalType: "service" | "user";
201
+ principalId: string;
202
+ toRotate: number;
203
+ }[];
204
+ };
205
+ };
206
+ "GET /members/:member": {
207
+ input: undefined;
208
+ output: {
209
+ principalType: "service" | "user";
210
+ principalId: string;
211
+ status: "active" | "removed" | "tampered";
212
+ instanceRole: "owner" | "root-admin" | "user";
213
+ isRootAdmin: boolean;
214
+ removedAt: string | null;
215
+ removedBy: string | null;
216
+ live: {
217
+ grants: number;
218
+ sessions: number;
219
+ tokens: number;
220
+ identities: number;
221
+ };
222
+ exposed: {
223
+ project: string;
224
+ environment: string;
225
+ key: string;
226
+ version: number;
227
+ how: "read" | "wrote";
228
+ at: string;
229
+ }[];
230
+ rotated: number;
231
+ issuedTokens: {
232
+ id: string;
233
+ service: string;
234
+ label: string | null;
235
+ hint: string;
236
+ expiresAt: string;
237
+ lastUsedAt: string | null;
238
+ }[];
239
+ syncs: {
240
+ id: string;
241
+ provider: string;
242
+ providerLabel: string;
243
+ brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
244
+ offered: boolean;
245
+ destination: string;
246
+ config: {
247
+ [key: string]: string | number | boolean | null | Json[] | {
248
+ [key: string]: Json;
249
+ };
250
+ };
251
+ credential: string;
252
+ createdAt: string;
253
+ createdBy: string;
254
+ paused: boolean;
255
+ running: boolean;
256
+ lastRunAt: string | null;
257
+ lastStatus: "failed" | "ok" | "partial" | null;
258
+ lastError: string | null;
259
+ synced: number;
260
+ pending: number;
261
+ skipped: {
262
+ key: string;
263
+ reason: string;
264
+ }[];
265
+ project: string;
266
+ environment: string;
267
+ }[];
268
+ };
269
+ };
270
+ "PUT /members/:member": {
271
+ input: {
272
+ owner?: boolean;
273
+ };
274
+ output: {
275
+ member: string;
276
+ instanceRole: "owner" | "user";
277
+ created: boolean;
278
+ };
279
+ };
280
+ "DELETE /members/:member": {
281
+ input: undefined;
282
+ output: {
283
+ revoked: {
284
+ grants: number;
285
+ sessions: number;
286
+ tokens: number;
287
+ identities: number;
288
+ };
289
+ report: {
290
+ principalType: "service" | "user";
291
+ principalId: string;
292
+ status: "active" | "removed" | "tampered";
293
+ instanceRole: "owner" | "root-admin" | "user";
294
+ isRootAdmin: boolean;
295
+ removedAt: string | null;
296
+ removedBy: string | null;
297
+ live: {
298
+ grants: number;
299
+ sessions: number;
300
+ tokens: number;
301
+ identities: number;
302
+ };
303
+ exposed: {
304
+ project: string;
305
+ environment: string;
306
+ key: string;
307
+ version: number;
308
+ how: "read" | "wrote";
309
+ at: string;
310
+ }[];
311
+ rotated: number;
312
+ issuedTokens: {
313
+ id: string;
314
+ service: string;
315
+ label: string | null;
316
+ hint: string;
317
+ expiresAt: string;
318
+ lastUsedAt: string | null;
319
+ }[];
320
+ syncs: {
321
+ id: string;
322
+ provider: string;
323
+ providerLabel: string;
324
+ brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
325
+ offered: boolean;
326
+ destination: string;
327
+ config: {
328
+ [key: string]: string | number | boolean | null | Json[] | {
329
+ [key: string]: Json;
330
+ };
331
+ };
332
+ credential: string;
333
+ createdAt: string;
334
+ createdBy: string;
335
+ paused: boolean;
336
+ running: boolean;
337
+ lastRunAt: string | null;
338
+ lastStatus: "failed" | "ok" | "partial" | null;
339
+ lastError: string | null;
340
+ synced: number;
341
+ pending: number;
342
+ skipped: {
343
+ key: string;
344
+ reason: string;
345
+ }[];
346
+ project: string;
347
+ environment: string;
348
+ }[];
349
+ };
350
+ };
351
+ };
352
+ "GET /members/:member/tokens": {
353
+ input: undefined;
354
+ output: {
355
+ tokens: {
356
+ id: string;
357
+ label: string | null;
358
+ hint: string;
359
+ createdAt: string;
360
+ createdBy: string;
361
+ expiresAt: string;
362
+ lastUsedAt: string | null;
363
+ lastUsedIp: string | null;
364
+ }[];
365
+ };
366
+ };
367
+ "POST /members/:member/tokens": {
368
+ input: {
369
+ expiresInDays: number;
370
+ label?: string | null;
371
+ };
372
+ output: {
373
+ id: string;
374
+ token: string;
375
+ expiresAt: string;
376
+ };
377
+ };
378
+ "DELETE /members/:member/tokens/:id": {
379
+ input: undefined;
380
+ output: {
381
+ revoked: true;
382
+ };
383
+ };
384
+ "PATCH /access/:member": {
385
+ input: {
386
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer" | null | {
387
+ role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
388
+ until: string | null;
389
+ };
390
+ };
391
+ output: {
392
+ changes: {
393
+ [key: string]: "created" | "revoked" | "unchanged" | "updated";
394
+ };
395
+ };
396
+ };
397
+ "GET /sessions": {
398
+ input: undefined;
399
+ output: {
400
+ sessions: {
401
+ id: string;
402
+ kind: "browser" | "cli";
403
+ label: string | null;
404
+ hint: string;
405
+ provider: string | null;
406
+ createdAt: string;
407
+ expiresAt: string;
408
+ lastUsedAt: string | null;
409
+ lastUsedIp: string | null;
410
+ current: boolean;
411
+ }[];
412
+ };
413
+ };
414
+ "DELETE /sessions/:id": {
415
+ input: undefined;
416
+ output: {
417
+ revoked: true;
418
+ };
419
+ };
420
+ "GET /identities": {
421
+ input: undefined;
422
+ output: {
423
+ identities: {
424
+ id: string;
425
+ provider: string;
426
+ email: string | null;
427
+ createdAt: string;
428
+ lastSignInAt: string | null;
429
+ }[];
430
+ };
431
+ };
432
+ "DELETE /identities/:id": {
433
+ input: undefined;
434
+ output: {
435
+ unlinked: true;
436
+ };
437
+ };
438
+ "GET /device-logins/:code": {
439
+ input: undefined;
440
+ output: {
441
+ request: null | {
442
+ userCode: string;
443
+ clientLabel: string | null;
444
+ clientIp: string | null;
445
+ createdAt: string;
446
+ expiresAt: string;
447
+ };
448
+ sessionDays: number;
449
+ };
450
+ };
451
+ "POST /device-logins/:code": {
452
+ input: {
453
+ approve: boolean;
454
+ };
455
+ output: {
456
+ decided: true;
457
+ };
458
+ };
459
+ "GET /syncs/providers": {
460
+ input: undefined;
461
+ output: {
462
+ providers: {
463
+ brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
464
+ id: string;
465
+ credential: {
466
+ placeholder: string;
467
+ hint: string;
468
+ };
469
+ label: string;
470
+ fields: ({
471
+ type: "text";
472
+ name: string;
473
+ label: string;
474
+ placeholder: string;
475
+ optional?: boolean;
476
+ hint?: string;
477
+ when?: {
478
+ field: string;
479
+ is: string[];
480
+ };
481
+ } | {
482
+ type: "options";
483
+ name: string;
484
+ label: string;
485
+ options: {
486
+ value: string;
487
+ label: string;
488
+ }[];
489
+ multiple: boolean;
490
+ initial: string[];
491
+ hint?: string;
492
+ })[];
493
+ }[];
494
+ };
495
+ };
496
+ "GET /syncs/:project/:environment": {
497
+ input: undefined;
498
+ output: {
499
+ syncs: {
500
+ id: string;
501
+ provider: string;
502
+ providerLabel: string;
503
+ brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
504
+ offered: boolean;
505
+ destination: string;
506
+ config: {
507
+ [key: string]: string | number | boolean | null | Json[] | {
508
+ [key: string]: Json;
509
+ };
510
+ };
511
+ credential: string;
512
+ createdAt: string;
513
+ createdBy: string;
514
+ paused: boolean;
515
+ running: boolean;
516
+ lastRunAt: string | null;
517
+ lastStatus: "failed" | "ok" | "partial" | null;
518
+ lastError: string | null;
519
+ synced: number;
520
+ pending: number;
521
+ skipped: {
522
+ key: string;
523
+ reason: string;
524
+ }[];
525
+ }[];
526
+ canManage: boolean;
527
+ };
528
+ };
529
+ "POST /syncs/:project/:environment": {
530
+ input: {
531
+ provider: string;
532
+ config: {
533
+ [key: string]: unknown;
534
+ };
535
+ credential: string;
536
+ };
537
+ output: {
538
+ id: string;
539
+ provider: string;
540
+ providerLabel: string;
541
+ brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
542
+ offered: boolean;
543
+ destination: string;
544
+ config: {
545
+ [key: string]: string | number | boolean | null | Json[] | {
546
+ [key: string]: Json;
547
+ };
548
+ };
549
+ credential: string;
550
+ createdAt: string;
551
+ createdBy: string;
552
+ paused: boolean;
553
+ running: boolean;
554
+ lastRunAt: string | null;
555
+ lastStatus: "failed" | "ok" | "partial" | null;
556
+ lastError: string | null;
557
+ synced: number;
558
+ pending: number;
559
+ skipped: {
560
+ key: string;
561
+ reason: string;
562
+ }[];
563
+ };
564
+ };
565
+ "PATCH /syncs/by-id/:id": {
566
+ input: {
567
+ paused: boolean;
568
+ };
569
+ output: {
570
+ id: string;
571
+ provider: string;
572
+ providerLabel: string;
573
+ brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
574
+ offered: boolean;
575
+ destination: string;
576
+ config: {
577
+ [key: string]: string | number | boolean | null | Json[] | {
578
+ [key: string]: Json;
579
+ };
580
+ };
581
+ credential: string;
582
+ createdAt: string;
583
+ createdBy: string;
584
+ paused: boolean;
585
+ running: boolean;
586
+ lastRunAt: string | null;
587
+ lastStatus: "failed" | "ok" | "partial" | null;
588
+ lastError: string | null;
589
+ synced: number;
590
+ pending: number;
591
+ skipped: {
592
+ key: string;
593
+ reason: string;
594
+ }[];
595
+ };
596
+ };
597
+ "DELETE /syncs/by-id/:id": {
598
+ input: undefined;
599
+ output: {
600
+ id: string;
601
+ provider: string;
602
+ providerLabel: string;
603
+ brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
604
+ offered: boolean;
605
+ destination: string;
606
+ config: {
607
+ [key: string]: string | number | boolean | null | Json[] | {
608
+ [key: string]: Json;
609
+ };
610
+ };
611
+ credential: string;
612
+ createdAt: string;
613
+ createdBy: string;
614
+ paused: boolean;
615
+ running: boolean;
616
+ lastRunAt: string | null;
617
+ lastStatus: "failed" | "ok" | "partial" | null;
618
+ lastError: string | null;
619
+ synced: number;
620
+ pending: number;
621
+ skipped: {
622
+ key: string;
623
+ reason: string;
624
+ }[];
625
+ };
626
+ };
627
+ "POST /syncs/by-id/:id/runs": {
628
+ input: undefined;
629
+ output: {
630
+ sync: {
631
+ id: string;
632
+ provider: string;
633
+ providerLabel: string;
634
+ brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
635
+ offered: boolean;
636
+ destination: string;
637
+ config: {
638
+ [key: string]: string | number | boolean | null | Json[] | {
639
+ [key: string]: Json;
640
+ };
641
+ };
642
+ credential: string;
643
+ createdAt: string;
644
+ createdBy: string;
645
+ paused: boolean;
646
+ running: boolean;
647
+ lastRunAt: string | null;
648
+ lastStatus: "failed" | "ok" | "partial" | null;
649
+ lastError: string | null;
650
+ synced: number;
651
+ pending: number;
652
+ skipped: {
653
+ key: string;
654
+ reason: string;
655
+ }[];
656
+ };
657
+ outcome: {
658
+ status: "busy";
659
+ } | {
660
+ status: "failed" | "ok" | "partial";
661
+ upserted: string[];
662
+ deleted: string[];
663
+ failed: {
664
+ key: string;
665
+ operation: "delete" | "upsert";
666
+ message: string;
667
+ }[];
668
+ error: string | null;
669
+ };
670
+ };
671
+ };
672
+ "GET /audit": {
673
+ input: {
674
+ path?: string;
675
+ actor?: string;
676
+ decision?: "allow" | "deny";
677
+ detail?: "1" | "true";
678
+ before?: unknown;
679
+ limit?: unknown;
680
+ };
681
+ output: {
682
+ entries: {
683
+ seq: number;
684
+ author: "app" | "vault";
685
+ occurredAt: string;
686
+ actorType: "service" | "system" | "user";
687
+ actorId: string;
688
+ action: string;
689
+ decision: "allow" | "deny";
690
+ reason: string | null;
691
+ detail: boolean;
692
+ subject: string | null;
693
+ project: string | null;
694
+ environment: string | null;
695
+ key: string | null;
696
+ version: number | null;
697
+ operationId: string | null;
698
+ relatedSeq: number | null;
699
+ requestId: string | null;
700
+ metadata: {
701
+ [key: string]: unknown;
702
+ };
703
+ }[];
704
+ hidden?: {
705
+ action: string;
706
+ count: number;
707
+ }[];
708
+ };
709
+ };
710
+ "GET /audit/verification": {
711
+ input: undefined;
712
+ output: {
713
+ ok: true;
714
+ through: number | null;
715
+ entries: number;
716
+ checkpoint: null | {
717
+ seq: number;
718
+ signedAt: string;
719
+ };
720
+ pending?: number;
721
+ } | {
722
+ ok: false;
723
+ through: number | null;
724
+ failedAtSeq: number | null;
725
+ author: "app" | "vault";
726
+ reason: string;
727
+ };
728
+ };
729
+ };
730
+
731
+ export type AccessValue = "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer" | null | {
732
+ role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
733
+ until: string | null;
734
+ };
735
+
736
+ export type AuditEntryView = {
737
+ seq: number;
738
+ author: "app" | "vault";
739
+ occurredAt: string;
740
+ actorType: "service" | "system" | "user";
741
+ actorId: string;
742
+ action: string;
743
+ decision: "allow" | "deny";
744
+ reason: string | null;
745
+ detail: boolean;
746
+ subject: string | null;
747
+ project: string | null;
748
+ environment: string | null;
749
+ key: string | null;
750
+ version: number | null;
751
+ operationId: string | null;
752
+ relatedSeq: number | null;
753
+ requestId: string | null;
754
+ metadata: {
755
+ [key: string]: unknown;
756
+ };
757
+ };
758
+
759
+ export type AuthInfo = {
760
+ signin: null | {
761
+ title: string;
762
+ note: string | null;
763
+ providers: {
764
+ id: string;
765
+ label: string;
766
+ brand: "github" | "google" | "microsoft" | "oidc";
767
+ }[];
768
+ };
769
+ access: null | {
770
+ assertion: boolean;
771
+ };
772
+ };
773
+
774
+ export type DryRunOutcome = "added" | "archived" | "changed" | "unchanged";
775
+
776
+ export type DryRunResult = {
777
+ dryRun: true;
778
+ keys: {
779
+ [key: string]: "added" | "archived" | "changed" | "unchanged";
780
+ };
781
+ };
782
+
783
+ export type IdentityRow = {
784
+ id: string;
785
+ provider: string;
786
+ email: string | null;
787
+ createdAt: string;
788
+ lastSignInAt: string | null;
789
+ };
790
+
791
+ export type Me = {
792
+ principal: {
793
+ type: "service" | "user";
794
+ id: string;
795
+ };
796
+ registered: boolean;
797
+ tampered: boolean;
798
+ instanceRole: "owner" | "root-admin" | "user";
799
+ isRootAdmin: boolean;
800
+ canReadAudit: boolean;
801
+ environments: {
802
+ project: string;
803
+ environment: string;
804
+ permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
805
+ }[];
806
+ };
807
+
808
+ export type Member = {
809
+ member: string;
810
+ principalType: "service" | "user";
811
+ principalId: string;
812
+ instanceRole: "owner" | "root-admin" | "user";
813
+ isRootAdmin: boolean;
814
+ tampered: boolean;
815
+ grants: {
816
+ id: string;
817
+ project: string;
818
+ environment: string | null;
819
+ role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
820
+ roleName: string;
821
+ permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
822
+ expiresAt: string | null;
823
+ }[];
824
+ };
825
+
826
+ export type OffboardingReport = {
827
+ principalType: "service" | "user";
828
+ principalId: string;
829
+ status: "active" | "removed" | "tampered";
830
+ instanceRole: "owner" | "root-admin" | "user";
831
+ isRootAdmin: boolean;
832
+ removedAt: string | null;
833
+ removedBy: string | null;
834
+ live: {
835
+ grants: number;
836
+ sessions: number;
837
+ tokens: number;
838
+ identities: number;
839
+ };
840
+ exposed: {
841
+ project: string;
842
+ environment: string;
843
+ key: string;
844
+ version: number;
845
+ how: "read" | "wrote";
846
+ at: string;
847
+ }[];
848
+ rotated: number;
849
+ issuedTokens: {
850
+ id: string;
851
+ service: string;
852
+ label: string | null;
853
+ hint: string;
854
+ expiresAt: string;
855
+ lastUsedAt: string | null;
856
+ }[];
857
+ syncs: {
858
+ id: string;
859
+ provider: string;
860
+ providerLabel: string;
861
+ brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
862
+ offered: boolean;
863
+ destination: string;
864
+ config: {
865
+ [key: string]: string | number | boolean | null | Json[] | {
866
+ [key: string]: Json;
867
+ };
868
+ };
869
+ credential: string;
870
+ createdAt: string;
871
+ createdBy: string;
872
+ paused: boolean;
873
+ running: boolean;
874
+ lastRunAt: string | null;
875
+ lastStatus: "failed" | "ok" | "partial" | null;
876
+ lastError: string | null;
877
+ synced: number;
878
+ pending: number;
879
+ skipped: {
880
+ key: string;
881
+ reason: string;
882
+ }[];
883
+ project: string;
884
+ environment: string;
885
+ }[];
886
+ };
887
+
888
+ export type ProjectSummary = {
889
+ slug: string;
890
+ name: string;
891
+ archivedAt: string | null;
892
+ permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
893
+ environments: {
894
+ slug: string;
895
+ name: string;
896
+ accessible: boolean;
897
+ details: null | {
898
+ archivedAt: string | null;
899
+ secretCount: number | null;
900
+ };
901
+ }[];
902
+ };
903
+
904
+ export type RemovedMember = {
905
+ principalType: "service" | "user";
906
+ principalId: string;
907
+ toRotate: number;
908
+ };
909
+
910
+ export type RunOutcome = {
911
+ status: "busy";
912
+ } | {
913
+ status: "failed" | "ok" | "partial";
914
+ upserted: string[];
915
+ deleted: string[];
916
+ failed: {
917
+ key: string;
918
+ operation: "delete" | "upsert";
919
+ message: string;
920
+ }[];
921
+ error: string | null;
922
+ };
923
+
924
+ export type SecretKey = {
925
+ key: string;
926
+ archived: boolean;
927
+ version: number | null;
928
+ updatedAt: string | null;
929
+ updatedBy: string | null;
930
+ };
931
+
932
+ export type SecretVersion = {
933
+ version: number;
934
+ createdAt: string;
935
+ createdBy: string;
936
+ current: boolean;
937
+ kek: string;
938
+ };
939
+
940
+ export type ServiceTokenRow = {
941
+ id: string;
942
+ label: string | null;
943
+ hint: string;
944
+ createdAt: string;
945
+ createdBy: string;
946
+ expiresAt: string;
947
+ lastUsedAt: string | null;
948
+ lastUsedIp: string | null;
949
+ };
950
+
951
+ export type SessionRow = {
952
+ id: string;
953
+ kind: "browser" | "cli";
954
+ label: string | null;
955
+ hint: string;
956
+ provider: string | null;
957
+ createdAt: string;
958
+ expiresAt: string;
959
+ lastUsedAt: string | null;
960
+ lastUsedIp: string | null;
961
+ current: boolean;
962
+ };
963
+
964
+ export type SetResult = {
965
+ operationId: string;
966
+ keys: {
967
+ [key: string]: {
968
+ version: number;
969
+ } | {
970
+ archived: true;
971
+ };
972
+ };
973
+ };
974
+
975
+ export type SyncField = {
976
+ type: "text";
977
+ name: string;
978
+ label: string;
979
+ placeholder: string;
980
+ optional?: boolean;
981
+ hint?: string;
982
+ when?: {
983
+ field: string;
984
+ is: string[];
985
+ };
986
+ } | {
987
+ type: "options";
988
+ name: string;
989
+ label: string;
990
+ options: {
991
+ value: string;
992
+ label: string;
993
+ }[];
994
+ multiple: boolean;
995
+ initial: string[];
996
+ hint?: string;
997
+ };
998
+
999
+ export type SyncProviderInfo = {
1000
+ brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
1001
+ id: string;
1002
+ credential: {
1003
+ placeholder: string;
1004
+ hint: string;
1005
+ };
1006
+ label: string;
1007
+ fields: ({
1008
+ type: "text";
1009
+ name: string;
1010
+ label: string;
1011
+ placeholder: string;
1012
+ optional?: boolean;
1013
+ hint?: string;
1014
+ when?: {
1015
+ field: string;
1016
+ is: string[];
1017
+ };
1018
+ } | {
1019
+ type: "options";
1020
+ name: string;
1021
+ label: string;
1022
+ options: {
1023
+ value: string;
1024
+ label: string;
1025
+ }[];
1026
+ multiple: boolean;
1027
+ initial: string[];
1028
+ hint?: string;
1029
+ })[];
1030
+ };
1031
+
1032
+ export type SyncView = {
1033
+ id: string;
1034
+ provider: string;
1035
+ providerLabel: string;
1036
+ brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
1037
+ offered: boolean;
1038
+ destination: string;
1039
+ config: {
1040
+ [key: string]: string | number | boolean | null | Json[] | {
1041
+ [key: string]: Json;
1042
+ };
1043
+ };
1044
+ credential: string;
1045
+ createdAt: string;
1046
+ createdBy: string;
1047
+ paused: boolean;
1048
+ running: boolean;
1049
+ lastRunAt: string | null;
1050
+ lastStatus: "failed" | "ok" | "partial" | null;
1051
+ lastError: string | null;
1052
+ synced: number;
1053
+ pending: number;
1054
+ skipped: {
1055
+ key: string;
1056
+ reason: string;
1057
+ }[];
1058
+ };
1059
+
1060
+ export type Json = string | number | boolean | null | Json[] | {
1061
+ [key: string]: Json;
1062
+ };