calmlens 0.29.0 → 0.29.2
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/bin/calmlens.js +24 -2
- package/cjs/{BrowserUpload-CcSQI7Kf.js → BrowserUpload-CCXt4DAY.js} +1 -1
- package/cjs/{CalmLensAppClient-BPILD5mg.js → CalmLensAppClient-ea-qXkmD.js} +7 -6
- package/cjs/{CalmLensConnection-Wfxn25LT.js → CalmLensConnection-BrySN2M3.js} +29 -28
- package/cjs/CalmLensError-DPHJaVjX.js +1066 -0
- package/cjs/{CalmLensServerClient-C_42j_i4.js → CalmLensServerClient-FD7H7KvL.js} +21 -20
- package/cjs/{TestTriggers-uL2Ec8Vt-cPmmKvYd.js → CalmLensTestInputArguments-BXDBAOg_.js} +50 -22
- package/cjs/{Core-CfdovxKJ.js → Core-DMFa3EUp.js} +4 -3
- package/cjs/{ModerationContextLimits-DXlPrt4K.js → ModerationContextLimits-1XP4ZTQk.js} +67 -1126
- package/cjs/{ReactUpload-CzsQwVKM.js → ReactUpload-gaeiPSeH.js} +1 -1
- package/cjs/{TestTriggers-dognME9k-PWyIfHMI.d.ts → TestTriggers-CFnel6a9.d.ts} +1 -2
- package/cjs/{UploadController-D_Y5wktq.js → UploadController-CyPTBuZg.js} +6 -6
- package/cjs/app.js +22 -21
- package/cjs/elements.js +4 -4
- package/cjs/index.js +21 -20
- package/cjs/react-native.js +4 -4
- package/cjs/react.js +5 -5
- package/cjs/server.js +22 -21
- package/cjs/test-inputs.d.ts +6 -2
- package/cjs/test-inputs.js +23 -13
- package/cjs/testing.d.ts +3 -3
- package/cjs/testing.js +138 -133
- package/cjs/{ui-CkOexkAO.js → ui-DNP1uWQy.js} +2 -2
- package/cjs/ui.js +3 -3
- package/cjs/vue.js +4 -4
- package/esm/{BrowserUpload-DJ2euKyv.js → BrowserUpload-Bu6eWqQS.js} +1 -1
- package/esm/{CalmLensAppClient-CCT5Em2S.js → CalmLensAppClient-xp-fH6Lz.js} +3 -2
- package/esm/{CalmLensConnection-CfBXkam-.js → CalmLensConnection-DwG5yBk2.js} +2 -1
- package/esm/CalmLensError-BDWThPCr.js +917 -0
- package/esm/{CalmLensServerClient-e6gVcMxy.js → CalmLensServerClient-CKlNBBo3.js} +3 -2
- package/esm/{TestTriggers-uL2Ec8Vt-DYbTEJWm.js → CalmLensTestInputArguments-Xh4GIadS.js} +22 -1
- package/esm/{Core-CojlqrKH.js → Core-DnCeTmvS.js} +3 -2
- package/esm/{ModerationContextLimits-Abu_L1Df.js → ModerationContextLimits-CtAyz60h.js} +3 -918
- package/esm/{ReactUpload-CDrA7hRn.js → ReactUpload-D30YlRui.js} +1 -1
- package/esm/{TestTriggers-dognME9k-PWyIfHMI.d.ts → TestTriggers-CFnel6a9.d.ts} +1 -2
- package/esm/{UploadController-BubUXclM.js → UploadController-DENryQ8H.js} +2 -2
- package/esm/app.js +3 -2
- package/esm/elements.js +4 -4
- package/esm/index.js +3 -1
- package/esm/react-native.js +4 -4
- package/esm/react.js +5 -5
- package/esm/server.js +3 -2
- package/esm/test-inputs.d.ts +6 -2
- package/esm/test-inputs.js +12 -1
- package/esm/testing.d.ts +3 -3
- package/esm/testing.js +11 -7
- package/esm/{ui--AzgLLVf.js → ui-DUEBbRJ0.js} +2 -2
- package/esm/ui.js +3 -3
- package/esm/vue.js +4 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as withProvidedOptions, n as createUploadController } from "./UploadController-
|
|
1
|
+
import { i as withProvidedOptions, n as createUploadController } from "./UploadController-DENryQ8H.js";
|
|
2
2
|
import { createContext, createElement, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
3
3
|
// src/ui/ReactUpload.ts
|
|
4
4
|
const CalmLensContext = createContext(void 0);
|
|
@@ -356,7 +356,6 @@ declare const TEST_INPUT_PRESETS: {
|
|
|
356
356
|
};
|
|
357
357
|
};
|
|
358
358
|
};
|
|
359
|
-
declare function generateTestTextCode(scenario: TestInput | ClassificationTestSignal, key: string): Promise<string>;
|
|
360
359
|
/**
|
|
361
360
|
* The scenario a text declares when the whole text is one code signed with `key`; surrounding
|
|
362
361
|
* text, a second code or an altered code all return undefined, so the text is moderated as
|
|
@@ -413,4 +412,4 @@ declare function detectTestImage(image: RgbaImage, key: string,
|
|
|
413
412
|
}[] | undefined;
|
|
414
413
|
} | undefined;
|
|
415
414
|
} | undefined>;
|
|
416
|
-
export { TEST_FACE_AGE_PRESETS as a, TestDetections as c, detectTestTrigger as d,
|
|
415
|
+
export { TEST_FACE_AGE_PRESETS as a, TestDetections as c, detectTestTrigger as d, getImageTestCategories as f, TEST_FACE_AGE_MAX as i, TestInput as l, testInputForSignal as m, TEST_DETECTIONS_MAX as n, TEST_INPUT_KEY_PATTERN as o, paintTestImage as p, TEST_DETECTION_BOX_MAX as r, TEST_INPUT_PRESETS as s, ClassificationTestSignal as t, detectTestImage as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
1
|
+
import { l as CalmLensError, x as SDK_ERROR_CODES } from "./CalmLensError-BDWThPCr.js";
|
|
2
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-xp-fH6Lz.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.
|
package/esm/app.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as CalmLensTimeoutError, a as CalmLensCancelledError, c as CalmLensConnectionError, d as CalmLensInvalidResponseError, f as CalmLensNotFoundError, g as CalmLensServerError, h as CalmLensRateLimitError, i as CalmLensBadRequestError, l as CalmLensError, m as CalmLensPermissionDeniedError, n as CalmLensApiError, o as CalmLensConfigurationError, p as CalmLensPayloadTooLargeError, r as CalmLensAuthenticationError, s as CalmLensConflictError, t as CALMLENS_ERROR_CODES, u as CalmLensInvalidArgumentError, v as CalmLensUnprocessableEntityError, y as CalmLensWebhookVerificationError } from "./CalmLensError-BDWThPCr.js";
|
|
2
|
+
import { I as SDK_VERSION, a as CDN_RESOURCES, n as MODERATION_CONTEXT_USED_ITEMS, p as DEFAULT_CDN_BASE_URL, r as selectModerationContextItems, t as MODERATION_CONTEXT_USED_CHARACTERS, u as getAssetInfo, z as AUTO_PAGING_TO_ARRAY_MAX } from "./ModerationContextLimits-CtAyz60h.js";
|
|
2
3
|
import "./index.js";
|
|
3
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
4
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-xp-fH6Lz.js";
|
|
4
5
|
export { AUTO_PAGING_TO_ARRAY_MAX, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAppClient, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, DEFAULT_CDN_BASE_URL, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, SDK_VERSION, getAssetInfo, selectModerationContextItems };
|
package/esm/elements.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui
|
|
2
|
-
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-
|
|
3
|
-
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-
|
|
1
|
+
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-DUEBbRJ0.js";
|
|
2
|
+
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-DnCeTmvS.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-DENryQ8H.js";
|
|
4
4
|
import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
|
|
5
|
-
import { t as createUploadController } from "./BrowserUpload-
|
|
5
|
+
import { t as createUploadController } from "./BrowserUpload-Bu6eWqQS.js";
|
|
6
6
|
// src/viewers/Elements.ts
|
|
7
7
|
const BaseElement$1 = typeof HTMLElement === "undefined" ? class {} : HTMLElement;
|
|
8
8
|
const PROPERTIES = [
|
package/esm/index.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { _ as CalmLensTimeoutError, a as CalmLensCancelledError, c as CalmLensConnectionError, d as CalmLensInvalidResponseError, f as CalmLensNotFoundError, g as CalmLensServerError, h as CalmLensRateLimitError, i as CalmLensBadRequestError, l as CalmLensError, m as CalmLensPermissionDeniedError, n as CalmLensApiError, o as CalmLensConfigurationError, p as CalmLensPayloadTooLargeError, r as CalmLensAuthenticationError, s as CalmLensConflictError, t as CALMLENS_ERROR_CODES, u as CalmLensInvalidArgumentError, v as CalmLensUnprocessableEntityError, y as CalmLensWebhookVerificationError } from "./CalmLensError-BDWThPCr.js";
|
|
2
|
+
import { I as SDK_VERSION, a as CDN_RESOURCES, n as MODERATION_CONTEXT_USED_ITEMS, p as DEFAULT_CDN_BASE_URL, r as selectModerationContextItems, t as MODERATION_CONTEXT_USED_CHARACTERS, u as getAssetInfo, z as AUTO_PAGING_TO_ARRAY_MAX } from "./ModerationContextLimits-CtAyz60h.js";
|
|
3
|
+
export { AUTO_PAGING_TO_ARRAY_MAX, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, DEFAULT_CDN_BASE_URL, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, SDK_VERSION, getAssetInfo, selectModerationContextItems };
|
package/esm/react-native.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as assetUrlOf, o as appendAssetLocation } from "./ModerationContextLimits-
|
|
2
|
-
import { C as pickAssetSource, E as resolveTheme, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, x as getPlayedPercent, y as getAssetViewKey } from "./Core-
|
|
3
|
-
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-
|
|
1
|
+
import { c as assetUrlOf, o as appendAssetLocation } from "./ModerationContextLimits-CtAyz60h.js";
|
|
2
|
+
import { C as pickAssetSource, E as resolveTheme, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, x as getPlayedPercent, y as getAssetViewKey } from "./Core-DnCeTmvS.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-DENryQ8H.js";
|
|
4
4
|
import { a as getFileIcon, o as getFileIconLabel, t as FILE_ICON_COLORS } from "./FileIcons-M6dzjFxd.js";
|
|
5
|
-
import { i as useUploadSnapshot, n as useCalmLensUpload, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-
|
|
5
|
+
import { i as useUploadSnapshot, n as useCalmLensUpload, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-D30YlRui.js";
|
|
6
6
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Image, Linking, PixelRatio, Pressable, StyleSheet, Text, View } from "react-native";
|
package/esm/react.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui
|
|
3
|
-
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, n as CALMLENS_STYLES_ID, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-
|
|
4
|
-
import { a as createProgressFetch, i as withProvidedOptions, r as isFileAccepted, t as UploadController } from "./UploadController-
|
|
2
|
+
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-DUEBbRJ0.js";
|
|
3
|
+
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, n as CALMLENS_STYLES_ID, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-DnCeTmvS.js";
|
|
4
|
+
import { a as createProgressFetch, i as withProvidedOptions, r as isFileAccepted, t as UploadController } from "./UploadController-DENryQ8H.js";
|
|
5
5
|
import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
|
|
6
|
-
import { i as useUploadSnapshot, n as useCalmLensUpload$1, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-
|
|
7
|
-
import { t as createUploadController } from "./BrowserUpload-
|
|
6
|
+
import { i as useUploadSnapshot, n as useCalmLensUpload$1, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-D30YlRui.js";
|
|
7
|
+
import { t as createUploadController } from "./BrowserUpload-Bu6eWqQS.js";
|
|
8
8
|
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
const OPTION_NAMES = /* @__PURE__ */ new Set([
|
package/esm/server.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as CalmLensTimeoutError, a as CalmLensCancelledError, c as CalmLensConnectionError, d as CalmLensInvalidResponseError, f as CalmLensNotFoundError, g as CalmLensServerError, h as CalmLensRateLimitError, i as CalmLensBadRequestError, l as CalmLensError, m as CalmLensPermissionDeniedError, n as CalmLensApiError, o as CalmLensConfigurationError, p as CalmLensPayloadTooLargeError, r as CalmLensAuthenticationError, s as CalmLensConflictError, t as CALMLENS_ERROR_CODES, u as CalmLensInvalidArgumentError, v as CalmLensUnprocessableEntityError, y as CalmLensWebhookVerificationError } from "./CalmLensError-BDWThPCr.js";
|
|
2
|
+
import { I as SDK_VERSION, a as CDN_RESOURCES, n as MODERATION_CONTEXT_USED_ITEMS, p as DEFAULT_CDN_BASE_URL, r as selectModerationContextItems, t as MODERATION_CONTEXT_USED_CHARACTERS, u as getAssetInfo, z as AUTO_PAGING_TO_ARRAY_MAX } from "./ModerationContextLimits-CtAyz60h.js";
|
|
2
3
|
import "./index.js";
|
|
3
|
-
import { a as WEBHOOK_TIMESTAMP_HEADER, c as isNewerAssetEvent, d as verifyWebhookSignature, i as WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, l as isTestWebhookEvent, n as WEBHOOK_DELIVERY_HEADER, o as getEventFact, r as WEBHOOK_SIGNATURE_HEADER, s as getEventFacts, t as CalmLensServerClient, u as parseWebhookEvent } from "./CalmLensServerClient-
|
|
4
|
+
import { a as WEBHOOK_TIMESTAMP_HEADER, c as isNewerAssetEvent, d as verifyWebhookSignature, i as WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, l as isTestWebhookEvent, n as WEBHOOK_DELIVERY_HEADER, o as getEventFact, r as WEBHOOK_SIGNATURE_HEADER, s as getEventFacts, t as CalmLensServerClient, u as parseWebhookEvent } from "./CalmLensServerClient-CKlNBBo3.js";
|
|
4
5
|
export { AUTO_PAGING_TO_ARRAY_MAX, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, CalmLensServerClient, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, DEFAULT_CDN_BASE_URL, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, SDK_VERSION, WEBHOOK_DELIVERY_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, WEBHOOK_TIMESTAMP_HEADER, getAssetInfo, getEventFact, getEventFacts, isNewerAssetEvent, isTestWebhookEvent, parseWebhookEvent, selectModerationContextItems, verifyWebhookSignature };
|
package/esm/test-inputs.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import { a as TEST_FACE_AGE_PRESETS, c as TestDetections, d as detectTestTrigger, f as
|
|
2
|
-
|
|
1
|
+
import { a as TEST_FACE_AGE_PRESETS, c as TestDetections, d as detectTestTrigger, f as getImageTestCategories, i as TEST_FACE_AGE_MAX, l as TestInput, m as testInputForSignal, n as TEST_DETECTIONS_MAX, o as TEST_INPUT_KEY_PATTERN, p as paintTestImage$1, r as TEST_DETECTION_BOX_MAX, s as TEST_INPUT_PRESETS, t as ClassificationTestSignal, u as detectTestImage } from "./TestTriggers-CFnel6a9.js";
|
|
2
|
+
/** A text code for `scenario`, signed with the project's test input key. */
|
|
3
|
+
export declare const generateTestTextCode: (scenario: TestInput | ClassificationTestSignal, key: string) => Promise<string>;
|
|
4
|
+
/** An RGBA test image for `scenario`, signed with the project's test input key. */
|
|
5
|
+
export declare const paintTestImage: (scenario: TestInput | ClassificationTestSignal, key: string) => ReturnType<typeof paintTestImage$1>;
|
|
6
|
+
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, getImageTestCategories, testInputForSignal };
|
package/esm/test-inputs.js
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { a as TEST_FACE_AGE_PRESETS, c as detectTestImage, d as getImageTestCategories, i as TEST_FACE_AGE_MAX, l as detectTestTrigger, m as testInputForSignal, n as TEST_DETECTIONS_MAX, o as TEST_INPUT_KEY_PATTERN, p as paintTestImage$1, r as TEST_DETECTION_BOX_MAX, s as TEST_INPUT_PRESETS, t as withValidTestInputArguments, u as generateTestTextCode$1 } from "./CalmLensTestInputArguments-Xh4GIadS.js";
|
|
2
|
+
// src/test-inputs.ts
|
|
3
|
+
/**
|
|
4
|
+
* Portable test inputs: presets and custom instances share one authenticated format. CalmLens
|
|
5
|
+
* recognises a code only as the whole text and a test image only as the whole
|
|
6
|
+
* upload, signed with the project's own key.
|
|
7
|
+
*/
|
|
8
|
+
/** A text code for `scenario`, signed with the project's test input key. */
|
|
9
|
+
const generateTestTextCode = (scenario, key) => withValidTestInputArguments(key, () => generateTestTextCode$1(scenario, key));
|
|
10
|
+
/** An RGBA test image for `scenario`, signed with the project's test input key. */
|
|
11
|
+
const paintTestImage = (scenario, key) => withValidTestInputArguments(key, () => paintTestImage$1(scenario, key));
|
|
12
|
+
export { TEST_DETECTIONS_MAX, TEST_DETECTION_BOX_MAX, TEST_FACE_AGE_MAX, TEST_FACE_AGE_PRESETS, TEST_INPUT_KEY_PATTERN, TEST_INPUT_PRESETS, detectTestImage, detectTestTrigger, generateTestTextCode, getImageTestCategories, paintTestImage, testInputForSignal };
|
package/esm/testing.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Ln as AssetBinaryPayloadInput, Lt as SignUploadTokenOptions, O as CalmL
|
|
|
2
2
|
import { t as CalmLensAppClient } from "./CalmLensAppClient-D-BD_Ny1.js";
|
|
3
3
|
import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-DZWlnvcY.js";
|
|
4
4
|
import { t as CalmLensServerClient } from "./CalmLensServerClient-BYN_N0lt.js";
|
|
5
|
-
import { t as ClassificationTestSignal } from "./TestTriggers-
|
|
5
|
+
import { t as ClassificationTestSignal } from "./TestTriggers-CFnel6a9.js";
|
|
6
6
|
import "zod";
|
|
7
7
|
/**
|
|
8
8
|
* Signs a single-use upload token with `apiKey`, locally. `CalmLensServerClient` and
|
|
@@ -15,8 +15,6 @@ declare const signUploadTokenWithApiKey: (apiKey: string, options: SignUploadTok
|
|
|
15
15
|
nonce?: string;
|
|
16
16
|
}) => Promise<SignedUploadToken>;
|
|
17
17
|
export declare const MEDIA_TEST_SIGNALS: readonly ["sexual", "violence", "self-harm", "harassment", "hate", "criminal-activity", "personal-information", "profanity", "violence.graphic"];
|
|
18
|
-
/** Read this aloud, or render it as large, high-contrast text in a video frame. */
|
|
19
|
-
export declare function generateMediaTestCode(signal: ClassificationTestSignal, testInputKey: string): Promise<string>;
|
|
20
18
|
export declare const MOCK_API_KEY_PREFIX = "sk_test_";
|
|
21
19
|
export declare const createMockApiKey: (grants?: PermissionGrant[]) => string;
|
|
22
20
|
/**
|
|
@@ -477,4 +475,6 @@ export declare const createWebhookHeaders: (options: {
|
|
|
477
475
|
deliveryId: string;
|
|
478
476
|
timestampSeconds?: number;
|
|
479
477
|
}) => Promise<Record<string, string>>;
|
|
478
|
+
/** A spoken media test phrase for `signal`, signed with the project's test input key. */
|
|
479
|
+
export declare const generateMediaTestCode: (signal: ClassificationTestSignal, key: string) => Promise<string>;
|
|
480
480
|
export { type MockAssetOutcome, type MockCalmLensAppClientOptions, type MockCalmLensCall, type MockCalmLensOperation, type MockCalmLensServerClientOptions, type MockDatabaseStorage, type MockDetectedFace, type MockDetectedLink, type MockDetectedPerson, type MockEventInput, type MockFailureOptions, type MockImageStorage, type MockModerate, type MockModerationInput, type MockModerationTrigger, type MockQrCode, type MockRequestFailure, type MockReviewDecision, type MockServedUrl, type MockStoredContent, type MockTextRegion, type MockUploadPreset, signUploadTokenWithApiKey as signUploadToken };
|
package/esm/testing.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { C as invalidConfig, S as invalidArgument, T as API_ERROR_DEFINITIONS, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-BDWThPCr.js";
|
|
2
|
+
import { A as MAX_IMAGE_UPLOAD_BYTES, D as validateServerClientOptions, F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, T as validateAppClientOptions, _ as isAcceptedUploadMimeType, b as randomUuid, h as checkTransformOptions, i as ASSET_RESOURCE_PATHS, r as selectModerationContextItems, v as parseTransformSelector } from "./ModerationContextLimits-CtAyz60h.js";
|
|
3
|
+
import { a as WEBHOOK_TIMESTAMP_HEADER, f as signUploadTokenWithApiKey, m as stringifyJsonCanonical, n as WEBHOOK_DELIVERY_HEADER, p as decodeUploadToken, r as WEBHOOK_SIGNATURE_HEADER, t as CalmLensServerClient } from "./CalmLensServerClient-CKlNBBo3.js";
|
|
4
|
+
import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-DwG5yBk2.js";
|
|
4
5
|
import { t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
|
|
5
|
-
import { t as CalmLensAppClient } from "./CalmLensAppClient-
|
|
6
|
-
import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-
|
|
7
|
-
import {
|
|
6
|
+
import { t as CalmLensAppClient } from "./CalmLensAppClient-xp-fH6Lz.js";
|
|
7
|
+
import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-DENryQ8H.js";
|
|
8
|
+
import { f as getTestInputTag, g as CLASSIFICATION_CATEGORIES, h as lazySchema, t as withValidTestInputArguments } from "./CalmLensTestInputArguments-Xh4GIadS.js";
|
|
8
9
|
import * as zod from "zod";
|
|
9
10
|
// src/contract/MediaTestTriggers.js
|
|
10
11
|
const MEDIA_TEST_SIGNALS = [...CLASSIFICATION_CATEGORIES, "violence.graphic"];
|
|
@@ -27,7 +28,7 @@ const HEX_WORDS = [
|
|
|
27
28
|
"foxtrot"
|
|
28
29
|
];
|
|
29
30
|
/** Read this aloud, or render it as large, high-contrast text in a video frame. */
|
|
30
|
-
async function generateMediaTestCode(signal, testInputKey) {
|
|
31
|
+
async function generateMediaTestCode$1(signal, testInputKey) {
|
|
31
32
|
if (!MEDIA_TEST_SIGNALS.includes(signal)) throw new RangeError("Unsupported media test signal");
|
|
32
33
|
return `Calm Lens test ${[...await getTestInputTag("media", signal, testInputKey)].map((character) => HEX_WORDS[Number.parseInt(character, 16)]).join(" ")} ${signal.replace(/[.-]/g, " ")} end test`;
|
|
33
34
|
}
|
|
@@ -12527,4 +12528,7 @@ const createWebhookHeaders = async (options) => {
|
|
|
12527
12528
|
[WEBHOOK_SIGNATURE_HEADER]: await createWebhookSignatureHeader(options.secret, timestamp, options.body)
|
|
12528
12529
|
};
|
|
12529
12530
|
};
|
|
12531
|
+
// src/testing.ts
|
|
12532
|
+
/** A spoken media test phrase for `signal`, signed with the project's test input key. */
|
|
12533
|
+
const generateMediaTestCode = (signal, key) => withValidTestInputArguments(key, () => generateMediaTestCode$1(signal, key));
|
|
12530
12534
|
export { InMemoryMockDatabaseStorage, InMemoryMockImageStorage, MEDIA_TEST_SIGNALS, MOCK_API_KEY_ID, MOCK_API_KEY_PREFIX, MockCalmLensAppClient, MockCalmLensServerClient, MockDecision, createMockApiKey, createWebhookHeaders, createWebhookSignatureHeader, generateMediaTestCode, mockDecision, signUploadTokenWithApiKey as signUploadToken, toWebhookEventPayload };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as appendAssetLocation } from "./ModerationContextLimits-
|
|
2
|
-
import "./Core-
|
|
1
|
+
import { o as appendAssetLocation } from "./ModerationContextLimits-CtAyz60h.js";
|
|
2
|
+
import "./Core-DnCeTmvS.js";
|
|
3
3
|
// src/ui/viewers/PdfLoader.ts
|
|
4
4
|
let loading;
|
|
5
5
|
/**
|
package/esm/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui
|
|
2
|
-
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-
|
|
3
|
-
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-
|
|
1
|
+
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-DUEBbRJ0.js";
|
|
2
|
+
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-DnCeTmvS.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-DENryQ8H.js";
|
|
4
4
|
export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, AssetSession, AssetViewerMount, CALMLENS_STYLES, CALMLENS_THEME, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, MediaStreamPlayer, UploadController, VIEWER_STYLES, 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 };
|
package/esm/vue.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui
|
|
2
|
-
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-
|
|
3
|
-
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-
|
|
1
|
+
import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-DUEBbRJ0.js";
|
|
2
|
+
import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-DnCeTmvS.js";
|
|
3
|
+
import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-DENryQ8H.js";
|
|
4
4
|
import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
|
|
5
|
-
import { t as createUploadController } from "./BrowserUpload-
|
|
5
|
+
import { t as createUploadController } from "./BrowserUpload-Bu6eWqQS.js";
|
|
6
6
|
import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, onScopeDispose, provide, ref, shallowRef, toValue, watch, watchEffect } from "vue";
|
|
7
7
|
// src/viewers/Vue.ts
|
|
8
8
|
const optional$1 = (type) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "calmlens",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.2",
|
|
4
4
|
"description": "Official CalmLens SDK for JavaScript and TypeScript: content moderation, asset storage and CDN delivery.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://calmlens.com/docs/sdk/javascript",
|