@coffre/client 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,6 +37,7 @@ type Api = {
37
37
  secretCount: number | null;
38
38
  };
39
39
  }[];
40
+ secretCount: number | null;
40
41
  }[];
41
42
  };
42
43
  };
@@ -233,35 +234,6 @@ type Api = {
233
234
  expiresAt: string;
234
235
  lastUsedAt: string | null;
235
236
  }[];
236
- syncs: {
237
- id: string;
238
- provider: string;
239
- providerLabel: string;
240
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
241
- offered: boolean;
242
- destination: string;
243
- config: {
244
- [key: string]: string | number | boolean | null | Json[] | {
245
- [key: string]: Json;
246
- };
247
- };
248
- credential: string;
249
- createdAt: string;
250
- createdBy: string;
251
- paused: boolean;
252
- running: boolean;
253
- lastRunAt: string | null;
254
- lastStatus: "failed" | "ok" | "partial" | null;
255
- lastError: string | null;
256
- synced: number;
257
- pending: number;
258
- skipped: {
259
- key: string;
260
- reason: string;
261
- }[];
262
- project: string;
263
- environment: string;
264
- }[];
265
237
  };
266
238
  };
267
239
  "PUT /members/:member": {
@@ -314,35 +286,6 @@ type Api = {
314
286
  expiresAt: string;
315
287
  lastUsedAt: string | null;
316
288
  }[];
317
- syncs: {
318
- id: string;
319
- provider: string;
320
- providerLabel: string;
321
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
322
- offered: boolean;
323
- destination: string;
324
- config: {
325
- [key: string]: string | number | boolean | null | Json[] | {
326
- [key: string]: Json;
327
- };
328
- };
329
- credential: string;
330
- createdAt: string;
331
- createdBy: string;
332
- paused: boolean;
333
- running: boolean;
334
- lastRunAt: string | null;
335
- lastStatus: "failed" | "ok" | "partial" | null;
336
- lastError: string | null;
337
- synced: number;
338
- pending: number;
339
- skipped: {
340
- key: string;
341
- reason: string;
342
- }[];
343
- project: string;
344
- environment: string;
345
- }[];
346
289
  };
347
290
  };
348
291
  };
@@ -453,219 +396,6 @@ type Api = {
453
396
  decided: true;
454
397
  };
455
398
  };
456
- "GET /syncs/providers": {
457
- input: undefined;
458
- output: {
459
- providers: {
460
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
461
- id: string;
462
- credential: {
463
- placeholder: string;
464
- hint: string;
465
- };
466
- label: string;
467
- fields: ({
468
- type: "text";
469
- name: string;
470
- label: string;
471
- placeholder: string;
472
- optional?: boolean;
473
- hint?: string;
474
- when?: {
475
- field: string;
476
- is: string[];
477
- };
478
- } | {
479
- type: "options";
480
- name: string;
481
- label: string;
482
- options: {
483
- value: string;
484
- label: string;
485
- }[];
486
- multiple: boolean;
487
- initial: string[];
488
- hint?: string;
489
- })[];
490
- }[];
491
- };
492
- };
493
- "GET /syncs/:project/:environment": {
494
- input: undefined;
495
- output: {
496
- syncs: {
497
- id: string;
498
- provider: string;
499
- providerLabel: string;
500
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
501
- offered: boolean;
502
- destination: string;
503
- config: {
504
- [key: string]: string | number | boolean | null | Json[] | {
505
- [key: string]: Json;
506
- };
507
- };
508
- credential: string;
509
- createdAt: string;
510
- createdBy: string;
511
- paused: boolean;
512
- running: boolean;
513
- lastRunAt: string | null;
514
- lastStatus: "failed" | "ok" | "partial" | null;
515
- lastError: string | null;
516
- synced: number;
517
- pending: number;
518
- skipped: {
519
- key: string;
520
- reason: string;
521
- }[];
522
- }[];
523
- canManage: boolean;
524
- };
525
- };
526
- "POST /syncs/:project/:environment": {
527
- input: {
528
- provider: string;
529
- config: {
530
- [key: string]: unknown;
531
- };
532
- credential: string;
533
- };
534
- output: {
535
- id: string;
536
- provider: string;
537
- providerLabel: string;
538
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
539
- offered: boolean;
540
- destination: string;
541
- config: {
542
- [key: string]: string | number | boolean | null | Json[] | {
543
- [key: string]: Json;
544
- };
545
- };
546
- credential: string;
547
- createdAt: string;
548
- createdBy: string;
549
- paused: boolean;
550
- running: boolean;
551
- lastRunAt: string | null;
552
- lastStatus: "failed" | "ok" | "partial" | null;
553
- lastError: string | null;
554
- synced: number;
555
- pending: number;
556
- skipped: {
557
- key: string;
558
- reason: string;
559
- }[];
560
- };
561
- };
562
- "PATCH /syncs/by-id/:id": {
563
- input: {
564
- paused: boolean;
565
- };
566
- output: {
567
- id: string;
568
- provider: string;
569
- providerLabel: string;
570
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
571
- offered: boolean;
572
- destination: string;
573
- config: {
574
- [key: string]: string | number | boolean | null | Json[] | {
575
- [key: string]: Json;
576
- };
577
- };
578
- credential: string;
579
- createdAt: string;
580
- createdBy: string;
581
- paused: boolean;
582
- running: boolean;
583
- lastRunAt: string | null;
584
- lastStatus: "failed" | "ok" | "partial" | null;
585
- lastError: string | null;
586
- synced: number;
587
- pending: number;
588
- skipped: {
589
- key: string;
590
- reason: string;
591
- }[];
592
- };
593
- };
594
- "DELETE /syncs/by-id/:id": {
595
- input: undefined;
596
- output: {
597
- id: string;
598
- provider: string;
599
- providerLabel: string;
600
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
601
- offered: boolean;
602
- destination: string;
603
- config: {
604
- [key: string]: string | number | boolean | null | Json[] | {
605
- [key: string]: Json;
606
- };
607
- };
608
- credential: string;
609
- createdAt: string;
610
- createdBy: string;
611
- paused: boolean;
612
- running: boolean;
613
- lastRunAt: string | null;
614
- lastStatus: "failed" | "ok" | "partial" | null;
615
- lastError: string | null;
616
- synced: number;
617
- pending: number;
618
- skipped: {
619
- key: string;
620
- reason: string;
621
- }[];
622
- };
623
- };
624
- "POST /syncs/by-id/:id/runs": {
625
- input: undefined;
626
- output: {
627
- sync: {
628
- id: string;
629
- provider: string;
630
- providerLabel: string;
631
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
632
- offered: boolean;
633
- destination: string;
634
- config: {
635
- [key: string]: string | number | boolean | null | Json[] | {
636
- [key: string]: Json;
637
- };
638
- };
639
- credential: string;
640
- createdAt: string;
641
- createdBy: string;
642
- paused: boolean;
643
- running: boolean;
644
- lastRunAt: string | null;
645
- lastStatus: "failed" | "ok" | "partial" | null;
646
- lastError: string | null;
647
- synced: number;
648
- pending: number;
649
- skipped: {
650
- key: string;
651
- reason: string;
652
- }[];
653
- };
654
- outcome: {
655
- status: "busy";
656
- } | {
657
- status: "failed" | "ok" | "partial";
658
- upserted: string[];
659
- deleted: string[];
660
- failed: {
661
- key: string;
662
- operation: "delete" | "upsert";
663
- message: string;
664
- }[];
665
- error: string | null;
666
- };
667
- };
668
- };
669
399
  "GET /audit": {
670
400
  input: {
671
401
  path?: string;
@@ -863,35 +593,6 @@ type OffboardingReport = {
863
593
  expiresAt: string;
864
594
  lastUsedAt: string | null;
865
595
  }[];
866
- syncs: {
867
- id: string;
868
- provider: string;
869
- providerLabel: string;
870
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
871
- offered: boolean;
872
- destination: string;
873
- config: {
874
- [key: string]: string | number | boolean | null | Json[] | {
875
- [key: string]: Json;
876
- };
877
- };
878
- credential: string;
879
- createdAt: string;
880
- createdBy: string;
881
- paused: boolean;
882
- running: boolean;
883
- lastRunAt: string | null;
884
- lastStatus: "failed" | "ok" | "partial" | null;
885
- lastError: string | null;
886
- synced: number;
887
- pending: number;
888
- skipped: {
889
- key: string;
890
- reason: string;
891
- }[];
892
- project: string;
893
- environment: string;
894
- }[];
895
596
  };
896
597
  type ProjectSummary = {
897
598
  slug: string;
@@ -907,25 +608,13 @@ type ProjectSummary = {
907
608
  secretCount: number | null;
908
609
  };
909
610
  }[];
611
+ secretCount: number | null;
910
612
  };
911
613
  type RemovedMember = {
912
614
  principalType: "service" | "user";
913
615
  principalId: string;
914
616
  toRotate: number;
915
617
  };
916
- type RunOutcome = {
917
- status: "busy";
918
- } | {
919
- status: "failed" | "ok" | "partial";
920
- upserted: string[];
921
- deleted: string[];
922
- failed: {
923
- key: string;
924
- operation: "delete" | "upsert";
925
- message: string;
926
- }[];
927
- error: string | null;
928
- };
929
618
  type SecretKey = {
930
619
  key: string;
931
620
  archived: boolean;
@@ -972,110 +661,6 @@ type SetResult = {
972
661
  };
973
662
  };
974
663
  };
975
- 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
- type SyncProviderInfo = {
999
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
1000
- id: string;
1001
- credential: {
1002
- placeholder: string;
1003
- hint: string;
1004
- };
1005
- label: string;
1006
- fields: ({
1007
- type: "text";
1008
- name: string;
1009
- label: string;
1010
- placeholder: string;
1011
- optional?: boolean;
1012
- hint?: string;
1013
- when?: {
1014
- field: string;
1015
- is: string[];
1016
- };
1017
- } | {
1018
- type: "options";
1019
- name: string;
1020
- label: string;
1021
- options: {
1022
- value: string;
1023
- label: string;
1024
- }[];
1025
- multiple: boolean;
1026
- initial: string[];
1027
- hint?: string;
1028
- })[];
1029
- };
1030
- type SyncView = {
1031
- id: string;
1032
- provider: string;
1033
- providerLabel: string;
1034
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
1035
- offered: boolean;
1036
- destination: string;
1037
- config: {
1038
- [key: string]: string | number | boolean | null | Json[] | {
1039
- [key: string]: Json;
1040
- };
1041
- };
1042
- credential: string;
1043
- createdAt: string;
1044
- createdBy: string;
1045
- paused: boolean;
1046
- running: boolean;
1047
- lastRunAt: string | null;
1048
- lastStatus: "failed" | "ok" | "partial" | null;
1049
- lastError: string | null;
1050
- synced: number;
1051
- pending: number;
1052
- skipped: {
1053
- key: string;
1054
- reason: string;
1055
- }[];
1056
- };
1057
- type Json = string | number | boolean | null | Json[] | {
1058
- [key: string]: Json;
1059
- };
1060
- //#endregion
1061
- //#region src/sync-fields.d.ts
1062
- type FormValues = Record<string, string | string[]>;
1063
- declare function initialValues(provider: SyncProviderInfo): FormValues;
1064
- /** Whether the rest of the form makes the field meaningful. */
1065
- declare function isAsked(field: SyncField, values: FormValues): boolean;
1066
- /** The label of the first required field left empty, or null when the form can be sent. */
1067
- declare function firstMissing(provider: SyncProviderInfo, values: FormValues): string | null;
1068
- /**
1069
- * The provider's config. Text is trimmed, and an optional field left empty
1070
- * is left out rather than sent as "", which the server rightly refuses.
1071
- */
1072
- declare function configFromForm(provider: SyncProviderInfo, values: FormValues): Record<string, unknown>;
1073
- /**
1074
- * The config from `name=value` arguments, as the CLI takes them. A field with
1075
- * several options takes them comma-separated, and one left out gets what the
1076
- * form preselects. Text goes as typed, for the server to check.
1077
- */
1078
- declare function configFromArguments(provider: SyncProviderInfo, assignments: readonly string[]): Record<string, unknown>;
1079
664
  //#endregion
1080
665
  //#region src/index.d.ts
1081
666
  type RouteKey = keyof Api;
@@ -1149,6 +734,7 @@ declare function createClient(options: ClientOptions): {
1149
734
  secretCount: number | null;
1150
735
  };
1151
736
  }[];
737
+ secretCount: number | null;
1152
738
  }[];
1153
739
  }>;
1154
740
  create: (project: string, input: RouteInput<"PUT /projects/:project">) => Promise<{
@@ -1294,35 +880,6 @@ declare function createClient(options: ClientOptions): {
1294
880
  expiresAt: string;
1295
881
  lastUsedAt: string | null;
1296
882
  }[];
1297
- syncs: {
1298
- id: string;
1299
- provider: string;
1300
- providerLabel: string;
1301
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
1302
- offered: boolean;
1303
- destination: string;
1304
- config: {
1305
- [key: string]: string | number | boolean | null | Json[] | {
1306
- [key: string]: Json;
1307
- };
1308
- };
1309
- credential: string;
1310
- createdAt: string;
1311
- createdBy: string;
1312
- paused: boolean;
1313
- running: boolean;
1314
- lastRunAt: string | null;
1315
- lastStatus: "failed" | "ok" | "partial" | null;
1316
- lastError: string | null;
1317
- synced: number;
1318
- pending: number;
1319
- skipped: {
1320
- key: string;
1321
- reason: string;
1322
- }[];
1323
- project: string;
1324
- environment: string;
1325
- }[];
1326
883
  }>;
1327
884
  add: (member: string, input?: RouteInput<"PUT /members/:member">) => Promise<{
1328
885
  member: string;
@@ -1368,35 +925,6 @@ declare function createClient(options: ClientOptions): {
1368
925
  expiresAt: string;
1369
926
  lastUsedAt: string | null;
1370
927
  }[];
1371
- syncs: {
1372
- id: string;
1373
- provider: string;
1374
- providerLabel: string;
1375
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
1376
- offered: boolean;
1377
- destination: string;
1378
- config: {
1379
- [key: string]: string | number | boolean | null | Json[] | {
1380
- [key: string]: Json;
1381
- };
1382
- };
1383
- credential: string;
1384
- createdAt: string;
1385
- createdBy: string;
1386
- paused: boolean;
1387
- running: boolean;
1388
- lastRunAt: string | null;
1389
- lastStatus: "failed" | "ok" | "partial" | null;
1390
- lastError: string | null;
1391
- synced: number;
1392
- pending: number;
1393
- skipped: {
1394
- key: string;
1395
- reason: string;
1396
- }[];
1397
- project: string;
1398
- environment: string;
1399
- }[];
1400
928
  };
1401
929
  }>;
1402
930
  };
@@ -1482,196 +1010,6 @@ declare function createClient(options: ClientOptions): {
1482
1010
  decided: true;
1483
1011
  }>;
1484
1012
  };
1485
- syncs: {
1486
- /** Where a sync can push on this instance, and what each asks for. */
1487
- providers: () => Promise<{
1488
- providers: {
1489
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
1490
- id: string;
1491
- credential: {
1492
- placeholder: string;
1493
- hint: string;
1494
- };
1495
- label: string;
1496
- fields: ({
1497
- type: "text";
1498
- name: string;
1499
- label: string;
1500
- placeholder: string;
1501
- optional?: boolean;
1502
- hint?: string;
1503
- when?: {
1504
- field: string;
1505
- is: string[];
1506
- };
1507
- } | {
1508
- type: "options";
1509
- name: string;
1510
- label: string;
1511
- options: {
1512
- value: string;
1513
- label: string;
1514
- }[];
1515
- multiple: boolean;
1516
- initial: string[];
1517
- hint?: string;
1518
- })[];
1519
- }[];
1520
- }>;
1521
- list: (path: string) => Promise<{
1522
- syncs: {
1523
- id: string;
1524
- provider: string;
1525
- providerLabel: string;
1526
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
1527
- offered: boolean;
1528
- destination: string;
1529
- config: {
1530
- [key: string]: string | number | boolean | null | Json[] | {
1531
- [key: string]: Json;
1532
- };
1533
- };
1534
- credential: string;
1535
- createdAt: string;
1536
- createdBy: string;
1537
- paused: boolean;
1538
- running: boolean;
1539
- lastRunAt: string | null;
1540
- lastStatus: "failed" | "ok" | "partial" | null;
1541
- lastError: string | null;
1542
- synced: number;
1543
- pending: number;
1544
- skipped: {
1545
- key: string;
1546
- reason: string;
1547
- }[];
1548
- }[];
1549
- canManage: boolean;
1550
- }>;
1551
- add: (path: string, input: RouteInput<"POST /syncs/:project/:environment">) => Promise<{
1552
- id: string;
1553
- provider: string;
1554
- providerLabel: string;
1555
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
1556
- offered: boolean;
1557
- destination: string;
1558
- config: {
1559
- [key: string]: string | number | boolean | null | Json[] | {
1560
- [key: string]: Json;
1561
- };
1562
- };
1563
- credential: string;
1564
- createdAt: string;
1565
- createdBy: string;
1566
- paused: boolean;
1567
- running: boolean;
1568
- lastRunAt: string | null;
1569
- lastStatus: "failed" | "ok" | "partial" | null;
1570
- lastError: string | null;
1571
- synced: number;
1572
- pending: number;
1573
- skipped: {
1574
- key: string;
1575
- reason: string;
1576
- }[];
1577
- }>;
1578
- update: (id: string, patch: RouteInput<"PATCH /syncs/by-id/:id">) => Promise<{
1579
- id: string;
1580
- provider: string;
1581
- providerLabel: string;
1582
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
1583
- offered: boolean;
1584
- destination: string;
1585
- config: {
1586
- [key: string]: string | number | boolean | null | Json[] | {
1587
- [key: string]: Json;
1588
- };
1589
- };
1590
- credential: string;
1591
- createdAt: string;
1592
- createdBy: string;
1593
- paused: boolean;
1594
- running: boolean;
1595
- lastRunAt: string | null;
1596
- lastStatus: "failed" | "ok" | "partial" | null;
1597
- lastError: string | null;
1598
- synced: number;
1599
- pending: number;
1600
- skipped: {
1601
- key: string;
1602
- reason: string;
1603
- }[];
1604
- }>;
1605
- remove: (id: string) => Promise<{
1606
- id: string;
1607
- provider: string;
1608
- providerLabel: string;
1609
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
1610
- offered: boolean;
1611
- destination: string;
1612
- config: {
1613
- [key: string]: string | number | boolean | null | Json[] | {
1614
- [key: string]: Json;
1615
- };
1616
- };
1617
- credential: string;
1618
- createdAt: string;
1619
- createdBy: string;
1620
- paused: boolean;
1621
- running: boolean;
1622
- lastRunAt: string | null;
1623
- lastStatus: "failed" | "ok" | "partial" | null;
1624
- lastError: string | null;
1625
- synced: number;
1626
- pending: number;
1627
- skipped: {
1628
- key: string;
1629
- reason: string;
1630
- }[];
1631
- }>;
1632
- run: (id: string) => Promise<{
1633
- sync: {
1634
- id: string;
1635
- provider: string;
1636
- providerLabel: string;
1637
- brand: "cloudflare" | "github" | "other" | "railway" | "vercel";
1638
- offered: boolean;
1639
- destination: string;
1640
- config: {
1641
- [key: string]: string | number | boolean | null | Json[] | {
1642
- [key: string]: Json;
1643
- };
1644
- };
1645
- credential: string;
1646
- createdAt: string;
1647
- createdBy: string;
1648
- paused: boolean;
1649
- running: boolean;
1650
- lastRunAt: string | null;
1651
- lastStatus: "failed" | "ok" | "partial" | null;
1652
- lastError: string | null;
1653
- synced: number;
1654
- pending: number;
1655
- skipped: {
1656
- key: string;
1657
- reason: string;
1658
- }[];
1659
- };
1660
- outcome: {
1661
- status: "busy";
1662
- } | {
1663
- status: "failed" | "ok" | "partial";
1664
- upserted: string[];
1665
- deleted: string[];
1666
- failed: {
1667
- key: string;
1668
- operation: "delete" | "upsert";
1669
- message: string;
1670
- }[];
1671
- error: string | null;
1672
- };
1673
- }>;
1674
- };
1675
1013
  audit: {
1676
1014
  list: (query?: RouteInput<"GET /audit">) => Promise<{
1677
1015
  entries: {
@@ -1759,4 +1097,4 @@ declare function planImport(coffre: CoffreClient, path: string, entries: readonl
1759
1097
  changes: Record<string, string>;
1760
1098
  }>;
1761
1099
  //#endregion
1762
- export { RemovedMember as A, DryRunResult as C, Member as D, Me as E, SessionRow as F, SetResult as I, SyncField as L, SecretKey as M, SecretVersion as N, OffboardingReport as O, ServiceTokenRow as P, SyncProviderInfo as R, DryRunOutcome as S, Json as T, isAsked as _, Params as a, AuditEntryView as b, RouteOutput as c, planImport as d, FormValues as f, initialValues as g, firstMissing as h, ImportAction as i, RunOutcome as j, ProjectSummary as k, Transport as l, configFromForm as m, CoffreClient as n, RouteInput as o, configFromArguments as p, CoffreError as r, RouteKey as s, ClientOptions as t, createClient as u, AccessValue as v, IdentityRow as w, AuthInfo as x, Api as y, SyncView as z };
1100
+ export { RemovedMember as C, SessionRow as D, ServiceTokenRow as E, SetResult as O, ProjectSummary as S, SecretVersion as T, DryRunResult as _, Params as a, Member as b, RouteOutput as c, planImport as d, AccessValue as f, DryRunOutcome as g, AuthInfo as h, ImportAction as i, Transport as l, AuditEntryView as m, CoffreClient as n, RouteInput as o, Api as p, CoffreError as r, RouteKey as s, ClientOptions as t, createClient as u, IdentityRow as v, SecretKey as w, OffboardingReport as x, Me as y };