calmlens 0.20.0 → 0.21.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.
Files changed (108) hide show
  1. package/README.md +13 -9
  2. package/bin/calmlens.js +1329 -664
  3. package/cjs/{BrowserUpload-CjSHjx3C.js → BrowserUpload-CeSwiMo5.js} +1 -1
  4. package/cjs/{BrowserUpload-C07aL9Vq.d.ts → BrowserUpload-D-NnAN7g.d.ts} +2 -2
  5. package/cjs/{CalmLensAppClient-NaCxOVlM.js → CalmLensAppClient-0UVCuNqW.js} +30 -10
  6. package/cjs/{CalmLensAppClient-DDLojj0P.d.ts → CalmLensAppClient-gG16T2py.d.ts} +13 -3
  7. package/cjs/{CalmLensOptionKeys-p2QK687A.js → CalmLensOptionKeys-CYY6elxg.js} +183 -347
  8. package/cjs/{CalmLensServerClient-C-jsjn8m.d.ts → CalmLensServerClient-BHx3x_nZ.d.ts} +106 -48
  9. package/cjs/{CalmLensServerClient-BDzTthxE.js → CalmLensServerClient-nfu6_YEW.js} +288 -88
  10. package/cjs/{CalmLensTypes-COJbOuiv.d.ts → CalmLensTypes-CUB0YYVz.d.ts} +26601 -27354
  11. package/cjs/{Classification-D3SkprrQ-CMnQKW13.d.ts → Classification-Q5zGpR8l-CEWjnE39.d.ts} +731 -607
  12. package/cjs/Core-C82YmjjX.d.ts +823 -0
  13. package/cjs/Core-Dc3cteU7.js +998 -0
  14. package/cjs/FileIcons-4qSX7DW2.d.ts +67 -0
  15. package/cjs/{ModerationContextLimits-2nIv7Zh3.js → ModerationContextLimits-BxOmeSqq.js} +669 -269
  16. package/cjs/{ReactUpload-BdTRCTGA.js → ReactUpload-BK2O3dnK.js} +1 -1
  17. package/cjs/{ReactUpload-CRJNPB5T.d.ts → ReactUpload-DiiXfKvj.d.ts} +1 -1
  18. package/cjs/{TestTriggers-DbhsNPdg-DjvVuc2h.js → TestTriggers-BTyXtX0Q-ATuFDhLX.js} +342 -34
  19. package/{esm/TestTriggers-D-fwfhEP-hlaP1oW2.d.ts → cjs/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts} +146 -8
  20. package/cjs/{UploadController-MLVs97Zt.js → UploadController-DLyiLDTB.js} +34 -14
  21. package/cjs/{WebhookPayload-DkukERKE.d.ts → WebhookPayload-BLT2y_Jy.d.ts} +93 -86
  22. package/cjs/app.d.ts +6 -7
  23. package/cjs/app.js +4 -3
  24. package/cjs/elements.d.ts +123 -22
  25. package/cjs/elements.js +553 -156
  26. package/cjs/file-icons.d.ts +2 -67
  27. package/cjs/index-CKRgjV16.d.ts +16 -0
  28. package/cjs/index.d.ts +5 -6
  29. package/cjs/index.js +3 -2
  30. package/cjs/react-native.d.ts +52 -11
  31. package/cjs/react-native.js +231 -99
  32. package/cjs/react.d.ts +42 -9
  33. package/cjs/react.js +381 -118
  34. package/cjs/server.d.ts +48 -7
  35. package/cjs/server.js +7 -3
  36. package/cjs/test-inputs.d.ts +2 -2
  37. package/cjs/test-inputs.js +13 -9
  38. package/cjs/testing.d.ts +24 -14
  39. package/cjs/testing.js +1413 -402
  40. package/cjs/ui-CTBUxnVp.d.ts +139 -0
  41. package/cjs/ui-CZ8exACq.js +1359 -0
  42. package/cjs/ui.d.ts +3 -2
  43. package/cjs/ui.js +45 -22
  44. package/cjs/vue.d.ts +802 -199
  45. package/cjs/vue.js +359 -127
  46. package/esm/{BrowserUpload-C07aL9Vq.d.ts → BrowserUpload-D-NnAN7g.d.ts} +2 -2
  47. package/esm/{BrowserUpload-CAVkRotw.js → BrowserUpload-i9OhCzMJ.js} +1 -1
  48. package/esm/{CalmLensAppClient-PQ9VBvlW.js → CalmLensAppClient-CK4_Py0c.js} +30 -10
  49. package/esm/{CalmLensAppClient-DDLojj0P.d.ts → CalmLensAppClient-gG16T2py.d.ts} +13 -3
  50. package/esm/{CalmLensOptionKeys-Do2mPP6w.js → CalmLensOptionKeys-BGZlIsT2.js} +182 -340
  51. package/esm/{CalmLensServerClient-C-jsjn8m.d.ts → CalmLensServerClient-BHx3x_nZ.d.ts} +106 -48
  52. package/esm/{CalmLensServerClient-C_H5aAsV.js → CalmLensServerClient-dAQUcDWb.js} +265 -89
  53. package/esm/{CalmLensTypes-COJbOuiv.d.ts → CalmLensTypes-CUB0YYVz.d.ts} +26601 -27354
  54. package/esm/{Classification-D3SkprrQ-CMnQKW13.d.ts → Classification-Q5zGpR8l-CEWjnE39.d.ts} +731 -607
  55. package/esm/Core-BxeIud_S.js +843 -0
  56. package/esm/Core-C82YmjjX.d.ts +823 -0
  57. package/esm/FileIcons-4qSX7DW2.d.ts +67 -0
  58. package/esm/{ModerationContextLimits-Chw-AzgL.js → ModerationContextLimits-B6_RalCQ.js} +624 -254
  59. package/esm/{ReactUpload-CRJNPB5T.d.ts → ReactUpload-DiiXfKvj.d.ts} +1 -1
  60. package/esm/{ReactUpload-CMmL0R5Q.js → ReactUpload-DxwVqfX1.js} +1 -1
  61. package/esm/{TestTriggers-DbhsNPdg-CUdrv8Nm.js → TestTriggers-BTyXtX0Q-GRB9jQwo.js} +319 -35
  62. package/{cjs/TestTriggers-D-fwfhEP-hlaP1oW2.d.ts → esm/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts} +146 -8
  63. package/esm/{UploadController-BJZghJpg.js → UploadController-D9Z-h00Q.js} +34 -14
  64. package/esm/{WebhookPayload-DkukERKE.d.ts → WebhookPayload-BLT2y_Jy.d.ts} +93 -86
  65. package/esm/app.d.ts +6 -7
  66. package/esm/app.js +3 -3
  67. package/esm/elements.d.ts +123 -22
  68. package/esm/elements.js +497 -128
  69. package/esm/file-icons.d.ts +2 -67
  70. package/esm/index-CKRgjV16.d.ts +16 -0
  71. package/esm/index.d.ts +5 -6
  72. package/esm/index.js +1 -1
  73. package/esm/react-native.d.ts +52 -11
  74. package/esm/react-native.js +205 -75
  75. package/esm/react.d.ts +42 -9
  76. package/esm/react.js +327 -91
  77. package/esm/server.d.ts +48 -7
  78. package/esm/server.js +3 -3
  79. package/esm/styles.css +142 -22
  80. package/esm/svelte/AssetViewer.svelte +25 -0
  81. package/esm/svelte/CalmLensAsset.svelte +318 -0
  82. package/esm/svelte/CalmLensDocumentViewer.svelte +7 -0
  83. package/esm/svelte/CalmLensImageViewer.svelte +7 -0
  84. package/esm/svelte/CalmLensSpreadsheetViewer.svelte +7 -0
  85. package/esm/svelte/CalmLensTextViewer.svelte +7 -0
  86. package/esm/svelte/CalmLensWebsiteViewer.svelte +7 -0
  87. package/esm/svelte/index.d.ts +29 -6
  88. package/esm/svelte/index.js +7 -2
  89. package/esm/test-inputs.d.ts +2 -2
  90. package/esm/test-inputs.js +1 -1
  91. package/esm/testing.d.ts +24 -14
  92. package/esm/testing.js +1409 -398
  93. package/esm/ui-CTBUxnVp.d.ts +139 -0
  94. package/esm/ui-Cr7s6JHm.js +1258 -0
  95. package/esm/ui.d.ts +3 -2
  96. package/esm/ui.js +4 -3
  97. package/esm/vue.d.ts +802 -199
  98. package/esm/vue.js +308 -103
  99. package/package.json +3 -1
  100. package/cjs/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +0 -67
  101. package/cjs/index-DxbJ_Xaa.d.ts +0 -253
  102. package/cjs/ui-BSqPGKrZ.d.ts +0 -539
  103. package/cjs/ui-CX1z2pD9.js +0 -586
  104. package/esm/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +0 -67
  105. package/esm/index-DxbJ_Xaa.d.ts +0 -253
  106. package/esm/svelte/CalmLensMedia.svelte +0 -134
  107. package/esm/ui-BSqPGKrZ.d.ts +0 -539
  108. package/esm/ui-CXH7xJpb.js +0 -461
@@ -1,6 +1,6 @@
1
- import { o as HashList, s as HashListEntry } from "./ModerationContext-9lGm-Mna-CcmbRnOy.js";
2
- import { A as CdnServeOptions, B as DeleteAssetContentOptions, C as AssignPolicyOptions, Ct as SubmitAssetOptions, D as CalmLensServerClientOptions, Dt as UpdatePolicyOptions, Et as UpdateHashListOptions, F as CreateFolderOptions, G as FolderIdOptions, H as EnsureLensOptions, I as CreateHashListOptions, J as HashListEntryIdOptions, Jt as Folder, K as FolderPage, Lt as GetEventsResponse, M as ClassifyTextOptions, Nt as WaitForAssetDecisionOptions, O as CdnAssetUrlOptions, Ot as UploadAssetPartOptions, P as CreateAssetSignedUrlOptions, R as CreatePolicyOptions, Rt as PostAssetSignedUrlResponse, T as BatchAssetsResponse, Tt as UpdateFolderOptions, U as EnsureLensesOptions, V as DeleteAssetOptions, W as ExplainAssetOptions, X as HashListIdOptions, Y as HashListEntryPage, Yt as Policy, Z as HashListPage, _ as AssetSearchResponse, _t as RetryAssetOptions, a as AssetChildrenPage, at as ListEventsOptions, bt as SignUploadTokenOptions, ct as ListHashListsOptions, en as AssetSearchQuery, et as IterateAssetChildrenOptions, g as AssetPage, gt as RetrieveAssetOptions, ht as RequestOptions, it as ListAssetsOptions, jt as VerifyWebhookSignatureOptions, lt as MoveAssetOptions, mt as PolicyList, n as ApplyPolicyPresetOptions, nt as Lens, ot as ListFoldersOptions, pt as PolicyIdOptions, r as Asset, rt as ListAssetChildrenOptions, st as ListHashListEntriesOptions, t as AddHashListEntryOptions, tt as IterateAssetsOptions, ut as MoveFolderOptions, w as BatchAssetsOptions, wt as UpdateAssetOptions, xt as SignedUploadToken, yt as SetPolicyAutomaticUpdatesOptions, z as DecideAssetOptions } from "./CalmLensTypes-COJbOuiv.js";
3
- import "./WebhookPayload-DkukERKE.js";
1
+ import { d as HashListEntry, u as HashList } from "./Classification-Q5zGpR8l-CEWjnE39.js";
2
+ import { $ as HashListPage, At as ResetPolicyOptions, Bt as SubmitAssetOptions, Cn as Policy, Ct as MoveFolderOptions, Dn as AssetSearchQuery, Dt as PolicyPage, E as BatchAssetsResponse, Et as PolicyIdOptions, F as ClassifyTextOptions, Ft as SignAssetUrlOptions, G as EnsureLensesOptions, Gt as UpdatePolicyOptions, H as DecideAssetOptions, Ht as UpdateFolderOptions, It as SignUploadTokenOptions, J as FolderPage, K as ExplainAssetOptions, Kt as UpgradePolicyOptions, L as CreateFolderOptions, Lt as SignedAssetUrl, Mt as RetryAssetOptions, N as CdnServeOptions, O as CalmLensServerClientOptions, Ot as RemoveAssetContentOptions, Pt as SetPolicyAutomaticUpdatesOptions, Q as HashListIdOptions, Qt as WaitForAssetDecisionOptions, R as CreateHashListOptions, Rt as SignedUploadToken, St as MoveAssetOptions, T as BatchAssetsOptions, U as DeleteAssetOptions, Ut as UpdateHashListOptions, V as CreatePolicyOptions, Vt as UpdateAssetOptions, W as EnsureLensOptions, Wt as UpdateLensOptions, X as HashListEntryIdOptions, Xt as VerifyWebhookSignatureOptions, Y as GetAssetInfoOptions, Z as HashListEntryPage, _ as AssetSearchResponse, _t as ListFoldersOptions, a as AssetChildrenPage, at as IterateFoldersOptions, bt as ListLensesOptions, ct as IterateLensesOptions, dt as LensIdOptions, ft as LensPage, g as AssetPage, gt as ListEventsOptions, ht as ListAssetsOptions, it as IterateAssetsOptions, j as CdnAssetUrlOptions, jt as RetrieveAssetOptions, kn as AssetInfo, kt as RequestOptions, lt as IteratePoliciesOptions, mn as Folder, mt as ListAssetTimelineOptions, n as Asset, nt as IterateAssetChildrenOptions, ot as IterateHashListEntriesOptions, pt as ListAssetChildrenOptions, q as FolderIdOptions, qt as UploadAssetPartOptions, rn as GetEventsResponse, rt as IterateAssetTimelineOptions, st as IterateHashListsOptions, t as AddHashListEntryOptions, ut as Lens, vt as ListHashListEntriesOptions, w as AssignPolicyOptions, xt as ListPoliciesOptions, y as AssetTimelinePage, yt as ListHashListsOptions, z as CreateLensOptions } from "./CalmLensTypes-CUB0YYVz.js";
3
+ import "./WebhookPayload-BLT2y_Jy.js";
4
4
  interface LensCache {
5
5
  readonly ensuredLenses: Map<string, Lens>;
6
6
  readonly pendingEnsureLenses: Map<string, Promise<void>>;
@@ -48,13 +48,28 @@ declare class CalmLensServerClient {
48
48
  private submitAsset;
49
49
  get cdn(): {
50
50
  /**
51
- * Builds a CDN URL for asset content or a preview, without a request. Private assets
52
- * need a signed URL (`assets.createSignedUrl`) or an authenticated request; public
53
- * age-restricted assets additionally require `viewerClaims.ageConfirmed: true`. Your
54
- * platform confirms the viewer's age; CalmLens does not verify this claim, and anyone can
55
- * add it to a public URL.
51
+ * Builds an asset's CDN URL without a request: the asset URL, which every resource is a path
52
+ * beneath, or a resource URL when `resource` is given, with its lens or transform and the
53
+ * viewer claims. Use it for public assets; private ones need `cdn.signAssetUrl`. Viewer
54
+ * claims are your app's unsigned assertions: CalmLens does not verify an age confirmation,
55
+ * and anyone holding the URL can add it.
56
56
  */
57
57
  getAssetUrl: (urlOptions: CdnAssetUrlOptions) => string;
58
+ /**
59
+ * Signs a private asset's URL on your server, so browsers and apps can load it without an API
60
+ * key until it expires. Every resource is a path beneath it, as beneath a public asset URL;
61
+ * `/original` only when signed with `original: true`. With `resource`, returns that resource's
62
+ * URL beneath the grant; lenses, transforms and viewer claims are appended as `getAssetUrl`
63
+ * appends them and aren't part of the signature.
64
+ */
65
+ signAssetUrl: (signOptions: SignAssetUrlOptions) => Promise<SignedAssetUrl>;
66
+ /**
67
+ * The display info of an asset URL, public or signed (`{url}/info`): its type, size,
68
+ * rendered file, preview and stream, and whether the viewer its claims describe can see it.
69
+ * A server can pass it to `CalmLensAsset` as `info`, so the first render is the real
70
+ * element.
71
+ */
72
+ getAssetInfo: (url: string, options?: Omit<GetAssetInfoOptions, "fetch">) => Promise<AssetInfo>;
58
73
  /**
59
74
  * Fetches asset content or a preview from the CDN with the client's API key, and returns
60
75
  * the `Response` as soon as headers arrive, so the body streams. Non-2xx responses are
@@ -75,7 +90,7 @@ declare class CalmLensServerClient {
75
90
  search: (options: Partial<AssetSearchQuery> & {
76
91
  query: string;
77
92
  }) => Promise<AssetSearchResponse>;
78
- /** Lists one page of the project's assets, with optional filter and ordering. */
93
+ /** Lists one page of the project's assets, with an optional filter and sort. */
79
94
  list: (options?: ListAssetsOptions) => Promise<AssetPage>;
80
95
  /**
81
96
  * Yields every asset matching `options`, fetching pages as needed. The cursor keeps the position
@@ -88,12 +103,18 @@ declare class CalmLensServerClient {
88
103
  update: (options: UpdateAssetOptions) => Promise<Asset>;
89
104
  /** Lists one page of the assets extracted from a website or multimedia document. */
90
105
  listChildren: (options?: ListAssetChildrenOptions) => Promise<AssetChildrenPage>;
106
+ /**
107
+ * Lists one page of an audio or video asset's findings timeline, in time order.
108
+ * `classification.moderation.timeline.segmentCount` says how many segments there are.
109
+ */
110
+ listTimeline: (options: ListAssetTimelineOptions) => Promise<AssetTimelinePage>;
111
+ /** Yields every segment of an audio or video asset's findings timeline, in time order. */
112
+ iterateTimeline: (options: IterateAssetTimelineOptions) => AsyncGenerator<AssetTimelinePage["items"][number], void, undefined>;
91
113
  /** Yields every child of an asset, fetching pages as needed. */
92
114
  iterateChildren: (options: IterateAssetChildrenOptions) => AsyncGenerator<Asset, void, undefined>;
93
115
  /**
94
- * Uploads an asset and queues it for moderation, returning immediately with processing
95
- * status `processing` (or `uploading` for the first multipart part). Retried safely with an
96
- * `Idempotency-Key`.
116
+ * Uploads an asset and returns without waiting for its decision (`wait=false`), with
117
+ * `classification.status` `queued`. Retried safely with an `Idempotency-Key`.
97
118
  */
98
119
  create: (options: SubmitAssetOptions) => Promise<Asset>;
99
120
  /**
@@ -102,15 +123,10 @@ declare class CalmLensServerClient {
102
123
  */
103
124
  classify: (classifyOptions: SubmitAssetOptions) => Promise<Asset>;
104
125
  /**
105
- * Uploads the next part of a multipart upload. The upload's queue mode, chosen when it
106
- * started, applies when the final part arrives; pass `queue` to override it.
126
+ * Uploads the next part of a multipart upload. Whether the final part waits for the
127
+ * decision was chosen when the upload started; pass `wait` to override it.
107
128
  */
108
129
  uploadPart: (partOptions: UploadAssetPartOptions) => Promise<Asset>;
109
- /**
110
- * Creates a short-lived signed CDN URL, so browsers can load private content without
111
- * an API key.
112
- */
113
- createSignedUrl: (signedUrlOptions: CreateAssetSignedUrlOptions) => Promise<PostAssetSignedUrlResponse>;
114
130
  /** Moves an asset into a folder, or to the project root with `folderId: null`. */
115
131
  move: (options: MoveAssetOptions) => Promise<Asset>;
116
132
  /**
@@ -127,17 +143,22 @@ declare class CalmLensServerClient {
127
143
  */
128
144
  decide: (options: DecideAssetOptions) => Promise<Asset>;
129
145
  /**
130
- * Completes the policy evidence behind a decided asset's moderation decision: the report's
131
- * `classification.moderation.evidence` becomes `full` and every action stays as
146
+ * Completes the policy evidence behind a decided asset's moderation decision: its
147
+ * `classification.moderation.explanationComplete` becomes `true` and every action stays as
132
148
  * decided. With `rerun: true` the asset is moderated again with the project's current policy
133
- * and returns in `processing`; use it when the policy has changed since the decision
134
- * (`asset/policy-changed`).
149
+ * and an `asset.rerun-requested` event is recorded; use it when the policy has changed since
150
+ * the decision (`asset/policy-changed`). The asset returns unchanged: it keeps its decision
151
+ * until the re-run's is stored, reported by `asset.classified` and `asset.<status>` events,
152
+ * and a failed re-run keeps it. A reviewed asset fails with `asset/reviewed`, and one whose
153
+ * content is gone with `asset/content-unavailable`.
135
154
  */
136
155
  explain: (options: ExplainAssetOptions) => Promise<Asset>;
137
156
  /**
138
- * Waits until an asset's `classification.moderation.status` is no longer `pending` (`allowed`,
139
- * `limited`, `age-restricted`, `blocked` or `purged`), or its `classification.status` is `failed`, and returns that asset, checking every few seconds. Rejects with `sdk/timeout` if there is no
140
- * decision within `timeoutMs` (default 60000). Webhooks report decisions without polling.
157
+ * Waits until an asset is settled, its `classification.status` `completed` (with its
158
+ * decision in `classification.moderation.status`) or `failed`, and returns that asset,
159
+ * checking every few seconds. A `queued` or `processing` asset is still waiting, even when a
160
+ * reviewer has already decided it. Rejects with `sdk/timeout` if it is not settled within
161
+ * `timeoutMs` (default 60000). Webhooks report decisions without polling.
141
162
  */
142
163
  waitForDecision: (waitOptions: WaitForAssetDecisionOptions) => Promise<Asset>;
143
164
  /**
@@ -145,16 +166,21 @@ declare class CalmLensServerClient {
145
166
  * keeping the asset record, metadata and classification results. The returned asset has
146
167
  * `content.status` set to `removed` and `content.removalReason` to `requested`; the CDN no longer serves it.
147
168
  */
148
- deleteContent: (options: DeleteAssetContentOptions) => Promise<Asset>;
149
- /** Deletes an asset record together with its stored content. */
169
+ removeContent: (options: RemoveAssetContentOptions) => Promise<Asset>;
170
+ /**
171
+ * Deletes an asset record together with its stored content. An asset extracted from another
172
+ * (one with a `parentId`) fails with `asset/child-not-deletable`: delete its parent instead.
173
+ */
150
174
  delete: (options: DeleteAssetOptions) => Promise<void>;
151
175
  /**
152
176
  * Deletes up to 500 assets (`operation: "delete"`) or removes their stored content
153
177
  * (`"remove-content"`) in one request. Every asset must exist in the project and the key
154
- * needs `assets:delete` for its folder, or nothing is queued. Resolves with
155
- * `{ queued: true }` once queued; the work runs in the background and records
156
- * `asset.deleted` or `asset.content-removed` for each asset. Assets under a safety hold
157
- * are skipped. Not retried: it carries no `Idempotency-Key`.
178
+ * needs `assets:delete` for its folder, and a deletion can't name an asset extracted from
179
+ * another (`asset/child-not-deletable`), or nothing is queued. Resolves with
180
+ * `{ batchId, status: "queued", assetCount }` once queued; the work runs in the background
181
+ * and records `asset.deleted` or `asset.content-removed` for each asset, with a `batch-id`
182
+ * fact naming `batchId`. Assets under a safety hold are skipped. Not retried: it carries no
183
+ * `Idempotency-Key`.
158
184
  */
159
185
  batch: (options: BatchAssetsOptions) => Promise<BatchAssetsResponse>;
160
186
  };
@@ -173,8 +199,10 @@ declare class CalmLensServerClient {
173
199
  get events(): {
174
200
  /**
175
201
  * Lists project events after a cursor, oldest first. Call without `cursor` to get a cursor
176
- * for "now", then poll with each response's `nextCursor`. Webhook deliveries carry the same
177
- * events reshaped as `{ id, type, createdAt, projectId, data }`.
202
+ * for "now", then poll with each response's `nextCursor`. Webhook deliveries carry each
203
+ * event's same fields as a flat JSON body. `types` and `assetId` narrow the feed to some
204
+ * event types or one asset's events; a cursor belongs to the filters it was issued with, so
205
+ * pass the same ones with each `cursor`.
178
206
  */
179
207
  list: (options?: ListEventsOptions) => Promise<GetEventsResponse>;
180
208
  /**
@@ -188,10 +216,12 @@ declare class CalmLensServerClient {
188
216
  private iteratePages;
189
217
  get folders(): {
190
218
  /**
191
- * Lists one page of child folders, sorted by name unless `ordering` says otherwise. Pass
219
+ * Lists one page of child folders, sorted by name unless `sort` says otherwise. Pass
192
220
  * `nextCursor` as `cursor` for the next page; fetch a branch when it is opened.
193
221
  */
194
222
  list: (options?: ListFoldersOptions) => Promise<FolderPage>;
223
+ /** Yields every child folder of `parentId` (or the project root), fetching pages as needed. */
224
+ iterate: (options?: IterateFoldersOptions) => AsyncGenerator<Folder, void, undefined>;
195
225
  retrieve: (options: FolderIdOptions) => Promise<Folder>;
196
226
  /** Creates a folder at the project root or inside `parentId`. */
197
227
  create: (options: CreateFolderOptions) => Promise<Folder>;
@@ -206,51 +236,79 @@ declare class CalmLensServerClient {
206
236
  * compared with every list: `flag` lists record matches, `block` lists also block close ones.
207
237
  */
208
238
  get hashLists(): {
209
- /** Lists one page of the project's hash lists, newest first. */
239
+ /** Lists one page of the project's hash lists, newest first unless `sort` says otherwise. */
210
240
  list: (options?: ListHashListsOptions) => Promise<HashListPage>;
241
+ /** Yields every hash list, fetching pages as needed. */
242
+ iterate: (options?: IterateHashListsOptions) => AsyncGenerator<HashList, void, undefined>;
211
243
  retrieve: (options: HashListIdOptions) => Promise<HashList>;
212
244
  create: (options: CreateHashListOptions) => Promise<HashList>;
213
245
  /** Renames a list or changes its action; the new action applies to later uploads. */
214
246
  update: (options: UpdateHashListOptions) => Promise<HashList>;
215
247
  /** Deletes the list and every entry in it. */
216
248
  delete: (options: HashListIdOptions) => Promise<void>;
217
- /** Lists one page of a list's entries, newest first. */
249
+ /** Yields every entry of a list, fetching pages as needed. */
250
+ iterateEntries: (options: IterateHashListEntriesOptions) => AsyncGenerator<HashListEntry, void, undefined>;
251
+ /** Lists one page of a list's entries, newest first unless `sort` says otherwise. */
218
252
  listEntries: (options: ListHashListEntriesOptions) => Promise<HashListEntryPage>;
219
253
  /** Adds a hash, or an image asset's hash; a hash already in the list returns its entry. */
220
254
  addEntry: (options: AddHashListEntryOptions) => Promise<HashListEntry>;
221
255
  removeEntry: (options: HashListEntryIdOptions) => Promise<void>;
222
256
  };
223
257
  /**
224
- * Moderation policies belong to the project's organisation and its projects share them. Every
225
- * change sends the policy's `revision`, so a policy changed since is refused. Through a
226
- * project's key you can change only policies no other project uses or owns.
258
+ * Moderation policies belong to the organisation and its projects share them. Every change sends
259
+ * the policy's `revision`, so a policy changed since is refused. Through a project's key you can
260
+ * change only policies no other project uses.
227
261
  */
228
262
  get policies(): {
229
- /** Lists the organisation's policies and the ID of the one the project uses. */
230
- list: () => Promise<PolicyList>;
263
+ /** Lists one page of the organisation's policies, oldest first unless `sort` says otherwise. */
264
+ list: (options?: ListPoliciesOptions) => Promise<PolicyPage>;
265
+ /** Yields every policy of the organisation, fetching pages as needed. */
266
+ iterate: (options?: IteratePoliciesOptions) => AsyncGenerator<Policy, void, undefined>;
231
267
  retrieve: (options: PolicyIdOptions) => Promise<Policy>;
232
268
  /** Creates a policy from `settings`, or a copy of a built-in preset with `presetId`. */
233
269
  create: (options: CreatePolicyOptions) => Promise<Policy>;
234
270
  /** Changes the name, description or settings; later moderation uses them. */
235
271
  update: (options: UpdatePolicyOptions) => Promise<Policy>;
236
- /** Resets a preset copy to its pinned version, or updates an unchanged copy to the latest. */
237
- applyPreset: (options: ApplyPolicyPresetOptions) => Promise<Policy>;
238
- /** Switches automatic updates on or off for the organisation's own preset policy. */
272
+ /** Restores the settings of the preset release a `pinned` or `copy` policy is pinned to. */
273
+ reset: (options: ResetPolicyOptions) => Promise<Policy>;
274
+ /** Moves an unchanged `pinned` or `copy` policy to the latest release of its preset. */
275
+ upgrade: (options: UpgradePolicyOptions) => Promise<Policy>;
276
+ /** Switches automatic updates on (`live`) or off (`pinned`) for the organisation's own preset policy. */
239
277
  setAutomaticUpdates: (options: SetPolicyAutomaticUpdatesOptions) => Promise<Policy>;
240
278
  /** Deletes a policy that no project or upload preset uses. */
241
279
  delete: (options: PolicyIdOptions) => Promise<void>;
280
+ /** The policy the project moderates with. */
281
+ retrieveAssigned: () => Promise<Policy>;
242
282
  /** Chooses the policy the project moderates with. */
243
283
  assign: (options: AssignPolicyOptions) => Promise<Policy>;
244
284
  };
245
285
  /**
246
- * Create a named lens at any positive version, or update it with a greater version.
247
- * Supplying the same definition and version is idempotent.
286
+ * The project's lenses: named image transforms the CDN applies at `/@<identifier>`. The CDN
287
+ * serves files made with each lens's current definition. `ensureLenses` creates or changes
288
+ * lenses by identifier, for applications that declare theirs in code.
289
+ */
290
+ get lenses(): {
291
+ /** Lists one page of the project's lenses, newest first unless `sort` says otherwise. */
292
+ list: (options?: ListLensesOptions) => Promise<LensPage>;
293
+ /** Yields every lens of the project, fetching pages as needed. */
294
+ iterate: (options?: IterateLensesOptions) => AsyncGenerator<Lens, void, undefined>;
295
+ /** Creates a lens; its identifier must be new to the project. */
296
+ create: (options: CreateLensOptions) => Promise<Lens>;
297
+ retrieve: (options: LensIdOptions) => Promise<Lens>;
298
+ /** Changes a lens's name, description, type, transform or whether the CDN serves it. */
299
+ update: (options: UpdateLensOptions) => Promise<Lens>;
300
+ /** Deletes a lens; URLs that select it stop being served. */
301
+ delete: (options: LensIdOptions) => Promise<void>;
302
+ };
303
+ /**
304
+ * Creates a named lens, or changes it to this definition. Sending the same definition again
305
+ * returns the lens unchanged, from the client's lens cache once it has seen it.
248
306
  */
249
307
  ensureLens(options: EnsureLensOptions): Promise<Lens>;
250
308
  /**
251
309
  * Create or update several named lenses. New definitions are sent in one API request, or in
252
310
  * consecutive requests of at most {@link ENSURE_LENSES_MAX_PER_REQUEST} definitions, in order.
253
- * Each lens follows the same versioning and idempotency rules as ensureLens().
311
+ * Each lens is created or changed as ensureLens() does.
254
312
  */
255
313
  ensureLenses(options: EnsureLensesOptions): Promise<Lens[]>;
256
314
  private submitEnsureLenses;