@deliverd/sdk 0.6.2 → 0.7.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/dist/types.d.ts CHANGED
@@ -50,7 +50,10 @@ export interface ApprovalData {
50
50
  requiredApprovals: number;
51
51
  /** How many have approved so far. Compare with `requiredApprovals`. */
52
52
  approvalsSoFar: number;
53
+ /** Who decided, as a name rather than an id — the same as a review's `by`. */
53
54
  decidedBy: string | null;
55
+ /** Their user id, for anything that needs the key rather than the person. */
56
+ decidedById: string | null;
54
57
  decidedAt: string | null;
55
58
  /** The approver's reason, on a rejection or an approval that carried one. */
56
59
  note: string | null;
@@ -111,7 +114,10 @@ export type Decision = {
111
114
  status: "approved" | "rejected" | "expired" | "cancelled";
112
115
  /** Their reason, when they gave one. */
113
116
  note: string | null;
117
+ /** Who decided, as a name rather than an id. Log it; put it in a message. */
114
118
  decidedBy: string | null;
119
+ /** Their user id, when the key is what you need. */
120
+ decidedById: string | null;
115
121
  decidedAt: string | null;
116
122
  id: string;
117
123
  /** The page they decided on. Worth logging. */
@@ -122,7 +128,10 @@ export type Decision = {
122
128
  export interface ListApprovalsInput {
123
129
  status?: ApprovalStatus;
124
130
  externalId?: string;
131
+ /** One page of this size. Leave it unset to get every row. */
125
132
  limit?: number;
133
+ /** `nextCursor` from a previous page. Only meaningful with `limit`. */
134
+ cursor?: string;
126
135
  }
127
136
  export interface InlineFile {
128
137
  path: string;
@@ -178,19 +187,137 @@ export interface PublishResult {
178
187
  warnings?: string[];
179
188
  [key: string]: unknown;
180
189
  }
190
+ /**
191
+ * One open thread, as the organisation-wide list returns it.
192
+ *
193
+ * Deliberately thinner than a `CommentThread`: this answers "where is the
194
+ * feedback" across every report, so it carries the report and the quoted
195
+ * passage rather than the whole conversation. Fetch the thread itself with
196
+ * `comments.list(reportId)` once you know which report to look at.
197
+ */
198
+ export interface OpenThread {
199
+ threadId: string;
200
+ reportId: string;
201
+ reportTitle: string;
202
+ reportSlug: string;
203
+ /** Who owns the report — filter on it to find the threads on yours. */
204
+ reportOwnerId: string | null;
205
+ quote: string | null;
206
+ author: string;
207
+ authorType: string;
208
+ messages: number;
209
+ lastActivityAt: string;
210
+ }
211
+ /**
212
+ * What a send did, per address.
213
+ *
214
+ * `delivered` is the mail provider accepting it, not the person reading it —
215
+ * and `alreadyHadAccess` names the recipients who could already open the
216
+ * report, who were emailed again anyway. Re-sending to somebody who says
217
+ * they never got the first one is the point.
218
+ */
219
+ export interface SendResult {
220
+ sent: {
221
+ email: string;
222
+ delivered: boolean;
223
+ }[];
224
+ alreadyHadAccess: string[];
225
+ }
226
+ /**
227
+ * A recurring publish an agent is expected to perform.
228
+ *
229
+ * `due` is the useful field: true once the schedule has fired and nobody has
230
+ * acted on that firing. Publishing a new version clears it, and so does
231
+ * writing a dataset — for a report that reads its numbers from `_data/…`,
232
+ * updating the data is the whole job.
233
+ */
234
+ export interface ScheduleSummary {
235
+ id: string;
236
+ reportId: string;
237
+ reportSlug: string;
238
+ reportTitle: string;
239
+ reportUrl: string;
240
+ agentId: string;
241
+ agentName: string;
242
+ /** Five-field cron expression, evaluated in UTC. */
243
+ recurrence: string;
244
+ enabled: boolean;
245
+ lastRunAt: string | null;
246
+ nextRunAt: string | null;
247
+ currentVersion: number | null;
248
+ due: boolean;
249
+ dueSince: string | null;
250
+ }
181
251
  export interface CommentThread {
182
252
  threadId: string;
183
253
  status: "open" | "resolved";
184
254
  quote: string | null;
185
255
  messages: {
256
+ /** What `comments.retract` takes. */
257
+ commentId: string;
186
258
  author: string;
187
259
  authorType: string;
188
260
  body: string;
189
261
  createdAt: string;
262
+ /** True for the one message this credential could still take back. */
263
+ retractable: boolean;
190
264
  }[];
191
265
  [key: string]: unknown;
192
266
  }
193
- 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";
267
+ /** Who read one report. The detail beyond `totalViews` needs the analytics plan. */
268
+ export interface ReportAnalytics {
269
+ reportId: string;
270
+ title: string;
271
+ totalViews: number;
272
+ uniqueViewers: number | null;
273
+ internalViewers: number | null;
274
+ externalViewers: number | null;
275
+ firstViewedAt: string | null;
276
+ lastViewedAt: string | null;
277
+ byDay: {
278
+ day: string;
279
+ views: number;
280
+ uniqueViewers: number;
281
+ }[];
282
+ byVersion: {
283
+ versionNumber: number;
284
+ views: number;
285
+ uniqueViewers: number;
286
+ lastViewedAt: string | null;
287
+ }[];
288
+ /** Names only where the organisation shows viewer identities. */
289
+ recentViewers: {
290
+ displayName: string;
291
+ principalType: string;
292
+ viewCount: number;
293
+ lastViewedAt: string;
294
+ }[];
295
+ }
296
+ /** What is being read across every report, and what is not being read at all. */
297
+ export interface OrgAnalytics {
298
+ days: number;
299
+ totalViews: number;
300
+ uniqueViewers: number;
301
+ activeReports: number;
302
+ externallySharedReports: number;
303
+ publicReports: number;
304
+ publishesInPeriod: number;
305
+ topReports: {
306
+ reportId: string;
307
+ title: string;
308
+ views: number;
309
+ uniqueViewers: number;
310
+ lastViewedAt: string | null;
311
+ }[];
312
+ /** Live reports with no view in the period — oldest silence first. */
313
+ inactiveReports: {
314
+ reportId: string;
315
+ title: string;
316
+ lastViewedAt: string | null;
317
+ publishedAt: string | null;
318
+ }[];
319
+ }
320
+ 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.escalated" | "approval.question" | "approval.answered" | "review.requested" | "review.approved" | "review.changes_requested" | "collection.requested" | "collection.completed" | "flow.completed";
194
321
  export interface WebhookEvent {
195
322
  event: WebhookEventName;
196
323
  sentAt: string;
@@ -284,7 +411,10 @@ export interface ListReviewsInput {
284
411
  status?: ReviewStatus;
285
412
  externalId?: string;
286
413
  reportId?: string;
414
+ /** One page of this size. Leave it unset to get every row. */
287
415
  limit?: number;
416
+ /** `nextCursor` from a previous page. Only meaningful with `limit`. */
417
+ cursor?: string;
288
418
  }
289
419
  export type CollectionStatus = "pending" | "complete" | "expired" | "cancelled";
290
420
  export type QuestionKind = "text" | "long_text" | "number" | "date" | "choice" | "multi_choice" | "boolean";
@@ -389,7 +519,10 @@ export interface CollectedAnswers {
389
519
  export interface ListCollectionsInput {
390
520
  status?: CollectionStatus;
391
521
  externalId?: string;
522
+ /** One page of this size. Leave it unset to get every row. */
392
523
  limit?: number;
524
+ /** `nextCursor` from a previous page. Only meaningful with `limit`. */
525
+ cursor?: string;
393
526
  }
394
527
  export type FlowStatus = "open" | "complete" | "cancelled";
395
528
  export type FlowMemberKind = "approval" | "review" | "collection" | "report";
@@ -445,7 +578,10 @@ export interface CreateFlowInput {
445
578
  export interface ListFlowsInput {
446
579
  status?: FlowStatus;
447
580
  externalId?: string;
581
+ /** One page of this size. Leave it unset to get every row. */
448
582
  limit?: number;
583
+ /** `nextCursor` from a previous page. Only meaningful with `limit`. */
584
+ cursor?: string;
449
585
  }
450
586
  export type EvidenceStepKind = "approval" | "review" | "collection" | "report";
451
587
  export interface EvidenceOutcome {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;AAC3F,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAElE,2DAA2D;AAC3D,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM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,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;QACxB,EAAE,EAAE,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.6.2",
3
+ "version": "0.7.1",
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/approvals.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { listOrCollect, type PageOf } from "./paging.js";
1
2
  import { DeliverdError, DeliverdTimeoutError } from "./errors.js";
2
3
  import type { HttpClient } from "./http.js";
3
4
  import { durationMs, type Duration } from "./duration.js";
@@ -87,7 +88,9 @@ export class Approval {
87
88
  get title(): string { return this.data.title; }
88
89
  /** Their reason, when they gave one. */
89
90
  get note(): string | null { return this.data.note; }
91
+ /** Who decided, as a name rather than an id. */
90
92
  get decidedBy(): string | null { return this.data.decidedBy; }
93
+ get decidedById(): string | null { return this.data.decidedById; }
91
94
  get decidedAt(): string | null { return this.data.decidedAt; }
92
95
  get questions(): ApprovalQuestion[] { return this.data.questions; }
93
96
  /** Questions the approver is still waiting on you to answer. */
@@ -117,6 +120,7 @@ export class Approval {
117
120
  status,
118
121
  note: this.data.note,
119
122
  decidedBy: this.data.decidedBy,
123
+ decidedById: this.data.decidedById,
120
124
  decidedAt: this.data.decidedAt,
121
125
  id: this.data.id,
122
126
  url: this.data.url,
@@ -257,14 +261,35 @@ export class Approvals {
257
261
  return new Approval(this.http, data);
258
262
  }
259
263
 
264
+ /**
265
+ * The organisation's approvals, newest first.
266
+ *
267
+ * With no `limit` this is every one of them: the API says where each page
268
+ * stopped and this follows the cursor to the end. With a `limit` it is one
269
+ * page of that size, and `listPage` hands back the cursor to continue from.
270
+ */
260
271
  async list(input: ListApprovalsInput = {}, signal?: AbortSignal): Promise<Approval[]> {
261
- const { approvals } = await this.http.request<{ approvals: ApprovalData[] }>({
272
+ return listOrCollect(input, async (q: { limit?: number; cursor?: string }) => {
273
+ const page = await this.listPage({ ...input, ...q }, signal);
274
+ return { items: page.items, nextCursor: page.nextCursor };
275
+ });
276
+ }
277
+
278
+ /** One page, and the cursor to continue from — null when it is the end. */
279
+ async listPage(
280
+ input: ListApprovalsInput = {},
281
+ signal?: AbortSignal
282
+ ): Promise<PageOf<Approval>> {
283
+ const { approvals, nextCursor } = await this.http.request<{
284
+ approvals: ApprovalData[];
285
+ nextCursor: string | null;
286
+ }>({
262
287
  method: "GET",
263
288
  path: "/approvals",
264
- query: { status: input.status, externalId: input.externalId, limit: input.limit },
289
+ query: { status: input.status, externalId: input.externalId, limit: input.limit, cursor: input.cursor },
265
290
  signal,
266
291
  });
267
- return approvals.map((a) => new Approval(this.http, a));
292
+ return { items: approvals.map((r) => new Approval(this.http, r)), nextCursor };
268
293
  }
269
294
 
270
295
  /**
@@ -1,3 +1,4 @@
1
+ import { listOrCollect, type PageOf } from "./paging.js";
1
2
  import { DeliverdError, DeliverdTimeoutError } from "./errors.js";
2
3
  import type { HttpClient } from "./http.js";
3
4
  import { POLL_SCHEDULE } from "./approvals.js";
@@ -187,14 +188,35 @@ export class Collections {
187
188
  return new Collection(this.http, data);
188
189
  }
189
190
 
191
+ /**
192
+ * The organisation's collections, newest first.
193
+ *
194
+ * With no `limit` this is every one of them: the API says where each page
195
+ * stopped and this follows the cursor to the end. With a `limit` it is one
196
+ * page of that size, and `listPage` hands back the cursor to continue from.
197
+ */
190
198
  async list(input: ListCollectionsInput = {}, signal?: AbortSignal): Promise<Collection[]> {
191
- const { collections } = await this.http.request<{ collections: CollectionData[] }>({
199
+ return listOrCollect(input, async (q: { limit?: number; cursor?: string }) => {
200
+ const page = await this.listPage({ ...input, ...q }, signal);
201
+ return { items: page.items, nextCursor: page.nextCursor };
202
+ });
203
+ }
204
+
205
+ /** One page, and the cursor to continue from — null when it is the end. */
206
+ async listPage(
207
+ input: ListCollectionsInput = {},
208
+ signal?: AbortSignal
209
+ ): Promise<PageOf<Collection>> {
210
+ const { collections, nextCursor } = await this.http.request<{
211
+ collections: CollectionData[];
212
+ nextCursor: string | null;
213
+ }>({
192
214
  method: "GET",
193
215
  path: "/collections",
194
- query: { status: input.status, externalId: input.externalId, limit: input.limit },
216
+ query: { status: input.status, externalId: input.externalId, limit: input.limit, cursor: input.cursor },
195
217
  signal,
196
218
  });
197
- return collections.map((c) => new Collection(this.http, c));
219
+ return { items: collections.map((r) => new Collection(this.http, r)), nextCursor };
198
220
  }
199
221
 
200
222
  /** Ask and wait, for the common case where there is nothing to do between. */
package/src/dev.ts CHANGED
@@ -108,6 +108,7 @@ export function developmentFetch(options: DevelopmentOptions = {}): typeof globa
108
108
  requiredApprovals: 1,
109
109
  approvalsSoFar: 0,
110
110
  decidedBy: null,
111
+ decidedById: null,
111
112
  decidedAt: null,
112
113
  note: null,
113
114
  expiresAt: (body.expiresAt as string | undefined) ?? null,
@@ -387,7 +388,7 @@ export function developmentFetch(options: DevelopmentOptions = {}): typeof globa
387
388
  const title = kind === "flow" ? (flowStore.get(id)?.title ?? "A flow") : "A report";
388
389
  const now = new Date().toISOString();
389
390
  const pack: EvidencePack = {
390
- packVersion: 1,
391
+ packVersion: 2,
391
392
  generatedAt: now,
392
393
  generatedBy: "You (development mode)",
393
394
  organisation: { id: "org_dev", name: "Development" },
@@ -471,7 +472,13 @@ function settle(stored: Stored): void {
471
472
  if (stored.outcome === "question" && stored.data.questions.some((q) => !q.answer)) return;
472
473
 
473
474
  stored.data.status = stored.outcome === "rejected" ? "rejected" : "approved";
474
- stored.data.decidedBy = "approver@development.invalid";
475
+ /*
476
+ * The same shape production sends: a person's name in `decidedBy` and the
477
+ * key in `decidedById`. It used to be an email-shaped string alone, so the
478
+ * offline loop taught a shape a real organisation never delivers.
479
+ */
480
+ stored.data.decidedBy = "Development approver";
481
+ stored.data.decidedById = "00000000-0000-0000-0000-00000000dev0";
475
482
  stored.data.decidedAt = new Date().toISOString();
476
483
  stored.data.note =
477
484
  stored.options.note ??
package/src/flows.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { listOrCollect, type PageOf } from "./paging.js";
1
2
  import type { HttpClient } from "./http.js";
2
3
  import type { CreateFlowInput, EvidencePack, FlowData, ListFlowsInput } from "./types.js";
3
4
  /*
@@ -168,14 +169,35 @@ export class Flows {
168
169
  return new Flow(this.http, data, this.client);
169
170
  }
170
171
 
172
+ /**
173
+ * The organisation's flows, newest first.
174
+ *
175
+ * With no `limit` this is every one of them: the API says where each page
176
+ * stopped and this follows the cursor to the end. With a `limit` it is one
177
+ * page of that size, and `listPage` hands back the cursor to continue from.
178
+ */
171
179
  async list(input: ListFlowsInput = {}, signal?: AbortSignal): Promise<Flow[]> {
172
- const { flows } = await this.http.request<{ flows: FlowData[] }>({
180
+ return listOrCollect(input, async (q: { limit?: number; cursor?: string }) => {
181
+ const page = await this.listPage({ ...input, ...q }, signal);
182
+ return { items: page.items, nextCursor: page.nextCursor };
183
+ });
184
+ }
185
+
186
+ /** One page, and the cursor to continue from — null when it is the end. */
187
+ async listPage(
188
+ input: ListFlowsInput = {},
189
+ signal?: AbortSignal
190
+ ): Promise<PageOf<Flow>> {
191
+ const { flows, nextCursor } = await this.http.request<{
192
+ flows: FlowData[];
193
+ nextCursor: string | null;
194
+ }>({
173
195
  method: "GET",
174
196
  path: "/flows",
175
- query: { status: input.status, externalId: input.externalId, limit: input.limit },
197
+ query: { status: input.status, externalId: input.externalId, limit: input.limit, cursor: input.cursor },
176
198
  signal,
177
199
  });
178
- return flows.map((f) => new Flow(this.http, f, this.client));
200
+ return { items: flows.map((f) => new Flow(this.http, f, this.client)), nextCursor };
179
201
  }
180
202
 
181
203
  /** The same job as before, when there was one — so a restart extends it rather than starting a second. */
package/src/http.ts CHANGED
@@ -175,9 +175,22 @@ export class HttpClient {
175
175
 
176
176
  export const USER_AGENT = "deliverd-sdk";
177
177
 
178
- /** 429 and 5xx only: a 4xx will be just as wrong on the next attempt. */
178
+ /**
179
+ * A 5xx the server might get right next time. 501 is not one of them: it means
180
+ * the call is not built, which is a fact about the server rather than about
181
+ * this moment — the same argument as a 4xx.
182
+ *
183
+ * Ported from the Python SDK, which found it first and where the symptom was a
184
+ * development-mode call taking two and a half seconds to say three times that
185
+ * it is not implemented. The fix was never brought back here, and nothing
186
+ * compared the two until `packages/conformance/cases.json` existed.
187
+ */
188
+ const RETRYABLE_5XX_EXCEPTIONS = new Set([501]);
189
+
190
+ /** 429 and most 5xx: a 4xx will be just as wrong on the next attempt. */
179
191
  function isRetryable(status: number): boolean {
180
- return status === 429 || status >= 500;
192
+ if (status === 429) return true;
193
+ return status >= 500 && !RETRYABLE_5XX_EXCEPTIONS.has(status);
181
194
  }
182
195
 
183
196
  function parseRetryAfter(header: string | null): number | undefined {
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, type ClientOptions } from "./http.js";
2
2
  import { Approvals, FAST_POLL_SCHEDULE, type WaitOptions } from "./approvals.js";
3
- import { Comments, Reports } from "./reports.js";
3
+ import { Comments, Reports, Schedules } from "./reports.js";
4
4
  import { Reviews, type ReviewWaitOptions } from "./reviews.js";
5
5
  import { Collections, type CollectWaitOptions } from "./collections.js";
6
6
  import { Flows } from "./flows.js";
@@ -20,7 +20,7 @@ import type {
20
20
  } from "./types.js";
21
21
 
22
22
  export { Approval, Approvals, POLL_SCHEDULE, type WaitOptions } from "./approvals.js";
23
- export { Comments, Reports } from "./reports.js";
23
+ export { Comments, Reports, Schedules } from "./reports.js";
24
24
  export { Review, Reviews, type ReviewWaitOptions } from "./reviews.js";
25
25
  export { Collection, Collections, type CollectWaitOptions } from "./collections.js";
26
26
  export { Flow, Flows, type FlowPrimitives } from "./flows.js";
@@ -138,6 +138,7 @@ export class Deliverd {
138
138
  readonly flows: Flows;
139
139
  readonly reports: Reports;
140
140
  readonly comments: Comments;
141
+ readonly schedules: Schedules;
141
142
  readonly webhooks: Webhooks;
142
143
  readonly http: HttpClient;
143
144
  /** Whether an imaginary approver is deciding these. */
@@ -166,6 +167,7 @@ export class Deliverd {
166
167
  this.flows = new Flows(this.http, this);
167
168
  this.reports = new Reports(this.http);
168
169
  this.comments = new Comments(this.http);
170
+ this.schedules = new Schedules(this.http);
169
171
  this.webhooks = new Webhooks();
170
172
  }
171
173
 
package/src/messages.ts CHANGED
@@ -23,11 +23,15 @@ export const EXPLANATIONS: Record<string, Explanation> = {
23
23
  hint: "Set DELIVERD_API_KEY in your environment, or pass { apiKey } — or use { mode: \"development\" } to run without one.",
24
24
  },
25
25
  auth_error: {
26
- message: "That API key was not accepted.",
27
- hint: "Check DELIVERD_API_KEY. Keys start with dlv_ and are created in Settings → API tokens.",
26
+ message: "That credential was not accepted.",
27
+ // Both families, because both work: a `dlv_` key somebody created, or a
28
+ // `dlvo_` access token from an OAuth connector. Naming only the first is
29
+ // how a connector's token gets thrown away and replaced with a key
30
+ // nobody needed to create.
31
+ hint: "Check DELIVERD_API_KEY. An API key starts with dlv_ and is created in Settings → API tokens; an OAuth access token starts with dlvo_ and needs no setup.",
28
32
  },
29
33
  insufficient_scope: {
30
- hint: "Reissue the key with the scope named above. A key issued before a scope existed does not have it.",
34
+ hint: "Reissue the key with the scope named above, or re-consent the connector for it. A credential issued before a scope existed does not have it.",
31
35
  },
32
36
  unknown_approver: {
33
37
  message: "No approver could be found for this request.",
package/src/paging.ts ADDED
@@ -0,0 +1,64 @@
1
+ import type { HttpClient } from "./http.js";
2
+
3
+ /**
4
+ * What the SDK does about a list that does not fit in one answer.
5
+ *
6
+ * The API says where it stopped: a response carries `nextCursor`, null when
7
+ * the page is the end of the list and a string to pass back when it is not.
8
+ * That leaves the client one decision, and it is worth stating rather than
9
+ * leaving to whoever reads the call:
10
+ *
11
+ * **`limit` set means one page of that size. `limit` unset means all of
12
+ * them.** `list()` with no limit follows the cursor until the API stops
13
+ * offering one, so `.length` is the real count rather than a page size that
14
+ * happens to look like one. A caller who wants to page by hand asks for a
15
+ * `limit`, or uses `listPage` and drives the cursor themselves.
16
+ *
17
+ * The alternative — return a page and let the caller notice — reads fine and
18
+ * fails quietly, because a full page and a complete list are indistinguishable
19
+ * until somebody counts.
20
+ */
21
+ export interface PageInput {
22
+ limit?: number;
23
+ cursor?: string;
24
+ }
25
+
26
+ export interface PageOf<T> {
27
+ items: T[];
28
+ nextCursor: string | null;
29
+ }
30
+
31
+ /**
32
+ * Follow the cursor to the end, collecting as we go.
33
+ *
34
+ * `fetchPage` is whatever single request the caller's endpoint makes; this
35
+ * only decides when to ask again. A page that comes back empty while still
36
+ * offering a cursor ends the loop as well — a server that did that would
37
+ * otherwise spin here for ever.
38
+ */
39
+ export async function collect<T>(
40
+ fetchPage: (cursor: string | null) => Promise<PageOf<T>>
41
+ ): Promise<T[]> {
42
+ const all: T[] = [];
43
+ let cursor: string | null = null;
44
+ for (;;) {
45
+ const page: PageOf<T> = await fetchPage(cursor);
46
+ all.push(...page.items);
47
+ if (!page.nextCursor || page.items.length === 0) return all;
48
+ cursor = page.nextCursor;
49
+ }
50
+ }
51
+
52
+ /** One page, or every page, depending on whether a limit was asked for. */
53
+ export async function listOrCollect<T>(
54
+ input: PageInput,
55
+ fetchPage: (query: { limit?: number; cursor?: string }) => Promise<PageOf<T>>
56
+ ): Promise<T[]> {
57
+ if (input.limit !== undefined) {
58
+ const page = await fetchPage({ limit: input.limit, cursor: input.cursor });
59
+ return page.items;
60
+ }
61
+ return collect((cursor) => fetchPage({ cursor: cursor ?? undefined }));
62
+ }
63
+
64
+ export type { HttpClient };