calmlens 0.27.6 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/bin/calmlens.js +24 -13
  2. package/cjs/{BrowserUpload-CdOfuIcV.d.ts → BrowserUpload-CRbCsX7a.d.ts} +2 -2
  3. package/cjs/{BrowserUpload-GQtZti-D.js → BrowserUpload-Dz4UwTTJ.js} +1 -1
  4. package/cjs/{CalmLensAppClient-Bwt3gP0C.js → CalmLensAppClient-B0QZ1oJV.js} +2 -2
  5. package/cjs/{CalmLensAppClient-Btp8f-34.d.ts → CalmLensAppClient-B3u6BlP5.d.ts} +1 -1
  6. package/cjs/{CalmLensOptionKeys--gTpTkwt.js → CalmLensOptionKeys-Cat8CgOn.js} +2 -2
  7. package/cjs/{CalmLensServerClient-C3kaPLUZ.d.ts → CalmLensServerClient-B8ntjNL3.d.ts} +6 -6
  8. package/cjs/{CalmLensServerClient-BYMzGkQK.js → CalmLensServerClient-CQdvhCGg.js} +9 -9
  9. package/cjs/{CalmLensTypes-DxxyZt2L.d.ts → CalmLensTypes-CtO4Dieu.d.ts} +6 -3
  10. package/cjs/{Core-Dhijt6JU.d.ts → Core-BJaLU71Q.d.ts} +2 -2
  11. package/cjs/{Core-52DVaX7d.js → Core-DCnnUsgF.js} +7 -4
  12. package/cjs/{ModerationContextLimits-DJyIjzIn.js → ModerationContextLimits-_knOVCH0.js} +43 -6
  13. package/cjs/{ReactUpload-BuqLPgNr.d.ts → ReactUpload-BGUkcMpg.d.ts} +1 -1
  14. package/cjs/{ReactUpload-DHuhGYsr.js → ReactUpload-BtmIrdky.js} +1 -1
  15. package/{esm/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts → cjs/TestTriggers-dognME9k-PWyIfHMI.d.ts} +1 -2
  16. package/cjs/{TestTriggers-DP4m92jg-C0HD-A4r.js → TestTriggers-uL2Ec8Vt-cPmmKvYd.js} +1 -2
  17. package/cjs/{UploadController-ChzDPMmm.js → UploadController-CEL3N4Ae.js} +2 -2
  18. package/{esm/WebhookPayload-D_yWJA9M.d.ts → cjs/WebhookPayload-DZadhbAJ.d.ts} +1 -1
  19. package/cjs/app.d.ts +4 -4
  20. package/cjs/app.js +2 -2
  21. package/cjs/elements.d.ts +4 -4
  22. package/cjs/elements.js +4 -4
  23. package/cjs/{index-CUA-HDNu.d.ts → index-DQUZYLVY.d.ts} +2 -2
  24. package/cjs/index.d.ts +3 -3
  25. package/cjs/index.js +1 -1
  26. package/cjs/react-native.d.ts +2 -2
  27. package/cjs/react-native.js +5 -5
  28. package/cjs/react.d.ts +4 -4
  29. package/cjs/react.js +5 -5
  30. package/cjs/server.d.ts +4 -4
  31. package/cjs/server.js +2 -2
  32. package/cjs/test-inputs.d.ts +1 -1
  33. package/cjs/test-inputs.js +13 -13
  34. package/cjs/testing.d.ts +36 -7
  35. package/cjs/testing.js +73 -26
  36. package/cjs/{ui-BSm_qphN.d.ts → ui-BGywTQ2M.d.ts} +2 -2
  37. package/cjs/{ui-C1_SDSiq.js → ui-DVQm0TFJ.js} +2 -2
  38. package/cjs/ui.d.ts +2 -2
  39. package/cjs/ui.js +3 -3
  40. package/cjs/vue.d.ts +5 -5
  41. package/cjs/vue.js +4 -4
  42. package/esm/{BrowserUpload-CdOfuIcV.d.ts → BrowserUpload-CRbCsX7a.d.ts} +2 -2
  43. package/esm/{BrowserUpload-BaKFKEBz.js → BrowserUpload-DSq5Ezo1.js} +1 -1
  44. package/esm/{CalmLensAppClient-DM6c3pGC.js → CalmLensAppClient-B1QpSXYm.js} +2 -2
  45. package/esm/{CalmLensAppClient-Btp8f-34.d.ts → CalmLensAppClient-B3u6BlP5.d.ts} +1 -1
  46. package/esm/{CalmLensOptionKeys-CKZs8i3_.js → CalmLensOptionKeys-BYqFZ0FP.js} +2 -2
  47. package/esm/{CalmLensServerClient-C3kaPLUZ.d.ts → CalmLensServerClient-B8ntjNL3.d.ts} +6 -6
  48. package/esm/{CalmLensServerClient-Da2UfUo4.js → CalmLensServerClient-D2Vr_jTR.js} +9 -9
  49. package/esm/{CalmLensTypes-DxxyZt2L.d.ts → CalmLensTypes-CtO4Dieu.d.ts} +6 -3
  50. package/esm/{Core-Dhijt6JU.d.ts → Core-BJaLU71Q.d.ts} +2 -2
  51. package/esm/{Core-kYMRW5C1.js → Core-Dz7BAias.js} +7 -4
  52. package/esm/{ModerationContextLimits-ZIlK9n2X.js → ModerationContextLimits-DaFaXt45.js} +26 -7
  53. package/esm/{ReactUpload-BuqLPgNr.d.ts → ReactUpload-BGUkcMpg.d.ts} +1 -1
  54. package/esm/{ReactUpload-CipY3cmO.js → ReactUpload-kSzn3SOj.js} +1 -1
  55. package/{cjs/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts → esm/TestTriggers-dognME9k-PWyIfHMI.d.ts} +1 -2
  56. package/esm/{TestTriggers-DP4m92jg-DhOI4S1V.js → TestTriggers-uL2Ec8Vt-DYbTEJWm.js} +1 -2
  57. package/esm/{UploadController-D-14HWII.js → UploadController--Qz3DP2W.js} +2 -2
  58. package/{cjs/WebhookPayload-D_yWJA9M.d.ts → esm/WebhookPayload-DZadhbAJ.d.ts} +1 -1
  59. package/esm/app.d.ts +4 -4
  60. package/esm/app.js +2 -2
  61. package/esm/elements.d.ts +4 -4
  62. package/esm/elements.js +4 -4
  63. package/esm/{index-CUA-HDNu.d.ts → index-DQUZYLVY.d.ts} +2 -2
  64. package/esm/index.d.ts +3 -3
  65. package/esm/index.js +1 -1
  66. package/esm/react-native.d.ts +2 -2
  67. package/esm/react-native.js +5 -5
  68. package/esm/react.d.ts +4 -4
  69. package/esm/react.js +5 -5
  70. package/esm/server.d.ts +4 -4
  71. package/esm/server.js +2 -2
  72. package/esm/test-inputs.d.ts +1 -1
  73. package/esm/test-inputs.js +1 -1
  74. package/esm/testing.d.ts +36 -7
  75. package/esm/testing.js +64 -17
  76. package/esm/{ui-CgIG3knW.js → ui-B951EpwC.js} +2 -2
  77. package/esm/{ui-BSm_qphN.d.ts → ui-BGywTQ2M.d.ts} +2 -2
  78. package/esm/ui.d.ts +2 -2
  79. package/esm/ui.js +3 -3
  80. package/esm/vue.d.ts +5 -5
  81. package/esm/vue.js +4 -4
  82. package/package.json +1 -1
package/cjs/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
2
+ const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
3
3
  exports.AUTO_PAGING_TO_ARRAY_MAX = require_ModerationContextLimits.AUTO_PAGING_TO_ARRAY_MAX;
4
4
  exports.CALMLENS_ERROR_CODES = require_ModerationContextLimits.CALMLENS_ERROR_CODES;
5
5
  exports.CDN_RESOURCES = require_ModerationContextLimits.CDN_RESOURCES;
@@ -1,5 +1,5 @@
1
- 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, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, 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, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, c as ICON_ATTRIBUTES, d as AssetDisplayOptions, et as getAssetAspectRatio, f as AssetEventHandlers, g as CalmLensMessages, h as UploaderProps, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, m as UploaderDisplayOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as createUploadController } from "./Core-Dhijt6JU.js";
2
- import { i as useCalmLensUpload, n as CalmLensProviderProps, r as UseCalmLensUploadResult, t as CalmLensProvider } from "./ReactUpload-BuqLPgNr.js";
1
+ 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, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, 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, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, c as ICON_ATTRIBUTES, d as AssetDisplayOptions, et as getAssetAspectRatio, f as AssetEventHandlers, g as CalmLensMessages, h as UploaderProps, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, m as UploaderDisplayOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as createUploadController } from "./Core-BJaLU71Q.js";
2
+ import { i as useCalmLensUpload, n as CalmLensProviderProps, r as UseCalmLensUploadResult, t as CalmLensProvider } from "./ReactUpload-BGUkcMpg.js";
3
3
  import { ReactNode } from "react";
4
4
  import { StyleProp, ViewStyle } from "react-native";
5
5
  /** What the uploader asks your picker for. */
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
3
- const require_Core = require("./Core-52DVaX7d.js");
4
- const require_UploadController = require("./UploadController-ChzDPMmm.js");
2
+ const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
3
+ const require_Core = require("./Core-DCnnUsgF.js");
4
+ const require_UploadController = require("./UploadController-CEL3N4Ae.js");
5
5
  const require_FileIcons = require("./FileIcons-Ob003MdS.js");
6
- const require_ReactUpload = require("./ReactUpload-DHuhGYsr.js");
6
+ const require_ReactUpload = require("./ReactUpload-BtmIrdky.js");
7
7
  let react = require("react");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  let react_native = require("react-native");
@@ -412,7 +412,7 @@ function CalmLensAsset(props) {
412
412
  onAvailabilityChange
413
413
  };
414
414
  (0, react.useEffect)(() => session.load());
415
- const base = state.src?.split("?", 1)[0];
415
+ const base = state.src ? require_ModerationContextLimits.assetUrlOf(state.src) : void 0;
416
416
  const previewUrl = base && state.info?.content?.preview ? require_ModerationContextLimits.appendAssetLocation(base, {
417
417
  resource: "preview",
418
418
  viewerClaims
package/cjs/react.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- 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";
2
- import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-BuqLPgNr.js";
3
- import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, o as UseCalmLensUploadResult, 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";
1
+ 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-BJaLU71Q.js";
2
+ import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-BGUkcMpg.js";
3
+ import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, o as UseCalmLensUploadResult, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-CRbCsX7a.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-BGywTQ2M.js";
5
5
  import { CSSProperties, HTMLAttributes, ReactNode } from "react";
6
6
  type ElementProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
7
7
  /** Leaves out the stylesheet the viewers render, so you can style the `calmlens-*` classes. */
package/cjs/react.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_ui = require("./ui-C1_SDSiq.js");
4
- const require_Core = require("./Core-52DVaX7d.js");
5
- const require_UploadController = require("./UploadController-ChzDPMmm.js");
3
+ const require_ui = require("./ui-DVQm0TFJ.js");
4
+ const require_Core = require("./Core-DCnnUsgF.js");
5
+ const require_UploadController = require("./UploadController-CEL3N4Ae.js");
6
6
  const require_FileIcons = require("./FileIcons-Ob003MdS.js");
7
- const require_ReactUpload = require("./ReactUpload-DHuhGYsr.js");
8
- const require_BrowserUpload = require("./BrowserUpload-GQtZti-D.js");
7
+ const require_ReactUpload = require("./ReactUpload-BtmIrdky.js");
8
+ const require_BrowserUpload = require("./BrowserUpload-Dz4UwTTJ.js");
9
9
  let react = require("react");
10
10
  let react_jsx_runtime = require("react/jsx-runtime");
11
11
  const OPTION_NAMES = /* @__PURE__ */ new Set([
package/cjs/server.d.ts CHANGED
@@ -1,8 +1,8 @@
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-DxxyZt2L.js";
3
- import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-CUA-HDNu.js";
4
- 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";
5
- import { t as CalmLensServerClient } from "./CalmLensServerClient-C3kaPLUZ.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-CtO4Dieu.js";
3
+ import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-DQUZYLVY.js";
4
+ 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-DZadhbAJ.js";
5
+ import { t as CalmLensServerClient } from "./CalmLensServerClient-B8ntjNL3.js";
6
6
  export declare const WEBHOOK_DELIVERY_HEADER = "x-calmlens-delivery";
7
7
  export declare const WEBHOOK_TIMESTAMP_HEADER = "x-calmlens-timestamp";
8
8
  export declare const WEBHOOK_SIGNATURE_HEADER = "x-calmlens-signature";
package/cjs/server.js CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
2
+ const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
3
3
  require("./index.js");
4
- const require_CalmLensServerClient = require("./CalmLensServerClient-BYMzGkQK.js");
4
+ const require_CalmLensServerClient = require("./CalmLensServerClient-CQdvhCGg.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;
@@ -1,2 +1,2 @@
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-Dnukm-jm-DoEB7jJc.js";
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-dognME9k-PWyIfHMI.js";
2
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 };
@@ -1,14 +1,14 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_TestTriggers_DP4m92jg = require("./TestTriggers-DP4m92jg-C0HD-A4r.js");
3
- exports.TEST_DETECTIONS_MAX = require_TestTriggers_DP4m92jg.TEST_DETECTIONS_MAX;
4
- exports.TEST_DETECTION_BOX_MAX = require_TestTriggers_DP4m92jg.TEST_DETECTION_BOX_MAX;
5
- exports.TEST_FACE_AGE_MAX = require_TestTriggers_DP4m92jg.TEST_FACE_AGE_MAX;
6
- exports.TEST_FACE_AGE_PRESETS = require_TestTriggers_DP4m92jg.TEST_FACE_AGE_PRESETS;
7
- exports.TEST_INPUT_KEY_PATTERN = require_TestTriggers_DP4m92jg.TEST_INPUT_KEY_PATTERN;
8
- exports.TEST_INPUT_PRESETS = require_TestTriggers_DP4m92jg.TEST_INPUT_PRESETS;
9
- exports.detectTestImage = require_TestTriggers_DP4m92jg.detectTestImage;
10
- exports.detectTestTrigger = require_TestTriggers_DP4m92jg.detectTestTrigger;
11
- exports.generateTestTextCode = require_TestTriggers_DP4m92jg.generateTestTextCode;
12
- exports.getImageTestCategories = require_TestTriggers_DP4m92jg.getImageTestCategories;
13
- exports.paintTestImage = require_TestTriggers_DP4m92jg.paintTestImage;
14
- exports.testInputForSignal = require_TestTriggers_DP4m92jg.testInputForSignal;
2
+ const require_TestTriggers_uL2Ec8Vt = require("./TestTriggers-uL2Ec8Vt-cPmmKvYd.js");
3
+ exports.TEST_DETECTIONS_MAX = require_TestTriggers_uL2Ec8Vt.TEST_DETECTIONS_MAX;
4
+ exports.TEST_DETECTION_BOX_MAX = require_TestTriggers_uL2Ec8Vt.TEST_DETECTION_BOX_MAX;
5
+ exports.TEST_FACE_AGE_MAX = require_TestTriggers_uL2Ec8Vt.TEST_FACE_AGE_MAX;
6
+ exports.TEST_FACE_AGE_PRESETS = require_TestTriggers_uL2Ec8Vt.TEST_FACE_AGE_PRESETS;
7
+ exports.TEST_INPUT_KEY_PATTERN = require_TestTriggers_uL2Ec8Vt.TEST_INPUT_KEY_PATTERN;
8
+ exports.TEST_INPUT_PRESETS = require_TestTriggers_uL2Ec8Vt.TEST_INPUT_PRESETS;
9
+ exports.detectTestImage = require_TestTriggers_uL2Ec8Vt.detectTestImage;
10
+ exports.detectTestTrigger = require_TestTriggers_uL2Ec8Vt.detectTestTrigger;
11
+ exports.generateTestTextCode = require_TestTriggers_uL2Ec8Vt.generateTestTextCode;
12
+ exports.getImageTestCategories = require_TestTriggers_uL2Ec8Vt.getImageTestCategories;
13
+ exports.paintTestImage = require_TestTriggers_uL2Ec8Vt.paintTestImage;
14
+ exports.testInputForSignal = require_TestTriggers_uL2Ec8Vt.testInputForSignal;
package/cjs/testing.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { Fn as AssetBinaryPayloadInput, Ft as SignUploadTokenOptions, Lt as SignedUploadToken, O as CalmLensAppClientOptions, _n as Folder, gn as PermissionGrant, k as CalmLensServerClientOptions, ln as TypedEvent, m as AssetModeration, r as Asset } from "./CalmLensTypes-DxxyZt2L.js";
2
- import { t as CalmLensAppClient } from "./CalmLensAppClient-Btp8f-34.js";
3
- import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-D_yWJA9M.js";
4
- import { t as CalmLensServerClient } from "./CalmLensServerClient-C3kaPLUZ.js";
5
- import { t as ClassificationTestSignal } from "./TestTriggers-Dnukm-jm-DoEB7jJc.js";
1
+ import { Fn as AssetBinaryPayloadInput, Ft as SignUploadTokenOptions, Lt as SignedUploadToken, O as CalmLensAppClientOptions, _n as Folder, gn as PermissionGrant, k as CalmLensServerClientOptions, ln as TypedEvent, m as AssetModeration, r as Asset } from "./CalmLensTypes-CtO4Dieu.js";
2
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-B3u6BlP5.js";
3
+ import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-DZadhbAJ.js";
4
+ import { t as CalmLensServerClient } from "./CalmLensServerClient-B8ntjNL3.js";
5
+ import { t as ClassificationTestSignal } from "./TestTriggers-dognME9k-PWyIfHMI.js";
6
6
  import "zod";
7
7
  /**
8
8
  * Signs a single-use upload token with `apiKey`, locally. `CalmLensServerClient` and
@@ -64,6 +64,15 @@ declare const MOCK_CATEGORIES: readonly ["sexual", "violence", "self-harm", "har
64
64
  */
65
65
  type MockAssetOutcome = "pending" | "failed" | "allowed" | "limited" | "age-restricted" | "blocked" | "purged";
66
66
  type Category = (typeof MOCK_CATEGORIES)[number];
67
+ type EvaluatedFeature<K extends "ocr" | "linkDetection"> = Extract<NonNullable<Asset["classification"][K]>, {
68
+ status: "evaluated";
69
+ }>;
70
+ /** A region of text OCR found, as `classification.ocr.textRegions` reports one. */
71
+ type MockTextRegion = EvaluatedFeature<"ocr">["textRegions"][number];
72
+ /** A QR code link detection decoded, as `classification.linkDetection.qrCodes` reports one. */
73
+ type MockQrCode = EvaluatedFeature<"linkDetection">["qrCodes"][number];
74
+ /** A link found in an image's text or QR codes, as `classification.linkDetection.links` reports one. */
75
+ type MockDetectedLink = EvaluatedFeature<"linkDetection">["links"][number];
67
76
  /** Why a decision waits for human review: `sampled`, or `uncertain` about some categories. */
68
77
  type MockPendingReviewReason = "sampled" | "uncertain";
69
78
  /**
@@ -90,6 +99,26 @@ export declare class MockDecision {
90
99
  * decision (`decide` on the mock) clears it; `assets.decide` doesn't, as with the API.
91
100
  */
92
101
  pendingReview(reason: MockPendingReviewReason, uncertainCategories?: Category[]): this;
102
+ /**
103
+ * The text OCR finds in an image, for an upload that turns OCR on: `classification.ocr` reports
104
+ * `textRegions`, and `content.extractedText` holds `text` when the upload keeps its content.
105
+ */
106
+ withOcr(text: string | null, textRegions?: MockTextRegion[]): this;
107
+ /**
108
+ * The QR codes and links link detection finds in an image, reported as
109
+ * `classification.linkDetection` unless the upload turns link detection off.
110
+ */
111
+ withLinkDetection(qrCodes?: MockQrCode[], links?: MockDetectedLink[]): this;
112
+ /** @internal What `withOcr` set, if anything. */
113
+ get ocrFindings(): {
114
+ text: string | null;
115
+ textRegions: MockTextRegion[];
116
+ } | undefined;
117
+ /** @internal What `withLinkDetection` set, if anything. */
118
+ get linkFindings(): {
119
+ qrCodes: MockQrCode[];
120
+ links: MockDetectedLink[];
121
+ } | undefined;
93
122
  /**
94
123
  * The report a decided asset gets, as the API sends it: every category (unflagged ones
95
124
  * evaluated with score 0), policy-adjusted results and the automated status and
@@ -271,7 +300,7 @@ interface MockCalmLensServerClientOptions extends Omit<CalmLensServerClientOptio
271
300
  /**
272
301
  * Returns a new ID for an object of the kind `prefix` names (`asset`, `fldr`, `hl`, `hle`,
273
302
  * `lens`, `evt` or `rev`). The default is like the API's: the prefix, `_` and 20 random
274
- * base62 characters, such as `asset_5Gm2Rk8XqT3wLp9VbN4c`.
303
+ * base62 characters, such as `asset_e5Gm2Rk8XqT3wLp9VbN4`.
275
304
  */
276
305
  createId?: (prefix: IdPrefix) => string;
277
306
  /**
@@ -401,4 +430,4 @@ export declare const createWebhookHeaders: (options: {
401
430
  deliveryId: string;
402
431
  timestampSeconds?: number;
403
432
  }) => Promise<Record<string, string>>;
404
- export { type MockAssetOutcome, type MockCalmLensAppClientOptions, type MockCalmLensCall, type MockCalmLensOperation, type MockCalmLensServerClientOptions, type MockDatabaseStorage, type MockEventInput, type MockFailureOptions, type MockImageStorage, type MockModerate, type MockModerationInput, type MockModerationTrigger, type MockRequestFailure, type MockReviewDecision, type MockStoredContent, type MockUploadPreset, signUploadTokenWithApiKey as signUploadToken };
433
+ export { type MockAssetOutcome, type MockCalmLensAppClientOptions, type MockCalmLensCall, type MockCalmLensOperation, type MockCalmLensServerClientOptions, type MockDatabaseStorage, type MockDetectedLink, type MockEventInput, type MockFailureOptions, type MockImageStorage, type MockModerate, type MockModerationInput, type MockModerationTrigger, type MockQrCode, type MockRequestFailure, type MockReviewDecision, type MockStoredContent, type MockTextRegion, type MockUploadPreset, signUploadTokenWithApiKey as signUploadToken };
package/cjs/testing.js CHANGED
@@ -1,15 +1,15 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_TestTriggers_DP4m92jg = require("./TestTriggers-DP4m92jg-C0HD-A4r.js");
3
- const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
4
- const require_CalmLensServerClient = require("./CalmLensServerClient-BYMzGkQK.js");
5
- const require_CalmLensOptionKeys = require("./CalmLensOptionKeys--gTpTkwt.js");
2
+ const require_TestTriggers_uL2Ec8Vt = require("./TestTriggers-uL2Ec8Vt-cPmmKvYd.js");
3
+ const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
4
+ const require_CalmLensServerClient = require("./CalmLensServerClient-CQdvhCGg.js");
5
+ const require_CalmLensOptionKeys = require("./CalmLensOptionKeys-Cat8CgOn.js");
6
6
  const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.js");
7
- const require_CalmLensAppClient = require("./CalmLensAppClient-Bwt3gP0C.js");
8
- const require_UploadController = require("./UploadController-ChzDPMmm.js");
7
+ const require_CalmLensAppClient = require("./CalmLensAppClient-B0QZ1oJV.js");
8
+ const require_UploadController = require("./UploadController-CEL3N4Ae.js");
9
9
  let zod = require("zod");
10
- zod = require_TestTriggers_DP4m92jg.__toESM(zod, 1);
10
+ zod = require_TestTriggers_uL2Ec8Vt.__toESM(zod, 1);
11
11
  // src/contract/MediaTestTriggers.js
12
- const MEDIA_TEST_SIGNALS = [...require_TestTriggers_DP4m92jg.CLASSIFICATION_CATEGORIES, "violence.graphic"];
12
+ const MEDIA_TEST_SIGNALS = [...require_TestTriggers_uL2Ec8Vt.CLASSIFICATION_CATEGORIES, "violence.graphic"];
13
13
  const HEX_WORDS = [
14
14
  "zero",
15
15
  "one",
@@ -31,7 +31,7 @@ const HEX_WORDS = [
31
31
  /** Read this aloud, or render it as large, high-contrast text in a video frame. */
32
32
  async function generateMediaTestCode(signal, testInputKey) {
33
33
  if (!MEDIA_TEST_SIGNALS.includes(signal)) throw new RangeError("Unsupported media test signal");
34
- return `Calm Lens test ${[...await require_TestTriggers_DP4m92jg.getTestInputTag("media", signal, testInputKey)].map((character) => HEX_WORDS[Number.parseInt(character, 16)]).join(" ")} ${signal.replace(/[.-]/g, " ")} end test`;
34
+ return `Calm Lens test ${[...await require_TestTriggers_uL2Ec8Vt.getTestInputTag("media", signal, testInputKey)].map((character) => HEX_WORDS[Number.parseInt(character, 16)]).join(" ")} ${signal.replace(/[.-]/g, " ")} end test`;
35
35
  }
36
36
  /**
37
37
  * The character an asset ID starts with (after `asset_`) to say the region it lives in: the asset
@@ -8086,7 +8086,7 @@ const PERMISSION_ACTIONS = [
8086
8086
  "reviews:write",
8087
8087
  "project:manage"
8088
8088
  ];
8089
- const ACTION_SCHEMA = /* @__PURE__ */ require_TestTriggers_DP4m92jg.lazySchema(() => zod.enum(PERMISSION_ACTIONS));
8089
+ const ACTION_SCHEMA = /* @__PURE__ */ require_TestTriggers_uL2Ec8Vt.lazySchema(() => zod.enum(PERMISSION_ACTIONS));
8090
8090
  const PROJECT_ACTIONS = [...[
8091
8091
  "settings",
8092
8092
  "members",
@@ -8102,12 +8102,12 @@ const PROJECT_ACTIONS = [...[
8102
8102
  const isProjectAction = (action) => PROJECT_ACTIONS.includes(action);
8103
8103
  /** The actions that include `action`: its feature's write action and project:manage. */
8104
8104
  const actionsImplying = (action) => !isProjectAction(action) || action === "project:manage" ? [] : action.endsWith(":read") ? [action.replace(/:read$/, ":write"), "project:manage"] : ["project:manage"];
8105
- const GRANT_SCHEMA = /* @__PURE__ */ require_TestTriggers_DP4m92jg.lazySchema(() => zod.object({
8105
+ const GRANT_SCHEMA = /* @__PURE__ */ require_TestTriggers_uL2Ec8Vt.lazySchema(() => zod.object({
8106
8106
  actions: zod.array(ACTION_SCHEMA),
8107
8107
  folderId: idField("fldr").nullable(),
8108
8108
  includeSubfolders: zod.boolean()
8109
8109
  }).strict().refine((g) => g.folderId === null || !g.actions.some(isProjectAction), "Project configuration permissions require project scope"));
8110
- const GRANTS_SCHEMA = /* @__PURE__ */ require_TestTriggers_DP4m92jg.lazySchema(() => zod.array(GRANT_SCHEMA).max(100));
8110
+ const GRANTS_SCHEMA = /* @__PURE__ */ require_TestTriggers_uL2Ec8Vt.lazySchema(() => zod.array(GRANT_SCHEMA).max(100));
8111
8111
  [...PERMISSION_ACTIONS.filter((a) => !isProjectAction(a))];
8112
8112
  [...PERMISSION_ACTIONS.filter((a) => !isProjectAction(a))];
8113
8113
  const permits = (grants, action, folderId, folders) => grants.some((grant) => {
@@ -8339,6 +8339,8 @@ var MockDecision = class {
8339
8339
  #flags = /* @__PURE__ */ new Map();
8340
8340
  #notEvaluated = /* @__PURE__ */ new Set();
8341
8341
  #pendingReview;
8342
+ #ocr;
8343
+ #linkDetection;
8342
8344
  constructor(status) {
8343
8345
  if (!OUTCOMES.includes(status)) throw require_ModerationContextLimits.invalidArgument(`status must be one of ${OUTCOMES.join(", ")}`);
8344
8346
  this.status = status;
@@ -8388,6 +8390,36 @@ var MockDecision = class {
8388
8390
  };
8389
8391
  return this;
8390
8392
  }
8393
+ /**
8394
+ * The text OCR finds in an image, for an upload that turns OCR on: `classification.ocr` reports
8395
+ * `textRegions`, and `content.extractedText` holds `text` when the upload keeps its content.
8396
+ */
8397
+ withOcr(text, textRegions = []) {
8398
+ this.#ocr = {
8399
+ text,
8400
+ textRegions: structuredClone(textRegions)
8401
+ };
8402
+ return this;
8403
+ }
8404
+ /**
8405
+ * The QR codes and links link detection finds in an image, reported as
8406
+ * `classification.linkDetection` unless the upload turns link detection off.
8407
+ */
8408
+ withLinkDetection(qrCodes = [], links = []) {
8409
+ this.#linkDetection = {
8410
+ qrCodes: structuredClone(qrCodes),
8411
+ links: structuredClone(links)
8412
+ };
8413
+ return this;
8414
+ }
8415
+ /** @internal What `withOcr` set, if anything. */
8416
+ get ocrFindings() {
8417
+ return this.#ocr && structuredClone(this.#ocr);
8418
+ }
8419
+ /** @internal What `withLinkDetection` set, if anything. */
8420
+ get linkFindings() {
8421
+ return this.#linkDetection && structuredClone(this.#linkDetection);
8422
+ }
8391
8423
  #checkCategory(category) {
8392
8424
  if (!MOCK_CATEGORIES.includes(category)) throw require_ModerationContextLimits.invalidArgument(`${category} is not a CalmLens category`);
8393
8425
  }
@@ -9557,7 +9589,7 @@ const MOCK_PRESET_NAMES = {
9557
9589
  * personal information and profanity, `block` otherwise) and no rules. The mock holds no built-in
9558
9590
  * preset settings, and uploads are never decided by a policy.
9559
9591
  */
9560
- const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require_TestTriggers_DP4m92jg.CLASSIFICATION_CATEGORIES.map((category) => [category, {
9592
+ const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require_TestTriggers_uL2Ec8Vt.CLASSIFICATION_CATEGORIES.map((category) => [category, {
9561
9593
  action: category === "personal-information" || category === "profanity" ? "allow" : "block",
9562
9594
  allowances: [],
9563
9595
  restrictions: []
@@ -9569,13 +9601,13 @@ const mockPresetSettings = () => ({ categorySettings: Object.fromEntries(require
9569
9601
  const checkPolicySettings = (settings) => {
9570
9602
  const categories = settings?.categorySettings;
9571
9603
  if (!categories || typeof categories !== "object") throw invalidField("validation/invalid-type", "settings.categorySettings");
9572
- for (const category of require_TestTriggers_DP4m92jg.CLASSIFICATION_CATEGORIES) {
9604
+ for (const category of require_TestTriggers_uL2Ec8Vt.CLASSIFICATION_CATEGORIES) {
9573
9605
  const value = categories[category];
9574
9606
  if (!value || typeof value !== "object") throw invalidField("validation/invalid-type", `settings.categorySettings.${category}`);
9575
9607
  for (const key of ["allowances", "restrictions"]) if (!Array.isArray(value[key])) throw invalidField("validation/invalid-type", `settings.categorySettings.${category}.${key}`);
9576
9608
  if (typeof value.action !== "string") throw invalidField("validation/invalid-value", `settings.categorySettings.${category}.action`);
9577
9609
  }
9578
- for (const key of Object.keys(categories)) if (!require_TestTriggers_DP4m92jg.CLASSIFICATION_CATEGORIES.includes(key)) throw invalidField("validation/unknown-field", `settings.categorySettings.${key}`);
9610
+ for (const key of Object.keys(categories)) if (!require_TestTriggers_uL2Ec8Vt.CLASSIFICATION_CATEGORIES.includes(key)) throw invalidField("validation/unknown-field", `settings.categorySettings.${key}`);
9579
9611
  };
9580
9612
  /** The client methods that send a request, the one it is recorded under first. */
9581
9613
  const operationsOf = (request) => {
@@ -10471,17 +10503,21 @@ var MockCalmLensApi = class {
10471
10503
  }
10472
10504
  /**
10473
10505
  * Signs an asset URL like the API (`POST /projects/:projectId/signed-asset-urls`): a grant to one
10474
- * asset, by ID or external ID, until it expires, serving the original only when asked. The mock's
10506
+ * asset, by ID or external ID, until it expires, ending in the resource it was signed for and
10507
+ * serving the original only when signed for it. The mock's
10475
10508
  * grant is readable (its asset, original access and expiry), unlike the CDN's, and only the
10476
10509
  * mock's CDN accepts it.
10477
10510
  */
10478
10511
  async signAssetUrl(body) {
10479
- for (const key of [
10512
+ const fields = [
10480
10513
  "assetId",
10481
10514
  "externalId",
10482
10515
  "expiresIn",
10483
- "original"
10484
- ]) if (body[key] === null) throw invalidField("validation/invalid-type", key);
10516
+ "resource"
10517
+ ];
10518
+ const unknown = Object.keys(body).find((key) => !fields.includes(key));
10519
+ if (unknown !== void 0) throw invalidField("validation/unknown-field", unknown);
10520
+ for (const key of fields) if (body[key] === null) throw invalidField("validation/invalid-type", key);
10485
10521
  const { assetId, externalId } = body;
10486
10522
  if (assetId === void 0 === (externalId === void 0)) throw new ApiFailure(400, require_ModerationContextLimits.API_ERROR_CODES.INVALID_REQUEST, "Send either assetId or externalId", { issues: [{
10487
10523
  path: "",
@@ -10492,8 +10528,8 @@ var MockCalmLensApi = class {
10492
10528
  if (typeof expiresIn !== "number" || !Number.isInteger(expiresIn)) throw invalidField("validation/invalid-type", "expiresIn");
10493
10529
  if (expiresIn < 1) throw invalidField("validation/too-small", "expiresIn");
10494
10530
  if (expiresIn > 86400) throw invalidField("validation/too-big", "expiresIn");
10495
- const original = body.original ?? false;
10496
- if (typeof original !== "boolean") throw invalidField("validation/invalid-type", "original");
10531
+ const { resource } = body;
10532
+ if (resource !== void 0 && (typeof resource !== "string" || !Object.hasOwn(require_ModerationContextLimits.ASSET_RESOURCE_PATHS, resource))) throw invalidField("validation/invalid-value", "resource");
10497
10533
  let asset;
10498
10534
  if (externalId !== void 0) {
10499
10535
  asset = (await this.databaseStorage.listAssets(this.projectId)).find((candidate) => candidate.externalId === externalId);
@@ -10503,11 +10539,12 @@ var MockCalmLensApi = class {
10503
10539
  const expiresAt = this.now() + expiresIn * 1e3;
10504
10540
  const grant = encodeMockGrant({
10505
10541
  assetId: asset.id,
10506
- original,
10542
+ original: resource === "original",
10507
10543
  expiresAt
10508
10544
  });
10545
+ const path = resource === void 0 ? "" : `/${require_ModerationContextLimits.ASSET_RESOURCE_PATHS[resource]}`;
10509
10546
  return {
10510
- url: `${this.cdnBaseUrl}/assets/${encodeURIComponent(this.projectId)}/${grant}`,
10547
+ url: `${this.cdnBaseUrl}/assets/${encodeURIComponent(this.projectId)}/${grant}${path}`,
10511
10548
  expiresAt
10512
10549
  };
10513
10550
  }
@@ -10929,18 +10966,28 @@ var MockCalmLensApi = class {
10929
10966
  const next = await this.applyOutcome(asset, decision.status, "policy", decision.report(this.now()));
10930
10967
  const features = this.processingOptions.get(asset.id)?.features;
10931
10968
  if (next.classification.status !== "completed" || asset.type !== "image") return next;
10969
+ const ocr = features?.ocr?.enabled === true ? decision.ocrFindings : void 0;
10932
10970
  return {
10933
10971
  ...next,
10972
+ ...ocr?.text != null && next.content.status === "stored" && { content: {
10973
+ ...next.content,
10974
+ extractedText: {
10975
+ type: "string",
10976
+ content: ocr.text
10977
+ }
10978
+ } },
10934
10979
  classification: {
10935
10980
  ...next.classification,
10936
10981
  ...features?.ocr?.enabled === true && { ocr: {
10937
10982
  status: "evaluated",
10938
- textRegions: []
10983
+ textRegions: ocr?.textRegions ?? []
10939
10984
  } },
10940
10985
  ...features?.linkDetection?.enabled !== false && { linkDetection: {
10941
10986
  status: "evaluated",
10942
- qrCodes: [],
10943
- links: []
10987
+ ...decision.linkFindings ?? {
10988
+ qrCodes: [],
10989
+ links: []
10990
+ }
10944
10991
  } },
10945
10992
  ...features?.personDetection?.enabled === true && { personDetection: {
10946
10993
  status: "evaluated",
@@ -1,5 +1,5 @@
1
- import "./CalmLensTypes-DxxyZt2L.js";
2
- import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-Dhijt6JU.js";
1
+ import "./CalmLensTypes-CtO4Dieu.js";
2
+ import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-BJaLU71Q.js";
3
3
  import "pdfjs-dist";
4
4
  /** A viewer mounted into an element, which it owns the children of. */
5
5
  interface AssetViewer<O extends ViewerOptions = ViewerOptions> {
@@ -1,5 +1,5 @@
1
- const require_ModerationContextLimits = require("./ModerationContextLimits-DJyIjzIn.js");
2
- require("./Core-52DVaX7d.js");
1
+ const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
2
+ require("./Core-DCnnUsgF.js");
3
3
  // src/ui/viewers/PdfLoader.ts
4
4
  let loading;
5
5
  /**
package/cjs/ui.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- 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, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, 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, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, 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, z as createUploadController } from "./Core-Dhijt6JU.js";
2
- 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";
1
+ 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, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, 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, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, 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, z as createUploadController } from "./Core-BJaLU71Q.js";
2
+ 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-BGywTQ2M.js";
3
3
  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 };
package/cjs/ui.js CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ui = require("./ui-C1_SDSiq.js");
3
- const require_Core = require("./Core-52DVaX7d.js");
4
- const require_UploadController = require("./UploadController-ChzDPMmm.js");
2
+ const require_ui = require("./ui-DVQm0TFJ.js");
3
+ const require_Core = require("./Core-DCnnUsgF.js");
4
+ const require_UploadController = require("./UploadController-CEL3N4Ae.js");
5
5
  exports.ASSET_FILE_ICON_SIZE = require_Core.ASSET_FILE_ICON_SIZE;
6
6
  exports.ASSET_VIEWERS = require_ui.ASSET_VIEWERS;
7
7
  exports.AssetSession = require_Core.AssetSession;
package/cjs/vue.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-DxxyZt2L.js";
2
- import "./index-CUA-HDNu.js";
3
- 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";
4
- import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-CdOfuIcV.js";
5
- 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";
1
+ import { O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-CtO4Dieu.js";
2
+ import "./index-DQUZYLVY.js";
3
+ 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-BJaLU71Q.js";
4
+ import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-CRbCsX7a.js";
5
+ 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-BGywTQ2M.js";
6
6
  import { App, MaybeRefOrGetter, PropType, ShallowRef } from "vue";
7
7
  /** Shows a text asset's text, escaped, in a scrolling region. */
8
8
  export declare const CalmLensTextViewer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
package/cjs/vue.js CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ui = require("./ui-C1_SDSiq.js");
3
- const require_Core = require("./Core-52DVaX7d.js");
4
- const require_UploadController = require("./UploadController-ChzDPMmm.js");
2
+ const require_ui = require("./ui-DVQm0TFJ.js");
3
+ const require_Core = require("./Core-DCnnUsgF.js");
4
+ const require_UploadController = require("./UploadController-CEL3N4Ae.js");
5
5
  const require_FileIcons = require("./FileIcons-Ob003MdS.js");
6
- const require_BrowserUpload = require("./BrowserUpload-GQtZti-D.js");
6
+ const require_BrowserUpload = require("./BrowserUpload-Dz4UwTTJ.js");
7
7
  let vue = require("vue");
8
8
  // src/viewers/Vue.ts
9
9
  const optional$1 = (type) => ({
@@ -1,5 +1,5 @@
1
- import { F as UploadFile, I as UploadItem$1, L as UploadSnapshot$1, N as UploadController, P as UploadControllerOptions$1, h as UploaderProps$1, k as CalmLensUpload$1 } from "./Core-Dhijt6JU.js";
2
- import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-BuqLPgNr.js";
1
+ import { F as UploadFile, I as UploadItem$1, L as UploadSnapshot$1, N as UploadController, P as UploadControllerOptions$1, h as UploaderProps$1, k as CalmLensUpload$1 } from "./Core-BJaLU71Q.js";
2
+ import { r as UseCalmLensUploadResult$1 } from "./ReactUpload-BGUkcMpg.js";
3
3
  type UploadItem<F extends UploadFile = File> = UploadItem$1<F>;
4
4
  type CalmLensUpload<F extends UploadFile = File> = CalmLensUpload$1<F>;
5
5
  type UploadSnapshot<F extends UploadFile = File> = UploadSnapshot$1<F>;
@@ -1,4 +1,4 @@
1
- import { n as createUploadController$1 } from "./UploadController-D-14HWII.js";
1
+ import { n as createUploadController$1 } from "./UploadController--Qz3DP2W.js";
2
2
  // src/ui/BrowserUpload.ts
3
3
  /** Creates an upload queue for the browser components, such as one a form starts on submit. */
4
4
  const createUploadController = (options) => createUploadController$1(options);
@@ -1,5 +1,5 @@
1
- import { S as validateAppClientOptions, ct as invalidConfig, d as checkOptionKeys, o as buildAssetUrl, p as encodePathSegment, st as invalidArgument, u as DEFAULT_CDN_BASE_URL } from "./ModerationContextLimits-ZIlK9n2X.js";
2
- import { d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, p as splitsIntoParts, s as expectUploadedAsset, t as APP_OPTION_KEYS } from "./CalmLensOptionKeys-CKZs8i3_.js";
1
+ import { T as validateAppClientOptions, dt as invalidConfig, g as encodePathSegment, l as buildAssetUrl, m as checkOptionKeys, p as DEFAULT_CDN_BASE_URL, ut as invalidArgument } from "./ModerationContextLimits-DaFaXt45.js";
2
+ import { d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, p as splitsIntoParts, s as expectUploadedAsset, t as APP_OPTION_KEYS } from "./CalmLensOptionKeys-BYqFZ0FP.js";
3
3
  // src/client/CalmLensAppClient.ts
4
4
  const inspectSymbol = Symbol.for("nodejs.util.inspect.custom");
5
5
  /** `options`, once `checkOptionKeys` finds only keys `operation` takes. */
@@ -1,4 +1,4 @@
1
- import { At as RetrieveAssetOptions, M as CdnAssetUrlOptions, O as CalmLensAppClientOptions, Ot as RequestOptions, Qt as UploadedAsset, Zt as UploadPresetSubmitAssetOptions, qt as UploadAssetPartOptions } from "./CalmLensTypes-DxxyZt2L.js";
1
+ import { At as RetrieveAssetOptions, M as CdnAssetUrlOptions, O as CalmLensAppClientOptions, Ot as RequestOptions, Qt as UploadedAsset, Zt as UploadPresetSubmitAssetOptions, qt as UploadAssetPartOptions } from "./CalmLensTypes-CtO4Dieu.js";
2
2
  declare const inspectSymbol: unique symbol;
3
3
  declare class CalmLensAppClient {
4
4
  #private;
@@ -1,4 +1,4 @@
1
- import { B as resolveLogLevel, D as MAX_IMAGE_UPLOAD_BYTES, E as MAX_DIRECT_IMAGE_UPLOAD_BYTES, M as sleep, O as MAX_NON_IMAGE_UPLOAD_BYTES, Y as CalmLensError, _ as randomUuid, j as CalmLensTransport, k as getRejectedUploadMimeTypeError, lt as API_ERROR_CODES, m as isAcceptedUploadMimeType, ot as SDK_ERROR_CODES, r as selectModerationContextItems, st as invalidArgument, y as stringifyQuery } from "./ModerationContextLimits-ZIlK9n2X.js";
1
+ import { A as MAX_IMAGE_UPLOAD_BYTES, F as sleep, M as getRejectedUploadMimeTypeError, P as CalmLensTransport, Q as CalmLensError, S as stringifyQuery, U as resolveLogLevel, _ as isAcceptedUploadMimeType, b as randomUuid, ft as API_ERROR_CODES, j as MAX_NON_IMAGE_UPLOAD_BYTES, k as MAX_DIRECT_IMAGE_UPLOAD_BYTES, lt as SDK_ERROR_CODES, r as selectModerationContextItems, ut as invalidArgument } from "./ModerationContextLimits-DaFaXt45.js";
2
2
  // src/contract/AssetPayload.js
3
3
  const bufferInputToBytes = (value) => {
4
4
  if (value instanceof ArrayBuffer) return new Uint8Array(value);
@@ -746,9 +746,9 @@ const SERVER_OPTION_KEYS = {
746
746
  "expiresIn",
747
747
  "externalId",
748
748
  "lens",
749
- "original",
750
749
  "projectId",
751
750
  "resource",
751
+ "resource",
752
752
  "transform",
753
753
  "viewerClaims"
754
754
  ],