calmlens 0.19.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.
- package/README.md +13 -9
- package/bin/calmlens.js +1646 -706
- package/cjs/{BrowserUpload-CJ4Xc9bR.js → BrowserUpload-CeSwiMo5.js} +1 -1
- package/{esm/BrowserUpload-RkxV_Vv7.d.ts → cjs/BrowserUpload-D-NnAN7g.d.ts} +2 -2
- package/cjs/{CalmLensAppClient-LHMEQ-UZ.js → CalmLensAppClient-0UVCuNqW.js} +30 -10
- package/cjs/{CalmLensAppClient-B5gfOB6J.d.ts → CalmLensAppClient-gG16T2py.d.ts} +13 -3
- package/cjs/{CalmLensOptionKeys-BUj7v5AG.js → CalmLensOptionKeys-CYY6elxg.js} +242 -345
- package/cjs/{CalmLensServerClient-DCSbwIBs.d.ts → CalmLensServerClient-BHx3x_nZ.d.ts} +107 -49
- package/cjs/{CalmLensServerClient-BVOEUT_v.js → CalmLensServerClient-nfu6_YEW.js} +297 -92
- package/cjs/{CalmLensTypes-DpU-hXq2.d.ts → CalmLensTypes-CUB0YYVz.d.ts} +26601 -27354
- package/cjs/{Classification-D3SkprrQ-CMnQKW13.d.ts → Classification-Q5zGpR8l-CEWjnE39.d.ts} +731 -607
- package/cjs/Core-C82YmjjX.d.ts +823 -0
- package/cjs/Core-Dc3cteU7.js +998 -0
- package/cjs/FileIcons-4qSX7DW2.d.ts +67 -0
- package/cjs/{ModerationContextLimits-FDpQmw_T.js → ModerationContextLimits-BxOmeSqq.js} +970 -278
- package/cjs/{ReactUpload-BvpW4hJi.js → ReactUpload-BK2O3dnK.js} +1 -1
- package/cjs/{ReactUpload-huIMnOJ4.d.ts → ReactUpload-DiiXfKvj.d.ts} +1 -1
- package/cjs/{TestTriggers-CMwMrbjy-K0YBzu2a.js → TestTriggers-BTyXtX0Q-ATuFDhLX.js} +343 -35
- package/{esm/TestTriggers-D-fwfhEP-hlaP1oW2.d.ts → cjs/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts} +146 -8
- package/cjs/{UploadController-D4qOZZc3.js → UploadController-DLyiLDTB.js} +34 -14
- package/cjs/{WebhookPayload-CQg8BBZQ.d.ts → WebhookPayload-BLT2y_Jy.d.ts} +93 -86
- package/cjs/app.d.ts +6 -7
- package/cjs/app.js +4 -3
- package/cjs/elements.d.ts +123 -22
- package/cjs/elements.js +553 -156
- package/cjs/file-icons.d.ts +2 -67
- package/cjs/index-CKRgjV16.d.ts +16 -0
- package/cjs/index.d.ts +5 -6
- package/cjs/index.js +3 -2
- package/cjs/react-native.d.ts +52 -11
- package/cjs/react-native.js +231 -99
- package/cjs/react.d.ts +42 -9
- package/cjs/react.js +381 -118
- package/cjs/server.d.ts +48 -7
- package/cjs/server.js +7 -3
- package/cjs/test-inputs.d.ts +2 -2
- package/cjs/test-inputs.js +13 -9
- package/cjs/testing.d.ts +29 -16
- package/cjs/testing.js +1511 -397
- package/cjs/ui-CTBUxnVp.d.ts +139 -0
- package/cjs/ui-CZ8exACq.js +1359 -0
- package/cjs/ui.d.ts +3 -2
- package/cjs/ui.js +45 -22
- package/cjs/vue.d.ts +802 -199
- package/cjs/vue.js +359 -127
- package/{cjs/BrowserUpload-RkxV_Vv7.d.ts → esm/BrowserUpload-D-NnAN7g.d.ts} +2 -2
- package/esm/{BrowserUpload-DpzS2bbj.js → BrowserUpload-i9OhCzMJ.js} +1 -1
- package/esm/{CalmLensAppClient-BjlvBweS.js → CalmLensAppClient-CK4_Py0c.js} +30 -10
- package/esm/{CalmLensAppClient-B5gfOB6J.d.ts → CalmLensAppClient-gG16T2py.d.ts} +13 -3
- package/esm/{CalmLensOptionKeys-BKez0Wiw.js → CalmLensOptionKeys-BGZlIsT2.js} +235 -338
- package/esm/{CalmLensServerClient-DCSbwIBs.d.ts → CalmLensServerClient-BHx3x_nZ.d.ts} +107 -49
- package/esm/{CalmLensServerClient-DemxbNMn.js → CalmLensServerClient-dAQUcDWb.js} +274 -93
- package/esm/{CalmLensTypes-DpU-hXq2.d.ts → CalmLensTypes-CUB0YYVz.d.ts} +26601 -27354
- package/esm/{Classification-D3SkprrQ-CMnQKW13.d.ts → Classification-Q5zGpR8l-CEWjnE39.d.ts} +731 -607
- package/esm/Core-BxeIud_S.js +843 -0
- package/esm/Core-C82YmjjX.d.ts +823 -0
- package/esm/FileIcons-4qSX7DW2.d.ts +67 -0
- package/esm/{ModerationContextLimits-lLfmyLni.js → ModerationContextLimits-B6_RalCQ.js} +911 -261
- package/esm/{ReactUpload-huIMnOJ4.d.ts → ReactUpload-DiiXfKvj.d.ts} +1 -1
- package/esm/{ReactUpload-6klucehl.js → ReactUpload-DxwVqfX1.js} +1 -1
- package/esm/{TestTriggers-CMwMrbjy-bdowBBKw.js → TestTriggers-BTyXtX0Q-GRB9jQwo.js} +320 -36
- package/{cjs/TestTriggers-D-fwfhEP-hlaP1oW2.d.ts → esm/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts} +146 -8
- package/esm/{UploadController-UxP6gj7A.js → UploadController-D9Z-h00Q.js} +34 -14
- package/esm/{WebhookPayload-CQg8BBZQ.d.ts → WebhookPayload-BLT2y_Jy.d.ts} +93 -86
- package/esm/app.d.ts +6 -7
- package/esm/app.js +3 -3
- package/esm/elements.d.ts +123 -22
- package/esm/elements.js +497 -128
- package/esm/file-icons.d.ts +2 -67
- package/esm/index-CKRgjV16.d.ts +16 -0
- package/esm/index.d.ts +5 -6
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +52 -11
- package/esm/react-native.js +205 -75
- package/esm/react.d.ts +42 -9
- package/esm/react.js +327 -91
- package/esm/server.d.ts +48 -7
- package/esm/server.js +3 -3
- package/esm/styles.css +142 -22
- package/esm/svelte/AssetViewer.svelte +25 -0
- package/esm/svelte/CalmLensAsset.svelte +318 -0
- package/esm/svelte/CalmLensDocumentViewer.svelte +7 -0
- package/esm/svelte/CalmLensImageViewer.svelte +7 -0
- package/esm/svelte/CalmLensSpreadsheetViewer.svelte +7 -0
- package/esm/svelte/CalmLensTextViewer.svelte +7 -0
- package/esm/svelte/CalmLensWebsiteViewer.svelte +7 -0
- package/esm/svelte/index.d.ts +29 -6
- package/esm/svelte/index.js +7 -2
- package/esm/test-inputs.d.ts +2 -2
- package/esm/test-inputs.js +1 -1
- package/esm/testing.d.ts +29 -16
- package/esm/testing.js +1507 -393
- package/esm/ui-CTBUxnVp.d.ts +139 -0
- package/esm/ui-Cr7s6JHm.js +1258 -0
- package/esm/ui.d.ts +3 -2
- package/esm/ui.js +4 -3
- package/esm/vue.d.ts +802 -199
- package/esm/vue.js +308 -103
- package/package.json +3 -1
- package/cjs/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +0 -67
- package/cjs/index-BcDDQJF2.d.ts +0 -253
- package/cjs/ui-B23r8BvW.d.ts +0 -539
- package/cjs/ui-Dq-cm6Rx.js +0 -586
- package/esm/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +0 -67
- package/esm/index-BcDDQJF2.d.ts +0 -253
- package/esm/svelte/CalmLensMedia.svelte +0 -134
- package/esm/ui-B23r8BvW.d.ts +0 -539
- package/esm/ui-Bn29rfAi.js +0 -461
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "./WebhookPayload-
|
|
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
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
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
|
|
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,29 +103,30 @@ 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
|
|
95
|
-
* status
|
|
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
|
/**
|
|
100
121
|
* Uploads an asset and waits for its moderation decision. Audio and video still finish
|
|
101
122
|
* in the background. Retried safely with an `Idempotency-Key`.
|
|
102
123
|
*/
|
|
103
|
-
classify: (
|
|
124
|
+
classify: (classifyOptions: SubmitAssetOptions) => Promise<Asset>;
|
|
104
125
|
/**
|
|
105
|
-
* Uploads the next part of a multipart upload.
|
|
106
|
-
*
|
|
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:
|
|
131
|
-
* `classification.moderation.
|
|
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
|
|
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
|
|
139
|
-
*
|
|
140
|
-
*
|
|
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
|
-
|
|
149
|
-
/**
|
|
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,
|
|
155
|
-
* `
|
|
156
|
-
* `
|
|
157
|
-
*
|
|
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
|
|
177
|
-
*
|
|
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 `
|
|
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
|
-
/**
|
|
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
|
|
225
|
-
*
|
|
226
|
-
*
|
|
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
|
|
230
|
-
list: () => Promise<
|
|
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
|
-
/**
|
|
237
|
-
|
|
238
|
-
/**
|
|
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
|
-
*
|
|
247
|
-
*
|
|
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
|
|
311
|
+
* Each lens is created or changed as ensureLens() does.
|
|
254
312
|
*/
|
|
255
313
|
ensureLenses(options: EnsureLensesOptions): Promise<Lens[]>;
|
|
256
314
|
private submitEnsureLenses;
|