@coffre/client 0.10.2 → 0.12.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.js CHANGED
@@ -1,486 +1,2 @@
1
- //#region src/reach.ts
2
- /** Two colons or more, in hex: an IPv6 address, as `::1` or `2001:db8::1:443` with its port. */
3
- const IPV6 = /[0-9a-f]*:[0-9a-f]*:[0-9a-f:]*/i;
4
- const TIMEOUT_OR_REFUSAL = /* @__PURE__ */ new Set([
5
- "ECONNREFUSED",
6
- "ETIMEDOUT",
7
- "UND_ERR_CONNECT_TIMEOUT",
8
- "ENETUNREACH",
9
- "EHOSTUNREACH"
10
- ]);
11
- /** What to try for the common causes; null for the others. */
12
- function hint(cause) {
13
- const code = cause.code ?? "";
14
- if (code === "ENOTFOUND" || code === "EAI_AGAIN") return "the name does not resolve here: check the address, or flush this machine's DNS cache";
15
- const tried = [cause, ...cause.errors ?? []].flatMap((each) => [each.address ?? "", each.message]);
16
- if (TIMEOUT_OR_REFUSAL.has(code) && tried.some((each) => IPV6.test(each))) return "it was tried over IPv6, which this network may not carry: try NODE_OPTIONS=--dns-result-order=ipv4first";
17
- if (/CERT|UNABLE_TO_VERIFY|SELF_SIGNED/.test(code)) return "something between you and the instance, such as a proxy or a network filter, presents its own certificate";
18
- return null;
19
- }
20
- /** The cause's own words, with its code and address when they don't already say them. */
21
- function described(cause) {
22
- const said = cause.message || (cause.errors ?? []).map((each) => each.message).join(", ");
23
- const address = cause.address === void 0 ? void 0 : cause.port === void 0 ? cause.address : `${cause.address}:${cause.port}`;
24
- const more = [cause.code, address].filter((each) => each !== void 0 && !said.includes(each));
25
- if (said === "") return more.join(" ") || cause.name;
26
- return more.length === 0 ? said : `${said} (${more.join(", ")})`;
27
- }
28
- /**
29
- * `could not reach <origin>: <why>`, and what to try when the cause is a
30
- * common one: `could not reach https://x: getaddrinfo ENOTFOUND x; the name
31
- * does not resolve here: …`.
32
- */
33
- function unreachable(origin, error) {
34
- const cause = error instanceof Error && error.cause instanceof Error ? error.cause : null;
35
- if (cause === null) return `could not reach ${origin}: ${error instanceof Error ? error.message : String(error)}`;
36
- const then = hint(cause);
37
- return `could not reach ${origin}: ${described(cause)}${then === null ? "" : `; ${then}`}`;
38
- }
39
- /** A request that never reached the instance: its message says why, `cause` is what `fetch` threw. */
40
- var Unreachable = class extends Error {
41
- origin;
42
- constructor(origin, error) {
43
- super(unreachable(origin, error), { cause: error });
44
- this.name = "Unreachable";
45
- this.origin = origin;
46
- }
47
- };
48
- //#endregion
49
- //#region src/age.ts
50
- const DAY = 864e5;
51
- /**
52
- * Whole days since a key's value was written (`updatedAt`, a reference's
53
- * source's): 0 on the day it was. Null while it reads no value.
54
- */
55
- function ageInDays(entry, now = Date.now()) {
56
- return entry.updatedAt === null ? null : Math.max(0, Math.floor((now - Date.parse(entry.updatedAt)) / DAY));
57
- }
58
- /**
59
- * Whether a key's value has gone unchanged for more than `days` whole days:
60
- * against the deployment's `rotateAfterDays`, due for rotation. An archived
61
- * key, which nothing reads, and a key with no value never are.
62
- */
63
- function olderThan(entry, days, now = Date.now()) {
64
- const age = ageInDays(entry, now);
65
- return !entry.archived && age !== null && age > days;
66
- }
67
- //#endregion
68
- //#region src/folders.ts
69
- /**
70
- * Rows grouped by folder, as every list shows them: those in no folder
71
- * first, then each folder by name, each keeping the order it was given. A
72
- * folder only arranges a list (docs/design/environments.md).
73
- */
74
- function byFolder(rows) {
75
- const groups = /* @__PURE__ */ new Map([[null, []]]);
76
- for (const folder of [...new Set(rows.flatMap((row) => row.folder === null ? [] : [row.folder]))].sort()) groups.set(folder, []);
77
- for (const row of rows) groups.get(row.folder).push(row);
78
- return [...groups].filter(([, inFolder]) => inFolder.length > 0);
79
- }
80
- /** The folders in use among `rows`, by name. */
81
- function foldersOf(rows) {
82
- return [...new Set(rows.flatMap((row) => row.folder === null ? [] : [row.folder]))].sort();
83
- }
84
- //#endregion
85
- //#region src/members.ts
86
- /**
87
- * How members are named, to people and to the API. A service account, a
88
- * machine identity that signs in by OIDC (trust bindings) or with bearer
89
- * tokens, is `service:<name>` wherever a person reads or types one. The
90
- * API, the vault and the audit log keep `token:<name>`, which the log's
91
- * signed entries hold: so the rename is here, at the edges, and nothing
92
- * stored or verified changes.
93
- */
94
- /** A member as people read it: `service:deploy` for the API's `token:deploy`; anyone else as they are. */
95
- function shownMember(member) {
96
- return member.startsWith("token:") ? `service:${member.slice(6)}` : member;
97
- }
98
- /** A member as the API takes it, from what a person typed: `service:deploy` and `token:deploy` alike name a service account. */
99
- function apiMember(member) {
100
- return member.startsWith("service:") ? `token:${member.slice(8)}` : member;
101
- }
102
- /** A service account's name alone, from any of its forms: `deploy`, `service:deploy` or `token:deploy`. */
103
- function serviceName(member) {
104
- return member.replace(/^(?:service|token):/, "");
105
- }
106
- //#endregion
107
- //#region src/index.ts
108
- /** The API's error shape, `{ error, message }`, with the HTTP status. */
109
- var CoffreError = class extends Error {
110
- status;
111
- code;
112
- /** The vault's own code when it refused: `no_grant`, `removed`, `bulk_limit`, ... */
113
- reason;
114
- constructor(status, code, message, reason) {
115
- super(message);
116
- this.name = "CoffreError";
117
- this.status = status;
118
- this.code = code;
119
- this.reason = reason;
120
- }
121
- };
122
- /** `market/prod/KEY` as route parameters. */
123
- function place(path) {
124
- const [project = "", environment = "", key = ""] = path.replace(/^\/+|\/+$/g, "").split("/");
125
- return {
126
- project,
127
- environment,
128
- key
129
- };
130
- }
131
- /** `?revision=57.3f9a0c2e81b4d7a6`, or nothing for a change asked without its preview. */
132
- function asPreviewed(revision) {
133
- return revision === void 0 ? "" : `?revision=${encodeURIComponent(revision)}`;
134
- }
135
- function createClient(options) {
136
- const origin = options.url.replace(/\/+$/, "");
137
- const transport = options.transport ?? (async (request) => {
138
- try {
139
- return await fetch(request);
140
- } catch (error) {
141
- throw new Unreachable(origin, error);
142
- }
143
- });
144
- async function send(method, path, input) {
145
- const url = new URL(`${origin}/api${path}`);
146
- const headers = new Headers(await options.headers?.());
147
- let body;
148
- if (method === "GET") {
149
- for (const [name, value] of Object.entries(input ?? {})) if (value !== void 0 && value !== null) url.searchParams.set(name, String(value));
150
- } else if (input !== void 0) {
151
- headers.set("content-type", "application/json");
152
- body = JSON.stringify(input);
153
- }
154
- const response = await transport(new Request(url, {
155
- method,
156
- headers,
157
- body
158
- }));
159
- const payload = await response.json().catch(() => null);
160
- if (!response.ok) {
161
- const error = payload;
162
- throw new CoffreError(response.status, typeof error?.error === "string" ? error.error : "http_error", typeof error?.message === "string" ? error.message : `request failed with status ${response.status}`, typeof error?.reason === "string" ? error.reason : void 0);
163
- }
164
- return payload;
165
- }
166
- /** A route key and its parameters as a method and a path. */
167
- function address(key, params) {
168
- const [method, pattern] = key.split(" ");
169
- return [method, pattern.replace(/:(\w+)/g, (_, name) => encodeURIComponent(params[name]))];
170
- }
171
- /** Any route by its key: `call('GET /secrets/:project/:environment', { project, environment })`. */
172
- async function call(key, ...[params, input]) {
173
- const [method, path] = address(key, params);
174
- return await send(method, path, input);
175
- }
176
- return {
177
- call,
178
- /** How this instance signs people in. Answers anyone, signed in or not. */
179
- auth: () => send("GET", "/auth", void 0),
180
- /** Who I am, and every place I can reach. */
181
- me: () => call("GET /me", {}),
182
- projects: {
183
- /** With their environments. */
184
- list: () => call("GET /projects", {}),
185
- /** Its `name`, which releases before 0.6.2 show, defaults to the slug. */
186
- create: (project, input = {}) => call("PUT /projects/:project", { project }, input),
187
- update: (project, patch) => call("PATCH /projects/:project", { project }, patch),
188
- /** What deleting an archived project would erase and revoke; changes nothing. */
189
- previewDelete: (project) => {
190
- const [method, route] = address("DELETE /projects/:project", { project });
191
- return send(method, `${route}?dryRun=1`, void 0);
192
- },
193
- /** Delete an archived project for good: its values erased, its grants revoked, its slug free. Owners only. */
194
- delete: (project) => call("DELETE /projects/:project", { project })
195
- },
196
- environments: {
197
- /** As a project's: its `name` defaults to the slug. `from` forks a sibling. */
198
- create: (path, input = {}) => call("PUT /projects/:project/:environment", place(path), input),
199
- update: (path, patch) => call("PATCH /projects/:project/:environment", place(path), patch),
200
- /**
201
- * Protected, a person holds their role's protected column there
202
- * (docs/design/roles.md); whoever manages the project's environments
203
- * protects one, and only an Owner of the whole instance unprotects it.
204
- */
205
- protect: (path, on = true) => call("PATCH /projects/:project/:environment", place(path), { protected: on }),
206
- /** What deleting an archived environment would erase and revoke; changes nothing. */
207
- previewDelete: (path) => {
208
- const [method, route] = address("DELETE /projects/:project/:environment", place(path));
209
- return send(method, `${route}?dryRun=1`, void 0);
210
- },
211
- /** Delete an archived environment for good, as a project is. Owners only. */
212
- delete: (path) => call("DELETE /projects/:project/:environment", place(path)),
213
- /** The keys its sibling environments have and it lacks, read or not, and those its team dismissed. */
214
- missing: (path) => call("GET /projects/:project/:environment/missing", place(path)),
215
- /** A project's personal configs, for whoever manages its environments: whose, of what, and their key names. */
216
- personal: (project) => call("GET /personal/:project", place(project)),
217
- /**
218
- * A version of what reading it would open: it changes whenever a read
219
- * would, and reads no value, so it is not logged. Poll it, and read
220
- * only when it changed.
221
- */
222
- version: (path) => call("GET /projects/:project/:environment/version", place(path)),
223
- /** Dismiss missing keys (`true`) or restore them (`null`). */
224
- dismiss: (path, patch) => call("PATCH /projects/:project/:environment/dismissals", place(path), patch)
225
- },
226
- secrets: {
227
- /** Keys, versions and who changed what; never values. */
228
- list: (path) => call("GET /secrets/:project/:environment", place(path)),
229
- /** Decrypts one secret, or every secret in an environment. Logged in your name. */
230
- reveal: (path) => call("POST /reveals", {}, { path }),
231
- /** One transaction, a version and an audit entry per key; `null` archives. */
232
- set: (path, values) => call("PATCH /secrets/:project/:environment", place(path), values),
233
- /**
234
- * What `set` would do to each key, `added`, `changed`, `unchanged` or
235
- * `archived`, and nothing else: no value comes back and nothing is
236
- * written. Comparing opens the current values, logged as reads.
237
- */
238
- dryRun: (path, values) => {
239
- const [method, route] = address("PATCH /secrets/:project/:environment", place(path));
240
- return send(method, `${route}?dryRun=1`, values);
241
- },
242
- history: (path) => call("GET /secrets/:project/:environment/:key/versions", place(path)),
243
- /** A new version holding the old one's value. */
244
- restore: (path, version) => call("POST /secrets/:project/:environment/:key/restore", place(path), { version }),
245
- rename: (path, key) => call("PATCH /secrets/:project/:environment/:key", place(path), { key }),
246
- update: (path, patch) => call("PATCH /secrets/:project/:environment/:key", place(path), patch),
247
- /**
248
- * In a fork, a key back to its parent's value (`true`), its own kept,
249
- * or its own served again (`false`); `from` holds the parent's.
250
- */
251
- inherit: (path, inherit) => call("PATCH /secrets/:project/:environment/:key", place(path), { inherit })
252
- },
253
- /**
254
- * References: secrets read through others (docs/design/environments.md).
255
- * A key becomes one with `secrets.set(path, { KEY: { ref: 'market/prod/KEY' } })`.
256
- */
257
- references: {
258
- /** The live references into and out of a place, `market`, `market/prod` or `market/prod/KEY`, and who reads through them. */
259
- list: (path) => call("GET /references", {}, { path }),
260
- /** Break the reference a secret is: its readers stop reading the source through it. */
261
- break: (path) => call("DELETE /secrets/:project/:environment/:key/reference", place(path))
262
- },
263
- members: {
264
- /** People and tokens, their role and their access; at a place, those who reach it. */
265
- list: (path) => call("GET /members", {}, { path }),
266
- /** What they hold, and what to rotate if they leave. */
267
- get: (member) => call("GET /members/:member", { member }),
268
- /** Their instance role and scope, and the grants you manage, in one read. */
269
- access: (member) => call("GET /members/:member/access", { member }),
270
- add: (member, input = {}) => call("PUT /members/:member", { member }, input),
271
- /** Offboards; returns what to rotate. */
272
- remove: (member) => call("DELETE /members/:member", { member })
273
- },
274
- /**
275
- * A member's tokens: a service account's bearer tokens, or a person's
276
- * personal tokens (`user:<email>`), which act as them within their scope.
277
- */
278
- tokens: {
279
- list: (member) => call("GET /members/:member/tokens", { member }),
280
- /** What the token would reach, as the server would issue it now; issues nothing. */
281
- preview: (member, input) => {
282
- const [method, route] = address("POST /members/:member/tokens", { member });
283
- return send(method, `${route}?dryRun=1`, input);
284
- },
285
- /** The value is in the answer, and only there. */
286
- issue: (member, input) => call("POST /members/:member/tokens", { member }, input),
287
- revoke: (member, id) => call("DELETE /members/:member/tokens/:id", {
288
- member,
289
- id
290
- })
291
- },
292
- /**
293
- * Handles: placeholders a person's app holds in place of an environment's
294
- * values, which only the credential proxy (`/use`) takes. The value is
295
- * in the answer, and only there; it is revoked as a token is.
296
- */
297
- handles: { create: (input) => call("POST /handles", {}, input) },
298
- /** Trust bindings: which CI runs may sign in as a service, by their platform's ID token. */
299
- bindings: {
300
- list: (member) => call("GET /members/:member/bindings", { member }),
301
- /** The binding as it would be saved, the keys its issuer names, and what it replaces; writes nothing. */
302
- preview: (member, input) => {
303
- const [method, route] = address("POST /members/:member/bindings", { member });
304
- return send(method, `${route}?dryRun=1`, input);
305
- },
306
- create: (member, input) => call("POST /members/:member/bindings", { member }, input),
307
- /** The service's bindings on an issuer that new keys would replace, and the keys as checked; writes nothing. */
308
- previewKeys: (member, input) => {
309
- const [method, route] = address("POST /members/:member/bindings/keys", { member });
310
- return send(method, `${route}?dryRun=1`, input);
311
- },
312
- /** New keys, uploaded, for every binding of the service on the issuer: each replaced by one the same but for them. */
313
- replaceKeys: (member, input) => call("POST /members/:member/bindings/keys", { member }, input),
314
- remove: (member, id) => call("DELETE /members/:member/bindings/:id", {
315
- member,
316
- id
317
- }),
318
- /** A GitHub repository's or GitLab project's IDs, which bindings name: a public one's, or one the deployment's GitHub App is installed on. */
319
- lookup: (input) => call("GET /workloads/lookup", {}, input),
320
- /** The repositories the deployment's GitHub App is installed on, private ones too; `{ app: null }` without one. */
321
- repositories: () => call("GET /workloads/repositories", {})
322
- },
323
- access: {
324
- /** What they should hold at each place; the server applies the difference. `null` revokes. */
325
- set: (member, access) => call("PATCH /access/:member", { member }, access) },
326
- /** Where I am signed in. Only where coffre runs its own sign-in. */
327
- sessions: {
328
- list: () => call("GET /sessions", {}),
329
- revoke: (id) => call("DELETE /sessions/:id", { id })
330
- },
331
- /** The accounts I sign in with. */
332
- identities: {
333
- list: () => call("GET /identities", {}),
334
- unlink: (id) => call("DELETE /identities/:id", { id })
335
- },
336
- /** A `coffre login` waiting for someone to approve it, by the code it shows. */
337
- deviceLogins: {
338
- get: (code) => call("GET /device-logins/:code", { code }),
339
- decide: (code, approve) => call("POST /device-logins/:code", { code }, { approve })
340
- },
341
- /**
342
- * Folders, which arrange lists and do nothing else: a folder exists while
343
- * something is filed in it. Renaming one re-files all of it, onto a folder
344
- * that exists merges the two; removing one takes all of it out, each item
345
- * staying where it is, in no folder. Moving one item is `projects.update`
346
- * or `secrets.update` with a `folder`.
347
- */
348
- folders: {
349
- /** A folder of projects, renamed. Takes managing every project in it. */
350
- rename: (folder, name) => call("PATCH /folders/:folder", { folder }, { name }),
351
- /** Every project out of a folder. */
352
- remove: (folder) => call("DELETE /folders/:folder", { folder }),
353
- /** One of an environment's key folders, `market/prod`, renamed. Takes writing there. */
354
- renameKeys: (environment, folder, name) => {
355
- const { project, environment: slug } = place(environment);
356
- return call("PATCH /folders/:project/:environment/:folder", {
357
- project,
358
- environment: slug,
359
- folder
360
- }, { name });
361
- },
362
- /** Every key out of one of an environment's folders. */
363
- removeKeys: (environment, folder) => {
364
- const { project, environment: slug } = place(environment);
365
- return call("DELETE /folders/:project/:environment/:folder", {
366
- project,
367
- environment: slug,
368
- folder
369
- });
370
- }
371
- },
372
- /**
373
- * An MCP client asking to connect, by its authorization request, and the
374
- * person's answer: where to send the browser next.
375
- */
376
- oauth: {
377
- describe: (request) => call("GET /oauth/authorizations", {}, request),
378
- decide: (input) => call("POST /oauth/authorizations", {}, input)
379
- },
380
- /** The MCP clients I connected. */
381
- /** A change an MCP client asked for: what it would do, and the person's decision, which makes it. */
382
- approvals: {
383
- get: (id) => call("GET /approvals/:id", { id }),
384
- decide: (id, input) => call("POST /approvals/:id", { id }, input)
385
- },
386
- apps: {
387
- list: () => call("GET /apps", {}),
388
- disconnect: (id) => call("DELETE /apps/:id", { id })
389
- },
390
- /**
391
- * The instance's roles, in two columns, an environment's that is not
392
- * protected and one's that is (docs/design/roles.md). Any member lists
393
- * them; an Owner of the whole instance edits them. `instance` is about
394
- * instance roles, a person's across every project in their scope.
395
- */
396
- roles: {
397
- list: () => call("GET /roles", {}),
398
- /** What defining the role so would do to everyone it reaches; changes nothing. */
399
- preview: (role, definition, { instance = false } = {}) => {
400
- const [method, route] = instance ? address("PUT /instance-roles/:role", { role }) : address("PUT /roles/:role", { role });
401
- return send(method, `${route}?dryRun=1`, definition);
402
- },
403
- /**
404
- * A built-in role edited, or one an Owner makes. With its preview's
405
- * `revision`, made as previewed, or refused (409 `policy_changed`)
406
- * if the policy changed since: preview it again.
407
- */
408
- set: (role, definition, { instance = false, revision } = {}) => {
409
- const [method, route] = instance ? address("PUT /instance-roles/:role", { role }) : address("PUT /roles/:role", { role });
410
- return send(method, `${route}${asPreviewed(revision)}`, definition);
411
- },
412
- /** What putting it back as it ships, or deleting one an Owner made, would do; changes nothing. */
413
- previewReset: (role, { instance = false } = {}) => {
414
- const [method, route] = instance ? address("DELETE /instance-roles/:role", { role }) : address("DELETE /roles/:role", { role });
415
- return send(method, `${route}?dryRun=1`, void 0);
416
- },
417
- /** A built-in role back as it ships; one an Owner made, deleted, while no grant names it. With its preview's `revision`, as `set`. */
418
- reset: (role, { instance = false, revision } = {}) => {
419
- const [method, route] = instance ? address("DELETE /instance-roles/:role", { role }) : address("DELETE /roles/:role", { role });
420
- return send(method, `${route}${asPreviewed(revision)}`, void 0);
421
- }
422
- },
423
- /** The instance's settings, for those who run it: where people set up service accounts themselves. */
424
- settings: {
425
- get: () => call("GET /settings", {}),
426
- set: (input) => call("PUT /settings", {}, input)
427
- },
428
- audit: {
429
- list: (query = {}) => call("GET /audit", {}, query),
430
- /**
431
- * Whether the log holds, from the newest checkpoint; or, with `from`, a
432
- * stretch of the walk from the first entry: `start`, then each `next`
433
- * until it is null (`verifyWhole`).
434
- */
435
- verify: (query = {}) => call("GET /audit/verification", {}, query),
436
- /**
437
- * The walk from the first entry to the head, a stretch a request, each
438
- * as long as the server walks in one: the first stretch that fails, or
439
- * the last. `onStretch` sees each verdict as it comes.
440
- */
441
- verifyWhole: async (onStretch = () => {}) => {
442
- for (let from = "start";;) {
443
- const verdict = await call("GET /audit/verification", {}, { from });
444
- onStretch(verdict);
445
- if (!verdict.ok || verdict.next === void 0 || verdict.next === null) return verdict;
446
- from = verdict.next;
447
- }
448
- },
449
- /** What an escrowed key is checked against: public material, for admins and owners of the whole instance. */
450
- keys: () => call("GET /audit/keys", {})
451
- }
452
- };
453
- }
454
- /**
455
- * What writing these entries (a parsed `.env` file) would do, from a dry run
456
- * of the write: the server compares, so no value leaves it, and the values it
457
- * opens to compare are logged as reads. `changes` is what to pass to
458
- * `secrets.set`: the keys that differ, so an unchanged value does not become
459
- * a new version.
460
- */
461
- async function planImport(coffre, path, entries) {
462
- const values = Object.create(null);
463
- for (const { key, value } of entries) values[key] = value;
464
- const [listed, compared] = await Promise.allSettled([coffre.secrets.list(path), coffre.secrets.dryRun(path, { ...values })]);
465
- if (listed.status === "rejected") throw listed.reason;
466
- if (compared.status === "rejected") throw compared.reason;
467
- const [{ keys }, dryRun] = [listed.value, compared.value];
468
- const versions = new Map(keys.map((entry) => [entry.key, entry.version]));
469
- const plan = [];
470
- const changes = Object.create(null);
471
- for (const [key, value] of Object.entries(values)) {
472
- const action = dryRun.keys[key];
473
- plan.push({
474
- key,
475
- action,
476
- version: versions.get(key) ?? null
477
- });
478
- if (action !== "unchanged") changes[key] = value;
479
- }
480
- return {
481
- plan,
482
- changes: { ...changes }
483
- };
484
- }
485
- //#endregion
1
+ import { a as serviceName, c as foldersOf, d as Unreachable, f as unreachable, i as apiMember, l as ageInDays, n as createClient, o as shownMember, r as planImport, s as byFolder, t as CoffreError, u as olderThan } from "./src-CjUBSxZs.js";
486
2
  export { CoffreError, Unreachable, ageInDays, apiMember, byFolder, createClient, foldersOf, olderThan, planImport, serviceName, shownMember, unreachable };
package/dist/routes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as Params, o as RouteInput, s as RouteKey } from "./index-D86fJBDd.js";
1
+ import { a as Params, o as RouteInput, s as RouteKey } from "./index-DxSvWq3r.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
@@ -24,11 +24,16 @@ function getCalls({ places, secrets, members, services }) {
24
24
  "GET /members/:member/access": members.map((member) => ({ params: { member } })),
25
25
  "GET /members/:member/tokens": services.map((member) => ({ params: { member } })),
26
26
  "GET /members/:member/bindings": services.map((member) => ({ params: { member } })),
27
+ "GET /members/:member/bindings/:id/enrollments": services.map((member) => ({ params: {
28
+ member,
29
+ id: "00000000-0000-4000-8000-000000000000"
30
+ } })),
27
31
  "GET /workloads/lookup": [{
28
32
  params: {},
29
33
  input: { github: "acme/api" }
30
34
  }],
31
35
  "GET /workloads/repositories": [{ params: {} }],
36
+ "GET /freezes": [{ params: {} }],
32
37
  "GET /roles": [{ params: {} }],
33
38
  "GET /settings": [{ params: {} }],
34
39
  "GET /sessions": [{ params: {} }],
@@ -101,10 +106,18 @@ const EVERY_ROUTE = {
101
106
  "POST /members/:member/tokens": true,
102
107
  "DELETE /members/:member/tokens/:id": true,
103
108
  "POST /handles": true,
109
+ "DELETE /handles/:id": true,
104
110
  "GET /members/:member/bindings": true,
105
111
  "POST /members/:member/bindings": true,
106
112
  "POST /members/:member/bindings/keys": true,
107
113
  "DELETE /members/:member/bindings/:id": true,
114
+ "GET /members/:member/bindings/:id/enrollments": true,
115
+ "POST /members/:member/bindings/:id/enrollments": true,
116
+ "POST /members/:member/bindings/:id/enrollments/:enrollment/promote": true,
117
+ "POST /members/:member/tokens/:id/approve": true,
118
+ "GET /freezes": true,
119
+ "POST /freezes": true,
120
+ "DELETE /freezes/:target": true,
108
121
  "GET /workloads/lookup": true,
109
122
  "GET /workloads/repositories": true,
110
123
  "GET /roles": true,