calmlens 0.27.4 → 0.27.6
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 +2 -2
- package/bin/calmlens.js +26 -15
- package/cjs/{BrowserUpload-CFtjSpBI.d.ts → BrowserUpload-CdOfuIcV.d.ts} +2 -2
- package/cjs/{BrowserUpload-Ch9y2ZDx.js → BrowserUpload-GQtZti-D.js} +1 -1
- package/{esm/CalmLensAppClient-DzoSqUgG.d.ts → cjs/CalmLensAppClient-Btp8f-34.d.ts} +2 -2
- package/cjs/{CalmLensAppClient-DGtj1vUV.js → CalmLensAppClient-Bwt3gP0C.js} +3 -3
- package/cjs/{CalmLensOptionKeys-DbL03fZj.js → CalmLensOptionKeys--gTpTkwt.js} +1 -1
- package/cjs/{CalmLensServerClient-D62AeRAi.js → CalmLensServerClient-BYMzGkQK.js} +7 -7
- package/cjs/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-C3kaPLUZ.d.ts} +2 -2
- package/cjs/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-DxxyZt2L.d.ts} +73 -5
- package/cjs/{Core-Cv2zLAJ-.js → Core-52DVaX7d.js} +63 -21
- package/{esm/Core-BXeXyiNv.d.ts → cjs/Core-Dhijt6JU.d.ts} +13 -14
- package/cjs/{CryptoUtils-B_x8lMIx-YBW1-bvL.js → CryptoUtils-BLCa-oZe-leCkr1ko.js} +1 -2
- package/cjs/{ModerationContextLimits-DjacyIkw.js → ModerationContextLimits-DJyIjzIn.js} +21 -3
- package/cjs/{ReactUpload-C47UrgH2.d.ts → ReactUpload-BuqLPgNr.d.ts} +1 -1
- package/cjs/{ReactUpload-CytoQTh_.js → ReactUpload-DHuhGYsr.js} +1 -1
- package/cjs/{TestTriggers-Cvi7e2KA-DcT1pc_W.js → TestTriggers-DP4m92jg-C0HD-A4r.js} +14 -14
- package/cjs/{UploadController-fpTC5TUO.js → UploadController-ChzDPMmm.js} +2 -2
- package/{esm/WebhookPayload-CrMU6lg0.d.ts → cjs/WebhookPayload-D_yWJA9M.d.ts} +5 -1
- package/cjs/app.d.ts +4 -4
- package/cjs/app.js +2 -2
- package/cjs/elements.d.ts +8 -19
- package/cjs/elements.js +45 -53
- package/cjs/{index-BDxmVi-G.d.ts → index-CUA-HDNu.d.ts} +2 -2
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +1 -1
- package/cjs/react-native.d.ts +3 -3
- package/cjs/react-native.js +6 -4
- package/cjs/react.d.ts +5 -11
- package/cjs/react.js +29 -36
- package/cjs/server.d.ts +4 -4
- package/cjs/server.js +2 -2
- package/cjs/test-inputs.js +13 -13
- package/cjs/testing.d.ts +4 -4
- package/cjs/testing.js +54 -32
- package/cjs/{ui-5IdEYYpC.d.ts → ui-BSm_qphN.d.ts} +3 -9
- package/cjs/{ui-BvyDbJBb.js → ui-C1_SDSiq.js} +2 -201
- package/cjs/ui.d.ts +3 -3
- package/cjs/ui.js +5 -5
- package/cjs/vue.d.ts +6 -319
- package/cjs/vue.js +27 -17
- package/esm/{BrowserUpload-BE8OVeBC.js → BrowserUpload-BaKFKEBz.js} +1 -1
- package/esm/{BrowserUpload-CFtjSpBI.d.ts → BrowserUpload-CdOfuIcV.d.ts} +2 -2
- package/{cjs/CalmLensAppClient-DzoSqUgG.d.ts → esm/CalmLensAppClient-Btp8f-34.d.ts} +2 -2
- package/esm/{CalmLensAppClient-C1cpQEYR.js → CalmLensAppClient-DM6c3pGC.js} +3 -3
- package/esm/{CalmLensOptionKeys-DoCKKuLT.js → CalmLensOptionKeys-CKZs8i3_.js} +1 -1
- package/esm/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-C3kaPLUZ.d.ts} +2 -2
- package/esm/{CalmLensServerClient-CSCrJ7wX.js → CalmLensServerClient-Da2UfUo4.js} +3 -3
- package/esm/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-DxxyZt2L.d.ts} +73 -5
- package/{cjs/Core-BXeXyiNv.d.ts → esm/Core-Dhijt6JU.d.ts} +13 -14
- package/esm/{Core-Df2PSa1n.js → Core-kYMRW5C1.js} +52 -22
- package/esm/{CryptoUtils-B_x8lMIx-DhuWGzqn.js → CryptoUtils-BLCa-oZe-DKr3LmN6.js} +1 -2
- package/esm/{ModerationContextLimits-tu_PY4fn.js → ModerationContextLimits-ZIlK9n2X.js} +21 -3
- package/esm/{ReactUpload-C47UrgH2.d.ts → ReactUpload-BuqLPgNr.d.ts} +1 -1
- package/esm/{ReactUpload-BsbisXS6.js → ReactUpload-CipY3cmO.js} +1 -1
- package/esm/{TestTriggers-Cvi7e2KA-BA83CRJb.js → TestTriggers-DP4m92jg-DhOI4S1V.js} +11 -11
- package/esm/{UploadController-Dqjf23bS.js → UploadController-D-14HWII.js} +2 -2
- package/{cjs/WebhookPayload-CrMU6lg0.d.ts → esm/WebhookPayload-D_yWJA9M.d.ts} +5 -1
- package/esm/app.d.ts +4 -4
- package/esm/app.js +2 -2
- package/esm/elements.d.ts +8 -19
- package/esm/elements.js +44 -50
- package/esm/{index-BDxmVi-G.d.ts → index-CUA-HDNu.d.ts} +2 -2
- package/esm/index.d.ts +3 -3
- package/esm/index.js +1 -1
- package/esm/react-native.d.ts +3 -3
- package/esm/react-native.js +5 -5
- package/esm/react.d.ts +5 -11
- package/esm/react.js +29 -34
- package/esm/server.d.ts +4 -4
- package/esm/server.js +2 -2
- package/esm/styles.css +12 -16
- package/esm/svelte/CalmLensAsset.svelte +22 -4
- package/esm/svelte/index.d.ts +0 -6
- package/esm/svelte/index.js +0 -2
- package/esm/test-inputs.js +1 -1
- package/esm/testing.d.ts +4 -4
- package/esm/testing.js +45 -23
- package/esm/{ui-5IdEYYpC.d.ts → ui-BSm_qphN.d.ts} +3 -9
- package/esm/{ui-DF7-9mB3.js → ui-CgIG3knW.js} +3 -190
- package/esm/ui.d.ts +3 -3
- package/esm/ui.js +4 -4
- package/esm/vue.d.ts +6 -319
- package/esm/vue.js +26 -14
- package/package.json +1 -1
- package/esm/svelte/CalmLensImageViewer.svelte +0 -7
- package/esm/svelte/CalmLensWebsiteViewer.svelte +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as CdnTransform, O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-
|
|
2
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
1
|
+
import { F as CdnTransform, O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-DxxyZt2L.js";
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-Btp8f-34.js";
|
|
3
3
|
import { o as UploadFileIconFamily } from "./FileIcons-4qSX7DW2.js";
|
|
4
4
|
/**
|
|
5
5
|
* The text the asset viewers show, keyed by name. `{name}` placeholders are filled in when shown.
|
|
@@ -7,12 +7,6 @@ import { o as UploadFileIconFamily } from "./FileIcons-4qSX7DW2.js";
|
|
|
7
7
|
*/
|
|
8
8
|
interface ViewerMessages {
|
|
9
9
|
loading: string;
|
|
10
|
-
/** An image that can't be loaded. */
|
|
11
|
-
imageFailed: string;
|
|
12
|
-
/** The website viewer's link to the original page; `{host}` is the page's host name. */
|
|
13
|
-
openWebsite: string;
|
|
14
|
-
/** The website screenshot's accessible name when no `label` is set. */
|
|
15
|
-
websiteLabel: string;
|
|
16
10
|
textLabel: string;
|
|
17
11
|
textFailed: string;
|
|
18
12
|
documentLabel: string;
|
|
@@ -151,11 +145,6 @@ interface ViewerTextOptions {
|
|
|
151
145
|
*/
|
|
152
146
|
getText?: () => Promise<string>;
|
|
153
147
|
}
|
|
154
|
-
interface ImageViewerOptions extends ViewerOptions {
|
|
155
|
-
/** The `sizes` attribute of a public image's responsive widths. Defaults to `100vw`. */
|
|
156
|
-
sizes?: string;
|
|
157
|
-
}
|
|
158
|
-
type WebsiteViewerOptions = ViewerOptions;
|
|
159
148
|
type TextViewerOptions = ViewerOptions & ViewerTextOptions;
|
|
160
149
|
interface SpreadsheetViewerOptions extends ViewerOptions, ViewerTextOptions {
|
|
161
150
|
/** Rows shown at a time. Defaults to 100. */
|
|
@@ -364,6 +353,16 @@ declare const getPlayedPercent: (media: {
|
|
|
364
353
|
currentTime: number;
|
|
365
354
|
duration: number;
|
|
366
355
|
}) => number;
|
|
356
|
+
/**
|
|
357
|
+
* How soon after an image element mounts an `onload` still counts as a browser cache hit (such as
|
|
358
|
+
* the HTTP disk cache, where `complete` is false on mount) and appears immediately without fading.
|
|
359
|
+
*/
|
|
360
|
+
declare const INSTANT_LOAD_MS = 50;
|
|
361
|
+
/** True when an image element is already decoded in the browser's memory cache. */
|
|
362
|
+
declare const isImageReady: (image: {
|
|
363
|
+
complete: boolean;
|
|
364
|
+
naturalWidth: number;
|
|
365
|
+
} | null | undefined) => boolean;
|
|
367
366
|
/** Where a video or audio element was when its URL failed, to resume once a fresh one loads. */
|
|
368
367
|
interface MediaPlayback {
|
|
369
368
|
position: number;
|
|
@@ -831,4 +830,4 @@ declare const CALMLENS_THEME: {
|
|
|
831
830
|
* as the stylesheet mixes them from the page's text colour.
|
|
832
831
|
*/
|
|
833
832
|
declare const resolveTheme: (overrides?: Partial<CalmLensTheme>) => CalmLensTheme;
|
|
834
|
-
export {
|
|
833
|
+
export { MediaPlayback as $, CustomUploadContext as A, isFileAccepted as B, formatMessage as C, resolveMessages as D, getUploadItemOutcome as E, UploadFile as F, AssetImageSource as G, AssetDisplay as H, UploadItem as I, AssetSessionState as J, AssetOptions as K, UploadSnapshot as L, UploadClient as M, UploadController as N, CalmLensProvidedOptions as O, UploadControllerOptions as P, INSTANT_LOAD_MS as Q, UploadStage as R, formatBytes as S, getUploadItemMessage as T, AssetDocumentOptions as U, withProvidedOptions as V, AssetImageOptions as W, AssetVideoOptions as X, AssetSpreadsheetOptions as Y, AssetView as Z, DEFAULT_MESSAGES as _, DEFAULT_VIEWER_MESSAGES as _t, ProgressFetchOptions as a, isImageReady as at, describeUploadItem as b, resolveViewerMessages as bt, ICON_ATTRIBUTES as c, DocumentViewerOptions as ct, AssetDisplayOptions as d, TextViewerOptions as dt, getAssetAspectRatio as et, AssetEventHandlers as f, ViewerAsset as ft, CalmLensMessages as g, isSpreadsheetFormat as gt, UploaderProps as h, getAssetViewerKind as ht, CALMLENS_STYLES as i, getPlayedPercent as it, CustomUploadResult as j, CalmLensUpload as k, IconName as l, PdfAssetOptions as lt, UploaderDisplayOptions as m, ViewerTextOptions as mt, CalmLensTheme as n, getAssetViewKey as nt, createProgressFetch as o, pickAssetSource as ot, AssetProps as p, ViewerOptions as pt, AssetSession as q, resolveTheme as r, getPeakHeights as rt, ICONS as s, AssetViewerKind as st, CALMLENS_THEME as t, getAssetView as tt, ASSET_FILE_ICON_SIZE as u, SpreadsheetViewerOptions as ut, UploadItemView as v, ViewerMessages as vt, getDropzoneHint as w, describeUploader as x, UploaderView as y, formatViewerMessage as yt, createUploadController as z };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
// src/contract/CryptoUtils-
|
|
1
|
+
// src/contract/CryptoUtils-BLCa-oZe.js
|
|
2
2
|
const encoder = new TextEncoder();
|
|
3
3
|
/** Lowercase hex of `bytes`, two characters per byte. */
|
|
4
4
|
const bytesToHex = (bytes) => Array.from(bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
5
|
-
/** SHA-256 of the UTF-8 encoding of `value`, as lowercase hex. */
|
|
6
5
|
const sha256Hex = async (value) => bytesToHex(await crypto.subtle.digest("SHA-256", encoder.encode(value)));
|
|
7
6
|
/** HMAC-SHA256 of `message` keyed with `secret` (both UTF-8 encoded), as lowercase hex. */
|
|
8
7
|
const hmacSha256Hex = async (secret, message) => {
|
|
@@ -40,6 +40,7 @@ const API_ERROR_CODES = {
|
|
|
40
40
|
INVALID_IMAGE: "image/invalid",
|
|
41
41
|
IMAGE_TOO_LARGE: "image/too-large",
|
|
42
42
|
FREE_UPLOADS_EXHAUSTED: "usage/free-uploads-exhausted",
|
|
43
|
+
WEBSITE_BILLING_REQUIRED: "payment/billing-required",
|
|
43
44
|
UPLOADS_PAUSED: "usage/uploads-paused",
|
|
44
45
|
UNSUPPORTED_UPLOAD_TYPE: "upload/unsupported-type",
|
|
45
46
|
INVALID_UPLOAD_PAYLOAD: "upload-payload/invalid",
|
|
@@ -79,6 +80,7 @@ const API_ERROR_CODES = {
|
|
|
79
80
|
HASH_LIST_ENTRY_NOT_FOUND: "hash-list-entry/not-found",
|
|
80
81
|
HASH_LIST_LIMIT_REACHED: "hash-list/limit-reached",
|
|
81
82
|
HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list-entry/limit-reached",
|
|
83
|
+
HASH_LIST_ENTRY_QUALITY_TOO_LOW: "hash-list-entry/quality-too-low",
|
|
82
84
|
HASH_LIST_ASSET_NOT_HASHED: "hash-list/asset-not-hashed",
|
|
83
85
|
POLICY_NOT_FOUND: "policy/not-found",
|
|
84
86
|
POLICY_REVISION_CONFLICT: "policy/revision-conflict",
|
|
@@ -277,6 +279,10 @@ const API_ERROR_DEFINITIONS = {
|
|
|
277
279
|
status: 403,
|
|
278
280
|
message: "This project's organisation has used its free uploads. Set up billing to continue uploading."
|
|
279
281
|
},
|
|
282
|
+
"payment/billing-required": {
|
|
283
|
+
status: 409,
|
|
284
|
+
message: "Set up billing to upload websites."
|
|
285
|
+
},
|
|
280
286
|
"usage/uploads-paused": {
|
|
281
287
|
status: 402,
|
|
282
288
|
message: "This upload would pass its organisation's usage limits, so it was refused. See details.reason; an owner can review them in Billing."
|
|
@@ -433,6 +439,10 @@ const API_ERROR_DEFINITIONS = {
|
|
|
433
439
|
status: 409,
|
|
434
440
|
message: "This project's hash lists hold the most entries they can. Remove entries to add more."
|
|
435
441
|
},
|
|
442
|
+
"hash-list-entry/quality-too-low": {
|
|
443
|
+
status: 422,
|
|
444
|
+
message: "This hash cannot be matched. Use a more detailed image or a hash of higher quality."
|
|
445
|
+
},
|
|
436
446
|
"hash-list/asset-not-hashed": {
|
|
437
447
|
status: 409,
|
|
438
448
|
message: "This asset has no perceptual hash. Only image assets that finished processing can be added."
|
|
@@ -1052,7 +1062,7 @@ const listPages = (fetchPage, { cursor, feed = false } = {}) => {
|
|
|
1052
1062
|
};
|
|
1053
1063
|
// src/client/CalmLensVersion.ts
|
|
1054
1064
|
/** This SDK's version, from its package.json. */
|
|
1055
|
-
const SDK_VERSION = "0.27.
|
|
1065
|
+
const SDK_VERSION = "0.27.6";
|
|
1056
1066
|
const runtimeName = () => {
|
|
1057
1067
|
const runtime = globalThis;
|
|
1058
1068
|
if (isReactNativeRuntime()) return "react-native";
|
|
@@ -1432,7 +1442,7 @@ var CalmLensTransport = class {
|
|
|
1432
1442
|
}
|
|
1433
1443
|
}
|
|
1434
1444
|
};
|
|
1435
|
-
// src/contract/SharedConstants-
|
|
1445
|
+
// src/contract/SharedConstants-D-QkbICw.js
|
|
1436
1446
|
const IMPERSONATION_COOKIE_NAME = "CL_impersonation";
|
|
1437
1447
|
const DAY_MS = 864e5;
|
|
1438
1448
|
const YEAR_MS = 365 * DAY_MS;
|
|
@@ -1545,7 +1555,7 @@ const FIRST_PARTY_COOKIES = {
|
|
|
1545
1555
|
},
|
|
1546
1556
|
ASSET_DASHBOARD_STATE: {
|
|
1547
1557
|
name: "CL_assetDashboardState",
|
|
1548
|
-
description: "Remembers your asset dashboard view (view mode
|
|
1558
|
+
description: "Remembers your asset dashboard view (view mode and metadata grouping)",
|
|
1549
1559
|
expirationDescription: "1 year",
|
|
1550
1560
|
expirationMs: YEAR_MS,
|
|
1551
1561
|
type: "functional",
|
|
@@ -1593,6 +1603,14 @@ const FIRST_PARTY_COOKIES = {
|
|
|
1593
1603
|
type: "functional",
|
|
1594
1604
|
providerName: "CalmLens"
|
|
1595
1605
|
},
|
|
1606
|
+
CHATGPT_AD_CLICK: {
|
|
1607
|
+
name: "CL_chatgptAdClick",
|
|
1608
|
+
description: "Links a ChatGPT ad click to signups, moderation checks and credit checkouts",
|
|
1609
|
+
expirationDescription: "30 days",
|
|
1610
|
+
expirationMs: 30 * DAY_MS,
|
|
1611
|
+
type: "marketing",
|
|
1612
|
+
providerName: "CalmLens"
|
|
1613
|
+
},
|
|
1596
1614
|
SEARCH_SDK_LANGUAGE: {
|
|
1597
1615
|
name: "CL_searchSdkLanguage",
|
|
1598
1616
|
description: "Remembers the SDK you chose to filter documentation search results by",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-
|
|
1
|
+
import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-Dhijt6JU.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
type CalmLensProviderProps<F extends UploadFile = File> = CalmLensProvidedOptions<F> & {
|
|
4
4
|
children?: ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_UploadController = require("./UploadController-
|
|
1
|
+
const require_UploadController = require("./UploadController-ChzDPMmm.js");
|
|
2
2
|
let react = require("react");
|
|
3
3
|
// src/ui/ReactUpload.ts
|
|
4
4
|
const CalmLensContext = (0, react.createContext)(void 0);
|
|
@@ -19,7 +19,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
19
19
|
value: mod,
|
|
20
20
|
enumerable: true
|
|
21
21
|
}) : target, mod));
|
|
22
|
-
const
|
|
22
|
+
const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.js");
|
|
23
23
|
let zod = require("zod");
|
|
24
24
|
zod = __toESM(zod, 1);
|
|
25
25
|
// src/contract/ModerationCategories-CHFRoeWV.js
|
|
@@ -33,7 +33,7 @@ const CLASSIFICATION_CATEGORIES = [
|
|
|
33
33
|
"personal-information",
|
|
34
34
|
"profanity"
|
|
35
35
|
];
|
|
36
|
-
// src/contract/LazySchema-
|
|
36
|
+
// src/contract/LazySchema-BKMpWIaF.js
|
|
37
37
|
const registryMap = zod.globalRegistry._map;
|
|
38
38
|
/**
|
|
39
39
|
* A schema built the first time anything reads it, rather than when its module loads. Building
|
|
@@ -55,9 +55,9 @@ const lazySchema = /* @__NO_SIDE_EFFECTS__ */ (build) => {
|
|
|
55
55
|
if (!schema) {
|
|
56
56
|
const built = build();
|
|
57
57
|
schema = built;
|
|
58
|
+
const internals = built._zod;
|
|
58
59
|
const meta = registryMap.get(built);
|
|
59
60
|
if (meta !== void 0) registryMap.set(proxy, meta);
|
|
60
|
-
const internals = built._zod;
|
|
61
61
|
const process = internals.processJSONSchema;
|
|
62
62
|
if (process) internals.processJSONSchema = (context, json, params) => {
|
|
63
63
|
const record = context.seen.get(proxy);
|
|
@@ -103,7 +103,7 @@ const lazySchema = /* @__NO_SIDE_EFFECTS__ */ (build) => {
|
|
|
103
103
|
});
|
|
104
104
|
return proxy;
|
|
105
105
|
};
|
|
106
|
-
// src/contract/Jurisdiction-
|
|
106
|
+
// src/contract/Jurisdiction-uODFGQGo.js
|
|
107
107
|
/**
|
|
108
108
|
* Jurisdictions with legal rules always apply to every project. An optional jurisdiction is a
|
|
109
109
|
* product standard rather than a legal floor: every project serves it unless it opts out.
|
|
@@ -155,7 +155,7 @@ Object.keys(JURISDICTIONS).filter((code) => !JURISDICTIONS[code].optional);
|
|
|
155
155
|
Object.keys(JURISDICTIONS).filter((code) => JURISDICTIONS[code].optional);
|
|
156
156
|
new Set("AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "));
|
|
157
157
|
new Set("AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE".split(" "));
|
|
158
|
-
// src/contract/TestRegionalActions-
|
|
158
|
+
// src/contract/TestRegionalActions-Ce8EVv4q.js
|
|
159
159
|
/**
|
|
160
160
|
* Marks English text in shared, backend and data modules that the portal shows, so the app's
|
|
161
161
|
* message catalog (packages/app/vite/messageCatalog.ts) extracts it and the portal can translate it
|
|
@@ -1186,7 +1186,7 @@ const TEST_REGIONAL_ACTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => zod.array(
|
|
|
1186
1186
|
"block"
|
|
1187
1187
|
])
|
|
1188
1188
|
}).strict()).max(7).refine((entries) => new Set(entries.map((entry) => entry.region)).size === entries.length, "Choose each region once"));
|
|
1189
|
-
// src/contract/TestTriggers-
|
|
1189
|
+
// src/contract/TestTriggers-DP4m92jg.js
|
|
1190
1190
|
/**
|
|
1191
1191
|
* The visual encoding of test images (shared by images and video frames), independent of what the
|
|
1192
1192
|
* bytes mean. An odd N×N grid of square cells fills the image. Its outer ring alternates black and
|
|
@@ -1604,7 +1604,7 @@ const TEXT_CODE_SIGNALS = [
|
|
|
1604
1604
|
/** A 128-bit, domain-separated tag; published samples never contain the project key. */
|
|
1605
1605
|
const getTestInputTag = async (kind, signal, testInputKey) => {
|
|
1606
1606
|
if (!TEST_INPUT_KEY_PATTERN.test(testInputKey)) throw new TypeError("Invalid test input key");
|
|
1607
|
-
return (await
|
|
1607
|
+
return (await require_CryptoUtils_BLCa_oZe.hmacSha256Hex(testInputKey, `calmlens-test:${kind}:${signal}`)).slice(0, 32);
|
|
1608
1608
|
};
|
|
1609
1609
|
/** Category shortcuts are presets in the same instance-based format. */
|
|
1610
1610
|
function testInputForSignal(signal, kind = "text") {
|
|
@@ -1646,19 +1646,19 @@ const TEST_FACE_AGE_PRESETS = {
|
|
|
1646
1646
|
}
|
|
1647
1647
|
};
|
|
1648
1648
|
const TEST_FACE_AGE_MAX = 120;
|
|
1649
|
-
const basisPoints = zod.number().int().min(0).max(TEST_DETECTION_BOX_MAX);
|
|
1649
|
+
const basisPoints = /* @__PURE__ */ lazySchema(() => zod.number().int().min(0).max(TEST_DETECTION_BOX_MAX));
|
|
1650
1650
|
const detectionShape = {
|
|
1651
|
-
box: zod.tuple([
|
|
1651
|
+
box: /* @__PURE__ */ lazySchema(() => zod.tuple([
|
|
1652
1652
|
basisPoints,
|
|
1653
1653
|
basisPoints,
|
|
1654
1654
|
basisPoints,
|
|
1655
1655
|
basisPoints
|
|
1656
|
-
]),
|
|
1657
|
-
confidence: zod.number().int().min(0).max(100).optional()
|
|
1656
|
+
])),
|
|
1657
|
+
confidence: /* @__PURE__ */ lazySchema(() => zod.number().int().min(0).max(100).optional())
|
|
1658
1658
|
};
|
|
1659
1659
|
const fitsImage = ({ box: [left, top, width, height] }) => left + width <= 1e4 && top + height <= 1e4;
|
|
1660
1660
|
const BOX_MESSAGE = msg("A box must lie inside the image: left + width and top + height are at most 10000.");
|
|
1661
|
-
const ageYears = zod.number().int().min(0).max(120);
|
|
1661
|
+
const ageYears = /* @__PURE__ */ lazySchema(() => zod.number().int().min(0).max(120));
|
|
1662
1662
|
const TEST_DETECTED_PERSON_SCHEMA = /* @__PURE__ */ lazySchema(() => zod.object(detectionShape).strict().refine(fitsImage, BOX_MESSAGE));
|
|
1663
1663
|
const TEST_DETECTED_FACE_SCHEMA = /* @__PURE__ */ lazySchema(() => zod.object({
|
|
1664
1664
|
...detectionShape,
|
|
@@ -1866,7 +1866,7 @@ const TEST_INPUT_PRESETS = {
|
|
|
1866
1866
|
* removed before the signature is checked.
|
|
1867
1867
|
*/
|
|
1868
1868
|
const WHOLE_CODE = /^<!calmlens-\s*test\s+([A-Za-z0-9_\s-]{33,16384})>$/;
|
|
1869
|
-
const tag = async (payload, key) => (await
|
|
1869
|
+
const tag = async (payload, key) => (await require_CryptoUtils_BLCa_oZe.hmacSha256Hex(key, `calmlens-test:v2:${payload}`)).slice(0, 32);
|
|
1870
1870
|
const toBase64Url = (bytes) => btoa(String.fromCharCode(...bytes)).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
|
|
1871
1871
|
const fromBase64Url = (text) => Uint8Array.from(atob(text.replaceAll("-", "+").replaceAll("_", "/")), (char) => char.charCodeAt(0));
|
|
1872
1872
|
/** The signed bytes: the scenario's canonical JSON (ASCII). */
|
|
@@ -1889,7 +1889,7 @@ async function detectTestTrigger(text, key) {
|
|
|
1889
1889
|
const code = match[1].replace(/\s+/g, "");
|
|
1890
1890
|
const signature = code.slice(0, 32);
|
|
1891
1891
|
const payload = code.slice(32);
|
|
1892
|
-
if (!/^[a-f0-9]{32}$/.test(signature) || !payload || payload.length > 8e3 || !
|
|
1892
|
+
if (!/^[a-f0-9]{32}$/.test(signature) || !payload || payload.length > 8e3 || !require_CryptoUtils_BLCa_oZe.timingSafeEqual(signature, await tag(payload, key))) return;
|
|
1893
1893
|
try {
|
|
1894
1894
|
const json = fromBase64Url(payload);
|
|
1895
1895
|
if (json.some((byte) => byte > 127)) return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
1
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
|
|
2
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-Bwt3gP0C.js");
|
|
3
3
|
// src/contract/PlaceholderHashDecode.js
|
|
4
4
|
/**
|
|
5
5
|
* Decodes a ThumbHash to an RGBA image. RGB is not be premultiplied by A.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn as EventAsset, ln as TypedEvent, sn as Actor } from "./CalmLensTypes-
|
|
1
|
+
import { cn as EventAsset, ln as TypedEvent, sn as Actor } from "./CalmLensTypes-DxxyZt2L.js";
|
|
2
2
|
import * as zod from "zod";
|
|
3
3
|
/** Error codes the CalmLens API documents, by name. */
|
|
4
4
|
declare const API_ERROR_CODES: {
|
|
@@ -41,6 +41,7 @@ declare const API_ERROR_CODES: {
|
|
|
41
41
|
readonly INVALID_IMAGE: "image/invalid";
|
|
42
42
|
readonly IMAGE_TOO_LARGE: "image/too-large";
|
|
43
43
|
readonly FREE_UPLOADS_EXHAUSTED: "usage/free-uploads-exhausted";
|
|
44
|
+
readonly WEBSITE_BILLING_REQUIRED: "payment/billing-required";
|
|
44
45
|
readonly UPLOADS_PAUSED: "usage/uploads-paused";
|
|
45
46
|
readonly UNSUPPORTED_UPLOAD_TYPE: "upload/unsupported-type";
|
|
46
47
|
readonly INVALID_UPLOAD_PAYLOAD: "upload-payload/invalid";
|
|
@@ -80,6 +81,7 @@ declare const API_ERROR_CODES: {
|
|
|
80
81
|
readonly HASH_LIST_ENTRY_NOT_FOUND: "hash-list-entry/not-found";
|
|
81
82
|
readonly HASH_LIST_LIMIT_REACHED: "hash-list/limit-reached";
|
|
82
83
|
readonly HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list-entry/limit-reached";
|
|
84
|
+
readonly HASH_LIST_ENTRY_QUALITY_TOO_LOW: "hash-list-entry/quality-too-low";
|
|
83
85
|
readonly HASH_LIST_ASSET_NOT_HASHED: "hash-list/asset-not-hashed";
|
|
84
86
|
readonly POLICY_NOT_FOUND: "policy/not-found";
|
|
85
87
|
readonly POLICY_REVISION_CONFLICT: "policy/revision-conflict";
|
|
@@ -189,6 +191,7 @@ declare const CALMLENS_ERROR_CODES: {
|
|
|
189
191
|
readonly INVALID_IMAGE: "image/invalid";
|
|
190
192
|
readonly IMAGE_TOO_LARGE: "image/too-large";
|
|
191
193
|
readonly FREE_UPLOADS_EXHAUSTED: "usage/free-uploads-exhausted";
|
|
194
|
+
readonly WEBSITE_BILLING_REQUIRED: "payment/billing-required";
|
|
192
195
|
readonly UPLOADS_PAUSED: "usage/uploads-paused";
|
|
193
196
|
readonly UNSUPPORTED_UPLOAD_TYPE: "upload/unsupported-type";
|
|
194
197
|
readonly INVALID_UPLOAD_PAYLOAD: "upload-payload/invalid";
|
|
@@ -228,6 +231,7 @@ declare const CALMLENS_ERROR_CODES: {
|
|
|
228
231
|
readonly HASH_LIST_ENTRY_NOT_FOUND: "hash-list-entry/not-found";
|
|
229
232
|
readonly HASH_LIST_LIMIT_REACHED: "hash-list/limit-reached";
|
|
230
233
|
readonly HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list-entry/limit-reached";
|
|
234
|
+
readonly HASH_LIST_ENTRY_QUALITY_TOO_LOW: "hash-list-entry/quality-too-low";
|
|
231
235
|
readonly HASH_LIST_ASSET_NOT_HASHED: "hash-list/asset-not-hashed";
|
|
232
236
|
readonly POLICY_NOT_FOUND: "policy/not-found";
|
|
233
237
|
readonly POLICY_REVISION_CONFLICT: "policy/revision-conflict";
|
package/cjs/app.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as ClassificationNotEvaluatedReason, c as ModerationQualifier, d as HashListEntry, f as ModerationContext, g as selectModerationContextItems, h as ModerationContextItem, i as ClassificationCategoryReport, l as PolicyAction, m as MODERATION_CONTEXT_USED_ITEMS, n as ClassificationCategories, o as ClassificationQualifierResults, p as MODERATION_CONTEXT_USED_CHARACTERS, r as ClassificationCategory, s as Likelihood, u as HashList } from "./Classification-CMM2tZpJ-IdIh63n0.js";
|
|
2
|
-
import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, A as CdnAssetLocation, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bn as AssetRendered, Bt as UpdateAssetOptions, C as AssetUploadStatus, Cn as BoundingBox, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureResults, Dt as RequestAttempt, E as BatchAssetsOptions, En as ProcessingFeatureId, Et as RemoveAssetContentOptions, F as CdnTransform, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gn as FileMetadata, Gt as UpdateProjectSettingsOptions, H as CreateMultipartUploadPartOptions, Hn as AssetSafetyHold, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, Jt as UploadPresetDefinition, K as DeleteMetadataFieldOptions, Kn as MetadataItem, Kt as UpgradePolicyOptions, L as ClientRequestDefaults, Ln as AssetHls, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Mn as LensType, Mt as SearchAssetsOptions, N as CdnResource, Nn as AssetSearchMatchField, Nt as SetPolicyAutomaticUpdatesOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureStage, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, Qt as UploadedAsset, R as ConnectionOptions, Rn as AssetHlsRendition, Rt as StreamingFeatureOptions, S as AssetUpload, Sn as AgeRange, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as DetectedPerson, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetSafetyHoldReason, Ut as UpdateLensOptions, V as CreateLensOptions, Vn as AssetRenderedKind, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wn as ExtractedText, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetSubmitAssetOptions, _ as AssetPage, _n as Folder, _t as ListLensesOptions, a as AssetChecksums, an as AssetTimelineSegment, at as IdempotencyOptions, b as AssetTimelinePage, bn as PublicProjectSettings, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as EventAsset, ct as LensIdOptions, d as AssetContentOptions, dn as EventFact, dt as ListAssetTimelineOptions, en as ViewerClaims, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as EventFactValues, ft as ListAssetsOptions, g as AssetModerationStatus, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventType, ht as ListHashListEntriesOptions, i as AssetAvailability, in as AssetBatchOperation, it as HashListPage, j as CdnAssetReference, jn as CursorPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatures, kt as ResetPolicyOptions, l as AssetClassificationStatus, ln as TypedEvent, lt as LensPage, m as AssetModeration, mn as EventSeverity, mt as ListFoldersOptions, n as AppInfo, nn as WebhookHeadersInput, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventFacts, pt as ListEventsOptions, q as EnsureLensOptions, qn as ProcessingOptions, qt as UploadAssetPartOptions, r as Asset, rn as WebhookPayloadInput, rt as HashListIdOptions, s as AssetClassification, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, u as AssetContent, un as EventCategory, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, w as AssetVisibility, wn as DetectedFace, wt as PolicyIdOptions, x as AssetType, xn as UploadPreset, xt as MoveFolderOptions, y as AssetSearchResult, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zn as AssetPreview, zt as SubmitAssetOptions } from "./CalmLensTypes-
|
|
3
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
4
|
-
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-
|
|
5
|
-
import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-
|
|
2
|
+
import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, A as CdnAssetLocation, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bn as AssetRendered, Bt as UpdateAssetOptions, C as AssetUploadStatus, Cn as BoundingBox, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureResults, Dt as RequestAttempt, E as BatchAssetsOptions, En as ProcessingFeatureId, Et as RemoveAssetContentOptions, F as CdnTransform, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gn as FileMetadata, Gt as UpdateProjectSettingsOptions, H as CreateMultipartUploadPartOptions, Hn as AssetSafetyHold, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, Jt as UploadPresetDefinition, K as DeleteMetadataFieldOptions, Kn as MetadataItem, Kt as UpgradePolicyOptions, L as ClientRequestDefaults, Ln as AssetHls, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Mn as LensType, Mt as SearchAssetsOptions, N as CdnResource, Nn as AssetSearchMatchField, Nt as SetPolicyAutomaticUpdatesOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureStage, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, Qt as UploadedAsset, R as ConnectionOptions, Rn as AssetHlsRendition, Rt as StreamingFeatureOptions, S as AssetUpload, Sn as AgeRange, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as DetectedPerson, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetSafetyHoldReason, Ut as UpdateLensOptions, V as CreateLensOptions, Vn as AssetRenderedKind, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wn as ExtractedText, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetSubmitAssetOptions, _ as AssetPage, _n as Folder, _t as ListLensesOptions, a as AssetChecksums, an as AssetTimelineSegment, at as IdempotencyOptions, b as AssetTimelinePage, bn as PublicProjectSettings, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as EventAsset, ct as LensIdOptions, d as AssetContentOptions, dn as EventFact, dt as ListAssetTimelineOptions, en as ViewerClaims, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as EventFactValues, ft as ListAssetsOptions, g as AssetModerationStatus, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventType, ht as ListHashListEntriesOptions, i as AssetAvailability, in as AssetBatchOperation, it as HashListPage, j as CdnAssetReference, jn as CursorPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatures, kt as ResetPolicyOptions, l as AssetClassificationStatus, ln as TypedEvent, lt as LensPage, m as AssetModeration, mn as EventSeverity, mt as ListFoldersOptions, n as AppInfo, nn as WebhookHeadersInput, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventFacts, pt as ListEventsOptions, q as EnsureLensOptions, qn as ProcessingOptions, qt as UploadAssetPartOptions, r as Asset, rn as WebhookPayloadInput, rt as HashListIdOptions, s as AssetClassification, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, u as AssetContent, un as EventCategory, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, w as AssetVisibility, wn as DetectedFace, wt as PolicyIdOptions, x as AssetType, xn as UploadPreset, xt as MoveFolderOptions, y as AssetSearchResult, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zn as AssetPreview, zt as SubmitAssetOptions } from "./CalmLensTypes-DxxyZt2L.js";
|
|
3
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-Btp8f-34.js";
|
|
4
|
+
import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-CUA-HDNu.js";
|
|
5
|
+
import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-D_yWJA9M.js";
|
|
6
6
|
export { AUTO_PAGING_TO_ARRAY_MAX, type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type AppInfo, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type AutoPaging, type AutoPagingToArrayOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAppClient, type CalmLensAppClientOptions, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorKind, type CalmLensErrorOptions, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, type CalmLensLastResponse, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, type CalmLensResponse, type CalmLensServerClientOptions, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnResponse, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ClientRequestDefaults, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DeleteMetadataFieldOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EnsureMetadataFieldsOptions, type EnsureUploadPresetsOptions, type EnsureUploadPresetsResponse, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type FolderPage, type GetAssetInfoOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type Lens, type LensIdOptions, type LensPage, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetTimelineOptions, type ListAssetsOptions, type ListEventsOptions, type ListFoldersOptions, type ListHashListEntriesOptions, type ListHashListsOptions, type ListLensesOptions, type ListPage, type ListPoliciesOptions, type ListPromise, type ListUploadPresetsOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataFieldsResource, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyPage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type ProjectSettingsResource, type PublicProjectSettings, type RemoveAssetContentOptions, type RequestAttempt, type RequestOptions, type ResetPolicyOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type ServedAssetInfo, type SetPolicyAutomaticUpdatesOptions, type SignAssetUrlOptions, type SignUploadTokenOptions, type SignedAssetUrl, type SignedUploadToken, type StreamingFeatureOptions, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdateLensOptions, type UpdatePolicyOptions, type UpdateProjectSettingsOptions, type UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPreset, type UploadPresetDefinition, type UploadPresetIdOptions, type UploadPresetPage, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo, selectModerationContextItems };
|
package/cjs/app.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_ModerationContextLimits = require("./ModerationContextLimits-
|
|
2
|
+
const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
|
|
3
3
|
require("./index.js");
|
|
4
|
-
const require_CalmLensAppClient = require("./CalmLensAppClient-
|
|
4
|
+
const require_CalmLensAppClient = require("./CalmLensAppClient-Bwt3gP0C.js");
|
|
5
5
|
exports.AUTO_PAGING_TO_ARRAY_MAX = require_ModerationContextLimits.AUTO_PAGING_TO_ARRAY_MAX;
|
|
6
6
|
exports.CALMLENS_ERROR_CODES = require_ModerationContextLimits.CALMLENS_ERROR_CODES;
|
|
7
7
|
exports.CDN_RESOURCES = require_ModerationContextLimits.CDN_RESOURCES;
|
package/cjs/elements.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { i as AssetAvailability } from "./CalmLensTypes-
|
|
2
|
-
import { $ as
|
|
3
|
-
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-
|
|
4
|
-
import {
|
|
1
|
+
import { i as AssetAvailability } from "./CalmLensTypes-DxxyZt2L.js";
|
|
2
|
+
import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-Dhijt6JU.js";
|
|
3
|
+
import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-CdOfuIcV.js";
|
|
4
|
+
import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-BSm_qphN.js";
|
|
5
5
|
declare const BaseElement$1: typeof HTMLElement;
|
|
6
6
|
/**
|
|
7
7
|
* An asset viewer element. Set the `src` attribute to the asset URL (public or signed) and the
|
|
8
8
|
* `asset` property to its display info or the asset from the API, and `onExpired` to refresh a
|
|
9
|
-
* signed URL; other attributes: `label`, `viewer-claims` (JSON), `
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* its files from.
|
|
9
|
+
* signed URL; other attributes: `label`, `viewer-claims` (JSON), `page-size` (spreadsheets) and
|
|
10
|
+
* `initial-page` (documents). The `text` and `getText` properties supply text and spreadsheet
|
|
11
|
+
* viewers' text, `messages` replaces their text and `pdf` sets where pdf.js loads its files from.
|
|
13
12
|
*/
|
|
14
13
|
declare abstract class ViewerElement<K extends AssetViewerName> extends BaseElement$1 {
|
|
15
14
|
#private;
|
|
@@ -36,14 +35,6 @@ declare abstract class ViewerElement<K extends AssetViewerName> extends BaseElem
|
|
|
36
35
|
attributeChangedCallback(): void;
|
|
37
36
|
disconnectedCallback(): void;
|
|
38
37
|
}
|
|
39
|
-
/** `<calmlens-image-viewer>`: an image asset's rendered file, fitted to the element. */
|
|
40
|
-
export declare class CalmLensImageViewerElement extends ViewerElement<"image"> {
|
|
41
|
-
protected readonly kind = "image";
|
|
42
|
-
}
|
|
43
|
-
/** `<calmlens-website-viewer>`: a website's screenshot and a link to the page. */
|
|
44
|
-
export declare class CalmLensWebsiteViewerElement extends ViewerElement<"website"> {
|
|
45
|
-
protected readonly kind = "website";
|
|
46
|
-
}
|
|
47
38
|
/** `<calmlens-text-viewer>`: text, escaped, in a scrolling region. */
|
|
48
39
|
export declare class CalmLensTextViewerElement extends ViewerElement<"text"> {
|
|
49
40
|
protected readonly kind = "text";
|
|
@@ -60,8 +51,6 @@ export declare class CalmLensSpreadsheetViewerElement extends ViewerElement<"spr
|
|
|
60
51
|
export declare const defineCalmLensViewerElements: () => void;
|
|
61
52
|
declare global {
|
|
62
53
|
interface HTMLElementTagNameMap {
|
|
63
|
-
"calmlens-image-viewer": CalmLensImageViewerElement;
|
|
64
|
-
"calmlens-website-viewer": CalmLensWebsiteViewerElement;
|
|
65
54
|
"calmlens-text-viewer": CalmLensTextViewerElement;
|
|
66
55
|
"calmlens-document-viewer": CalmLensDocumentViewerElement;
|
|
67
56
|
"calmlens-spreadsheet-viewer": CalmLensSpreadsheetViewerElement;
|
|
@@ -186,4 +175,4 @@ declare global {
|
|
|
186
175
|
"calmlens-timeupdate": CustomEvent<number>;
|
|
187
176
|
}
|
|
188
177
|
}
|
|
189
|
-
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES,
|
|
178
|
+
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, type IconName, type MediaPlayback, MediaStreamPlayer, type MountedViewerKind, type PdfAssetOptions, type ProgressFetchOptions, type SpreadsheetCell, type SpreadsheetRow, type SpreadsheetSheet, type SpreadsheetViewerOptions, type TextViewerOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, VIEWER_STYLES, type ViewerAsset, type ViewerMessages, type ViewerOptions, type ViewerState, type ViewerTextOptions, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
|