calmlens 0.20.0 → 0.22.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 +15 -10
- package/bin/calmlens.js +1848 -679
- package/cjs/{BrowserUpload-C07aL9Vq.d.ts → BrowserUpload-BWjZ9ntu.d.ts} +2 -2
- package/cjs/{BrowserUpload-CjSHjx3C.js → BrowserUpload-Bwlib4Zc.js} +1 -1
- package/cjs/{CalmLensAppClient-DDLojj0P.d.ts → CalmLensAppClient-BaW3ddUR.d.ts} +13 -3
- package/cjs/{CalmLensAppClient-NaCxOVlM.js → CalmLensAppClient-DUYMo9PZ.js} +30 -10
- package/cjs/{CalmLensOptionKeys-p2QK687A.js → CalmLensOptionKeys-YvgV995V.js} +318 -374
- package/cjs/{CalmLensServerClient-BDzTthxE.js → CalmLensServerClient-3N-gdsxC.js} +346 -89
- package/cjs/CalmLensServerClient-BKzn8zmp.d.ts +353 -0
- package/cjs/{CalmLensTypes-COJbOuiv.d.ts → CalmLensTypes-BDKwThbO.d.ts} +26993 -27187
- package/cjs/{Classification-D3SkprrQ-CMnQKW13.d.ts → Classification-Q5zGpR8l-CEWjnE39.d.ts} +731 -607
- package/cjs/Core-C33pkBmf.d.ts +826 -0
- package/cjs/Core-Cm5Z1oJ9.js +1001 -0
- package/cjs/FileIcons-4qSX7DW2.d.ts +67 -0
- package/cjs/{ModerationContextLimits-2nIv7Zh3.js → ModerationContextLimits-ud1xpZRK.js} +727 -268
- package/cjs/{ReactUpload-BdTRCTGA.js → ReactUpload-DQ0BYISX.js} +1 -1
- package/cjs/{ReactUpload-CRJNPB5T.d.ts → ReactUpload-DhF8mm51.d.ts} +1 -1
- package/{esm/TestTriggers-D-fwfhEP-hlaP1oW2.d.ts → cjs/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts} +146 -8
- package/cjs/{TestTriggers-DbhsNPdg-DjvVuc2h.js → TestTriggers-D29T_R0M-D6Bu-Mln.js} +355 -47
- package/cjs/{UploadController-MLVs97Zt.js → UploadController-l8fZM2qT.js} +34 -14
- package/{esm/WebhookPayload-DkukERKE.d.ts → cjs/WebhookPayload-Dt6DttS0.d.ts} +120 -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-Bde1wjiw.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 -15
- package/cjs/testing.js +1722 -433
- package/cjs/ui-BRA4HQ8r.js +1359 -0
- package/cjs/ui-YQuvbidU.d.ts +139 -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/esm/{BrowserUpload-C07aL9Vq.d.ts → BrowserUpload-BWjZ9ntu.d.ts} +2 -2
- package/esm/{BrowserUpload-CAVkRotw.js → BrowserUpload-GRZVB0G_.js} +1 -1
- package/esm/{CalmLensAppClient-PQ9VBvlW.js → CalmLensAppClient-B5QIJ6KS.js} +30 -10
- package/esm/{CalmLensAppClient-DDLojj0P.d.ts → CalmLensAppClient-BaW3ddUR.d.ts} +13 -3
- package/esm/{CalmLensOptionKeys-Do2mPP6w.js → CalmLensOptionKeys-BG7Qrh8-.js} +317 -367
- package/esm/CalmLensServerClient-BKzn8zmp.d.ts +353 -0
- package/esm/{CalmLensServerClient-C_H5aAsV.js → CalmLensServerClient-bRUAebi-.js} +323 -90
- package/esm/{CalmLensTypes-COJbOuiv.d.ts → CalmLensTypes-BDKwThbO.d.ts} +26993 -27187
- package/esm/{Classification-D3SkprrQ-CMnQKW13.d.ts → Classification-Q5zGpR8l-CEWjnE39.d.ts} +731 -607
- package/esm/Core-BvQe4moS.js +846 -0
- package/esm/Core-C33pkBmf.d.ts +826 -0
- package/esm/FileIcons-4qSX7DW2.d.ts +67 -0
- package/esm/{ModerationContextLimits-Chw-AzgL.js → ModerationContextLimits-CrxSnVZ3.js} +682 -253
- package/esm/{ReactUpload-CMmL0R5Q.js → ReactUpload-BMO8saxT.js} +1 -1
- package/esm/{ReactUpload-CRJNPB5T.d.ts → ReactUpload-DhF8mm51.d.ts} +1 -1
- package/{cjs/TestTriggers-D-fwfhEP-hlaP1oW2.d.ts → esm/TestTriggers-D0pYHbkr-D5T0VdSn.d.ts} +146 -8
- package/esm/{TestTriggers-DbhsNPdg-CUdrv8Nm.js → TestTriggers-D29T_R0M-Ztc74ucs.js} +332 -48
- package/esm/{UploadController-BJZghJpg.js → UploadController-DnJrWiE4.js} +34 -14
- package/{cjs/WebhookPayload-DkukERKE.d.ts → esm/WebhookPayload-Dt6DttS0.d.ts} +120 -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-Bde1wjiw.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 -15
- package/esm/testing.js +1718 -429
- package/esm/ui-YQuvbidU.d.ts +139 -0
- package/esm/ui-heryDd6g.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 +4 -2
- package/cjs/CalmLensServerClient-C-jsjn8m.d.ts +0 -259
- package/cjs/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +0 -67
- package/cjs/index-DxbJ_Xaa.d.ts +0 -253
- package/cjs/ui-BSqPGKrZ.d.ts +0 -539
- package/cjs/ui-CX1z2pD9.js +0 -586
- package/esm/CalmLensServerClient-C-jsjn8m.d.ts +0 -259
- package/esm/ModerationContext-9lGm-Mna-CcmbRnOy.d.ts +0 -67
- package/esm/index-DxbJ_Xaa.d.ts +0 -253
- package/esm/svelte/CalmLensMedia.svelte +0 -134
- package/esm/ui-BSqPGKrZ.d.ts +0 -539
- package/esm/ui-CXH7xJpb.js +0 -461
package/esm/svelte/index.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import type { Component } from "svelte";
|
|
1
|
+
import type { Component, Snippet } from "svelte";
|
|
2
2
|
import type {
|
|
3
|
+
AssetProps,
|
|
3
4
|
CalmLensUpload as CoreCalmLensUpload,
|
|
4
5
|
UploadControllerOptions as CoreUploadControllerOptions,
|
|
5
6
|
UploaderProps as CoreUploaderProps,
|
|
6
7
|
UploadItem as CoreUploadItem,
|
|
7
8
|
UploadSnapshot as CoreUploadSnapshot,
|
|
8
|
-
|
|
9
|
+
DocumentViewerOptions,
|
|
10
|
+
ImageViewerOptions,
|
|
11
|
+
SpreadsheetViewerOptions,
|
|
12
|
+
TextViewerOptions,
|
|
9
13
|
UploadController,
|
|
10
14
|
UploadFile,
|
|
15
|
+
WebsiteViewerOptions,
|
|
11
16
|
} from "../ui.js";
|
|
12
17
|
|
|
13
18
|
// The browser's files are `File`s, so the upload types default to `File` here.
|
|
@@ -28,10 +33,28 @@ export declare const createUploadController: <F extends UploadFile = File>(
|
|
|
28
33
|
export declare const CalmLensUploader: Component<UploaderProps>;
|
|
29
34
|
|
|
30
35
|
/**
|
|
31
|
-
* Shows
|
|
32
|
-
*
|
|
33
|
-
*
|
|
36
|
+
* Shows any asset from its asset URL (public or signed), natively in the page: images, websites,
|
|
37
|
+
* video and audio with their adaptive stream, documents, text and spreadsheets, or a preview still
|
|
38
|
+
* or file icon. It reads `{src}/info` once mounted, unless `info` is given. Age-restricted content
|
|
39
|
+
* stays behind its blurred placeholder and a reveal button; content the CDN refuses shows the
|
|
40
|
+
* unavailable notice. `renderUnavailable` and `renderAgeGate` snippets replace the notices.
|
|
34
41
|
*/
|
|
35
|
-
export declare const
|
|
42
|
+
export declare const CalmLensAsset: Component<
|
|
43
|
+
AssetProps & {
|
|
44
|
+
renderUnavailable?: Snippet;
|
|
45
|
+
renderAgeGate?: Snippet<[{ placeholderUrl?: string; confirm?: () => void }]>;
|
|
46
|
+
}
|
|
47
|
+
>;
|
|
48
|
+
|
|
49
|
+
/** Shows an image asset's rendered file, fitted to the element, over its placeholder (preview). */
|
|
50
|
+
export declare const CalmLensImageViewer: Component<ImageViewerOptions>;
|
|
51
|
+
/** Shows a website asset's screenshot with a link to the original page (preview). */
|
|
52
|
+
export declare const CalmLensWebsiteViewer: Component<WebsiteViewerOptions>;
|
|
53
|
+
/** Shows a text asset's text, escaped, in a scrolling region (preview). */
|
|
54
|
+
export declare const CalmLensTextViewer: Component<TextViewerOptions>;
|
|
55
|
+
/** Shows a PDF, or a document rendered as one, a page at a time with pdf.js (preview). */
|
|
56
|
+
export declare const CalmLensDocumentViewer: Component<DocumentViewerOptions>;
|
|
57
|
+
/** Shows a spreadsheet's sheets as tabs and paged tables, from its extracted text (preview). */
|
|
58
|
+
export declare const CalmLensSpreadsheetViewer: Component<SpreadsheetViewerOptions>;
|
|
36
59
|
|
|
37
60
|
export * from "../ui.js";
|
package/esm/svelte/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
// Svelte 5 components for uploads and
|
|
1
|
+
// Svelte 5 components for uploads and assets. The upload controller is a Svelte store, so
|
|
2
2
|
// `createUploadController(...)` and `$controller.items` build your own upload UI.
|
|
3
3
|
|
|
4
4
|
export * from "../ui.js";
|
|
5
|
-
export { default as
|
|
5
|
+
export { default as CalmLensAsset } from "./CalmLensAsset.svelte";
|
|
6
|
+
export { default as CalmLensDocumentViewer } from "./CalmLensDocumentViewer.svelte";
|
|
7
|
+
export { default as CalmLensImageViewer } from "./CalmLensImageViewer.svelte";
|
|
8
|
+
export { default as CalmLensSpreadsheetViewer } from "./CalmLensSpreadsheetViewer.svelte";
|
|
9
|
+
export { default as CalmLensTextViewer } from "./CalmLensTextViewer.svelte";
|
|
6
10
|
export { default as CalmLensUploader } from "./CalmLensUploader.svelte";
|
|
11
|
+
export { default as CalmLensWebsiteViewer } from "./CalmLensWebsiteViewer.svelte";
|
package/esm/test-inputs.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { type ClassificationTestSignal, TEST_INPUT_KEY_PATTERN, TEST_INPUT_PRESETS, type TestInput, detectTestImage, detectTestTrigger, generateTestTextCode, getImageTestCategories, paintTestImage, testInputForSignal };
|
|
1
|
+
import { a as TEST_FACE_AGE_PRESETS, c as TestDetections, d as detectTestTrigger, f as generateTestTextCode, h as testInputForSignal, i as TEST_FACE_AGE_MAX, l as TestInput, m as paintTestImage, n as TEST_DETECTIONS_MAX, o as TEST_INPUT_KEY_PATTERN, p as getImageTestCategories, r as TEST_DETECTION_BOX_MAX, s as TEST_INPUT_PRESETS, t as ClassificationTestSignal, u as detectTestImage } from "./TestTriggers-D0pYHbkr-D5T0VdSn.js";
|
|
2
|
+
export { type ClassificationTestSignal, TEST_DETECTIONS_MAX, TEST_DETECTION_BOX_MAX, TEST_FACE_AGE_MAX, TEST_FACE_AGE_PRESETS, TEST_INPUT_KEY_PATTERN, TEST_INPUT_PRESETS, type TestDetections, type TestInput, detectTestImage, detectTestTrigger, generateTestTextCode, getImageTestCategories, paintTestImage, testInputForSignal };
|
package/esm/test-inputs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as
|
|
1
|
+
export { t as TEST_DETECTIONS_MAX, n as TEST_DETECTION_BOX_MAX, r as TEST_FACE_AGE_MAX, i as TEST_FACE_AGE_PRESETS, a as TEST_INPUT_KEY_PATTERN, o as TEST_INPUT_PRESETS, s as detectTestImage, c as detectTestTrigger, l as generateTestTextCode, u as getImageTestCategories, f as paintTestImage, p as testInputForSignal } from "./TestTriggers-D29T_R0M-Ztc74ucs.js";
|
package/esm/testing.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
3
|
-
import { l as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-
|
|
4
|
-
import { t as CalmLensServerClient } from "./CalmLensServerClient-
|
|
5
|
-
import { t as ClassificationTestSignal } from "./TestTriggers-
|
|
1
|
+
import { Cn as PermissionGrant, D as CalmLensAppClientOptions, Hn as AssetBinaryPayloadInput, Ht as SignUploadTokenOptions, O as CalmLensServerClientOptions, Wt as SignedUploadToken, gn as TypedEvent, n as Asset, p as AssetModeration, wn as Folder } from "./CalmLensTypes-BDKwThbO.js";
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-BaW3ddUR.js";
|
|
3
|
+
import { l as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-Dt6DttS0.js";
|
|
4
|
+
import { t as CalmLensServerClient } from "./CalmLensServerClient-BKzn8zmp.js";
|
|
5
|
+
import { t as ClassificationTestSignal } from "./TestTriggers-D0pYHbkr-D5T0VdSn.js";
|
|
6
6
|
import "zod";
|
|
7
7
|
/**
|
|
8
8
|
* Signs a single-use upload token with `apiKey`, locally. `CalmLensServerClient` and
|
|
@@ -42,6 +42,7 @@ declare const ID_PREFIXES: {
|
|
|
42
42
|
readonly member: "mem";
|
|
43
43
|
readonly invitation: "inv";
|
|
44
44
|
readonly transfer: "xfer";
|
|
45
|
+
readonly assetBatch: "batch";
|
|
45
46
|
readonly supportTicket: "tkt";
|
|
46
47
|
readonly supportTicketMessage: "msg";
|
|
47
48
|
readonly humanReview: "rev";
|
|
@@ -83,7 +84,7 @@ export declare class MockDecision {
|
|
|
83
84
|
notEvaluated(category: Category): this;
|
|
84
85
|
/**
|
|
85
86
|
* The report a decided asset gets, as the API sends it: every category (unflagged ones
|
|
86
|
-
* evaluated with score 0), policy-adjusted results and the automated
|
|
87
|
+
* evaluated with score 0), policy-adjusted results and the automated status and
|
|
87
88
|
* `flaggedCategories`. `undefined` for `pending` and `failed`.
|
|
88
89
|
*/
|
|
89
90
|
report(): Omit<AssetModeration, "status" | "manualReviews"> | undefined;
|
|
@@ -184,7 +185,7 @@ type MockReviewDecision = "allowed" | "limited" | "age-restricted" | "blocked" |
|
|
|
184
185
|
* method that sends it; `callsTo` and `failNextRequest` also match the others (see
|
|
185
186
|
* `MockCalmLensCall`).
|
|
186
187
|
*/
|
|
187
|
-
declare const MOCK_OPERATIONS: readonly ["assets.list", "assets.iterate", "assets.search", "assets.retrieve", "assets.waitForDecision", "assets.update", "assets.listChildren", "assets.iterateChildren", "assets.
|
|
188
|
+
declare const MOCK_OPERATIONS: readonly ["assets.list", "assets.iterate", "assets.search", "assets.retrieve", "assets.waitForDecision", "assets.update", "assets.listChildren", "assets.iterateChildren", "assets.listTimeline", "assets.iterateTimeline", "assets.create", "assets.classify", "assets.uploadPart", "assets.move", "assets.retry", "assets.explain", "assets.decide", "assets.removeContent", "assets.delete", "assets.batch", "text.classify", "cdn.serve", "cdn.getAssetInfo", "cdn.signAssetUrl", "events.list", "events.pages", "folders.list", "folders.iterate", "folders.retrieve", "folders.create", "folders.update", "folders.delete", "folders.move", "hashLists.list", "hashLists.iterate", "hashLists.retrieve", "hashLists.create", "hashLists.update", "hashLists.delete", "hashLists.listEntries", "hashLists.iterateEntries", "hashLists.addEntry", "hashLists.removeEntry", "policies.list", "policies.iterate", "policies.retrieve", "policies.create", "policies.update", "policies.reset", "policies.upgrade", "policies.setAutomaticUpdates", "policies.delete", "policies.retrieveAssigned", "policies.assign", "lenses.list", "lenses.iterate", "lenses.create", "lenses.retrieve", "lenses.update", "lenses.delete", "ensureLens", "ensureLenses", "uploadPresets.list", "uploadPresets.iterate", "uploadPresets.ensure", "uploadPresets.delete", "projectSettings.get", "projectSettings.update", "metadataFields.list", "metadataFields.ensure", "metadataFields.delete"];
|
|
188
189
|
type MockCalmLensOperation = (typeof MOCK_OPERATIONS)[number];
|
|
189
190
|
/**
|
|
190
191
|
* One request a mock client sent, as the in-memory API received it. `operation` is the client
|
|
@@ -205,7 +206,11 @@ interface MockCalmLensCall {
|
|
|
205
206
|
query: Record<string, string>;
|
|
206
207
|
/** Request headers, with lowercase names. */
|
|
207
208
|
headers: Record<string, string>;
|
|
208
|
-
/**
|
|
209
|
+
/**
|
|
210
|
+
* The JSON body (plain text arrives as `{ name, content: { plainText, type } }`), an upload
|
|
211
|
+
* form as `{ options, file }` (the file as text for a `text/*` type, else bytes), the bytes of a
|
|
212
|
+
* later part, or `undefined`.
|
|
213
|
+
*/
|
|
209
214
|
body: unknown;
|
|
210
215
|
/** The HTTP status the mock answered with, or `undefined` when the request failed without one. */
|
|
211
216
|
status: number | undefined;
|
|
@@ -213,7 +218,7 @@ interface MockCalmLensCall {
|
|
|
213
218
|
/**
|
|
214
219
|
* What a simulated request failure does: `"transport-error"` and `"timeout"` fail the request
|
|
215
220
|
* like a network failure (`sdk/transport-error`) or a deadline (`sdk/timeout`); an API error
|
|
216
|
-
* code, such as `"
|
|
221
|
+
* code, such as `"usage/free-uploads-exhausted"`, answers with that API error and its HTTP status; a
|
|
217
222
|
* `CalmLensError` is thrown as is and any other `Error` as the cause of `sdk/transport-error`,
|
|
218
223
|
* like an exception from `fetch`.
|
|
219
224
|
*/
|
|
@@ -227,7 +232,8 @@ interface MockFailureOptions {
|
|
|
227
232
|
retryAfter?: number;
|
|
228
233
|
}
|
|
229
234
|
/** An event to add to the mock feed; omitted fields get defaults. */
|
|
230
|
-
|
|
235
|
+
/** An event to add to the feed; its `assetSequence` is assigned like the API's. */
|
|
236
|
+
type MockEventInput = Partial<Omit<TypedEvent, "type" | "assetSequence">> & {
|
|
231
237
|
type: TypedEvent["type"];
|
|
232
238
|
};
|
|
233
239
|
/** The upload preset settings a `MockCalmLensAppClient` applies, as the API would. */
|
|
@@ -237,7 +243,7 @@ interface MockUploadPreset {
|
|
|
237
243
|
/** Accepted content types, such as `["image/*"]`. Defaults to any type. */
|
|
238
244
|
allowedContentTypes?: string[];
|
|
239
245
|
maxFileSizeInBytes?: number;
|
|
240
|
-
/** Return `status` to the uploader. Defaults to `true`. */
|
|
246
|
+
/** Return `classification.moderation.status` to the uploader. Defaults to `true`. */
|
|
241
247
|
showDecisions?: boolean;
|
|
242
248
|
/** Defaults to `public`. */
|
|
243
249
|
visibility?: "public" | "private";
|
|
@@ -271,7 +277,6 @@ interface MockCalmLensServerClientOptions extends Omit<CalmLensServerClientOptio
|
|
|
271
277
|
* `completeProcessing`, and everything else is `allowed`.
|
|
272
278
|
*/
|
|
273
279
|
moderate?: MockModerate;
|
|
274
|
-
signedUrlBaseUrl?: string;
|
|
275
280
|
};
|
|
276
281
|
}
|
|
277
282
|
/**
|
|
@@ -301,6 +306,12 @@ export declare class MockCalmLensServerClient extends CalmLensServerClient {
|
|
|
301
306
|
* `callsTo("assets.waitForDecision")` the `assets.retrieve` requests it polls with.
|
|
302
307
|
*/
|
|
303
308
|
callsTo(operation: MockCalmLensOperation): MockCalmLensCall[];
|
|
309
|
+
/**
|
|
310
|
+
* Fetches a URL of the mock's CDN as a browser would, without the API key: a signed asset URL
|
|
311
|
+
* from `cdn.signAssetUrl` (with a resource appended), or a public one from `cdn.getAssetUrl`.
|
|
312
|
+
* The request is recorded like any other.
|
|
313
|
+
*/
|
|
314
|
+
fetchCdn(url: string, init?: RequestInit): Promise<Response>;
|
|
304
315
|
/** Forgets the requests recorded so far, so `calls` lists only later ones. */
|
|
305
316
|
clearCalls(): void;
|
|
306
317
|
/**
|
|
@@ -325,7 +336,7 @@ export declare class MockCalmLensServerClient extends CalmLensServerClient {
|
|
|
325
336
|
* Applies a reviewer's decision to a stored asset, as the portal or API would: the moderation
|
|
326
337
|
* status changes (`purged` also removes the content, with reason `requested` and an
|
|
327
338
|
* `asset.content-removed` event), the review joins `manualReviews`, and an `asset.<decision>`
|
|
328
|
-
* event
|
|
339
|
+
* event whose `actor` is a `user` joins the events feed. Rejects with
|
|
329
340
|
* `asset/not-found` for an unknown asset. It sends no request.
|
|
330
341
|
*/
|
|
331
342
|
decide(assetId: string, decision: MockReviewDecision): Promise<Asset>;
|
|
@@ -334,8 +345,11 @@ export declare class MockCalmLensServerClient extends CalmLensServerClient {
|
|
|
334
345
|
* else what `mockOptions.moderate` returns for the `complete` trigger (`allowed` by default).
|
|
335
346
|
* The asset gets the decision's report, and `asset.classified` and the automated
|
|
336
347
|
* `asset.<status>` (or `asset.failed`) join the events feed. No review is recorded, so the
|
|
337
|
-
* asset can still be moderated again.
|
|
338
|
-
* `
|
|
348
|
+
* asset can still be moderated again. A decided asset whose re-run (`assets.explain` with
|
|
349
|
+
* `rerun: true`) is still pending gets the decision in place of its old one, unless it is
|
|
350
|
+
* `pending` or `failed`. Rejects with `asset/not-found` for an unknown asset and
|
|
351
|
+
* `sdk/invalid-argument` for one that isn't processing or awaiting a pending re-run. It sends
|
|
352
|
+
* no request.
|
|
339
353
|
*/
|
|
340
354
|
completeProcessing(assetId: string, decision?: MockAssetOutcome | MockDecision): Promise<Asset>;
|
|
341
355
|
}
|