@deliverd/sdk 0.6.1 → 0.7.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.
@@ -0,0 +1,29 @@
1
+ /**
2
+ * What each published version of `@deliverd/sdk` actually offers.
3
+ *
4
+ * Written after the package drifted **thirteen commits and fifty-four public
5
+ * surface items** ahead of what npm was serving, under a version number that
6
+ * had already been published. Among them `decidedById` — the field the
7
+ * decision-names-the-person correction added — and the whole `Schedules`
8
+ * namespace, so `docs/api.md` and this repository's own readiness notes
9
+ * described an SDK nobody could install.
10
+ *
11
+ * `release.test.ts` already proves what a tarball *contains*; its own header
12
+ * says the one thing it cannot know is the version number, because the
13
+ * registry is not reachable from a test. This is that missing half, and it is
14
+ * the same device the CLI got after 0.3.0 shipped three commands short:
15
+ * a ledger the source is held against, so adding to the surface fails until
16
+ * somebody records which version carries it.
17
+ *
18
+ * **The rule:** every entry in `SURFACE` below is an item a caller can reach —
19
+ * an export, a field of an exported type, or a webhook event name. The guard
20
+ * computes the same set from source and refuses a mismatch. Adding a field
21
+ * therefore forces a version bump, which is correct: a package that describes
22
+ * something new is a package somebody has to install to get.
23
+ *
24
+ * 0.6.2 and earlier predate this ledger and are not recorded. Reconstructing
25
+ * them would mean asserting a surface nobody checked at the time, which is the
26
+ * kind of entry that reads like a fact and is a guess.
27
+ */
28
+ export declare const RELEASED: Record<string, readonly string[]>;
29
+ //# sourceMappingURL=released.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"released.d.ts","sourceRoot":"","sources":["../src/released.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAsXtD,CAAC"}
@@ -0,0 +1,402 @@
1
+ /**
2
+ * What each published version of `@deliverd/sdk` actually offers.
3
+ *
4
+ * Written after the package drifted **thirteen commits and fifty-four public
5
+ * surface items** ahead of what npm was serving, under a version number that
6
+ * had already been published. Among them `decidedById` — the field the
7
+ * decision-names-the-person correction added — and the whole `Schedules`
8
+ * namespace, so `docs/api.md` and this repository's own readiness notes
9
+ * described an SDK nobody could install.
10
+ *
11
+ * `release.test.ts` already proves what a tarball *contains*; its own header
12
+ * says the one thing it cannot know is the version number, because the
13
+ * registry is not reachable from a test. This is that missing half, and it is
14
+ * the same device the CLI got after 0.3.0 shipped three commands short:
15
+ * a ledger the source is held against, so adding to the surface fails until
16
+ * somebody records which version carries it.
17
+ *
18
+ * **The rule:** every entry in `SURFACE` below is an item a caller can reach —
19
+ * an export, a field of an exported type, or a webhook event name. The guard
20
+ * computes the same set from source and refuses a mismatch. Adding a field
21
+ * therefore forces a version bump, which is correct: a package that describes
22
+ * something new is a package somebody has to install to get.
23
+ *
24
+ * 0.6.2 and earlier predate this ledger and are not recorded. Reconstructing
25
+ * them would mean asserting a surface nobody checked at the time, which is the
26
+ * kind of entry that reads like a fact and is a guess.
27
+ */
28
+ export const RELEASED = {
29
+ /*
30
+ * The first recorded surface, and a minor rather than a patch.
31
+ *
32
+ * Fifty-four additions over the published 0.6.2 and nothing removed, so
33
+ * nothing a caller wrote against 0.6.2 stops compiling. See CHANGELOG.md —
34
+ * and note the `decidedBy` correction there, which changes what an existing
35
+ * field *contains* without changing this list.
36
+ */
37
+ "0.7.0": [
38
+ "Approval",
39
+ "ApprovalData.approvalsSoFar",
40
+ "ApprovalData.approvers",
41
+ "ApprovalData.createdAt",
42
+ "ApprovalData.decidedAt",
43
+ "ApprovalData.decidedBy",
44
+ "ApprovalData.decidedById",
45
+ "ApprovalData.description",
46
+ "ApprovalData.expiresAt",
47
+ "ApprovalData.externalId",
48
+ "ApprovalData.factors",
49
+ "ApprovalData.id",
50
+ "ApprovalData.links",
51
+ "ApprovalData.metadata",
52
+ "ApprovalData.note",
53
+ "ApprovalData.questions",
54
+ "ApprovalData.reportId",
55
+ "ApprovalData.requestedBy",
56
+ "ApprovalData.requiredApprovals",
57
+ "ApprovalData.risk",
58
+ "ApprovalData.status",
59
+ "ApprovalData.title",
60
+ "ApprovalData.url",
61
+ "ApprovalFactor.detail",
62
+ "ApprovalFactor.label",
63
+ "ApprovalFactor.status",
64
+ "ApprovalLink.label",
65
+ "ApprovalLink.url",
66
+ "ApprovalQuestion.answer",
67
+ "ApprovalQuestion.answeredAt",
68
+ "ApprovalQuestion.askedAt",
69
+ "ApprovalQuestion.id",
70
+ "ApprovalQuestion.question",
71
+ "Approvals",
72
+ "ApproveOptions",
73
+ "ClientOptions",
74
+ "CollectOptions",
75
+ "CollectWaitOptions",
76
+ "CollectedAnswers.answers",
77
+ "CollectedAnswers.collection",
78
+ "CollectedAnswers.complete",
79
+ "CollectedAnswers.id",
80
+ "CollectedAnswers.responses",
81
+ "CollectedAnswers.status",
82
+ "CollectedAnswers.url",
83
+ "Collection",
84
+ "CollectionData.askedCount",
85
+ "CollectionData.createdAt",
86
+ "CollectionData.dueAt",
87
+ "CollectionData.expiresAt",
88
+ "CollectionData.externalId",
89
+ "CollectionData.id",
90
+ "CollectionData.instructions",
91
+ "CollectionData.metadata",
92
+ "CollectionData.questions",
93
+ "CollectionData.reportId",
94
+ "CollectionData.requestedBy",
95
+ "CollectionData.requiredResponses",
96
+ "CollectionData.responses",
97
+ "CollectionData.settledAt",
98
+ "CollectionData.status",
99
+ "CollectionData.submittedCount",
100
+ "CollectionData.title",
101
+ "CollectionData.url",
102
+ "CollectionQuestion.help",
103
+ "CollectionQuestion.id",
104
+ "CollectionQuestion.kind",
105
+ "CollectionQuestion.options",
106
+ "CollectionQuestion.prompt",
107
+ "CollectionQuestion.required",
108
+ "CollectionReply.answers",
109
+ "CollectionReply.respondent",
110
+ "CollectionReply.status",
111
+ "CollectionReply.submittedAt",
112
+ "Collections",
113
+ "CommentThread.messages",
114
+ "CommentThread.quote",
115
+ "CommentThread.status",
116
+ "CommentThread.threadId",
117
+ "Comments",
118
+ "CreateApprovalInput.approvers",
119
+ "CreateApprovalInput.description",
120
+ "CreateApprovalInput.expiresAt",
121
+ "CreateApprovalInput.externalId",
122
+ "CreateApprovalInput.factors",
123
+ "CreateApprovalInput.flowId",
124
+ "CreateApprovalInput.links",
125
+ "CreateApprovalInput.metadata",
126
+ "CreateApprovalInput.reportId",
127
+ "CreateApprovalInput.risk",
128
+ "CreateApprovalInput.title",
129
+ "CreateCollectionInput.dueAt",
130
+ "CreateCollectionInput.expiresAt",
131
+ "CreateCollectionInput.externalId",
132
+ "CreateCollectionInput.flowId",
133
+ "CreateCollectionInput.instructions",
134
+ "CreateCollectionInput.metadata",
135
+ "CreateCollectionInput.questions",
136
+ "CreateCollectionInput.reportId",
137
+ "CreateCollectionInput.requiredResponses",
138
+ "CreateCollectionInput.respondents",
139
+ "CreateCollectionInput.title",
140
+ "CreateFlowInput.description",
141
+ "CreateFlowInput.externalId",
142
+ "CreateFlowInput.metadata",
143
+ "CreateFlowInput.title",
144
+ "CreateFlowInput.workspaceId",
145
+ "CreateReviewInput.expiresAt",
146
+ "CreateReviewInput.externalId",
147
+ "CreateReviewInput.flowId",
148
+ "CreateReviewInput.instructions",
149
+ "CreateReviewInput.metadata",
150
+ "CreateReviewInput.reportId",
151
+ "CreateReviewInput.requiredApprovals",
152
+ "CreateReviewInput.reviewers",
153
+ "CreateReviewInput.title",
154
+ "CreateReviewInput.versionId",
155
+ "DEFAULT_BASE_URL",
156
+ "DEFAULT_EXPIRY",
157
+ "DELIVERY_HEADER",
158
+ "Decision.approval",
159
+ "Decision.approved",
160
+ "Decision.decidedAt",
161
+ "Decision.decidedBy",
162
+ "Decision.decidedById",
163
+ "Decision.id",
164
+ "Decision.note",
165
+ "Decision.status",
166
+ "Decision.url",
167
+ "Deliverd",
168
+ "DeliverdError",
169
+ "DeliverdOptions",
170
+ "DeliverdTimeoutError",
171
+ "Duration",
172
+ "EVENT_HEADER",
173
+ "EvidenceEvent.actor",
174
+ "EvidenceEvent.actorType",
175
+ "EvidenceEvent.at",
176
+ "EvidenceEvent.event",
177
+ "EvidenceEvent.metadata",
178
+ "EvidenceEvent.step",
179
+ "EvidenceOutcome.at",
180
+ "EvidenceOutcome.note",
181
+ "EvidenceOutcome.said",
182
+ "EvidenceOutcome.who",
183
+ "EvidencePack.generatedAt",
184
+ "EvidencePack.generatedBy",
185
+ "EvidencePack.integrity",
186
+ "EvidencePack.organisation",
187
+ "EvidencePack.packVersion",
188
+ "EvidencePack.steps",
189
+ "EvidencePack.subject",
190
+ "EvidencePack.summary",
191
+ "EvidencePack.timeline",
192
+ "EvidenceStep.asked",
193
+ "EvidenceStep.createdAt",
194
+ "EvidenceStep.detail",
195
+ "EvidenceStep.id",
196
+ "EvidenceStep.kind",
197
+ "EvidenceStep.outcomes",
198
+ "EvidenceStep.requestedBy",
199
+ "EvidenceStep.requestedByAgent",
200
+ "EvidenceStep.settledAt",
201
+ "EvidenceStep.status",
202
+ "EvidenceStep.title",
203
+ "EvidenceStep.url",
204
+ "Flow",
205
+ "FlowData.allSettled",
206
+ "FlowData.createdAt",
207
+ "FlowData.description",
208
+ "FlowData.externalId",
209
+ "FlowData.id",
210
+ "FlowData.memberCount",
211
+ "FlowData.members",
212
+ "FlowData.metadata",
213
+ "FlowData.openCount",
214
+ "FlowData.settledAt",
215
+ "FlowData.startedBy",
216
+ "FlowData.status",
217
+ "FlowData.timeline",
218
+ "FlowData.title",
219
+ "FlowData.url",
220
+ "FlowEvent.actor",
221
+ "FlowEvent.actorType",
222
+ "FlowEvent.at",
223
+ "FlowEvent.event",
224
+ "FlowEvent.resourceId",
225
+ "FlowEvent.resourceType",
226
+ "FlowMember.createdAt",
227
+ "FlowMember.id",
228
+ "FlowMember.kind",
229
+ "FlowMember.open",
230
+ "FlowMember.status",
231
+ "FlowMember.title",
232
+ "FlowPrimitives",
233
+ "Flows",
234
+ "InlineFile.content",
235
+ "InlineFile.encoding",
236
+ "InlineFile.path",
237
+ "ListApprovalsInput.cursor",
238
+ "ListApprovalsInput.externalId",
239
+ "ListApprovalsInput.limit",
240
+ "ListApprovalsInput.status",
241
+ "ListCollectionsInput.cursor",
242
+ "ListCollectionsInput.externalId",
243
+ "ListCollectionsInput.limit",
244
+ "ListCollectionsInput.status",
245
+ "ListFlowsInput.cursor",
246
+ "ListFlowsInput.externalId",
247
+ "ListFlowsInput.limit",
248
+ "ListFlowsInput.status",
249
+ "ListReviewsInput.cursor",
250
+ "ListReviewsInput.externalId",
251
+ "ListReviewsInput.limit",
252
+ "ListReviewsInput.reportId",
253
+ "ListReviewsInput.status",
254
+ "OpenThread.author",
255
+ "OpenThread.authorType",
256
+ "OpenThread.lastActivityAt",
257
+ "OpenThread.messages",
258
+ "OpenThread.quote",
259
+ "OpenThread.reportId",
260
+ "OpenThread.reportOwnerId",
261
+ "OpenThread.reportSlug",
262
+ "OpenThread.reportTitle",
263
+ "OpenThread.threadId",
264
+ "OrgAnalytics.activeReports",
265
+ "OrgAnalytics.days",
266
+ "OrgAnalytics.externallySharedReports",
267
+ "OrgAnalytics.inactiveReports",
268
+ "OrgAnalytics.publicReports",
269
+ "OrgAnalytics.publishesInPeriod",
270
+ "OrgAnalytics.topReports",
271
+ "OrgAnalytics.totalViews",
272
+ "OrgAnalytics.uniqueViewers",
273
+ "POLL_SCHEDULE",
274
+ "PublishReportInput.audience",
275
+ "PublishReportInput.changeSummary",
276
+ "PublishReportInput.classification",
277
+ "PublishReportInput.content",
278
+ "PublishReportInput.description",
279
+ "PublishReportInput.expectedVersion",
280
+ "PublishReportInput.files",
281
+ "PublishReportInput.living",
282
+ "PublishReportInput.slug",
283
+ "PublishReportInput.sourceModel",
284
+ "PublishReportInput.sourceTool",
285
+ "PublishReportInput.title",
286
+ "PublishReportInput.uploadId",
287
+ "PublishReportInput.workspaceId",
288
+ "PublishResult.approval",
289
+ "PublishResult.report",
290
+ "PublishResult.status",
291
+ "PublishResult.version",
292
+ "PublishResult.warnings",
293
+ "QuestionInput.help",
294
+ "QuestionInput.kind",
295
+ "QuestionInput.options",
296
+ "QuestionInput.prompt",
297
+ "QuestionInput.required",
298
+ "ReportAnalytics.byDay",
299
+ "ReportAnalytics.byVersion",
300
+ "ReportAnalytics.externalViewers",
301
+ "ReportAnalytics.firstViewedAt",
302
+ "ReportAnalytics.internalViewers",
303
+ "ReportAnalytics.lastViewedAt",
304
+ "ReportAnalytics.recentViewers",
305
+ "ReportAnalytics.reportId",
306
+ "ReportAnalytics.title",
307
+ "ReportAnalytics.totalViews",
308
+ "ReportAnalytics.uniqueViewers",
309
+ "ReportData.currentVersion",
310
+ "ReportData.id",
311
+ "ReportData.slug",
312
+ "ReportData.status",
313
+ "ReportData.title",
314
+ "ReportData.url",
315
+ "Reports",
316
+ "Review",
317
+ "ReviewData.createdAt",
318
+ "ReviewData.expiresAt",
319
+ "ReviewData.externalId",
320
+ "ReviewData.id",
321
+ "ReviewData.instructions",
322
+ "ReviewData.metadata",
323
+ "ReviewData.reportId",
324
+ "ReviewData.requestedBy",
325
+ "ReviewData.requiredApprovals",
326
+ "ReviewData.reviewers",
327
+ "ReviewData.settledAt",
328
+ "ReviewData.status",
329
+ "ReviewData.threadCount",
330
+ "ReviewData.title",
331
+ "ReviewData.url",
332
+ "ReviewData.verdicts",
333
+ "ReviewData.versionId",
334
+ "ReviewOptions",
335
+ "ReviewOutcome.approved",
336
+ "ReviewOutcome.id",
337
+ "ReviewOutcome.review",
338
+ "ReviewOutcome.status",
339
+ "ReviewOutcome.threadCount",
340
+ "ReviewOutcome.url",
341
+ "ReviewOutcome.verdicts",
342
+ "ReviewVerdict.at",
343
+ "ReviewVerdict.by",
344
+ "ReviewVerdict.note",
345
+ "ReviewVerdict.verdict",
346
+ "ReviewWaitOptions",
347
+ "ReviewerRef.id",
348
+ "ReviewerRef.kind",
349
+ "ReviewerRef.label",
350
+ "Reviews",
351
+ "SIGNATURE_HEADER",
352
+ "ScheduleSummary.agentId",
353
+ "ScheduleSummary.agentName",
354
+ "ScheduleSummary.currentVersion",
355
+ "ScheduleSummary.due",
356
+ "ScheduleSummary.dueSince",
357
+ "ScheduleSummary.enabled",
358
+ "ScheduleSummary.id",
359
+ "ScheduleSummary.lastRunAt",
360
+ "ScheduleSummary.nextRunAt",
361
+ "ScheduleSummary.recurrence",
362
+ "ScheduleSummary.reportId",
363
+ "ScheduleSummary.reportSlug",
364
+ "ScheduleSummary.reportTitle",
365
+ "ScheduleSummary.reportUrl",
366
+ "Schedules",
367
+ "SendResult.alreadyHadAccess",
368
+ "SendResult.sent",
369
+ "TOLERANCE_SECONDS",
370
+ "WaitOptions",
371
+ "WebhookEvent.data",
372
+ "WebhookEvent.event",
373
+ "WebhookEvent.sentAt",
374
+ "WebhookEvent.test",
375
+ "Webhooks",
376
+ "constructEvent",
377
+ "deliverd",
378
+ "durationMs",
379
+ "event:access.requested",
380
+ "event:approval.answered",
381
+ "event:approval.approved",
382
+ "event:approval.escalated",
383
+ "event:approval.expired",
384
+ "event:approval.question",
385
+ "event:approval.rejected",
386
+ "event:approval.requested",
387
+ "event:collection.completed",
388
+ "event:collection.requested",
389
+ "event:comment.created",
390
+ "event:flow.completed",
391
+ "event:publish.held",
392
+ "event:report.published",
393
+ "event:report.shared",
394
+ "event:report.updated",
395
+ "event:report.viewed",
396
+ "event:review.approved",
397
+ "event:review.changes_requested",
398
+ "event:review.requested",
399
+ "event:schedule.due",
400
+ "verifySignature",
401
+ ],
402
+ };
package/dist/reports.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import { type PageInput, type PageOf } from "./paging.js";
1
2
  import type { HttpClient } from "./http.js";
2
- import type { CommentThread, PublishReportInput, PublishResult, ReportData, UpdateReportInput, EvidencePack } from "./types.js";
3
+ import type { CommentThread, OpenThread, OrgAnalytics, ReportAnalytics, PublishReportInput, PublishResult, ReportData, ScheduleSummary, SendResult, UpdateReportInput, EvidencePack } from "./types.js";
3
4
  /**
4
5
  * The publishing half: get what the agent wrote to the people who need it, at
5
6
  * an address that does not change.
@@ -32,7 +33,20 @@ export declare class Reports {
32
33
  */
33
34
  evidence(idOrSlug: string, signal?: AbortSignal): Promise<EvidencePack>;
34
35
  get(idOrSlug: string, signal?: AbortSignal): Promise<ReportData>;
36
+ /**
37
+ * Every report, newest change first. `query` searches title, slug and
38
+ * description.
39
+ *
40
+ * This one used to be the worst of them: the API had no limit at all, so an
41
+ * organisation past PostgREST's own cap was handed a prefix of its reports
42
+ * and nothing said so. It follows the cursor now, so the array really is all
43
+ * of them; `listPage` is there when one page is what you want.
44
+ */
35
45
  list(query?: string, signal?: AbortSignal): Promise<ReportData[]>;
46
+ /** One page, and the cursor to continue from — null when it is the end. */
47
+ listPage(input?: {
48
+ query?: string;
49
+ } & PageInput, signal?: AbortSignal): Promise<PageOf<ReportData>>;
36
50
  /** Change the title, the address, or both. The old address keeps working. */
37
51
  rename(idOrSlug: string, input: {
38
52
  title?: string;
@@ -42,20 +56,85 @@ export declare class Reports {
42
56
  }, signal?: AbortSignal): Promise<ReportData>;
43
57
  /** Grant people, teams or groups access. Filing is not access; this is. */
44
58
  share(idOrSlug: string, audience: unknown, signal?: AbortSignal): Promise<unknown[]>;
45
- /** Stop the URL serving. `archived: false` puts it back. */
59
+ /**
60
+ * Take it away again, from the same audience phrase that granted it.
61
+ *
62
+ * By audience rather than by grant id because that is all a caller has:
63
+ * `get()` returns each grant's principal id, never the grant row's. Refuses
64
+ * when the audience never had access, so a script that revokes and carries
65
+ * on is not told the door is shut when it is open.
66
+ */
67
+ revoke(idOrSlug: string, audience: unknown, signal?: AbortSignal): Promise<unknown[]>;
68
+ /**
69
+ * Email it to a list of addresses, inside or outside the organisation.
70
+ *
71
+ * `share` grants access to people the organisation already knows. This
72
+ * takes bare email addresses, creates the guest records behind them, and
73
+ * emails each recipient their own link with your covering note. Not a
74
+ * mailing list: one link per person, which is what makes the audit trail
75
+ * and the per-reader analytics mean anything.
76
+ *
77
+ * A publishing rule can refuse it — a report classified confidential or
78
+ * restricted does not leave the organisation.
79
+ */
80
+ send(idOrSlug: string, input: {
81
+ to: string[];
82
+ message?: string;
83
+ allowComments?: boolean;
84
+ expiresInDays?: number;
85
+ }, signal?: AbortSignal): Promise<SendResult>;
86
+ /**
87
+ * Stop the URL serving. A reader following a link they already hold is told
88
+ * the report is no longer available; nothing is deleted and the audience is
89
+ * kept, so `unarchive` puts it back exactly as it was.
90
+ */
46
91
  archive(idOrSlug: string, archived?: boolean, signal?: AbortSignal): Promise<ReportData>;
47
- rollback(idOrSlug: string, version: number, signal?: AbortSignal): Promise<unknown>;
92
+ /** Put an archived report back at the same URL, to the same audience. */
93
+ unarchive(idOrSlug: string, signal?: AbortSignal): Promise<ReportData>;
94
+ /**
95
+ * Serve an earlier version again, at the same URL. The newer version is
96
+ * kept — roll forward the same way.
97
+ *
98
+ * The version number is the one `versions()` and `get()` report, not a
99
+ * version uuid.
100
+ */
101
+ rollback(idOrSlug: string, version: number, signal?: AbortSignal): Promise<{
102
+ ok: true;
103
+ version: number;
104
+ versionId: string;
105
+ }>;
48
106
  /**
49
107
  * Every version, with `latestVersion` beside `currentVersion`. Pass
50
108
  * `latestVersion` as `expectedVersion` on an update: a held or declined
51
109
  * version takes a number without going live.
52
110
  */
53
111
  versions(idOrSlug: string, signal?: AbortSignal): Promise<Record<string, unknown>>;
112
+ /**
113
+ * What is being read across every report — and what is not.
114
+ *
115
+ * `analytics` needs to be told which report, so "what is getting read" meant
116
+ * walking the list and adding up. The half that cannot be reconstructed that
117
+ * way is `inactiveReports`: a report nobody has opened does not appear in
118
+ * anything you would think to ask about.
119
+ *
120
+ * Part of analytics, so Team and above; `analytics` returns a total view
121
+ * count on every plan.
122
+ */
123
+ orgAnalytics(options?: {
124
+ days?: number;
125
+ limit?: number;
126
+ }, signal?: AbortSignal): Promise<OrgAnalytics>;
54
127
  /** Who read it and when. The detail needs the analytics plan. */
55
- analytics(idOrSlug: string, signal?: AbortSignal): Promise<Record<string, unknown>>;
128
+ analytics(idOrSlug: string, signal?: AbortSignal): Promise<ReportAnalytics>;
56
129
  /** Replace a dataset a living report reads. No new version, same URL. */
57
130
  putData(idOrSlug: string, name: string, data: unknown, signal?: AbortSignal): Promise<unknown>;
58
131
  listData(idOrSlug: string, signal?: AbortSignal): Promise<unknown>;
132
+ /**
133
+ * Remove a dataset. The published version is untouched; a report that
134
+ * fetches this name will show its readers an error from the next open, so
135
+ * `listData` first if you are not sure what reads it.
136
+ */
137
+ deleteData(idOrSlug: string, name: string, signal?: AbortSignal): Promise<void>;
59
138
  /**
60
139
  * The open feedback composed into one prompt, with the readers' images as
61
140
  * signed links: everything needed to write the next version.
@@ -69,17 +148,86 @@ export declare class Reports {
69
148
  export declare class Comments {
70
149
  private readonly http;
71
150
  constructor(http: HttpClient);
151
+ /** Every thread on a report, newest activity first. */
72
152
  list(idOrSlug: string, status?: "open" | "resolved" | "all", signal?: AbortSignal): Promise<CommentThread[]>;
153
+ /**
154
+ * Every open thread in the organisation, newest activity first — the
155
+ * answer to "is anything waiting on me?" without naming a report first.
156
+ *
157
+ * `list` needs one, which means enumerating every report to find the two
158
+ * with feedback on them. Threads on archived reports are left out: the URL
159
+ * does not serve, so nothing can be done about them.
160
+ */
161
+ open(signal?: AbortSignal): Promise<OpenThread[]>;
73
162
  /** `quote` anchors it to a passage; `threadId` replies to one. */
74
163
  create(idOrSlug: string, input: {
75
164
  body: string;
76
165
  quote?: string;
77
166
  threadId?: string;
78
167
  }, signal?: AbortSignal): Promise<unknown>;
168
+ /**
169
+ * Take back a comment you posted.
170
+ *
171
+ * Your own last comment in a thread, while the thread is open. Once
172
+ * somebody has replied it stays — their reply would otherwise be left
173
+ * answering something no longer on the page. Retracting the only comment in
174
+ * a thread takes the thread with it.
175
+ *
176
+ * `commentId` comes back from `create`, and `list` carries one on every
177
+ * message with `retractable` beside it. This closes what a reader can see
178
+ * and unsends nothing: the report's owner may already have been emailed.
179
+ */
180
+ retract(idOrSlug: string, commentId: string, signal?: AbortSignal): Promise<{
181
+ status: "retracted";
182
+ threadId: string;
183
+ threadRetracted: boolean;
184
+ }>;
79
185
  /** Mark a thread resolved, with a note on what changed. */
80
186
  resolve(threadId: string, input?: {
81
187
  note?: string;
82
188
  reopen?: boolean;
83
189
  }, signal?: AbortSignal): Promise<unknown>;
84
190
  }
191
+ /**
192
+ * Recurring publishes.
193
+ *
194
+ * A schedule says when an agent is asked for a new version. It says nothing
195
+ * about who hears about one — publishing emails the report's audience either
196
+ * way.
197
+ *
198
+ * Read-only over the API until now, which made the timetable the one thing
199
+ * about an agent that could be set from the admin screen and nowhere else.
200
+ * An agent key cannot write here on purpose: a schedule is an instruction
201
+ * *to* an agent.
202
+ */
203
+ export declare class Schedules {
204
+ private readonly http;
205
+ constructor(http: HttpClient);
206
+ /** Every schedule, or only the ones waiting on a publish. */
207
+ list(options?: {
208
+ dueOnly?: boolean;
209
+ }, signal?: AbortSignal): Promise<ScheduleSummary[]>;
210
+ /**
211
+ * `recurrence` is a five-field cron expression in UTC, and it has to have a
212
+ * next occurrence — `0 0 30 2 *` is well-formed and never arrives, and is
213
+ * refused rather than stored.
214
+ */
215
+ create(input: {
216
+ reportId: string;
217
+ agentId: string;
218
+ recurrence: string;
219
+ }, signal?: AbortSignal): Promise<ScheduleSummary>;
220
+ /**
221
+ * Change the cadence, or turn it on or off.
222
+ *
223
+ * Changing the cadence re-times the next run, so moving a weekly publish
224
+ * from Friday to Monday does not fire once more on the Friday.
225
+ */
226
+ update(id: string, input: {
227
+ recurrence?: string;
228
+ enabled?: boolean;
229
+ }, signal?: AbortSignal): Promise<ScheduleSummary>;
230
+ /** Remove it. `update(id, { enabled: false })` pauses it instead. */
231
+ delete(id: string, signal?: AbortSignal): Promise<void>;
232
+ }
85
233
  //# sourceMappingURL=reports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reports.d.ts","sourceRoot":"","sources":["../src/reports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,YAAY,EACb,MAAM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