@deliverd/sdk 0.3.0 → 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/types.d.ts CHANGED
@@ -72,6 +72,12 @@ export interface CreateApprovalInput {
72
72
  expiresAt?: string;
73
73
  /** Your own reference, returned unchanged and searchable. */
74
74
  externalId?: string;
75
+ /**
76
+ * The flow this belongs to, when it is one step of a larger piece of work.
77
+ * Must be an open flow in your organisation. `flow.approve()` and its
78
+ * siblings set this for you.
79
+ */
80
+ flowId?: string;
75
81
  metadata?: Record<string, unknown>;
76
82
  }
77
83
  /**
@@ -168,7 +174,7 @@ export interface CommentThread {
168
174
  }[];
169
175
  [key: string]: unknown;
170
176
  }
171
- export type WebhookEventName = "report.published" | "report.updated" | "report.shared" | "report.viewed" | "comment.created" | "access.requested" | "schedule.due" | "publish.held" | "approval.requested" | "approval.approved" | "approval.rejected" | "approval.expired" | "approval.question" | "approval.answered" | "review.requested" | "review.approved" | "review.changes_requested" | "collection.requested" | "collection.completed";
177
+ export type WebhookEventName = "report.published" | "report.updated" | "report.shared" | "report.viewed" | "comment.created" | "access.requested" | "schedule.due" | "publish.held" | "approval.requested" | "approval.approved" | "approval.rejected" | "approval.expired" | "approval.question" | "approval.answered" | "review.requested" | "review.approved" | "review.changes_requested" | "collection.requested" | "collection.completed" | "flow.completed";
172
178
  export interface WebhookEvent {
173
179
  event: WebhookEventName;
174
180
  sentAt: string;
@@ -204,6 +210,12 @@ export interface CreateReviewInput {
204
210
  expiresAt?: string;
205
211
  /** Your own reference, returned unchanged and searchable. */
206
212
  externalId?: string;
213
+ /**
214
+ * The flow this belongs to, when it is one step of a larger piece of work.
215
+ * Must be an open flow in your organisation. `flow.approve()` and its
216
+ * siblings set this for you.
217
+ */
218
+ flowId?: string;
207
219
  metadata?: Record<string, unknown>;
208
220
  }
209
221
  export interface ReviewerRef {
@@ -293,6 +305,12 @@ export interface CreateCollectionInput {
293
305
  /** After this the request closes unanswered. ISO 8601. */
294
306
  expiresAt?: string;
295
307
  externalId?: string;
308
+ /**
309
+ * The flow this belongs to, when it is one step of a larger piece of work.
310
+ * Must be an open flow in your organisation. `flow.approve()` and its
311
+ * siblings set this for you.
312
+ */
313
+ flowId?: string;
296
314
  metadata?: Record<string, unknown>;
297
315
  }
298
316
  export interface CollectionQuestion {
@@ -357,4 +375,134 @@ export interface ListCollectionsInput {
357
375
  externalId?: string;
358
376
  limit?: number;
359
377
  }
378
+ export type FlowStatus = "open" | "complete" | "cancelled";
379
+ export type FlowMemberKind = "approval" | "review" | "collection" | "report";
380
+ export interface FlowMember {
381
+ kind: FlowMemberKind;
382
+ id: string;
383
+ title: string;
384
+ /** The member's own status word, which differs by kind. */
385
+ status: string;
386
+ /** Still waiting on somebody. Always false for a report. */
387
+ open: boolean;
388
+ createdAt: string;
389
+ }
390
+ /** One line of the history: what happened, who did it, when. */
391
+ export interface FlowEvent {
392
+ event: string;
393
+ actor: string;
394
+ actorType: string;
395
+ resourceType: string | null;
396
+ resourceId: string | null;
397
+ at: string;
398
+ }
399
+ export interface FlowData {
400
+ id: string;
401
+ status: FlowStatus;
402
+ /** The timeline page a person can open. */
403
+ url: string;
404
+ title: string;
405
+ description: string | null;
406
+ externalId: string | null;
407
+ metadata: Record<string, unknown>;
408
+ startedBy: string;
409
+ members: FlowMember[];
410
+ memberCount: number;
411
+ openCount: number;
412
+ /** Nothing outstanding right now — not a claim that the job is finished. */
413
+ allSettled: boolean;
414
+ /** Present on a single read, absent from a list. */
415
+ timeline?: FlowEvent[];
416
+ settledAt: string | null;
417
+ createdAt: string;
418
+ }
419
+ export interface CreateFlowInput {
420
+ /** What this piece of work is, as the timeline will be titled. */
421
+ title: string;
422
+ /** What it is for, for whoever reads the history a year from now. */
423
+ description?: string;
424
+ workspaceId?: string;
425
+ /** Your own reference. Pass it and use `resume()` so a restart does not start a second flow. */
426
+ externalId?: string;
427
+ metadata?: Record<string, unknown>;
428
+ }
429
+ export interface ListFlowsInput {
430
+ status?: FlowStatus;
431
+ externalId?: string;
432
+ limit?: number;
433
+ }
434
+ export type EvidenceStepKind = "approval" | "review" | "collection" | "report";
435
+ export interface EvidenceOutcome {
436
+ who: string;
437
+ /** What they said, in the words the step uses: "approved", "answered". */
438
+ said: string;
439
+ note: string | null;
440
+ at: string;
441
+ }
442
+ export interface EvidenceStep {
443
+ kind: EvidenceStepKind;
444
+ id: string;
445
+ title: string;
446
+ status: string;
447
+ url: string;
448
+ createdAt: string;
449
+ settledAt: string | null;
450
+ requestedBy: string;
451
+ /** Whether an agent asked for this, which is the point of the record. */
452
+ requestedByAgent: boolean;
453
+ asked: string[];
454
+ outcomes: EvidenceOutcome[];
455
+ /** Whatever else the step records: the description, the questions, the answers. */
456
+ detail: Record<string, unknown>;
457
+ }
458
+ export interface EvidenceEvent {
459
+ at: string;
460
+ event: string;
461
+ actor: string;
462
+ actorType: string;
463
+ /** Which step it happened to, when it happened to one. */
464
+ step: string | null;
465
+ metadata: Record<string, unknown>;
466
+ }
467
+ export interface EvidencePack {
468
+ packVersion: number;
469
+ generatedAt: string;
470
+ generatedBy: string;
471
+ organisation: {
472
+ id: string;
473
+ name: string;
474
+ };
475
+ subject: {
476
+ kind: "flow" | "report";
477
+ id: string;
478
+ title: string;
479
+ url: string;
480
+ status: string;
481
+ startedBy: string;
482
+ startedAt: string;
483
+ };
484
+ summary: {
485
+ steps: number;
486
+ events: number;
487
+ firstEventAt: string | null;
488
+ lastEventAt: string | null;
489
+ };
490
+ steps: EvidenceStep[];
491
+ timeline: EvidenceEvent[];
492
+ /**
493
+ * What the digest does and does not stand for, in the pack's own words.
494
+ *
495
+ * `covers` says it detects a file altered after export. `doesNotCover` says
496
+ * it makes no claim about the database. Both travel with the pack rather
497
+ * than living only in documentation, because a reader who sees a hash and
498
+ * no sentence will assume the stronger one.
499
+ */
500
+ integrity: {
501
+ algorithm: "sha256";
502
+ digest: string;
503
+ covers: string;
504
+ doesNotCover: string;
505
+ recordsAreInsertOnly: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E,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;KAC5B,CAAC;IACF,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B;;;;;;;OAOG;IACH,SAAS,EAAE;QACT,SAAS,EAAE,QAAQ,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;CACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deliverd/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Add human approval to any AI agent. Ask a person, wait for the answer, act on it.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/dev.ts CHANGED
@@ -1,4 +1,10 @@
1
- import type { ApprovalData, CollectionData, ReviewData } from "./types.js";
1
+ import type {
2
+ ApprovalData,
3
+ CollectionData,
4
+ EvidencePack,
5
+ FlowData,
6
+ ReviewData,
7
+ } from "./types.js";
2
8
 
3
9
  /**
4
10
  * Development mode: the whole loop, on your machine, with nobody in it.
@@ -62,6 +68,7 @@ export function developmentFetch(options: DevelopmentOptions = {}): typeof globa
62
68
  const store = new Map<string, Stored>();
63
69
  const reviewStore = new Map<string, StoredReview>();
64
70
  const collectionStore = new Map<string, StoredCollection>();
71
+ const flowStore = new Map<string, FlowData>();
65
72
 
66
73
  return (async (input: string | URL | Request, init?: RequestInit) => {
67
74
  const url = new URL(String(input));
@@ -297,6 +304,109 @@ export function developmentFetch(options: DevelopmentOptions = {}): typeof globa
297
304
  });
298
305
  }
299
306
 
307
+ /*
308
+ * Flows in development are real objects with no simulation attached:
309
+ * there is nobody to imagine, and the thing worth exercising offline is
310
+ * that `flow.approve()` reaches the same code as `deliverd.approve()`.
311
+ * Members are not tracked here — the server derives them from rows this
312
+ * store does not keep — so a development flow reports what it knows and
313
+ * does not invent a membership.
314
+ */
315
+ if (method === "POST" && path === "/flows") {
316
+ const id = `flw_dev_${++counter}`;
317
+ const data: FlowData = {
318
+ id,
319
+ status: "open",
320
+ url: `https://deliverd.dev/flows/${id}`,
321
+ title: String(body.title ?? "Untitled"),
322
+ description: (body.description as string | undefined) ?? null,
323
+ externalId: (body.externalId as string | undefined) ?? null,
324
+ metadata: (body.metadata as Record<string, unknown>) ?? {},
325
+ startedBy: "You (development mode)",
326
+ members: [],
327
+ memberCount: 0,
328
+ openCount: 0,
329
+ allSettled: false,
330
+ timeline: [],
331
+ settledAt: null,
332
+ createdAt: new Date().toISOString(),
333
+ };
334
+ flowStore.set(id, data);
335
+ if (options.log !== false) {
336
+ console.log(`\n \u25B8 Flow started: ${data.title}\n ${data.url}\n`);
337
+ }
338
+ return json(data, 201);
339
+ }
340
+
341
+ /*
342
+ * Evidence in development is the shape and not the substance: this store
343
+ * holds no audit rows, so the pack comes back with the subject and an
344
+ * empty record rather than an invented one. What it proves is that
345
+ * `flow.evidence()` reaches the right path and returns something a caller
346
+ * can destructure — an imaginary approval trail would be worse than none.
347
+ */
348
+ const evidenceMatch = /^\/(flows|reports)\/([^/]+)\/evidence$/.exec(path);
349
+ if (evidenceMatch && method === "GET") {
350
+ const kind = evidenceMatch[1] === "flows" ? "flow" : "report";
351
+ const id = evidenceMatch[2]!;
352
+ const title = kind === "flow" ? (flowStore.get(id)?.title ?? "A flow") : "A report";
353
+ const now = new Date().toISOString();
354
+ const pack: EvidencePack = {
355
+ packVersion: 1,
356
+ generatedAt: now,
357
+ generatedBy: "You (development mode)",
358
+ organisation: { id: "org_dev", name: "Development" },
359
+ subject: {
360
+ kind,
361
+ id,
362
+ title,
363
+ url: `https://deliverd.dev/${evidenceMatch[1]}/${id}`,
364
+ status: "open",
365
+ startedBy: "You (development mode)",
366
+ startedAt: now,
367
+ },
368
+ summary: { steps: 0, events: 0, firstEventAt: null, lastEventAt: null },
369
+ steps: [],
370
+ timeline: [],
371
+ integrity: {
372
+ algorithm: "sha256",
373
+ digest: "development",
374
+ covers: "Nothing: this pack was produced in development mode and holds no records.",
375
+ doesNotCover: "Everything. Do not hand this to anybody.",
376
+ recordsAreInsertOnly: true,
377
+ },
378
+ };
379
+ return json(pack);
380
+ }
381
+
382
+ const flowMatch = /^\/flows\/([^/]+)(\/complete|\/cancel)?$/.exec(path);
383
+ if (flowMatch) {
384
+ const flow = flowStore.get(flowMatch[1]!);
385
+ if (!flow) {
386
+ return json(
387
+ { error: { code: "not_found", message: "No such flow in this development session." } },
388
+ 404
389
+ );
390
+ }
391
+ if (flowMatch[2] === "/complete" || flowMatch[2] === "/cancel") {
392
+ if (flow.status !== "open") {
393
+ return json(
394
+ { error: { code: "not_open", message: `This flow is already ${flow.status}.` } },
395
+ 409
396
+ );
397
+ }
398
+ flow.status = flowMatch[2] === "/complete" ? "complete" : "cancelled";
399
+ flow.settledAt = new Date().toISOString();
400
+ }
401
+ return json(flow);
402
+ }
403
+
404
+ if (method === "GET" && path === "/flows") {
405
+ const externalId = url.searchParams.get("externalId");
406
+ const all = [...flowStore.values()];
407
+ return json({ flows: externalId ? all.filter((f) => f.externalId === externalId) : all });
408
+ }
409
+
300
410
  return json(
301
411
  {
302
412
  error: {
package/src/flows.ts ADDED
@@ -0,0 +1,200 @@
1
+ import type { HttpClient } from "./http.js";
2
+ import type { CreateFlowInput, EvidencePack, FlowData, ListFlowsInput } from "./types.js";
3
+ /*
4
+ * Type-only, and therefore erased: `index.ts` imports this file at runtime,
5
+ * and a value import back would be a cycle. What the handle needs from the
6
+ * client is its three primitives with their real signatures, so that
7
+ * `flow.approve({…})` is checked exactly as `deliverd.approve({…})` is.
8
+ */
9
+ import type {
10
+ ApproveOptions,
11
+ CollectOptions,
12
+ Decision,
13
+ ReviewOptions,
14
+ ReviewOutcome,
15
+ } from "./index.js";
16
+ import type { CollectedAnswers } from "./types.js";
17
+
18
+ /**
19
+ * A flow: the thread that ties one job's approvals, reviews, collections and
20
+ * publishes together.
21
+ *
22
+ * The reason it exists in this SDK rather than only in the API is the handle
23
+ * below. An agent doing a multi-step job would otherwise carry a `flowId`
24
+ * through every call and pass it by hand each time — which works right up
25
+ * until one call is written without it, and that step is then missing from
26
+ * the history with nothing to say so. `flow.approve()` cannot forget.
27
+ *
28
+ * It groups and nothing else. Nothing waits on a flow; nothing is blocked by
29
+ * one; there are no steps to declare up front. Do the work in the order you
30
+ * want it done and name the flow as you go.
31
+ */
32
+
33
+ /** The three primitives a flow can start on your behalf, with their real signatures. */
34
+ export interface FlowPrimitives {
35
+ approve(options: ApproveOptions): Promise<Decision>;
36
+ review(options: ReviewOptions): Promise<ReviewOutcome>;
37
+ collect(options: CollectOptions): Promise<CollectedAnswers>;
38
+ }
39
+
40
+ export class Flow {
41
+ constructor(
42
+ private readonly http: HttpClient,
43
+ private data: FlowData,
44
+ private readonly client: FlowPrimitives
45
+ ) {}
46
+
47
+ get id(): string { return this.data.id; }
48
+ get status(): FlowData["status"] { return this.data.status; }
49
+ /** The timeline page a person can open. */
50
+ get url(): string { return this.data.url; }
51
+ get title(): string { return this.data.title; }
52
+ get members(): FlowData["members"] { return this.data.members; }
53
+ get timeline(): NonNullable<FlowData["timeline"]> { return this.data.timeline ?? []; }
54
+ get memberCount(): number { return this.data.memberCount; }
55
+ get openCount(): number { return this.data.openCount; }
56
+
57
+ get open(): boolean { return this.data.status === "open"; }
58
+ get complete(): boolean { return this.data.status === "complete"; }
59
+ get cancelled(): boolean { return this.data.status === "cancelled"; }
60
+
61
+ /**
62
+ * Nothing in it is waiting on anybody *at this moment*.
63
+ *
64
+ * Not a claim that the job is finished — you may be about to add the next
65
+ * step, and an empty flow is never settled. Branch on it to decide whether
66
+ * to move on; call `complete()` to say the work is over.
67
+ */
68
+ get allSettled(): boolean { return this.data.allSettled; }
69
+
70
+ toJSON(): FlowData { return this.data; }
71
+
72
+ async refresh(signal?: AbortSignal): Promise<this> {
73
+ this.data = await this.http.request<FlowData>({
74
+ method: "GET",
75
+ path: `/flows/${this.data.id}`,
76
+ signal,
77
+ });
78
+ return this;
79
+ }
80
+
81
+ /**
82
+ * Ask permission, inside this flow. Exactly `deliverd.approve()` with the
83
+ * flow already named — which is the point: a `flowId` passed by hand at
84
+ * four call sites is one that gets left off the fifth.
85
+ */
86
+ approve(options: Omit<ApproveOptions, "flowId">): Promise<Decision> {
87
+ return this.client.approve({ ...options, flowId: this.data.id });
88
+ }
89
+
90
+ /** Ask for judgement, inside this flow. */
91
+ review(options: Omit<ReviewOptions, "flowId">): Promise<ReviewOutcome> {
92
+ return this.client.review({ ...options, flowId: this.data.id });
93
+ }
94
+
95
+ /** Ask for facts, inside this flow. */
96
+ collect(options: Omit<CollectOptions, "flowId">): Promise<CollectedAnswers> {
97
+ return this.client.collect({ ...options, flowId: this.data.id });
98
+ }
99
+
100
+ /**
101
+ * The whole record of this flow: every step with who was asked and what they
102
+ * said, and the timeline across all of it.
103
+ *
104
+ * What to hand over when somebody asks you to show your working. Needs every
105
+ * read scope, because it contains everything.
106
+ */
107
+ evidence(signal?: AbortSignal): Promise<EvidencePack> {
108
+ return this.http.request<EvidencePack>({
109
+ method: "GET",
110
+ path: `/flows/${this.data.id}/evidence`,
111
+ signal,
112
+ });
113
+ }
114
+
115
+ /**
116
+ * Say the work is done. It stops taking new members from here.
117
+ *
118
+ * Named `close()` rather than `complete()` so it does not collide with the
119
+ * `complete` getter above, which every other primitive in this SDK also
120
+ * has; `flow.complete` asks, `flow.close()` decides.
121
+ *
122
+ * Allowed with steps still outstanding, and how many is recorded — a flow
123
+ * that could not be closed until every reviewer replied would be one that
124
+ * stayed open for ever.
125
+ */
126
+ async close(signal?: AbortSignal): Promise<this> {
127
+ this.data = await this.http.request<FlowData>({
128
+ method: "POST",
129
+ path: `/flows/${this.data.id}/complete`,
130
+ signal,
131
+ });
132
+ return this;
133
+ }
134
+
135
+ /** Call it off. The flow and its members stay as evidence; nothing inside is cancelled. */
136
+ async cancel(signal?: AbortSignal): Promise<this> {
137
+ this.data = await this.http.request<FlowData>({
138
+ method: "POST",
139
+ path: `/flows/${this.data.id}/cancel`,
140
+ signal,
141
+ });
142
+ return this;
143
+ }
144
+ }
145
+
146
+ export class Flows {
147
+ constructor(
148
+ private readonly http: HttpClient,
149
+ private readonly client: FlowPrimitives
150
+ ) {}
151
+
152
+ async create(input: CreateFlowInput, signal?: AbortSignal): Promise<Flow> {
153
+ const data = await this.http.request<FlowData>({
154
+ method: "POST",
155
+ path: "/flows",
156
+ body: input,
157
+ signal,
158
+ });
159
+ return new Flow(this.http, data, this.client);
160
+ }
161
+
162
+ async get(id: string, signal?: AbortSignal): Promise<Flow> {
163
+ const data = await this.http.request<FlowData>({
164
+ method: "GET",
165
+ path: `/flows/${id}`,
166
+ signal,
167
+ });
168
+ return new Flow(this.http, data, this.client);
169
+ }
170
+
171
+ async list(input: ListFlowsInput = {}, signal?: AbortSignal): Promise<Flow[]> {
172
+ const { flows } = await this.http.request<{ flows: FlowData[] }>({
173
+ method: "GET",
174
+ path: "/flows",
175
+ query: { status: input.status, externalId: input.externalId, limit: input.limit },
176
+ signal,
177
+ });
178
+ return flows.map((f) => new Flow(this.http, f, this.client));
179
+ }
180
+
181
+ /** The same job as before, when there was one — so a restart extends it rather than starting a second. */
182
+ async findByExternalId(externalId: string, signal?: AbortSignal): Promise<Flow | null> {
183
+ const found = await this.list({ externalId, limit: 1 }, signal);
184
+ return found[0] ?? null;
185
+ }
186
+
187
+ /**
188
+ * The flow for this reference, started if it does not exist yet.
189
+ *
190
+ * What a restartable agent actually wants: one line that is correct on the
191
+ * first run and on the fourth. Without it the caller writes the lookup, the
192
+ * branch and the create by hand, and a crash between the lookup and the
193
+ * create leaves two flows for one job.
194
+ */
195
+ async resume(input: CreateFlowInput & { externalId: string }, signal?: AbortSignal): Promise<Flow> {
196
+ const existing = await this.findByExternalId(input.externalId, signal);
197
+ if (existing && existing.open) return existing;
198
+ return this.create(input, signal);
199
+ }
200
+ }
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@ import { Approvals, FAST_POLL_SCHEDULE, type WaitOptions } from "./approvals.js"
3
3
  import { Comments, Reports } from "./reports.js";
4
4
  import { Reviews, type ReviewWaitOptions } from "./reviews.js";
5
5
  import { Collections, type CollectWaitOptions } from "./collections.js";
6
+ import { Flows } from "./flows.js";
6
7
  import { Webhooks } from "./webhooks.js";
7
8
  import { developmentFetch, type DevelopmentOptions } from "./dev.js";
8
9
  import { durationMs, type Duration } from "./duration.js";
@@ -22,6 +23,7 @@ export { Approval, Approvals, POLL_SCHEDULE, type WaitOptions } from "./approval
22
23
  export { Comments, Reports } from "./reports.js";
23
24
  export { Review, Reviews, type ReviewWaitOptions } from "./reviews.js";
24
25
  export { Collection, Collections, type CollectWaitOptions } from "./collections.js";
26
+ export { Flow, Flows, type FlowPrimitives } from "./flows.js";
25
27
  export {
26
28
  constructEvent,
27
29
  DELIVERY_HEADER,
@@ -133,6 +135,7 @@ export class Deliverd {
133
135
  readonly approvals: Approvals;
134
136
  readonly reviews: Reviews;
135
137
  readonly collections: Collections;
138
+ readonly flows: Flows;
136
139
  readonly reports: Reports;
137
140
  readonly comments: Comments;
138
141
  readonly webhooks: Webhooks;
@@ -155,6 +158,12 @@ export class Deliverd {
155
158
  this.approvals = new Approvals(this.http);
156
159
  this.reviews = new Reviews(this.http);
157
160
  this.collections = new Collections(this.http);
161
+ /*
162
+ * The handle takes the client so `flow.approve()` is the same call as
163
+ * `deliverd.approve()` with the flow filled in, rather than a second
164
+ * implementation that can drift from it.
165
+ */
166
+ this.flows = new Flows(this.http, this);
158
167
  this.reports = new Reports(this.http);
159
168
  this.comments = new Comments(this.http);
160
169
  this.webhooks = new Webhooks();
package/src/reports.ts CHANGED
@@ -5,6 +5,7 @@ import type {
5
5
  PublishResult,
6
6
  ReportData,
7
7
  UpdateReportInput,
8
+ EvidencePack,
8
9
  } from "./types.js";
9
10
 
10
11
  /**
@@ -44,6 +45,22 @@ export class Reports {
44
45
  });
45
46
  }
46
47
 
48
+ /**
49
+ * The whole record behind a report: the approvals, reviews and requests for
50
+ * information that point at it, its version history, and the timeline across
51
+ * all of it.
52
+ *
53
+ * The subject an auditor usually names — and unlike a flow, it works for
54
+ * work that was done before flows existed. Needs every read scope.
55
+ */
56
+ evidence(idOrSlug: string, signal?: AbortSignal): Promise<EvidencePack> {
57
+ return this.http.request<EvidencePack>({
58
+ method: "GET",
59
+ path: `/reports/${encodeURIComponent(idOrSlug)}/evidence`,
60
+ signal,
61
+ });
62
+ }
63
+
47
64
  get(idOrSlug: string, signal?: AbortSignal): Promise<ReportData> {
48
65
  return this.http.request({
49
66
  method: "GET",