@coffre/client 0.4.5 → 0.5.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.
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as DeletionResult, B as OffboardingReport, C as AuthInfo, D as ConnectedApp, E as BindingView, F as InheritedGrant, G as SecretVersion, H as ReferenceView, I as ListedReference, J as SetResult, K as ServiceTokenRow, L as Me, M as DryRunOutcome, N as DryRunResult, O as Decision, P as IdentityRow, R as Member, S as AuditEntryView, T as BindingPlan, U as RemovedMember, V as ProjectSummary, W as SecretKey, Y as WorkloadIds, _ as byFolder, a as Params, b as Api, c as RouteOutput, d as planImport, f as Unreachable, g as shownMember, h as serviceName, i as ImportAction, j as DismissedKey, k as Deletion, l as Transport, m as apiMember, n as CoffreClient, o as RouteInput, p as unreachable, q as SessionRow, r as CoffreError, s as RouteKey, t as ClientOptions, u as createClient, v as foldersOf, w as AuthorizationView, x as ApprovalView, y as AccessValue, z as MissingKey } from "./index-ZGDlpCwB.js";
2
- export { type AccessValue, type Api, type ApprovalView, type AuditEntryView, type AuthInfo, type AuthorizationView, type BindingPlan, type BindingView, ClientOptions, CoffreClient, CoffreError, type ConnectedApp, type Decision, type Deletion, type DeletionResult, type DismissedKey, type DryRunOutcome, type DryRunResult, type IdentityRow, ImportAction, type InheritedGrant, type ListedReference, type Me, type Member, type MissingKey, type OffboardingReport, Params, type ProjectSummary, type ReferenceView, type RemovedMember, RouteInput, RouteKey, RouteOutput, type SecretKey, type SecretVersion, type ServiceTokenRow, type SessionRow, type SetResult, Transport, Unreachable, type WorkloadIds, apiMember, byFolder, createClient, foldersOf, planImport, serviceName, shownMember, unreachable };
1
+ import { A as DeletionResult, B as OffboardingReport, C as AuthInfo, D as ConnectedApp, E as BindingView, F as ListedReference, G as SecretVersion, H as ReferenceView, I as Me, J as SetResult, K as ServiceTokenRow, L as Member, M as DryRunOutcome, N as DryRunResult, O as Decision, P as IdentityRow, R as MemberAccess, S as AuditEntryView, T as BindingPlan, U as RemovedMember, V as ProjectSummary, W as SecretKey, X as WorkloadIds, Y as TokenPlan, _ as byFolder, a as Params, b as Api, c as RouteOutput, d as planImport, f as Unreachable, g as shownMember, h as serviceName, i as ImportAction, j as DismissedKey, k as Deletion, l as Transport, m as apiMember, n as CoffreClient, o as RouteInput, p as unreachable, q as SessionRow, r as CoffreError, s as RouteKey, t as ClientOptions, u as createClient, v as foldersOf, w as AuthorizationView, x as ApprovalView, y as AccessValue, z as MissingKey } from "./index-D0kM4Gfi.js";
2
+ export { type AccessValue, type Api, type ApprovalView, type AuditEntryView, type AuthInfo, type AuthorizationView, type BindingPlan, type BindingView, ClientOptions, CoffreClient, CoffreError, type ConnectedApp, type Decision, type Deletion, type DeletionResult, type DismissedKey, type DryRunOutcome, type DryRunResult, type IdentityRow, ImportAction, type ListedReference, type Me, type Member, type MemberAccess, type MissingKey, type OffboardingReport, Params, type ProjectSummary, type ReferenceView, type RemovedMember, RouteInput, RouteKey, RouteOutput, type SecretKey, type SecretVersion, type ServiceTokenRow, type SessionRow, type SetResult, type TokenPlan, Transport, Unreachable, type WorkloadIds, apiMember, byFolder, createClient, foldersOf, planImport, serviceName, shownMember, unreachable };
package/dist/index.js CHANGED
@@ -221,12 +221,19 @@ function createClient(options) {
221
221
  list: (path) => call("GET /members", {}, { path }),
222
222
  /** What they hold, and what to rotate if they leave. */
223
223
  get: (member) => call("GET /members/:member", { member }),
224
+ /** Their instance role and scope, and the grants you manage, in one read. */
225
+ access: (member) => call("GET /members/:member/access", { member }),
224
226
  add: (member, input = {}) => call("PUT /members/:member", { member }, input),
225
227
  /** Offboards; returns what to rotate. */
226
228
  remove: (member) => call("DELETE /members/:member", { member })
227
229
  },
228
230
  tokens: {
229
231
  list: (member) => call("GET /members/:member/tokens", { member }),
232
+ /** What the token would reach, as the server would issue it now; issues nothing. */
233
+ preview: (member, input) => {
234
+ const [method, route] = address("POST /members/:member/tokens", { member });
235
+ return send(method, `${route}?dryRun=1`, input);
236
+ },
230
237
  /** The value is in the answer, and only there. */
231
238
  issue: (member, input) => call("POST /members/:member/tokens", { member }, input),
232
239
  revoke: (member, id) => call("DELETE /members/:member/tokens/:id", {
@@ -317,6 +324,11 @@ set: (member, access) => call("PATCH /access/:member", { member }, access) },
317
324
  list: () => call("GET /apps", {}),
318
325
  disconnect: (id) => call("DELETE /apps/:id", { id })
319
326
  },
327
+ /** The instance's settings, for those who run it: where people set up service accounts themselves. */
328
+ settings: {
329
+ get: () => call("GET /settings", {}),
330
+ set: (input) => call("PUT /settings", {}, input)
331
+ },
320
332
  audit: {
321
333
  list: (query = {}) => call("GET /audit", {}, query),
322
334
  verify: () => call("GET /audit/verification", {}),
package/dist/routes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as Params, o as RouteInput, s as RouteKey } from "./index-ZGDlpCwB.js";
1
+ import { a as Params, o as RouteInput, s as RouteKey } from "./index-D0kM4Gfi.js";
2
2
  //#region src/routes.d.ts
3
3
  export type GetKey = Extract<RouteKey, `GET ${string}`>;
4
4
  /** Each GET route, with what to ask it. */
package/dist/routes.js CHANGED
@@ -19,12 +19,14 @@ function getCalls({ places, secrets, members, services }) {
19
19
  input: { path: `${first.project}/${first.environment}` }
20
20
  }]],
21
21
  "GET /members/:member": members.map((member) => ({ params: { member } })),
22
+ "GET /members/:member/access": members.map((member) => ({ params: { member } })),
22
23
  "GET /members/:member/tokens": services.map((member) => ({ params: { member } })),
23
24
  "GET /members/:member/bindings": services.map((member) => ({ params: { member } })),
24
25
  "GET /workloads/lookup": [{
25
26
  params: {},
26
27
  input: { github: "acme/api" }
27
28
  }],
29
+ "GET /settings": [{ params: {} }],
28
30
  "GET /sessions": [{ params: {} }],
29
31
  "GET /identities": [{ params: {} }],
30
32
  "GET /device-logins/:code": [{ params: { code: "BCDF-GHJK" } }],
@@ -86,6 +88,7 @@ const EVERY_ROUTE = {
86
88
  "POST /reveals": true,
87
89
  "GET /members": true,
88
90
  "GET /members/:member": true,
91
+ "GET /members/:member/access": true,
89
92
  "PUT /members/:member": true,
90
93
  "DELETE /members/:member": true,
91
94
  "GET /members/:member/tokens": true,
@@ -95,6 +98,8 @@ const EVERY_ROUTE = {
95
98
  "POST /members/:member/bindings": true,
96
99
  "DELETE /members/:member/bindings/:id": true,
97
100
  "GET /workloads/lookup": true,
101
+ "GET /settings": true,
102
+ "PUT /settings": true,
98
103
  "PATCH /access/:member": true,
99
104
  "GET /sessions": true,
100
105
  "DELETE /sessions/:id": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffre/client",
3
- "version": "0.4.5",
3
+ "version": "0.5.0",
4
4
  "description": "The coffre API as typed function calls.",
5
5
  "license": "MIT",
6
6
  "repository": {